More cosmetic changes to the examples GUI

- switch shading radio buttons to pulldowns
- re-ordered elements on screen in most viewers

note: the ptex viewer has not been updated to the new look yet
This commit is contained in:
Manuel Kraemer 2014-04-28 10:10:10 -07:00
parent 00f2419388
commit 48c119cb26
6 changed files with 57 additions and 61 deletions

View File

@ -833,21 +833,17 @@ initHUD()
#endif
g_hud.Init(windowWidth, windowHeight);
g_hud.AddRadioButton(1, "Wire (W)", g_displayStyle == kWire,
10, 10, callbackDisplayStyle, kWire, 'w');
g_hud.AddRadioButton(1, "Shaded", g_displayStyle == kShaded,
10, 30, callbackDisplayStyle, kShaded, 'w');
g_hud.AddRadioButton(1, "Wire+Shaded", g_displayStyle == kWireShaded,
10, 50, callbackDisplayStyle, kWireShaded, 'w');
g_hud.AddRadioButton(1, "Varying color", g_displayStyle == kVaryingColor,
10, 70, callbackDisplayStyle, kVaryingColor, 'w');
g_hud.AddRadioButton(1, "Face varying color", g_displayStyle == kFaceVaryingColor,
10, 90, callbackDisplayStyle, kFaceVaryingColor, 'w');
g_hud.AddCheckBox("Batching (B)", g_batching != 0, 10, 10, callbackCheckBox, HUD_CB_BATCHING, 'b');
g_hud.AddCheckBox("Patch Color (P)", true, 10, 50, callbackCheckBox, HUD_CB_DISPLAY_PATCH_COLOR, 'p');
g_hud.AddCheckBox("Screen space LOD (V)", g_screenSpaceTess != 0, 10, 70, callbackCheckBox, HUD_CB_VIEW_LOD, 'v');
g_hud.AddCheckBox("Freeze (spc)", false, 10, 90, callbackCheckBox, HUD_CB_FREEZE, ' ');
g_hud.AddCheckBox("Batching (B)", g_batching != 0, 200, 10, callbackCheckBox, HUD_CB_BATCHING, 'b');
g_hud.AddCheckBox("Patch Color (P)", true, 200, 50, callbackCheckBox, HUD_CB_DISPLAY_PATCH_COLOR, 'p');
g_hud.AddCheckBox("Screen space LOD (V)", g_screenSpaceTess != 0, 200, 70, callbackCheckBox, HUD_CB_VIEW_LOD, 'v');
g_hud.AddCheckBox("Freeze (spc)", false, 200, 90, callbackCheckBox, HUD_CB_FREEZE, ' ');
int shading_pulldown = g_hud.AddPullDown("Shading (w) :", 200, 10, 250, callbackDisplayStyle, 'w');
g_hud.AddPullDownButton(shading_pulldown, "Wire", kWire);
g_hud.AddPullDownButton(shading_pulldown, "Shaded", kShaded);
g_hud.AddPullDownButton(shading_pulldown, "Wire+Shaded", kWireShaded);
g_hud.AddPullDownButton(shading_pulldown, "Varying Color", kVaryingColor);
g_hud.AddPullDownButton(shading_pulldown, "FaceVarying Color", kFaceVaryingColor);
int compute_pulldown = g_hud.AddPullDown("Compute (k) :", 450, 10, 300, callbackKernel, 'k');
g_hud.AddPullDownButton(compute_pulldown, "CPU", kCPU);

View File

