Go to the documentation of this file.
36 #include "vtkPolyData.h"
37 #include "vtkPolyDataMapper.h"
38 #include "vtkProperty.h"
39 #include "vtkRenderer.h"
40 #include "vtkSmartPointer.h"
43 #include "vtkPolyDataReader.h"
44 #include "vtkXMLPolyDataReader.h"
50 namespace functionObjects
52 namespace runTimePostPro
73 if (fName.
ext() ==
"vtp")
77 reader->SetFileName(fName.c_str());
79 dataset = reader->GetOutput();
101 cloudName_(
dict.get<
word>(
"cloud")),
103 colourFieldName_(
dict.get<
word>(
"colourField")),
120 const scalar position,
121 vtkRenderer* renderer
140 inputFileName_ = getFileName(
"file", cloudName_);
142 if (inputFileName_.size())
144 polyData = getPolyDataFile(inputFileName_);
146 if (!polyData || polyData->GetNumberOfPoints() == 0)
151 <<
"Could not read "<< inputFileName_ <<
nl
152 <<
"Only VTK (.vtp) files are supported"
158 <<
" Resolved cloud file " << inputFileName_ <<
endl;
166 <<
"Unable to find function object " << functionObjectName_
167 <<
" output for field " << fieldName_
168 <<
". Cloud will not be processed"
174 inputFileName_.clear();
197 queryFieldSummary(fieldName_, polyData);
200 queryFieldSummary(colourFieldName_, polyData);
203 <<
" Field " << fieldName_ <<
' ' << scaleFieldInfo.
info() <<
nl
204 <<
" Field " << colourFieldName_ <<
' ' << colourFieldInfo.
info()
212 actor_->SetMapper(mapper);
219 fieldName_, scaleFieldInfo,
220 colourFieldName_, colourFieldInfo,
227 renderer->AddActor(actor_);
237 const scalar position,
238 vtkRenderer* renderer
242 addGeometryFromFile(position, renderer);
248 const scalar position
253 const vector colour = pointColour_->value(position);
255 vtkProperty* prop = actor_->GetProperty();
257 prop->SetOpacity(opacity(position));
259 prop->SetColor(colour[0], colour[1], colour[2]);
268 if (inputFileName_.size() &&
Foam::rm(inputFileName_))
270 inputFileName_.clear();
addToRunTimeSelectionTable(surface, contourFilter, dictionary)
A class for handling words, derived from Foam::string.
bool addGeometryFromFile(const scalar position, vtkRenderer *renderer)
Add cloud to scene (using file source)
A class for handling file names.
General field characteristics.
virtual void updateActors(const scalar position)
Update actors.
bool rm(const fileName &file)
Remove a file (or its gz equivalent), returning true if successful.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Visualisation of point data.
Top level data entry class for use in dictionaries. Provides a mechanism to specify a variable as a c...
Base class for function object visualisation.
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
Generate images during run-time.
virtual bool clear()
Clear files used to create the object(s)
InfoProxy< fieldSummary > info() const
virtual bool clear()
Clear files used to create the object(s)
virtual void addGeometryToScene(const scalar position, vtkRenderer *renderer)
Add cloud to scene.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Macros for easy insertion into run-time selection tables.
word ext() const
Return file name extension (part after last .)
functionObjectCloud(const functionObjectCloud &)=delete
No copy construct.
static bool master(const label communicator=0)
Am I the master process.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
virtual ~functionObjectCloud()
Destructor.
#define DebugInfo
Report an information message using Foam::Info.
A HashTable of pointers to objects of type <T>.
defineTypeName(contourFilter)
#define WarningInFunction
Report a warning using Foam::Warning.