- Timestamp:
- Aug 8, 2013, 1:33:28 PM (11 years ago)
- Location:
- trunk/packages/vizservers/vtkvis
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/vizservers/vtkvis/Makefile.in
r3851 r3859 147 147 Molecule.cpp \ 148 148 Outline.cpp \ 149 Parallelpiped.cpp \ 149 150 PolyData.cpp \ 150 151 Polygon.cpp \ … … 230 231 Molecule.o: Molecule.h MoleculeData.h GraphicsObject.h DataSet.h Renderer.h ColorMap.h Trace.h 231 232 Outline.o: Outline.h GraphicsObject.h DataSet.h Trace.h 233 Parallelpiped.o: Parallelpiped.h Shape.h GraphicsObject.h DataSet.h Renderer.h Trace.h 232 234 PolyData.o: PolyData.h GraphicsObject.h DataSet.h Renderer.h Trace.h 233 235 Polygon.o: Polygon.h Shape.h GraphicsObject.h DataSet.h Renderer.h Trace.h … … 235 237 PseudoColor.o: PseudoColor.h GraphicsObject.h DataSet.h Renderer.h ColorMap.h Trace.h 236 238 ReadBuffer.o: ReadBuffer.h Trace.h 237 Renderer.o: Renderer.h RendererGraphicsObjs.h vtkRpCubeAxesActor.h vtkRpAxisFollower.h vtkRpAxisActor.h Math.h DataSet.h Arc.h Arrow.h Box.h Cone.h Contour2D.h Contour3D.h Cutplane.h Cylinder.h Disk.h Glyphs.h Group.h HeightMap.h Image.h LIC.h Line.h Molecule.h Outline.h P olyData.h Polygon.h PseudoColor.h Sphere.h Streamlines.h Text3D.h Volume.h Warp.h ColorMap.h Trace.h238 RendererCmd.o: Renderer.h RendererGraphicsObjs.h vtkRpCubeAxesActor.h vtkRpAxisFollower.h vtkRpAxisActor.h DataSet.h Arc.h Arrow.h Box.h Cone.h Contour2D.h Contour3D.h Cutplane.h Cylinder.h Disk.h Glyphs.h Group.h HeightMap.h Image.h LIC.h Line.h Molecule.h Outline.h P olyData.h Polygon.h PseudoColor.h Sphere.h Streamlines.h Text3D.h Volume.h Warp.h ColorMap.h ReadBuffer.h ResponseQueue.h Trace.h CmdProc.h PPMWriter.h TGAWriter.h239 RendererGraphicsObjs.o: Renderer.h RendererGraphicsObjs.h DataSet.h Arc.h Arrow.h Box.h Cone.h Contour2D.h Contour3D.h Cutplane.h Cylinder.h Disk.h Glyphs.h Group.h HeightMap.h Image.h LIC.h Line.h Molecule.h Outline.h P olyData.h Polygon.h PseudoColor.h Sphere.h Streamlines.h Text3D.h Volume.h Warp.h ColorMap.h Trace.h239 Renderer.o: Renderer.h RendererGraphicsObjs.h vtkRpCubeAxesActor.h vtkRpAxisFollower.h vtkRpAxisActor.h Math.h DataSet.h Arc.h Arrow.h Box.h Cone.h Contour2D.h Contour3D.h Cutplane.h Cylinder.h Disk.h Glyphs.h Group.h HeightMap.h Image.h LIC.h Line.h Molecule.h Outline.h Parallelpiped.h PolyData.h Polygon.h PseudoColor.h Sphere.h Streamlines.h Text3D.h Volume.h Warp.h ColorMap.h Trace.h 240 RendererCmd.o: Renderer.h RendererGraphicsObjs.h vtkRpCubeAxesActor.h vtkRpAxisFollower.h vtkRpAxisActor.h DataSet.h Arc.h Arrow.h Box.h Cone.h Contour2D.h Contour3D.h Cutplane.h Cylinder.h Disk.h Glyphs.h Group.h HeightMap.h Image.h LIC.h Line.h Molecule.h Outline.h Parallelpiped.h PolyData.h Polygon.h PseudoColor.h Sphere.h Streamlines.h Text3D.h Volume.h Warp.h ColorMap.h ReadBuffer.h ResponseQueue.h Trace.h CmdProc.h PPMWriter.h TGAWriter.h 241 RendererGraphicsObjs.o: Renderer.h RendererGraphicsObjs.h DataSet.h Arc.h Arrow.h Box.h Cone.h Contour2D.h Contour3D.h Cutplane.h Cylinder.h Disk.h Glyphs.h Group.h HeightMap.h Image.h LIC.h Line.h Molecule.h Outline.h Parallelpiped.h PolyData.h Polygon.h PseudoColor.h Sphere.h Streamlines.h Text3D.h Volume.h Warp.h ColorMap.h Trace.h 240 242 RenderServer.o: RenderServer.h RendererCmd.h Renderer.h vtkRpCubeAxesActor.h vtkRpAxisFollower.h vtkRpAxisActor.h ReadBuffer.h ResponseQueue.h Trace.h PPMWriter.h TGAWriter.h 241 243 ResponseQueue.o: ResponseQueue.h Trace.h -
trunk/packages/vizservers/vtkvis/RenderServer.h
r3819 r3859 16 16 class Renderer; 17 17 18 #define VTKVIS_VERSION_STRING "1. 5"18 #define VTKVIS_VERSION_STRING "1.6" 19 19 20 20 #define MSECS_ELAPSED(t1, t2) \ -
trunk/packages/vizservers/vtkvis/Renderer.cpp
r3828 r3859 197 197 deleteAllGraphicsObjects<Molecule>(); 198 198 deleteAllGraphicsObjects<Outline>(); 199 deleteAllGraphicsObjects<Parallelpiped>(); 199 200 deleteAllGraphicsObjects<PolyData>(); 200 201 deleteAllGraphicsObjects<Polygon>(); … … 2436 2437 setGraphicsObjectAspect<Molecule>(aspectRatio); 2437 2438 setGraphicsObjectAspect<Outline>(aspectRatio); 2439 setGraphicsObjectAspect<Parallelpiped>(aspectRatio); 2438 2440 setGraphicsObjectAspect<PolyData>(aspectRatio); 2439 2441 setGraphicsObjectAspect<Polygon>(aspectRatio); … … 3357 3359 mergeGraphicsObjectBounds<Molecule>(bounds, onlyVisible); 3358 3360 mergeGraphicsObjectBounds<Outline>(bounds, onlyVisible); 3361 mergeGraphicsObjectBounds<Parallelpiped>(bounds, onlyVisible); 3359 3362 mergeGraphicsObjectBounds<PolyData>(bounds, onlyVisible); 3360 3363 mergeGraphicsObjectBounds<Polygon>(bounds, onlyVisible); … … 3429 3432 mergeGraphicsObjectUnscaledBounds<Outline>(bounds, onlyVisible); 3430 3433 mergeGraphicsObjectUnscaledBounds<PolyData>(bounds, onlyVisible); 3434 mergeGraphicsObjectUnscaledBounds<Parallelpiped>(bounds, onlyVisible); 3431 3435 mergeGraphicsObjectUnscaledBounds<Polygon>(bounds, onlyVisible); 3432 3436 mergeGraphicsObjectUnscaledBounds<PseudoColor>(bounds, onlyVisible); … … 4577 4581 setGraphicsObjectClippingPlanes<Molecule>(_activeClipPlanes); 4578 4582 setGraphicsObjectClippingPlanes<Outline>(_activeClipPlanes); 4583 setGraphicsObjectClippingPlanes<Parallelpiped>(_activeClipPlanes); 4579 4584 setGraphicsObjectClippingPlanes<PolyData>(_activeClipPlanes); 4580 4585 setGraphicsObjectClippingPlanes<Polygon>(_activeClipPlanes); -
trunk/packages/vizservers/vtkvis/Renderer.h
r3818 r3859 45 45 #include "Molecule.h" 46 46 #include "Outline.h" 47 #include "Parallelpiped.h" 47 48 #include "PolyData.h" 48 49 #include "Polygon.h" … … 809 810 const char *name, double range[2] = NULL); 810 811 811 // N-sided Regular Polygons 812 813 bool addPolygon(const DataSetId& id, int numSides, double center[3], double normal[3], double radius); 812 // Parallelpipeds 813 814 bool addParallelpiped(const DataSetId& id, double vec1[3], double vec2[3], double vec3[3], 815 bool flipNormals = false); 814 816 815 817 // PolyData meshes … … 826 828 DataSet::DataAttributeType type, 827 829 const char *name, double range[2] = NULL); 830 831 // N-sided Regular Polygons 832 833 bool addPolygon(const DataSetId& id, int numSides, double center[3], double normal[3], double radius); 828 834 829 835 // Color-mapped surfaces … … 975 981 typedef std::tr1::unordered_map<DataSetId, Molecule *> MoleculeHashmap; 976 982 typedef std::tr1::unordered_map<DataSetId, Outline *> OutlineHashmap; 983 typedef std::tr1::unordered_map<DataSetId, Parallelpiped *> ParallelpipedHashmap; 977 984 typedef std::tr1::unordered_map<DataSetId, PolyData *> PolyDataHashmap; 978 985 typedef std::tr1::unordered_map<DataSetId, Polygon *> PolygonHashmap; … … 1114 1121 MoleculeHashmap _molecules; 1115 1122 OutlineHashmap _outlines; 1123 ParallelpipedHashmap _parallelpipeds; 1116 1124 PolyDataHashmap _polyDatas; 1117 1125 PolygonHashmap _polygons; -
trunk/packages/vizservers/vtkvis/RendererCmd.cpp
r3835 r3859 8559 8559 8560 8560 static int 8561 ParallelpipedAddOp(ClientData clientData, Tcl_Interp *interp, int objc, 8562 Tcl_Obj *const *objv) 8563 { 8564 double vec1[3], vec2[3], vec3[3]; 8565 if (Tcl_GetDoubleFromObj(interp, objv[2], &vec1[0]) != TCL_OK || 8566 Tcl_GetDoubleFromObj(interp, objv[3], &vec1[1]) != TCL_OK || 8567 Tcl_GetDoubleFromObj(interp, objv[4], &vec1[2]) != TCL_OK || 8568 Tcl_GetDoubleFromObj(interp, objv[5], &vec2[0]) != TCL_OK || 8569 Tcl_GetDoubleFromObj(interp, objv[6], &vec2[1]) != TCL_OK || 8570 Tcl_GetDoubleFromObj(interp, objv[7], &vec2[2]) != TCL_OK || 8571 Tcl_GetDoubleFromObj(interp, objv[8], &vec3[0]) != TCL_OK || 8572 Tcl_GetDoubleFromObj(interp, objv[9], &vec3[1]) != TCL_OK || 8573 Tcl_GetDoubleFromObj(interp, objv[10], &vec3[2]) != TCL_OK) { 8574 return TCL_ERROR; 8575 } 8576 const char *name = Tcl_GetString(objv[11]); 8577 if (!g_renderer->addParallelpiped(name, vec1, vec2, vec3)) { 8578 Tcl_AppendResult(interp, "Failed to create parallelpiped", (char*)NULL); 8579 return TCL_ERROR; 8580 } 8581 return TCL_OK; 8582 } 8583 8584 static int 8585 ParallelpipedDeleteOp(ClientData clientData, Tcl_Interp *interp, int objc, 8586 Tcl_Obj *const *objv) 8587 { 8588 if (objc == 3) { 8589 const char *name = Tcl_GetString(objv[2]); 8590 g_renderer->deleteGraphicsObject<Parallelpiped>(name); 8591 } else { 8592 g_renderer->deleteGraphicsObject<Parallelpiped>("all"); 8593 } 8594 return TCL_OK; 8595 } 8596 8597 static int 8598 ParallelpipedColorOp(ClientData clientData, Tcl_Interp *interp, int objc, 8599 Tcl_Obj *const *objv) 8600 { 8601 float color[3]; 8602 if (GetFloatFromObj(interp, objv[2], &color[0]) != TCL_OK || 8603 GetFloatFromObj(interp, objv[3], &color[1]) != TCL_OK || 8604 GetFloatFromObj(interp, objv[4], &color[2]) != TCL_OK) { 8605 return TCL_ERROR; 8606 } 8607 if (objc == 6) { 8608 const char *name = Tcl_GetString(objv[5]); 8609 g_renderer->setGraphicsObjectColor<Parallelpiped>(name, color); 8610 } else { 8611 g_renderer->setGraphicsObjectColor<Parallelpiped>("all", color); 8612 } 8613 return TCL_OK; 8614 } 8615 8616 static int 8617 ParallelpipedCullingOp(ClientData clientData, Tcl_Interp *interp, int objc, 8618 Tcl_Obj *const *objv) 8619 { 8620 bool state; 8621 if (GetBooleanFromObj(interp, objv[2], &state) != TCL_OK) { 8622 return TCL_ERROR; 8623 } 8624 if (objc == 4) { 8625 const char *name = Tcl_GetString(objv[3]); 8626 g_renderer->setGraphicsObjectCulling<Parallelpiped>(name, state); 8627 } else { 8628 g_renderer->setGraphicsObjectCulling<Parallelpiped>("all", state); 8629 } 8630 return TCL_OK; 8631 } 8632 8633 static int 8634 ParallelpipedEdgeVisibilityOp(ClientData clientData, Tcl_Interp *interp, int objc, 8635 Tcl_Obj *const *objv) 8636 { 8637 bool state; 8638 if (GetBooleanFromObj(interp, objv[2], &state) != TCL_OK) { 8639 return TCL_ERROR; 8640 } 8641 if (objc == 4) { 8642 const char *name = Tcl_GetString(objv[3]); 8643 g_renderer->setGraphicsObjectEdgeVisibility<Parallelpiped>(name, state); 8644 } else { 8645 g_renderer->setGraphicsObjectEdgeVisibility<Parallelpiped>("all", state); 8646 } 8647 return TCL_OK; 8648 } 8649 8650 static int 8651 ParallelpipedFlipNormalsOp(ClientData clientData, Tcl_Interp *interp, int objc, 8652 Tcl_Obj *const *objv) 8653 { 8654 bool state; 8655 if (GetBooleanFromObj(interp, objv[2], &state) != TCL_OK) { 8656 return TCL_ERROR; 8657 } 8658 if (objc == 4) { 8659 const char *name = Tcl_GetString(objv[3]); 8660 g_renderer->setGraphicsObjectFlipNormals<Parallelpiped>(name, state); 8661 } else { 8662 g_renderer->setGraphicsObjectFlipNormals<Parallelpiped>("all", state); 8663 } 8664 return TCL_OK; 8665 } 8666 8667 static int 8668 ParallelpipedLightingOp(ClientData clientData, Tcl_Interp *interp, int objc, 8669 Tcl_Obj *const *objv) 8670 { 8671 bool state; 8672 if (GetBooleanFromObj(interp, objv[2], &state) != TCL_OK) { 8673 return TCL_ERROR; 8674 } 8675 if (objc == 4) { 8676 const char *name = Tcl_GetString(objv[3]); 8677 g_renderer->setGraphicsObjectLighting<Parallelpiped>(name, state); 8678 } else { 8679 g_renderer->setGraphicsObjectLighting<Parallelpiped>("all", state); 8680 } 8681 return TCL_OK; 8682 } 8683 8684 static int 8685 ParallelpipedLineColorOp(ClientData clientData, Tcl_Interp *interp, int objc, 8686 Tcl_Obj *const *objv) 8687 { 8688 float color[3]; 8689 if (GetFloatFromObj(interp, objv[2], &color[0]) != TCL_OK || 8690 GetFloatFromObj(interp, objv[3], &color[1]) != TCL_OK || 8691 GetFloatFromObj(interp, objv[4], &color[2]) != TCL_OK) { 8692 return TCL_ERROR; 8693 } 8694 if (objc == 6) { 8695 const char *name = Tcl_GetString(objv[5]); 8696 g_renderer->setGraphicsObjectEdgeColor<Parallelpiped>(name, color); 8697 } else { 8698 g_renderer->setGraphicsObjectEdgeColor<Parallelpiped>("all", color); 8699 } 8700 return TCL_OK; 8701 } 8702 8703 static int 8704 ParallelpipedLineWidthOp(ClientData clientData, Tcl_Interp *interp, int objc, 8705 Tcl_Obj *const *objv) 8706 { 8707 float width; 8708 if (GetFloatFromObj(interp, objv[2], &width) != TCL_OK) { 8709 return TCL_ERROR; 8710 } 8711 if (objc == 4) { 8712 const char *name = Tcl_GetString(objv[3]); 8713 g_renderer->setGraphicsObjectEdgeWidth<Parallelpiped>(name, width); 8714 } else { 8715 g_renderer->setGraphicsObjectEdgeWidth<Parallelpiped>("all", width); 8716 } 8717 return TCL_OK; 8718 } 8719 8720 static int 8721 ParallelpipedMaterialOp(ClientData clientData, Tcl_Interp *interp, int objc, 8722 Tcl_Obj *const *objv) 8723 { 8724 double ambient, diffuse, specCoeff, specPower; 8725 if (Tcl_GetDoubleFromObj(interp, objv[2], &ambient) != TCL_OK || 8726 Tcl_GetDoubleFromObj(interp, objv[3], &diffuse) != TCL_OK || 8727 Tcl_GetDoubleFromObj(interp, objv[4], &specCoeff) != TCL_OK || 8728 Tcl_GetDoubleFromObj(interp, objv[5], &specPower) != TCL_OK) { 8729 return TCL_ERROR; 8730 } 8731 8732 if (objc == 7) { 8733 const char *name = Tcl_GetString(objv[6]); 8734 g_renderer->setGraphicsObjectAmbient<Parallelpiped>(name, ambient); 8735 g_renderer->setGraphicsObjectDiffuse<Parallelpiped>(name, diffuse); 8736 g_renderer->setGraphicsObjectSpecular<Parallelpiped>(name, specCoeff, specPower); 8737 } else { 8738 g_renderer->setGraphicsObjectAmbient<Parallelpiped>("all", ambient); 8739 g_renderer->setGraphicsObjectDiffuse<Parallelpiped>("all", diffuse); 8740 g_renderer->setGraphicsObjectSpecular<Parallelpiped>("all", specCoeff, specPower); 8741 } 8742 return TCL_OK; 8743 } 8744 8745 static int 8746 ParallelpipedOpacityOp(ClientData clientData, Tcl_Interp *interp, int objc, 8747 Tcl_Obj *const *objv) 8748 { 8749 double opacity; 8750 if (Tcl_GetDoubleFromObj(interp, objv[2], &opacity) != TCL_OK) { 8751 return TCL_ERROR; 8752 } 8753 if (objc == 4) { 8754 const char *name = Tcl_GetString(objv[3]); 8755 g_renderer->setGraphicsObjectOpacity<Parallelpiped>(name, opacity); 8756 } else { 8757 g_renderer->setGraphicsObjectOpacity<Parallelpiped>("all", opacity); 8758 } 8759 return TCL_OK; 8760 } 8761 8762 static int 8763 ParallelpipedOrientOp(ClientData clientData, Tcl_Interp *interp, int objc, 8764 Tcl_Obj *const *objv) 8765 { 8766 double quat[4]; 8767 if (Tcl_GetDoubleFromObj(interp, objv[2], &quat[0]) != TCL_OK || 8768 Tcl_GetDoubleFromObj(interp, objv[3], &quat[1]) != TCL_OK || 8769 Tcl_GetDoubleFromObj(interp, objv[4], &quat[2]) != TCL_OK || 8770 Tcl_GetDoubleFromObj(interp, objv[5], &quat[3]) != TCL_OK) { 8771 return TCL_ERROR; 8772 } 8773 if (objc == 7) { 8774 const char *name = Tcl_GetString(objv[6]); 8775 g_renderer->setGraphicsObjectOrientation<Parallelpiped>(name, quat); 8776 } else { 8777 g_renderer->setGraphicsObjectOrientation<Parallelpiped>("all", quat); 8778 } 8779 return TCL_OK; 8780 } 8781 8782 static int 8783 ParallelpipedOriginOp(ClientData clientData, Tcl_Interp *interp, int objc, 8784 Tcl_Obj *const *objv) 8785 { 8786 double origin[3]; 8787 if (Tcl_GetDoubleFromObj(interp, objv[2], &origin[0]) != TCL_OK || 8788 Tcl_GetDoubleFromObj(interp, objv[3], &origin[1]) != TCL_OK || 8789 Tcl_GetDoubleFromObj(interp, objv[4], &origin[2]) != TCL_OK) { 8790 return TCL_ERROR; 8791 } 8792 if (objc == 6) { 8793 const char *name = Tcl_GetString(objv[5]); 8794 g_renderer->setGraphicsObjectOrigin<Parallelpiped>(name, origin); 8795 } else { 8796 g_renderer->setGraphicsObjectOrigin<Parallelpiped>("all", origin); 8797 } 8798 return TCL_OK; 8799 } 8800 8801 static int 8802 ParallelpipedPositionOp(ClientData clientData, Tcl_Interp *interp, int objc, 8803 Tcl_Obj *const *objv) 8804 { 8805 double pos[3]; 8806 if (Tcl_GetDoubleFromObj(interp, objv[2], &pos[0]) != TCL_OK || 8807 Tcl_GetDoubleFromObj(interp, objv[3], &pos[1]) != TCL_OK || 8808 Tcl_GetDoubleFromObj(interp, objv[4], &pos[2]) != TCL_OK) { 8809 return TCL_ERROR; 8810 } 8811 if (objc == 6) { 8812 const char *name = Tcl_GetString(objv[5]); 8813 g_renderer->setGraphicsObjectPosition<Parallelpiped>(name, pos); 8814 } else { 8815 g_renderer->setGraphicsObjectPosition<Parallelpiped>("all", pos); 8816 } 8817 return TCL_OK; 8818 } 8819 8820 static int 8821 ParallelpipedScaleOp(ClientData clientData, Tcl_Interp *interp, int objc, 8822 Tcl_Obj *const *objv) 8823 { 8824 double scale[3]; 8825 if (Tcl_GetDoubleFromObj(interp, objv[2], &scale[0]) != TCL_OK || 8826 Tcl_GetDoubleFromObj(interp, objv[3], &scale[1]) != TCL_OK || 8827 Tcl_GetDoubleFromObj(interp, objv[4], &scale[2]) != TCL_OK) { 8828 return TCL_ERROR; 8829 } 8830 if (objc == 6) { 8831 const char *name = Tcl_GetString(objv[5]); 8832 g_renderer->setGraphicsObjectScale<Parallelpiped>(name, scale); 8833 } else { 8834 g_renderer->setGraphicsObjectScale<Parallelpiped>("all", scale); 8835 } 8836 return TCL_OK; 8837 } 8838 8839 static int 8840 ParallelpipedShadingOp(ClientData clientData, Tcl_Interp *interp, int objc, 8841 Tcl_Obj *const *objv) 8842 { 8843 GraphicsObject::ShadingModel shadeModel; 8844 const char *str = Tcl_GetString(objv[2]); 8845 if (str[0] == 'f' && strcmp(str, "flat") == 0) { 8846 shadeModel = GraphicsObject::SHADE_FLAT; 8847 } else if (str[0] == 's' && strcmp(str, "smooth") == 0) { 8848 shadeModel = GraphicsObject::SHADE_GOURAUD; 8849 } else { 8850 Tcl_AppendResult(interp, "bad shading option \"", str, 8851 "\": should be one of: 'flat', 'smooth'", (char*)NULL); 8852 return TCL_ERROR; 8853 } 8854 if (objc == 4) { 8855 const char *name = Tcl_GetString(objv[3]); 8856 g_renderer->setGraphicsObjectShadingModel<Parallelpiped>(name, shadeModel); 8857 } else { 8858 g_renderer->setGraphicsObjectShadingModel<Parallelpiped>("all", shadeModel); 8859 } 8860 return TCL_OK; 8861 } 8862 8863 static int 8864 ParallelpipedVisibleOp(ClientData clientData, Tcl_Interp *interp, int objc, 8865 Tcl_Obj *const *objv) 8866 { 8867 bool state; 8868 if (GetBooleanFromObj(interp, objv[2], &state) != TCL_OK) { 8869 return TCL_ERROR; 8870 } 8871 if (objc == 4) { 8872 const char *name = Tcl_GetString(objv[3]); 8873 g_renderer->setGraphicsObjectVisibility<Parallelpiped>(name, state); 8874 } else { 8875 g_renderer->setGraphicsObjectVisibility<Parallelpiped>("all", state); 8876 } 8877 return TCL_OK; 8878 } 8879 8880 static int 8881 ParallelpipedWireframeOp(ClientData clientData, Tcl_Interp *interp, int objc, 8882 Tcl_Obj *const *objv) 8883 { 8884 bool state; 8885 if (GetBooleanFromObj(interp, objv[2], &state) != TCL_OK) { 8886 return TCL_ERROR; 8887 } 8888 if (objc == 4) { 8889 const char *name = Tcl_GetString(objv[3]); 8890 g_renderer->setGraphicsObjectWireframe<Parallelpiped>(name, state); 8891 } else { 8892 g_renderer->setGraphicsObjectWireframe<Parallelpiped>("all", state); 8893 } 8894 return TCL_OK; 8895 } 8896 8897 static Rappture::CmdSpec parallelpipedOps[] = { 8898 {"add", 1, ParallelpipedAddOp, 12, 12, "v0x v0y v0z v1x v1y v1z v2x v2y v2z name"}, 8899 {"color", 2, ParallelpipedColorOp, 5, 6, "r g b ?name?"}, 8900 {"culling", 2, ParallelpipedCullingOp, 3, 4, "bool ?name?"}, 8901 {"delete", 1, ParallelpipedDeleteOp, 2, 3, "?name?"}, 8902 {"edges", 1, ParallelpipedEdgeVisibilityOp, 3, 4, "bool ?name?"}, 8903 {"flipnorms", 1, ParallelpipedFlipNormalsOp, 3, 4, "bool ?name?"}, 8904 {"lighting", 3, ParallelpipedLightingOp, 3, 4, "bool ?name?"}, 8905 {"linecolor", 5, ParallelpipedLineColorOp, 5, 6, "r g b ?name?"}, 8906 {"linewidth", 5, ParallelpipedLineWidthOp, 3, 4, "width ?name?"}, 8907 {"material", 1, ParallelpipedMaterialOp, 6, 7, "ambientCoeff diffuseCoeff specularCoeff specularPower ?name?"}, 8908 {"opacity", 2, ParallelpipedOpacityOp, 3, 4, "value ?name?"}, 8909 {"orient", 4, ParallelpipedOrientOp, 6, 7, "qw qx qy qz ?name?"}, 8910 {"origin", 4, ParallelpipedOriginOp, 5, 6, "x y z ?name?"}, 8911 {"pos", 1, ParallelpipedPositionOp, 5, 6, "x y z ?name?"}, 8912 {"scale", 2, ParallelpipedScaleOp, 5, 6, "sx sy sz ?name?"}, 8913 {"shading", 2, ParallelpipedShadingOp, 3, 4, "val ?name?"}, 8914 {"visible", 1, ParallelpipedVisibleOp, 3, 4, "bool ?name?"}, 8915 {"wireframe", 1, ParallelpipedWireframeOp, 3, 4, "bool ?name?"} 8916 }; 8917 static int nParallelpipedOps = NumCmdSpecs(parallelpipedOps); 8918 8919 static int 8920 ParallelpipedCmd(ClientData clientData, Tcl_Interp *interp, int objc, 8921 Tcl_Obj *const *objv) 8922 { 8923 Tcl_ObjCmdProc *proc; 8924 8925 proc = Rappture::GetOpFromObj(interp, nParallelpipedOps, parallelpipedOps, 8926 Rappture::CMDSPEC_ARG1, objc, objv, 0); 8927 if (proc == NULL) { 8928 return TCL_ERROR; 8929 } 8930 return (*proc) (clientData, interp, objc, objv); 8931 } 8932 8933 static int 8561 8934 PolyDataAddOp(ClientData clientData, Tcl_Interp *interp, int objc, 8562 8935 Tcl_Obj *const *objv) … … 12228 12601 { 12229 12602 Tcl_MakeSafe(interp); 12230 Tcl_CreateObjCommand(interp, "arc", ArcCmd, clientData, NULL); 12231 Tcl_CreateObjCommand(interp, "arrow", ArrowCmd, clientData, NULL); 12232 Tcl_CreateObjCommand(interp, "axis", AxisCmd, clientData, NULL); 12233 Tcl_CreateObjCommand(interp, "box", BoxCmd, clientData, NULL); 12234 Tcl_CreateObjCommand(interp, "camera", CameraCmd, clientData, NULL); 12235 Tcl_CreateObjCommand(interp, "clientinfo", ClientInfoCmd, clientData, NULL); 12236 Tcl_CreateObjCommand(interp, "colormap", ColorMapCmd, clientData, NULL); 12237 Tcl_CreateObjCommand(interp, "cone", ConeCmd, clientData, NULL); 12238 Tcl_CreateObjCommand(interp, "contour2d", Contour2DCmd, clientData, NULL); 12239 Tcl_CreateObjCommand(interp, "contour3d", Contour3DCmd, clientData, NULL); 12240 Tcl_CreateObjCommand(interp, "cutplane", CutplaneCmd, clientData, NULL); 12241 Tcl_CreateObjCommand(interp, "cylinder", CylinderCmd, clientData, NULL); 12242 Tcl_CreateObjCommand(interp, "dataset", DataSetCmd, clientData, NULL); 12243 Tcl_CreateObjCommand(interp, "disk", DiskCmd, clientData, NULL); 12244 Tcl_CreateObjCommand(interp, "glyphs", GlyphsCmd, clientData, NULL); 12245 Tcl_CreateObjCommand(interp, "group", GroupCmd, clientData, NULL); 12246 Tcl_CreateObjCommand(interp, "heightmap", HeightMapCmd, clientData, NULL); 12247 Tcl_CreateObjCommand(interp, "image", ImageCmd, clientData, NULL); 12248 Tcl_CreateObjCommand(interp, "imgflush", ImageFlushCmd, clientData, NULL); 12249 Tcl_CreateObjCommand(interp, "legend", LegendCmd, clientData, NULL); 12250 Tcl_CreateObjCommand(interp, "legend2", LegendSimpleCmd,clientData, NULL); 12251 Tcl_CreateObjCommand(interp, "lic", LICCmd, clientData, NULL); 12252 Tcl_CreateObjCommand(interp, "line", LineCmd, clientData, NULL); 12253 Tcl_CreateObjCommand(interp, "molecule", MoleculeCmd, clientData, NULL); 12254 Tcl_CreateObjCommand(interp, "outline", OutlineCmd, clientData, NULL); 12255 Tcl_CreateObjCommand(interp, "polydata", PolyDataCmd, clientData, NULL); 12256 Tcl_CreateObjCommand(interp, "polygon", PolygonCmd, clientData, NULL); 12257 Tcl_CreateObjCommand(interp, "pseudocolor", PseudoColorCmd, clientData, NULL); 12258 Tcl_CreateObjCommand(interp, "renderer", RendererCmd, clientData, NULL); 12259 Tcl_CreateObjCommand(interp, "screen", ScreenCmd, clientData, NULL); 12260 Tcl_CreateObjCommand(interp, "sphere", SphereCmd, clientData, NULL); 12261 Tcl_CreateObjCommand(interp, "streamlines", StreamlinesCmd, clientData, NULL); 12262 Tcl_CreateObjCommand(interp, "text3d", Text3DCmd, clientData, NULL); 12263 Tcl_CreateObjCommand(interp, "volume", VolumeCmd, clientData, NULL); 12264 Tcl_CreateObjCommand(interp, "warp", WarpCmd, clientData, NULL); 12603 Tcl_CreateObjCommand(interp, "arc", ArcCmd, clientData, NULL); 12604 Tcl_CreateObjCommand(interp, "arrow", ArrowCmd, clientData, NULL); 12605 Tcl_CreateObjCommand(interp, "axis", AxisCmd, clientData, NULL); 12606 Tcl_CreateObjCommand(interp, "box", BoxCmd, clientData, NULL); 12607 Tcl_CreateObjCommand(interp, "camera", CameraCmd, clientData, NULL); 12608 Tcl_CreateObjCommand(interp, "clientinfo", ClientInfoCmd, clientData, NULL); 12609 Tcl_CreateObjCommand(interp, "colormap", ColorMapCmd, clientData, NULL); 12610 Tcl_CreateObjCommand(interp, "cone", ConeCmd, clientData, NULL); 12611 Tcl_CreateObjCommand(interp, "contour2d", Contour2DCmd, clientData, NULL); 12612 Tcl_CreateObjCommand(interp, "contour3d", Contour3DCmd, clientData, NULL); 12613 Tcl_CreateObjCommand(interp, "cutplane", CutplaneCmd, clientData, NULL); 12614 Tcl_CreateObjCommand(interp, "cylinder", CylinderCmd, clientData, NULL); 12615 Tcl_CreateObjCommand(interp, "dataset", DataSetCmd, clientData, NULL); 12616 Tcl_CreateObjCommand(interp, "disk", DiskCmd, clientData, NULL); 12617 Tcl_CreateObjCommand(interp, "glyphs", GlyphsCmd, clientData, NULL); 12618 Tcl_CreateObjCommand(interp, "group", GroupCmd, clientData, NULL); 12619 Tcl_CreateObjCommand(interp, "heightmap", HeightMapCmd, clientData, NULL); 12620 Tcl_CreateObjCommand(interp, "image", ImageCmd, clientData, NULL); 12621 Tcl_CreateObjCommand(interp, "imgflush", ImageFlushCmd, clientData, NULL); 12622 Tcl_CreateObjCommand(interp, "legend", LegendCmd, clientData, NULL); 12623 Tcl_CreateObjCommand(interp, "legend2", LegendSimpleCmd, clientData, NULL); 12624 Tcl_CreateObjCommand(interp, "lic", LICCmd, clientData, NULL); 12625 Tcl_CreateObjCommand(interp, "line", LineCmd, clientData, NULL); 12626 Tcl_CreateObjCommand(interp, "molecule", MoleculeCmd, clientData, NULL); 12627 Tcl_CreateObjCommand(interp, "outline", OutlineCmd, clientData, NULL); 12628 Tcl_CreateObjCommand(interp, "parallelpiped", ParallelpipedCmd, clientData, NULL); 12629 Tcl_CreateObjCommand(interp, "polydata", PolyDataCmd, clientData, NULL); 12630 Tcl_CreateObjCommand(interp, "polygon", PolygonCmd, clientData, NULL); 12631 Tcl_CreateObjCommand(interp, "pseudocolor", PseudoColorCmd, clientData, NULL); 12632 Tcl_CreateObjCommand(interp, "renderer", RendererCmd, clientData, NULL); 12633 Tcl_CreateObjCommand(interp, "screen", ScreenCmd, clientData, NULL); 12634 Tcl_CreateObjCommand(interp, "sphere", SphereCmd, clientData, NULL); 12635 Tcl_CreateObjCommand(interp, "streamlines", StreamlinesCmd, clientData, NULL); 12636 Tcl_CreateObjCommand(interp, "text3d", Text3DCmd, clientData, NULL); 12637 Tcl_CreateObjCommand(interp, "volume", VolumeCmd, clientData, NULL); 12638 Tcl_CreateObjCommand(interp, "warp", WarpCmd, clientData, NULL); 12265 12639 } 12266 12640 … … 12295 12669 Tcl_DeleteCommand(interp, "molecule"); 12296 12670 Tcl_DeleteCommand(interp, "outline"); 12671 Tcl_DeleteCommand(interp, "parallelpiped"); 12297 12672 Tcl_DeleteCommand(interp, "polydata"); 12298 12673 Tcl_DeleteCommand(interp, "polygon"); -
trunk/packages/vizservers/vtkvis/RendererGraphicsObjs.cpp
r3818 r3859 28 28 #include "Line.h" 29 29 #include "Molecule.h" 30 #include "Parallelpiped.h" 30 31 #include "PolyData.h" 31 32 #include "PseudoColor.h" … … 123 124 Renderer::getGraphicsObjectHashmap<Outline>() 124 125 { return _outlines; } 126 127 template<> 128 Renderer::ParallelpipedHashmap & 129 Renderer::getGraphicsObjectHashmap<Parallelpiped>() 130 { return _parallelpipeds; } 125 131 126 132 template<> … … 173 179 template Group *Renderer::getGraphicsObject(const DataSetId&); 174 180 template Line *Renderer::getGraphicsObject(const DataSetId&); 181 template Parallelpiped *Renderer::getGraphicsObject(const DataSetId&); 175 182 template Polygon *Renderer::getGraphicsObject(const DataSetId&); 176 183 template Sphere *Renderer::getGraphicsObject(const DataSetId&); … … 287 294 } 288 295 if ((gobj = getGraphicsObject<Line>(id)) != NULL) { 296 return gobj; 297 } 298 if ((gobj = getGraphicsObject<Parallelpiped>(id)) != NULL) { 289 299 return gobj; 290 300 } … … 2938 2948 2939 2949 /** 2950 * \brief Create a new Parallelpiped and associate it with an ID 2951 */ 2952 bool Renderer::addParallelpiped(const DataSetId& id, 2953 double vec1[3], double vec2[3], double vec3[3], 2954 bool flipNormals) 2955 { 2956 Parallelpiped *gobj; 2957 if ((gobj = getGraphicsObject<Parallelpiped>(id)) != NULL) { 2958 WARN("Replacing existing %s %s", gobj->getClassName(), id.c_str()); 2959 deleteGraphicsObject<Parallelpiped>(id); 2960 } 2961 2962 gobj = new Parallelpiped(); 2963 2964 gobj->setDataSet(NULL, this); 2965 2966 if (gobj->getProp() == NULL && 2967 gobj->getOverlayProp() == NULL) { 2968 delete gobj; 2969 return false; 2970 } else { 2971 if (gobj->getProp()) 2972 _renderer->AddViewProp(gobj->getProp()); 2973 if (gobj->getOverlayProp()) 2974 _renderer->AddViewProp(gobj->getOverlayProp()); 2975 } 2976 2977 gobj->setVectors(vec1, vec2, vec3); 2978 if (flipNormals) 2979 gobj->flipNormals(flipNormals); 2980 2981 getGraphicsObjectHashmap<Parallelpiped>()[id] = gobj; 2982 2983 sceneBoundsChanged(); 2984 _needsRedraw = true; 2985 return true; 2986 } 2987 2988 /** 2940 2989 * \brief Create a new n-sided regular Polygon and associate it with an ID 2941 2990 */ -
trunk/packages/vizservers/vtkvis/protocol.txt
r3835 r3859 685 685 outline scale <sx> <sy> <sz> <?datasetName?> 686 686 outline visible <bool> <?datasetName?> 687 688 parallelpiped add <v0x> <v0y> <v0z> <v1x> <v1y> <v1z> <v2x> <v2y> <v2z> <name> 689 Specify parallelpiped using 3 basis vectors. The 3 vectors should 690 be given in order to create a right-handed coordinate system, i.e. 691 (v0 cross v1) dot v2 should be positive. 692 parallelpiped color <r> <g> <b> <?name?> 693 parallelpiped culling <bool> <?name?> 694 parallelpiped delete <?name?> 695 parallelpiped edges <bool> <?name?> 696 parallelpiped flipnorm <bool> <?name?> 697 parallelpiped lighting <bool> <?name?> 698 parallelpiped linecolor <r> <g> <b> <?name?> 699 parallelpiped linewidth <val> <?name?> 700 parallelpiped material <ambientCoeff> <diffuseCoeff> <specularCoeff> <specularExp> <?name?> 701 parallelpiped opacity <val> <?name?> 702 parallelpiped orient <qw> <qx> <qy> <qz> <?name?> 703 parallelpiped origin <x> <y> <z> <?name?> 704 parallelpiped pos <x> <y> <z> <?name?> 705 parallelpiped scale <sx> <sy> <sz> <?name?> 706 parallelpiped shading <val> <?name?> 707 val = flat|smooth 708 parallelpiped visible <bool> <?name?> 709 parallelpiped wireframe <bool> <?name?> 687 710 688 711 polydata add <?datasetName?>
Note: See TracChangeset
for help on using the changeset viewer.