surface Class Reference

Visualisation of surface data with additional routines for handling parallel distributed data. More...

Inheritance diagram for surface:
[legend]
Collaboration diagram for surface:
[legend]

Public Types

enum  representationType {
  rtNone, rtGlyph, rtWireframe, rtSurface,
  rtSurfaceWithEdges
}
 Surface representation types. More...
 
- Public Types inherited from geometryBase
enum  renderModeType { rmFlat, rmGouraud, rmPhong }
 Surface shading types. More...
 

Public Member Functions

 TypeNameNoDebug ("surface")
 Run-time type information. More...
 
 declareRunTimeSelectionTable (autoPtr, surface, dictionary,(const runTimePostProcessing &parent, const dictionary &dict, const HashPtrTable< Function1< vector >> &colours),(parent, dict, colours))
 
 surface (const runTimePostProcessing &parent, const dictionary &dict, const HashPtrTable< Function1< vector >> &colours)
 Construct from dictionary. More...
 
virtual ~surface ()
 Destructor. More...
 
virtual void updateActors (const scalar position)
 Update the actors. More...
 
- Public Member Functions inherited from geometryBase
 geometryBase (const runTimePostProcessing &parent_, const dictionary &dict, const HashPtrTable< Function1< vector >> &colours)
 Construct from dictionary. More...
 
virtual ~geometryBase ()
 Destructor. More...
 
const runTimePostProcessingparent () const
 Return the reference to the parent function object. More...
 
bool needsCollective () const
 May need to gather geometry parts to render on single-processor. More...
 
const wordname () const
 Return the name. More...
 
bool visible () const
 Return the visible flag. More...
 
bool parallel () const
 Allow parallel rendering. More...
 
scalar opacity (const scalar position) const
 Return the opacity. More...
 
const HashPtrTable< Function1< vector > > & colours () const
 Return reference to the colours. More...
 
virtual void addGeometryToScene (const scalar position, vtkRenderer *renderer)=0
 Add geometry to scene. More...
 
virtual bool clear ()=0
 Clear any files used to create the object(s) More...
 

Static Public Member Functions

static autoPtr< surfaceNew (const runTimePostProcessing &parent, const dictionary &dict, const HashPtrTable< Function1< vector >> &colours, const word &surfaceName)
 Return selected surface. More...
 

Static Public Attributes

static const Enum< representationTyperepresentationTypeNames
 Names for surface representation types. More...
 
- Static Public Attributes inherited from geometryBase
static const Enum< renderModeTyperenderModeTypeNames
 Names for surface shading types. More...
 
static int debug
 Debug switch. More...
 

Protected Member Functions

void setRepresentation (vtkActor *actor) const
 Set the representation. More...
 
void addFeatureEdges (vtkRenderer *renderer, vtkFeatureEdges *featureEdges) const
 Add feature edges to scene. More...
 
void addFeatureEdges (vtkRenderer *renderer, vtkPolyData *data) const
 Add feature edges to scene. More...
 
void addFeatureEdges (vtkRenderer *renderer, vtkCompositeDataGeometryFilter *input) const
 Add feature edges to scene. More...
 
vtkSmartPointer< vtkMultiPieceDataSet > gatherSurfacePieces (const polySurface *surf) const
 
vtkSmartPointer< vtkMultiPieceDataSet > gatherFaceCentres (const polySurface *surf) const
 
template<class Type , class GeoMeshType >
bool addField (vtkDataSet *piece, const Field< Type > &fld, const word &fieldName) const
 Add field of Type to piece as VTK field data in GeoMeshType slot. More...
 
template<class Type , class GeoMeshType >
bool addDimField (vtkDataSet *piece, const regIOobject *ioptr, const word &fieldName) const
 
template<class GeoMeshType >
bool addDimField (vtkDataSet *piece, const regIOobject *ioptr, const word &fieldName) const
 
