21 #include "wx/geometry.h"
69 a2dAffineMatrix(
double xt,
double yt,
double scalex = 1,
double scaley = 1,
double degrees = 0 );
71 a2dAffineMatrix(
double sx,
double shx,
double shy,
double sy,
double tx,
double ty );
84 double GetValue(
int col,
int row )
const;
91 void SetValue(
int col,
int row,
double value );
126 double& operator()(
int col,
int row );
132 double operator()(
int col,
int row )
const;
138 bool Identity(
void );
147 inline bool IsIdentity(
void )
const {
return m_isIdentity; }
150 inline bool IsIdentity1(
void )
const ;
155 inline bool IsTranslate(
void )
const;
157 inline bool IsTranslateScaleIso(
void )
const;
167 bool Scale(
double scale );
187 a2dAffineMatrix& Scale(
const double& xs,
const double& ys,
const double& xc,
const double& yc );
207 bool Translate(
double x,
double y );
223 bool Rotate(
double angle );
233 bool SkewX(
double degrees );
243 bool SkewY(
double degrees );
253 a2dAffineMatrix& Rotate(
const double& r,
const double& x,
const double& y );
256 void TransformPoint(
double x,
double y,
double& tx,
double& ty )
const;
259 void TransformPoint(
double& tx,
double& ty )
const;
262 void TransformPoint(
a2dPoint2D* point )
const;
275 void TransformVector(
double dx,
double dy,
double& tdx,
double& tdy )
const;
287 double TransformDistance(
double distance )
const;
290 void TransformDistance(
double& dx,
double& dy )
const;
293 double Get_scaleX()
const;
296 double Get_scaleY()
const;
303 double GetRotation()
const;
310 void SetRotation(
double rotation );
316 double GetDeterminant()
const;
318 double GetDeterminant1()
const;
320 double GetDeterminant2()
const;
322 double GetMaximum()
const;
324 double GetMaximum1()
const;
326 double GetMaximum2()
const;
329 void DebugDump(
const wxChar* text,
double w,
double h )
const;
335 double m_matrix[3][2];
369 inline bool a2dAffineMatrix::IsTranslateScaleIso(
void )
const
400 #if defined(WXART2D_USINGDLL)
416 a2dMatrixProperty(
const a2dPropertyIdMatrix*
id,
const a2dAffineMatrix& value = a2dIDENTITY_MATRIX );
418 a2dMatrixProperty(
const a2dMatrixProperty* ori );
420 a2dMatrixProperty(
const a2dMatrixProperty& other );
422 virtual ~a2dMatrixProperty();
435 virtual wxString StringRepresentation()
const;
437 virtual wxString StringValueRepresentation()
const;
441 static a2dMatrixProperty* CreatePropertyFromString(
const a2dPropertyIdMatrix*
id,
const wxString& value );
443 #if wxART2D_USE_CVGIO
446 #endif //wxART2D_USE_CVGIO
448 DECLARE_DYNAMIC_CLASS( a2dMatrixProperty )
460 #if defined(WXART2D_USINGDLL)
479 a2dPoint2DProperty();
482 a2dPoint2DProperty(
const a2dPropertyIdPoint2D*
id,
const a2dPoint2D& value,
int index = 0,
bool afterinversion =
false );
485 a2dPoint2DProperty(
const a2dPoint2DProperty* ori );
488 a2dPoint2DProperty(
const a2dPoint2DProperty& other );
491 virtual ~a2dPoint2DProperty();
500 static a2dPoint2DProperty* CreatePropertyFromString(
const a2dPropertyIdPoint2D*
id,
const wxString& value );
503 void SetValue(
double x,
double y,
int index = 0,
bool afterinversion =
false );
506 void SetValue(
const a2dPoint2D& P,
int index = 0,
bool afterinversion =
false );
510 const a2dPoint2D& GetValue()
const {
return m_value; }
522 virtual wxString StringRepresentation()
const;
525 virtual wxString StringValueRepresentation()
const;
527 #if wxART2D_USE_CVGIO
530 #endif //wxART2D_USE_CVGIO
532 DECLARE_DYNAMIC_CLASS( a2dPoint2DProperty )
544 bool m_afterinversion;
wxPoint2DDouble a2dPoint2D
this to define if coordinate numbers are integer or doubles
(In) Visible property that can be added to Docview Objects.
double m_matrix[3][2]
array store the six double for the affine matrix
property to hold a a2dAffineMatrix
class to map references to objects stored in XML, in order to make the connection later on...
bool IsIdentity1(void) const
This does an actual check.
a2dPoint2D & GetValue()
get the point
static const a2dAffineMatrix & GetIdentityMatrix()
Return a static identity matrix as reference.
bool IsIdentity(void) const
Is the matrix the identity matrix?
Input and output handler for the XmlSer format.
bool ParseCvgTransForm(a2dAffineMatrix &matrix, const wxString &str, wxString &error)
function to parse a string in SVG/CVG format and return the resulting matrix
a2dAffineMatrix a2dIDENTITY_MATRIX
global a2dAffineMatrix to set/pass the identity matrix.
property to hold a a2dPoint2D plus an index in e.g a polygon.
bool m_isIdentity
true if identity matrix
static const a2dAffineMatrix sm_Identity
A static identity matrix in case an identity matrix is to be returned as reference.
classes for initializing the artbase modules, and set paths to be used for fonts etc.
bool IsTranslate(void) const
Is the matrix only a translation?
Input and output handler for the XmlSer format.
A 2x3 affine matrix class for 2D transformations.
bool GetAfterinversion()
get property setting for m_afterinversion
a2dAffineMatrix operator-(const a2dAffineMatrix &a, const a2dAffineMatrix &b)
matrixes subtract
This template class is for property ids with a known data type.
a2dPoint2D * GetValuePtr()
get the point its address
CloneOptions
options for cloning
a2dPoint2D GetTranslation() const
get the translation vector as a point
wxInt32 GetIndex()
get property setting for m_index