Skip to content

Commit 37fac69

Browse files
committed
change slice plane programmatic defaults
1 parent f4c8f94 commit 37fac69

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

include/polyscope/slice_plane.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class SlicePlane {
7373
void updateWidgetEnabled();
7474
};
7575

76-
SlicePlane* addSceneSlicePlane();
76+
SlicePlane* addSceneSlicePlane(bool initiallyVisible=false);
7777
void removeLastSceneSlicePlane();
7878
void buildSlicePlaneGUI();
7979

src/slice_plane.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,14 @@ std::vector<SlicePlane*> sceneSlicePlanes;
2020
// Storage for global options
2121
bool openSlicePlaneMenu = false;
2222

23-
SlicePlane* addSceneSlicePlane() {
23+
SlicePlane* addSceneSlicePlane(bool initiallyVisible) {
2424
size_t nPlanes = sceneSlicePlanes.size();
2525
std::string newName = "Scene Slice Plane " + std::to_string(nPlanes);
2626
sceneSlicePlanes.emplace_back(new SlicePlane(newName));
27+
if(!initiallyVisible) {
28+
sceneSlicePlanes.back()->setDrawPlane(false);
29+
sceneSlicePlanes.back()->setDrawWidget(false);
30+
}
2731
return sceneSlicePlanes.back();
2832
}
2933

@@ -43,7 +47,7 @@ void buildSlicePlaneGUI() {
4347
}
4448
if (ImGui::TreeNode("Slice Planes")) {
4549
if (ImGui::Button("Add plane")) {
46-
addSceneSlicePlane();
50+
addSceneSlicePlane(true);
4751
}
4852
ImGui::SameLine();
4953
if (ImGui::Button("Remove plane")) {

0 commit comments

Comments
 (0)