TexGen
SectionMesh.h
Go to the documentation of this file.
1/*=============================================================================
2TexGen: Geometric textile modeller.
3Copyright (C) 2006 Martin Sherburn
4
5This program is free software; you can redistribute it and/or
6modify it under the terms of the GNU General Public License
7as published by the Free Software Foundation; either version 2
8of the License, or (at your option) any later version.
9
10This program is distributed in the hope that it will be useful,
11but WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with this program; if not, write to the Free Software
17Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18=============================================================================*/
19
20#pragma once
21#include "Mesh.h"
22
23namespace TexGen
24{
25 using namespace std;
26
28
33 {
34 public:
35 CSectionMesh(void);
36 CSectionMesh(TiXmlElement &Element);
37 virtual ~CSectionMesh(void);
38
40
44 virtual CSectionMesh* Copy() const = 0;
45
47 virtual string GetType() const = 0;
48
50 virtual void PopulateTiXmlElement(TiXmlElement &Element, OUTPUT_TYPE OutputType) const;
51
53 static CObjectContainer<CSectionMesh> CreateSectionMesh(TiXmlElement &Element);
54
56 const CMesh &GetMesh(const vector<XY> &Section) const;
57 virtual void SetNumLayers( int iNumLayers ){;}
58 virtual int GetNumLayers() {return -1;}
59
60 protected:
62 virtual bool CreateMesh(const vector<XY> &Section) const = 0;
63
65 bool CreateMeshIfNeeded(const vector<XY> &Section) const;
66
68 mutable CMesh m_Mesh;
69
71
75 mutable vector<XY> m_Section;
76 };
77
78}; // namespace TexGen
#define CLASS_DECLSPEC
Definition: Misc.h:35
Defines the nodes and elements of a surface or volume mesh.
Definition: Mesh.h:58
Object container to help handle memory management issues.
Abstract base class to create a 2D mesh of a section.
Definition: SectionMesh.h:33
virtual string GetType() const =0
Derived class should return the class name.
CMesh m_Mesh
Used to cache the result of the previous mesh for efficiency.
Definition: SectionMesh.h:68
virtual CSectionMesh * Copy() const =0
This is a function to allow copying of derived classes correctly.
virtual int GetNumLayers()
Definition: SectionMesh.h:58
virtual void SetNumLayers(int iNumLayers)
Definition: SectionMesh.h:57
virtual bool CreateMesh(const vector< XY > &Section) const =0
Create a mesh out of given list of points representing the edge of the section.
vector< XY > m_Section
Store the section used to request a mesh the last time.
Definition: SectionMesh.h:75
Namespace containing a series of customised math operations not found in the standard c++ library.
OUTPUT_TYPE
Definition: Misc.h:105