Ignore:
Timestamp:
Jul 18, 2013, 2:51:21 PM (11 years ago)
Author:
ldelgass
Message:

Add colormode for PolyData?, by default color map if an active scalar field with
multiple components is present (color scalars). Add protocol for image/text3d
drawing components. Make 'color' synonym for 'ccolor' in protocol commands,
also accept 'ccolor' or 'constant' as colormode. Add experimental commands for
simple legend (no field info required), extended colormode for heightmap with
explicit range. Add fontconfig support (needs testing). Added code to remove
duplicate points from unstructured grids. Should probably be optional. Stack
trace on error (if WANT_TRACE is on) using VTK.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/vizservers/vtkvis/PolyData.h

    r3774 r3818  
    1212#include <vtkPolyDataMapper.h>
    1313#include <vtkActor.h>
     14#include <vtkLookupTable.h>
    1415
     16#include "ColorMap.h"
    1517#include "GraphicsObject.h"
    16 #include "DataSet.h"
    1718
    1819namespace VtkVis {
     
    2930        CLOUD_POINTS
    3031    };
     32    enum ColorMode {
     33        COLOR_BY_SCALAR,
     34        COLOR_BY_VECTOR_MAGNITUDE,
     35        COLOR_BY_VECTOR_X,
     36        COLOR_BY_VECTOR_Y,
     37        COLOR_BY_VECTOR_Z,
     38        COLOR_CONSTANT
     39    };
    3140
    3241    PolyData();
     
    3847    }
    3948
     49    virtual void setDataSet(DataSet *dataSet,
     50                            Renderer *renderer);
     51
    4052    virtual void setClippingPlanes(vtkPlaneCollection *planes);
    4153
    4254    void setCloudStyle(CloudStyle style);
    4355
     56    void setInterpolateBeforeMapping(bool state);
     57
     58    void setColorMode(ColorMode mode, DataSet::DataAttributeType type,
     59                      const char *name, double range[2] = NULL);
     60
     61    void setColorMode(ColorMode mode,
     62                      const char *name, double range[2] = NULL);
     63
     64    void setColorMode(ColorMode mode);
     65
     66    void setColorMap(ColorMap *colorMap);
     67
     68    /**
     69     * \brief Return the ColorMap in use
     70     */
     71    ColorMap *getColorMap()
     72    {
     73        return _colorMap;
     74    }
     75
     76    void updateColorMap();
     77
     78    virtual void updateRanges(Renderer *renderer);
     79
    4480private:
    4581    virtual void update();
    4682
     83    ColorMap *_colorMap;
     84    ColorMode _colorMode;
     85    std::string _colorFieldName;
     86    DataSet::DataAttributeType _colorFieldType;
     87    double _colorFieldRange[2];
     88    double _vectorMagnitudeRange[2];
     89    double _vectorComponentRange[3][2];
     90    Renderer *_renderer;
     91
    4792    CloudStyle _cloudStyle;
     93    vtkSmartPointer<vtkLookupTable> _lut;
    4894    vtkSmartPointer<vtkPolyDataMapper> _mapper;
    4995};
Note: See TracChangeset for help on using the changeset viewer.