Ignore:
Timestamp:
Sep 15, 2011, 11:04:29 AM (13 years ago)
Author:
ldelgass
Message:

Add cutplane command -- pseudocolored plane on principal axis. Can be colored
by scalar or vector. Rename 'volumeslice' -> 'slice' in protocol. Fix
PseudoColor? for case when dataset has only cell field vectors. Add variable
to Makefile for HAVE_GLYPH3D_MAPPER. Should really be a configure test for
VTK >= 5.8. Remove VTK legacy method support cruft from custom 2D axes class.

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

Legend:

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

    r2423 r2514  
    4747DEBUG                   = #yes
    4848TRACE                   = #yes
    49 USE_CUSTOM_AXES         = yes
    50 USE_GPU_RAYCASTING      = yes
    51 USE_OFFSCREEN_RENDERING = yes
     49HAVE_GLYPH3D_MAPPER     = #yes
     50USE_CUSTOM_AXES         = yes
     51USE_GPU_RAYCASTING      = yes
     52USE_OFFSCREEN_RENDERING = yes
    5253
    5354#vtk uses deprecated strstream header (instead of sstream)
     
    6061ifdef TRACE
    6162DEFINES         += -DWANT_TRACE
     63endif
     64ifdef HAVE_GLYPH3D_MAPPER
     65DEFINES         += -DHAVE_GLYPH3D_MAPPER
    6266endif
    6367ifdef USE_CUSTOM_AXES
     
    7882                RpContour2D.cpp \
    7983                RpContour3D.cpp \
     84                RpCutplane.cpp \
    8085                RpGlyphs.cpp \
    8186                RpHeightMap.cpp \
     
    132137RpContour2D.o: RpContour2D.h RpVtkGraphicsObject.h RpVtkDataSet.h Trace.h
    133138RpContour3D.o: RpContour3D.h RpVtkGraphicsObject.h RpVtkDataSet.h ColorMap.h Trace.h
     139RpCutplane.o: RpCutplane.h RpVtkGraphicsObject.h RpVtkDataSet.h ColorMap.h Trace.h
    134140RpGlyphs.o: RpGlyphs.h RpVtkGraphicsObject.h RpVtkDataSet.h ColorMap.h Trace.h
    135141RpHeightMap.o: RpHeightMap.h RpVtkGraphicsObject.h RpVtkDataSet.h ColorMap.h Trace.h
     
    141147RpVolume.o: RpVolume.h RpVtkGraphicsObject.h RpVtkDataSet.h ColorMap.h Trace.h
    142148RpVtkDataSet.o: RpVtkDataSet.h Trace.h
    143 RpVtkRenderer.o: RpVtkRenderer.h RpVtkDataSet.h RpContour2D.h RpContour3D.h RpGlyphs.h RpHeightMap.h RpLIC.h RpMolecule.h RpPolyData.h RpPseudoColor.h RpStreamlines.h RpVolume.h ColorMap.h Trace.h
    144 RpVtkRendererCmd.o: RpVtkRenderer.h RpVtkDataSet.h RpContour2D.h RpContour3D.h RpGlyphs.h RpHeightMap.h RpLIC.h RpMolecule.h RpPolyData.h RpPseudoColor.h RpStreamlines.h RpVolume.h ColorMap.h Trace.h CmdProc.h PPMWriter.h TGAWriter.h
    145 RpVtkRenderServer.o: RpVtkRenderServer.h RpVtkRendererCmd.h RpVtkRenderer.h Trace.h PPMWriter.h TGAWriter.h
     149RpVtkRenderer.o: RpVtkRenderer.h vtkRpCubeAxesActor2D.h RpVtkDataSet.h RpContour2D.h RpContour3D.h RpGlyphs.h RpHeightMap.h RpLIC.h RpMolecule.h RpPolyData.h RpPseudoColor.h RpStreamlines.h RpVolume.h ColorMap.h Trace.h
     150RpVtkRendererCmd.o: RpVtkRenderer.h vtkRpCubeAxesActor2D.h RpVtkDataSet.h RpContour2D.h RpContour3D.h RpGlyphs.h RpHeightMap.h RpLIC.h RpMolecule.h RpPolyData.h RpPseudoColor.h RpStreamlines.h RpVolume.h ColorMap.h Trace.h CmdProc.h PPMWriter.h TGAWriter.h
     151RpVtkRenderServer.o: RpVtkRenderServer.h RpVtkRendererCmd.h RpVtkRenderer.h vtkRpCubeAxesActor2D.h Trace.h PPMWriter.h TGAWriter.h
    146152Trace.o: Trace.h
    147153TGAWriter.o: TGAWriter.h Trace.h
  • trunk/packages/vizservers/vtkvis/RpContour3D.cpp

    r2459 r2514  
    172172        _contourMapper->SetResolveCoincidentTopologyToPolygonOffset();
    173173        _contourMapper->SetInputConnection(_contourFilter->GetOutputPort());
     174        _contourMapper->SetColorModeToMapScalars();
    174175        getActor()->SetMapper(_contourMapper);
    175176    }
  • trunk/packages/vizservers/vtkvis/RpHeightMap.cpp

    r2459 r2514  
    9191                _dataRange[1] = scalarRange[1];
    9292            } else {
    93                 dataSet->getScalarRange(_dataRange);
     93                _dataSet->getScalarRange(_dataRange);
    9494            }
    9595
  • trunk/packages/vizservers/vtkvis/RpLIC.cpp

    r2459 r2514  
    2424#include "RpLIC.h"
    2525#include "Trace.h"
    26 #include "RpVtkRenderServer.h"
    2726
    2827using namespace Rappture::VtkVis;
  • trunk/packages/vizservers/vtkvis/RpPseudoColor.cpp

    r2492 r2514  
    1010#include <vtkDataSet.h>
    1111#include <vtkPointData.h>
     12#include <vtkCellData.h>
    1213#include <vtkDataSetMapper.h>
    1314#include <vtkUnstructuredGrid.h>
     
    235236    case COLOR_BY_VECTOR_MAGNITUDE: {
    236237        _dsMapper->ScalarVisibilityOn();
    237         _dsMapper->SetScalarModeToUsePointFieldData();
    238238        if (ds->GetPointData() != NULL &&
    239239            ds->GetPointData()->GetVectors() != NULL) {
     240            _dsMapper->SetScalarModeToUsePointFieldData();
    240241            _dsMapper->SelectColorArray(ds->GetPointData()->GetVectors()->GetName());
     242        } else if (ds->GetCellData() != NULL &&
     243                   ds->GetCellData()->GetVectors() != NULL) {
     244            _dsMapper->SetScalarModeToUseCellFieldData();
     245            _dsMapper->SelectColorArray(ds->GetCellData()->GetVectors()->GetName());
    241246        }
    242247        if (_lut != NULL) {
     
    248253    case COLOR_BY_VECTOR_X:
    249254        _dsMapper->ScalarVisibilityOn();
    250         _dsMapper->SetScalarModeToUsePointFieldData();
    251255        if (ds->GetPointData() != NULL &&
    252256            ds->GetPointData()->GetVectors() != NULL) {
     257            _dsMapper->SetScalarModeToUsePointFieldData();
    253258            _dsMapper->SelectColorArray(ds->GetPointData()->GetVectors()->GetName());
     259        } else if (ds->GetCellData() != NULL &&
     260                   ds->GetCellData()->GetVectors() != NULL) {
     261            _dsMapper->SetScalarModeToUseCellFieldData();
     262            _dsMapper->SelectColorArray(ds->GetCellData()->GetVectors()->GetName());
    254263        }
    255264        if (_lut != NULL) {
     
    261270    case COLOR_BY_VECTOR_Y:
    262271        _dsMapper->ScalarVisibilityOn();
    263         _dsMapper->SetScalarModeToUsePointFieldData();
    264272        if (ds->GetPointData() != NULL &&
    265273            ds->GetPointData()->GetVectors() != NULL) {
     274            _dsMapper->SetScalarModeToUsePointFieldData();
    266275            _dsMapper->SelectColorArray(ds->GetPointData()->GetVectors()->GetName());
     276        } else if (ds->GetCellData() != NULL &&
     277                   ds->GetCellData()->GetVectors() != NULL) {
     278            _dsMapper->SetScalarModeToUseCellFieldData();
     279            _dsMapper->SelectColorArray(ds->GetCellData()->GetVectors()->GetName());
    267280        }
    268281        if (_lut != NULL) {
     
    274287    case COLOR_BY_VECTOR_Z:
    275288        _dsMapper->ScalarVisibilityOn();
    276         _dsMapper->SetScalarModeToUsePointFieldData();
    277289        if (ds->GetPointData() != NULL &&
    278290            ds->GetPointData()->GetVectors() != NULL) {
     291            _dsMapper->SetScalarModeToUsePointFieldData();
    279292            _dsMapper->SelectColorArray(ds->GetPointData()->GetVectors()->GetName());
     293        } else if (ds->GetCellData() != NULL &&
     294                   ds->GetCellData()->GetVectors() != NULL) {
     295            _dsMapper->SetScalarModeToUseCellFieldData();
     296            _dsMapper->SelectColorArray(ds->GetCellData()->GetVectors()->GetName());
    280297        }
    281298        if (_lut != NULL) {
  • trunk/packages/vizservers/vtkvis/RpVtkRenderServer.h

    r2100 r2514  
    99#define __RAPPTURE_VTKVIS_RENDERSERVER_H__
    1010
    11 #include "RpVtkRenderer.h"
    12 
    1311namespace Rappture {
    1412namespace VtkVis {
     13
     14class Renderer;
    1515
    1616extern int g_fdIn;
  • trunk/packages/vizservers/vtkvis/RpVtkRenderer.cpp

    r2512 r2514  
    158158    }
    159159    _contour3Ds.clear();
     160    TRACE("Deleting Cutplanes");
     161    for (CutplaneHashmap::iterator itr = _cutplanes.begin();
     162             itr != _cutplanes.end(); ++itr) {
     163        delete itr->second;
     164    }
     165    _cutplanes.clear();
    160166    TRACE("Deleting Glyphs");
    161167    for (GlyphsHashmap::iterator itr = _glyphs.begin();
     
    314320
    315321/**
     322 * \brief Remove the Cutplane for the specified DataSet
     323 *
     324 * The underlying Cutplane is deleted, freeing its memory
     325 */
     326void Renderer::deleteCutplane(const DataSetId& id)
     327{
     328    CutplaneHashmap::iterator itr;
     329
     330    bool doAll = false;
     331
     332    if (id.compare("all") == 0) {
     333        itr = _cutplanes.begin();
     334        doAll = true;
     335    } else {
     336        itr = _cutplanes.find(id);
     337    }
     338    if (itr == _cutplanes.end()) {
     339        ERROR("Cutplane not found: %s", id.c_str());
     340        return;
     341    }
     342
     343    TRACE("Deleting Cutplanes for %s", id.c_str());
     344
     345    do {
     346        Cutplane *cutplane = itr->second;
     347        if (cutplane->getProp())
     348            _renderer->RemoveViewProp(cutplane->getProp());
     349        delete cutplane;
     350
     351        itr = _cutplanes.erase(itr);
     352    } while (doAll && itr != _cutplanes.end());
     353
     354    initCamera();
     355    _needsRedraw = true;
     356}
     357
     358/**
    316359 * \brief Remove the Glyphs for the specified DataSet
    317360 *
     
    637680        deleteContour2D(itr->second->getName());
    638681        deleteContour3D(itr->second->getName());
     682        deleteCutplane(itr->second->getName());
    639683        deleteGlyphs(itr->second->getName());
    640684        deleteHeightMap(itr->second->getName());
     
    12131257        }
    12141258    }
     1259    for (CutplaneHashmap::iterator itr = _cutplanes.begin();
     1260         itr != _cutplanes.end(); ++itr) {
     1261        if (itr->second->getColorMap() == cmap) {
     1262            itr->second->updateColorMap();
     1263            _needsRedraw = true;
     1264        }
     1265    }
    12151266    for (GlyphsHashmap::iterator itr = _glyphs.begin();
    12161267         itr != _glyphs.end(); ++itr) {
     
    12711322    for (Contour3DHashmap::iterator itr = _contour3Ds.begin();
    12721323         itr != _contour3Ds.end(); ++itr) {
     1324        if (itr->second->getColorMap() == cmap)
     1325            return true;
     1326    }
     1327    for (CutplaneHashmap::iterator itr = _cutplanes.begin();
     1328         itr != _cutplanes.end(); ++itr) {
    12731329        if (itr->second->getColorMap() == cmap)
    12741330            return true;
     
    26722728
    26732729/**
     2730 * \brief Create a new Cutplane and associate it with the named DataSet
     2731 */
     2732bool Renderer::addCutplane(const DataSetId& id)
     2733{
     2734    DataSetHashmap::iterator itr;
     2735
     2736    bool doAll = false;
     2737
     2738    if (id.compare("all") == 0) {
     2739        itr = _dataSets.begin();
     2740    } else {
     2741        itr = _dataSets.find(id);
     2742    }
     2743    if (itr == _dataSets.end()) {
     2744        ERROR("Unknown dataset %s", id.c_str());
     2745        return false;
     2746    }
     2747
     2748    do {
     2749        DataSet *ds = itr->second;
     2750        const DataSetId& dsID = ds->getName();
     2751
     2752        if (getCutplane(dsID)) {
     2753            WARN("Replacing existing Cutplane %s", dsID.c_str());
     2754            deleteCutplane(dsID);
     2755        }
     2756
     2757        Cutplane *cutplane = new Cutplane();
     2758        _cutplanes[dsID] = cutplane;
     2759
     2760        cutplane->setDataSet(ds,
     2761                             _useCumulativeRange,
     2762                             _cumulativeScalarRange,
     2763                             _cumulativeVectorMagnitudeRange,
     2764                             _cumulativeVectorComponentRange);
     2765
     2766        _renderer->AddViewProp(cutplane->getProp());
     2767    } while (doAll && ++itr != _dataSets.end());
     2768
     2769    initCamera();
     2770    _needsRedraw = true;
     2771    return true;
     2772}
     2773
     2774/**
     2775 * \brief Get the Cutplane associated with a named DataSet
     2776 */
     2777Cutplane *Renderer::getCutplane(const DataSetId& id)
     2778{
     2779    CutplaneHashmap::iterator itr = _cutplanes.find(id);
     2780
     2781    if (itr == _cutplanes.end()) {
     2782#ifdef DEBUG
     2783        TRACE("Cutplane not found: %s", id.c_str());
     2784#endif
     2785        return NULL;
     2786    } else
     2787        return itr->second;
     2788}
     2789
     2790/**
     2791 * \brief Set an additional transform on the prop
     2792 */
     2793void Renderer::setCutplaneTransform(const DataSetId& id, vtkMatrix4x4 *trans)
     2794{
     2795    CutplaneHashmap::iterator itr;
     2796
     2797    bool doAll = false;
     2798
     2799    if (id.compare("all") == 0) {
     2800        itr = _cutplanes.begin();
     2801        doAll = true;
     2802    } else {
     2803        itr = _cutplanes.find(id);
     2804    }
     2805    if (itr == _cutplanes.end()) {
     2806        ERROR("Cutplane not found: %s", id.c_str());
     2807        return;
     2808    }
     2809
     2810    do {
     2811        itr->second->setTransform(trans);
     2812    } while (doAll && ++itr != _cutplanes.end());
     2813
     2814    resetAxes();
     2815    _needsRedraw = true;
     2816}
     2817
     2818/**
     2819 * \brief Set the prop orientation with a quaternion
     2820 */
     2821void Renderer::setCutplaneOrientation(const DataSetId& id, double quat[4])
     2822{
     2823    CutplaneHashmap::iterator itr;
     2824
     2825    bool doAll = false;
     2826
     2827    if (id.compare("all") == 0) {
     2828        itr = _cutplanes.begin();
     2829        doAll = true;
     2830    } else {
     2831        itr = _cutplanes.find(id);
     2832    }
     2833    if (itr == _cutplanes.end()) {
     2834        ERROR("Cutplane not found: %s", id.c_str());
     2835        return;
     2836    }
     2837
     2838    do {
     2839        itr->second->setOrientation(quat);
     2840    } while (doAll && ++itr != _cutplanes.end());
     2841
     2842    resetAxes();
     2843    _needsRedraw = true;
     2844}
     2845
     2846/**
     2847 * \brief Set the prop orientation with a rotation about an axis
     2848 */
     2849void Renderer::setCutplaneOrientation(const DataSetId& id, double angle, double axis[3])
     2850{
     2851    CutplaneHashmap::iterator itr;
     2852
     2853    bool doAll = false;
     2854
     2855    if (id.compare("all") == 0) {
     2856        itr = _cutplanes.begin();
     2857        doAll = true;
     2858    } else {
     2859        itr = _cutplanes.find(id);
     2860    }
     2861    if (itr == _cutplanes.end()) {
     2862        ERROR("Cutplane not found: %s", id.c_str());
     2863        return;
     2864    }
     2865
     2866    do {
     2867        itr->second->setOrientation(angle, axis);
     2868    } while (doAll && ++itr != _cutplanes.end());
     2869
     2870    resetAxes();
     2871    _needsRedraw = true;
     2872}
     2873
     2874/**
     2875 * \brief Set the prop position in world coords
     2876 */
     2877void Renderer::setCutplanePosition(const DataSetId& id, double pos[3])
     2878{
     2879    CutplaneHashmap::iterator itr;
     2880
     2881    bool doAll = false;
     2882
     2883    if (id.compare("all") == 0) {
     2884        itr = _cutplanes.begin();
     2885        doAll = true;
     2886    } else {
     2887        itr = _cutplanes.find(id);
     2888    }
     2889    if (itr == _cutplanes.end()) {
     2890        ERROR("Cutplane not found: %s", id.c_str());
     2891        return;
     2892    }
     2893
     2894    do {
     2895        itr->second->setPosition(pos);
     2896    } while (doAll && ++itr != _cutplanes.end());
     2897
     2898    resetAxes();
     2899    _needsRedraw = true;
     2900}
     2901
     2902/**
     2903 * \brief Set the prop scaling
     2904 */
     2905void Renderer::setCutplaneScale(const DataSetId& id, double scale[3])
     2906{
     2907    CutplaneHashmap::iterator itr;
     2908
     2909    bool doAll = false;
     2910
     2911    if (id.compare("all") == 0) {
     2912        itr = _cutplanes.begin();
     2913        doAll = true;
     2914    } else {
     2915        itr = _cutplanes.find(id);
     2916    }
     2917    if (itr == _cutplanes.end()) {
     2918        ERROR("Cutplane not found: %s", id.c_str());
     2919        return;
     2920    }
     2921
     2922    do {
     2923        itr->second->setScale(scale);
     2924    } while (doAll && ++itr != _cutplanes.end());
     2925
     2926    resetAxes();
     2927    _needsRedraw = true;
     2928}
     2929
     2930/**
     2931 * \brief Set the volume slice used for mapping volumetric data
     2932 */
     2933void Renderer::setCutplaneVolumeSlice(const DataSetId& id, Cutplane::Axis axis, double ratio)
     2934{
     2935    CutplaneHashmap::iterator itr;
     2936
     2937    bool doAll = false;
     2938
     2939    if (id.compare("all") == 0) {
     2940        itr = _cutplanes.begin();
     2941        doAll = true;
     2942    } else {
     2943        itr = _cutplanes.find(id);
     2944    }
     2945
     2946    if (itr == _cutplanes.end()) {
     2947        ERROR("Cutplane not found: %s", id.c_str());
     2948        return;
     2949    }
     2950
     2951    do {
     2952        itr->second->selectVolumeSlice(axis, ratio);
     2953     } while (doAll && ++itr != _cutplanes.end());
     2954
     2955    initCamera();
     2956    _needsRedraw = true;
     2957}
     2958
     2959/**
     2960 * \brief Associate an existing named color map with a Cutplane for the given DataSet
     2961 */
     2962void Renderer::setCutplaneColorMap(const DataSetId& id, const ColorMapId& colorMapId)
     2963{
     2964    CutplaneHashmap::iterator itr;
     2965
     2966    bool doAll = false;
     2967
     2968    if (id.compare("all") == 0) {
     2969        itr = _cutplanes.begin();
     2970        doAll = true;
     2971    } else {
     2972        itr = _cutplanes.find(id);
     2973    }
     2974
     2975    if (itr == _cutplanes.end()) {
     2976        ERROR("Cutplane not found: %s", id.c_str());
     2977        return;
     2978    }
     2979
     2980    ColorMap *cmap = getColorMap(colorMapId);
     2981    if (cmap == NULL) {
     2982        ERROR("Unknown colormap: %s", colorMapId.c_str());
     2983        return;
     2984    }
     2985
     2986    do {
     2987        TRACE("Set Cutplane color map: %s for dataset %s", colorMapId.c_str(),
     2988              itr->second->getDataSet()->getName().c_str());
     2989
     2990        itr->second->setColorMap(cmap);
     2991    } while (doAll && ++itr != _cutplanes.end());
     2992
     2993    _needsRedraw = true;
     2994}
     2995
     2996/**
     2997 * \brief Set the color mode for the specified DataSet
     2998 */
     2999void Renderer::setCutplaneColorMode(const DataSetId& id, Cutplane::ColorMode mode)
     3000{
     3001    CutplaneHashmap::iterator itr;
     3002
     3003    bool doAll = false;
     3004
     3005    if (id.compare("all") == 0) {
     3006        itr = _cutplanes.begin();
     3007        doAll = true;
     3008    } else {
     3009        itr = _cutplanes.find(id);
     3010    }
     3011    if (itr == _cutplanes.end()) {
     3012        ERROR("Cutplane not found: %s", id.c_str());
     3013        return;
     3014    }
     3015
     3016    do {
     3017        itr->second->setColorMode(mode);
     3018    } while (doAll && ++itr != _cutplanes.end());
     3019
     3020    _needsRedraw = true;
     3021}
     3022
     3023/**
     3024 * \brief Set opacity of height map for the given DataSet
     3025 */
     3026void Renderer::setCutplaneOpacity(const DataSetId& id, double opacity)
     3027{
     3028    CutplaneHashmap::iterator itr;
     3029
     3030    bool doAll = false;
     3031
     3032    if (id.compare("all") == 0) {
     3033        itr = _cutplanes.begin();
     3034        doAll = true;
     3035    } else {
     3036        itr = _cutplanes.find(id);
     3037    }
     3038    if (itr == _cutplanes.end()) {
     3039        ERROR("Cutplane not found: %s", id.c_str());
     3040        return;
     3041    }
     3042
     3043    do {
     3044        itr->second->setOpacity(opacity);
     3045    } while (doAll && ++itr != _cutplanes.end());
     3046
     3047    _needsRedraw = true;
     3048}
     3049
     3050/**
     3051 * \brief Turn on/off rendering height map for the given DataSet
     3052 */
     3053void Renderer::setCutplaneVisibility(const DataSetId& id, bool state)
     3054{
     3055    CutplaneHashmap::iterator itr;
     3056
     3057    bool doAll = false;
     3058
     3059    if (id.compare("all") == 0) {
     3060        itr = _cutplanes.begin();
     3061        doAll = true;
     3062    } else {
     3063        itr = _cutplanes.find(id);
     3064    }
     3065    if (itr == _cutplanes.end()) {
     3066        ERROR("Cutplane not found: %s", id.c_str());
     3067        return;
     3068    }
     3069
     3070    do {
     3071        itr->second->setVisibility(state);
     3072    } while (doAll && ++itr != _cutplanes.end());
     3073
     3074    _needsRedraw = true;
     3075}
     3076
     3077/**
     3078 * \brief Set wireframe rendering for the specified DataSet
     3079 */
     3080void Renderer::setCutplaneWireframe(const DataSetId& id, bool state)
     3081{
     3082    CutplaneHashmap::iterator itr;
     3083
     3084    bool doAll = false;
     3085
     3086    if (id.compare("all") == 0) {
     3087        itr = _cutplanes.begin();
     3088        doAll = true;
     3089    } else {
     3090        itr = _cutplanes.find(id);
     3091    }
     3092    if (itr == _cutplanes.end()) {
     3093        ERROR("Cutplane not found: %s", id.c_str());
     3094        return;
     3095    }
     3096
     3097    do {
     3098        itr->second->setWireframe(state);
     3099    } while (doAll && ++itr != _cutplanes.end());
     3100
     3101    _needsRedraw = true;
     3102}
     3103
     3104/**
     3105 * \brief Turn on/off rendering height map mesh edges for the given DataSet
     3106 */
     3107void Renderer::setCutplaneEdgeVisibility(const DataSetId& id, bool state)
     3108{
     3109    CutplaneHashmap::iterator itr;
     3110
     3111    bool doAll = false;
     3112
     3113    if (id.compare("all") == 0) {
     3114        itr = _cutplanes.begin();
     3115        doAll = true;
     3116    } else {
     3117        itr = _cutplanes.find(id);
     3118    }
     3119    if (itr == _cutplanes.end()) {
     3120        ERROR("Cutplane not found: %s", id.c_str());
     3121        return;
     3122    }
     3123
     3124    do {
     3125        itr->second->setEdgeVisibility(state);
     3126    } while (doAll && ++itr != _cutplanes.end());
     3127
     3128    _needsRedraw = true;
     3129}
     3130
     3131/**
     3132 * \brief Set the RGB height map mesh edge color for the specified DataSet
     3133 */
     3134void Renderer::setCutplaneEdgeColor(const DataSetId& id, float color[3])
     3135{
     3136    CutplaneHashmap::iterator itr;
     3137
     3138    bool doAll = false;
     3139
     3140    if (id.compare("all") == 0) {
     3141        itr = _cutplanes.begin();
     3142        doAll = true;
     3143    } else {
     3144        itr = _cutplanes.find(id);
     3145    }
     3146    if (itr == _cutplanes.end()) {
     3147        ERROR("Cutplane not found: %s", id.c_str());
     3148        return;
     3149    }
     3150
     3151    do {
     3152        itr->second->setEdgeColor(color);
     3153    } while (doAll && ++itr != _cutplanes.end());
     3154
     3155    _needsRedraw = true;
     3156}
     3157
     3158/**
     3159 * \brief Set the height map mesh edge width for the specified DataSet (may be a no-op)
     3160 *
     3161 * If the OpenGL implementation/hardware does not support wide lines,
     3162 * this function may not have an effect.
     3163 */
     3164void Renderer::setCutplaneEdgeWidth(const DataSetId& id, float edgeWidth)
     3165{
     3166    CutplaneHashmap::iterator itr;
     3167
     3168    bool doAll = false;
     3169
     3170    if (id.compare("all") == 0) {
     3171        itr = _cutplanes.begin();
     3172        doAll = true;
     3173    } else {
     3174        itr = _cutplanes.find(id);
     3175    }
     3176    if (itr == _cutplanes.end()) {
     3177        ERROR("Cutplane not found: %s", id.c_str());
     3178        return;
     3179    }
     3180
     3181    do {
     3182        itr->second->setEdgeWidth(edgeWidth);
     3183    } while (doAll && ++itr != _cutplanes.end());
     3184
     3185    _needsRedraw = true;
     3186}
     3187
     3188/**
     3189 * \brief Turn height map lighting on/off for the specified DataSet
     3190 */
     3191void Renderer::setCutplaneLighting(const DataSetId& id, bool state)
     3192{
     3193    CutplaneHashmap::iterator itr;
     3194
     3195    bool doAll = false;
     3196
     3197    if (id.compare("all") == 0) {
     3198        itr = _cutplanes.begin();
     3199        doAll = true;
     3200    } else {
     3201        itr = _cutplanes.find(id);
     3202    }
     3203    if (itr == _cutplanes.end()) {
     3204        ERROR("Cutplane not found: %s", id.c_str());
     3205        return;
     3206    }
     3207
     3208    do {
     3209        itr->second->setLighting(state);
     3210    } while (doAll && ++itr != _cutplanes.end());
     3211    _needsRedraw = true;
     3212}
     3213
     3214/**
    26743215 * \brief Create a new Glyphs and associate it with the named DataSet
    26753216 */
     
    80808621            mergeBounds(bounds, bounds, itr->second->getProp()->GetBounds());
    80818622    }
     8623    for (CutplaneHashmap::iterator itr = _cutplanes.begin();
     8624             itr != _cutplanes.end(); ++itr) {
     8625        if ((!onlyVisible || itr->second->getVisibility()) &&
     8626            itr->second->getProp() != NULL)
     8627            mergeBounds(bounds, bounds, itr->second->getProp()->GetBounds());
     8628    }
    80828629    for (GlyphsHashmap::iterator itr = _glyphs.begin();
    80838630             itr != _glyphs.end(); ++itr) {
     
    81768723    for (Contour3DHashmap::iterator itr = _contour3Ds.begin();
    81778724         itr != _contour3Ds.end(); ++itr) {
     8725        itr->second->updateRanges(_useCumulativeRange,
     8726                                  _cumulativeScalarRange,
     8727                                  _cumulativeVectorMagnitudeRange,
     8728                                  _cumulativeVectorComponentRange);
     8729    }
     8730    for (CutplaneHashmap::iterator itr = _cutplanes.begin();
     8731         itr != _cutplanes.end(); ++itr) {
    81788732        itr->second->updateRanges(_useCumulativeRange,
    81798733                                  _cumulativeScalarRange,
     
    85119065    if (id.compare("all") == 0 || getContour3D(id) != NULL)
    85129066        setContour3DOpacity(id, opacity);
     9067    if (id.compare("all") == 0 || getCutplane(id) != NULL)
     9068        setCutplaneOpacity(id, opacity);
    85139069    if (id.compare("all") == 0 || getGlyphs(id) != NULL)
    85149070        setGlyphsOpacity(id, opacity);
     
    85599115    if (id.compare("all") == 0 || getContour3D(id) != NULL)
    85609116        setContour3DVisibility(id, state);
     9117   if (id.compare("all") == 0 || getCutplane(id) != NULL)
     9118        setCutplaneVisibility(id, state);
    85619119    if (id.compare("all") == 0 || getGlyphs(id) != NULL)
    85629120        setGlyphsVisibility(id, state);
     
    87679325        itr->second->setClippingPlanes(_activeClipPlanes);
    87689326    }
     9327    for (CutplaneHashmap::iterator itr = _cutplanes.begin();
     9328         itr != _cutplanes.end(); ++itr) {
     9329        itr->second->setClippingPlanes(_activeClipPlanes);
     9330    }
    87699331    for (GlyphsHashmap::iterator itr = _glyphs.begin();
    87709332         itr != _glyphs.end(); ++itr) {
  • trunk/packages/vizservers/vtkvis/RpVtkRenderer.h

    r2506 r2514  
    2929#include "RpContour2D.h"
    3030#include "RpContour3D.h"
     31#include "RpCutplane.h"
    3132#include "RpGlyphs.h"
    3233#include "RpHeightMap.h"
     
    101102    typedef std::tr1::unordered_map<DataSetId, Contour2D *> Contour2DHashmap;
    102103    typedef std::tr1::unordered_map<DataSetId, Contour3D *> Contour3DHashmap;
     104    typedef std::tr1::unordered_map<DataSetId, Cutplane *> CutplaneHashmap;
    103105    typedef std::tr1::unordered_map<DataSetId, Glyphs *> GlyphsHashmap;
    104106    typedef std::tr1::unordered_map<DataSetId, HeightMap *> HeightMapHashmap;
     
    164166    void setViewAngle(int height);
    165167
     168    vtkCamera *getVtkCamera()
     169    {
     170        if (_renderer != NULL)
     171            return _renderer->GetActiveCamera();
     172        else
     173            return NULL;
     174    }
     175
    166176    void setCameraMode(CameraMode mode);
    167177
     
    332342
    333343    void setContour3DColorMap(const DataSetId& id, const ColorMapId& colorMapId);
     344
     345    // Cutplanes
     346
     347    bool addCutplane(const DataSetId& id);
     348   
     349    void deleteCutplane(const DataSetId& id);
     350
     351    Cutplane *getCutplane(const DataSetId& id);
     352
     353    void setCutplaneTransform(const DataSetId& id, vtkMatrix4x4 *trans);
     354
     355    void setCutplaneOrientation(const DataSetId& id, double quat[4]);
     356
     357    void setCutplaneOrientation(const DataSetId& id, double angle, double axis[3]);
     358
     359    void setCutplanePosition(const DataSetId& id, double pos[3]);
     360
     361    void setCutplaneScale(const DataSetId& id, double scale[3]);
     362
     363    void setCutplaneEdgeVisibility(const DataSetId& id, bool state);
     364
     365    void setCutplaneEdgeColor(const DataSetId& id, float color[3]);
     366
     367    void setCutplaneEdgeWidth(const DataSetId& id, float edgeWidth);
     368
     369    void setCutplaneLighting(const DataSetId& id, bool state);
     370
     371    void setCutplaneOpacity(const DataSetId& id, double opacity);
     372
     373    void setCutplaneVisibility(const DataSetId& id, bool state);
     374
     375    void setCutplaneWireframe(const DataSetId& id, bool state);
     376
     377    void setCutplaneVolumeSlice(const DataSetId& id, Cutplane::Axis axis, double ratio);
     378
     379    void setCutplaneColorMap(const DataSetId& id, const ColorMapId& colorMapId);
     380
     381    void setCutplaneColorMode(const DataSetId& id, Cutplane::ColorMode mode);
    334382
    335383    // Glyphs
     
    754802    Contour2DHashmap _contour2Ds;
    755803    Contour3DHashmap _contour3Ds;
     804    CutplaneHashmap _cutplanes;
    756805    GlyphsHashmap _glyphs;
    757806    HeightMapHashmap _heightMaps;
  • trunk/packages/vizservers/vtkvis/RpVtkRendererCmd.cpp

    r2509 r2514  
    12611261
    12621262    proc = Rappture::GetOpFromObj(interp, nContour3dOps, contour3dOps,
     1263                                  Rappture::CMDSPEC_ARG1, objc, objv, 0);
     1264    if (proc == NULL) {
     1265        return TCL_ERROR;
     1266    }
     1267    return (*proc) (clientData, interp, objc, objv);
     1268}
     1269
     1270static int
     1271CutplaneAddOp(ClientData clientData, Tcl_Interp *interp, int objc,
     1272              Tcl_Obj *const *objv)
     1273{
     1274    if (objc == 3) {
     1275        const char *name = Tcl_GetString(objv[2]);
     1276        if (!g_renderer->addCutplane(name)) {
     1277            Tcl_AppendResult(interp, "Failed to create cutplane", (char*)NULL);
     1278            return TCL_ERROR;
     1279        }
     1280    } else {
     1281        if (!g_renderer->addCutplane("all")) {
     1282            Tcl_AppendResult(interp, "Failed to create cutplane for one or more data sets", (char*)NULL);
     1283            return TCL_ERROR;
     1284        }
     1285    }
     1286    return TCL_OK;
     1287}
     1288
     1289static int
     1290CutplaneColorMapOp(ClientData clientData, Tcl_Interp *interp, int objc,
     1291                   Tcl_Obj *const *objv)
     1292{
     1293    const char *colorMapName = Tcl_GetString(objv[2]);
     1294    if (objc == 4) {
     1295        const char *dataSetName = Tcl_GetString(objv[3]);
     1296        g_renderer->setCutplaneColorMap(dataSetName, colorMapName);
     1297    } else {
     1298        g_renderer->setCutplaneColorMap("all", colorMapName);
     1299    }
     1300    return TCL_OK;
     1301}
     1302
     1303static int
     1304CutplaneColorModeOp(ClientData clientData, Tcl_Interp *interp, int objc,
     1305                    Tcl_Obj *const *objv)
     1306{
     1307    Cutplane::ColorMode mode;
     1308    const char *str = Tcl_GetString(objv[2]);
     1309    if (str[0] == 's' && strcmp(str, "scalar") == 0) {
     1310        mode = Cutplane::COLOR_BY_SCALAR;
     1311    } else if (str[0] == 'v' && strcmp(str, "vmag") == 0) {
     1312        mode = Cutplane::COLOR_BY_VECTOR_MAGNITUDE;
     1313    } else if (str[0] == 'v' && strcmp(str, "vx") == 0) {
     1314        mode = Cutplane::COLOR_BY_VECTOR_X;
     1315    } else if (str[0] == 'v' && strcmp(str, "vy") == 0) {
     1316        mode = Cutplane::COLOR_BY_VECTOR_Y;
     1317    } else if (str[0] == 'v' && strcmp(str, "vz") == 0) {
     1318        mode = Cutplane::COLOR_BY_VECTOR_Z;
     1319    } else {
     1320        Tcl_AppendResult(interp, "bad color mode option \"", str,
     1321                         "\": should be one of: 'scalar', 'vmag', 'vx', 'vy', 'vz'", (char*)NULL);
     1322        return TCL_ERROR;
     1323    }
     1324    if (objc == 4) {
     1325        const char *name = Tcl_GetString(objv[3]);
     1326        g_renderer->setCutplaneColorMode(name, mode);
     1327    } else {
     1328        g_renderer->setCutplaneColorMode("all", mode);
     1329    }
     1330    return TCL_OK;
     1331}
     1332
     1333static int
     1334CutplaneDeleteOp(ClientData clientData, Tcl_Interp *interp, int objc,
     1335                 Tcl_Obj *const *objv)
     1336{
     1337    if (objc == 3) {
     1338        const char *name = Tcl_GetString(objv[2]);
     1339        g_renderer->deleteCutplane(name);
     1340    } else {
     1341        g_renderer->deleteCutplane("all");
     1342    }
     1343    return TCL_OK;
     1344}
     1345
     1346static int
     1347CutplaneEdgeVisibilityOp(ClientData clientData, Tcl_Interp *interp, int objc,
     1348                         Tcl_Obj *const *objv)
     1349{
     1350    bool state;
     1351    if (GetBooleanFromObj(interp, objv[2], &state) != TCL_OK) {
     1352        return TCL_ERROR;
     1353    }
     1354    if (objc == 4) {
     1355        const char *name = Tcl_GetString(objv[3]);
     1356        g_renderer->setCutplaneEdgeVisibility(name, state);
     1357    } else {
     1358        g_renderer->setCutplaneEdgeVisibility("all", state);
     1359    }
     1360    return TCL_OK;
     1361}
     1362
     1363static int
     1364CutplaneLightingOp(ClientData clientData, Tcl_Interp *interp, int objc,
     1365                   Tcl_Obj *const *objv)
     1366{
     1367    bool state;
     1368    if (GetBooleanFromObj(interp, objv[2], &state) != TCL_OK) {
     1369        return TCL_ERROR;
     1370    }
     1371    if (objc == 4) {
     1372        const char *name = Tcl_GetString(objv[3]);
     1373        g_renderer->setCutplaneLighting(name, state);
     1374    } else {
     1375        g_renderer->setCutplaneLighting("all", state);
     1376    }
     1377    return TCL_OK;
     1378}
     1379
     1380static int
     1381CutplaneLineColorOp(ClientData clientData, Tcl_Interp *interp, int objc,
     1382                    Tcl_Obj *const *objv)
     1383{
     1384    float color[3];
     1385    if (GetFloatFromObj(interp, objv[2], &color[0]) != TCL_OK ||
     1386        GetFloatFromObj(interp, objv[3], &color[1]) != TCL_OK ||
     1387        GetFloatFromObj(interp, objv[4], &color[2]) != TCL_OK) {
     1388        return TCL_ERROR;
     1389    }
     1390    if (objc == 6) {
     1391        const char *name = Tcl_GetString(objv[5]);
     1392        g_renderer->setCutplaneEdgeColor(name, color);
     1393    } else {
     1394        g_renderer->setCutplaneEdgeColor("all", color);
     1395    }
     1396    return TCL_OK;
     1397}
     1398
     1399static int
     1400CutplaneLineWidthOp(ClientData clientData, Tcl_Interp *interp, int objc,
     1401                    Tcl_Obj *const *objv)
     1402{
     1403    float width;
     1404    if (GetFloatFromObj(interp, objv[2], &width) != TCL_OK) {
     1405        return TCL_ERROR;
     1406    }
     1407    if (objc == 4) {
     1408        const char *name = Tcl_GetString(objv[3]);
     1409        g_renderer->setCutplaneEdgeWidth(name, width);
     1410    } else {
     1411        g_renderer->setCutplaneEdgeWidth("all", width);
     1412    }
     1413    return TCL_OK;
     1414}
     1415
     1416static int
     1417CutplaneOpacityOp(ClientData clientData, Tcl_Interp *interp, int objc,
     1418                  Tcl_Obj *const *objv)
     1419{
     1420    double opacity;
     1421    if (Tcl_GetDoubleFromObj(interp, objv[2], &opacity) != TCL_OK) {
     1422        return TCL_ERROR;
     1423    }
     1424    if (objc == 4) {
     1425        const char *name = Tcl_GetString(objv[3]);
     1426        g_renderer->setCutplaneOpacity(name, opacity);
     1427    } else {
     1428        g_renderer->setCutplaneOpacity("all", opacity);
     1429    }
     1430    return TCL_OK;
     1431}
     1432
     1433static int
     1434CutplaneOrientOp(ClientData clientData, Tcl_Interp *interp, int objc,
     1435                 Tcl_Obj *const *objv)
     1436{
     1437    double quat[4];
     1438    if (Tcl_GetDoubleFromObj(interp, objv[2], &quat[0]) != TCL_OK ||
     1439        Tcl_GetDoubleFromObj(interp, objv[3], &quat[1]) != TCL_OK ||
     1440        Tcl_GetDoubleFromObj(interp, objv[4], &quat[2]) != TCL_OK ||
     1441        Tcl_GetDoubleFromObj(interp, objv[5], &quat[3]) != TCL_OK) {
     1442        return TCL_ERROR;
     1443    }
     1444    if (objc == 7) {
     1445        const char *name = Tcl_GetString(objv[6]);
     1446        g_renderer->setCutplaneOrientation(name, quat);
     1447    } else {
     1448        g_renderer->setCutplaneOrientation("all", quat);
     1449    }
     1450    return TCL_OK;
     1451}
     1452
     1453static int
     1454CutplanePositionOp(ClientData clientData, Tcl_Interp *interp, int objc,
     1455                   Tcl_Obj *const *objv)
     1456{
     1457    double pos[3];
     1458    if (Tcl_GetDoubleFromObj(interp, objv[2], &pos[0]) != TCL_OK ||
     1459        Tcl_GetDoubleFromObj(interp, objv[3], &pos[1]) != TCL_OK ||
     1460        Tcl_GetDoubleFromObj(interp, objv[4], &pos[2]) != TCL_OK) {
     1461        return TCL_ERROR;
     1462    }
     1463    if (objc == 6) {
     1464        const char *name = Tcl_GetString(objv[5]);
     1465        g_renderer->setCutplanePosition(name, pos);
     1466    } else {
     1467        g_renderer->setCutplanePosition("all", pos);
     1468    }
     1469    return TCL_OK;
     1470}
     1471
     1472static int
     1473CutplaneScaleOp(ClientData clientData, Tcl_Interp *interp, int objc,
     1474                Tcl_Obj *const *objv)
     1475{
     1476    double scale[3];
     1477    if (Tcl_GetDoubleFromObj(interp, objv[2], &scale[0]) != TCL_OK ||
     1478        Tcl_GetDoubleFromObj(interp, objv[3], &scale[1]) != TCL_OK ||
     1479        Tcl_GetDoubleFromObj(interp, objv[4], &scale[2]) != TCL_OK) {
     1480        return TCL_ERROR;
     1481    }
     1482    if (objc == 6) {
     1483        const char *name = Tcl_GetString(objv[5]);
     1484        g_renderer->setCutplaneScale(name, scale);
     1485    } else {
     1486        g_renderer->setCutplaneScale("all", scale);
     1487    }
     1488    return TCL_OK;
     1489}
     1490
     1491static int
     1492CutplaneVisibleOp(ClientData clientData, Tcl_Interp *interp, int objc,
     1493                  Tcl_Obj *const *objv)
     1494{
     1495    bool state;
     1496    if (GetBooleanFromObj(interp, objv[2], &state) != TCL_OK) {
     1497        return TCL_ERROR;
     1498    }
     1499    if (objc == 4) {
     1500        const char *name = Tcl_GetString(objv[3]);
     1501        g_renderer->setCutplaneVisibility(name, state);
     1502    } else {
     1503        g_renderer->setCutplaneVisibility("all", state);
     1504    }
     1505    return TCL_OK;
     1506}
     1507
     1508static int
     1509CutplaneVolumeSliceOp(ClientData clientData, Tcl_Interp *interp, int objc,
     1510                      Tcl_Obj *const *objv)
     1511{
     1512    double ratio;
     1513    if (Tcl_GetDoubleFromObj(interp, objv[3], &ratio) != TCL_OK) {
     1514        return TCL_ERROR;
     1515    }
     1516    const char *string = Tcl_GetString(objv[2]);
     1517    char c = string[0];
     1518    Cutplane::Axis axis;
     1519    if ((c == 'x') && (strcmp(string, "x") == 0)) {
     1520        axis = Cutplane::X_AXIS;
     1521    } else if ((c == 'y') && (strcmp(string, "y") == 0)) {
     1522        axis = Cutplane::Y_AXIS;
     1523    } else if ((c == 'z') && (strcmp(string, "z") == 0)) {
     1524        axis = Cutplane::Z_AXIS;
     1525    } else {
     1526        Tcl_AppendResult(interp, "bad axis option \"", string,
     1527                         "\": should be axisName ratio", (char*)NULL);
     1528        return TCL_ERROR;
     1529    }
     1530    if (objc == 5) {
     1531        const char *name = Tcl_GetString(objv[4]);
     1532        g_renderer->setCutplaneVolumeSlice(name, axis, ratio);
     1533    } else {
     1534        g_renderer->setCutplaneVolumeSlice("all", axis, ratio);
     1535    }
     1536    return TCL_OK;
     1537}
     1538
     1539static int
     1540CutplaneWireframeOp(ClientData clientData, Tcl_Interp *interp, int objc,
     1541                    Tcl_Obj *const *objv)
     1542{
     1543    bool state;
     1544    if (GetBooleanFromObj(interp, objv[2], &state) != TCL_OK) {
     1545        return TCL_ERROR;
     1546    }
     1547    if (objc == 4) {
     1548        const char *name = Tcl_GetString(objv[3]);
     1549        g_renderer->setCutplaneWireframe(name, state);
     1550    } else {
     1551        g_renderer->setCutplaneWireframe("all", state);
     1552    }
     1553    return TCL_OK;
     1554}
     1555
     1556static Rappture::CmdSpec cutplaneOps[] = {
     1557    {"add",          1, CutplaneAddOp, 2, 3, "oper value ?dataSetName?"},
     1558    {"colormap",     7, CutplaneColorMapOp, 3, 4, "colorMapName ?dataSetName?"},
     1559    {"colormode",    7, CutplaneColorModeOp, 3, 4, "mode ?dataSetNme?"},
     1560    {"delete",       1, CutplaneDeleteOp, 2, 3, "?dataSetName?"},
     1561    {"edges",        1, CutplaneEdgeVisibilityOp, 3, 4, "bool ?dataSetName?"},
     1562    {"lighting",     3, CutplaneLightingOp, 3, 4, "bool ?dataSetName?"},
     1563    {"linecolor",    5, CutplaneLineColorOp, 5, 6, "r g b ?dataSetName?"},
     1564    {"linewidth",    5, CutplaneLineWidthOp, 3, 4, "width ?dataSetName?"},
     1565    {"opacity",      2, CutplaneOpacityOp, 3, 4, "value ?dataSetName?"},
     1566    {"orient",       2, CutplaneOrientOp, 6, 7, "qw qx qy qz ?dataSetName?"},
     1567    {"pos",          1, CutplanePositionOp, 5, 6, "x y z ?dataSetName?"},
     1568    {"scale",        2, CutplaneScaleOp, 5, 6, "sx sy sz ?dataSetName?"},
     1569    {"slice",        2, CutplaneVolumeSliceOp, 4, 5, "axis ratio ?dataSetName?"},
     1570    {"visible",      1, CutplaneVisibleOp, 3, 4, "bool ?dataSetName?"},
     1571    {"wireframe",    1, CutplaneWireframeOp, 3, 4, "bool ?dataSetName?"}
     1572};
     1573static int nCutplaneOps = NumCmdSpecs(cutplaneOps);
     1574
     1575static int
     1576CutplaneCmd(ClientData clientData, Tcl_Interp *interp, int objc,
     1577             Tcl_Obj *const *objv)
     1578{
     1579    Tcl_ObjCmdProc *proc;
     1580
     1581    proc = Rappture::GetOpFromObj(interp, nCutplaneOps, cutplaneOps,
    12631582                                  Rappture::CMDSPEC_ARG1, objc, objv, 0);
    12641583    if (proc == NULL) {
     
    25642883static Rappture::CmdSpec heightmapOps[] = {
    25652884    {"add",          1, HeightMapAddOp, 5, 6, "oper value ?dataSetName?"},
    2566     {"colormap",     2, HeightMapColorMapOp, 3, 4, "colorMapName ?dataSetName?"},
    2567     {"contourlist",  2, HeightMapContourListOp, 3, 4, "contourList ?dataSetName?"},
     2885    {"colormap",     3, HeightMapColorMapOp, 3, 4, "colorMapName ?dataSetName?"},
     2886    {"contourlist",  3, HeightMapContourListOp, 3, 4, "contourList ?dataSetName?"},
    25682887    {"delete",       1, HeightMapDeleteOp, 2, 3, "?dataSetName?"},
    25692888    {"edges",        1, HeightMapEdgeVisibilityOp, 3, 4, "bool ?dataSetName?"},
     
    25792898    {"orient",       2, HeightMapOrientOp, 6, 7, "qw qx qy qz ?dataSetName?"},
    25802899    {"pos",          1, HeightMapPositionOp, 5, 6, "x y z ?dataSetName?"},
    2581     {"scale",        1, HeightMapScaleOp, 5, 6, "sx sy sz ?dataSetName?"},
     2900    {"scale",        2, HeightMapScaleOp, 5, 6, "sx sy sz ?dataSetName?"},
     2901    {"slice",        2, HeightMapVolumeSliceOp, 4, 5, "axis ratio ?dataSetName?"},
    25822902    {"surface",      2, HeightMapContourSurfaceVisibleOp, 3, 4, "bool ?dataSetName?"},
    2583     {"visible",      2, HeightMapVisibleOp, 3, 4, "bool ?dataSetName?"},
    2584     {"volumeslice",  2, HeightMapVolumeSliceOp, 4, 5, "axis ratio ?dataSetName?"},
     2903    {"visible",      1, HeightMapVisibleOp, 3, 4, "bool ?dataSetName?"},
    25852904    {"wireframe",    1, HeightMapWireframeOp, 3, 4, "bool ?dataSetName?"}
    25862905};
     
    29293248    {"orient",      2, LICOrientOp, 6, 7, "qw qx qy qz ?dataSetName?"},
    29303249    {"pos",         1, LICPositionOp, 5, 6, "x y z ?dataSetName?"},
    2931     {"scale",       1, LICScaleOp, 5, 6, "sx sy sz ?dataSetName?"},
    2932     {"visible",     2, LICVisibleOp, 3, 4, "bool ?dataSetName?"},
    2933     {"volumeslice", 2, LICVolumeSliceOp, 4, 5, "axis ratio ?dataSetName?"}
     3250    {"scale",       2, LICScaleOp, 5, 6, "sx sy sz ?dataSetName?"},
     3251    {"slice",       2, LICVolumeSliceOp, 4, 5, "axis ratio ?dataSetName?"},
     3252    {"visible",     1, LICVisibleOp, 3, 4, "bool ?dataSetName?"}
    29343253};
    29353254static int nLICOps = NumCmdSpecs(licOps);
     
    50465365    Tcl_CreateObjCommand(interp, "contour2d",   Contour2DCmd,   NULL, NULL);
    50475366    Tcl_CreateObjCommand(interp, "contour3d",   Contour3DCmd,   NULL, NULL);
     5367    Tcl_CreateObjCommand(interp, "cutplane",    CutplaneCmd,    NULL, NULL);
    50485368    Tcl_CreateObjCommand(interp, "dataset",     DataSetCmd,     NULL, NULL);
    50495369    Tcl_CreateObjCommand(interp, "glyphs",      GlyphsCmd,      NULL, NULL);
     
    50735393    Tcl_DeleteCommand(interp, "contour2d");
    50745394    Tcl_DeleteCommand(interp, "contour3d");
     5395    Tcl_DeleteCommand(interp, "cutplane");
    50755396    Tcl_DeleteCommand(interp, "dataset");
    50765397    Tcl_DeleteCommand(interp, "glyphs");
  • trunk/packages/vizservers/vtkvis/protocol.txt

    r2506 r2514  
    143143contour3d visible <bool> <?datasetName?>
    144144contour3d wireframe <bool> <?datasetName?>
     145
     146cutplane add <?dataSetName?>
     147cutplane colormap <colorMapName> <?dataSetName?>
     148cutplane colormode <scalar|vmag|vx|vy|vz> <?datasetName?>
     149         Set the field used to color the object.  'scalar' uses
     150         the active scalar field.  'vmag' uses the magnitude of the current
     151         vector field, and 'vx','vy','vz' use the corresponding component of
     152         the active vector field.
     153cutplane delete <?dataSetName?>
     154cutplane edges <bool> <?dataSetName?>
     155cutplane lighting <bool> <?dataSetName?>
     156cutplane linecolor <r> <g> <b> <?dataSetName?>
     157cutplane linewidth <width> <?dataSetName?>
     158cutplane opacity <value> <?dataSetName?>
     159cutplane orient <qw> <qx> <qy> <qz> <?dataSetName?>
     160cutplane pos <x> <y> <z> <?dataSetName?>
     161cutplane scale <sx> <sy> <sz> <?dataSetName?>
     162cutplane slice axis ratio <?dataSetName?>
     163         For 3D data, select a slice along a principle axis of the volume. The
     164         ratio is [0,1]
     165cutplane visible <bool> <?dataSetName?>
     166cutplane wireframe <bool> <?datasetName?>
    145167
    146168glyphs add <shape> <?dataSetName?>
     
    194216heightmap pos <x> <y> <z> <?dataSetName?>
    195217heightmap scale <sx> <sy> <sz> <?dataSetName?>
     218heightmap slice axis ratio <?dataSetName?>
     219          For 3D data, select a slice along a principle axis of the volume. The
     220          ratio is [0,1]
    196221heightmap surface <bool> <?dataSetName?>
    197222          Toggle rendering of colormapped surface (mountain plot or cutplane)
    198223heightmap visible <bool> <?dataSetName?>
    199 heightmap volumeslice axis ratio <?dataSetName?>
    200           For 3D data, select a slice along a principle axis of the volume. The
    201           ratio is [0,1]
    202224heightmap wireframe <bool> <?datasetName?>
    203225
     
    213235lic pos <x> <y> <z> <?dataSetName?>
    214236lic scale <sx> <sy> <sz> <?dataSetName?>
     237lic slice <axis> <ratio> <?datasetName?>
     238    For 3D data, select a slice along a principle axis of the volume. The
     239    ratio is [0,1]
    215240lic visible <bool> <?datasetName?>
    216 lic volumeslice <axis> <ratio> <?datasetName?>
    217241
    218242molecule add <?datasetName?>
  • trunk/packages/vizservers/vtkvis/vtkRpCubeAxesActor2D.cpp

    r2492 r2514  
    439439  // can be changed). Therefore, we can not just assign pointers otherwise
    440440  // each individual axis text prop would point to the same text prop.
    441 #ifdef notdef
     441#if 1
    442442  if (this->AxisLabelTextProperty &&
    443443      this->AxisLabelTextProperty->GetMTime() > this->BuildTime)
     
    10781078}
    10791079
    1080 //----------------------------------------------------------------------------
    1081 
    1082 // Disable warnings about qualifiers on return types.
    1083 #if defined(_COMPILER_VERSION)
    1084 # pragma set woff 3303
    1085 #endif
    1086 #if defined(__INTEL_COMPILER)
    1087 # pragma warning (disable:858)
    1088 #endif
    1089 
    1090 #ifndef VTK_LEGACY_REMOVE
    1091 # ifdef VTK_WORKAROUND_WINDOWS_MANGLE
    1092 #  undef SetProp
    1093 #  undef GetProp
    1094 void vtkRpCubeAxesActor2D::SetPropA(vtkProp* prop)
    1095 {
    1096   VTK_LEGACY_REPLACED_BODY(vtkRpCubeAxesActor2D::SetProp, "VTK 5.0",
    1097                            vtkRpCubeAxesActor2D::SetViewProp);
    1098   this->SetViewProp(prop);
    1099 }
    1100 void vtkRpCubeAxesActor2D::SetPropW(vtkProp* prop)
    1101 {
    1102   VTK_LEGACY_REPLACED_BODY(vtkRpCubeAxesActor2D::SetProp, "VTK 5.0",
    1103                            vtkRpCubeAxesActor2D::SetViewProp);
    1104   this->SetViewProp(prop);
    1105 }
    1106 vtkProp* vtkRpCubeAxesActor2D::GetPropA()
    1107 {
    1108   VTK_LEGACY_REPLACED_BODY(vtkRpCubeAxesActor2D::GetProp, "VTK 5.0",
    1109                            vtkRpCubeAxesActor2D::GetViewProp);
    1110   return this->GetViewProp();
    1111 }
    1112 vtkProp* vtkRpCubeAxesActor2D::GetPropW()
    1113 {
    1114   VTK_LEGACY_REPLACED_BODY(vtkRpCubeAxesActor2D::GetProp, "VTK 5.0",
    1115                            vtkRpCubeAxesActor2D::GetViewProp);
    1116   return this->GetViewProp();
    1117 }
    1118 # endif
    1119 void vtkRpCubeAxesActor2D::SetProp(vtkProp* prop)
    1120 {
    1121   VTK_LEGACY_REPLACED_BODY(vtkRpCubeAxesActor2D::SetProp, "VTK 5.0",
    1122                            vtkRpCubeAxesActor2D::SetViewProp);
    1123   this->SetViewProp(prop);
    1124 }
    1125 vtkProp* vtkRpCubeAxesActor2D::GetProp()
    1126 {
    1127   VTK_LEGACY_REPLACED_BODY(vtkRpCubeAxesActor2D::GetProp, "VTK 5.0",
    1128                            vtkRpCubeAxesActor2D::GetViewProp);
    1129   return this->GetViewProp();
    1130 }
    1131 #endif
  • trunk/packages/vizservers/vtkvis/vtkRpCubeAxesActor2D.h

    r2320 r2514  
    253253  void ShallowCopy(vtkRpCubeAxesActor2D *actor);
    254254
    255 // Disable warnings about qualifiers on return types.
    256 #if defined(_COMPILER_VERSION)
    257 # pragma set woff 3303
    258 #endif
    259 #if defined(__INTEL_COMPILER)
    260 # pragma warning (push)
    261 # pragma warning (disable:858)
    262 #endif
    263 
    264 #ifdef VTK_WORKAROUND_WINDOWS_MANGLE
    265 # define SetPropA SetProp
    266 # define SetPropW SetProp
    267 # define GetPropA GetProp
    268 # define GetPropW GetProp
    269 #endif
    270 
    271   // Description:
    272   // @deprecated Replaced by vtkRpCubeAxesActor2D::SetViewProp() as of VTK 5.0.
    273   VTK_LEGACY(virtual void SetProp(vtkProp* prop));
    274 
    275   // Description:
    276   // @deprecated Replaced by vtkRpCubeAxesActor2D::GetViewProp() as of VTK 5.0.
    277   VTK_LEGACY(virtual vtkProp* GetProp());
    278 
    279 #ifdef VTK_WORKAROUND_WINDOWS_MANGLE
    280 # undef SetPropW
    281 # undef SetPropA
    282 # undef GetPropW
    283 # undef GetPropA
    284   //BTX
    285   VTK_LEGACY(virtual void SetPropA(vtkProp* prop));
    286   VTK_LEGACY(virtual void SetPropW(vtkProp* prop));
    287   VTK_LEGACY(virtual vtkProp* GetPropA());
    288   VTK_LEGACY(virtual vtkProp* GetPropW());
    289   //ETX
    290 #endif
    291 
    292 // Reset disabled warning about qualifiers on return types.
    293 #if defined(__INTEL_COMPILER)
    294 # pragma warning (pop)
    295 #endif
    296 #if defined(_COMPILER_VERSION)
    297 # pragma reset woff 3303
    298 #endif
    299 
    300255protected:
    301256  vtkRpCubeAxesActor2D();
Note: See TracChangeset for help on using the changeset viewer.