TexGen
YarnSectionInterp.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 "YarnSection.h"
22
23namespace TexGen
24{
25 using namespace std;
26
27 class CSection;
28
31 {
32 public:
40 CYarnSectionInterp(bool bRamped, bool bPolar, bool bConstMesh = true);
41 CYarnSectionInterp(TiXmlElement &Element);
42 virtual ~CYarnSectionInterp(void);
43
44 virtual void PopulateTiXmlElement(TiXmlElement &Element, OUTPUT_TYPE OutputType) const;
45
46 // Accessor methods
47 bool GetRamped() { return m_bRamped; }
48 bool GetPolar() { return m_bPolar; }
49
50
51
52 protected:
53 bool GetInterpedSection(const CSection &Section1, const CSection &Section2, double u, int iNumPoints, bool bEquiSpaced, vector<XY> &Points) const;
54 bool GetInterpedSectionMesh(const CSection &Section1, const CSection &Section2, double u, int iNumPoints, bool bEquiSpaced, CMesh &Mesh) const;
55 XY InterpolatePoints(XY P1, XY P2, double u) const;
56 int CalculateNumberofLayers(const vector<XY> &Section) const;
57
58 bool m_bRamped, m_bPolar;//, m_bConstMesh;
59 };
60
61}; // 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.
Namespace containing a series of customised math operations not found in the standard c++ library.
OUTPUT_TYPE
Definition: Misc.h:105
Struct for representing points in 2D space.
Definition: mymath.h:103