Skip to content

Commit

Permalink
Merge pull request #49 from jilei-hao/dev/issue#42
Browse files Browse the repository at this point in the history
Dev/issue#42: Multi-Component display mode in context menu
  • Loading branch information
jilei-hao authored Oct 11, 2022
2 parents 8fb81e7 + 6096907 commit 888353b
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions GUI/Model/LayerTableRowModel.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,8 @@ void ImageLayerTableRowModel::UpdateDisplayModeList()
if(m_Layer && m_ImageLayer->GetNumberOfComponents() > 1)
{
for(std::size_t i = 0; i < m_ImageLayer->GetNumberOfComponents(); i++)
m_AvailableDisplayModes.push_back(
MultiChannelDisplayMode(false, false, SCALAR_REP_COMPONENT, i));
m_AvailableDisplayModes.push_back(MultiChannelDisplayMode(false, false, SCALAR_REP_COMPONENT, i));

m_AvailableDisplayModes.push_back(
MultiChannelDisplayMode(false, false, SCALAR_REP_MAGNITUDE, 0));
m_AvailableDisplayModes.push_back(
Expand Down Expand Up @@ -297,16 +297,16 @@ ImageLayerTableRowModel::CheckState(UIState state)
void
ImageLayerTableRowModel::Initialize(GlobalUIModel *parentModel, WrapperBase *layer)
{
// Initialize superclass first
Superclass::Initialize(parentModel, layer);

// Downcast wrapper. It has to be a ImageWrapperBase or raise error
ImageWrapperBase *img_wrapper = static_cast<ImageWrapperBase*>(layer);
m_ImageLayer = img_wrapper;

// Update the list of display modes (again, should not change during the
// lifetime of this object
UpdateDisplayModeList();

// At the end, call parent initialize
Superclass::Initialize(parentModel, layer);
}

void
Expand Down Expand Up @@ -597,12 +597,11 @@ ::MeshLayerTableRowModel()
void
MeshLayerTableRowModel::Initialize(GlobalUIModel *parentModel, WrapperBase *layer)
{
Superclass::Initialize(parentModel, layer);

// Downcast wrapper. It has to be a MeshWrapperBase or raise error
MeshWrapperBase *mesh_wrapper = static_cast<MeshWrapperBase*>(layer);
m_MeshLayer = mesh_wrapper;

// In the end, call parent initialize
Superclass::Initialize(parentModel, layer);
}

bool
Expand Down Expand Up @@ -705,7 +704,7 @@ void
MeshLayerTableRowModel::UpdateRoleInfo()
{
m_LayerRole = MESH_ROLE;
m_LayerPositionInRole = m_MeshLayer->GetUniqueId();
m_LayerPositionInRole = m_Layer->GetUniqueId();
m_LayerNumberOfLayersInRole = m_ImageData->GetMeshLayers()->size();
}

Expand Down

0 comments on commit 888353b

Please sign in to comment.