24CInterpolationAdjusted::CInterpolationAdjusted(
const CInterpolation &Interpolation)
26, m_pInterpolation(Interpolation)
39 vector<pair<double, XYZ> > Adjustments;
42 pair<double, XYZ> Adjustment(0.0,
XYZ());
43 pAdjustmentSection->Attribute(
"T", &Adjustment.first);
44 Adjustment.second = valueify<XYZ>(pAdjustmentSection->Attribute(
"Vector"));
45 Adjustments.push_back(Adjustment);
49 TiXmlElement* pInterpolation = Element.FirstChildElement(
"Interpolation");
60 TiXmlElement Adjustment(
"Adjustment");
61 Adjustment.SetAttribute(
"index", i);
64 TiXmlElement AdjustmentSection(
"AdjustmentSection");
67 Adjustment.InsertEndChild(AdjustmentSection);
69 Element.InsertEndChild(Adjustment);
71 TiXmlElement Interpolation(
"Interpolation");
73 Element.InsertEndChild(Interpolation);
82 TGERROR(
"Unable to adjust node position. Index out of range: " << iIndex);
101 TGERROR(
"Unable to add adjustment. Index out of range: " << iIndex);
#define TGERROR(MESSAGE)
Macros used to report the file name and line number to the TexGenError and TexGenLog functions.
#define FOR_EACH_TIXMLELEMENT(CHILDELEMENT, PARENTELEMENT, ELEMENTNAME)
Macro to enable looping over tinyxml easier.
CSlaveNode GetNode(const vector< CNode > &MasterNodes, int iIndex, double t) const
Get a node from parametric function where t is specified.
void PopulateTiXmlElement(TiXmlElement &Element, OUTPUT_TYPE OutputType) const
Used for saving data to XML.
vector< vector< pair< double, XYZ > > > m_Adjustments
Represents the adjustements to the interpolation.
CObjectContainer< CInterpolation > m_pInterpolation
CInterpolationAdjusted(const CInterpolation &Interpolation)
void AddAdjustment(int iIndex, double t, XYZ Vector)
At given index and value t the position of the node should be adjusted by given vector.
void Initialise(const vector< CNode > &MasterNodes) const
Calculate the node tangents (use node tangents of they exist) and store them in m_Tangents.
~CInterpolationAdjusted(void)
Abstract base class for describing the yarn path interpolations.
virtual void PopulateTiXmlElement(TiXmlElement &Element, OUTPUT_TYPE OutputType) const
Used for saving data to XML.
static CObjectContainer< CInterpolation > CreateInterpolation(TiXmlElement &Element)
Create an interpolation from TiXmlElement.
void SetPosition(XYZ Position)
A derivation of the CNode class which contains data specific to slave nodes such as sections.
Namespace containing a series of customised math operations not found in the standard c++ library.
T GetInterpedValue(const std::vector< std::pair< double, T > > &InterpValues, double fraction)
Get an interpolated value.
std::string stringify(const T &x, int iPrecision=12, bool bScientific=true)
Function to convert a value (e.g. int, double, etc...) to a string.
Struct for representing points in 3D space.