TexGen
YarnSectionInterpNode.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
33 {
34 public:
44 CYarnSectionInterpNode(bool bRamped = true, bool bPolar = false, bool bConstMesh = true);
45 CYarnSectionInterpNode(TiXmlElement &Element);
47
48 vector<XY> GetSection(const YARN_POSITION_INFORMATION PositionInfo, int iNumPoints, bool bEquiSpaced = false) const;
49 CMesh GetSectionMesh(const YARN_POSITION_INFORMATION PositionInfo, int iNumPoints, bool bEquiSpaced) const;
50 CYarnSection* Copy() const { return new CYarnSectionInterpNode(*this); }
51 string GetType() const { return "CYarnSectionInterpNode"; }
52 void PopulateTiXmlElement(TiXmlElement &Element, OUTPUT_TYPE OutputType) const;
53
55
59 void AddSection(const CSection &Section);
60
62
66 void InsertSection(int iIndex, const CSection &Section);
67
69
73 void ReplaceSection(int iIndex, const CSection &Section);
74
76 void ReplaceMidSection(int iNodeIndex, int iIndex, const CSection &Section);
77
79 void DeleteSection(int iIndex);
80
82
88 void InsertSection(int iIndex, double u, const CSection &Section);
89
91 void SetSectionMeshLayersEqual( int iNumPoints ) const;
92
93 // Accessor methods
94 int GetNumNodeSections() const { return (int)m_Sections.size(); }
95 const CSection &GetNodeSection(int iIndex) const;
96 int GetNumMidNodeSections(int iIndex) const;
97 double GetMidNodeSectionPos( int iNodeIndex, int iIndex ) const;
98
99 protected:
100 void GetSectionsToInterp(const YARN_POSITION_INFORMATION PositionInfo, const CSection* &pSection1, const CSection* &pSection2, double &u) const;
101
102 vector<CObjectContainer<CSection> > m_Sections;
103 vector<vector<pair<double, CObjectContainer<CSection> > > > m_MidNodeSections;
104
105 };
106
107
108}; // 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.
Creates a section which is linearly interpolated between sections defined at the nodes.
CYarnSection * Copy() const
This is a function to allow copying of derived classes correctly.
vector< vector< pair< double, CObjectContainer< CSection > > > > m_MidNodeSections
vector< CObjectContainer< CSection > > m_Sections
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