Go to the documentation of this file.
38 #include "vtkCellArray.h"
39 #include "vtkCellData.h"
40 #include "vtkDoubleArray.h"
41 #include "vtkPointData.h"
42 #include "vtkPoints.h"
43 #include "vtkPolyData.h"
44 #include "vtkPolyDataMapper.h"
45 #include "vtkProperty.h"
46 #include "vtkRenderer.h"
47 #include "vtkSmartPointer.h"
50 #include "vtkOBJReader.h"
51 #include "vtkSTLReader.h"
52 #include "vtkPolyDataReader.h"
53 #include "vtkXMLPolyDataReader.h"
59 namespace functionObjects
61 namespace runTimePostPro
80 if (
"vtk" == fName.
ext())
84 reader->SetFileName(fName.c_str());
86 dataset = reader->GetOutput();
91 if (
"vtp" == fName.
ext())
95 reader->SetFileName(fName.c_str());
97 dataset = reader->GetOutput();
102 if (
"obj" == fName.
ext())
106 reader->SetFileName(fName.c_str());
108 dataset = reader->GetOutput();
113 if (
"stl" == fName.
ext() ||
"stlb" == fName.
ext())
117 reader->SetFileName(fName.c_str());
119 dataset = reader->GetOutput();
130 dataset->GetCellData()->SetNormals
145 const scalar position,
146 vtkRenderer* renderer,
151 if (!visible_ || !renderer || !Pstream::master())
156 if (representation_ == rtGlyph)
159 <<
"Glyph representation not available for " << typeName
163 DebugInfo <<
" Add geometry surface: " << fName <<
nl;
165 auto surf = getPolyDataFile(fName);
167 if (!surf || !surf->GetNumberOfPoints())
170 <<
"Could not read "<< fName <<
nl
176 mapper->ScalarVisibilityOff();
178 mapper->SetInputData(surf);
180 addFeatureEdges(renderer, surf);
182 surfaceActor_->SetMapper(mapper);
184 setRepresentation(surfaceActor_);
186 renderer->AddActor(surfaceActor_);
202 dict.readEntry(
"files", fileNames_);
215 fileNames_(fileNames)
223 const scalar position,
224 vtkRenderer* renderer
242 const scalar position
252 surfaceActor_->GetProperty()->SetOpacity(opacity(position));
254 vector sc = surfaceColour_->value(position);
255 surfaceActor_->GetProperty()->SetColor(sc[0], sc[1], sc[2]);
257 vector ec = edgeColour_->value(position);
258 surfaceActor_->GetProperty()->SetEdgeColor(ec[0], ec[1], ec[2]);
defineTypeNameAndDebug(geometrySurface, 0)
addToRunTimeSelectionTable(surface, contourFilter, dictionary)
A class for handling file names.
virtual void updateActors(const scalar position)
Update actors.
geometrySurface(const geometrySurface &)=delete
No copy construct.
static void addGeometryToScene(PtrList< Type > &objects, const scalar position, vtkRenderer *renderer)
Top level data entry class for use in dictionaries. Provides a mechanism to specify a variable as a c...
static void updateActors(PtrList< Type > &objects, const scalar position)
Generate images during run-time.
Visualisation of surface data with additional routines for handling parallel distributed data.
virtual bool clear()
Clear files used to create the object(s) - no-op.
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 .)
errorManipArg< error, int > exit(error &err, const int errNo=1)
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define DebugInfo
Report an information message using Foam::Info.
A HashTable of pointers to objects of type <T>.
void addGeometryToScene(const scalar position, vtkRenderer *renderer, const fileName &fName) const
Add surface (file) to scene.