@ -1066,7 +1066,12 @@ initHUD()
#endif
g_hud.Init(windowWidth, windowHeight);
int compute_pulldown = g_hud.AddPullDown("Compute (k) :", 10, 10, 300, callbackKernel, 'k');
g_hud.AddCheckBox("Cage Edges (H)", true, 10, 10, callbackDisplayCageEdges, 0, 'h');
g_hud.AddCheckBox("Cage Verts (J)", true, 10, 30, callbackDisplayCageVertices, 0, 'j');
g_hud.AddCheckBox("Animate vertices (M)", g_moveScale != 0, 10, 50, callbackAnimate, 0, 'm');
g_hud.AddCheckBox("Freeze (spc)", false, 10, 70, callbackFreeze, 0, ' ');
int compute_pulldown = g_hud.AddPullDown("Compute (k) :", 250, 10, 300, callbackKernel, 'k');
g_hud.AddPullDownButton(compute_pulldown, "CPU", kCPU);
#ifdef OPENSUBDIV_HAS_OPENMP
g_hud.AddPullDownButton(compute_pulldown, "OpenMP", kOPENMP);
@ -1075,11 +1080,6 @@ initHUD()
g_hud.AddPullDownButton(compute_pulldown, "TBB", kTBB);
#endif
g_hud.AddCheckBox("Cage Edges (H)", true, 350, 10, callbackDisplayCageEdges, 0, 'h');
g_hud.AddCheckBox("Cage Verts (J)", true, 350, 30, callbackDisplayCageVertices, 0, 'j');
g_hud.AddCheckBox("Animate vertices (M)", g_moveScale != 0, 350, 50, callbackAnimate, 0, 'm');
g_hud.AddCheckBox("Freeze (spc)", false, 350, 70, callbackFreeze, 0, ' ');
for (int i = 1; i < 11; ++i) {
char level[16];
sprintf(level, "Lv. %d", i);

View File

@ -1680,29 +1680,29 @@ initHUD()
#endif
g_hud.Init(windowWidth, windowHeight);
g_hud.AddRadioButton(1, "Wire (W)", g_displayStyle == kWire, 10, 10, callbackDisplayStyle, 0, 'w');
g_hud.AddRadioButton(1, "Shaded", g_displayStyle == kShaded, 10, 30, callbackDisplayStyle, 1, 'w');
g_hud.AddRadioButton(1, "Wire+Shaded", g_displayStyle == kWireShaded, 10, 50, callbackDisplayStyle, 2, 'w');
g_hud.AddRadioButton(1, "Varying color", g_displayStyle == kVaryingColor, 10, 70, callbackDisplayStyle, 3, 'w');
g_hud.AddRadioButton(1, "FaceVarying color", g_displayStyle == kFaceVaryingColor, 10, 90, callbackDisplayStyle, 4, 'w');
g_hud.AddCheckBox("Cage Edges (H)", g_drawCageEdges != 0,
200, 10, callbackCheckBox, kHUD_CB_DISPLAY_CAGE_EDGES, 'h');
10, 10, callbackCheckBox, kHUD_CB_DISPLAY_CAGE_EDGES, 'h');
g_hud.AddCheckBox("Cage Verts (J)", g_drawCageVertices != 0,
200, 30, callbackCheckBox, kHUD_CB_DISPLAY_CAGE_VERTS, 'j');
10, 30, callbackCheckBox, kHUD_CB_DISPLAY_CAGE_VERTS, 'j');
g_hud.AddCheckBox("Animate vertices (M)", g_moveScale != 0,
200, 50, callbackCheckBox, kHUD_CB_ANIMATE_VERTICES, 'm');
10, 50, callbackCheckBox, kHUD_CB_ANIMATE_VERTICES, 'm');
g_hud.AddCheckBox("Patch Color (P)", g_displayPatchColor != 0,
200, 70, callbackCheckBox, kHUD_CB_DISPLAY_PATCH_COLOR, 'p');
10, 70, callbackCheckBox, kHUD_CB_DISPLAY_PATCH_COLOR, 'p');
g_hud.AddCheckBox("Screen space LOD (V)", g_screenSpaceTess != 0,
200, 90, callbackCheckBox, kHUD_CB_VIEW_LOD, 'v');
10, 90, callbackCheckBox, kHUD_CB_VIEW_LOD, 'v');
g_hud.AddCheckBox("Fractional spacing (T)", g_fractionalSpacing != 0,
200, 110, callbackCheckBox, kHUD_CB_FRACTIONAL_SPACING, 't');
10, 110, callbackCheckBox, kHUD_CB_FRACTIONAL_SPACING, 't');
g_hud.AddCheckBox("Frustum Patch Culling (B)", g_patchCull != 0,
200, 130, callbackCheckBox, kHUD_CB_PATCH_CULL, 'b');
10, 130, callbackCheckBox, kHUD_CB_PATCH_CULL, 'b');
g_hud.AddCheckBox("Freeze (spc)", g_freeze != 0,
200, 150, callbackCheckBox, kHUD_CB_FREEZE, ' ');
10, 150, callbackCheckBox, kHUD_CB_FREEZE, ' ');
int shading_pulldown = g_hud.AddPullDown("Shading (w) :", 200, 10, 250, callbackDisplayStyle, 'w');
g_hud.AddPullDownButton(shading_pulldown, "Wire", kWire);
g_hud.AddPullDownButton(shading_pulldown, "Shaded", kShaded);
g_hud.AddPullDownButton(shading_pulldown, "Wire+Shaded", kWireShaded);
g_hud.AddPullDownButton(shading_pulldown, "Varying Color", kVaryingColor);
g_hud.AddPullDownButton(shading_pulldown, "FaceVarying Color", kFaceVaryingColor);
int compute_pulldown = g_hud.AddPullDown("Compute (k) :", 450, 10, 300, callbackKernel, 'k');
g_hud.AddPullDownButton(compute_pulldown, "CPU", kCPU);

