Commit 13dec703 authored by T.J. Corona's avatar T.J. Corona
Browse files

qtSelectionManager: add toggle for mesh selection.

parent 90095c6e
......@@ -40,6 +40,7 @@ namespace smtk
m_mask |= smtk::model::FACE;
m_mask |= smtk::model::EDGE;
m_mask |= smtk::model::VERTEX;
this->m_filterMeshes = true;
this->m_modelMgr = nullptr;
this->m_selectionModifier = SelectionModifier::SELECTION_DEFAULT;
}
......@@ -62,8 +63,10 @@ namespace smtk
this->clearAllSelections();
this->filterEntitySelectionsByMask(const_cast<smtk::common::UUIDs &>
(selEntities), this->m_selEntities);
this->m_selMeshes.insert(selMeshes.begin(),selMeshes.end());
if (this->m_filterMeshes)
{
this->m_selMeshes.insert(selMeshes.begin(),selMeshes.end());
}
}
else if (this->m_selectionModifier == SelectionModifier::SELECTION_ADDITION)
{ // add to current selection
......@@ -71,8 +74,10 @@ namespace smtk
this->filterEntitySelectionsByMask(const_cast<smtk::common::UUIDs &>
(selEntities), currentSelFiltered);
this->m_selEntities.insert(currentSelFiltered.begin(), currentSelFiltered.end());
this->m_selMeshes.insert(selMeshes.begin(),selMeshes.end());
if (this->m_filterMeshes)
{
this->m_selMeshes.insert(selMeshes.begin(),selMeshes.end());
}
}
else
{ //subtract from current selection
......@@ -84,10 +89,13 @@ namespace smtk
this->m_selEntities.erase(selEnt);
}
for (const auto& selMesh: selMeshes)
{
this->m_selMeshes.erase(selMesh);
}
if (this->m_filterMeshes)
{
for (const auto& selMesh: selMeshes)
{
this->m_selMeshes.erase(selMesh);
}
}
}
this->m_selectionModifier = SelectionModifier::SELECTION_DEFAULT; // reset
......@@ -189,6 +197,11 @@ namespace smtk
: (m_mask & (~smtk::model::VERTEX | smtk::model::CELL_ENTITY));
}
void qtSelectionManager::filterMeshes(bool checked)
{
this->m_filterMeshes = checked;
}
void qtSelectionManager::clearAllSelections()
{
this->m_selEntities.clear();
......@@ -275,4 +288,3 @@ namespace smtk
}; // namespace extension
}; // namespace smtk
......@@ -104,25 +104,29 @@ public:
SelectionFlags);
// Description
// update mask for model
// update mask for models
void filterModels(bool checked);
// Description
// update mask for model
// update mask for volumes
void filterVolumes(bool checked);
// Description
// update mask for model
// update mask for faces
void filterFaces(bool checked);
// Description
// update mask for model
// update mask for edges
void filterEdges(bool checked);
// Description
// update mask for model
// update mask for vertices
void filterVertices(bool checked);
// Description
// toggle filtering meshes
void filterMeshes(bool checked);
protected:
void clearAllSelections();
......@@ -139,6 +143,7 @@ public:
smtk::common::UUIDs m_selEntities;
smtk::model::DescriptivePhrases m_desPhrases;
smtk::model::BitFlags m_mask;
bool m_filterMeshes;
smtk::model::ManagerPtr m_modelMgr;
SelectionModifier m_selectionModifier;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment