mirror of
https://github.com/OpenMW/openmw.git
synced 2025-04-03 02:36:46 +00:00
Feat(cell.cpp): Add select/unhide functions in cell.cpp
This commit is contained in:
parent
8edc148418
commit
f287914f1e
2 changed files with 23 additions and 0 deletions
|
@ -612,6 +612,25 @@ osg::ref_ptr<CSVRender::TagBase> CSVRender::Cell::getSnapTarget(unsigned int ele
|
||||||
return result;
|
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<CSVRender::TagBase>> CSVRender::Cell::getSelection(unsigned int elementMask) const
|
||||||
{
|
{
|
||||||
std::vector<osg::ref_ptr<TagBase>> result;
|
std::vector<osg::ref_ptr<TagBase>> result;
|
||||||
|
|
|
@ -148,6 +148,10 @@ namespace CSVRender
|
||||||
// already selected
|
// already selected
|
||||||
void selectAllWithSameParentId(int elementMask);
|
void selectAllWithSameParentId(int elementMask);
|
||||||
|
|
||||||
|
void selectFromGroup(const std::vector<std::string> group);
|
||||||
|
|
||||||
|
void unhideAll();
|
||||||
|
|
||||||
void handleSelectDrag(Object* object, DragMode dragMode);
|
void handleSelectDrag(Object* object, DragMode dragMode);
|
||||||
|
|
||||||
void selectInsideCube(const osg::Vec3d& pointA, const osg::Vec3d& pointB, DragMode dragMode);
|
void selectInsideCube(const osg::Vec3d& pointA, const osg::Vec3d& pointB, DragMode dragMode);
|
||||||
|
|
Loading…
Reference in a new issue