TexGen
TextileWeave2D.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 "TextileWeave.h"
22
23namespace TexGen
24{
25 using namespace std;
26
27 class CPatternDraft;
28
31 {
32 public:
34 CTextileWeave2D(int iWidth, int iHeight, double dSpacing, double dThickness, bool bRefine = true, bool bInPlaneTangents = true);
35 CTextileWeave2D(TiXmlElement &Element);
36 ~CTextileWeave2D(void);
37
38 CTextile* Copy() const { return new CTextileWeave2D(*this); }
39 string GetType() const { return "CTextileWeave2D"; }
40 void PopulateTiXmlElement(TiXmlElement &Element, OUTPUT_TYPE OutputType);
41
42 string GetDefaultName() const;
43
45 void SwapPosition(int x, int y);
47 void SwapAll();
48
49 // Accessor methods
50 bool GetRefine() const { return m_bRefine; }
51 bool GetInPlaneTangents() const { return m_bInPlaneTangents; }
52
54
59 void RefineTextile( bool bCorrectWidths = true, bool bCorrectInterference = true, bool bPeriodic = true );
60
61
62 virtual CDomainPlanes GetDefaultDomain( bool bSheared = false, bool bAddedDomainHeight = true );
63
64 void ConvertToPatternDraft( /*CPatternDraft& PatternDraft*/ );
65
67
70 void SetInPlaneTangents( bool bInPlaneTangents = true ) const;
71
72 protected:
73 bool BuildTextile() const;
74 virtual void Refine( bool bCorrectWidths = true, bool bCorrectInterference = true, bool bPeriodic = true ) const;
75 void AdjustTangents() const;
76 virtual bool AdjustSectionsForRotation( bool bPeriodic = true ) const;
77
78 void SetInPlaneTangents( int Yarn, bool bInPlaneTangents = true ) const;
79
82 };
83}; // namespace TexGen
84
#define CLASS_DECLSPEC
Definition: Misc.h:35
Domain implementation described using planes, the simplest of which would be a box.
Definition: DomainPlanes.h:37
Represents a textile cell containing yarns.
Definition: Textile.h:39
Respresents a 2d woven textile.
bool GetInPlaneTangents() const
string GetType() const
Derived class should return the class name.
CTextile * Copy() const
Represents a woven textile.
Definition: TextileWeave.h:41
Namespace containing a series of customised math operations not found in the standard c++ library.
OUTPUT_TYPE
Definition: Misc.h:105