Ignore:
Timestamp:
Mar 19, 2013, 1:08:03 AM (12 years ago)
Author:
ldelgass
Message:

Add outline command/graphics object to vtkvis and bump version. This is
intended to replace the outline/color subcommands in dataset.

Location:
trunk/packages/vizservers/vtkvis
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/vizservers/vtkvis/Makefile.in

    r3479 r3535  
    156156                RpLIC.cpp \
    157157                RpMolecule.cpp \
     158                RpOutline.cpp \
    158159                RpPolyData.cpp \
    159160                RpPolygon.cpp \
     
    237238RpMolecule.o: RpMolecule.h RpMoleculeData.h RpVtkGraphicsObject.h RpVtkDataSet.h RpVtkRenderer.h ColorMap.h Trace.h
    238239RpMolecule2.o: RpMolecule2.h RpMoleculeData.h RpVtkGraphicsObject.h RpVtkDataSet.h RpVtkRenderer.h ColorMap.h Trace.h
     240RpOutline.o: RpOutline.h RpVtkGraphicsObject.h RpVtkDataSet.h Trace.h
    239241RpPolyData.o: RpPolyData.h RpVtkGraphicsObject.h RpVtkDataSet.h RpVtkRenderer.h Trace.h
    240242RpPolygon.o: RpPolygon.h RpShape.h RpVtkGraphicsObject.h RpVtkDataSet.h RpVtkRenderer.h Trace.h
     
    246248RpVtkDataSet.o: RpVtkDataSet.h Trace.h
    247249RpVtkGraphicsObject.o: RpVtkGraphicsObject.h RpVtkRenderer.h RpVtkDataSet.h ColorMap.h Trace.h
    248 RpVtkRenderer.o: RpVtkRenderer.h RpVtkRendererGraphicsObjs.h vtkRpCubeAxesActor.h vtkRpAxisFollower.h vtkRpAxisActor.h RpMath.h RpVtkDataSet.h RpArc.h RpArrow.h RpBox.h RpCone.h RpContour2D.h RpContour3D.h RpCutplane.h RpCylinder.h RpDisk.h RpGlyphs.h RpGroup.h RpHeightMap.h RpLIC.h RpLine.h RpMolecule.h RpPolyData.h RpPolygon.h RpPseudoColor.h RpSphere.h RpStreamlines.h RpVolume.h ColorMap.h Trace.h
    249 RpVtkRendererCmd.o: RpVtkRenderer.h RpVtkRendererGraphicsObjs.h vtkRpCubeAxesActor.h vtkRpAxisFollower.h vtkRpAxisActor.h RpVtkDataSet.h RpArc.h RpArrow.h RpBox.h RpCone.h RpContour2D.h RpContour3D.h RpCutplane.h RpCylinder.h RpDisk.h RpGlyphs.h RpGroup.h RpHeightMap.h RpLIC.h RpLine.h RpMolecule.h RpPolyData.h RpPolygon.h RpPseudoColor.h RpSphere.h RpStreamlines.h RpVolume.h ColorMap.h ReadBuffer.h ResponseQueue.h Trace.h CmdProc.h PPMWriter.h TGAWriter.h
    250 RpVtkRendererGraphicsObjs.o: RpVtkRenderer.h RpVtkRendererGraphicsObjs.h RpVtkDataSet.h RpArc.h RpArrow.h RpBox.h RpCone.h RpContour2D.h RpContour3D.h RpCutplane.h RpCylinder.h RpDisk.h RpGlyphs.h RpGroup.h RpHeightMap.h RpLIC.h RpLine.h RpMolecule.h RpPolyData.h RpPolygon.h RpPseudoColor.h RpSphere.h RpStreamlines.h RpVolume.h ColorMap.h Trace.h
     250RpVtkRenderer.o: RpVtkRenderer.h RpVtkRendererGraphicsObjs.h vtkRpCubeAxesActor.h vtkRpAxisFollower.h vtkRpAxisActor.h RpMath.h RpVtkDataSet.h RpArc.h RpArrow.h RpBox.h RpCone.h RpContour2D.h RpContour3D.h RpCutplane.h RpCylinder.h RpDisk.h RpGlyphs.h RpGroup.h RpHeightMap.h RpLIC.h RpLine.h RpMolecule.h RpOutline.h RpPolyData.h RpPolygon.h RpPseudoColor.h RpSphere.h RpStreamlines.h RpVolume.h ColorMap.h Trace.h
     251RpVtkRendererCmd.o: RpVtkRenderer.h RpVtkRendererGraphicsObjs.h vtkRpCubeAxesActor.h vtkRpAxisFollower.h vtkRpAxisActor.h RpVtkDataSet.h RpArc.h RpArrow.h RpBox.h RpCone.h RpContour2D.h RpContour3D.h RpCutplane.h RpCylinder.h RpDisk.h RpGlyphs.h RpGroup.h RpHeightMap.h RpLIC.h RpLine.h RpMolecule.h RpOutline.h RpPolyData.h RpPolygon.h RpPseudoColor.h RpSphere.h RpStreamlines.h RpVolume.h ColorMap.h ReadBuffer.h ResponseQueue.h Trace.h CmdProc.h PPMWriter.h TGAWriter.h
     252RpVtkRendererGraphicsObjs.o: RpVtkRenderer.h RpVtkRendererGraphicsObjs.h RpVtkDataSet.h RpArc.h RpArrow.h RpBox.h RpCone.h RpContour2D.h RpContour3D.h RpCutplane.h RpCylinder.h RpDisk.h RpGlyphs.h RpGroup.h RpHeightMap.h RpLIC.h RpLine.h RpMolecule.h RpOutline.h RpPolyData.h RpPolygon.h RpPseudoColor.h RpSphere.h RpStreamlines.h RpVolume.h ColorMap.h Trace.h
    251253RpVtkRenderServer.o: RpVtkRenderServer.h RpVtkRendererCmd.h RpVtkRenderer.h vtkRpCubeAxesActor.h vtkRpAxisFollower.h vtkRpAxisActor.h ReadBuffer.h ResponseQueue.h Trace.h PPMWriter.h TGAWriter.h
    252254RpWarp.o: RpWarp.h RpVtkGraphicsObject.h RpVtkDataSet.h RpVtkRenderer.h ColorMap.h Trace.h
  • trunk/packages/vizservers/vtkvis/RpVtkRenderServer.cpp

    r3465 r3535  
    522522     * also be used to supply information about the server (version, memory
    523523     * size, etc). */
    524     fprintf(g_fOut, "VtkVis 1.1 (build %s)\n", SVN_VERSION);
     524    fprintf(g_fOut, "VtkVis 1.2 (build %s)\n", SVN_VERSION);
    525525    fflush(g_fOut);
    526526
  • trunk/packages/vizservers/vtkvis/RpVtkRenderer.cpp

    r3525 r3535  
    165165    deleteAllGraphicsObjects<Line>();
    166166    deleteAllGraphicsObjects<Molecule>();
     167    deleteAllGraphicsObjects<Outline>();
    167168    deleteAllGraphicsObjects<PolyData>();
    168169    deleteAllGraphicsObjects<Polygon>();
     
    243244        deleteGraphicsObject<LIC>(itr->second->getName());
    244245        deleteGraphicsObject<Molecule>(itr->second->getName());
     246        deleteGraphicsObject<Outline>(itr->second->getName());
    245247        deleteGraphicsObject<PolyData>(itr->second->getName());
    246248        deleteGraphicsObject<PseudoColor>(itr->second->getName());
     
    22082210    setGraphicsObjectAspect<Line>(aspectRatio);
    22092211    setGraphicsObjectAspect<Molecule>(aspectRatio);
     2212    setGraphicsObjectAspect<Outline>(aspectRatio);
    22102213    setGraphicsObjectAspect<PolyData>(aspectRatio);
    22112214    setGraphicsObjectAspect<Polygon>(aspectRatio);
     
    31263129    mergeGraphicsObjectBounds<Line>(bounds, onlyVisible);
    31273130    mergeGraphicsObjectBounds<Molecule>(bounds, onlyVisible);
     3131    mergeGraphicsObjectBounds<Outline>(bounds, onlyVisible);
    31283132    mergeGraphicsObjectBounds<PolyData>(bounds, onlyVisible);
    31293133    mergeGraphicsObjectBounds<Polygon>(bounds, onlyVisible);
     
    32043208    mergeGraphicsObjectUnscaledBounds<Line>(bounds, onlyVisible);
    32053209    mergeGraphicsObjectUnscaledBounds<Molecule>(bounds, onlyVisible);
     3210    mergeGraphicsObjectUnscaledBounds<Outline>(bounds, onlyVisible);
    32063211    mergeGraphicsObjectUnscaledBounds<PolyData>(bounds, onlyVisible);
    32073212    mergeGraphicsObjectUnscaledBounds<Polygon>(bounds, onlyVisible);
     
    39383943    if (id.compare("all") == 0 || getGraphicsObject<Molecule>(id) != NULL)
    39393944        setGraphicsObjectOpacity<Molecule>(id, opacity);
     3945    if (id.compare("all") == 0 || getGraphicsObject<Outline>(id) != NULL)
     3946        setGraphicsObjectOpacity<Outline>(id, opacity);
    39403947    if (id.compare("all") == 0 || getGraphicsObject<PolyData>(id) != NULL)
    39413948        setGraphicsObjectOpacity<PolyData>(id, opacity);
     
    39923999    if (id.compare("all") == 0 || getGraphicsObject<Molecule>(id) != NULL)
    39934000        setGraphicsObjectVisibility<Molecule>(id, state);
     4001    if (id.compare("all") == 0 || getGraphicsObject<Outline>(id) != NULL)
     4002        setGraphicsObjectVisibility<Outline>(id, state);
    39944003    if (id.compare("all") == 0 || getGraphicsObject<PolyData>(id) != NULL)
    39954004        setGraphicsObjectVisibility<PolyData>(id, state);
     
    42114220    setGraphicsObjectClippingPlanes<Line>(_activeClipPlanes);
    42124221    setGraphicsObjectClippingPlanes<Molecule>(_activeClipPlanes);
     4222    setGraphicsObjectClippingPlanes<Outline>(_activeClipPlanes);
    42134223    setGraphicsObjectClippingPlanes<PolyData>(_activeClipPlanes);
    42144224    setGraphicsObjectClippingPlanes<Polygon>(_activeClipPlanes);
  • trunk/packages/vizservers/vtkvis/RpVtkRenderer.h

    r3490 r3535  
    4343#include "RpLine.h"
    4444#include "RpMolecule.h"
     45#include "RpOutline.h"
    4546#include "RpPolyData.h"
    4647#include "RpPolygon.h"
     
    840841    typedef std::tr1::unordered_map<DataSetId, Line *> LineHashmap;
    841842    typedef std::tr1::unordered_map<DataSetId, Molecule *> MoleculeHashmap;
     843    typedef std::tr1::unordered_map<DataSetId, Outline *> OutlineHashmap;
    842844    typedef std::tr1::unordered_map<DataSetId, PolyData *> PolyDataHashmap;
    843845    typedef std::tr1::unordered_map<DataSetId, Polygon *> PolygonHashmap;
     
    970972    LineHashmap _lines;
    971973    MoleculeHashmap _molecules;
     974    OutlineHashmap _outlines;
    972975    PolyDataHashmap _polyDatas;
    973976    PolygonHashmap _polygons;
  • trunk/packages/vizservers/vtkvis/RpVtkRendererCmd.cpp

    r3526 r3535  
    70787078
    70797079static int
     7080OutlineAddOp(ClientData clientData, Tcl_Interp *interp, int objc,
     7081             Tcl_Obj *const *objv)
     7082{
     7083    if (objc == 3) {
     7084        const char *name = Tcl_GetString(objv[2]);
     7085        if (!g_renderer->addGraphicsObject<Outline>(name)) {
     7086            Tcl_AppendResult(interp, "Failed to create Outline", (char*)NULL);
     7087            return TCL_ERROR;
     7088        }
     7089    } else {
     7090        if (!g_renderer->addGraphicsObject<Outline>("all")) {
     7091            Tcl_AppendResult(interp, "Failed to create Outline for one or more data sets", (char*)NULL);
     7092            return TCL_ERROR;
     7093        }
     7094    }
     7095    return TCL_OK;
     7096}
     7097
     7098static int
     7099OutlineDeleteOp(ClientData clientData, Tcl_Interp *interp, int objc,
     7100                Tcl_Obj *const *objv)
     7101{
     7102    if (objc == 3) {
     7103        const char *name = Tcl_GetString(objv[2]);
     7104        g_renderer->deleteGraphicsObject<Outline>(name);
     7105    } else {
     7106        g_renderer->deleteGraphicsObject<Outline>("all");
     7107    }
     7108    return TCL_OK;
     7109}
     7110
     7111static int
     7112OutlineColorOp(ClientData clientData, Tcl_Interp *interp, int objc,
     7113               Tcl_Obj *const *objv)
     7114{
     7115    float color[3];
     7116    if (GetFloatFromObj(interp, objv[2], &color[0]) != TCL_OK ||
     7117        GetFloatFromObj(interp, objv[3], &color[1]) != TCL_OK ||
     7118        GetFloatFromObj(interp, objv[4], &color[2]) != TCL_OK) {
     7119        return TCL_ERROR;
     7120    }
     7121    if (objc == 6) {
     7122        const char *name = Tcl_GetString(objv[5]);
     7123        g_renderer->setGraphicsObjectColor<Outline>(name, color);
     7124    } else {
     7125        g_renderer->setGraphicsObjectColor<Outline>("all", color);
     7126    }
     7127    return TCL_OK;
     7128}
     7129
     7130static int
     7131OutlineLineWidthOp(ClientData clientData, Tcl_Interp *interp, int objc,
     7132                   Tcl_Obj *const *objv)
     7133{
     7134    float width;
     7135    if (GetFloatFromObj(interp, objv[2], &width) != TCL_OK) {
     7136        return TCL_ERROR;
     7137    }
     7138    if (objc == 4) {
     7139        const char *name = Tcl_GetString(objv[3]);
     7140        g_renderer->setGraphicsObjectEdgeWidth<Outline>(name, width);
     7141    } else {
     7142        g_renderer->setGraphicsObjectEdgeWidth<Outline>("all", width);
     7143    }
     7144    return TCL_OK;
     7145}
     7146
     7147static int
     7148OutlineOpacityOp(ClientData clientData, Tcl_Interp *interp, int objc,
     7149                 Tcl_Obj *const *objv)
     7150{
     7151    double opacity;
     7152    if (Tcl_GetDoubleFromObj(interp, objv[2], &opacity) != TCL_OK) {
     7153        return TCL_ERROR;
     7154    }
     7155    if (objc == 4) {
     7156        const char *name = Tcl_GetString(objv[3]);
     7157        g_renderer->setGraphicsObjectOpacity<Outline>(name, opacity);
     7158    } else {
     7159        g_renderer->setGraphicsObjectOpacity<Outline>("all", opacity);
     7160    }
     7161    return TCL_OK;
     7162}
     7163
     7164static int
     7165OutlineOrientOp(ClientData clientData, Tcl_Interp *interp, int objc,
     7166                Tcl_Obj *const *objv)
     7167{
     7168    double quat[4];
     7169    if (Tcl_GetDoubleFromObj(interp, objv[2], &quat[0]) != TCL_OK ||
     7170        Tcl_GetDoubleFromObj(interp, objv[3], &quat[1]) != TCL_OK ||
     7171        Tcl_GetDoubleFromObj(interp, objv[4], &quat[2]) != TCL_OK ||
     7172        Tcl_GetDoubleFromObj(interp, objv[5], &quat[3]) != TCL_OK) {
     7173        return TCL_ERROR;
     7174    }
     7175    if (objc == 7) {
     7176        const char *name = Tcl_GetString(objv[6]);
     7177        g_renderer->setGraphicsObjectOrientation<Outline>(name, quat);
     7178    } else {
     7179        g_renderer->setGraphicsObjectOrientation<Outline>("all", quat);
     7180    }
     7181    return TCL_OK;
     7182}
     7183
     7184static int
     7185OutlinePositionOp(ClientData clientData, Tcl_Interp *interp, int objc,
     7186                  Tcl_Obj *const *objv)
     7187{
     7188    double pos[3];
     7189    if (Tcl_GetDoubleFromObj(interp, objv[2], &pos[0]) != TCL_OK ||
     7190        Tcl_GetDoubleFromObj(interp, objv[3], &pos[1]) != TCL_OK ||
     7191        Tcl_GetDoubleFromObj(interp, objv[4], &pos[2]) != TCL_OK) {
     7192        return TCL_ERROR;
     7193    }
     7194    if (objc == 6) {
     7195        const char *name = Tcl_GetString(objv[5]);
     7196        g_renderer->setGraphicsObjectPosition<Outline>(name, pos);
     7197    } else {
     7198        g_renderer->setGraphicsObjectPosition<Outline>("all", pos);
     7199    }
     7200    return TCL_OK;
     7201}
     7202
     7203static int
     7204OutlineScaleOp(ClientData clientData, Tcl_Interp *interp, int objc,
     7205               Tcl_Obj *const *objv)
     7206{
     7207    double scale[3];
     7208    if (Tcl_GetDoubleFromObj(interp, objv[2], &scale[0]) != TCL_OK ||
     7209        Tcl_GetDoubleFromObj(interp, objv[3], &scale[1]) != TCL_OK ||
     7210        Tcl_GetDoubleFromObj(interp, objv[4], &scale[2]) != TCL_OK) {
     7211        return TCL_ERROR;
     7212    }
     7213    if (objc == 6) {
     7214        const char *name = Tcl_GetString(objv[5]);
     7215        g_renderer->setGraphicsObjectScale<Outline>(name, scale);
     7216    } else {
     7217        g_renderer->setGraphicsObjectScale<Outline>("all", scale);
     7218    }
     7219    return TCL_OK;
     7220}
     7221
     7222static int
     7223OutlineVisibleOp(ClientData clientData, Tcl_Interp *interp, int objc,
     7224                 Tcl_Obj *const *objv)
     7225{
     7226    bool state;
     7227    if (GetBooleanFromObj(interp, objv[2], &state) != TCL_OK) {
     7228        return TCL_ERROR;
     7229    }
     7230    if (objc == 4) {
     7231        const char *name = Tcl_GetString(objv[3]);
     7232        g_renderer->setGraphicsObjectVisibility<Outline>(name, state);
     7233    } else {
     7234        g_renderer->setGraphicsObjectVisibility<Outline>("all", state);
     7235    }
     7236    return TCL_OK;
     7237}
     7238
     7239static Rappture::CmdSpec outlineOps[] = {
     7240    {"add",       1, OutlineAddOp, 2, 3, "?dataSetName?"},
     7241    {"color",     1, OutlineColorOp, 5, 6, "r g b ?dataSetName?"},
     7242    {"delete",    1, OutlineDeleteOp, 2, 3, "?dataSetName?"},
     7243    {"linecolor", 5, OutlineColorOp, 5, 6, "r g b ?dataSetName?"},
     7244    {"linewidth", 5, OutlineLineWidthOp, 3, 4, "width ?dataSetName?"},
     7245    {"opacity",   2, OutlineOpacityOp, 3, 4, "value ?dataSetName?"},
     7246    {"orient",    2, OutlineOrientOp, 6, 7, "qw qx qy qz ?dataSetName?"},
     7247    {"pos",       2, OutlinePositionOp, 5, 6, "x y z ?dataSetName?"},
     7248    {"scale",     2, OutlineScaleOp, 5, 6, "sx sy sz ?dataSetName?"},
     7249    {"visible",   1, OutlineVisibleOp, 3, 4, "bool ?dataSetName?"}
     7250};
     7251static int nOutlineOps = NumCmdSpecs(outlineOps);
     7252
     7253static int
     7254OutlineCmd(ClientData clientData, Tcl_Interp *interp, int objc,
     7255           Tcl_Obj *const *objv)
     7256{
     7257    Tcl_ObjCmdProc *proc;
     7258
     7259    proc = Rappture::GetOpFromObj(interp, nOutlineOps, outlineOps,
     7260                                  Rappture::CMDSPEC_ARG1, objc, objv, 0);
     7261    if (proc == NULL) {
     7262        return TCL_ERROR;
     7263    }
     7264    return (*proc) (clientData, interp, objc, objv);
     7265}
     7266
     7267static int
    70807268PolyDataAddOp(ClientData clientData, Tcl_Interp *interp, int objc,
    70817269              Tcl_Obj *const *objv)
     
    995510143    Tcl_CreateObjCommand(interp, "line",        LineCmd,        clientData, NULL);
    995610144    Tcl_CreateObjCommand(interp, "molecule",    MoleculeCmd,    clientData, NULL);
     10145    Tcl_CreateObjCommand(interp, "outline",     OutlineCmd,     clientData, NULL);
    995710146    Tcl_CreateObjCommand(interp, "polydata",    PolyDataCmd,    clientData, NULL);
    995810147    Tcl_CreateObjCommand(interp, "polygon",     PolygonCmd,     clientData, NULL);
     
    999210181    Tcl_DeleteCommand(interp, "line");
    999310182    Tcl_DeleteCommand(interp, "molecule");
     10183    Tcl_DeleteCommand(interp, "outline");
    999410184    Tcl_DeleteCommand(interp, "polydata");
    999510185    Tcl_DeleteCommand(interp, "polygon");
  • trunk/packages/vizservers/vtkvis/RpVtkRendererGraphicsObjs.cpp

    r3490 r3535  
    115115
    116116template<>
     117Renderer::OutlineHashmap &
     118Renderer::getGraphicsObjectHashmap<Outline>()
     119{ return _outlines; }
     120
     121template<>
    117122Renderer::PolyDataHashmap &
    118123Renderer::getGraphicsObjectHashmap<PolyData>()
Note: See TracChangeset for help on using the changeset viewer.