TexGen
Simulation.cpp
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#include "PrecompiledHeaders.h"
21#include "Simulation.h"
22
23using namespace TexGen;
24
25CSimulation::CSimulation(void)
26{
27}
28
30{
31}
32
34{
35 if (!m_DeformationSteps.empty())
36 return m_DeformationSteps.back();
37 static CLinearTransformation Identity;
38 return Identity;
39}
40
42{
44 AddDeformationStep(Deformation);
45}
46
48{
49 m_DeformationSteps.clear();
50}
51
53{
54 m_DeformationSteps.push_back(Deformation);
55}
56
57
58
59
Represents a linear transformation as a 3x3 matrix.
const CLinearTransformation & GetDeformation() const
Return the final deformation in the series or identity if none exist.
Definition: Simulation.cpp:33
void ClearDeformationSteps()
Clear all deformation steps.
Definition: Simulation.cpp:47
void SetDeformation(const CLinearTransformation &Deformation)
Set the deformation, this will clear all existing deformations.
Definition: Simulation.cpp:41
void AddDeformationStep(const CLinearTransformation &Deformation)
Add a deformation step.
Definition: Simulation.cpp:52
vector< CLinearTransformation > m_DeformationSteps
Definition: Simulation.h:62
virtual ~CSimulation(void)
Definition: Simulation.cpp:29
Namespace containing a series of customised math operations not found in the standard c++ library.