Feat(cell.cpp): Add select/unhide functions in cell.cpp

macos_ci_fix
Dave Corley 1 year ago
parent 8edc148418
commit f287914f1e

@ -612,6 +612,25 @@ osg::ref_ptr<CSVRender::TagBase> CSVRender::Cell::getSnapTarget(unsigned int ele
return result;
}
void CSVRender::Cell::selectFromGroup(const std::vector<std::string> group)
{
for (const auto& [_, object] : mObjects)
if (auto found = std::ranges::find_if(group.begin(), group.end(),
[&object](const std::string& id) { return object->getReferenceId() == id; });
found != group.end())
object->setSelected(true, osg::Vec4f(1, 0, 1, 1));
}
void CSVRender::Cell::unhideAll()
{
for (const auto& [_, object] : mObjects)
{
osg::ref_ptr<osg::Group> rootNode = object->getRootNode();
if (rootNode->getNodeMask() == Mask_Hidden)
rootNode->setNodeMask(Mask_Reference);
}
}
std::vector<osg::ref_ptr<CSVRender::TagBase>> CSVRender::Cell::getSelection(unsigned int elementMask) const
{
std::vector<osg::ref_ptr<TagBase>> result;

@ -148,6 +148,10 @@ namespace CSVRender
// already selected
void selectAllWithSameParentId(int elementMask);
void selectFromGroup(const std::vector<std::string> group);
void unhideAll();
void handleSelectDrag(Object* object, DragMode dragMode);
void selectInsideCube(const osg::Vec3d& pointA, const osg::Vec3d& pointB, DragMode dragMode);

Loading…
Cancel
Save