template<class Type , class GeoMeshType >
bool addDimField (vtkMultiPieceDataSet *multiPiece, const DimensionedField< Type, GeoMeshType > *fldptr, const word &fieldName) const
 
template<class Type , class GeoMeshType >
bool addDimField (vtkMultiPieceDataSet *multiPiece, const regIOobject *ioptr, const word &fieldName) const
 
template<class GeoMeshType >
bool addDimField (vtkMultiPieceDataSet *multiPiece, const regIOobject *ioptr, const word &fieldName) const
 
template<class GeoMeshType >
bool addDimField (vtkMultiPieceDataSet *multiPiece, const polySurface *surf, const word &fieldName) const
 Add using regIOobject information obtained from surface. More...
 
 surface (const surface &)=delete
 No copy construct. More...
 
void operator= (const surface &)=delete
 No copy assignment. More...
 
- Protected Member Functions inherited from geometryBase
void initialiseActor (vtkActor *actor) const
 Initialise actor. More...
 
 geometryBase (const geometryBase &)=delete
 No copy construct. More...
 
void operator= (const geometryBase &)=delete
 No copy assignment. More...
 

Protected Attributes

representationType representation_
 Representation type. More...
 
bool featureEdges_
 Activate feature edges. More...
 
bool backFaceCulling_
 Back face culling option; default = off. More...
 
bool frontFaceCulling_
 Front face culling option; default = on. More...
 
autoPtr< Function1< vector > > surfaceColour_
 Surface colour. More...
 
autoPtr< Function1< vector > > edgeColour_
 Edge colour. More...
 
vtkSmartPointer< vtkActor > surfaceActor_
 Surface actor. More...
 
vtkSmartPointer< vtkActor > edgeActor_
 Edge actor. More...
 
scalar maxGlyphLength_
 Max glyph length for representation type rtGlyph. More...
 
- Protected Attributes inherited from geometryBase
const runTimePostProcessingparent_
 Reference to the parent function object. More...
 
word name_
 The surface name. More...
 
bool visible_
 Visible flag. More...
 
bool parallel_
 Allow parallel rendering. More...
 
renderModeType renderMode_
 Render mode. More...
 
autoPtr< Function1< scalar > > opacity_
 Opacity. More...
 
const HashPtrTable< Function1< vector > > & colours_
 Reference to the colours. More...
 

Detailed Description

Visualisation of surface data with additional routines for handling parallel distributed data.

Dictionary controls

Property Description Required Default
representation none/glyph/wireframe/surface/surfaceWithEdges yes
surfaceColour Override surface colour no
edgeColour Override edge colour no
featureEdges Display surface feature edges no false
maxGlyphLength Limit for glyph representation yes 0
backFaceCulling Cull back face no false
frontFaceCulling Cull front face no true
Source files

Definition at line 180 of file surface.H.

Member Enumeration Documentation

◆ representationType

Surface representation types.

Enumerator
rtNone 

"none"

rtGlyph 

"glyph"

rtWireframe 

"wireframe"

rtSurface 

"surface"

rtSurfaceWithEdges 

"surfaceWithEdges"

Definition at line 189 of file surface.H.

Constructor & Destructor Documentation

◆ surface() [1/2]

surface ( const surface )
protecteddelete

No copy construct.

◆ surface() [2/2]

surface ( const runTimePostProcessing parent,
const dictionary dict,
const HashPtrTable< Function1< vector >> &  colours 
)

Construct from dictionary.

Definition at line 202 of file surface.C.

References dict, and Foam::New().

Here is the call graph for this function:

◆ ~surface()

~surface ( )
virtual

Destructor.

Definition at line 282 of file surface.C.

Member Function Documentation

◆ setRepresentation()

void setRepresentation ( vtkActor *  actor) const
protected

Set the representation.

Definition at line 96 of file surface.C.

◆ addFeatureEdges() [1/3]

