Changeset 3110 for trunk/packages/vizservers
- Timestamp:
- Jul 23, 2012 11:51:04 AM (12 years ago)
- Location:
- trunk/packages/vizservers/vtkvis
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/vizservers/vtkvis/RpVtkRenderer.h
r3095 r3110 431 431 432 432 // Molecules 433 434 void setMoleculeAtomRadiusScale(const DataSetId& id, double scale); 435 436 void setMoleculeBondRadiusScale(const DataSetId& id, double scale); 433 437 434 438 void setMoleculeAtomScaling(const DataSetId& id, Molecule::AtomScaling scaling); -
trunk/packages/vizservers/vtkvis/RpVtkRendererCmd.cpp
r3095 r3110 552 552 553 553 static Rappture::CmdSpec cameraOps[] = { 554 {"get", 1, CameraGetOp, 2, 2, ""},555 {"mode", 1, CameraModeOp, 3, 3, "mode"},554 {"get", 1, CameraGetOp, 2, 2, ""}, 555 {"mode", 1, CameraModeOp, 3, 3, "mode"}, 556 556 {"orient", 3, CameraOrientOp, 6, 6, "qw qx qy qz"}, 557 {"ortho", 1, CameraOrthoOp, 7, 7, "coordMode x y width height"},558 {"pan", 1, CameraPanOp, 4, 4, "panX panY"},559 {"reset", 2, CameraResetOp, 2, 3, "?all?"},557 {"ortho", 1, CameraOrthoOp, 7, 7, "coordMode x y width height"}, 558 {"pan", 1, CameraPanOp, 4, 4, "panX panY"}, 559 {"reset", 2, CameraResetOp, 2, 3, "?all?"}, 560 560 {"rotate", 2, CameraRotateOp, 5, 5, "angle angle angle"}, 561 {"set", 1, CameraSetOp, 11, 11, "posX posY posZ focalPtX focalPtY focalPtZ viewUpX viewUpY viewUpZ"},562 {"zoom", 1, CameraZoomOp, 3, 3, "zoomAmount"}561 {"set", 1, CameraSetOp, 11, 11, "posX posY posZ focalPtX focalPtY focalPtZ viewUpX viewUpY viewUpZ"}, 562 {"zoom", 1, CameraZoomOp, 3, 3, "zoomAmount"} 563 563 }; 564 564 static int nCameraOps = NumCmdSpecs(cameraOps); … … 3488 3488 3489 3489 static int 3490 MoleculeAtomScaleFactorOp(ClientData clientData, Tcl_Interp *interp, int objc, 3491 Tcl_Obj *const *objv) 3492 { 3493 double scale; 3494 if (Tcl_GetDoubleFromObj(interp, objv[2], &scale) != TCL_OK) { 3495 return TCL_ERROR; 3496 } 3497 if (objc == 4) { 3498 const char *name = Tcl_GetString(objv[3]); 3499 g_renderer->setMoleculeAtomRadiusScale(name, scale); 3500 } else { 3501 g_renderer->setMoleculeAtomRadiusScale("all", scale); 3502 } 3503 return TCL_OK; 3504 } 3505 3506 static int 3490 3507 MoleculeAtomScalingOp(ClientData clientData, Tcl_Interp *interp, int objc, 3491 3508 Tcl_Obj *const *objv) … … 3516 3533 3517 3534 static int 3535 MoleculeBondScaleFactorOp(ClientData clientData, Tcl_Interp *interp, int objc, 3536 Tcl_Obj *const *objv) 3537 { 3538 double scale; 3539 if (Tcl_GetDoubleFromObj(interp, objv[2], &scale) != TCL_OK) { 3540 return TCL_ERROR; 3541 } 3542 if (objc == 4) { 3543 const char *name = Tcl_GetString(objv[3]); 3544 g_renderer->setMoleculeBondRadiusScale(name, scale); 3545 } else { 3546 g_renderer->setMoleculeBondRadiusScale("all", scale); 3547 } 3548 return TCL_OK; 3549 } 3550 3551 static int 3518 3552 MoleculeBondVisibilityOp(ClientData clientData, Tcl_Interp *interp, int objc, 3519 3553 Tcl_Obj *const *objv) … … 3740 3774 static Rappture::CmdSpec moleculeOps[] = { 3741 3775 {"add", 2, MoleculeAddOp, 2, 3, "?dataSetName?"}, 3776 {"ascale", 2, MoleculeAtomScaleFactorOp, 3, 4, "value ?dataSetName?"}, 3742 3777 {"atoms", 2, MoleculeAtomVisibilityOp, 3, 4, "bool ?dataSetName?"}, 3743 3778 {"bonds", 2, MoleculeBondVisibilityOp, 3, 4, "bool ?dataSetName?"}, 3779 {"bscale", 2, MoleculeBondScaleFactorOp, 3, 4, "value ?dataSetName?"}, 3744 3780 {"colormap", 1, MoleculeColorMapOp, 3, 4, "colorMapName ?dataSetName?"}, 3745 3781 {"delete", 1, MoleculeDeleteOp, 2, 3, "?dataSetName?"}, -
trunk/packages/vizservers/vtkvis/RpVtkRendererGraphicsObjs.cpp
r3095 r3110 1083 1083 1084 1084 /** 1085 * \brief Set radius s tandard for scalingatoms1086 */ 1087 void Renderer::setMoleculeAtom Scaling(const DataSetId& id, Molecule::AtomScaling scaling)1085 * \brief Set radius scale factor for atoms 1086 */ 1087 void Renderer::setMoleculeAtomRadiusScale(const DataSetId& id, double scale) 1088 1088 { 1089 1089 MoleculeHashmap::iterator itr; … … 1103 1103 1104 1104 do { 1105 itr->second->setAtomRadiusScale(scale); 1106 } while (doAll && ++itr != _molecules.end()); 1107 1108 _needsRedraw = true; 1109 } 1110 1111 /** 1112 * \brief Set radius standard for scaling atoms 1113 */ 1114 void Renderer::setMoleculeAtomScaling(const DataSetId& id, Molecule::AtomScaling scaling) 1115 { 1116 MoleculeHashmap::iterator itr; 1117 1118 bool doAll = false; 1119 1120 if (id.compare("all") == 0) { 1121 itr = _molecules.begin(); 1122 doAll = true; 1123 } else { 1124 itr = _molecules.find(id); 1125 } 1126 if (itr == _molecules.end()) { 1127 ERROR("Molecule not found: %s", id.c_str()); 1128 return; 1129 } 1130 1131 do { 1105 1132 itr->second->setAtomScaling(scaling); 1106 1133 } while (doAll && ++itr != _molecules.end()); … … 1131 1158 do { 1132 1159 itr->second->setAtomVisibility(state); 1160 } while (doAll && ++itr != _molecules.end()); 1161 1162 _needsRedraw = true; 1163 } 1164 1165 /** 1166 * \brief Set radius scale factor for atoms 1167 */ 1168 void Renderer::setMoleculeBondRadiusScale(const DataSetId& id, double scale) 1169 { 1170 MoleculeHashmap::iterator itr; 1171 1172 bool doAll = false; 1173 1174 if (id.compare("all") == 0) { 1175 itr = _molecules.begin(); 1176 doAll = true; 1177 } else { 1178 itr = _molecules.find(id); 1179 } 1180 if (itr == _molecules.end()) { 1181 ERROR("Molecule not found: %s", id.c_str()); 1182 return; 1183 } 1184 1185 do { 1186 itr->second->setBondRadiusScale(scale); 1133 1187 } while (doAll && ++itr != _molecules.end()); 1134 1188 -
trunk/packages/vizservers/vtkvis/protocol.txt
r3097 r3110 274 274 molecule atoms <bool> <?datasetName?> 275 275 Toggle rendering of atoms 276 molecule ascale <val> <?datasetName?> 277 Set atom scale factor 276 278 molecule bonds <bool> <?datasetName?> 277 279 Toggle rendering of bonds 280 molecule bscale <val> <?datasetName?> 281 Set bond scale factor 278 282 molecule colormap <colormapName> <?datasetName?> 279 283 molecule delete <?datasetName?>
Note: See TracChangeset
for help on using the changeset viewer.