surface.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::surface
26 
27 Description
28 
29 SourceFiles
30  surface.C
31 
32 \*---------------------------------------------------------------------------*/
33 
34 #ifndef surface_H
35 #define surface_H
36 
37 #include "geometryBase.H"
38 #include "NamedEnum.H"
39 #include "runTimeSelectionTables.H"
40 
41 #include "vtkSmartPointer.h"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 class vtkActor;
46 class vtkRenderer;
47 class vtkPolyData;
48 
49 namespace Foam
50 {
51 
52 /*---------------------------------------------------------------------------*\
53  Class surface Declaration
54 \*---------------------------------------------------------------------------*/
55 
56 class surface
57 :
58  public geometryBase
59 {
60 public:
61 
62  // Public enumerations
63 
65  {
70  rtGlyph
71  };
72 
74 
75 
76 private:
77 
78  // Private Member Functions
79 
80  //- Disallow default bitwise copy construct
81  surface(const surface&);
82 
83  //- Disallow default bitwise assignment
84  void operator=(const surface&);
85 
86 
87 protected:
88 
89  // Protected data
90 
91  //- Representation type
93 
94  //- Activate feature edges
95  bool featureEdges_;
96 
97  //- Surface colour
99 
100  //- Edge colour
102 
103  //- Surface actor
104  vtkSmartPointer<vtkActor> surfaceActor_;
105 
106  //- Edge actor
107  vtkSmartPointer<vtkActor> edgeActor_;
108 
109  //- Max glyph length for representation type rtGlyph
110  scalar maxGlyphLength_;
111 
112 
113  // Protected Member Functions
114 
115  //- Set the representation
116  void setRepresentation(vtkActor* actor) const;
117 
118  //- Add feature edges to scene
119  void addFeatureEdges
120  (
121  vtkRenderer* renderer,
122  vtkPolyData* data
123  ) const;
124 
125 
126 public:
127 
128  //- Run-time type information
129  TypeName("surface");
130 
131 
132  // Declare run-time constructor selection table
133 
135  (
136  autoPtr,
137  surface,
138  dictionary,
139  (
141  const dictionary& dict,
143  ),
144  (parent, dict, colours)
145  );
146 
147 
148  // Constructors
149 
150  //- Construct from dictionary
151  surface
152  (
154  const dictionary& dict,
156  );
157 
158 
159  // Selectors
160 
161  //- Return a reference to the selected RAS model
162  static autoPtr<surface> New
163  (
165  const dictionary& dict,
167  const word& surfaceName
168  );
169 
170 
171  //- Destructor
172  virtual ~surface();
173 
174 
175  // Member Functions
176 
177  //- Update the actors
178  virtual void updateActors(const scalar position);
179 };
180 
181 
182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
183 
184 } // End namespace Foam
185 
186 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187 
188 #endif
189 
190 // ************************************************************************* //
Foam::surface::rtGlyph
@ rtGlyph
Definition: surface.H:69
Foam::surface::updateActors
virtual void updateActors(const scalar position)
Update the actors.
Definition: surface.C:228
Foam::surface::surface
surface(const surface &)
Disallow default bitwise copy construct.
Foam::surface::edgeColour_
autoPtr< DataEntry< vector > > edgeColour_
Edge colour.
Definition: surface.H:100
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::surface::representationTypeNames
static const NamedEnum< representationType, 5 > representationTypeNames
Definition: surface.H:72
NamedEnum.H
Foam::surface::representation_
representationType representation_
Representation type.
Definition: surface.H:91
geometryBase.H
Foam::geometryBase
Definition: geometryBase.H:56
Foam::surface::~surface
virtual ~surface()
Destructor.
Definition: surface.C:222
Foam::surface::operator=
void operator=(const surface &)
Disallow default bitwise assignment.
Foam::runTimePostProcessing
Function object to generate images during run-time.
Definition: runTimePostProcessing.H:83
Foam::surface::TypeName
TypeName("surface")
Run-time type information.
Foam::surface::surfaceActor_
vtkSmartPointer< vtkActor > surfaceActor_
Surface actor.
Definition: surface.H:103
Foam::surface::declareRunTimeSelectionTable
declareRunTimeSelectionTable(autoPtr, surface, dictionary,(const runTimePostProcessing &parent, const dictionary &dict, const HashPtrTable< DataEntry< vector >, word > &colours),(parent, dict, colours))
Foam::surface::surfaceColour_
autoPtr< DataEntry< vector > > surfaceColour_
Surface colour.
Definition: surface.H:97
Foam::surface::maxGlyphLength_
scalar maxGlyphLength_
Max glyph length for representation type rtGlyph.
Definition: surface.H:109
Foam::geometryBase::colours
const HashPtrTable< DataEntry< vector >, word > & colours() const
Return reference to the colours.
Definition: geometryBase.C:143
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam::surface::New
static autoPtr< surface > New(const runTimePostProcessing &parent, const dictionary &dict, const HashPtrTable< DataEntry< vector >, word > &colours, const word &surfaceName)
Return a reference to the selected RAS model.
Definition: surface.C:191
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::surface::rtSurfaceWithEdges
@ rtSurfaceWithEdges
Definition: surface.H:68
Foam::geometryBase::parent
const runTimePostProcessing & parent() const
Return the reference to the parent function object.
Definition: geometryBase.C:118
Foam::surface::representationType
representationType
Definition: surface.H:63
Foam::surface::rtSurface
@ rtSurface
Definition: surface.H:67
Foam::autoPtr
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:117
Foam::surface::setRepresentation
void setRepresentation(vtkActor *actor) const
Set the representation.
Definition: surface.C:63
Foam::HashPtrTable
A HashTable specialization for hashing pointers.
Definition: HashPtrTable.H:50
runTimeSelectionTables.H
Macros to ease declaration of run-time selection tables.
Foam::surface::rtWireframe
@ rtWireframe
Definition: surface.H:66
Foam::surface
Definition: surface.H:55
Foam::surface::featureEdges_
bool featureEdges_
Activate feature edges.
Definition: surface.H:94
Foam::surface::addFeatureEdges
void addFeatureEdges(vtkRenderer *renderer, vtkPolyData *data) const
Add feature edges to scene.
Definition: surface.C:97
Foam::surface::rtNone
@ rtNone
Definition: surface.H:65
Foam::DataEntry
Top level data entry class for use in dictionaries. Provides a mechanism to specify a variable as a c...
Definition: DataEntry.H:52
Foam::data
Database for solution data, solver performance and other reduced data.
Definition: data.H:52
Foam::NamedEnum< representationType, 5 >
Foam::surface::edgeActor_
vtkSmartPointer< vtkActor > edgeActor_
Edge actor.
Definition: surface.H:106