Changeset 3211 for branches/Rappture 1.2


Ignore:
Timestamp:
Dec 18, 2012, 10:49:56 AM (12 years ago)
Author:
ldelgass
Message:
Location:
branches/Rappture 1.2/packages/vizservers/vtkvis
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • branches/Rappture 1.2/packages/vizservers/vtkvis/RpCutplane.cpp

    r3205 r3211  
    158158            // Map scalars through lookup table regardless of type
    159159            _mapper[i]->SetColorModeToMapScalars();
    160             //_mapper->InterpolateScalarsBeforeMappingOn();
     160            //_mapper[i]->InterpolateScalarsBeforeMappingOn();
    161161        }
    162162        _cutPlane[i] = vtkSmartPointer<vtkPlane>::New();
     
    375375}
    376376
     377void Cutplane::setInterpolateBeforeMapping(bool state)
     378{
     379    for (int i = 0; i < 3; i++) {
     380        if (_mapper[i] != NULL) {
     381            _mapper[i]->SetInterpolateScalarsBeforeMapping((state ? 1 : 0));
     382        }
     383    }
     384}
     385
    377386/**
    378387 * \brief Select a 2D slice plane from a 3D DataSet
  • branches/Rappture 1.2/packages/vizservers/vtkvis/RpCutplane.h

    r3177 r3211  
    6666    void setSliceVisibility(Axis axis, bool state);
    6767
     68    void setInterpolateBeforeMapping(bool state);
     69
    6870    void setColorMode(ColorMode mode, DataSet::DataAttributeType type,
    6971                      const char *name, double range[2] = NULL);
  • branches/Rappture 1.2/packages/vizservers/vtkvis/RpHeightMap.cpp

    r3205 r3211  
    470470}
    471471
     472void HeightMap::setInterpolateBeforeMapping(bool state)
     473{
     474    if (_dsMapper != NULL) {
     475        _dsMapper->SetInterpolateScalarsBeforeMapping((state ? 1 : 0));
     476    }
     477}
     478
    472479void HeightMap::setAspect(double aspect)
    473480{
  • branches/Rappture 1.2/packages/vizservers/vtkvis/RpHeightMap.h

    r3189 r3211  
    7272    }
    7373
     74    void setInterpolateBeforeMapping(bool state);
     75
    7476    void setNumContours(int numContours);
    7577
  • branches/Rappture 1.2/packages/vizservers/vtkvis/RpPseudoColor.cpp

    r3205 r3211  
    220220}
    221221
     222void PseudoColor::setInterpolateBeforeMapping(bool state)
     223{
     224    if (_dsMapper != NULL) {
     225        _dsMapper->SetInterpolateScalarsBeforeMapping((state ? 1 : 0));
     226    }
     227}
     228
    222229void PseudoColor::updateRanges(Renderer *renderer)
    223230{
  • branches/Rappture 1.2/packages/vizservers/vtkvis/RpPseudoColor.h

    r3177 r3211  
    4848    virtual void setClippingPlanes(vtkPlaneCollection *planes);
    4949
     50    void setInterpolateBeforeMapping(bool state);
     51
    5052    void setColorMode(ColorMode mode, DataSet::DataAttributeType type,
    5153                      const char *name, double range[2] = NULL);
  • branches/Rappture 1.2/packages/vizservers/vtkvis/RpVtkRenderer.cpp

    r3208 r3211  
    533533    _cubeAxesActor->SetViewAngleLODThreshold(0);
    534534    _cubeAxesActor->SetEnableViewAngleLOD(0);
    535     _cubeAxesActor->SetScreenSize(10.0);
     535    // Attempt to set font sizes for 2D (this currently doesn't work)
     536    for (int i = 0; i < 3; i++) {
     537        _cubeAxesActor->GetTitleTextProperty(i)->SetFontSize(14);
     538        _cubeAxesActor->GetLabelTextProperty(i)->SetFontSize(12);
     539    }
     540    // Set font pixel size for 3D
     541    _cubeAxesActor->SetScreenSize(8.0);
    536542#endif
    537543    _cubeAxesActor->SetBounds(0, 1, 0, 1, 0, 1);
  • branches/Rappture 1.2/packages/vizservers/vtkvis/RpVtkRenderer.h

    r3205 r3211  
    453453                              const char *name, double range[2] = NULL);
    454454
     455    void setCutplaneInterpolateBeforeMapping(const DataSetId& id, bool state);
     456
    455457    // Cylinders
    456458
     
    499501    void setHeightMapContourList(const DataSetId& id, const std::vector<double>& contours);
    500502
     503    void setHeightMapInterpolateBeforeMapping(const DataSetId& id, bool state);
     504
    501505    void setHeightMapContourSurfaceVisibility(const DataSetId& id, bool state);
    502506
     
    554558                                 DataSet::DataAttributeType type,
    555559                                 const char *name, double range[2] = NULL);
     560
     561    void setPseudoColorInterpolateBeforeMapping(const DataSetId& id, bool state);
    556562
    557563    // Spheres
  • branches/Rappture 1.2/packages/vizservers/vtkvis/RpVtkRendererCmd.cpp

    r3196 r3211  
    26842684
    26852685static int
     2686CutplanePreInterpOp(ClientData clientData, Tcl_Interp *interp, int objc,
     2687                    Tcl_Obj *const *objv)
     2688{
     2689    bool state;
     2690    if (GetBooleanFromObj(interp, objv[2], &state) != TCL_OK) {
     2691        return TCL_ERROR;
     2692    }
     2693    if (objc == 4) {
     2694        const char *name = Tcl_GetString(objv[3]);
     2695        g_renderer->setCutplaneInterpolateBeforeMapping(name, state);
     2696    } else {
     2697        g_renderer->setCutplaneInterpolateBeforeMapping("all", state);
     2698    }
     2699    return TCL_OK;
     2700}
     2701
     2702static int
    26862703CutplaneScaleOp(ClientData clientData, Tcl_Interp *interp, int objc,
    26872704                Tcl_Obj *const *objv)
     
    28122829    {"orient",       2, CutplaneOrientOp, 6, 7, "qw qx qy qz ?dataSetName?"},
    28132830    {"outline",      2, CutplaneOutlineOp, 3, 4, "bool ?dataSetName?"},
    2814     {"pos",          1, CutplanePositionOp, 5, 6, "x y z ?dataSetName?"},
     2831    {"pos",          2, CutplanePositionOp, 5, 6, "x y z ?dataSetName?"},
     2832    {"preinterp",    2, CutplanePreInterpOp, 3, 4, "bool ?dataSetName?"},
    28152833    {"scale",        2, CutplaneScaleOp, 5, 6, "sx sy sz ?dataSetName?"},
    28162834    {"slice",        2, CutplaneVolumeSliceOp, 4, 5, "axis ratio ?dataSetName?"},
     
    47134731
    47144732static int
     4733HeightMapPreInterpOp(ClientData clientData, Tcl_Interp *interp, int objc,
     4734                     Tcl_Obj *const *objv)
     4735{
     4736    bool state;
     4737    if (GetBooleanFromObj(interp, objv[2], &state) != TCL_OK) {
     4738        return TCL_ERROR;
     4739    }
     4740    if (objc == 4) {
     4741        const char *name = Tcl_GetString(objv[3]);
     4742        g_renderer->setHeightMapInterpolateBeforeMapping(name, state);
     4743    } else {
     4744        g_renderer->setHeightMapInterpolateBeforeMapping("all", state);
     4745    }
     4746    return TCL_OK;
     4747}
     4748
     4749static int
    47154750HeightMapScaleOp(ClientData clientData, Tcl_Interp *interp, int objc,
    47164751                 Tcl_Obj *const *objv)
     
    48124847    {"opacity",      2, HeightMapOpacityOp, 3, 4, "value ?dataSetName?"},
    48134848    {"orient",       2, HeightMapOrientOp, 6, 7, "qw qx qy qz ?dataSetName?"},
    4814     {"pos",          1, HeightMapPositionOp, 5, 6, "x y z ?dataSetName?"},
     4849    {"pos",          2, HeightMapPositionOp, 5, 6, "x y z ?dataSetName?"},
     4850    {"preinterp",    2, HeightMapPreInterpOp, 3, 4, "bool ?dataSetName?"},
    48154851    {"scale",        2, HeightMapScaleOp, 5, 6, "sx sy sz ?dataSetName?"},
    48164852    {"slice",        2, HeightMapVolumeSliceOp, 4, 5, "axis ratio ?dataSetName?"},
     
    67286764
    67296765static int
     6766PseudoColorPreInterpOp(ClientData clientData, Tcl_Interp *interp, int objc,
     6767                       Tcl_Obj *const *objv)
     6768{
     6769    bool state;
     6770    if (GetBooleanFromObj(interp, objv[2], &state) != TCL_OK) {
     6771        return TCL_ERROR;
     6772    }
     6773    if (objc == 4) {
     6774        const char *name = Tcl_GetString(objv[3]);
     6775        g_renderer->setPseudoColorInterpolateBeforeMapping(name, state);
     6776    } else {
     6777        g_renderer->setPseudoColorInterpolateBeforeMapping("all", state);
     6778    }
     6779    return TCL_OK;
     6780}
     6781
     6782static int
    67306783PseudoColorScaleOp(ClientData clientData, Tcl_Interp *interp, int objc,
    67316784                   Tcl_Obj *const *objv)
     
    67926845    {"opacity",   2, PseudoColorOpacityOp, 3, 4, "value ?dataSetName?"},
    67936846    {"orient",    2, PseudoColorOrientOp, 6, 7, "qw qx qy qz ?dataSetName?"},
    6794     {"pos",       1, PseudoColorPositionOp, 5, 6, "x y z ?dataSetName?"},
     6847    {"pos",       2, PseudoColorPositionOp, 5, 6, "x y z ?dataSetName?"},
     6848    {"preinterp", 2, PseudoColorPreInterpOp, 3, 4, "bool ?dataSetName?"},
    67956849    {"scale",     1, PseudoColorScaleOp, 5, 6, "sx sy sz ?dataSetName?"},
    67966850    {"visible",   1, PseudoColorVisibleOp, 3, 4, "bool ?dataSetName?"},
  • branches/Rappture 1.2/packages/vizservers/vtkvis/RpVtkRendererGraphicsObjs.cpp

    r3203 r3211  
    929929}
    930930
     931void Renderer::setCutplaneInterpolateBeforeMapping(const DataSetId& id, bool state)
     932{
     933    CutplaneHashmap::iterator itr;
     934
     935    bool doAll = false;
     936
     937    if (id.compare("all") == 0) {
     938        itr = _cutplanes.begin();
     939        doAll = true;
     940    } else {
     941        itr = _cutplanes.find(id);
     942    }
     943
     944    if (itr == _cutplanes.end()) {
     945        ERROR("Cutplane not found: %s", id.c_str());
     946        return;
     947    }
     948
     949    do {
     950        itr->second->setInterpolateBeforeMapping(state);
     951     } while (doAll && ++itr != _cutplanes.end());
     952
     953    _needsRedraw = true;
     954}
     955
    931956/**
    932957 * \brief Create a new Cylinder and associate it with an ID
     
    14791504}
    14801505
     1506void Renderer::setHeightMapInterpolateBeforeMapping(const DataSetId& id, bool state)
     1507{
     1508    HeightMapHashmap::iterator itr;
     1509
     1510    bool doAll = false;
     1511
     1512    if (id.compare("all") == 0) {
     1513        itr = _heightMaps.begin();
     1514        doAll = true;
     1515    } else {
     1516        itr = _heightMaps.find(id);
     1517    }
     1518    if (itr == _heightMaps.end()) {
     1519        ERROR("HeightMap not found: %s", id.c_str());
     1520        return;
     1521    }
     1522
     1523    do {
     1524        itr->second->setInterpolateBeforeMapping(state);
     1525    } while (doAll && ++itr != _heightMaps.end());
     1526
     1527    _needsRedraw = true;
     1528}
     1529
    14811530/**
    14821531 * \brief Turn on/off rendering height map contour lines for the given DataSet
     
    20142063    do {
    20152064        itr->second->setColorMode(mode, name, range);
     2065    } while (doAll && ++itr != _pseudoColors.end());
     2066
     2067    _needsRedraw = true;
     2068}
     2069
     2070void Renderer::setPseudoColorInterpolateBeforeMapping(const DataSetId& id, bool state)
     2071{
     2072    PseudoColorHashmap::iterator itr;
     2073
     2074    bool doAll = false;
     2075
     2076    if (id.compare("all") == 0) {
     2077        itr = _pseudoColors.begin();
     2078        doAll = true;
     2079    } else {
     2080        itr = _pseudoColors.find(id);
     2081    }
     2082    if (itr == _pseudoColors.end()) {
     2083        ERROR("PseudoColor not found: %s", id.c_str());
     2084        return;
     2085    }
     2086
     2087    do {
     2088        itr->second->setInterpolateBeforeMapping(state);
    20162089    } while (doAll && ++itr != _pseudoColors.end());
    20172090
Note: See TracChangeset for help on using the changeset viewer.