Changeset 2329 for trunk/packages
- Timestamp:
- Aug 3, 2011, 6:10:59 AM (13 years ago)
- Location:
- trunk/packages/vizservers/vtkvis
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/vizservers/vtkvis/RpVtkRenderer.cpp
r2328 r2329 898 898 setAxisTickVisibility(Y_AXIS, state); 899 899 setAxisTickVisibility(Z_AXIS, state); 900 } 901 902 /** 903 * \brief Control position of ticks on 3D axes 904 */ 905 void Renderer::setAxesTickPosition(AxesTickPosition pos) 906 { 907 if (_cubeAxesActor == NULL) 908 return; 909 910 switch (pos) { 911 case TICKS_BOTH: 912 _cubeAxesActor->SetTickLocationToBoth(); 913 break; 914 case TICKS_OUTSIDE: 915 _cubeAxesActor->SetTickLocationToOutside(); 916 break; 917 case TICKS_INSIDE: 918 default: 919 _cubeAxesActor->SetTickLocationToInside(); 920 break; 921 } 922 _needsRedraw = true; 900 923 } 901 924 -
trunk/packages/vizservers/vtkvis/RpVtkRenderer.h
r2328 r2329 67 67 FLY_STATIC_EDGES, 68 68 FLY_STATIC_TRIAD 69 }; 70 71 enum AxesTickPosition { 72 TICKS_INSIDE, 73 TICKS_OUTSIDE, 74 TICKS_BOTH 69 75 }; 70 76 … … 185 191 186 192 void setAxesTickVisibility(bool state); 193 194 void setAxesTickPosition(AxesTickPosition pos); 187 195 188 196 void setAxesColor(double color[3]); -
trunk/packages/vizservers/vtkvis/RpVtkRendererCmd.cpp
r2328 r2329 199 199 200 200 static int 201 AxisTickPositionOp(ClientData clientData, Tcl_Interp *interp, int objc, 202 Tcl_Obj *const *objv) 203 { 204 const char *string = Tcl_GetString(objv[2]); 205 char c = string[0]; 206 if ((c == 'i') && (strcmp(string, "inside") == 0)) { 207 g_renderer->setAxesTickPosition(Renderer::TICKS_INSIDE); 208 } else if ((c == 'o') && (strcmp(string, "outside") == 0)) { 209 g_renderer->setAxesTickPosition(Renderer::TICKS_OUTSIDE); 210 } else if ((c == 'b') && (strcmp(string, "both") == 0)) { 211 g_renderer->setAxesTickPosition(Renderer::TICKS_BOTH); 212 } else { 213 Tcl_AppendResult(interp, "bad axis option \"", string, 214 "\": should be inside, outside or both", (char*)NULL); 215 return TCL_ERROR; 216 } 217 return TCL_OK; 218 } 219 220 static int 201 221 AxisUnitsOp(ClientData clientData, Tcl_Interp *interp, int objc, 202 222 Tcl_Obj *const *objv) … … 251 271 {"labels", 1, AxisLabelsVisibleOp, 4, 4, "axis bool"}, 252 272 {"name", 1, AxisNameOp, 4, 4, "axis title"}, 253 {"ticks", 1, AxisTicksVisibleOp, 4, 4, "axis bool"}, 273 {"tickpos", 2, AxisTickPositionOp, 3, 3, "position"}, 274 {"ticks", 2, AxisTicksVisibleOp, 4, 4, "axis bool"}, 254 275 {"units", 1, AxisUnitsOp, 4, 4, "axis units"}, 255 276 {"visible", 1, AxisVisibleOp, 4, 4, "axis bool"} -
trunk/packages/vizservers/vtkvis/protocol.txt
r2328 r2329 15 15 renderer depthpeel <bool> 16 16 Set use of depth peeling algorithm for transparency 17 renderer render 18 Force a new image to be rendered - use for advancing animation 17 19 18 20 axis color <r> <g> <b> … … 25 27 <axis> = x|y|z|all 26 28 axis name <axis> <title> 29 axis tickpos <position> 30 Set position of ticks on 3D axes (not implemented for 2D axes) 31 <position> = inside|outside|both 27 32 axis ticks <axis> <bool> 28 33 Toggle visibility of axis tick marks
Note: See TracChangeset
for help on using the changeset viewer.