geometryBase.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::geometryBase
26 
27 Description
28 
29 SourceFiles
30  geometryBase.C
31 
32 \*---------------------------------------------------------------------------*/
33 
34 #ifndef geometryBase_H
35 #define geometryBase_H
36 
37 #include "dictionary.H"
38 #include "vector.H"
39 #include "DataEntry.H"
40 #include "HashPtrTable.H"
41 #include "NamedEnum.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 class vtkRenderer;
46 class vtkActor;
47 
48 namespace Foam
49 {
50 
51 class runTimePostProcessing;
52 
53 /*---------------------------------------------------------------------------*\
54  Class geometryBase Declaration
55 \*---------------------------------------------------------------------------*/
56 
57 class geometryBase
58 {
59 
60 public:
61 
62  // Public enumerations
63 
64  enum renderModeType
65  {
68  rmPhong
69  };
70 
72 
73 
74 private:
75 
76  // Private Member Functions
77 
78  //- Disallow default bitwise copy construct
79  geometryBase(const geometryBase&);
80 
81  //- Disallow default bitwise assignment
82  void operator=(const geometryBase&);
83 
84 
85 protected:
86 
87  // Protected data
88 
89  //- Reference to the parent function object
91 
92  //- Name
93  word name_;
94 
95  //- Visible flag
96  bool visible_;
97 
98  //- Render mode
100 
101  //- Opacity
103 
104  //- Reference to the colours
106 
107 
108  // Protected functions
109 
110  //- Initialse actor
111  void initialiseActor(vtkActor* actor) const;
112 
113 
114 public:
115 
116  // Constructors
117 
118  //- Construct from dictionary
120  (
122  const dictionary& dict,
124  );
125 
126 
127  //- Destructor
128  virtual ~geometryBase();
129 
130 
131  // Member Functions
132 
133  // Access
134 
135  //- Return the reference to the parent function object
136  const runTimePostProcessing& parent() const;
137 
138  //- Return the name
139  const word& name() const;
140 
141  //- Return the visible flag
142  bool visible() const;
143 
144  //- Return the opacity
145  scalar opacity(const scalar position) const;
146 
147  //- Return reference to the colours
149 
150 
151  //- Add geometry to scene
152  virtual void addGeometryToScene
153  (
154  const scalar position,
155  vtkRenderer* renderer
156  ) = 0;
157 
158  //- Update the actors
159  virtual void updateActors(const scalar position) = 0;
160 };
161 
162 
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 
165 } // End namespace Foam
166 
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168 
169 #endif
170 
171 // ************************************************************************* //
Foam::geometryBase::name_
word name_
Name.
Definition: geometryBase.H:92
Foam::geometryBase::opacity
scalar opacity(const scalar position) const
Return the opacity.
Definition: geometryBase.C:136
Foam::geometryBase::parent_
const runTimePostProcessing & parent_
Reference to the parent function object.
Definition: geometryBase.H:89
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::geometryBase::geometryBase
geometryBase(const geometryBase &)
Disallow default bitwise copy construct.
Foam::geometryBase::rmPhong
@ rmPhong
Definition: geometryBase.H:67
NamedEnum.H
Foam::geometryBase::visible
bool visible() const
Return the visible flag.
Definition: geometryBase.C:130
Foam::geometryBase::colours_
const HashPtrTable< DataEntry< vector >, word > & colours_
Reference to the colours.
Definition: geometryBase.H:104
Foam::geometryBase::visible_
bool visible_
Visible flag.
Definition: geometryBase.H:95
Foam::geometryBase
Definition: geometryBase.H:56
Foam::runTimePostProcessing
Function object to generate images during run-time.
Definition: runTimePostProcessing.H:83
Foam::geometryBase::updateActors
virtual void updateActors(const scalar position)=0
Update the actors.
Foam::geometryBase::operator=
void operator=(const geometryBase &)
Disallow default bitwise assignment.
Foam::geometryBase::opacity_
autoPtr< DataEntry< scalar > > opacity_
Opacity.
Definition: geometryBase.H:101
DataEntry.H
Foam::geometryBase::colours
const HashPtrTable< DataEntry< vector >, word > & colours() const
Return reference to the colours.
Definition: geometryBase.C:143
Foam::geometryBase::renderModeTypeNames
static const NamedEnum< renderModeType, 3 > renderModeTypeNames
Definition: geometryBase.H:70
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::geometryBase::name
const word & name() const
Return the name.
Definition: geometryBase.C:124
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::geometryBase::rmFlat
@ rmFlat
Definition: geometryBase.H:65
Foam::geometryBase::parent
const runTimePostProcessing & parent() const
Return the reference to the parent function object.
Definition: geometryBase.C:118
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::geometryBase::rmGouraud
@ rmGouraud
Definition: geometryBase.H:66
Foam::HashPtrTable
A HashTable specialization for hashing pointers.
Definition: HashPtrTable.H:50
Foam::geometryBase::renderModeType
renderModeType
Definition: geometryBase.H:63
HashPtrTable.H
dictionary.H
Foam::geometryBase::renderMode_
renderModeType renderMode_
Render mode.
Definition: geometryBase.H:98
Foam::geometryBase::~geometryBase
virtual ~geometryBase()
Destructor.
Definition: geometryBase.C:112
vector.H
Foam::geometryBase::initialiseActor
void initialiseActor(vtkActor *actor) const
Initialse actor.
Definition: geometryBase.C:52
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::geometryBase::addGeometryToScene
virtual void addGeometryToScene(const scalar position, vtkRenderer *renderer)=0
Add geometry to scene.
Foam::NamedEnum< renderModeType, 3 >