void addFeatureEdges ( vtkRenderer *  renderer,
vtkFeatureEdges *  featureEdges 
) const
protected

Add feature edges to scene.

featureEdges->SetFeatureAngle(60);

Definition at line 136 of file surface.C.

References Foam::New().

Here is the call graph for this function:

◆ addFeatureEdges() [2/3]

void addFeatureEdges ( vtkRenderer *  renderer,
vtkPolyData *  data 
) const
protected

Add feature edges to scene.

Definition at line 168 of file surface.C.

References Foam::New().

Here is the call graph for this function:

◆ addFeatureEdges() [3/3]

void addFeatureEdges ( vtkRenderer *  renderer,
vtkCompositeDataGeometryFilter *  input 
) const
protected

Add feature edges to scene.

Definition at line 184 of file surface.C.

References Foam::New().

Here is the call graph for this function:

◆ gatherSurfacePieces()

vtkSmartPointer< vtkMultiPieceDataSet > gatherSurfacePieces ( const polySurface surf) const
protected

Gather and convert polySurface to multi-piece dataset with vtkPolyData for the leaves.

If VTK is also running in parallel, each surface is left as a processor-local piece. Otherwise all processor-local surfaces are gathered onto the master in their correponding slots.

Definition at line 44 of file surfaceGather.C.

References List< T >::clear(), polySurface::faces(), Patch::mesh(), Foam::New(), points, and polySurface::points().

Here is the call graph for this function:

◆ gatherFaceCentres()

vtkSmartPointer< vtkMultiPieceDataSet > gatherFaceCentres ( const polySurface surf) const
protected

Gather and convert polySurface to multi-piece dataset with vtkPolyData for the leaves.

If VTK is also running in parallel, each surface is left as a processor-local piece. Otherwise all processor-local surfaces are gathered onto the master in their correponding slots.

Definition at line 135 of file surfaceGather.C.

References Patch::faceCentres(), PrimitivePatch< Face, FaceList, PointField, PointType >::faceCentres(), Foam::vtk::Tools::identityVertices(), Foam::New(), polySurface::nFaces(), points, and Foam::vtk::Tools::Vertices().

Here is the call graph for this function:

◆ addField()

bool addField ( vtkDataSet *  piece,
const Field< Type > &  fld,
const word fieldName 
) const
protected

Add field of Type to piece as VTK field data in GeoMeshType slot.

GeoMeshType distinguishes between vtkCellData and vtkPointData

Parameters
pieceThe VTK piece (null protected)
fldThe field values to add
fieldNameThe field name to use

Definition at line 36 of file surfaceTemplates.C.

References fld.

◆ addDimField() [1/6]

bool addDimField ( vtkDataSet *  piece,
const regIOobject ioptr,
const word fieldName 
) const
protected

Attempt cast of regIOobject to DimensionedField<Type> and add to piece as VTK field data in GeoMeshType slot.

GeoMeshType distinguishes between vtkCellData and vtkPointData

Parameters
pieceThe VTK piece (null protected)
ioptrThe field values to add
fieldNameThe field name to use

Definition at line 62 of file surfaceTemplates.C.

◆ addDimField() [2/6]

bool addDimField ( vtkDataSet *  piece,
const regIOobject ioptr,
const word fieldName 
) const
protected

Attempt cast of regIOobject to standard DimensionedField types and add to piece when possible

Parameters
pieceThe VTK piece (null protected)
ioptrThe field values to add
fieldNameThe field name to use

Definition at line 87 of file surfaceTemplates.C.

◆ addDimField() [3/6]

bool addDimField ( vtkMultiPieceDataSet *  multiPiece,
const DimensionedField< Type, GeoMeshType > *  fldptr,
const word fieldName 
) const
protected

Add DimensionedField of Type to multi-piece as VTK field data in GeoMeshType slot (CELL | POINT).

Definition at line 121 of file surfaceTemplates.C.

References DimensionedField< Type, GeoMesh >::field(), and Foam::returnReduce().