View File

@ -1047,14 +1047,15 @@ initHUD()
#endif
g_hud.Init(windowWidth, windowHeight);
g_hud.AddCheckBox("Cage Edges (H)", true, 350, 10, callbackDisplayCageEdges, 0, 'h');
g_hud.AddCheckBox("Cage Verts (J)", true, 350, 30, callbackDisplayCageVertices, 0, 'j');
g_hud.AddCheckBox("Animate vertices (M)", g_moveScale != 0, 350, 50, callbackAnimate, 0, 'm');
g_hud.AddCheckBox("Freeze (spc)", false, 350, 70, callbackFreeze, 0, ' ');
g_hud.AddCheckBox("Cage Edges (H)", true, 10, 10, callbackDisplayCageEdges, 0, 'h');
g_hud.AddCheckBox("Cage Verts (J)", true, 10, 30, callbackDisplayCageVertices, 0, 'j');
g_hud.AddCheckBox("Animate vertices (M)", g_moveScale != 0, 10, 50, callbackAnimate, 0, 'm');
g_hud.AddCheckBox("Freeze (spc)", false, 10, 70, callbackFreeze, 0, ' ');
g_hud.AddRadioButton(0, "(u,v)", true, 200, 10, callbackDisplayVaryingColors, kUV, 'k');
g_hud.AddRadioButton(0, "varying", false, 200, 30, callbackDisplayVaryingColors, kVARYING, 'k');
g_hud.AddRadioButton(0, "face-varying", false, 200, 50, callbackDisplayVaryingColors, kFACEVARYING, 'k');
int shading_pulldown = g_hud.AddPullDown("Shading (w) :", 250, 10, 250, callbackDisplayVaryingColors, 'w');
g_hud.AddPullDownButton(shading_pulldown, "(u,v)", kUV);
g_hud.AddPullDownButton(shading_pulldown, "Varying", kVARYING);
g_hud.AddPullDownButton(shading_pulldown, "FaceVarying", kFACEVARYING);
for (int i = 1; i < 11; ++i) {
char level[16];

View File

@ -1161,13 +1161,14 @@ initHUD()
#endif
g_hud.Init(windowWidth, windowHeight);
g_hud.AddRadioButton(1, "Wire (W)", g_wire == 0, 200, 10, callbackWireframe, 0, 'w');
g_hud.AddRadioButton(1, "Shaded", g_wire == 1, 200, 30, callbackWireframe, 1, 'w');
g_hud.AddRadioButton(1, "Wire+Shaded", g_wire == 2, 200, 50, callbackWireframe, 2, 'w');
g_hud.AddCheckBox("Color (C)", g_displayColor != 0, 350, 10, callbackDisplay, 0, 'c');
g_hud.AddCheckBox("Displacement (D)", g_displayDisplacement != 0, 350, 30, callbackDisplay, 1, 'd');
g_hud.AddCheckBox("Color (C)", g_displayColor != 0, 10, 10, callbackDisplay, 0, 'c');
g_hud.AddCheckBox("Displacement (D)", g_displayDisplacement != 0, 10, 30, callbackDisplay, 1, 'd');
int shading_pulldown = g_hud.AddPullDown("Shading (w) :", 200, 10, 250, callbackWireframe, 'w');
g_hud.AddPullDownButton(shading_pulldown, "Wire", 0);
g_hud.AddPullDownButton(shading_pulldown, "Shaded", 1);
g_hud.AddPullDownButton(shading_pulldown, "Wire+Shaded", 2);
for (int i = 1; i < 11; ++i) {
char level[16];
sprintf(level, "Lv. %d", i);

View File

@ -1277,37 +1277,35 @@ initHUD()
#endif
g_hud.Init(windowWidth, windowHeight);
g_hud.AddRadioButton(1, "Wire (W)", g_displayStyle == kWire,
200, 10, callbackDisplayStyle, 0, 'w');
g_hud.AddRadioButton(1, "Shaded", g_displayStyle == kShaded,
200, 30, callbackDisplayStyle, 1, 'w');
g_hud.AddRadioButton(1, "Wire+Shaded", g_displayStyle == kWireShaded,
200, 50, callbackDisplayStyle, 2, 'w');
int shading_pulldown = g_hud.AddPullDown("Shading (w) :", 350, 10, 250, callbackDisplayStyle, 'w');
g_hud.AddPullDownButton(shading_pulldown, "Wire", kWire);
g_hud.AddPullDownButton(shading_pulldown, "Shaded", kShaded);
g_hud.AddPullDownButton(shading_pulldown, "Wire+Shaded", kWireShaded);
if (OpenSubdiv::OsdGLDrawContext::SupportsAdaptiveTessellation())
g_hud.AddCheckBox("Adaptive (`)", g_adaptive != 0, 10, 10, callbackAdaptive, 0, '`');
g_hud.AddCheckBox("Adaptive (`)", g_adaptive != 0, 10, 250, callbackAdaptive, 0, '`');
for (int i = 1; i < 11; ++i) {
char level[16];
sprintf(level, "Lv. %d", i);
g_hud.AddRadioButton(3, level, i == 2, 10, 20 + i*20, callbackLevel, i, '0'+(i%10));
g_hud.AddRadioButton(3, level, i == 2, 10, 270 + i*20, callbackLevel, i, '0'+(i%10));
}
g_hud.AddRadioButton(2, "Boundary none (B)",
g_fvarBoundary == OsdHbrMesh::k_InterpolateBoundaryNone,
350, 10, callbackBoundary, OsdHbrMesh::k_InterpolateBoundaryNone, 'b');
10, 10, callbackBoundary, OsdHbrMesh::k_InterpolateBoundaryNone, 'b');
g_hud.AddRadioButton(2, "Boundary edge only",
g_fvarBoundary == OsdHbrMesh::k_InterpolateBoundaryEdgeOnly,
350, 30, callbackBoundary, OsdHbrMesh::k_InterpolateBoundaryEdgeOnly, 'b');
10, 30, callbackBoundary, OsdHbrMesh::k_InterpolateBoundaryEdgeOnly, 'b');
g_hud.AddRadioButton(2, "Boundary edge and corners",
g_fvarBoundary == OsdHbrMesh::k_InterpolateBoundaryEdgeAndCorner,
350, 50, callbackBoundary, OsdHbrMesh::k_InterpolateBoundaryEdgeAndCorner, 'b');
10, 50, callbackBoundary, OsdHbrMesh::k_InterpolateBoundaryEdgeAndCorner, 'b');
g_hud.AddRadioButton(2, "Boundary always sharp",
g_fvarBoundary == OsdHbrMesh::k_InterpolateBoundaryAlwaysSharp,
350, 70, callbackBoundary, OsdHbrMesh::k_InterpolateBoundaryAlwaysSharp, 'b');
10, 70, callbackBoundary, OsdHbrMesh::k_InterpolateBoundaryAlwaysSharp, 'b');
g_hud.AddCheckBox("Propagate corners (C)", g_fvarPropagateCorners != 0,
350, 110, callbackPropagateCorners, 0, 'c');
10, 110, callbackPropagateCorners, 0, 'c');
int pulldown_handle = g_hud.AddPullDown("Shape :", -300, 10, 300, callbackModel, 'n');
for (int i = 0; i < (int)g_defaultShapes.size(); ++i) {