Skip to content

Commit 0615cd7

Browse files
committed
rename manual ground plane option
1 parent df6e137 commit 0615cd7

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

include/polyscope/types.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ enum class BackgroundView { None = 0 };
1313
enum class ProjectionMode { Perspective = 0, Orthographic };
1414
enum class TransparencyMode { None = 0, Simple, Pretty };
1515
enum class GroundPlaneMode { None, Tile, TileReflection, ShadowOnly };
16-
enum class GroundPlaneHeightMode { Relative = 0, Absolute };
16+
enum class GroundPlaneHeightMode { Automatic = 0, Manual };
1717
enum class BackFacePolicy { Identical, Different, Custom, Cull };
1818

1919
enum class PointRenderMode { Sphere = 0, Quad };

src/options.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ std::string screenshotExtension = ".png";
3131
// Ground plane / shadows
3232
bool groundPlaneEnabled = true;
3333
GroundPlaneMode groundPlaneMode = GroundPlaneMode::TileReflection;
34-
GroundPlaneHeightMode groundPlaneHeightMode = GroundPlaneHeightMode::Relative;
34+
GroundPlaneHeightMode groundPlaneHeightMode = GroundPlaneHeightMode::Automatic;
3535
ScaledValue<float> groundPlaneHeightFactor = 0;
3636
float groundPlaneHeight = 0.;
3737
int shadowBlurIters = 2;

src/render/ground_plane.cpp

+9-9
Original file line numberDiff line numberDiff line change
@@ -199,11 +199,11 @@ void GroundPlane::draw(bool isRedraw) {
199199

200200
double groundHeight = -777;
201201
switch (options::groundPlaneHeightMode) {
202-
case GroundPlaneHeightMode::Relative: {
202+
case GroundPlaneHeightMode::Automatic: {
203203
groundHeight = bboxBottom - sign * (options::groundPlaneHeightFactor.asAbsolute() + heightEPS);
204204
break;
205205
}
206-
case GroundPlaneHeightMode::Absolute: {
206+
case GroundPlaneHeightMode::Manual: {
207207
groundHeight = options::groundPlaneHeight;
208208
break;
209209
}
@@ -400,10 +400,10 @@ void GroundPlane::buildGui() {
400400

401401
auto heightModeName = [](const GroundPlaneHeightMode& m) -> std::string {
402402
switch (m) {
403-
case GroundPlaneHeightMode::Relative:
404-
return "Relative";
405-
case GroundPlaneHeightMode::Absolute:
406-
return "Absolute";
403+
case GroundPlaneHeightMode::Automatic:
404+
return "Automatic";
405+
case GroundPlaneHeightMode::Manual:
406+
return "Manual";
407407
}
408408
return "";
409409
};
@@ -428,11 +428,11 @@ void GroundPlane::buildGui() {
428428
// Height
429429
ImGui::PushItemWidth(80);
430430
switch (options::groundPlaneHeightMode) {
431-
case GroundPlaneHeightMode::Relative:
431+
case GroundPlaneHeightMode::Automatic:
432432
if (ImGui::SliderFloat("##HeightValue", options::groundPlaneHeightFactor.getValuePtr(), -1.0, 1.0))
433433
requestRedraw();
434434
break;
435-
case GroundPlaneHeightMode::Absolute:
435+
case GroundPlaneHeightMode::Manual:
436436
int iP;
437437
float sign;
438438
std::tie(iP, sign) = getGroundPlaneAxisAndSign();
@@ -448,7 +448,7 @@ void GroundPlane::buildGui() {
448448
ImGui::SameLine();
449449
ImGui::PushItemWidth(100);
450450
if (ImGui::BeginCombo("Height##Mode", heightModeName(options::groundPlaneHeightMode).c_str())) {
451-
for (GroundPlaneHeightMode m : {GroundPlaneHeightMode::Relative, GroundPlaneHeightMode::Absolute}) {
451+
for (GroundPlaneHeightMode m : {GroundPlaneHeightMode::Automatic, GroundPlaneHeightMode::Manual}) {
452452
std::string mName = heightModeName(m);
453453
if (ImGui::Selectable(mName.c_str(), options::groundPlaneHeightMode == m)) {
454454
options::groundPlaneHeightMode = m;

test/src/basics_test.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,11 @@ TEST_F(PolyscopeTest, GroundPlaneTest) {
134134
polyscope::refresh();
135135
polyscope::show(3);
136136

137-
polyscope::options::groundPlaneHeightMode = polyscope::GroundPlaneHeightMode::Absolute;
137+
polyscope::options::groundPlaneHeightMode = polyscope::GroundPlaneHeightMode::Manual;
138138
polyscope::options::groundPlaneHeight = -0.3;
139139
polyscope::show(3);
140140

141-
polyscope::options::groundPlaneHeightMode = polyscope::GroundPlaneHeightMode::Relative;
141+
polyscope::options::groundPlaneHeightMode = polyscope::GroundPlaneHeightMode::Automatic;
142142
polyscope::show(3);
143143

144144
polyscope::removeAllStructures();

0 commit comments

Comments
 (0)