Skip to content
This repository has been archived by the owner on May 23, 2023. It is now read-only.

Commit

Permalink
improve the legend panel
Browse files Browse the repository at this point in the history
  • Loading branch information
takashi310 committed Aug 25, 2021
1 parent b491cb7 commit 3be8c98
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 11 deletions.
8 changes: 4 additions & 4 deletions fluorender/FluoRender/DataManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ VolumeData::VolumeData()
m_clip_dist_z = 0;

//legend
m_legend = true;
m_legend = false;
//interpolate
m_interpolate = true;

Expand Down Expand Up @@ -476,7 +476,7 @@ VolumeData* VolumeData::DeepCopy(VolumeData &copy, bool use_default_settings, Da
vd->m_skip_brick = false;

//legend
vd->m_legend = true;
vd->m_legend = false;

//interpolate
vd->m_interpolate = copy.m_interpolate;
Expand Down Expand Up @@ -3518,7 +3518,7 @@ VolumeData* VolumeData::CopyLevel(int lv)
vd->m_skip_brick = false;

//legend
vd->m_legend = true;
vd->m_legend = false;

vd->m_annotation = m_annotation;

Expand Down Expand Up @@ -4172,7 +4172,7 @@ m_data(0),
Color color(HSVColor(hue, sat, val));
m_mat_diff = color;

m_legend = true;
m_legend = false;

m_swc = false;
m_r_scale = 1.0;
Expand Down
2 changes: 1 addition & 1 deletion fluorender/FluoRender/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ bool VRenderApp::OnInit()
std::string(VERSION_MAJOR_TAG) + std::string(".") +
std::string(VERSION_MINOR_TAG);
*/
std::string title = std::string(FLUORENDER_TITLE) + "1.3.5";
std::string title = std::string(FLUORENDER_TITLE) + "1.3.6";

m_frame = new VRenderFrame(
this,
Expand Down
18 changes: 17 additions & 1 deletion fluorender/FluoRender/VRenderFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5197,7 +5197,23 @@ void VRenderFrame::OpenProject(wxString& filename)
if (fconfig.Read("draw_legend", &bVal))
{
vrv->m_glview->m_draw_legend = bVal;
vrv->m_legend_chk->SetValue(bVal);
if (!bVal)
{
int vnum = vrv->GetAllVolumeNum();
for (int vid = 0; vid < vnum; vid++)
{
VolumeData* vd = vrv->GetAllVolumeData(vid);
if (vd)
vd->SetLegend(false);
}
int mnum = vrv->GetMeshNum();
for (int mid = 0; mid < mnum; mid++)
{
MeshData* md = vrv->GetMeshData(mid);
if (md)
md->SetLegend(false);
}
}
}

//camera
Expand Down
11 changes: 6 additions & 5 deletions fluorender/FluoRender/VRenderView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ VRenderVulkanView::VRenderVulkanView(wxWindow* frame,
m_draw_frame(false),
m_test_speed(false),
m_draw_clip(false),
m_draw_legend(false),
m_draw_legend(true),
m_mouse_focus(false),
m_test_wiref(false),
m_draw_rulers(true),
Expand Down Expand Up @@ -17589,7 +17589,7 @@ void LegendListCtrl::OnLeftDown(wxMouseEvent& event)
else
CheckItem(item, true);
}
event.Skip(true);
event.Skip(false);
}

void LegendListCtrl::OnScroll(wxScrollWinEvent& event)
Expand Down Expand Up @@ -17825,7 +17825,8 @@ void VRenderView::CreateBar()
m_fps_chk->SetValue(false);
m_legend_chk = new wxCheckBox(this, ID_LegendChk, "",
wxDefaultPosition, wxSize(-1, 20));
m_legend_chk->SetValue(false);
m_legend_chk->SetValue(true);
m_legend_chk->Hide();
m_legend_btn = new wxButton(this, ID_LegendBtn, "Legend",
wxDefaultPosition, wxSize(60, 20));
m_legend_list = NULL;
Expand Down Expand Up @@ -17892,7 +17893,7 @@ void VRenderView::CreateBar()
sizer_h_1->Add(5, 5, 0);
sizer_h_1->Add(m_legend_chk, 0, wxALIGN_CENTER);
sizer_h_1->Add(m_legend_btn, 0, wxALIGN_CENTER);
m_legend_btn->Disable();
//m_legend_btn->Disable();
sizer_h_1->Add(10, 5, 0);
sizer_h_1->Add(m_intp_chk, 0, wxALIGN_CENTER);
sizer_h_1->Add(5, 5, 0);
Expand Down Expand Up @@ -19768,7 +19769,7 @@ void VRenderView::LoadSettings()
if (fconfig.Read("legend_chk", &bVal))
{
m_legend_chk->SetValue(bVal);
m_glview->m_draw_legend = bVal;
m_glview->m_draw_legend = true;
}
if (fconfig.Read("search_chk", &bVal))
{
Expand Down

0 comments on commit 3be8c98

Please sign in to comment.