TexGen
TextileDeformerVolumeMesh.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
22#include "TextileDeformer.h"
23#include "Mesh.h"
24
25namespace TexGen
26{
27 using namespace std;
28
29 class CTextile;
30
32
39 {
40 public:
42 virtual ~CTextileDeformerVolumeMesh(void);
43
44 bool SetYarnMeshDisplacements(int iYarn, const CMesh &Mesh, vector<XYZ> &Displacements);
45
46 protected:
47 struct YARN_MESH
48 {
50 vector<XYZ> NodeDisplacements;
51 };
52
53 virtual double GetDisplacement(XYZ Pos, int iYarn, XYZ &Disp) const;
54 void GetBarycentricCoordinates(const XYZ &P, const XYZ &P1, const XYZ &P2, const XYZ &P3, const XYZ &P4, double &a, double &b, double &c, double &d) const;
55
56 vector<YARN_MESH> m_YarnMeshes;
57 };
58
59
60}; // namespace TexGen
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#define CLASS_DECLSPEC
Definition: Misc.h:35
Defines the nodes and elements of a surface or volume mesh.
Definition: Mesh.h:58
A virtual base class which can be used to deform textiles.
Deform the geometry of a textile given a volume mesh.
Namespace containing a series of customised math operations not found in the standard c++ library.
XYZ GetBarycentricCoordinates(const XY &P1, const XY &P2, const XY &P3, const XY &P)
Get the barycentric coordinates of a point lying on a triangle.
Definition: mymath.h:1421
Struct for representing points in 3D space.
Definition: mymath.h:56