TexGen
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
TexGen::CSectionMesh Class Referenceabstract

Abstract base class to create a 2D mesh of a section. More...

#include <SectionMesh.h>

Inheritance diagram for TexGen::CSectionMesh:
Inheritance graph
[legend]

Public Member Functions

 CSectionMesh (void)
 
 CSectionMesh (TiXmlElement &Element)
 
virtual ~CSectionMesh (void)
 
virtual CSectionMeshCopy () const =0
 This is a function to allow copying of derived classes correctly. More...
 
virtual string GetType () const =0
 Derived class should return the class name. More...
 
virtual void PopulateTiXmlElement (TiXmlElement &Element, OUTPUT_TYPE OutputType) const
 Used for saving data to XML. More...
 
const CMeshGetMesh (const vector< XY > &Section) const
 Accessor methods. More...
 
virtual void SetNumLayers (int iNumLayers)
 
virtual int GetNumLayers ()
 

Static Public Member Functions

static CObjectContainer< CSectionMeshCreateSectionMesh (TiXmlElement &Element)
 Create a section from TiXmlElement. More...
 

Protected Member Functions

virtual bool CreateMesh (const vector< XY > &Section) const =0
 Create a mesh out of given list of points representing the edge of the section. More...
 
bool CreateMeshIfNeeded (const vector< XY > &Section) const
 Create the mesh if it has not already been created. More...
 

Protected Attributes

CMesh m_Mesh
 Used to cache the result of the previous mesh for efficiency. More...
 
vector< XYm_Section
 Store the section used to request a mesh the last time. More...
 

Detailed Description

Abstract base class to create a 2D mesh of a section.

The resulting mesh is stored in a CMesh where the z coordinate is always 0. The derived section mesh should be assigned to a section for meshing.

Definition at line 32 of file SectionMesh.h.

Constructor & Destructor Documentation

◆ CSectionMesh() [1/2]

CSectionMesh::CSectionMesh ( void  )

Definition at line 27 of file SectionMesh.cpp.

◆ CSectionMesh() [2/2]

CSectionMesh::CSectionMesh ( TiXmlElement &  Element)

Definition at line 35 of file SectionMesh.cpp.

◆ ~CSectionMesh()

CSectionMesh::~CSectionMesh ( void  )
virtual

Definition at line 31 of file SectionMesh.cpp.

Member Function Documentation

◆ Copy()

virtual CSectionMesh * TexGen::CSectionMesh::Copy ( ) const
pure virtual

This is a function to allow copying of derived classes correctly.

Derived classes should implement this as CSectionMesh* Copy() const { return new CSectionMeshDerived(*this); } where CSectionMeshDerived should be replaced by the name of the derived class

Implemented in TexGen::CSectionMeshRectangleSection, TexGen::CSectionMeshRectangular, and TexGen::CSectionMeshTriangulate.

◆ CreateMesh()

virtual bool TexGen::CSectionMesh::CreateMesh ( const vector< XY > &  Section) const
protectedpure virtual

Create a mesh out of given list of points representing the edge of the section.

Implemented in TexGen::CSectionMeshRectangleSection, TexGen::CSectionMeshRectangular, and TexGen::CSectionMeshTriangulate.

Referenced by CreateMeshIfNeeded().

◆ CreateMeshIfNeeded()

bool CSectionMesh::CreateMeshIfNeeded ( const vector< XY > &  Section) const
protected

Create the mesh if it has not already been created.

Definition at line 67 of file SectionMesh.cpp.

References CreateMesh(), and m_Section.

Referenced by GetMesh().

◆ CreateSectionMesh()

CObjectContainer< CSectionMesh > CSectionMesh::CreateSectionMesh ( TiXmlElement &  Element)
static

Create a section from TiXmlElement.

Definition at line 52 of file SectionMesh.cpp.

Referenced by TexGen::CSection::CSection(), TexGen::CTextile3DWeave::CTextile3DWeave(), and TexGen::CTextileWeave::CTextileWeave().

◆ GetMesh()

const CMesh & CSectionMesh::GetMesh ( const vector< XY > &  Section) const

Accessor methods.

Definition at line 77 of file SectionMesh.cpp.

References CreateMeshIfNeeded(), and m_Mesh.

◆ GetNumLayers()

virtual int TexGen::CSectionMesh::GetNumLayers ( )
inlinevirtual

Definition at line 58 of file SectionMesh.h.

◆ GetType()

virtual string TexGen::CSectionMesh::GetType ( ) const
pure virtual

Derived class should return the class name.

Implemented in TexGen::CSectionMeshRectangleSection, TexGen::CSectionMeshRectangular, and TexGen::CSectionMeshTriangulate.

Referenced by PopulateTiXmlElement().

◆ PopulateTiXmlElement()

void CSectionMesh::PopulateTiXmlElement ( TiXmlElement &  Element,
OUTPUT_TYPE  OutputType 
) const
virtual

◆ SetNumLayers()

virtual void TexGen::CSectionMesh::SetNumLayers ( int  iNumLayers)
inlinevirtual

Reimplemented in TexGen::CSectionMeshRectangleSection, and TexGen::CSectionMeshRectangular.

Definition at line 57 of file SectionMesh.h.

Member Data Documentation

◆ m_Mesh

CMesh TexGen::CSectionMesh::m_Mesh
mutableprotected

◆ m_Section

vector<XY> TexGen::CSectionMesh::m_Section
mutableprotected

Store the section used to request a mesh the last time.

If the given section is the same as given last time then no need to remesh, simply re-used the result of last time.

Definition at line 75 of file SectionMesh.h.

Referenced by CreateMeshIfNeeded().


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