Skip to content

Commit

Permalink
spelling is hard
Browse files Browse the repository at this point in the history
  • Loading branch information
nmwsharp committed Nov 26, 2023
1 parent c60e7d1 commit f3623ec
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
12 changes: 6 additions & 6 deletions include/polyscope/group.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -41,16 +41,16 @@ class Group : public virtual WeakReferrable {
bool isRootGroup();
Group* getTopLevelGrandparent();
void appendStructuresToSkip(std::unordered_set<Structure*>& skipSet);
void appendAllDescendents(std::unordered_set<Structure*>& skipSet);
void appendAllDescendants(std::unordered_set<Structure*>& skipSet);

std::string niceName();
std::string uniqueName();

Group* setShowChildDetails(bool newVal);
bool getShowChildDetails();

Group* setHideDescendentsFromStructureLists(bool newVal);
bool getHideDescendentsFromStructureLists();
Group* setHideDescendantsFromStructureLists(bool newVal);
bool getHideDescendantsFromStructureLists();

// === Member variables ===
WeakHandle<Group> parentGroup; // the parent group of this group (if null, this is a root group)
Expand All @@ -62,7 +62,7 @@ class Group : public virtual WeakReferrable {
// = State

PersistentValue<bool> showChildDetails;
PersistentValue<bool> hideDescendentsFromStructureLists;
PersistentValue<bool> hideDescendantsFromStructureLists;

// helpers
void cullExpiredChildren(); // remove any child
Expand Down
20 changes: 10 additions & 10 deletions src/group.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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();
}
Expand Down Expand Up @@ -260,16 +260,16 @@ void Group::cullExpiredChildren() {
}

void Group::appendStructuresToSkip(std::unordered_set<Structure*>& skipSet) {
if (getHideDescendentsFromStructureLists()) {
appendAllDescendents(skipSet);
if (getHideDescendantsFromStructureLists()) {
appendAllDescendants(skipSet);
}
}

void Group::appendAllDescendents(std::unordered_set<Structure*>& skipSet) {
void Group::appendAllDescendants(std::unordered_set<Structure*>& skipSet) {
for (WeakHandle<Group>& childWeak : childrenGroups) {
if (childWeak.isValid()) {
Group& child = childWeak.get();
child.appendAllDescendents(skipSet);
child.appendAllDescendants(skipSet);
}
}

Expand Down Expand Up @@ -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(); }

Expand Down
2 changes: 1 addition & 1 deletion test/src/group_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f3623ec

Please sign in to comment.