Here is the call graph for this function:

◆ addDimField() [4/6]

bool addDimField ( vtkMultiPieceDataSet *  multiPiece,
const regIOobject ioptr,
const word fieldName 
) const
protected

Attempt cast of regIOobject to DimensionedField<Type> and add in multi-piece as VTK field data in GeoMeshType slot (CELL | POINT).

Parameters
multiPieceThe VTK pieces
ioptrThe field values to add
fieldNameThe field name to use

Definition at line 223 of file surfaceTemplates.C.

◆ addDimField() [5/6]

bool addDimField ( vtkMultiPieceDataSet *  multiPiece,
const regIOobject ioptr,
const word fieldName 
) const
protected

Attempt cast of regIOobject to standard DimensionedField types and add when possible in GeoMeshType slot (CELL | POINT).

Parameters
multiPieceThe VTK pieces
ioptrThe field values to add
fieldNameThe field name to use

Definition at line 240 of file surfaceTemplates.C.

◆ addDimField() [6/6]

bool addDimField ( vtkMultiPieceDataSet *  multiPiece,
const polySurface surf,
const word fieldName 
) const
protected

Add using regIOobject information obtained from surface.

Definition at line 274 of file surfaceTemplates.C.

References polySurface::findFieldObject().

Here is the call graph for this function:

◆ operator=()

void operator= ( const surface )
protecteddelete

No copy assignment.

◆ TypeNameNoDebug()

TypeNameNoDebug ( "surface"  )

Run-time type information.

◆ declareRunTimeSelectionTable()

declareRunTimeSelectionTable ( autoPtr  ,
surface  ,
dictionary  ,
(const runTimePostProcessing &parent, const dictionary &dict, const HashPtrTable< Function1< vector >> &colours ,
(parent, dict, colours  
)

◆ New()

Foam::autoPtr< Foam::functionObjects::runTimePostPro::surface > New ( const runTimePostProcessing parent,
const dictionary dict,
const HashPtrTable< Function1< vector >> &  colours,
const word surfaceName 
)
static

Return selected surface.

Definition at line 254 of file surface.C.

References DebugInfo, dict, Foam::endl(), Foam::exit(), Foam::FatalIOError, and FatalIOErrorInLookup.

Here is the call graph for this function:

◆ updateActors()

void updateActors ( const scalar  position)
virtual

Update the actors.

Implements geometryBase.

Reimplemented in geometryPatches, and geometrySurface.

Definition at line 289 of file surface.C.

Member Data Documentation

◆ representationTypeNames

Names for surface representation types.

Definition at line 199 of file surface.H.

◆ representation_

representationType representation_
protected

Representation type.

Definition at line 207 of file surface.H.

◆ featureEdges_

bool featureEdges_
protected

Activate feature edges.

Definition at line 210 of file surface.H.

◆ backFaceCulling_

bool backFaceCulling_
protected

Back face culling option; default = off.

Definition at line 213 of file surface.H.

◆ frontFaceCulling_

bool frontFaceCulling_
protected

Front face culling option; default = on.

Definition at line 216 of file surface.H.

◆ surfaceColour_

autoPtr<Function1<vector> > surfaceColour_
protected

Surface colour.

Definition at line 219 of file surface.H.

◆ edgeColour_

autoPtr<Function1<vector> > edgeColour_
protected

Edge colour.

Definition at line 222 of file surface.H.

◆ surfaceActor_

vtkSmartPointer<vtkActor> surfaceActor_
protected

Surface actor.

Definition at line 225 of file surface.H.

◆ edgeActor_

vtkSmartPointer<vtkActor> edgeActor_
protected

Edge actor.

Definition at line 228 of file surface.H.

◆ maxGlyphLength_

scalar maxGlyphLength_
protected

Max glyph length for representation type rtGlyph.

Definition at line 231 of file surface.H.


The documentation for this class was generated from the following files: