TexGen
Node.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
21class TiXmlElement;
22namespace TexGen
23{
24 using namespace std;
25
28 {
29 public:
31
36 CNode(XYZ Position = XYZ(), XYZ Tangent = XYZ(), XYZ Up = XYZ(0, 0, 1), double Angle = 0.0);
37 CNode(TiXmlElement &Element);
38 virtual ~CNode(void);
39
41 virtual void PopulateTiXmlElement(TiXmlElement &Element, OUTPUT_TYPE OutputType) const;
42
44 virtual void Rotate(WXYZ Rotation, XYZ Origin = XYZ(0,0,0));
45
47 virtual void Translate(XYZ Vector);
48
50 void ProjectUp();
51
53 //XYZ GetSide() const { return CrossProduct(m_Tangent, m_Up); }
54 XYZ GetSide() const;
55 //XYZ RotateSide( XYZ Side );
56 // Various accessor methods
57 XYZ GetPosition() const { return m_Position; }
58 XYZ GetTangent() const { return m_Tangent; }
59 XYZ GetUp() const { return m_Up; }
60 double GetAngle() const { return m_Angle; }
61 XYZ GetNormal() const;
62 void SetPosition(XYZ Position) { m_Position = Position; }
63 void SetTangent(XYZ Tangent) { m_Tangent = Tangent; }
64 void SetUp(XYZ Up) { m_Up = Up; }
65 void SetAngle( double Angle ) { m_Angle = Angle; }
66
67 protected:
74 double m_Angle;
75 };
76}; // namespace TexGen
77
78
79
#define CLASS_DECLSPEC
Definition: Misc.h:35
Represents a point on the centreline of a yarn.
Definition: Node.h:28
XYZ m_Up
Unit vector which represents the up direction (must be perpendicular to m_Tangent)
Definition: Node.h:73
XYZ m_Tangent
Unit vector tangent to the yarn path at this node.
Definition: Node.h:71
double m_Angle
Definition: Node.h:74
XYZ GetUp() const
Definition: Node.h:59
XYZ GetPosition() const
Definition: Node.h:57
void SetAngle(double Angle)
Definition: Node.h:65
void SetPosition(XYZ Position)
Definition: Node.h:62
XYZ GetTangent() const
Definition: Node.h:58
void SetUp(XYZ Up)
Definition: Node.h:64
double GetAngle() const
Definition: Node.h:60
XYZ m_Position
Coordinates representing the position of the node.
Definition: Node.h:69
void SetTangent(XYZ Tangent)
Definition: Node.h:63
Namespace containing a series of customised math operations not found in the standard c++ library.
OUTPUT_TYPE
Definition: Misc.h:105
Struct for representing a quaternion.
Definition: mymath.h:38
Struct for representing points in 3D space.
Definition: mymath.h:56