21 #include <wx/wfstream.h>
24 #include "wx/canvas/eval.h"
33 #if wxART2D_USE_EDITOR
35 #endif //wxART2D_USE_EDITOR
47 IMPLEMENT_DYNAMIC_CLASS(
a2dBarCurve, a2dVertexCurve )
53 #define wxMAX_COORDINATE INT_MAX
54 #define wxMIN_COORDINATE INT_MIN
56 #define wxMAX_COORDINATE 100e99
57 #define wxMIN_COORDINATE 100e-99
93 const a2dCommandId a2dCommand_VertexCurveMovePoint::COMID_VertexCurveMovePoint( wxT(
"VertexCurveMovePoint" ) );
100 a2dCommand_VertexCurveMovePoint::a2dCommand_VertexCurveMovePoint( a2dVertexCurve* curve,
double x,
double y,
int index ):
101 a2dCommand( true, COMID_VertexCurveMovePoint )
110 a2dCommand_VertexCurveMovePoint::~a2dCommand_VertexCurveMovePoint(
void )
136 ProcessEvent( changed );
176 const a2dCommandId a2dCommand_SweepCurveMovePoint::COMID_SweepCurveMovePoint( wxT(
"SweepCurveMovePoint" ) );
182 a2dCommand_SweepCurveMovePoint::a2dCommand_SweepCurveMovePoint( a2dSweepCurve* curve,
double x,
double y,
int index ):
192 a2dCommand_SweepCurveMovePoint::~a2dCommand_SweepCurveMovePoint(
void )
218 ProcessEvent( changed );
257 const a2dCommandId a2dCommand_BandCurveMovePoint::COMID_BandCurveMovePoint( wxT(
"BandCurveMovePoint" ) );
262 a2dCommand_BandCurveMovePoint::a2dCommand_BandCurveMovePoint( a2dBandCurve* curve,
double sweep,
double y,
bool up,
int index ):
274 a2dCommand_BandCurveMovePoint::~a2dCommand_BandCurveMovePoint(
void )
301 ProcessEvent( changed );
328 static const a2dCommandId COMID_VertexListCurveMovePoint;
344 const a2dCommandId a2dCommand_VertexListCurveMovePoint::COMID_VertexListCurveMovePoint( wxT(
"VertexListCurveMovePoint" ) );
346 a2dCommand_VertexListCurveMovePoint::a2dCommand_VertexListCurveMovePoint( a2dVertexListCurve* curve,
double x,
double y,
int index ):
347 a2dCommand( true, COMID_VertexListCurveMovePoint )
356 a2dCommand_VertexListCurveMovePoint::~a2dCommand_VertexListCurveMovePoint(
void )
382 ProcessEvent( changed );
459 m_logFunction = wxNO_OP;
460 m_clipdata.SetValid(
false );
461 m_curveBox.SetValid(
false );
464 a2dCurve::~a2dCurve()
468 a2dCurve::a2dCurve(
const a2dCurve& other, CloneOptions options,
a2dRefMap* refs )
472 m_highlightmode = other.m_highlightmode;
473 m_pointsFill = other.m_pointsFill;
474 m_logFunction = other.m_logFunction;
486 #if wxART2D_USE_CVGIO
490 if ( xmlparts == a2dXmlSer_attrib )
508 if ( xmlparts == a2dXmlSer_attrib )
521 #endif //wxART2D_USE_CVGIO
537 if( curvebox.
GetValid() && !curvebox.
And( &areabox ) )
612 a2dFunctionCurve::a2dFunctionCurve(
const wxString& curve ): a2dCurve()
615 #if wxART2D_USE_CANEXTOBJ
616 m_toeval.SetEvalString( m_curve );
617 #endif //wxART2D_USE_CANEXTOBJ
619 m_xstart = wxMIN_COORDINATE;
620 m_xstop = wxMAX_COORDINATE;
621 m_xstep = ( m_xstop - m_xstart ) / 100.0;
624 a2dFunctionCurve::~a2dFunctionCurve()
628 a2dFunctionCurve::a2dFunctionCurve(
const a2dFunctionCurve& other, CloneOptions options,
a2dRefMap* refs )
629 : a2dCurve( other, options, refs )
631 m_curve = other.m_curve;
632 #if wxART2D_USE_CANEXTOBJ
633 m_toeval.SetEvalString( m_curve );
634 #endif //wxART2D_USE_CANEXTOBJ
635 m_xstep = other.m_xstep;
636 m_xstart = other.m_xstart;
637 m_xstop = other.m_xstop;
642 return new a2dFunctionCurve( *
this, options, refs );
647 #if wxART2D_USE_CANEXTOBJ
650 m_toeval.ClearAllVars();
652 m_toeval.SetValue( wxT(
"x" ) , sweepValue );
653 m_toeval.Evaluate( &result, &a );
654 m_toeval.GetValue( wxT(
"y" ) , &point.m_y );
656 point.m_x = sweepValue;
662 #endif //wxART2D_USE_CANEXTOBJ
674 for ( x = start; x <= stop; x = x + m_xstep )
703 box.Expand( xw, yw );
724 double xprev = 0, yprev = 0;
727 wxRasterOperationMode prevlogfunction = wxNO_OP;
729 if( m_logFunction != wxNO_OP )
732 prevlogfunction = aDC->GetLogicalFunction();
733 aDC->SetLogicalFunction( m_logFunction );
735 for ( x = curvebox.
GetMinX(); x < curvebox.
GetMaxX(); x = x + m_xstep )
750 aDC->SetLogicalFunction( prevlogfunction );
759 double xw, yw, xcurve, ycurve;
766 if ( fabs( yw - hitEvent.
m_rely ) < pw + margin )
778 #if wxART2D_USE_CVGIO
782 if ( xmlparts == a2dXmlSer_attrib )
793 if ( xmlparts == a2dXmlSer_attrib )
800 #endif //wxART2D_USE_CVGIO
805 BEGIN_EVENT_TABLE( a2dVertexCurve, a2dCurve )
813 a2dVertexCurve::a2dVertexCurve(
a2dVertexArray* points ): a2dCurve()
817 m_rendermode = a2dCURVES_RENDER_DEFAULT;
818 m_editmode = a2dCURVES_EDIT_DEFAULT;
821 a2dVertexCurve::a2dVertexCurve( ): a2dCurve()
826 m_editmode = a2dCURVES_EDIT_DEFAULT;
830 a2dVertexCurve::~a2dVertexCurve()
835 a2dVertexCurve::a2dVertexCurve(
const a2dVertexCurve& other, CloneOptions options,
a2dRefMap* refs )
836 : a2dCurve( other, options, refs )
839 *m_points = *other.m_points;
841 m_spline = other.m_spline;
843 m_rendermode = other.m_rendermode;
844 m_editmode = other.m_editmode;
849 return new a2dVertexCurve( *
this, options, refs );
856 for( a2dVertexArray::const_iterator iter = m_points->begin(); iter != m_points->end(); ++iter )
869 m_points->Item( n )->
m_x = x;
870 m_points->Item( n )->
m_y = y;
878 index = m_points->size();
880 x = m_points->Item( index )->
m_x;
881 y = m_points->Item( index )->
m_y;
882 m_points->RemoveAt( index );
888 index = m_points->size();
890 x = m_points->Item( index )->
m_x;
891 y = m_points->Item( index )->
m_y;
892 m_points->RemoveAt( index );
913 m_points->push_back( point );
915 m_points->Insert( point, index );
923 index = m_points->size();
925 x = m_points->Item( index )->
m_x;
926 y = m_points->Item( index )->
m_y;
932 index = m_points->size();
934 x = m_points->Item( index )->
m_x;
935 y = m_points->Item( index )->
m_y;
958 for ( i = 0; i < array->size(); i++ )
995 if( !m_points->size() )
998 xp = m_points->Item( 0 )->
m_x;
999 yp = m_points->Item( 0 )->
m_y;
1001 if ( sweepValue <= m_points->
Item( 0 )->m_x )
1003 point.m_x = m_points->Item( 0 )->
m_x;
1004 point.m_y = m_points->Item( 0 )->
m_y;
1009 for ( i = 0; i < m_points->size(); i++ )
1011 if ( xp < sweepValue && m_points->
Item( i )->
m_x >= sweepValue )
1013 point.m_x = sweepValue;
1014 point.m_y = ( m_points->Item( i )->
m_y - yp ) * ( sweepValue - xp ) / ( m_points->Item( i )->
m_x - xp ) + yp;
1017 xp = m_points->Item( i )->
m_x;
1018 yp = m_points->Item( i )->
m_y;
1022 point.m_x = m_points->Item( i - 1 )->
m_x;
1023 point.m_y = m_points->Item( i - 1 )->
m_y;
1034 for ( i = 0; i < m_points->size(); i++ )
1057 box.Expand( xw, yw );
1087 if ( m_highlightmode )
1101 bool firstPoint =
true;
1102 for ( i = 0; i < m_points->size(); i++ )
1104 if ( m_points->Item( i )->
m_x >= curvebox.
GetMinX() )
1106 if( firstPoint && i )
1108 Curve2World( m_points->Item( i - 1 )->
m_x, m_points->Item( i - 1 )->
m_y, xw, yw );
1123 if ( m_points->Item( i )->
m_x > curvebox.
GetMaxX() )
1140 wxRasterOperationMode prevlogfunction = wxNO_OP;
1142 if( m_logFunction != wxNO_OP )
1145 wxASSERT_MSG( aDC, wxT(
"TODO: aDC not defined for aggdrawer" ) );
1146 prevlogfunction = aDC->GetLogicalFunction();
1147 aDC->SetLogicalFunction( m_logFunction );
1151 double xprev = 0, yprev = 0;
1152 if( m_points->size() )
1153 Curve2World( m_points->Item( 0 )->
m_x, m_points->Item( 0 )->
m_y, xprev, yprev );
1155 for ( i = 1; i < m_points->size(); i++ )
1157 if ( m_points->Item( i )->
m_x >= curvebox.
GetMinX() )
1160 if( iprev != i - 1 )
1161 Curve2World( m_points->Item( i - 1 )->
m_x, m_points->Item( i - 1 )->
m_y, xprev, yprev );
1163 xprev = xw; yprev = yw;
1166 if ( m_points->Item( i )->
m_x > curvebox.
GetMaxX() )
1172 double xprev = 0, yprev = 0;
1175 for ( i = 1; i < m_points->size(); i++ )
1177 if ( m_points->Item( i )->
m_x >= curvebox.
GetMinX() )
1181 Curve2World( m_points->Item( i - 1 )->
m_x, m_points->Item( i - 1 )->
m_y, xprev, yprev );
1184 if ( m_points->Item( i )->
m_x > curvebox.
GetMaxX() )
1194 for ( i = 0; i < m_points->size(); i++ )
1196 if ( m_points->Item( i )->
m_x >= curvebox.
GetMinX() )
1209 if ( m_points->Item( i )->
m_x > curvebox.
GetMaxX() )
1220 aDC->SetLogicalFunction( prevlogfunction );
1223 #if wxART2D_USE_CVGIO
1227 if ( xmlparts == a2dXmlSer_attrib )
1231 out.WriteAttribute( wxT(
"spline" ) , m_spline );
1233 out.WriteAttribute( wxT(
"points" ) , m_points->size() );
1234 out.WriteAttribute( wxT(
"rendermode" ) , m_rendermode );
1235 out.WriteAttribute( wxT(
"editmode" ) , m_editmode );
1240 for ( i = 0; i < m_points->size(); i++ )
1245 out.WriteAttribute( wxT(
"x" ) , m_points->Item( i )->
m_x );
1246 out.WriteAttribute( wxT(
"y" ) , m_points->Item( i )->
m_y );
1255 if ( xmlparts == a2dXmlSer_attrib )
1268 m_points->push_back( point );
1276 #endif //wxART2D_USE_CVGIO
1281 double xcurve, ycurve;
1302 bool result =
false;
1306 if( m_points->size() )
1308 p2 = m_points->Item( 0 )->GetPoint();
1310 for ( i = 0; i < m_points->size() - 1; i++ )
1313 p2 = m_points->Item( i + 1 )->GetPoint();
1314 if ( margin > sqrt( pow( p1.m_x - P.m_x, 2 ) + pow( p1.m_y - P.m_y, 2 ) ) )
1319 else if ( !( ( p1.m_x == p2.m_x ) && ( p1.m_y == p2.m_y ) ) )
1322 if ( line1.
PointInLine( P, distance, margin ) == R_IN_AREA )
1354 double xinternal, yinternal;
1357 World2Curve( xinternal, yinternal, xinternal, yinternal );
1359 a2dHandle* draghandle =
event.GetCanvasHandle();
1364 if ( editmode == 1 )
1369 p1 = m_points->Item( index )->GetPoint();
1389 if ( draghandle->
GetName() == wxT(
"__index__" ) )
1430 double xinternal, yinternal;
1440 for ( i = 0; i <
GetPoints()->size(); i++ )
1443 if ( x < xinternal )
1450 original->
AddPoint( xinternal, yinternal, insertpos );
1451 AddPoint( xinternal, yinternal, insertpos );
1462 if ( index >= insertpos )
1503 m_highlightmode = 1;
1514 m_highlightmode = 0;
1523 a2dSweepPoint::a2dSweepPoint(
double sweep,
double a,
double b )
1530 #include <wx/arrimpl.cpp>
1531 WX_DEFINE_OBJARRAY( a2dSweepPointArray );
1533 BEGIN_EVENT_TABLE( a2dSweepCurve, a2dCurve )
1541 a2dSweepCurve::a2dSweepCurve( a2dSweepPointArray* points ): a2dCurve()
1545 m_rendermode = a2dCURVES_RENDER_DEFAULT;
1546 m_editmode = a2dCURVES_EDIT_DEFAULT;
1549 a2dSweepCurve::a2dSweepCurve( ): a2dCurve()
1551 m_points =
new a2dSweepPointArray;
1554 m_editmode = a2dCURVES_EDIT_DEFAULT;
1558 a2dSweepCurve::~a2dSweepCurve()
1563 a2dSweepCurve::a2dSweepCurve(
const a2dSweepCurve& other, CloneOptions options,
a2dRefMap* refs )
1564 : a2dCurve( other, options, refs )
1566 m_points =
new a2dSweepPointArray;
1568 for ( i = 0; i < other.m_points->size(); i++ )
1569 m_points->push_back(
new a2dSweepPoint( other.m_points->Item( i ) ) );
1571 m_spline = other.m_spline;
1573 m_rendermode = other.m_rendermode;
1574 m_editmode = other.m_editmode;
1579 return new a2dSweepCurve( *
this, options, refs );
1587 for ( i = 0; i < m_points->size(); i++ )
1589 m_lworld.
TransformPoint( m_points->Item( i ).m_a, m_points->Item( i ).m_b, m_points->Item( i ).m_a, m_points->Item( i ).m_b );
1599 m_points->Item( n ).m_a = x;
1600 m_points->Item( n ).m_b = y;
1608 index = m_points->size();
1610 x = m_points->Item( index ).m_a;
1611 y = m_points->Item( index ).m_b;
1612 m_points->RemoveAt( index );
1618 index = m_points->size();
1620 x = m_points->Item( index ).m_a;
1621 y = m_points->Item( index ).m_b;
1622 m_points->RemoveAt( index );
1642 m_points->push_back( point );
1649 index = m_points->size();
1651 x = m_points->Item( index ).m_a;
1652 y = m_points->Item( index ).m_b;
1658 index = m_points->size();
1660 x = m_points->Item( index ).m_a;
1661 y = m_points->Item( index ).m_b;
1674 if ( editmode == 1 )
1682 a2dSweepPointArray* array =
GetPoints();
1684 for ( i = 0; i < array->size(); i++ )
1687 Curve2World( array->Item( i ).m_a, array->Item( i ).m_b, xw, yw );
1720 if( !m_points->size() )
1723 xp = m_points->Item( 0 ).m_a;
1724 yp = m_points->Item( 0 ).m_b;
1725 if ( sweepValue <= m_points->
Item( 0 ).m_a )
1727 point.m_x = m_points->Item( 0 ).m_a;
1728 point.m_y = m_points->Item( 0 ).m_b;
1733 for ( i = 0; i < m_points->size(); i++ )
1735 if ( xp < sweepValue && m_points->
Item( i ).m_a >= sweepValue )
1737 point.m_x = sweepValue;
1738 point.m_y = ( m_points->Item( i ).m_b - yp ) * ( sweepValue - xp ) / ( m_points->Item( i ).m_a - xp ) + yp;
1741 xp = m_points->Item( i ).m_a;
1742 yp = m_points->Item( i ).m_b;
1746 point.m_x = m_points->Item( i - 1 ).m_a;
1747 point.m_y = m_points->Item( i - 1 ).m_b;
1758 for ( i = 0; i < m_points->size(); i++ )
1761 Curve2World( m_points->Item( i ).m_a, m_points->Item( i ).m_b, xw, yw );
1785 box.Expand( xw, yw );
1813 if ( m_highlightmode )
1827 for ( i = 0; i < m_points->size(); i++ )
1829 Curve2World( m_points->Item( i ).m_a, m_points->Item( i ).m_b, xw, yw );
1842 wxRasterOperationMode prevlogfunction = wxNO_OP;
1844 if( m_logFunction != wxNO_OP )
1849 prevlogfunction = aDC->GetLogicalFunction();
1850 aDC->SetLogicalFunction( m_logFunction );
1855 double xprev = 0, yprev = 0;
1856 for ( i = 1; i < m_points->size(); i++ )
1858 Curve2World( m_points->Item( i ).m_a, m_points->Item( i ).m_b, xw, yw );
1859 Curve2World( m_points->Item( i - 1 ).m_a, m_points->Item( i - 1 ).m_b, xprev, yprev );
1865 double xprev = 0, yprev = 0;
1867 Curve2World( m_points->Item( i ).m_a, 0, xw, yw0 );
1868 for ( i = 1; i < m_points->size(); i++ )
1870 Curve2World( m_points->Item( i ).m_a, m_points->Item( i ).m_b, xw, yw );
1872 Curve2World( m_points->Item( i - 1 ).m_a, m_points->Item( i - 1 ).m_b, xprev, yprev );
1882 for ( i = 0; i < m_points->size(); i++ )
1884 Curve2World( m_points->Item( i ).m_a, m_points->Item( i ).m_b, xw, yw );
1889 Curve2World( m_points->Item( i ).m_a, 0, xw0, yw0 );
1896 Curve2World( m_points->Item( i - 1 ).m_a, 0, xw0, yw0 );
1902 double xprev = 0, yprev = 0;
1903 for ( i = 1; i < m_points->size(); i++ )
1905 Curve2World( m_points->Item( i ).m_a, m_points->Item( i ).m_b, xw, yw );
1906 Curve2World( m_points->Item( i - 1 ).m_a, m_points->Item( i - 1 ).m_b, xprev, yprev );
1911 aDC->SetLogicalFunction( prevlogfunction );
1914 #if wxART2D_USE_CVGIO
1918 if ( xmlparts == a2dXmlSer_attrib )
1922 out.WriteAttribute( wxT(
"spline" ) , m_spline );
1924 out.WriteAttribute( wxT(
"points" ) , m_points->size() );
1925 out.WriteAttribute( wxT(
"rendermode" ) , m_rendermode );
1926 out.WriteAttribute( wxT(
"editmode" ) , m_editmode );
1931 for ( i = 0; i < m_points->size(); i++ )
1936 out.WriteAttribute( wxT(
"x" ) , m_points->Item( i ).m_a );
1937 out.WriteAttribute( wxT(
"y" ) , m_points->Item( i ).m_b );
1946 if ( xmlparts == a2dXmlSer_attrib )
1960 m_points->push_back( point );
1968 #endif //wxART2D_USE_CVGIO
1972 double xcurve, ycurve;
1993 bool result =
false;
1997 if( m_points->size() )
1999 p2 = m_points->Item( 0 ).GetPoint();
2001 for ( i = 0; i < m_points->size() - 1; i++ )
2004 p2 = m_points->Item( i + 1 ).GetPoint();
2005 if ( margin > sqrt( pow( p1.m_x - P.m_x, 2 ) + pow( p1.m_y - P.m_y, 2 ) ) )
2010 else if ( !( ( p1.m_x == p2.m_x ) && ( p1.m_y == p2.m_y ) ) )
2013 if ( line1.
PointInLine( P, distance, margin ) == R_IN_AREA )
2045 double xinternal, yinternal;
2048 World2Curve( xinternal, yinternal, xinternal, yinternal );
2050 a2dHandle* draghandle =
event.GetCanvasHandle();
2055 if ( editmode == 1 )
2057 if ( !( m_editmode & a2dCURVES_EDIT_NORMAL ) )
2060 p1 = m_points->Item( index ).GetPoint();
2062 if ( m_editmode & a2dCURVES_EDIT_FIXED_X )
2080 if ( draghandle->
GetName() == wxT(
"__index__" ) )
2115 m_highlightmode = 1;
2126 m_highlightmode = 0;
2137 :
a2dHandle( NULL, 0, 0, wxT( "dummy" ), 5, 5 )
2144 unsigned int index,
bool arcMid,
double xc,
double yc,
const wxString& name )
2154 m_index = other.m_index;
2166 BEGIN_EVENT_TABLE( a2dBandCurve, a2dCurve )
2174 a2dBandCurve::a2dBandCurve( a2dSweepPointArray* points ): a2dCurve()
2178 m_rendermode = a2dCURVES_RENDER_DEFAULT;
2179 m_editmode = a2dCURVES_EDIT_DEFAULT;
2180 m_markerUpLow =
true;
2183 a2dBandCurve::a2dBandCurve( ): a2dCurve()
2185 m_points =
new a2dSweepPointArray;
2187 m_rendermode = a2dCURVES_RENDER_DEFAULT;
2188 m_editmode = a2dCURVES_EDIT_DEFAULT;
2189 m_markerUpLow =
true;
2193 a2dBandCurve::~a2dBandCurve()
2198 a2dBandCurve::a2dBandCurve(
const a2dBandCurve& other, CloneOptions options,
a2dRefMap* refs )
2199 : a2dCurve( other, options, refs )
2201 m_points =
new a2dSweepPointArray;
2203 for ( i = 0; i < other.m_points->size(); i++ )
2204 m_points->push_back(
new a2dSweepPoint( other.m_points->Item( i ) ) );
2206 m_spline = other.m_spline;
2208 m_rendermode = other.m_rendermode;
2209 m_editmode = other.m_editmode;
2215 return new a2dBandCurve( *
this, options, refs );
2223 for ( i = 0; i < m_points->size(); i++ )
2225 m_lworld.
TransformPoint( m_points->Item( i ).m_a, m_points->Item( i ).m_b, m_points->Item( i ).m_a, m_points->Item( i ).m_b );
2235 m_points->Item( index ).m_sweep = sweep;
2237 m_points->Item( index ).m_b = y;
2239 m_points->Item( index ).m_a = y;
2247 index = m_points->size();
2249 sweep = m_points->Item( index ).m_sweep;
2251 y = m_points->Item( index ).m_b;
2253 y = m_points->Item( index ).m_a;
2255 m_points->RemoveAt( index );
2261 index = m_points->size();
2263 sweep = m_points->Item( index ).m_sweep;
2265 y = m_points->Item( index ).m_b;
2267 y = m_points->Item( index ).m_a;
2269 m_points->RemoveAt( index );
2289 m_points->push_back( point );
2296 index = m_points->size();
2298 sweep = m_points->Item( index ).m_sweep;
2300 y = m_points->Item( index ).m_b;
2302 y = m_points->Item( index ).m_a;
2308 index = m_points->size();
2310 sweep = m_points->Item( index ).m_sweep;
2312 y = m_points->Item( index ).m_b;
2314 y = m_points->Item( index ).m_a;
2327 if ( editmode == 1 )
2335 a2dSweepPointArray* array =
GetPoints();
2337 for ( i = 0; i < array->size(); i++ )
2340 Curve2World( array->Item( i ).m_sweep, array->Item( i ).m_a, xw, yw );
2344 Curve2World( array->Item( i ).m_sweep, array->Item( i ).m_b, xw, yw2 );
2369 void a2dBandCurve::SyncHandlesWithLineSegments()
2379 unsigned int index = handle->GetIndex();
2381 if ( handle->
GetName() == wxT(
"__indexlow__" ) )
2383 Curve2World( m_points->Item( index ).m_sweep, m_points->Item( index ).m_a, xw, yw );
2386 else if ( handle->
GetName() == wxT(
"__indexhigh__" ) )
2388 Curve2World( m_points->Item( index ).m_sweep, m_points->Item( index ).m_b, xw, yw );
2415 double xinternal, yinternal;
2418 World2Curve( xinternal, yinternal, xinternal, yinternal );
2421 wxUint16 index = draghandle->GetIndex();
2425 if ( editmode == 1 )
2427 if ( !( m_editmode & a2dCURVES_EDIT_NORMAL ) )
2429 if ( m_editmode & a2dCURVES_EDIT_FIXED_X )
2431 xinternal = m_points->Item( index ).m_sweep;
2435 if ( draghandle->
GetName() == wxT(
"__indexlow__" ) )
2436 yinternal = m_points->Item( index ).m_a;
2438 yinternal = m_points->Item( index ).m_b;
2450 if ( draghandle->
GetName() == wxT(
"__indexlow__" ) )
2453 SyncHandlesWithLineSegments();
2455 else if ( draghandle->
GetName() == wxT(
"__indexhigh__" ) )
2458 SyncHandlesWithLineSegments();
2465 if ( draghandle->
GetName() == wxT(
"__indexlow__" ) )
2469 else if ( draghandle->
GetName() == wxT(
"__indexhigh__" ) )
2490 if( !m_points->size() )
2494 xp = m_points->Item( 0 ).m_sweep;
2496 yp = m_points->Item( 0 ).m_b;
2498 yp = m_points->Item( 0 ).m_b;
2499 if ( sweepValue <= m_points->
Item( 0 ).m_sweep )
2501 point.m_x = m_points->Item( 0 ).m_sweep;
2503 point.m_y = m_points->Item( 0 ).m_b;
2505 point.m_y = m_points->Item( 0 ).m_a;
2510 for ( i = 0; i < m_points->size(); i++ )
2512 if ( xp < sweepValue && m_points->
Item( i ).m_sweep >= sweepValue )
2514 point.m_x = sweepValue;
2516 point.m_y = ( m_points->Item( i ).m_b - yp ) * ( sweepValue - xp ) / ( m_points->Item( i ).m_sweep - xp ) + yp;
2518 point.m_y = ( m_points->Item( i ).m_a - yp ) * ( sweepValue - xp ) / ( m_points->Item( i ).m_sweep - xp ) + yp;
2522 xp = m_points->Item( i ).m_sweep;
2524 yp = m_points->Item( i ).m_b;
2526 yp = m_points->Item( i ).m_a;
2530 point.m_x = m_points->Item( i - 1 ).m_sweep;
2532 point.m_y = m_points->Item( i - 1 ).m_b;
2534 point.m_y = m_points->Item( i - 1 ).m_a;
2544 for ( i = 0; i < m_points->size(); i++ )
2547 Curve2World( m_points->Item( i ).m_sweep, m_points->Item( i ).m_a, xw, yw );
2550 Curve2World( m_points->Item( i ).m_sweep, m_points->Item( i ).m_b, xw, yw );
2574 box.Expand( xw, yw );
2604 if ( m_highlightmode )
2619 for ( i = 0; i < m_points->size(); i++ )
2621 if ( m_points->Item( i ).m_sweep >= curvebox.
GetMinX() )
2623 Curve2World( m_points->Item( i ).m_sweep, m_points->Item( i ).m_a, xw, yw );
2624 Curve2World( m_points->Item( i ).m_sweep, m_points->Item( i ).m_b, xw, yw2 );
2625 double xd, yd, xd2, yd2;
2632 if ( m_points->Item( i ).m_sweep > curvebox.
GetMaxX() )
2641 wxRasterOperationMode prevlogfunction = wxNO_OP;
2643 if( m_logFunction != wxNO_OP )
2646 prevlogfunction = aDC->GetLogicalFunction();
2647 aDC->SetLogicalFunction( m_logFunction );
2651 bool second =
false;
2652 double xprev = 0, yprev = 0;
2653 for ( i = 0; i < m_points->size(); i++ )
2655 if ( second && m_points->Item( i ).m_sweep >= curvebox.
GetMinX() )
2657 Curve2World( m_points->Item( i ).m_sweep, m_points->Item( i ).m_a, xw, yw );
2658 Curve2World( m_points->Item( i - 1 ).m_sweep, m_points->Item( i - 1 ).m_a, xprev, yprev );
2660 Curve2World( m_points->Item( i ).m_sweep, m_points->Item( i ).m_b, xw, yw2 );
2661 Curve2World( m_points->Item( i - 1 ).m_sweep, m_points->Item( i - 1 ).m_b, xprev, yprev );
2664 if ( m_points->Item( i ).m_sweep > curvebox.
GetMaxX() )
2671 bool second =
false;
2672 double xprev = 0, yprev = 0;
2673 for ( i = 0; i < m_points->size(); i++ )
2675 if ( second && m_points->Item( i ).m_sweep >= curvebox.
GetMinX() )
2677 Curve2World( m_points->Item( i ).m_sweep, m_points->Item( i ).m_a, xw, yw );
2678 Curve2World( m_points->Item( i - 1 ).m_sweep, m_points->Item( i - 1 ).m_a, xprev, yprev );
2679 Curve2World( m_points->Item( i ).m_sweep, m_points->Item( i ).m_b, xw, yw2 );
2682 Curve2World( m_points->Item( i - 1 ).m_sweep, m_points->Item( i - 1 ).m_b, xprev, yprev );
2686 if ( m_points->Item( i ).m_sweep > curvebox.
GetMaxX() )
2694 for ( i = 0; i < m_points->size(); i++ )
2696 Curve2World( m_points->Item( i ).m_sweep, m_points->Item( i ).m_a, xw, yw );
2697 Curve2World( m_points->Item( i ).m_sweep, m_points->Item( i ).m_b, xw, yw2 );
2708 aDC->SetLogicalFunction( prevlogfunction );
2711 #if wxART2D_USE_CVGIO
2715 if ( xmlparts == a2dXmlSer_attrib )
2719 out.WriteAttribute( wxT(
"spline" ) , m_spline );
2721 out.WriteAttribute( wxT(
"points" ) , m_points->size() );
2722 out.WriteAttribute( wxT(
"rendermode" ) , m_rendermode );
2723 out.WriteAttribute( wxT(
"editmode" ) , m_editmode );
2728 for ( i = 0; i < m_points->size(); i++ )
2733 out.WriteAttribute( wxT(
"sweep" ) , m_points->Item( i ).m_sweep );
2734 out.WriteAttribute( wxT(
"a" ) , m_points->Item( i ).m_a );
2735 out.WriteAttribute( wxT(
"b" ) , m_points->Item( i ).m_b );
2744 if ( xmlparts == a2dXmlSer_attrib )
2758 m_points->push_back( point );
2766 #endif //wxART2D_USE_CVGIO
2773 double xcurve, ycurve;
2794 bool result =
false;
2798 if( m_points->size() )
2800 pup2 = m_points->Item( 0 ).GetPoint();
2802 for ( i = 0; i < m_points->size() - 1; i++ )
2804 R_PointStatus up = R_RIGHT_SIDE;
2805 R_PointStatus low = R_RIGHT_SIDE;
2808 pup2 = m_points->Item( i + 1 ).GetPointUp();
2809 if ( margin > sqrt( pow( pup1.m_x - P.m_x, 2 ) + pow( pup1.m_y - P.m_y, 2 ) ) )
2814 else if ( !( ( pup1.m_x == pup2.m_x ) && ( pup1.m_y == pup2.m_y ) ) )
2817 if ( ( up = line1.
PointInLine( P, distance, margin ) ) == R_IN_AREA )
2824 plow2 = m_points->Item( i + 1 ).GetPointLow();
2825 if ( margin > sqrt( pow( plow1.m_x - P.m_x, 2 ) + pow( plow1.m_y - P.m_y, 2 ) ) )
2830 else if ( !( ( plow1.m_x == plow2.m_x ) && ( plow1.m_y == plow2.m_y ) ) )
2833 if ( ( low = line1.
PointInLine( P, distance, margin ) ) == R_IN_AREA )
2840 if ( pup1.m_x > plow1.m_x && up == R_RIGHT_SIDE && low == R_LEFT_SIDE )
2845 if ( pup1.m_x < plow1.m_x && low == R_RIGHT_SIDE && up == R_LEFT_SIDE )
2868 m_highlightmode = 1;
2879 m_highlightmode = 0;
2898 a2dBarCurve::a2dBarCurve(
a2dVertexArray* points ): a2dVertexCurve( points )
2901 m_depth = m_barwidth / 2;
2907 a2dBarCurve::a2dBarCurve( ): a2dVertexCurve()
2910 m_depth = m_barwidth / 2;
2917 a2dBarCurve::~a2dBarCurve()
2921 a2dBarCurve::a2dBarCurve(
const a2dBarCurve& other, CloneOptions options,
a2dRefMap* refs )
2922 : a2dVertexCurve( other, options, refs )
2924 m_barwidth = other.m_barwidth;
2925 m_depth = other.m_depth;
2926 m_angle3d = other.m_angle3d;
2928 m_extrudeFill = other.m_extrudeFill;
2930 #if defined(_DEBUG) && defined (SMART_POINTER_DEBUG)
2932 CurrentSmartPointerOwner =
this;
2938 return new a2dBarCurve( *
this, options, refs );
2941 void a2dBarCurve::SetExtrudeFill(
const a2dFill& fill )
2943 m_extrudeFill = fill;
2951 if ( m_highlightmode )
2969 for ( i = 0; i < m_points->size(); i++ )
2984 wxRasterOperationMode prevlogfunction = wxNO_OP;
2986 if( m_logFunction != wxNO_OP )
2989 prevlogfunction = aDC->GetLogicalFunction();
2990 aDC->SetLogicalFunction( m_logFunction );
2995 switch ( m_rendermode )
3000 double w2 = m_barwidth / 2;
3003 for ( i = 0; i < m_points->size(); i++ )
3005 if ( m_pointsFill.size() )
3018 double w2 = m_barwidth / 2;
3022 for ( i = 0; i < m_points->size(); i++ )
3026 double barlow = yw0;
3027 double barheight = yw;
3029 if ( barheight < 0 )
3039 cpoints->push_back(
new a2dLineSegment( barx - w2, barheight ) );
3040 cpoints->push_back(
new a2dLineSegment( barx - w2 + cos( m_angle3d -
wxPI / 30 )*m_depth, barheight + sin( m_angle3d -
wxPI / 30 )*m_depth ) );
3041 cpoints->push_back(
new a2dLineSegment( barx + w2 + cos( m_angle3d )*m_depth, barheight + sin( m_angle3d -
wxPI / 30 )*m_depth ) );
3042 cpoints->push_back(
new a2dLineSegment( barx + w2, barheight ) );
3047 cpoints->push_back(
new a2dLineSegment( barx + w2, barheight ) );
3048 cpoints->push_back(
new a2dLineSegment( barx + w2 + cos( m_angle3d )*m_depth, barheight + sin( m_angle3d -
wxPI / 30 )*m_depth ) );
3049 cpoints->push_back(
new a2dLineSegment( barx + w2 + cos( m_angle3d )*m_depth, barlow + sin( m_angle3d )*m_depth ) );
3054 if ( m_pointsFill.size() )
3069 for ( i = 0; i < m_points->size(); i++ )
3078 aDC->SetLogicalFunction( prevlogfunction );
3084 #if wxART2D_USE_CVGIO
3088 if ( xmlparts == a2dXmlSer_attrib )
3090 out.WriteAttribute( wxT(
"barwidth" ) , m_barwidth );
3091 out.WriteAttribute( wxT(
"depth" ) , m_depth );
3092 out.WriteAttribute( wxT(
"angle3d" ) , m_angle3d );
3097 m_extrudeFill.Save(
this, out, towrite );
3105 if ( xmlparts == a2dXmlSer_attrib )
3115 m_extrudeFill.Load( parent, parser );
3120 #endif //wxART2D_USE_CVGIO
3127 BEGIN_EVENT_TABLE( a2dVertexListCurve, a2dCurve )
3135 a2dVertexListCurve::a2dVertexListCurve(
a2dVertexList* points ): a2dCurve()
3139 m_rendermode = a2dCURVES_RENDER_DEFAULT;
3140 m_editmode = a2dCURVES_EDIT_DEFAULT;
3143 a2dVertexListCurve::a2dVertexListCurve( ): a2dCurve()
3148 m_editmode = a2dCURVES_EDIT_DEFAULT;
3152 a2dVertexListCurve::~a2dVertexListCurve()
3157 a2dVertexListCurve::a2dVertexListCurve(
const a2dVertexListCurve& other, CloneOptions options,
a2dRefMap* refs )
3158 : a2dCurve( other, options, refs )
3161 *m_lpoints = *other.m_lpoints;
3163 m_spline = other.m_spline;
3164 m_rendermode = other.m_rendermode;
3165 m_editmode = other.m_editmode;
3170 return new a2dVertexListCurve( *
this, options, refs );
3177 for( a2dVertexList::iterator iter = m_lpoints->begin(); iter != m_lpoints->end(); ++iter )
3189 if ( afterinversion )
3197 for( a2dVertexList::iterator iter = m_lpoints->begin(); iter != m_lpoints->end(); ++iter )
3213 AddPoint( P.m_x, P.m_y, index, afterinversion );
3218 if ( afterinversion )
3228 m_lpoints->push_back( point );
3231 a2dVertexList::iterator iter = m_lpoints->begin();
3233 while ( i < index ) { ++iter; i++; }
3234 m_lpoints->insert( iter, point );
3244 point = m_lpoints->back();
3247 m_lpoints->pop_back();
3252 a2dVertexList::iterator iter = m_lpoints->begin();
3254 while ( iter != m_lpoints->end() )
3261 m_lpoints->erase( iter );
3282 point = m_lpoints->back();
3289 a2dVertexList::iterator iter = m_lpoints->begin();
3291 while ( iter != m_lpoints->end() )
3315 if ( editmode == 1 )
3358 if( !m_lpoints->size() )
3361 a2dVertexList::iterator iter = m_lpoints->begin();
3366 while ( iter != m_lpoints->end() )
3369 if ( xp < sweepValue && pointc.m_x >= sweepValue )
3371 point.m_x = sweepValue;
3372 point.m_y = ( pointc.m_y - yp ) * ( pointc.m_x - xp ) / ( pointc.m_x - xp ) + yp;
3381 point.m_x = sweepValue;
3396 a2dVertexList::iterator iter;
3397 for( iter = m_lpoints->begin(); iter != m_lpoints->end(); ++iter )
3401 lpoints->push_back( point );
3405 for( iter = lpoints->begin(); iter != lpoints->end(); ++iter )
3416 for( a2dVertexList::iterator iter = m_lpoints->begin(); iter != m_lpoints->end(); ++iter )
3453 box.Expand( xw, yw );
3481 if ( m_highlightmode )
3517 wxRasterOperationMode prevlogfunction = wxNO_OP;
3519 if( m_logFunction != wxNO_OP )
3522 prevlogfunction = aDC->GetLogicalFunction();
3523 aDC->SetLogicalFunction( m_logFunction );
3528 bool second =
false;
3529 double xprev = 0, yprev = 0;
3534 if ( second && point->
m_x >= curvebox.
GetMinX() )
3550 bool second =
false;
3551 double xprev = 0, yprev = 0;
3559 if ( second && point->
m_x >= curvebox.
GetMinX() )
3574 aDC->SetLogicalFunction( prevlogfunction );
3577 #if wxART2D_USE_CVGIO
3581 if ( xmlparts == a2dXmlSer_attrib )
3585 out.WriteAttribute( wxT(
"spline" ) , m_spline );
3587 out.WriteAttribute( wxT(
"points" ) , m_lpoints->size() );
3588 out.WriteAttribute( wxT(
"rendermode" ) , m_rendermode );
3589 out.WriteAttribute( wxT(
"editmode" ) , m_editmode );
3600 out.WriteAttribute( wxT(
"x" ) , point->
m_x );
3601 out.WriteAttribute( wxT(
"y" ) , point->
m_y );
3611 if ( xmlparts == a2dXmlSer_attrib )
3624 m_lpoints->push_back( point );
3632 #endif //wxART2D_USE_CVGIO
3636 double xcurve, ycurve;
3657 bool result =
false;
3666 for( a2dVertexList::iterator iter = m_lpoints->begin(); iter != m_lpoints->end(); ++iter )
3669 lpoints->push_back( point );
3678 if ( rlist->size() )
3680 a2dVertexList::iterator iter = rlist->begin();
3681 p2 = ( *iter )->GetPoint();
3682 while ( iter != rlist->end() && !result )
3686 if ( iter != rlist->end() )
break;
3687 p2 = ( *iter )->GetPoint();
3689 if ( margin > sqrt( pow( p1.m_x - P.m_x, 2 ) + pow( p1.m_y - P.m_y, 2 ) ) )
3691 else if ( !( ( p1.m_x == p2.m_x ) && ( p1.m_y == p2.m_y ) ) )
3694 if ( line1.
PointInLine( P, distance, margin ) == R_IN_AREA )
3702 for( a2dVertexList::iterator iter = rlist->begin(); iter != rlist->end(); ++iter )
3733 double xinternal, yinternal;
3736 a2dHandle* draghandle =
event.GetCanvasHandle();
3741 if ( editmode == 1 )
3751 if ( draghandle->
GetName() == wxT(
"__index__" ) )
3785 m_highlightmode = 1;
3795 m_highlightmode = 0;
3804 BEGIN_EVENT_TABLE( a2dPieCurve, a2dCurve )
3815 m_rendermode = a2dCURVES_RENDER_DEFAULT;
3818 a2dPieCurve::a2dPieCurve( ): a2dCurve()
3825 a2dPieCurve::~a2dPieCurve()
3830 a2dPieCurve::a2dPieCurve(
const a2dPieCurve& other, CloneOptions options,
a2dRefMap* refs )
3831 : a2dCurve( other, options, refs )
3835 for ( i = 0; i < other.m_points->size(); i++ )
3836 m_points->push_back( other.m_points->Item( i )->
Clone() );
3839 m_rendermode = other.m_rendermode;
3844 return new a2dPieCurve( *
this, options, refs );
3850 index = m_points->size();
3852 x = m_points->Item( index )->
m_x;
3853 y = m_points->Item( index )->
m_y;
3854 m_points->RemoveAt( index );
3875 m_points->push_back( point );
3877 m_points->Insert( point, index );
3885 index = m_points->size();
3887 x = m_points->Item( index )->
m_x;
3888 y = m_points->Item( index )->
m_y;
3900 if( !m_points->size() )
3903 xp = m_points->Item( 0 )->
m_x;
3904 yp = m_points->Item( 0 )->
m_y;
3906 if ( sweepValue <= m_points->
Item( 0 )->m_x )
3908 point.m_x = m_points->Item( 0 )->
m_x;
3909 point.m_y = m_points->Item( 0 )->
m_y;
3914 for ( i = 0; i < m_points->size(); i++ )
3916 if ( xp < sweepValue && m_points->
Item( i )->
m_x >= sweepValue )
3918 point.m_x = sweepValue;
3919 point.m_y = ( m_points->Item( i )->
m_y - yp ) * ( sweepValue - xp ) / ( m_points->Item( i )->
m_x - xp ) + yp;
3922 xp = m_points->Item( i )->
m_x;
3923 yp = m_points->Item( i )->
m_y;
3927 point.m_x = m_points->Item( i - 1 )->
m_x;
3928 point.m_y = m_points->Item( i - 1 )->
m_y;
3963 for ( i = 0; i < m_points->size(); i++ )
3964 yt += m_points->Item( i )->
m_y;
3966 double dangle = 2 *
wxPI / yt;
3968 wxRasterOperationMode prevlogfunction = wxNO_OP;
3970 if( m_logFunction != wxNO_OP )
3973 prevlogfunction = aDC->GetLogicalFunction();
3974 aDC->SetLogicalFunction( m_logFunction );
3981 xn = m_width / 2 * cos ( theta );
3982 yn = m_height / 2 * sin ( theta );
3983 for ( i = 0; i < m_points->size(); i++ )
3986 double theta2 = theta;
3987 theta += dangle * m_points->Item( i )->
m_y;
3990 xn = m_width / 2 * cos ( theta2 );
3991 yn = m_height / 2 * sin ( theta2 );
3992 while ( theta2 < theta )
3997 xn = m_width / 2 * cos ( theta2 );
3998 yn = m_height / 2 * sin ( theta2 );
4000 xn = m_width / 2 * cos ( theta );
4001 yn = m_height / 2 * sin ( theta );
4009 xn = m_width / 2 * cos ( theta );
4010 yn = m_height / 2 * sin ( theta );
4012 for ( i = 0; i < m_points->size(); i++ )
4014 if ( m_pointsFill.size() )
4018 double theta2 = theta;
4019 theta += dangle * m_points->Item( i )->
m_y;
4026 xn = m_width / 2 * cos ( theta2 );
4027 yn = m_height / 2 * sin ( theta2 );
4028 while ( theta2 < theta )
4033 xn = m_width / 2 * cos ( theta2 );
4034 yn = m_height / 2 * sin ( theta2 );
4036 xn = m_width / 2 * cos ( theta );
4037 yn = m_height / 2 * sin ( theta );
4047 aDC->SetLogicalFunction( prevlogfunction );
4050 #if wxART2D_USE_CVGIO
4054 if ( xmlparts == a2dXmlSer_attrib )
4056 out.WriteAttribute( wxT(
"points" ) , m_points->size() );
4057 out.WriteAttribute( wxT(
"rendermode" ) , m_rendermode );
4062 for ( i = 0; i < m_points->size(); i++ )
4067 out.WriteAttribute( wxT(
"x" ) , m_points->Item( i )->
m_x );
4068 out.WriteAttribute( wxT(
"y" ) , m_points->Item( i )->
m_y );
4077 if ( xmlparts == a2dXmlSer_attrib )
4088 m_points->push_back( point );
4096 #endif //wxART2D_USE_CVGIO
4102 if ( m_height == 0 && m_width == 0 )
4108 if ( m_height == 0 || m_width == 0 )
4119 for ( i = 0; i < m_points->size(); i++ )
4120 yt += m_points->Item( i )->
m_y;
4122 double dangle = 2 *
wxPI / yt;
4124 double a = m_width / 2 + pw + margin ;
4125 double b = m_height / 2 + pw + margin;
4126 double c =
wxSqr( xh / a ) +
wxSqr( yh / b );
4133 for ( i = 0; i < m_points->size(); i++ )
4136 double start, end, angle;
4138 theta += dangle * m_points->Item( i )->
m_y;
4142 double c = m_height / m_width;
4144 rx = sqrt( dx * dx + ( dy * dy ) / ( c * c ) );
4147 if ( dx* ry == 0 && dy* rx == 0 )
4150 angle = atan2( dy * rx, dx * ry );
4152 angle = angle - start;
4155 if ( angle <= 0 ) angle += 2.0 *
wxPI;
4157 if ( end <= 0 ) end += 2.0 *
wxPI;
4158 if ( start < 0 ) start += 2.0 *
wxPI;
4161 angle = angle + start;
4164 if ( angle > start && angle < end )
4181 if ( editmode == 1 )
4191 for ( i = 0; i < m_points->size(); i++ )
4192 yt += m_points->Item( i )->
m_y;
4194 double dangle = 2 *
wxPI / yt;
4197 for ( i = 0; i < m_points->size(); i++ )
4199 xn = m_width / 2 * cos ( theta );
4200 yn = m_height / 2 * sin ( theta );
4201 theta += dangle * m_points->Item( i )->
m_y;
4251 double xinternal, yinternal;
4254 World2Curve( xinternal, yinternal, xinternal, yinternal );
4256 a2dHandle* draghandle =
event.GetCanvasHandle();
4261 if ( editmode == 1 )
4271 if ( draghandle->
GetName() == wxT(
"__index__" ) )
4306 m_highlightmode = 1;
4317 m_highlightmode = 0;
a2dHit m_how
return in which way the object was hit (stroke, fill, ...)
bool DoUpdate(UpdateMode mode, const a2dBoundingBox &childbox, const a2dBoundingBox &clipbox, const a2dBoundingBox &propbox)
Update derived Object specific things ( mainly boundingbox)
bool GetAttributeValueBool(const wxString &attrib, bool defaultv=false)
Returns the boolean value of an attribute.
void DoRender(a2dIterC &ic, OVERLAP clipparent)
render derived object
wxPoint2DDouble a2dPoint2D
this to define if coordinate numbers are integer or doubles
a2dVertexArray * GetPoints()
return the array of points.
void AddPoint(const a2dPoint2D &P, int index=-1, bool afterinversion=true)
Append a new point.
virtual bool GetXyAtSweep(double sweepValue, a2dPoint2D &point) const
calculate Y at X
double m_relx
(world coordinates) hit point x relative to the canvas object its parent object(s) ...
double GetHeight() const
returns height of the boundingbox
a2dSweepPointArray * GetPoints()
return the array of points.
bool SetSpecificFlags(bool setOrClear, a2dCanvasObjectFlagsMask which, const wxString &classname=wxT(""), a2dCanvasObjectFlagsMask whichobjects=a2dCanvasOFlags::ALL, const a2dBoundingBox &bbox=wxNonValidBbox, const a2dAffineMatrix &tworld=a2dIDENTITY_MATRIX)
set all given bit flags at once recursive for all objects in given boundingbox
handle holds a pointer to a polygon/polyline segment
#define wxDynamicCast(obj, className)
Define wxDynamicCast so that it will give a compiler error for unrelated types.
Base class for all types of strokes, understood by a2dDrawer2D classes.
virtual bool GetXyAtSweep(double sweepValue, a2dPoint2D &point) const
calculate Y at X
bool DoUpdate(UpdateMode mode, const a2dBoundingBox &childbox, const a2dBoundingBox &clipbox, const a2dBoundingBox &propbox)
Update derived Object specific things ( mainly boundingbox)
bool Undo(void)
Override this to undo a command.
bool DoUpdate(UpdateMode mode, const a2dBoundingBox &childbox, const a2dBoundingBox &clipbox, const a2dBoundingBox &propbox)
Update derived Object specific things ( mainly boundingbox)
bool DoUpdate(UpdateMode mode, const a2dBoundingBox &childbox, const a2dBoundingBox &clipbox, const a2dBoundingBox &propbox)
Update derived Object specific things ( mainly boundingbox)
bool HasAttribute(const wxString &attrib)
Does the current tag have this attribute?
a2dHandle is used inside editing versions of a certain objects.
a2dBoundingBox DoGetUnTransformedBbox(a2dBboxFlags flags=a2dCANOBJ_BBOX_NON) const
In derived object this should be overriden to calculate the boundingbox of the object without its chi...
mouse event sent from a2dCanvasObject to itself
a2dBoundingBox m_untransbbox
Untransformed bounding box.
void GetPosXYPointWorld(int index, double &x, double &y, bool transform)
get point x and y at index in world coordinates
bool DoUpdate(UpdateMode mode, const a2dBoundingBox &childbox, const a2dBoundingBox &clipbox, const a2dBoundingBox &propbox)
Update derived Object specific things ( mainly boundingbox)
const a2dStroke * a2dBLACK_STROKE
global a2dStroke stock object for BLACK stroking
bool DoIsHitWorld(a2dIterC &ic, a2dHitEvent &hitEvent)
Does hit test on the object (exclusif child objects)
bool Undo(void)
Override this to undo a command.
virtual void PopTransform(void)
Recall the previously saved user-to-world transform off the matrix stack.
XMLeventType Next()
Walks to next element and returns event type.
void GetPosXYPointWorld(int index, double &x, double &y, bool transform)
get point x and y at index in world coordinates
a2dCurveObject()
default constructor
void DoRender(a2dIterC &ic, OVERLAP clipparent)
render derived object
class to map references to objects stored in XML, in order to make the connection later on...
void RemovePoint(double &x, double &y, int index=-1)
removes point at index
a2dDrawing * m_root
root group for rendering and accessing the canvas's also contains layer settings
Bars in a Curve represented by a number of vertexes.
Curve represented by a number of vertexes.
a2dCanvasOFlags m_flags
holds flags for objects
void SetPosXYPoint(int index, double sweep, double y, bool upper)
modify point at index to x,y
void DoLoad(wxObject *parent, a2dIOHandlerXmlSerIn &parser, a2dXmlSer_flag xmlparts)
load object specific CVG data
const a2dAffineMatrix & GetInverseTransform() const
Inverse of GetTransform()
static const a2dCanvasObjectFlagsMask BIN2
#define EVT_CANVASOBJECT_ENTER_EVENT(func)
static event table macro for a2dCanvasObject mouse enter event
void AddPoint(const a2dPoint2D &P, int index=-1)
Append a new point in curve coordinates.
a2dSweepPointArray * GetPoints()
return the array of points.
const a2dFill * a2dBLACK_FILL
global a2dFill stock object for BLACK filling
void WriteStartElementAttributes(const wxString &name, bool newLine=true)
Writes start tag which has attributes.
static a2dHit stock_nohit
Stock object for no hit.
virtual void DoSave(wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts, a2dObjectList *towrite)
write object specific CVGL data
virtual bool GetXyAtSweep(double sweepValue, a2dPoint2D &point) const
calculate Y at X
virtual void Curve2World(double xcurve, double ycurve, double &xw, double &yw) const
used by a2dCurve to transform its own curve coordinates to the curve plotting area ...
used to move points in BandCurve objects
a2dDrawing * GetRoot() const
get a2dCanvasDocument of the object.
bool Do(void)
Override this to perform a command.
bool PointOnCurve(const a2dPoint2D &P, double marge)
test if a point is on the curve.
double wxDegToRad(double deg)
conversion from degrees to radians
a2dBoundingBox GetClippedCurveBoundaries()
get clipped boundary box of plot boundary in curve coordinates
void DoLoad(wxObject *parent, a2dIOHandlerXmlSerIn &parser, a2dXmlSer_flag xmlparts)
load object specific CVG data
virtual bool Update(UpdateMode mode)
Update the state of the object according to its current position etc.
int GetAttributeValueInt(const wxString &attrib, int defaultv=0)
Returns the integer value of an attribute.
bool DoStartEdit(wxUint16 editmode, wxEditStyle editstyle)
only used for editable objects and under control of a editing tool.
#define EVT_CANVASHANDLE_MOUSE_EVENT(func)
static event table macro for a2dHandle mouse event
void SetDrawerStroke(const a2dStroke &stroke)
Used to set the current stroke.
bool DoIsHitWorld(a2dIterC &ic, a2dHitEvent &hitEvent)
Does hit test on the object (exclusif child objects)
bool IsIdentity(void) const
Is the matrix the identity matrix?
Input and output handler for the XmlSer format.
virtual void DrawPolygon(a2dVertexArray *points, bool spline=false, wxPolygonFillMode fillStyle=wxODDEVEN_RULE)
Draw polygon in world coordinates using pointarray.
UpdateMode
Various mode flags for Update.
a2dBoundingBox GetCurveBoundaries()
get boundary box of plot boundary in curve coordinates
a2dBoundingBox DoGetUnTransformedBbox(a2dBboxFlags flags=a2dCANOBJ_BBOX_NON) const
In derived object this should be overriden to calculate the boundingbox of the object without its chi...
R_PointStatus PointInLine(const a2dPoint2D &a_Point, double &Distance, double Marge) const
For a non-infinite a2dLine.
void World2Curve(double xw, double yw, double &xcurve, double &ycurve)
used by a2dCurve to transform its own curve coordinates to the curve plotting area ...
a command processor specially designed to work with a a2dCanvasDocument
virtual void SetPending(bool pending)
set this object pending for update
OVERLAP
Result of a a2dBoundingBox intersection or hittest.
bool m_visiblechilds
child objects are visible or not
virtual a2dObject * DoClone(CloneOptions options, a2dRefMap *refs) const
This is here so that this class cannot be used directly.
bool EliminateMatrix()
reduce matrix to identity without replacing object
The base class for all drawable objects in a a2dCanvasDocument.
virtual a2dObject * DoClone(CloneOptions options, a2dRefMap *refs) const
This is here so that this class cannot be used directly.
double GetTransformedHitMargin()
transformed to object its coordinate system
a2dCommandProcessor * m_cmp
allows commands to get to the command processor that submitted the command.
a2dVertexList * ConvertSplinedPolyline(double Aber) const
Spline conversion for polyline.
wxUint16 m_layer
layer of object, default wxLAYER_DEFAULT
virtual void DoLoad(wxObject *parent, a2dIOHandlerXmlSerIn &parser, a2dXmlSer_flag xmlparts)
load object specific CVG data
void DoLoad(wxObject *parent, a2dIOHandlerXmlSerIn &parser, a2dXmlSer_flag xmlparts)
load object specific CVG data
void SetPosXYPoint(int index, double x, double y)
modify point at index to x,y
vertex array of line and arc segments.
a2dCanvasObject is the base class for Canvas Objects.
a2dLineSegmentPtr Item(size_t index) const
Returns the point pointer at the given position in the array.
bool EliminateMatrix()
reduce matrix to identity without replacing object
virtual void World2Curve(double xw, double yw, double &xcurve, double &ycurve) const
used by a2dCurve to transform its own curve coordinates to the curve plotting area ...
Object to plot a Curve defined by a Function in form of a string.
void AddPoint(double sweep, const a2dPoint2D &P)
Append a new point in curve coordinates.
bool And(a2dBoundingBox *, double Marge=0)
intersect the boundingbox with another, return true if the result is non zero
bool Undo(void)
Override this to undo a command.
A2DGENERALDLLEXP a2dWalkEvent a2dWalker_a2dDerivedCanvasObjectStart
id for a2dWalkEvent issued from within a2dWalkerIOHandler
a2dCanvas uses a2dCanvasView for displaying a view on a a2dCanvasDocument.
vertex list of line and arc segments.
void TransformPoint(double x, double y, double &tx, double &ty) const
Transform a point.
wxString GetName() const
get the name given to the handle.
void DoLoad(wxObject *parent, a2dIOHandlerXmlSerIn &parser, a2dXmlSer_flag xmlparts)
load object specific CVG data
virtual void EndEdit()
cleanup an editcopy object
void WriteEndElement(bool newLine=true)
Writes correspondending end tag for the current start tag.
void SetBoundaries(double xmin, double ymin, double xmax, double ymax)
define which part of the curve will be displayed.
virtual a2dObject * DoClone(CloneOptions options, a2dRefMap *refs) const
This is here so that this class cannot be used directly.
void Curve2World(double xcurve, double ycurve, double &xw, double &yw)
used by a2dCurve to transform its own curve coordinates to the curve plotting area ...
bool PointOnCurve(const a2dPoint2D &P, double marge)
test if a point is on the curve.
a2dVertexList * ConvertSplinedPolygon(double Aber) const
Spline conversion for polygon.
a2dCurveObject for objects needing to know its parent a2dCurvesArea.
static a2dPropertyIdBool * PROPID_FirstEventInObject
set in Startedit(), to be used to detect first (mouse)event sent to object.
a2dAffineMatrix m_lworld
used for positioning the object (x,y,ang,scale etc.)
void SetDrawerFill(const a2dFill &fill)
Used to set the current fill.
Curve represented by a number of vertexes.
Io handler to iterate through a a2dDocument.
static const a2dCanvasObjectFlagsMask PENDING
wxMouseEvent & GetMouseEvent()
return the original mouse event that was redirected to the a2dHandle
void RemovePoint(double &x, double &y, int index=-1)
removes point at index
virtual bool GetXyAtSweep(double sweepValue, a2dPoint2D &point) const
calculate Y at X
bool m_draggable
can be dragged
void WriteNewLine()
Writes a new line and takes care of indentation.
bool DoIsHitWorld(a2dIterC &ic, a2dHitEvent &hitEvent)
Does hit test on the object (exclusif child objects)
bool IsEdgeHit() const
true if this is a stroke hit on an edge
a2dSweepPoint * Item(size_t index) const
void DoRender(a2dIterC &ic, OVERLAP clipparent)
render derived object
used to move points in VertexCurve objects
a2dCanvasObjectList * wxNullCanvasObjectList
define a NON a2dCanvasObjectList
a2dBoundingBox DoGetUnTransformedBbox(a2dBboxFlags flags=a2dCANOBJ_BBOX_NON) const
In derived object this should be overriden to calculate the boundingbox of the object without its chi...
bool DoUpdate(UpdateMode mode, const a2dBoundingBox &childbox, const a2dBoundingBox &clipbox, const a2dBoundingBox &propbox)
Update derived Object specific things ( mainly boundingbox)
bool GetValid() const
returns true if boundingbox is calculated properly and therefore its valid flag is set...
void Expand(const a2dPoint2D &, const a2dPoint2D &)
expand boundingbox width two points
void DoLoad(wxObject *parent, a2dIOHandlerXmlSerIn &parser, a2dXmlSer_flag xmlparts)
load object specific CVG data
double GetMinX() const
get minimum X of the boundingbox
virtual void DrawRoundedRectangle(double x, double y, double width, double height, double radius, bool pixelsize=false)
Draw RoundedRectangle in world coordinates.
virtual a2dObject * DoClone(CloneOptions options, a2dRefMap *refs) const
This is here so that this class cannot be used directly.
a2dCanvasObjectList * m_childobjects
holds child objects
bool DoStartEdit(wxUint16 editmode, wxEditStyle editstyle)
only used for editable objects and under control of a editing tool.
~a2dCanvasBandCurveHandle()
destructor
a2dBoundingBox DoGetUnTransformedBbox(a2dBboxFlags flags=a2dCANOBJ_BBOX_NON) const
In derived object this should be overriden to calculate the boundingbox of the object without its chi...
#define forEachIn(listtype, list)
easy iteration for a2dlist
void RemovePointWorld(double &x, double &y, int index=-1, bool transformed=true)
removes point at index
void DoLoad(wxObject *parent, a2dIOHandlerXmlSerIn &parser, a2dXmlSer_flag xmlparts)
load object specific CVG data
void SetPropertyToObject(a2dObject *obj, const basetype &value, SetFlags setflags=set_none) const
Set the property in obj to value.
bool DoIsHitWorld(a2dIterC &ic, a2dHitEvent &hitEvent)
Does hit test on the object (exclusif child objects)
a2dHit & GetHow()
in what manner the a2dCanvasObject was hit.
a2dCanvasXYDisplayGroupAreas * GetGroup(void)
the group of which the area is a part
a2dDrawer2D * GetDrawer2D() const
get current a2dDrawer2D
#define wxStaticCast(obj, className)
The wxWindows 2.4.2 wxStaticCast is buggy. It evaluates its argument twice.
bool m_editable
object can be edited
void DoRender(a2dIterC &ic, OVERLAP clipparent)
render derived object
bool m_markerUpLow
return of GetXyAtSweep() is upper side of curve if true, else low
Normal straight line segment in a2dVertexList and a2dVertexArray.
void SetSpecificFlags(bool setOrClear, a2dCanvasObjectFlagsMask which)
set all bit flags in object that or true in mask to true or false
#define EVT_CANVASOBJECT_MOUSE_EVENT(func)
static event table macro for a2dCanvasObject mouse event
used to move points in VertexCurve objects
bool DoStartEdit(wxUint16 editmode, wxEditStyle editstyle)
only used for editable objects and under control of a editing tool.
virtual void DoSave(wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts, a2dObjectList *towrite)
write object specific CVGL data
used to move points in VertexCurve objects
virtual void DoSave(wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts, a2dObjectList *towrite)
write object specific CVGL data
general event sent from a2dHandle to its parent a2dCanvasObject
bool m_childrenOnSameLayer
void DoLoad(wxObject *parent, a2dIOHandlerXmlSerIn &parser, a2dXmlSer_flag xmlparts)
load object specific CVG data
virtual void DrawLine(double x1, double y1, double x2, double y2)
Draw line in world coordinates.
Input and output handler for the XmlSer format.
static const a2dCanvasObjectFlagsMask EditingCopy
virtual bool GetXyAtSweep(double sweepValue, a2dPoint2D &point) const
return Points in plot at the value of sweep parameter.
virtual void DoSave(wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts, a2dObjectList *towrite)
write object specific CVGL data
a2dHandle * GetCanvasHandle()
return the handle object hit
void GetPosXYPointWorld(int index, double &sweep, double &y, bool upper, bool transform)
get point x and y at index in world coordinates
virtual void DoSave(wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts, a2dObjectList *towrite)
write object specific CVGL data
void WriteEndAttributes(bool close=false)
"Closes" the start tag after writing all attributes (writes the ">" or "/>" bracket).
Each a2dCommand is given a command id at construction.
void RemovePointWorld(double &sweep, double &y, bool upper, int index=-1, bool transformed=true)
removes point at index
virtual bool Submit(a2dCommand *command, bool storeIt=true)
next to the base class submit, it sets a2DocumentCommandProcessor for a2dCommand
bool DoStartEdit(wxUint16 editmode, wxEditStyle editstyle)
only used for editable objects and under control of a editing tool.
bool Do(void)
Override this to perform a command.
virtual bool DoStartEdit(wxUint16 editmode, wxEditStyle editstyle)
only used for editable objects and under control of a editing tool.
A 2x3 affine matrix class for 2D transformations.
void RemovePoint(double &sweep, double &y, bool upper, int index=-1)
removes point at index
wxMouseEvent & GetMouseEvent()
return the original mouse event that was redirected to the a2dCanvasObject
a2dStroke GetDrawerStroke() const
get the current stroke
void DoRender(a2dIterC &ic, OVERLAP clipparent)
render derived object
double GetAttributeValueDouble(const wxString &attrib, double defaultv=0)
Returns the double value of an attribute.
double GetMaxX() const
get maximum X of the boundingbox
void DoRender(a2dIterC &ic, OVERLAP clipparent)
render derived object
const a2dAffineMatrix & GetInverseParentTransform() const
inverse of GetParentTransform()
void SetPosXYPoint(int index, double x, double y)
modify point at index to x,y
double GetWorldStrokeExtend()
void SetPosXYPoint(int index, double x, double y, bool afterinversion=true)
modify point at index to x,y
virtual a2dLineSegment * Clone()
create exact copy
bool DoIsHitWorld(a2dIterC &ic, a2dHitEvent &hitEvent)
Does hit test on the object (exclusif child objects)
void RemovePointWorld(double &x, double &y, int index=-1, bool transformed=true)
removes point at index
while iterating a a2dCanvasDocument, this holds the context.
Curve represented by a number of vertexes.
void RemovePoint(double &x, double &y, int index=-1, bool transformed=true)
removes point at index
void DoLoad(wxObject *parent, a2dIOHandlerXmlSerIn &parser, a2dXmlSer_flag xmlparts)
load object specific CVG data
a2dCanvasBandCurveHandle()
constructor
virtual a2dObject * DoClone(CloneOptions options, a2dRefMap *refs) const
This is here so that this class cannot be used directly.
double m_x
x endpoint of line
void DoRender(a2dIterC &ic, OVERLAP clipparent)
render derived object
a2dBoundingBox m_clipdata
defines boundaries in which the curve will be calculated / displayed
double m_x
(world coordinates) hit point x as in a2dDrawingPart or any other top level
double wxSqr(double x)
good replacement for pow(x,2)
All updates of these modes force an update (e.g. update non-pending valid bounding boxes) ...
void MapBbox(const a2dAffineMatrix &matrix)
a2dCommandProcessor * GetCommandProcessor() const
Returns a pointer to the command processor associated with this document.
#define EVT_CANVASOBJECT_LEAVE_EVENT(func)
static event table macro for a2dCanvasObject mouse leave event
double m_y
y endpoint of line
void AddPoint(double sweep, const a2dPoint2D &P)
Append a new point in curve coordinates.
static a2dHit stock_strokeoutside
Stock object for an outer stroke hit on objects without vertices/edges (like circles) ...
bool DoUpdate(UpdateMode mode, const a2dBoundingBox &childbox, const a2dBoundingBox &clipbox, const a2dBoundingBox &propbox)
Update derived Object specific things ( mainly boundingbox)
void GetPosXYPointWorld(int index, double &x, double &y, bool transform)
get point x and y at index in world coordinates
std::list< T, std::allocator< T > >::iterator GetNextAround(typename std::list< T, std::allocator< T > >::iterator iter)
get the next node ( begin() if no next )
void GetPosXYPoint(int index, double &x, double &y)
get point x and y at index
bool GetRelease() const
get release flag
editing tool for a2dCanvasObject's
a2dCurvesArea * m_curvesArea
parent of curve
a2dBoundingBox GetPlotAreaBbox() const
return plotting rectangle in world coordinates
a2dBoundingBox m_curveBox
defines boundaries in which the curve has points
double GetMaxY() const
get maximum Y of the boundingbox
double GetWidth() const
returns width of the boundingbox
bool PointOnCurve(const a2dPoint2D &P, double marge)
test if a point is on the curve.
void Require(const XMLeventType &type, wxString name)
Forces a special tag.
virtual void DoSave(wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts, a2dObjectList *towrite)
write object specific CVGL data
a2dBoundingBox DoGetUnTransformedBbox(a2dBboxFlags flags=a2dCANOBJ_BBOX_NON) const
In derived object this should be overriden to calculate the boundingbox of the object without its chi...
wxString GetTagName()
Returns name of the current XML tag.
bool m_arcMid
handle for middle point of arc
void SetPosXY(double x, double y, bool restrict=false)
set position to x,y
virtual wxDC * GetRenderDC() const
get the DC that is used for rendering
bool PointOnCurve(const a2dPoint2D &P, double marge)
test if a point is on the curve.
bool m_editingCopy
true if the object needs to be rendered in edit mode.
virtual bool EliminateMatrix()
reduce matrix to identity
virtual void DoSave(wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts, a2dObjectList *towrite)
write object specific CVGL data
a2dFill GetDrawerFill() const
get the current fill
a2dBoundingBox DoGetUnTransformedBbox(a2dBboxFlags flags=a2dCANOBJ_BBOX_NON) const
In derived object this should be overriden to calculate the boundingbox of the object without its chi...
void GetPosXYPoint(int index, double &x, double &y, bool transform=true)
get point x and y at index
a2dLineSegmentPtr Item(size_t index) const
Returns the point pointer at the given position in the array.
const a2dBoundingBox & GetInternalBoundaries() const
get the plotting rectangle in curve coordinates
Curve represented by a number of vertexes.
The a2dBoundingBox class stores one a2dBoundingBox of a a2dCanvasObject.
bool Invert(void)
Invert matrix.
bool DoStartEdit(wxUint16 editmode, wxEditStyle editstyle)
only used for editable objects and under control of a editing tool.
void AddPoint(const a2dPoint2D &P, int index=-1)
Append a new point in curve coordinates.
a2dVertexList * GetPoints()
return the array of points.
virtual a2dBoundingBox DoGetUnTransformedBbox(a2dBboxFlags flags=a2dCANOBJ_BBOX_NON) const
In derived object this should be overriden to calculate the boundingbox of the object without its chi...
void Modify(bool increment)
set the drawing as modified or not
a2dSweepPoint * Item(size_t index) const
static a2dHit stock_fill
Stock object for a fill hit.
virtual void DoSave(wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts, a2dObjectList *towrite)
write object specific CVGL data
virtual bool WalkTask(wxObject *parent, wxObject *object, a2dWalkEvent event)
called from within a2dObject's and derived classes
double GetMinY() const
get minimum Y of the boundingbox
void RemovePointWorld(double &x, double &y, int index=-1, bool transformed=true)
removes point at index
the a2dDrawingPart is a a2dView specially designed for displaying parts of a a2dDrawing. It uses a a2dDrawer2D to actually redraw things from the document, by giving that a2dDrawer2D as drawing context to the document, and telling the document to redraw a certain rectangular area. At that last is what this class is for. It optimizes the areas to be redrawn after object in the document were changed. To do that it combines redraw areas to a minimal set of redrawing areas. All the administration for this and the way things will be redrawn is from this view.
basetype GetPropertyValue(const a2dObject *obj) const
Get the property value in obj.
A2DGENERALDLLEXP a2dWalkEvent a2dWalker_a2dDerivedCanvasObjectEnd
id for a2dWalkEvent issued from within a2dWalkerIOHandler
a2dCanvasGlobal * a2dCanvasGlobals
global a2dCanvasGlobal to have easy access to global settings
virtual void DrawCircle(double x, double y, double radius)
Draw Circle in world coordinates.
bool Undo(void)
Override this to undo a command.
a2dDrawingPart * GetDrawingPart() const
get current a2dDrawingPart
This template class is for property ids with a known data type.
virtual a2dObject * DoClone(CloneOptions options, a2dRefMap *refs) const
This is here so that this class cannot be used directly.
a2dBoundingBox m_bbox
boundingbox in world coordinates
double RequireAttributeValueDouble(const wxString &attrib)
Forces an attribute and returns its double value.
virtual a2dObject * DoClone(CloneOptions options, a2dRefMap *refs) const
This is here so that this class cannot be used directly.
void Append(a2dCanvasObject *obj)
append a a2dCanvasObject to the childobjects
bool EliminateMatrix()
reduce matrix to identity without replacing object
Curve represented by a number of vertexes in a List.
const a2dAffineMatrix & GetTransform() const
Get the accumulated transform up to and including m_lworld of the current object. ...
virtual void SetLayer(wxUint16 layer)
set layer index where this object is drawn upon.
void GetPosXYPoint(int index, double &x, double &y)
get point x and y at index
double m_rely
(world coordinates) hit point y relative to the canvas object its parent object(s) ...
double m_y
(world coordinates) hit point y as in a2dDrawingPart or any other top level
virtual bool GetXyAtSweep(double sweepValue, a2dPoint2D &point) const
calculate Y at X
bool DoIsHitWorld(a2dIterC &ic, a2dHitEvent &hitEvent)
Does hit test on the object (exclusif child objects)
CloneOptions
options for cloning
~a2dCurveObject()
destructor
const a2dAffineMatrix & GetUserToDeviceTransform() const
get matrix which transforms directly from user coordinates to device
void SetCorridorPath(bool OnOff, a2dCanvasObject *captureObject=NULL)
to set corridor path ( also to captured object), its a2dCanvasOFlags::IsOnCorridorPath flag is set on...
void GetPosXYPoint(int index, double &sweep, double &y, bool upper)
get point x and y at index
bool EliminateMatrix()
reduce matrix to identity without replacing object
bool Do(void)
Override this to perform a command.
a2dBoundingBox & GetBbox()
get boundingbox in world coordinates exclusive stroke width relative to its parent ...
structure to give as parameter to member functions of a2dCanvasObject
const double wxPI
defines PI
virtual void PushIdentityTransform()
push no transform, to draw directly in device coordinates
void DoWalker(wxObject *parent, a2dWalkerIOHandler &handler)
iterate over this object and its children
virtual void DoWalker(wxObject *parent, a2dWalkerIOHandler &handler)
iterate over this object and its children
bool Do(void)
Override this to perform a command.
virtual void DoSave(wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts, a2dObjectList *towrite)
write object specific CVGL data
const a2dFill * a2dTRANSPARENT_FILL
global a2dFill stock object for TRANSPARENT filling
static const a2dCanvasObjectFlagsMask PRERENDERASCHILD
general canvas module declarations and classes
void WriteStartElement(const wxString &name, bool newLine=true)
Writes start tag which has no attributes.
old a complex point at a sweep value
a base command for the a2dCommandProcessor