diff --git a/include/polyscope/group.h b/include/polyscope/group.h index 822a7a11..e5ffff1e 100644 --- a/include/polyscope/group.h +++ b/include/polyscope/group.h @@ -29,8 +29,8 @@ class Group : public virtual WeakReferrable { // buildUI() for all children. // Is the group being displayed (0 no, 1 some children, 2 all children) - int isEnabled(); // checks ALL descendents - Group* setEnabled(bool newEnabled); // updates setting for ALL descendents + int isEnabled(); // checks ALL descendants + Group* setEnabled(bool newEnabled); // updates setting for ALL descendants void addChildGroup(Group& newChild); void addChildStructure(Structure& newChild); @@ -41,7 +41,7 @@ class Group : public virtual WeakReferrable { bool isRootGroup(); Group* getTopLevelGrandparent(); void appendStructuresToSkip(std::unordered_set& skipSet); - void appendAllDescendents(std::unordered_set& skipSet); + void appendAllDescendants(std::unordered_set& skipSet); std::string niceName(); std::string uniqueName(); @@ -49,8 +49,8 @@ class Group : public virtual WeakReferrable { Group* setShowChildDetails(bool newVal); bool getShowChildDetails(); - Group* setHideDescendentsFromStructureLists(bool newVal); - bool getHideDescendentsFromStructureLists(); + Group* setHideDescendantsFromStructureLists(bool newVal); + bool getHideDescendantsFromStructureLists(); // === Member variables === WeakHandle parentGroup; // the parent group of this group (if null, this is a root group) @@ -62,7 +62,7 @@ class Group : public virtual WeakReferrable { // = State PersistentValue showChildDetails; - PersistentValue hideDescendentsFromStructureLists; + PersistentValue hideDescendantsFromStructureLists; // helpers void cullExpiredChildren(); // remove any child diff --git a/src/group.cpp b/src/group.cpp index 7c0b9e91..2b948778 100644 --- a/src/group.cpp +++ b/src/group.cpp @@ -29,7 +29,7 @@ namespace polyscope { Group::Group(std::string name_) : name(name_), showChildDetails(uniqueName() + "showChildDetails", true), - hideDescendentsFromStructureLists(uniqueName() + "hideDescendentsFromStructureLists", false) {} + hideDescendantsFromStructureLists(uniqueName() + "hideDescendantsFromStructureLists", false) {} Group::~Group() { // unparent all children @@ -76,8 +76,8 @@ void Group::buildUI() { if (ImGui::MenuItem("Show child details", NULL, getShowChildDetails())) { setShowChildDetails(!getShowChildDetails()); } - if (ImGui::MenuItem("Hide descendents from structure lists", NULL, getHideDescendentsFromStructureLists())) { - setHideDescendentsFromStructureLists(!getHideDescendentsFromStructureLists()); + if (ImGui::MenuItem("Hide descendants from structure lists", NULL, getHideDescendantsFromStructureLists())) { + setHideDescendantsFromStructureLists(!getHideDescendantsFromStructureLists()); } ImGui::EndPopup(); } @@ -260,16 +260,16 @@ void Group::cullExpiredChildren() { } void Group::appendStructuresToSkip(std::unordered_set& skipSet) { - if (getHideDescendentsFromStructureLists()) { - appendAllDescendents(skipSet); + if (getHideDescendantsFromStructureLists()) { + appendAllDescendants(skipSet); } } -void Group::appendAllDescendents(std::unordered_set& skipSet) { +void Group::appendAllDescendants(std::unordered_set& skipSet) { for (WeakHandle& childWeak : childrenGroups) { if (childWeak.isValid()) { Group& child = childWeak.get(); - child.appendAllDescendents(skipSet); + child.appendAllDescendants(skipSet); } } @@ -304,11 +304,11 @@ Group* Group::setShowChildDetails(bool newVal) { } bool Group::getShowChildDetails() { return showChildDetails.get(); } -Group* Group::setHideDescendentsFromStructureLists(bool newVal) { - hideDescendentsFromStructureLists = newVal; +Group* Group::setHideDescendantsFromStructureLists(bool newVal) { + hideDescendantsFromStructureLists = newVal; return this; } -bool Group::getHideDescendentsFromStructureLists() { return hideDescendentsFromStructureLists.get(); } +bool Group::getHideDescendantsFromStructureLists() { return hideDescendantsFromStructureLists.get(); } bool Group::isRootGroup() { return !parentGroup.isValid(); } diff --git a/test/src/group_test.cpp b/test/src/group_test.cpp index 29e8ce99..dd525d5b 100644 --- a/test/src/group_test.cpp +++ b/test/src/group_test.cpp @@ -228,7 +228,7 @@ TEST_F(PolyscopeTest, TestDocsExample) { // hide items in group from displaying in the UI // (useful if you are registering huge numbers of structures you don't always need to see) - group->setHideDescendentsFromStructureLists(true); + group->setHideDescendantsFromStructureLists(true); group->setShowChildDetails(false); // nest groups inside of other groups