40 if (el.
GetName() !=
"Point2DDouble")
43 _(
"Wrong XML element."));
63 el.SetAttribute(
"y",
Y);
77 double cos_theta = theta.
Cos();
78 double sin_theta = theta.
Sin();
80 return Point2DDouble(
X * cos_theta -
Y * sin_theta,
X * sin_theta +
Y * cos_theta);
85 Cloner::Register<Point2DDouble>();
xml::Element Serialize(xml::Element &parent) const
Dumps the object to an XML element. Unsafe.
Point2DDouble MakeRotation(Angle< Radian > theta) const
Rotation for single point.
StringUTF8 GetName() const
Gets the label of the element.
#define CRN_END_CLASS_CONSTRUCTOR(classname)
Defines a class constructor.
A convenience class for angles units.
#define CRN_DATA_FACTORY_REGISTER(elemname, classname)
Registers a class to the data factory.
double Sin() const noexcept
Computes sine.
void SetAttribute(const StringUTF8 &name, const StringUTF8 &value)
Sets the value of an attribute.
double Cos() const noexcept
Computes cosine.
T GetAttribute(const StringUTF8 &name, bool silent=true) const
Gets an attribute.
A character string class.
Element PushBackElement(const StringUTF8 &name)
Adds an element at the end of the children list.
void Deserialize(xml::Element &el)
Initializes the object from an XML element. Unsafe.
Invalid argument error (e.g.: nullptr pointer)
#define CRN_BEGIN_CLASS_CONSTRUCTOR(classname)
Defines a class constructor.
Point2DDouble() noexcept
Default constructor.