TexGen
YarnSectionInterpPosition.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 "YarnSectionInterp.h"
22
23namespace TexGen
24{
25 using namespace std;
26
28
32 {
33 public:
43 CYarnSectionInterpPosition(bool bRamped = true, bool bPolar = false, bool bConstMesh = true);
44 CYarnSectionInterpPosition(TiXmlElement &Element);
46
47 vector<XY> GetSection(const YARN_POSITION_INFORMATION PositionInfo, int iNumPoints, bool bEquiSpaced = false) const;
48 CMesh GetSectionMesh(const YARN_POSITION_INFORMATION PositionInfo, int iNumPoints, bool bEquiSpaced) const;
49 CYarnSection* Copy() const { return new CYarnSectionInterpPosition(*this); }
50 string GetType() const { return "CYarnSectionInterpPosition"; }
51 void PopulateTiXmlElement(TiXmlElement &Element, OUTPUT_TYPE OutputType) const;
52
54
61 void AddSection(double dPosition, const CSection &Section);
62
64 void SetSectionMeshLayersEqual( int iNumPoints ) const;
65
66 // Accessor methods
67 int GetNumNodeSections() const { return (int)m_Sections.size(); }
68 const CSection &GetSection(int iIndex) const;
69 double GetSectionPosition(int iIndex) const;
70
71 protected:
72 vector<pair<double, CObjectContainer<CSection> > > m_Sections;
73 };
74
75}; // namespace TexGen
#define CLASS_DECLSPEC
Definition: Misc.h:35
Defines the nodes and elements of a surface or volume mesh.
Definition: Mesh.h:58
Abstract base class respresenting a yarn cross-section.
Definition: Section.h:31
Abstract base class used to define the sections along the length of a yarn.
Definition: YarnSection.h:58
Abstract base class to handle interpolation for derived classes.
Interpolate sections between arbritrary positions along the length of the yarn.
vector< pair< double, CObjectContainer< CSection > > > m_Sections
CYarnSection * Copy() const
This is a function to allow copying of derived classes correctly.
string GetType() const
Derived class should return the class name.
Namespace containing a series of customised math operations not found in the standard c++ library.
OUTPUT_TYPE
Definition: Misc.h:105
Structure used to represent the position along the length of a yarn.
Definition: YarnSection.h:36