Go to the documentation of this file.
35 #include "vtkPolyData.h"
36 #include "vtkPolyDataMapper.h"
37 #include "vtkProperty.h"
38 #include "vtkRenderer.h"
39 #include "vtkSmartPointer.h"
42 #include "vtkPolyDataReader.h"
43 #include "vtkXMLPolyDataReader.h"
49 namespace functionObjects
51 namespace runTimePostPro
70 if (
"vtk" == fName.
ext())
74 reader->SetFileName(fName.c_str());
76 dataset = reader->GetOutput();
81 if (
"vtp" == fName.
ext())
85 reader->SetFileName(fName.c_str());
87 dataset = reader->GetOutput();
126 const scalar position,
127 vtkRenderer* renderer
136 fileName fName = getFileName(
"file", fieldName_);
140 <<
"Unable to read file name from function object "
141 << functionObjectName_ <<
" for field " << fieldName_
142 <<
". Line will not be processed"
148 auto polyData = getPolyDataFile(fName);
150 if (!polyData || polyData->GetNumberOfPoints() == 0)
153 <<
"Could not read "<< fName <<
nl
154 <<
"Only VTK (.vtp, .vtk) files are supported"
168 queryFieldAssociation(fieldName_, polyData),
173 actor_->SetMapper(mapper);
175 addLines(position, actor_, polyData);
177 renderer->AddActor(actor_);
183 const scalar position
186 actor_->GetProperty()->SetLineWidth(2);
187 actor_->GetProperty()->SetOpacity(opacity(position));
195 return removeFile(
"file", fieldName_);
virtual void addGeometryToScene(const scalar position, vtkRenderer *renderer)
Add tube(s) to scene.
addToRunTimeSelectionTable(surface, contourFilter, dictionary)
A class for handling file names.
virtual bool clear()
Clear files used to create the object(s)
virtual void updateActors(const scalar position)
Update actors.
Visualisation of line data (eg, streamlines)
Ostream & endl(Ostream &os)
Add newline and flush stream.
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.
Generate images during run-time.
surfacesMesh setField(triSurfaceToAgglom)
virtual bool clear()
Clear files used to create the object(s)
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 .)
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.
functionObjectLine(const functionObjectLine &)=delete
No copy construct.
#define DebugInfo
Report an information message using Foam::Info.
A HashTable of pointers to objects of type <T>.
defineTypeName(contourFilter)
virtual ~functionObjectLine()
Destructor.
#define WarningInFunction
Report a warning using Foam::Warning.