avtMeshPlot.h 5.42 KB
Newer Older
hrchilds's avatar
hrchilds committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
// ************************************************************************* //
//                               avtMeshPlot.h                               //
// ************************************************************************* //

#ifndef AVT_MESH_PLOT_H
#define AVT_MESH_PLOT_H

#include <LineAttributes.h>
#include <MeshAttributes.h>

#include <avtPlot.h>
#include <avtSurfaceAndWireframeRenderer.h>
#include <avtGhostZoneAndFacelistFilter.h>

class     vtkProperty;

class     avtMeshFilter;
class     avtPointToGlyphFilter;
class     avtUserDefinedMapper;
class     avtVariableLegend;
class     avtSmoothPolyDataFilter;


// ****************************************************************************
//  Method: avtMeshPlot
//
//  Purpose:
//      A concrete type of avtPlot for meshes.
//
//  Programmer: Kathleen Bonnell 
//  Creation:   March 21, 2001 
//
//  Modifications:
//
//    Jeremy Meredith, Tue Jun  5 20:45:02 PDT 2001
//    Allow storage of attributes as a class member.
//
//    Kathleen Bonnell, Fri Jun  15 14:15:43 PDT 2001
//    Added mesh filter. 
//
//    Kathleen Bonnell, Fri Jun 29 10:27:44 PDT 2001 
//    Added method to set opaque render mode. 
//
//    Hank Childs, Thu Jul 26 11:59:16 PDT 2001
//    Went back to inheriting from avtPlot, since this can be a line plot or
//    a surface plot.
//
//    Kathleen Bonnell, Wed Aug 22 15:22:55 PDT 2001 
//    Use avtUserDefinedMapper and avtSurfaceAndWireframeRenderer instead
//    of avtWireframeMapper to better draw opaque mode.  Modified arguments
//    to SetLineWidth and SetLineStyle.  Added member property.
//    
//    Kathleen Bonnell, Sep  5 12:13:54 PDT 2001
//    Add method to set the color for opaque mode.
//
//    Kathleen Bonnell, Wed Sep 26 15:14:07 PDT 2001 
//    Add methods to set the background/foreground colors.
//
//    Jeremy Meredith, Fri Nov  9 10:15:17 PST 2001
//    Added an Equivalent method.
//
//    Hank Childs, Sun Jun 23 21:07:55 PDT 2002
//    Added support for point meshes.
//
//    Jeremy Meredith, Mon Jul  8 18:38:04 PDT 2002
//    Added facelist filter before the mesh lines were calculated.
//
//    Hank Childs, Fri Jul 19 08:59:21 PDT 2002
//    Use the ghost zone and facelist filter instead of the normal facelist
//    filter.
//
//    Kathleen Bonnell, Tue Oct 22 08:33:26 PDT 2002
//    Added ApplyRenderingTransformation. 
//    
//    Jeremy Meredith, Tue Dec 10 10:04:18 PST 2002
//    Added smooth poly data filter.
//
//    Kathleen Bonnell, Mon Mar 24 17:48:27 PST 2003
//    Added SetOpaqueColor with double* arg.  Added flag
//    wireframeRenderingIsInappropriate. 
//
hrchilds's avatar
hrchilds committed
82
83
84
//    Kathleen Bonnell, Wed Aug 27 15:45:45 PDT 2003 
//    Added SetOpaqueMeshIsAppropriate.
//    
hrchilds's avatar
hrchilds committed
85
86
//    Kathleen Bonnell, Thu Sep  4 11:15:30 PDT 2003 
//    Removed argument from 'SetRenderOpaque', added 'ShouldRenderOpaque'.
hrchilds's avatar
hrchilds committed
87
88
89
//
//    Mark C. Miller, Thu Aug 12 21:17:35 PDT 2004
//    Added GetCellCountMultiplierForSRThreshold
hrchilds's avatar
hrchilds committed
90
91
92
//
//    Mark C. Miller, Mon Aug 23 20:24:31 PDT 2004
//    Changed GetCellCountMultiplierForSRThreshold to Set...
hrchilds's avatar
hrchilds committed
93
//    
hrchilds's avatar
hrchilds committed
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
// ****************************************************************************

class
avtMeshPlot : public avtPlot
{
  public:
                    avtMeshPlot();
    virtual        ~avtMeshPlot();

    static avtPlot *Create();

    virtual const char *GetName(void)  { return "MeshPlot"; };
    virtual void    ReleaseData(void);

    virtual void    SetAtts(const AttributeGroup*);
    virtual bool    Equivalent(const AttributeGroup*);

    void            SetLegend(bool);
    void            SetLineWidth(_LineWidth);
    void            SetLineStyle(_LineStyle);
    void            SetPointSize(float);
hrchilds's avatar
hrchilds committed
115
    void            SetRenderOpaque(void);
hrchilds's avatar
hrchilds committed
116
117
118
119
120
121
122
123
124
    void            SetMeshColor(const unsigned char *);
    void            SetMeshColor(const double *);
    void            SetOpaqueColor(const unsigned char *, bool force = false);
    void            SetOpaqueColor(const double *, bool force = false);
    void            SetVarName(const char *);
    virtual bool    SetBackgroundColor(const double *);
    virtual bool    SetForegroundColor(const double *);

    virtual int     TargetTopologicalDimension(void);
hrchilds's avatar
hrchilds committed
125
126
    virtual const AttributeSubject 
                   *SetOpaqueMeshIsAppropriate(bool);
hrchilds's avatar
hrchilds committed
127

hrchilds's avatar
hrchilds committed
128

hrchilds's avatar
hrchilds committed
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
  protected:
    avtSurfaceAndWireframeRenderer_p renderer;
    avtUserDefinedMapper            *mapper;
    avtVariableLegend               *varLegend;
    avtGhostZoneAndFacelistFilter   *ghostAndFaceFilter;
    avtMeshFilter                   *filter;
    avtPointToGlyphFilter           *glyphPoints;
    vtkProperty                     *property;
    avtLegend_p                      varLegendRefPtr;
    avtSmoothPolyDataFilter         *smooth;
    double                           bgColor[3];
    double                           fgColor[3];
    bool                             wireframeRenderingIsInappropriate;
    MeshAttributes           atts;

    virtual avtMapper       *GetMapper(void);
    virtual avtDataObject_p  ApplyOperators(avtDataObject_p);
    virtual avtDataObject_p  ApplyRenderingTransformation(avtDataObject_p);
    virtual void             CustomizeBehavior(void);
    virtual void             CustomizeMapper(avtDataObjectInformation &);
    virtual avtLegend_p      GetLegend(void) { return varLegendRefPtr; };
hrchilds's avatar
hrchilds committed
150
151
    void                     SetCellCountMultiplierForSRThreshold(
                                 const avtDataObject_p);
hrchilds's avatar
hrchilds committed
152
153
154

  private:
    bool                     ShouldRenderOpaque(void);
hrchilds's avatar
hrchilds committed
155
156
157
158
159
160
};


#endif