Changeset 4089 for trunk/packages/vizservers/vtkvis
- Timestamp:
- Dec 18, 2013 2:24:13 PM (10 years ago)
- Location:
- trunk/packages/vizservers/vtkvis
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/vizservers/vtkvis/Renderer.h
r4082 r4089 780 780 void setImageCutplaneSliceVisibility(const DataSetId& id, Axis axis, bool state); 781 781 782 void setImageCutplaneLevel(const DataSetId& id, double level); 783 784 void setImageCutplaneWindow(const DataSetId& id, double window); 785 782 786 // Lines 783 787 -
trunk/packages/vizservers/vtkvis/RendererCmd.cpp
r4082 r4089 7178 7178 7179 7179 static int 7180 ImageCutplaneLevelOp(ClientData clientData, Tcl_Interp *interp, int objc, 7181 Tcl_Obj *const *objv) 7182 { 7183 double level; 7184 if (Tcl_GetDoubleFromObj(interp, objv[2], &level) != TCL_OK) { 7185 return TCL_ERROR; 7186 } 7187 if (objc == 4) { 7188 const char *name = Tcl_GetString(objv[3]); 7189 g_renderer->setImageCutplaneLevel(name, level); 7190 } else { 7191 g_renderer->setImageCutplaneLevel("all", level); 7192 } 7193 return TCL_OK; 7194 } 7195 7196 static int 7180 7197 ImageCutplaneMaterialOp(ClientData clientData, Tcl_Interp *interp, int objc, 7181 7198 Tcl_Obj *const *objv) … … 7369 7386 } 7370 7387 7388 static int 7389 ImageCutplaneWindowOp(ClientData clientData, Tcl_Interp *interp, int objc, 7390 Tcl_Obj *const *objv) 7391 { 7392 double window; 7393 if (Tcl_GetDoubleFromObj(interp, objv[2], &window) != TCL_OK) { 7394 return TCL_ERROR; 7395 } 7396 if (objc == 4) { 7397 const char *name = Tcl_GetString(objv[3]); 7398 g_renderer->setImageCutplaneWindow(name, window); 7399 } else { 7400 g_renderer->setImageCutplaneWindow("all", window); 7401 } 7402 return TCL_OK; 7403 } 7404 7371 7405 static CmdSpec imageCutplaneOps[] = { 7372 7406 {"add", 2, ImageCutplaneAddOp, 2, 3, "?dataSetName?"}, … … 7375 7409 {"colormap", 6, ImageCutplaneColorMapOp, 3, 4, "colorMapName ?dataSetName?"}, 7376 7410 {"delete", 1, ImageCutplaneDeleteOp, 2, 3, "?dataSetName?"}, 7411 {"level", 1, ImageCutplaneLevelOp, 3, 4, "level ?dataSetName?"}, 7377 7412 {"material", 1, ImageCutplaneMaterialOp, 4, 5, "ambientCoeff diffuseCoeff ?dataSetName?"}, 7378 7413 {"opacity", 2, ImageCutplaneOpacityOp, 3, 4, "value ?dataSetName?"}, … … 7382 7417 {"scale", 2, ImageCutplaneScaleOp, 5, 6, "sx sy sz ?dataSetName?"}, 7383 7418 {"slice", 2, ImageCutplaneVolumeSliceOp, 4, 5, "axis ratio ?dataSetName?"}, 7384 {"visible", 1, ImageCutplaneVisibleOp, 3, 4, "bool ?dataSetName?"} 7419 {"visible", 1, ImageCutplaneVisibleOp, 3, 4, "bool ?dataSetName?"}, 7420 {"window", 1, ImageCutplaneWindowOp, 3, 4, "window ?dataSetName?"} 7385 7421 }; 7386 7422 static int nImageCutplaneOps = NumCmdSpecs(imageCutplaneOps); -
trunk/packages/vizservers/vtkvis/RendererGraphicsObjs.cpp
r4082 r4089 2496 2496 } 2497 2497 2498 void Renderer::setImageCutplaneLevel(const DataSetId& id, double level) 2499 { 2500 ImageCutplaneHashmap::iterator itr; 2501 2502 bool doAll = false; 2503 2504 if (id.compare("all") == 0) { 2505 itr = _imageCutplanes.begin(); 2506 if (itr == _imageCutplanes.end()) 2507 return; 2508 doAll = true; 2509 } else { 2510 itr = _imageCutplanes.find(id); 2511 } 2512 if (itr == _imageCutplanes.end()) { 2513 ERROR("Image not found: %s", id.c_str()); 2514 return; 2515 } 2516 2517 do { 2518 itr->second->setLevel(level); 2519 } while (doAll && ++itr != _imageCutplanes.end()); 2520 2521 _needsRedraw = true; 2522 } 2523 2524 void Renderer::setImageCutplaneWindow(const DataSetId& id, double window) 2525 { 2526 ImageCutplaneHashmap::iterator itr; 2527 2528 bool doAll = false; 2529 2530 if (id.compare("all") == 0) { 2531 itr = _imageCutplanes.begin(); 2532 if (itr == _imageCutplanes.end()) 2533 return; 2534 doAll = true; 2535 } else { 2536 itr = _imageCutplanes.find(id); 2537 } 2538 if (itr == _imageCutplanes.end()) { 2539 ERROR("Image not found: %s", id.c_str()); 2540 return; 2541 } 2542 2543 do { 2544 itr->second->setWindow(window); 2545 } while (doAll && ++itr != _imageCutplanes.end()); 2546 2547 _needsRedraw = true; 2548 } 2549 2498 2550 /** 2499 2551 * \brief Create a new Line and associate it with an ID
Note: See TracChangeset
for help on using the changeset viewer.