Changeset 3677
- Timestamp:
- Jun 5, 2013 12:02:23 AM (11 years ago)
- Location:
- trunk/packages/vizservers/vtkvis
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/vizservers/vtkvis/Glyphs.cpp
r3621 r3677 22 22 #include <vtkCylinderSource.h> 23 23 #include <vtkPlatonicSolidSource.h> 24 #include <vtkPointSource.h> 24 25 #include <vtkSphereSource.h> 25 26 #include <vtkTransform.h> … … 145 146 _glyphSource = vtkSmartPointer<vtkPlatonicSolidSource>::New(); 146 147 vtkPlatonicSolidSource::SafeDownCast(_glyphSource)->SetSolidTypeToOctahedron(); 148 break; 149 case POINT: 150 _glyphSource = vtkSmartPointer<vtkPointSource>::New(); 151 vtkPointSource::SafeDownCast(_glyphSource)->SetNumberOfPoints(1); 152 vtkPointSource::SafeDownCast(_glyphSource)->SetCenter(0, 0, 0); 153 vtkPointSource::SafeDownCast(_glyphSource)->SetRadius(0); 154 vtkPointSource::SafeDownCast(_glyphSource)->SetDistributionToUniform(); 147 155 break; 148 156 case SPHERE: { -
trunk/packages/vizservers/vtkvis/Glyphs.h
r3621 r3677 40 40 LINE, 41 41 OCTAHEDRON, 42 POINT, 42 43 SPHERE, 43 44 TETRAHEDRON -
trunk/packages/vizservers/vtkvis/RendererCmd.cpp
r3641 r3677 4919 4919 } else if (shapeOpt[0] == 'o' && strcmp(shapeOpt, "octahedron") == 0) { 4920 4920 shape = Glyphs::OCTAHEDRON; 4921 } else if (shapeOpt[0] == 'p' && strcmp(shapeOpt, "point") == 0) { 4922 shape = Glyphs::POINT; 4921 4923 } else if (shapeOpt[0] == 's' && strcmp(shapeOpt, "sphere") == 0) { 4922 4924 shape = Glyphs::SPHERE; … … 4925 4927 } else { 4926 4928 Tcl_AppendResult(interp, "bad shape option \"", shapeOpt, 4927 "\": should be one of: 'arrow', 'cone', 'cube', 'cylinder', 'dodecahedron', 'icosahedron', 'octahedron', ' sphere', 'tetrahedron'", (char*)NULL);4929 "\": should be one of: 'arrow', 'cone', 'cube', 'cylinder', 'dodecahedron', 'icosahedron', 'octahedron', 'point', 'sphere', 'tetrahedron'", (char*)NULL); 4928 4930 return TCL_ERROR; 4929 4931 } … … 5164 5166 } else { 5165 5167 g_renderer->setGlyphsOrientMode("all", state, fieldName); 5168 } 5169 return TCL_OK; 5170 } 5171 5172 static int 5173 GlyphsPointSizeOp(ClientData clientData, Tcl_Interp *interp, int objc, 5174 Tcl_Obj *const *objv) 5175 { 5176 float size; 5177 if (GetFloatFromObj(interp, objv[2], &size) != TCL_OK) { 5178 return TCL_ERROR; 5179 } 5180 if (objc == 4) { 5181 const char *name = Tcl_GetString(objv[3]); 5182 g_renderer->setGraphicsObjectPointSize<Glyphs>(name, size); 5183 } else { 5184 g_renderer->setGraphicsObjectPointSize<Glyphs>("all", size); 5166 5185 } 5167 5186 return TCL_OK; … … 5275 5294 } else if (shapeOpt[0] == 'o' && strcmp(shapeOpt, "octahedron") == 0) { 5276 5295 shape = Glyphs::OCTAHEDRON; 5296 } else if (shapeOpt[0] == 'p' && strcmp(shapeOpt, "point") == 0) { 5297 shape = Glyphs::POINT; 5277 5298 } else if (shapeOpt[0] == 's' && strcmp(shapeOpt, "sphere") == 0) { 5278 5299 shape = Glyphs::SPHERE; … … 5281 5302 } else { 5282 5303 Tcl_AppendResult(interp, "bad shape option \"", shapeOpt, 5283 "\": should be one of: 'arrow', 'cone', 'cube', 'cylinder', 'dodecahedron', 'icosahedron', 'line', 'octahedron', ' sphere', 'tetrahedron'", (char*)NULL);5304 "\": should be one of: 'arrow', 'cone', 'cube', 'cylinder', 'dodecahedron', 'icosahedron', 'line', 'octahedron', 'point', 'sphere', 'tetrahedron'", (char*)NULL); 5284 5305 return TCL_ERROR; 5285 5306 } … … 5343 5364 {"opacity", 2, GlyphsOpacityOp, 3, 4, "value ?dataSetName?"}, 5344 5365 {"orient", 2, GlyphsOrientOp, 6, 7, "qw qx qy qz ?dataSetName?"}, 5345 {"pos", 1, GlyphsPositionOp, 5, 6, "x y z ?dataSetName?"}, 5366 {"pos", 2, GlyphsPositionOp, 5, 6, "x y z ?dataSetName?"}, 5367 {"ptsize", 2, GlyphsPointSizeOp, 3, 4, "size ?dataSetName?"}, 5346 5368 {"scale", 2, GlyphsScaleOp, 5, 6, "sx sy sz ?dataSetName?"}, 5347 5369 {"shape", 2, GlyphsShapeOp, 3, 4, "shapeVal ?dataSetName?"}, … … 6610 6632 return TCL_OK; 6611 6633 } 6612 6613 6634 6614 6635 static int -
trunk/packages/vizservers/vtkvis/protocol.txt
r3641 r3677 461 461 glyphs orient <qw> <qx> <qy> <qz> <?dataSetName?> 462 462 glyphs pos <x> <y> <z> <?dataSetName?> 463 glyphs ptsize <size> <?dataSetName?> 463 464 glyphs scale <sx> <sy> <sz> <?dataSetName?> 464 glyphs shape <arrow|cone|cube|cylinder|dodecahedron|icosahedron|line|octahedron| sphere|tetrahedron> <?datasetName?>465 glyphs shape <arrow|cone|cube|cylinder|dodecahedron|icosahedron|line|octahedron|point|sphere|tetrahedron> <?datasetName?> 465 466 glyphs smode <scalar|vmag|vcomp|off> <fieldName> <?dataSetName?> 466 467 Set the scaling mode: use the scalar field, vector magnitude
Note: See TracChangeset
for help on using the changeset viewer.