OBJedgeFormat Class Reference

Provide a means of reading/writing Alias/Wavefront OBJ format. More...

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

Public Member Functions

 OBJedgeFormat (const fileName &)
 Construct from file name. More...
 
virtual ~OBJedgeFormat ()=default
 Destructor. More...
 
virtual bool read (const fileName &)
 Read from file. More...
 
virtual void write (const fileName &name) const
 Write object file. More...
 
- Public Member Functions inherited from edgeMesh
 edgeMesh (const faMesh &mesh)
 
label size () const
 
const edgeVectorFieldC ()
 
 TypeName ("edgeMesh")
 Runtime type information. More...
 
 edgeMesh ()
 Default construct. More...
 
 edgeMesh (const edgeMesh &em)
 Copy construct. More...
 
 edgeMesh (edgeMesh &&em)
 Move construct. More...
 
 edgeMesh (const pointField &points, const edgeList &edges)
 Copy construct from components. More...
 
 edgeMesh (pointField &&pointLst, edgeList &&edgeLst)
 Move construct from components. More...
 
 edgeMesh (const fileName &name)
 Construct from file name (uses extension to determine type) More...
 
 edgeMesh (const fileName &name, const word &fileType)
 Construct from file name with specified type. More...
 
 declareRunTimeSelectionTable (autoPtr, edgeMesh, fileExtension,(const fileName &name),(name))
 
virtual ~edgeMesh ()=default
 Destructor. More...
 
 declareMemberFunctionSelectionTable (void, edgeMesh, write, fileExtension,(const fileName &name, const edgeMesh &mesh),(name, mesh))
 
void transfer (edgeMesh &mesh)
 Transfer the contents of the argument and annul the argument. More...
 
bool read (const fileName &name, const word &fileType)
 Read from file. Chooses reader based on explicit extension. More...
 
const pointFieldpoints () const
 Return points. More...
 
const edgeListedges () const
 Return edges. More...
 
const labelListListpointEdges () const
 Return edges. More...
 
label regions (labelList &edgeRegion) const
 Find connected regions. Set region number per edge. More...
 
virtual void clear ()
 Clear all storage. More...
 
virtual void scalePoints (const scalar scaleFactor)
 Scale points. A non-positive factor is ignored. More...
 
virtual void mergePoints (const scalar mergeDist)
 Geometric merge points (points within mergeDist) prior to. More...
 
virtual void mergeEdges ()
 Merge duplicate edges and eliminate unused points. More...
 
virtual void writeStats (Ostream &) const
 
virtual void write (const fileName &name, const word &fileType) const
 Generic write routine. Chooses writer based on extension. More...
 
void operator= (const edgeMesh &rhs)
 Copy assignment. More...
 
void operator= (edgeMesh &&rhs)
 Move assignment. More...
 
- Public Member Functions inherited from GeoMesh< faMesh >
 GeoMesh (const faMesh &mesh)
 Construct from MESH. More...
 
bool hasDb () const
 Return true if thisDb() is a valid DB - here = false. More...
 
const objectRegistrythisDb () const
 Return the object registry. More...
 
const faMeshoperator() () const
 Return reference to polyMesh. More...
 

Static Public Member Functions

static autoPtr< edgeMeshNew (const fileName &name)
 Read file and return surface. More...
 
static void write (const fileName &, const edgeMesh &)
 Write surface mesh components by proxy. More...
 
- Static Public Member Functions inherited from edgeMesh
static label size (const Mesh &mesh)
 
static wordHashSet readTypes ()
 Summary of supported read file types. More...
 
static wordHashSet writeTypes ()
 Summary of supported write file types. More...
 
static bool canReadType (const word &fileType, bool verbose=false)
 Can we read this file format? More...
 
static bool canWriteType (const word &fileType, bool verbose=false)
 Can we write this file format type? More...
 
static bool canRead (const fileName &name, bool verbose=false)
 Can we read this file format? More...
 
static autoPtr< edgeMeshNew (const fileName &name, const word &fileType)
 Read construct from filename with given format. More...
 
static autoPtr< edgeMeshNew (const fileName &name)
 Select constructed from filename (implicit extension) More...
 
static void write (const fileName &name, const edgeMesh &mesh)
 Write to file (format implicit in the extension) More...
 
static void write (const fileName &name, const word &fileType, const edgeMesh &mesh)
 Write to file, with given format. More...
 

Additional Inherited Members

- Public Types inherited from GeoMesh< faMesh >
typedef faMesh Mesh
 
typedef faMesh ::BoundaryMesh BoundaryMesh
 
- Protected Member Functions inherited from edgeMesh
pointFieldstoredPoints ()
 Non-const access to global points. More...
 
edgeListstoredEdges ()
 Non-const access to the edges. More...
 
- Protected Attributes inherited from GeoMesh< faMesh >
const faMeshmesh_
 Reference to Mesh. More...
 

Detailed Description

Provide a means of reading/writing Alias/Wavefront OBJ format.

Does not handle negative vertex indices.

Source files

Definition at line 56 of file OBJedgeFormat.H.

Constructor & Destructor Documentation

◆ OBJedgeFormat()

OBJedgeFormat ( const fileName filename)

Construct from file name.

Definition at line 86 of file OBJedgeFormat.C.

References Foam::blockMeshTools::read().

Here is the call graph for this function:

◆ ~OBJedgeFormat()

virtual ~OBJedgeFormat ( )
virtualdefault

Destructor.

Member Function Documentation

◆ New()

static autoPtr<edgeMesh> New ( const fileName name)
inlinestatic

Read file and return surface.

Definition at line 80 of file OBJedgeFormat.H.

References Foam::name().

Here is the call graph for this function:

◆ write() [1/2]

void write ( const fileName filename,
const edgeMesh mesh 
)
static

Write surface mesh components by proxy.

Definition at line 226 of file OBJedgeFormat.C.

References clock::dateTime(), Foam::constant::electromagnetic::e, Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, IOstream::good(), mesh, OFstream::name(), fileName::nameLessExt(), Foam::nl, and p.

Referenced by OBJedgeFormat::write().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ read()

bool read ( const fileName filename)
virtual

Read from file.

Reimplemented from edgeMesh.

Definition at line 96 of file OBJedgeFormat.C.

References DynamicList< T, SizeMin >::append(), edgeMesh::clear(), Foam::constant::electromagnetic::e, Foam::exit(), Foam::FatalError, FatalErrorInFunction, forAll, IOstream::good(), Foam::readObjVertices(), DynamicList< T, SizeMin >::setSize(), Foam::stringOps::splitSpace(), edgeMesh::storedEdges(), edgeMesh::storedPoints(), List< T >::transfer(), and word::validate().

Here is the call graph for this function:

◆ write() [2/2]

virtual void write ( const fileName name) const
inlinevirtual

Write object file.

Reimplemented from edgeMesh.

Definition at line 99 of file OBJedgeFormat.H.

References Foam::name(), and OBJedgeFormat::write().

Here is the call graph for this function:

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