21 #include <wx/wfstream.h>
22 #include <wx/module.h>
23 #include <wx/clipbrd.h>
33 #if defined(__WXMSW__) && defined(__MEMDEBUG__)
34 #include <wx/msw/msvcrt.h>
38 #define CIRCLE_STEPS 128
48 IMPLEMENT_DYNAMIC_CLASS(
a2dEllipse, a2dWHCenter )
62 a2dOrigin::a2dOrigin()
76 a2dOrigin::~a2dOrigin()
89 return new a2dOrigin( *
this, options, refs );
115 #if wxART2D_USE_CVGIO
119 if ( xmlparts == a2dXmlSer_attrib )
126 #endif //wxART2D_USE_CVGIO
152 a2dArrow::~a2dArrow()
165 void a2dArrow::Set(
double xt,
double yt,
double l1,
double l2,
double b,
bool spline )
194 returnIsPolygon =
true;
195 returnIsPolygon =
true;
204 for ( i = 0; i < segments->size(); i++ )
208 pointlist->push_back( point );
227 segments->
Add( seg );
230 segments->
Add( seg );
233 segments->
Add( seg );
236 segments->
Add( seg );
240 canpath->
SetFill( this->GetFill() );
244 canpathlist->push_back( canpath );
285 #if wxART2D_USE_CVGIO
289 if ( xmlparts == a2dXmlSer_attrib )
291 out.WriteAttribute( wxT(
"l1" ),
m_l1 * out.
GetScale() );
292 out.WriteAttribute( wxT(
"l2" ),
m_l2 * out.
GetScale() );
293 out.WriteAttribute( wxT(
"b" ),
m_b * out.
GetScale() );
294 out.WriteAttribute( wxT(
"spline" ),
m_spline );
304 if ( xmlparts == a2dXmlSer_attrib )
315 #endif //wxART2D_USE_CVGIO
329 AddPropertyId( PROPID_Width );
332 AddPropertyId( PROPID_Height );
335 AddPropertyId( PROPID_Radius );
371 void a2dRectC::Set(
double xc,
double yc,
double w,
double h,
double angle ,
double radius )
384 return new a2dRectC( *
this, options, refs );
389 returnIsPolygon =
true;
397 for ( i = 0; i < segments->size(); i++ )
401 pointlist->push_back( point );
416 double w2 = fabs(
m_width / 2 );
433 segments->push_back( seg );
436 segments->push_back( seg );
438 segments->push_back( seg );
441 segments->push_back( seg );
443 segments->push_back( seg );
446 segments->push_back( seg );
448 segments->push_back( seg );
451 segments->push_back( seg );
469 segments->push_back( seg );
472 segments->push_back( seg );
474 segments->push_back( seg );
477 segments->push_back( seg );
479 segments->push_back( seg );
482 segments->push_back( seg );
484 segments->push_back( seg );
487 segments->push_back( seg );
500 segments->push_back( seg );
503 segments->push_back( seg );
506 segments->push_back( seg );
509 segments->push_back( seg );
514 canpath->
SetFill( this->GetFill() );
518 canpathlist->push_back( canpath );
550 double xmax = fabs(
m_width / 2 );
568 #if wxART2D_USE_CVGIO
572 if ( xmlparts == a2dXmlSer_attrib )
578 out.WriteAttribute( wxT(
"radius" ),
m_radius );
585 #endif //wxART2D_USE_CVGIO
599 AddPropertyId( PROPID_Width );
602 AddPropertyId( PROPID_Height );
649 canpath->
SetFill( this->GetFill() );
655 segments->push_back( seg );
658 segments->push_back( seg );
661 segments->push_back( seg );
664 segments->push_back( seg );
667 canpathlist->push_back( canpath );
692 #if wxART2D_USE_CVGIO
697 if ( xmlparts == a2dXmlSer_attrib )
710 if ( xmlparts == a2dXmlSer_attrib )
719 #endif //wxART2D_USE_CVGIO
725 double xmin = wxMin( 0 ,
m_width );
726 double ymin = wxMin( 0 ,
m_height );
727 double xmax = wxMax( 0 ,
m_width );
728 double ymax = wxMax( 0 ,
m_height );
752 a2dHandle* draghandle =
event.GetCanvasHandle();
773 double xmin, ymin, xmax, ymax, w, h;
774 xmin = untrans.GetMinX();
775 ymin = untrans.GetMinY();
776 xmax = untrans.GetMaxX();
777 ymax = untrans.GetMaxY();
778 w = untrans.GetWidth();
779 h = untrans.GetHeight();
782 double x1, y1, x2, y2;
793 if ( restrictEngine )
797 if ( draghandle->
GetName() == wxT(
"handle1" ) )
807 sx = ( w - dx / 2 ) / w;
811 sy = ( h - dy / 2 ) / h;
824 else if ( draghandle->
GetName() == wxT(
"handle2" ) )
834 sx = ( w - dx / 2 ) / w;
838 sy = ( h + dy / 2 ) / h;
851 else if ( draghandle->
GetName() == wxT(
"handle3" ) )
862 sx = ( w + dx / 2 ) / w;
866 sy = ( h + dy / 2 ) / h;
879 else if ( draghandle->
GetName() == wxT(
"handle4" ) )
890 sx = ( w + dx / 2 ) / w;
894 sy = ( h - dy / 2 ) / h;
907 else if ( draghandle->
GetName() == wxT(
"rotate" ) )
930 else if ( draghandle->
GetName() == wxT(
"skewx" ) )
935 dx = xwi - ( xmin + w * 3 / 4 );
936 dy = ywi - ( ymin + h / 2 );
947 else if ( draghandle->
GetName() == wxT(
"skewy" ) )
952 dx = xwi - ( xmin + w / 2 );
953 dy = ywi - ( ymin + h * 3 / 4 );
964 else if ( draghandle->
GetName() == wxT(
"handle12" ) )
973 sx = ( w - dx / 2 ) / w;
986 else if ( draghandle->
GetName() == wxT(
"handle23" ) )
995 sy = ( h + dy / 2 ) / h;
1008 else if ( draghandle->
GetName() == wxT(
"handle34" ) )
1017 sx = ( w + dx / 2 ) / w;
1030 else if ( draghandle->
GetName() == wxT(
"handle41" ) )
1039 sy = ( h - dy / 2 ) / h;
1096 AddPropertyId( PROPID_Width );
1099 AddPropertyId( PROPID_Height );
1113 :
a2dWH( xc, yc, w, h )
1118 :
a2dWH( other, options, refs )
1136 AddPropertyId( PROPID_Radius );
1152 a2dRect::a2dRect(
double x,
double y,
double w,
double h ,
double radius,
double contourwidth )
1153 :
a2dWH( x, y, w, h )
1160 :
a2dWH( p1.m_x, p1.m_y, p2.m_x - p1.m_x, p2.m_y - p1.m_y )
1167 :
a2dWH( bbox.GetMinX(), bbox.GetMinY(), bbox.GetWidth(), bbox.GetHeight() )
1177 a2dRect::a2dRect(
const a2dRect& other, CloneOptions options,
a2dRefMap* refs )
1178 :
a2dWH( other, options, refs )
1186 return new a2dRect( *
this, options, refs );
1191 returnIsPolygon =
true;
1199 for ( i = 0; i < segments->size(); i++ )
1203 pointlist->push_back( point );
1219 canpath->
SetStroke( this->GetStroke() );
1220 canpath->
SetFill( this->GetFill() );
1237 segments->push_back( seg );
1240 segments->push_back( seg );
1242 segments->push_back( seg );
1245 segments->push_back( seg );
1247 segments->push_back( seg );
1250 segments->push_back( seg );
1252 segments->push_back( seg );
1255 segments->push_back( seg );
1270 segments->push_back( seg );
1273 segments->push_back( seg );
1275 segments->push_back( seg );
1278 segments->push_back( seg );
1280 segments->push_back( seg );
1283 segments->push_back( seg );
1285 segments->push_back( seg );
1288 segments->push_back( seg );
1303 segments->push_back( seg );
1306 segments->push_back( seg );
1309 segments->push_back( seg );
1312 segments->push_back( seg );
1315 segments->push_back( seg );
1318 segments->push_back( seg );
1321 segments->push_back( seg );
1324 segments->push_back( seg );
1327 segments->push_back( seg );
1330 segments->push_back( seg );
1333 segments->push_back( seg );
1340 segments->push_back( seg );
1343 segments->push_back( seg );
1346 segments->push_back( seg );
1349 segments->push_back( seg );
1354 canpathlist->push_back( canpath );
1363 if ( editmode == 1 )
1403 Append( handle =
new a2dHandle(
this, x + w, y + h , wxT(
"handle3" ) ) );
1407 Append( handle =
new a2dHandle(
this, x, y + h / 2 , wxT(
"handle12" ) ) );
1409 Append( handle =
new a2dHandle(
this, x + w / 2, y + h, wxT(
"handle23" ) ) );
1411 Append( handle =
new a2dHandle(
this, x + w, y + h / 2 , wxT(
"handle34" ) ) );
1413 Append( handle =
new a2dHandle(
this, x + w / 2, y, wxT(
"handle41" ) ) );
1418 a2dSLine* rotline =
new a2dSLine( x + w / 2, y + h / 2, x + w * 3 / 4, y + h / 2 );
1426 Append( handle =
new a2dHandle(
this, x + w * 3 / 4, y + h / 2, wxT(
"rotate" ) ) );
1431 Append( handle =
new a2dHandle(
this, x + w * 3 / 4, y + h, wxT(
"skewx" ) ) );
1433 Append( handle =
new a2dHandle(
this, x + w, y + h * 3 / 4, wxT(
"skewy" ) ) );
1466 a2dHandle* draghandle =
event.GetCanvasHandle();
1470 if ( editmode == 1 )
1489 double xmin, ymin, xmax, ymax, w, h;
1503 if ( draghandle->
GetName() == wxT(
"__rounding__" ) )
1512 if ( draghandle->
GetName() == wxT(
"__rounding__" ) )
1518 if ( fabs( xwi ) < fabs(
m_width / 2 ) && fabs( xwi ) < fabs(
m_height / 2 ) )
1594 #if wxART2D_USE_CVGIO
1599 if ( xmlparts == a2dXmlSer_attrib )
1615 if ( xmlparts == a2dXmlSer_attrib )
1624 #endif //wxART2D_USE_CVGIO
1630 double xmin = wxMin( 0 ,
m_width );
1631 double ymin = wxMin( 0 ,
m_height );
1632 double xmax = wxMax( 0 ,
m_width );
1633 double ymax = wxMax( 0 ,
m_height );
1651 if (
GetGeneratePins() && ( toCreate = toConnectTo->GetPinClassForTask( task,
this ) ) )
1704 AddPropertyId( PROPID_Radius );
1709 a2dCircle::a2dCircle()
1716 a2dCircle::a2dCircle(
double x,
double y,
double radius,
double width )
1728 a2dCircle::a2dCircle(
const a2dCircle& other, CloneOptions options,
a2dRefMap* refs )
1737 return new a2dCircle( *
this, options, refs );
1742 returnIsPolygon =
true;
1750 for ( i = 0; i < segments->size(); i++ )
1754 pointlist->push_back( point );
1774 segments->push_back( seg );
1776 segments->push_back( seg );
1778 segments->push_back( seg );
1781 segments->push_back( seg );
1784 segments->push_back( seg );
1786 segments->push_back( seg );
1789 segments->push_back( seg );
1794 segments->push_back( seg );
1796 segments->push_back( seg );
1798 segments->push_back( seg );
1803 canpath->
SetStroke( this->GetStroke() );
1804 canpath->
SetFill( this->GetFill() );
1808 canpathlist->push_back( canpath );
1873 #if wxART2D_USE_CVGIO
1877 if ( xmlparts == a2dXmlSer_attrib )
1890 if ( xmlparts == a2dXmlSer_attrib )
1899 #endif //wxART2D_USE_CVGIO
1987 if (
GetGeneratePins() && ( toCreate = toConnectTo->GetPinClassForTask( task,
this ) ) )
2026 a2dEllipse::a2dEllipse()
2032 a2dEllipse::a2dEllipse(
double xc,
double yc,
double width,
double height,
double contourwidth )
2035 m_contourwidth = contourwidth;
2038 a2dEllipse::~a2dEllipse()
2045 m_contourwidth = other.m_contourwidth;
2050 return new a2dEllipse( *
this, options, refs );
2055 returnIsPolygon =
true;
2063 for ( i = 0; i < segments->size(); i++ )
2067 pointlist->push_back( point );
2085 double dphi =
wxPI * 2.0 / CIRCLE_STEPS;
2091 for ( i = 0; i < CIRCLE_STEPS; i++ )
2097 else if ( i == CIRCLE_STEPS - 1 )
2101 segments->push_back( seg );
2105 canpath->
SetStroke( this->GetStroke() );
2106 canpath->
SetFill( this->GetFill() );
2111 canpathlist->push_back( canpath );
2124 if ( m_contourwidth > 0 )
2125 bbox.
Enlarge( m_contourwidth / 2 );
2137 double width =
m_width + m_contourwidth / 2;
2138 double height =
m_height + m_contourwidth / 2;
2176 #if wxART2D_USE_CVGIO
2180 if ( xmlparts == a2dXmlSer_attrib )
2182 out.WriteAttribute( wxT(
"contourwidth" ), m_contourwidth * out.
GetScale() );
2192 if ( xmlparts == a2dXmlSer_attrib )
2200 #endif //wxART2D_USE_CVGIO
2204 double xh = hitEvent.
m_relx;
2205 double yh = hitEvent.
m_rely;
2210 double a = 0.5 *
m_width + pw + margin ;
2211 double b = 0.5 *
m_height + pw + margin;
2212 double c =
wxSqr( xh / a ) +
wxSqr( yh / b );
2215 a = 0.5 *
m_width - pw - margin ;
2262 if (
GetGeneratePins() && ( toCreate = toConnectTo->GetPinClassForTask( task,
this ) ) )
2310 AddPropertyId( PROPID_StartAngle );
2313 AddPropertyId( PROPID_EndAngle );
2316 AddPropertyId( PROPID_Chord );
2370 returnIsPolygon =
true;
2378 for ( i = 0; i < segments->size(); i++ )
2382 pointlist->push_back( point );
2406 if ( end <= 0 ) end += 2.0 *
wxPI;
2408 if ( start < 0 ) start += 2.0 *
wxPI;
2412 double dphi =
wxPI * 2.0 / CIRCLE_STEPS;
2413 int steps = ( int )( ( end - start ) / dphi );
2416 dphi = ( end - start ) / steps;
2420 double theta = start;
2423 for ( i = 0; i < steps + 1; i++ )
2430 segments->push_back( seg );
2431 theta = theta + dphi;
2438 segments->push_back( seg );
2442 canpath->
SetStroke( this->GetStroke() );
2443 canpath->
SetFill( this->GetFill() );
2448 canpathlist->push_back( canpath );
2469 if (
InArc( 0, start, end,
false ) )
2471 if (
InArc(
wxPI / 2, start, end,
false ) )
2475 if (
InArc( 1.5 *
wxPI, start, end,
false ) )
2525 if (
InArc( alphax, start, end,
false ) )
2531 if (
InArc( alphax, start, end,
false ) )
2537 if (
InArc( alphax, start, end,
false ) )
2542 if (
InArc( alphay, start, end,
false ) )
2548 if (
InArc( alphay, start, end,
false ) )
2554 if (
InArc( alphay, start, end,
false ) )
2597 #if wxART2D_USE_CVGIO
2601 if ( xmlparts == a2dXmlSer_attrib )
2603 out.WriteAttribute( wxT(
"start" ),
m_start );
2604 out.WriteAttribute( wxT(
"end" ),
m_end );
2605 out.WriteAttribute( wxT(
"chord" ),
m_chord );
2616 if ( xmlparts == a2dXmlSer_attrib )
2627 #endif //wxART2D_USE_CVGIO
2631 double xh = hitEvent.
m_relx;
2632 double yh = hitEvent.
m_rely;
2649 double a =
m_width / 2 + pw + margin ;
2650 double b =
m_height / 2 + pw + margin;
2651 double c =
wxSqr( xh / a ) +
wxSqr( yh / b );
2657 double start, end, angle;
2665 rx = sqrt( dx * dx + ( dy * dy ) / ( c * c ) );
2668 if ( dx* ry == 0 && dy* rx == 0 )
2671 angle = atan2( dy * rx, dx * ry );
2673 angle = angle - start;
2676 if ( angle <= 0 ) angle += 2.0 *
wxPI;
2678 if ( end <= 0 ) end += 2.0 *
wxPI;
2679 if ( start < 0 ) start += 2.0 *
wxPI;
2682 angle = angle + start;
2685 if ( angle > start && angle < end )
2702 if ( editmode == 1 )
2707 double xs, ys, xe, ye ;
2718 Append( handle =
new a2dHandle(
this, xs * 3 / 4, ys * 3 / 4 , wxT(
"startangle" ) ) );
2720 Append( handle =
new a2dHandle(
this, xe * 3 / 4, ye * 3 / 4 , wxT(
"endangle" ) ) );
2732 void a2dEllipticArc::OnChar( wxKeyEvent& event )
2736 switch( event.GetKeyCode() )
2744 if ( ( *editmode ) > 1 ) ( *editmode ) = 0;
2765 a2dHandle* draghandle =
event.GetCanvasHandle();
2782 if ( draghandle->
GetName() == wxT(
"startangle" ) )
2787 else if ( draghandle->
GetName() == wxT(
"endangle" ) )
2797 double xs, ys, xe, ye, rx, ry;
2799 if ( draghandle->
GetName() == wxT(
"startangle" ) )
2808 rx = sqrt( xs * xs + ( ys * ys ) / ( c * c ) );
2827 draghandle->
SetPosXY( xs * 3 / 4, ys * 3 / 4 );
2830 else if ( draghandle->
GetName() == wxT(
"endangle" ) )
2839 rx = sqrt( xe * xe + ( ye * ye ) / ( c * c ) );
2857 draghandle->
SetPosXY( xe * 3 / 4, ye * 3 / 4 );
2888 AddPropertyId( PROPID_X1 );
2891 AddPropertyId( PROPID_X2 );
2894 AddPropertyId( PROPID_Y1 );
2897 AddPropertyId( PROPID_Y2 );
2902 AddPropertyId( PROPID_StartAngle );
2907 AddPropertyId( PROPID_EndAngle );
2910 AddPropertyId( PROPID_Chord );
2917 EVT_CHAR(
a2dArc::OnChar )
2931 a2dArc::a2dArc(
double xc,
double yc,
double radius,
double start,
double end,
bool chord,
double contourwidth )
2944 a2dArc::a2dArc(
double x1,
double y1,
double x2,
double y2,
double xc,
double yc,
bool chord,
double contourwidth )
2949 double dx = x1 - xc;
2950 double dy = y1 - yc;
2951 double radius = sqrt( dx * dx + dy * dy );
2959 double end = atan2( dy, dx );
2961 m_x2 = radius * cos ( end ) ;
2962 m_y2 = radius * sin ( end ) ;
2982 start = atan2( dy, dx );
2984 m_x1 = radius * cos ( start ) ;
2985 m_y1 = radius * sin ( start ) ;
2995 end = atan2( dy, dx );
2997 m_x2 = radius * cos ( end ) ;
2998 m_y2 = radius * sin ( end ) ;
3012 void a2dArc::Set(
double xs,
double ys,
double xm,
double ym,
double xe,
double ye )
3015 double center_x, center_y;
3016 double beginrad, midrad, endrad, phit;
3018 double ax, ay, bx, by, cx, cy;
3019 double ax2, ay2, bx2, by2, cx2, cy2;
3021 bool straight =
false;
3023 ax = xs; ay = ys; ax2 = pow( ax, 2 ); ay2 = pow( ay, 2 );
3024 bx = xm; by = ym; bx2 = pow( bx, 2 ); by2 = pow( by, 2 );
3025 cx = xe; cy = ye; cx2 = pow( cx, 2 ); cy2 = pow( cy, 2 );
3027 if ( ax == cx && ay == cy )
3030 center_x = ( bx + ax ) / 2.0;
3031 center_y = ( by + ay ) / 2.0;
3032 radius = sqrt( pow( bx - ax, 2 ) + pow( by - ay, 2 ) ) / 2.0;
3036 d = 2 * ( ay * cx + by * ax - by * cx - ay * bx - cy * ax + cy * bx );
3044 center_x = ( by * ax2 - cy * ax2 - by2 * ay + cy2 * ay + bx2 * cy + ay2 * by
3045 + cx2 * ay - cy2 * by - cx2 * by - bx2 * ay + by2 * cy - ay2 * cy
3048 center_y = ( ax2 * cx + ay2 * cx + bx2 * ax - bx2 * cx + by2 * ax - by2 * cx
3049 - ax2 * bx - ay2 * bx - cx2 * ax + cx2 * bx - cy2 * ax + cy2 * bx
3052 radius = sqrt( pow( ax - center_x, 2 ) + pow( ay - center_y, 2 ) );
3058 beginrad = atan2( ys - center_y, xs - center_x );
3059 midrad = atan2( ym - center_y, xm - center_x );
3060 endrad = atan2( ye - center_y, xe - center_x );
3068 mr = midrad - beginrad;
3069 er = endrad - beginrad;
3072 if ( mr <= 0 ) mr += 2.0 * M_PI;
3073 if ( er <= 0 ) er += 2.0 * M_PI;
3081 counterclock =
true;
3085 phit = -( 2.0 * M_PI - er );
3086 counterclock =
false;
3091 m_x1 = xs - center_x;
3092 m_y1 = ys - center_y;
3093 m_x2 = xe - center_x;
3094 m_y2 = ye - center_y;
3098 m_x2 = xs - center_x;
3099 m_y2 = ys - center_y;
3100 m_x1 = xe - center_x;
3101 m_y1 = ye - center_y;
3126 return new a2dArc( *
this, options, refs );
3154 m_x1 = radius * cos ( a ) ;
3155 m_y1 = radius * sin ( a ) ;
3161 m_x2 = radius * cos ( a ) ;
3162 m_y2 = radius * sin ( a ) ;
3172 double radius = sqrt( dx * dx + dy * dy );
3177 start = atan2( dy, dx );
3187 end = atan2( dy, dx );
3190 if ( end <= 0 ) end += 2.0 *
wxPI;
3192 if ( start < 0 ) start += 2.0 *
wxPI;
3196 return a2dPoint2D( radius * cos( ( end - start ) / 2 ), radius * sin( ( end - start ) / 2 ) );
3202 returnIsPolygon =
true;
3210 for ( i = 0; i < segments->size(); i++ )
3214 pointlist->push_back( point );
3239 double radius = sqrt( dx * dx + dy * dy );
3244 start = atan2( dy, dx );
3254 end = atan2( dy, dx );
3257 if ( end <= 0 ) end += 2.0 *
wxPI;
3259 if ( start < 0 ) start += 2.0 *
wxPI;
3263 double dphi =
wxPI * 2.0 / CIRCLE_STEPS;
3264 int steps = ( int ) ( ( end - start ) / dphi );
3267 dphi = ( end - start ) / steps;
3269 double theta = start;
3275 for ( i = 0; i < steps + 1; i++ )
3277 pworld.
TransformPoint( radius * cos ( theta ), radius * sin ( theta ), x, y );
3282 segments->push_back( seg );
3283 theta = theta + dphi;
3293 segments->push_back( seg );
3297 canpath->
SetStroke( this->GetStroke() );
3298 canpath->
SetFill( this->GetFill() );
3303 canpathlist->push_back( canpath );
3316 double radius = sqrt( dx * dx + dy * dy );
3329 start = atan2( dy, dx );
3337 end = atan2( dy, dx );
3340 if ( end <= 0 ) end += 2.0 *
wxPI;
3347 bbox.
Expand( radius * cos ( start ), radius * sin ( start ) );
3349 bbox.
Expand( radius * cos ( end ), radius * sin ( end ) );
3352 if (
InArc( 0, start, end,
false ) )
3353 bbox.
Expand( radius, 0 );
3354 if (
InArc(
wxPI / 2, start, end,
false ) )
3355 bbox.
Expand( 0, radius );
3357 bbox.
Expand( -radius, 0 );
3358 if (
InArc( 1.5 *
wxPI, start, end,
false ) )
3359 bbox.
Expand( 0, -radius );
3384 double radius = sqrt( dx * dx + dy * dy );
3397 start = atan2( dy, dx );
3405 end = atan2( dy, dx );
3412 if ( end <= start ) end += 2.0 *
wxPI;
3413 if ( alphax <= start ) alphax +=
wxPI;
3414 if ( alphay <= start ) alphay +=
wxPI;
3415 if ( alphax >= end ) alphax -=
wxPI;
3416 if ( alphay >= end ) alphay -=
wxPI;
3426 if (
InArc( alphax, start, end,
false ) )
3432 if (
InArc( alphax, start, end,
false ) )
3438 if (
InArc( alphax, start, end,
false ) )
3443 if (
InArc( alphay, start, end,
false ) )
3449 if (
InArc( alphay, start, end,
false ) )
3455 if (
InArc( alphay, start, end,
false ) )
3497 #if wxART2D_USE_CVGIO
3501 if ( xmlparts == a2dXmlSer_attrib )
3503 out.WriteAttribute( wxT(
"x1" ),
m_x1 * out.
GetScale() );
3504 out.WriteAttribute( wxT(
"y1" ),
m_y1 * out.
GetScale() );
3505 out.WriteAttribute( wxT(
"x2" ),
m_x2 * out.
GetScale() );
3506 out.WriteAttribute( wxT(
"y2" ),
m_y2 * out.
GetScale() );
3517 if ( xmlparts == a2dXmlSer_attrib )
3529 #endif //wxART2D_USE_CVGIO
3533 double xh = hitEvent.
m_relx;
3534 double yh = hitEvent.
m_rely;
3539 double radius = sqrt( dx * dx + dy * dy );
3542 if ( radius + pw + margin > sqrt( ( xh * xh ) + ( yh * yh ) ) )
3553 angle = atan2( dy, dx );
3563 start = atan2( dy, dx );
3573 end = atan2( dy, dx );
3576 angle = angle - start;
3579 if ( angle <= 0 ) angle += 2.0 *
wxPI;
3580 if ( end <= 0 ) end += 2.0 *
wxPI;
3581 if ( angle >= 2.0 * M_PI ) angle -= 2.0 * M_PI;
3582 if ( end >= 2.0 * M_PI ) end -= 2.0 * M_PI;
3589 if ( radius < sqrt( ( xh * xh ) + ( yh * yh ) ) )
3591 else if ( radius > sqrt( ( xh * xh ) + ( yh * yh ) ) && radius - pw - margin < sqrt( ( xh * xh ) + ( yh * yh ) ) )
3601 if ( radius < sqrt( ( xh * xh ) + ( yh * yh ) ) )
3603 if ( radius > sqrt( ( xh * xh ) + ( yh * yh ) ) && radius - pw - margin < sqrt( ( xh * xh ) + ( yh * yh ) ) )
3625 if ( editmode == 1 )
3649 void a2dArc::OnChar( wxKeyEvent& event )
3653 switch( event.GetKeyCode() )
3661 if ( ( *editmode ) > 1 ) ( *editmode ) = 0;
3682 a2dHandle* draghandle =
event.GetCanvasHandle();
3699 if ( draghandle->
GetName() == wxT(
"startangle" ) )
3701 double start = atan2(
m_y1,
m_x1 );
3704 else if ( draghandle->
GetName() == wxT(
"endangle" ) )
3714 if ( restrictEngine )
3717 if ( draghandle->
GetName() == wxT(
"startangle" ) )
3724 double end = atan2( dy, dx );
3729 double radius = sqrt( dx * dx + dy * dy );
3730 dx = radius * cos ( end );
3731 dy = radius * sin ( end );
3739 else if ( draghandle->
GetName() == wxT(
"endangle" ) )
3746 double end = atan2( dy, dx );
3751 double radius = sqrt( dx * dx + dy * dy );
3752 dx = radius * cos ( end );
3753 dy = radius * sin ( end );
3784 AddPropertyId( PROPID_X1 );
3787 AddPropertyId( PROPID_X2 );
3790 AddPropertyId( PROPID_Y1 );
3793 AddPropertyId( PROPID_Y2 );
3811 m_pathtype = a2dPATH_END_SQAURE;
3814 a2dSLine::a2dSLine(
double x1,
double y1,
double x2,
double y2,
double contourwidth )
3842 return new a2dSLine( *
this, options, refs );
3895 double x1, y1, x2, y2;
3899 return sqrt(
wxSqr( x2 - x1 ) +
wxSqr( y2 - y1 ) );
3904 if ( afterinversion )
3919 if ( afterinversion )
3934 if ( afterinversion )
3961 segments->push_back( seg );
3963 segments->push_back( seg );
3968 canpath->
SetStroke( this->GetStroke() );
3969 canpath->
SetFill( this->GetFill() );
3974 canpathlist->push_back( canpath );
4010 contour.
AddPoint( offsetpoint1left );
4011 contour.
AddPoint( offsetpoint2left );
4012 contour.
AddPoint( offsetpoint2right );
4013 contour.
AddPoint( offsetpoint1right );
4049 #if wxART2D_USE_CVGIO
4053 if ( xmlparts == a2dXmlSer_attrib )
4055 out.WriteAttribute( wxT(
"x1" ),
m_x1 * out.
GetScale() );
4056 out.WriteAttribute( wxT(
"y1" ),
m_y1 * out.
GetScale() );
4057 out.WriteAttribute( wxT(
"x2" ),
m_x2 * out.
GetScale() );
4058 out.WriteAttribute( wxT(
"y2" ),
m_y2 * out.
GetScale() );
4069 if ( xmlparts == a2dXmlSer_attrib )
4081 #endif //wxART2D_USE_CVGIO
4111 if ( editmode == 1 )
4145 void a2dSLine::OnChar( wxKeyEvent& event )
4149 switch( event.GetKeyCode() )
4157 if ( ( *editmode ) > 1 ) ( *editmode ) = 0;
4177 a2dHandle* draghandle =
event.GetCanvasHandle();
4195 if ( draghandle->
GetName() == wxT(
"__startpoint__" ) )
4200 else if ( draghandle->
GetName() == wxT(
"__endpoint__" ) )
4210 if ( draghandle->
GetName() == wxT(
"__startpoint__" ) )
4213 if ( restrictEngine )
4219 else if ( draghandle->
GetName() == wxT(
"__endpoint__" ) )
4222 if ( restrictEngine )
4244 a2dEndsLine::a2dEndsLine()
4247 m_xscale = m_yscale = 1;
4248 m_takeStyleToArrow =
false;
4251 a2dEndsLine::a2dEndsLine(
double x1,
double y1,
double x2,
double y2,
double contourwidth )
4252 :
a2dSLine( x1, y1, x2, y2, contourwidth )
4284 #if defined(_DEBUG) && defined (SMART_POINTER_DEBUG)
4286 CurrentSmartPointerOwner =
this;
4295 a2dEndsLine::~a2dEndsLine()
4452 #if wxART2D_USE_CVGIO
4456 if ( xmlparts == a2dXmlSer_attrib )
4493 if ( xmlparts == a2dXmlSer_attrib )
4498 wxString resolveKey;
4510 if ( parser.
GetTagName() != wxT(
"derived" ) )
4523 #endif //wxART2D_USE_CVGIO
4607 m_xscale = m_yscale = 1;
4608 m_begin =
new a2dArrow( 0, 0, L1, L2, B );
4609 m_end =
new a2dArrow( 0, 0, L1, L2, B );
4612 a2dScaledEndLine::a2dScaledEndLine(
double x1,
double y1,
double x2,
double y2,
double contourwidth )
4698 if ( distance == 0 )
4708 double baseD2B = arrow1->
GetBase() / 2.0;
4709 double l1B = arrow1->
GetL1();
4710 double layBackB = l1B * distance / baseD2B;
4716 double baseD2E = arrow2->
GetBase() / 2.0;
4717 double l1E = arrow2->
GetL1();
4718 double layBackE = l1E * distance / baseD2E;
4733 contour.
AddPoint( offsetpoint1left );
4734 contour.
AddPoint( offsetpoint2left );
4735 contour.
AddPoint( offsetpoint2right );
4736 contour.
AddPoint( offsetpoint1right );
4834 #if defined(_DEBUG) && defined (SMART_POINTER_DEBUG)
4836 CurrentSmartPointerOwner =
this;
4945 #if wxART2D_USE_CVGIO
4949 if ( xmlparts == a2dXmlSer_attrib )
4986 if ( xmlparts == a2dXmlSer_attrib )
5001 if ( parser.
GetTagName() != wxT(
"derived" ) )
5014 #endif //wxART2D_USE_CVGIO
5079 :
a2dRect( x, y, width, height )
5094 :
a2dRect( other, options, refs )
5106 return new a2dControl( *
this, options, refs );
5143 if ( editmode == 1 )
5195 if ( pinname == pinc->
GetName() )
5206 wxASSERT_MSG( done, wxT(
"no such pin to connect to" ) );
5213 wxASSERT_MSG( pinc->
GetParent() == toConnect, wxT(
"this pin has not connect object as parent" ) );
5219 if ( pinother == pinc )
5226 wxASSERT_MSG( done, wxT(
"this pin is not in to connect object" ) );
5238 #if defined(_DEBUG) && defined (SMART_POINTER_DEBUG)
5240 CurrentSmartPointerOwner =
this;
5270 if ( pinname.IsEmpty() )
5296 if ( pinother && pinname == pinother->
GetName() )
5312 wxString nextpin = wxT(
"pin" );
5322 if ( pinname == pinother->
GetName() )
5346 a2dCanvasObjectList::iterator iter;
5352 if ( pinc && pinc == pin )
5379 wxString nextpin = wxT(
"pin" );
5473 tmp->
Render( cworld,
_ON, layer, mask );
5494 if ( pinother && pinother != pinc )
5496 double x2 = pinother->
GetAbsX();
5497 double y2 = pinother->
GetAbsY();
5507 void a2dWires::CreateWires()
5522 if ( pinother && pinother != pinc )
5524 double x2 = pinother->
GetPosX();
5525 double y2 = pinother->
GetPosY();
void SetEnd(a2dCanvasObject *end)
set object to draw as end point
a2dHit m_how
return in which way the object was hit (stroke, fill, ...)
bool GeneratePins(a2dPinClass *toConnectTo, a2dConnectTask task, double x, double y, double margin=0)
create pins in derived objects.
a2dCircle at x,y, and with radius
bool GetAttributeValueBool(const wxString &attrib, bool defaultv=false)
Returns the boolean value of an attribute.
wxPoint2DDouble a2dPoint2D
this to define if coordinate numbers are integer or doubles
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
virtual void Render(a2dIterC &ic, OVERLAP clipparent)
Render this object to the active a2dDrawingPart.
double GetAbsY() const
get absolute Y position of the pin ( after applying the parent's matrix and its own matrix ) ...
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
all basic primitives derived from a2dCanvasObject
#define wxDynamicCast(obj, className)
Define wxDynamicCast so that it will give a compiler error for unrelated types.
void SetRoot(a2dDrawing *root, bool recurse=true)
Sets this object to a a2dCanvasDocument.
double GetPosX2(bool transform=true) const
Get (transformed) position of X2.
virtual a2dObject * DoClone(CloneOptions options, a2dRefMap *refs) const
Clone this object and return a pointer to the new object.
double m_y1
y of begin point
double GetContourWidth() const
get the Contour width of the shape
bool GetGeneratePins() const
get the GeneratePins flag
a2dObject * LoadOneObject(wxObject *parent)
load one object from a CVG file.
double m_height
height in pixels
void DoRender(a2dIterC &ic, OVERLAP clipparent)
render derived object
used to move start or end point in line objects
void DoWalker(wxObject *parent, a2dWalkerIOHandler &handler)
iterate over this object and its children
bool HasAttribute(const wxString &attrib)
Does the current tag have this attribute?
virtual void DrawArc(double x1, double y1, double x2, double y2, double xc, double yc, bool chord)
Draw Arc in world coordinates.
void DoRender(a2dIterC &ic, OVERLAP clipparent)
render derived object
bool m_chord
drawn as a chord ( no fill end no lines to center )
void SetEndAngle(double a)
Set the end angle (actually sets x2/y2)
a2dHandle is used inside editing versions of a certain objects.
void ConvertToLines()
Convert complex segments to line segments.
a2dCanvasObjectList * GetAsCanvasVpaths(bool transform=true) const
when implemented the object without its children, is converted to
a2dConnectTask
flags for searching a connecting a2dpinClass, for the connecting task at hand.
void SetRotation(double rotation)
Sets a rotation of this object.
int WorldToDeviceY(double y) const
convert y from world to device coordinates
virtual void DoSave(wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts, a2dObjectList *towrite)
write object specific CVGL data
void Set(double xs, double ys, double xm, double ym, double xe, double ye)
set arc using begin, end and middle point.
void SetStartAngle(double a)
Set the start angle (actually sets x1/y1)
void DoLoad(wxObject *parent, a2dIOHandlerXmlSerIn &parser, a2dXmlSer_flag xmlparts)
load object specific CVG 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...
void DoRender(a2dIterC &ic, OVERLAP clipparent)
render derived object
#define a2dACCUR
accuracy used to have some limit to calculation like hittesting
virtual a2dObject * DoClone(CloneOptions options, a2dRefMap *refs) const
This is here so that this class cannot be used directly.
void DoRender(a2dIterC &ic, OVERLAP clipparent)
render derived object
bool m_frozen
are the wires frozen (means will not resize)
virtual bool DoStartEdit(wxUint16 editmode, wxEditStyle editstyle)
only used for editable objects and under control of a editing tool.
XMLeventType Next()
Walks to next element and returns event type.
a2dCanvasObjectList * GetAsCanvasVpaths(bool transform=true) const
when implemented the object without its children, is converted to
void SetRadius(double radius)
set corner radius of rectangle
virtual a2dVertexList * GetAsVertexList(bool &returnIsPolygon) const
convert to a polygon and return the vertexlist.
bool ResolveOrAdd(a2dSmrtPtr< a2dObject > *storedHere, const wxString &id=wxT(""))
try to resolve the object that is in storedHere when it is a reference.
class to map references to objects stored in XML, in order to make the connection later on...
a2dPoint2D GetMidPoint() const
get point in between begin and end
a2dDrawing * m_root
root group for rendering and accessing the canvas's also contains layer settings
void SetPosXY12(double x1, double y1, double x2, double y2, bool afterinversion=true)
sets both positions of line
void DoRender(a2dIterC &ic, OVERLAP clipparent)
render derived object
void DoLoad(wxObject *parent, a2dIOHandlerXmlSerIn &parser, a2dXmlSer_flag xmlparts)
load object specific CVG 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...
double m_radius
radius in case of rounded rectangle (negatif inwards positif outwards)
a2dPoint2D DistancePoint(double distance, bool begin) const
calculate point on line at distance from the begin or end of line
a2dCanvasOFlags m_flags
holds flags for objects
void DoLoad(wxObject *parent, a2dIOHandlerXmlSerIn &parser, a2dXmlSer_flag xmlparts)
load object specific CVG data
void DoRender(a2dIterC &ic, OVERLAP clipparent)
render derived object
virtual a2dVertexList * GetAsVertexList(bool &returnIsPolygon) const
convert to a polygon.
const a2dAffineMatrix & GetInverseTransform() const
Inverse of GetTransform()
static const a2dCanvasObjectFlagsMask BIN2
a2dCanvasObjectList * GetAsCanvasVpaths(bool transform=true) const
when implemented the object without its children, is converted to
virtual a2dObject * DoClone(CloneOptions options, a2dRefMap *refs) const
Clone this object and return a pointer to the new object.
void Transform(const a2dAffineMatrix &world)
transform all segments with given matrix
a2dPin is used in a2dCanvasObject to add pins to it.
This is a class/type description for a2dPin's.
static a2dHit stock_nohit
Stock object for no hit.
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 DoRender(a2dIterC &ic, OVERLAP clipparent)
render derived object
static a2dHit stock_strokeinside
Stock object for an inner stroke hit on objects without vertices/edges (like circles) ...
bool DoIsHitWorld(a2dIterC &ic, a2dHitEvent &hitEvent)
Does hit test on the object (exclusif child objects)
void SetTransformMatrix(const a2dAffineMatrix &mat=a2dIDENTITY_MATRIX)
Returns the matrix used to position the object.
bool Rotate(double angle)
Rotate clockwise by the given number of degrees:
void Enlarge(const double Marge)
enlarge with the given amount
virtual bool DoStartEdit(wxUint16 editmode, wxEditStyle editstyle)
only used for editable objects and under control of a editing tool.
basetype * GetPropertyValuePtr(a2dObject *obj) const
Get a pointer to the property value in obj.
double wxDegToRad(double deg)
conversion from degrees to radians
double GetRadius() const
get radius of the Arc
bool GeneratePins(a2dPinClass *toConnectTo, a2dConnectTask task, double x, double y, double margin=0)
create pins in derived objects.
double GetContourWidth() const
get the Contour width of the shape
void DoRender(a2dIterC &ic, OVERLAP clipparent)
render derived object
a2dEllipticArc()
constructor
static a2dPropertyIdDouble * PROPID_StartAngle
property for class member
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...
a2dWHCenter()
default constructor
bool IsHit() const
true if this is a hit
double m_contourwidth
if != 0 you get a donut
virtual bool Update(UpdateMode mode)
Update the state of the object according to its current position etc.
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...
double GetY2() const
Get Y2 of arc being end point of arc.
void SetChord(bool chord)
if true draw as a chord ( no fill end no lines to center )
#define EVT_CANVASHANDLE_MOUSE_EVENT(func)
static event table macro for a2dHandle mouse event
double m_width
width in pixels
bool EliminateMatrix()
reduce matrix to identity without replacing object
double GetBase()
return how broad the basis of the arrow is.
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.
static a2dPropertyIdDouble * PROPID_EndAngle
property for class member
void SetChord(bool chord)
if true draw as a chord ( no fill end no lines to center )
bool DoUpdate(UpdateMode mode, const a2dBoundingBox &childbox, const a2dBoundingBox &clipbox, const a2dBoundingBox &propbox)
Update derived Object specific things ( mainly boundingbox)
double GetScale()
See GetScale()
R_PointStatus PointInLine(const a2dPoint2D &a_Point, double &Distance, double Marge) const
For a non-infinite a2dLine.
double GetValue(int col, int row) const
get the value in the matrix at col,row
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
bool DoUpdate(UpdateMode mode, const a2dBoundingBox &childbox, const a2dBoundingBox &clipbox, const a2dBoundingBox &propbox)
Update derived Object specific things ( mainly boundingbox)
a2dCanvasObjectList * GetAsCanvasVpaths(bool transform=true) const
return the arrow converted to a vector path.
a2dPropertyIdTyped< bool, a2dBoolProperty > a2dPropertyIdBool
property of this type
a2dRectC is a centered rectangle
a2dPin * IsConnectedTo(a2dPin *pin=a2dAnyPin) const
Return the pin to which this pin is connected.
double m_y2
y of end point
void DoLoad(wxObject *parent, a2dIOHandlerXmlSerIn &parser, a2dXmlSer_flag xmlparts)
load object specific CVG data
double m_contourwidth
if != 0 the line is contoured at distance m_contourwidth/2
double m_l1
length from top of arrow to outside points in X
bool m_hasPins
true if this object does have a2dPin's as children
The base class for all drawable objects in a a2dCanvasDocument.
double GetTransformedHitMargin()
transformed to object its coordinate system
bool DoIsHitWorld(a2dIterC &ic, a2dHitEvent &hitEvent)
Does hit test on the object (exclusif child objects)
static a2dPropertyIdDouble * PROPID_Y2
property for class member
static a2dPropertyIdBool * PROPID_Chord
property for class member
~a2dEndsEllipticChord()
destructor
virtual bool RestrictToObject(a2dIterC &ic, const a2dPoint2D &pointToSnapTo, a2dPoint2D &bestPointSofar, a2dSnapToWhatMask snapToWhat, double thresHoldWorld)
called from an a2dRestrictionEngine, to restrict vertexes, lines, object to this object.
double GetWidth() const
return width
void DoLoad(wxObject *parent, a2dIOHandlerXmlSerIn &parser, a2dXmlSer_flag xmlparts)
load object specific CVG data
void DoRender(a2dIterC &ic, OVERLAP clipparent)
render derived object
bool DoUpdate(UpdateMode mode, const a2dBoundingBox &childbox, const a2dBoundingBox &clipbox, const a2dBoundingBox &propbox)
Update derived Object specific things ( mainly boundingbox)
double m_xscale
scale begin and end object with this factor in X
wxUint16 m_layer
layer of object, default wxLAYER_DEFAULT
virtual void DoLoad(wxObject *parent, a2dIOHandlerXmlSerIn &parser, a2dXmlSer_flag xmlparts)
load object specific CVG data
static a2dPropertyIdDouble * PROPID_X1
property for class member
void DoRender(a2dIterC &ic, OVERLAP clipparent)
render derived object
void DoLoad(wxObject *parent, a2dIOHandlerXmlSerIn &parser, a2dXmlSer_flag xmlparts)
load object specific CVG data
vertex array of line and arc segments.
bool m_spline
draw splined?
a2dCanvasObject is the base class for Canvas Objects.
virtual bool RestrictToObject(a2dIterC &ic, const a2dPoint2D &pointToSnapTo, a2dPoint2D &bestPointSofar, a2dSnapToWhatMask snapToWhat, double thresHoldWorld)
called from an a2dRestrictionEngine, to restrict vertexes, lines, object to this object.
virtual void DoSave(wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts, a2dObjectList *towrite)
write object specific CVGL data
void DoLoad(wxObject *parent, a2dIOHandlerXmlSerIn &parser, a2dXmlSer_flag xmlparts)
load object specific CVG data
void SetX1(double x1)
Set X1 of arc being begin point of arc.
double GetContourWidth() const
get the Contour width of the shape
A2DGENERALDLLEXP a2dWalkEvent a2dWalker_a2dDerivedCanvasObjectStart
id for a2dWalkEvent issued from within a2dWalkerIOHandler
bool SetPointIfCloser(const a2dPoint2D &pointToSnapTo, const a2dPoint2D &pointToSnap, a2dPoint2D &bestPointSofar, double thresHoldWorld)
void SetWidth(double w)
set width of rectangle
void ReStartEdit(wxUint16 editmode)
to restart editing in a different mode
virtual a2dVertexList * GetAsVertexList(bool &returnIsPolygon) const
convert to a polygon.
a2dCanvasObjectList * GetChildObjectList()
get the list where the child objects are stored in.
vertex list of line and arc segments.
void Set(double xc, double yc, double w, double h, double angle=0, double radius=0)
set all paramters for the centered rectangle
void TransformPoint(double x, double y, double &tx, double &ty) const
Transform a point.
virtual void DrawCenterRoundedRectangle(double xc, double yc, double width, double height, double radius, bool pixelsize=false)
Draw CenterRoundedRectangle in world coordinates.
static const a2dCanvasObjectFlagsMask A
bool m_snap_to
snapping of other objects to this when in place
double GetRotation() const
return rotation
wxString GetName() const
get the name given to the handle.
bool DoUpdate(UpdateMode mode, const a2dBoundingBox &childbox, const a2dBoundingBox &clipbox, const a2dBoundingBox &propbox)
Update derived Object specific things ( mainly boundingbox)
virtual bool DoStartEdit(wxUint16 editmode, wxEditStyle editstyle)
only used for editable objects and under control of a editing tool.
return to contain edit bbox, suitable for editing matrix of object
virtual bool RestrictToObject(a2dIterC &ic, const a2dPoint2D &pointToSnapTo, a2dPoint2D &bestPointSofar, a2dSnapToWhatMask snapToWhat, double thresHoldWorld)
called from an a2dRestrictionEngine, to restrict vertexes, lines, object to this object.
void WriteEndElement(bool newLine=true)
Writes correspondending end tag for the current start tag.
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...
a2dEndsEllipticChord()
constructor
double m_yscale
scale begin and end object with this factor in Y
vector path a2dVectorPath derived from a2dCanvasObject
a2dAffineMatrix m_lworld
used for positioning the object (x,y,ang,scale etc.)
void SetEndObj(a2dCanvasObject *endob)
set object to draw as end point
void SetInternal(bool internal)
set when pin is within the border of its parent
Io handler to iterate through a a2dDocument.
void SetHeight(double h)
set height of rectangle
wxMouseEvent & GetMouseEvent()
return the original mouse event that was redirected to the a2dHandle
virtual void DoSave(wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts, a2dObjectList *towrite)
write object specific CVGL data
bool GetCheck() const
general flag use at will.
double GetEndAngle() const
Get the end angle (calculated form x2/y2)
bool m_draggable
can be dragged
virtual void DoSave(wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts, a2dObjectList *towrite)
write object specific CVGL data
double m_contourwidth
if != 0 you get a contour around the rectangle ( donut like ).
void SetIgnoreSetpending(bool value=true)
set IgnoreSetpending flag
void ConnectPins(a2dCanvasObject *parent, a2dPin *pinc, a2dPin *pinother, bool undo=false)
connect two pins which must be unconnected and at the same position
a2dCanvasObjectList * wxNullCanvasObjectList
define a NON a2dCanvasObjectList
void DoRender(a2dIterC &ic, OVERLAP clipparent)
render derived object
used to change a property on objects
see a2dCanvasObjectMouseEvent
void ConnectTo(a2dPin *connectto)
connect this pin to the given pin
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 Virtual_Point(a2dPoint2D &a_point, double distance) const
calculate point Perpendicula at distance from the line, through given point
virtual a2dBoundingBox GetUnTransformedBbox(a2dBboxFlags flags=a2dCANOBJ_BBOX_CHILDREN) const
Get boundingbox without the affine matrix transform included.
double GetMinX() const
get minimum X of the boundingbox
double GetLength() const
Returns length of line.
virtual void DrawRoundedRectangle(double x, double y, double width, double height, double radius, bool pixelsize=false)
Draw RoundedRectangle in world coordinates.
a2dOrigin stays at World Coordinate Zero (0,0) not matter what.
a2dCanvasObjectList * m_childobjects
holds child objects
a2dCanvasObjectList * GetAsCanvasVpaths(bool transform=true) const
when implemented the object without its children, is converted to
virtual a2dVertexList * GetAsVertexList(bool &returnIsPolygon) const
convert to a polygon.
void DoLoad(wxObject *parent, a2dIOHandlerXmlSerIn &parser, a2dXmlSer_flag xmlparts)
load object specific CVG data
a2dControl captures a wxWindow inside
void Transform(const a2dAffineMatrix &tworld)
transform the object using the given matrix
static a2dPropertyIdDouble * PROPID_Width
property to get m_width
void SetPosXY1(double x, double y, bool afterinversion=true)
sets position of first point
#define forEachIn(listtype, list)
easy iteration for a2dlist
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)
virtual a2dObject * DoClone(CloneOptions options, a2dRefMap *refs) const
Clone this object and return a pointer to the new object.
a2dEllipse centered at x,y.
a2dAffineMatrix GetEndTransform() const
Get the coordinate transform for the end object.
void SetPropertyToObject(a2dObject *obj, const basetype &value, SetFlags setflags=set_none) const
Set the property in obj to value.
void Walker(wxObject *parent, a2dWalkerIOHandler &handler)
This is used to recursively walk through an object tree.
double GetPosX() const
get x position from affine matrix
The point is in the fill area.
a2dCanvasObjectPtr m_beginobj
object drawn at begin point
void SkewY(double angle)
Skew in Y.
virtual a2dObject * DoClone(CloneOptions options, a2dRefMap *refs) const
Clone this object and return a pointer to the new object.
a2dDrawer2D * GetDrawer2D() const
get current a2dDrawer2D
Normal straight line segment in a2dVpath.
#define wxStaticCast(obj, className)
The wxWindows 2.4.2 wxStaticCast is buggy. It evaluates its argument twice.
virtual a2dObject * DoClone(CloneOptions options, a2dRefMap *refs) const
Clone this object and return a pointer to the new object.
bool m_editable
object can be edited
bool DoIsHitWorld(a2dIterC &ic, a2dHitEvent &hitEvent)
Does hit test on the object (exclusif child objects)
double wxRadToDeg(double rad)
conversion from radians to degrees
Normal straight line segment in a2dVertexList and a2dVertexArray.
double GetL1()
Returns the arrow length.
void SkewX(double angle)
Skew in X.
void SetSpecificFlags(bool setOrClear, a2dCanvasObjectFlagsMask which)
set all bit flags in object that or true in mask to true or false
void SetContourWidth(double width)
bool DoIsHitWorld(a2dIterC &ic, a2dHitEvent &hitEvent)
Does hit test on the object (exclusif child objects)
void CalculateLineParameters()
Calculate the parameters if invalid.
virtual void DoSave(wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts, a2dObjectList *towrite)
write object specific CVGL data
void Translate(double x, double y)
relative translate the object to position x,y in world coordinates
virtual bool DoStartEdit(wxUint16 editmode, wxEditStyle editstyle)
only used for editable objects and under control of a editing tool.
general event sent from a2dHandle to its parent a2dCanvasObject
void Add(a2dVpathSegment *seg)
add a segment
Restriction engine for editing restrictions like snapping.
double m_l2
length from top of arrow to inside point in X
void SetBeginObj(a2dCanvasObject *begin)
set object to draw as begin point
virtual a2dObject * DoClone(CloneOptions options, a2dRefMap *refs) const
Clone this object and return a pointer to the new object.
bool m_childrenOnSameLayer
void DoRender(a2dIterC &ic, OVERLAP clipparent)
render derived object
int WorldToDeviceX(double x) const
convert x from world to device coordinates
bool DoIsHitWorld(a2dIterC &ic, a2dHitEvent &hitEvent)
Does hit test on the object (exclusif child objects)
virtual void DoSave(wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts, a2dObjectList *towrite)
write object specific CVGL data
bool HasPins(bool realcheck=false)
are there a2dPin derived children
virtual void DrawLine(double x1, double y1, double x2, double y2)
Draw line in world coordinates.
Input and output handler for the XmlSer format.
a2dPin * AddPin(const wxString name, double x, double y, wxUint32 a2dpinFlags, a2dPinClass *pinClass, bool undo=false)
add a a2dPin as child
bool DoUpdate(UpdateMode mode, const a2dBoundingBox &childbox, const a2dBoundingBox &clipbox, const a2dBoundingBox &propbox)
Update derived Object specific things ( mainly boundingbox)
virtual a2dObject * DoClone(CloneOptions options, a2dRefMap *refs) const
This is here so that this class cannot be used directly.
void SetPathType(a2dPATH_END_TYPE pathtype)
Set when m_contourwidth != 0 what is the end of the lines should be.
void DoLoad(wxObject *parent, a2dIOHandlerXmlSerIn &parser, a2dXmlSer_flag xmlparts)
load object specific CVG data
double GetPosY2(bool transform=true) const
Get (transformed) position of Y2.
a2dCanvasObjectPtr m_begin
object drawn at begin point
Contains a2dDrawing Class to hold a drawing.
a2dArrow is used for having line begin and ends on specific objects.
wxUint32 a2dSnapToWhatMask
mask for a2dSnapToWhat flags
double m_xscale
scale begin and end object with this factor in X
virtual bool Submit(a2dCommand *command, bool storeIt=true)
next to the base class submit, it sets a2DocumentCommandProcessor for a2dCommand
double GetX1() const
Get X1 of arc being begin point of arc.
virtual void DoSave(wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts, a2dObjectList *towrite)
write object specific CVGL data
virtual bool DoStartEdit(wxUint16 editmode, wxEditStyle editstyle)
only used for editable objects and under control of a editing tool.
a2dCanvasObjectList * GetAsCanvasVpaths(bool transform=true) const
when implemented the object without its children, is converted to
A 2x3 affine matrix class for 2D transformations.
a2dStroke GetDrawerStroke() const
get the current stroke
bool DoUpdate(UpdateMode mode, const a2dBoundingBox &childbox, const a2dBoundingBox &clipbox, const a2dBoundingBox &propbox)
Update derived Object specific things ( mainly boundingbox)
a2dWH()
default constructor
double GetAttributeValueDouble(const wxString &attrib, double defaultv=0)
Returns the double value of an attribute.
bool DoIsHitWorld(a2dIterC &ic, a2dHitEvent &hitEvent)
Does hit test on the object (exclusif child objects)
int GetPinCount()
How many a2dPin derived children are there.
virtual void DoWalker(wxObject *parent, a2dWalkerIOHandler &handler)
iterate over this object and its children
double GetStartAngle() const
Get the start angle (calculated form x1/y1)
double GetMaxX() const
get maximum X of the boundingbox
virtual a2dVertexList * GetAsVertexList(bool &returnIsPolygon) const
convert to a polygon.
static a2dPropertyIdDouble * PROPID_X2
property for class member
double GetPosX1(bool transform=true) const
Get (transformed) position of X1.
a2dPin * HasPinNamed(const wxString pinName, bool NotConnected=false)
are there a2dPin derived children which matches the given pin name?
double GetPosY() const
get y position from affine matrix
bool DoIsHitWorld(a2dIterC &ic, a2dHitEvent &hitEvent)
Does hit test on the object (exclusif child objects)
double GetWorldStrokeExtend()
wxWindow * m_control
control with a a2dCanvas as parent.
void DoRender(a2dIterC &ic, OVERLAP clipparent)
render derived object
bool DoIsHitWorld(a2dIterC &ic, a2dHitEvent &hitEvent)
Does hit test on the object (exclusif child objects)
virtual a2dObject * DoClone(CloneOptions options, a2dRefMap *refs) const
This is here so that this class cannot be used directly.
double m_x1
x of begin point
virtual double GetContourWidth() const
get the Contour width of the shape
while iterating a a2dCanvasDocument, this holds the context.
double m_height
height of rectangle
virtual a2dObject * DoClone(CloneOptions options, a2dRefMap *refs) const
Clone this object and return a pointer to the new object.
double GetContourWidth() const
get the Contour width of the shape
virtual void DrawEllipticArc(double xc, double yc, double width, double height, double sa, double ea, bool chord)
Draw Elliptic Arc in world coordinates.
double m_yscale
scale begin and end object with this factor in Y
double wxSqr(double x)
good replacement for pow(x,2)
void Set(double xt, double yt, double l1, double l2, double b, bool spline=false)
Sets top, length, height and broad parameters.
virtual bool IsConnect() const
type of wire
All updates of these modes force an update (e.g. update non-pending valid bounding boxes) ...
virtual bool DoStartEdit(wxUint16 editmode, wxEditStyle editstyle)
only used for editable objects and under control of a editing tool.
void MapBbox(const a2dAffineMatrix &matrix)
virtual a2dObject * DoClone(CloneOptions options, a2dRefMap *refs) const
This is here so that this class cannot be used directly.
a2dCommandProcessor * GetCommandProcessor() const
Returns a pointer to the command processor associated with this document.
virtual a2dVertexList * GetAsVertexList(bool &returnIsPolygon) const
convert to a polygon.
a2dBoundingBox GetMappedBbox(a2dIterC &ic, bool withExtend=true)
first translate boundingbox with cworld and recalculate at new position
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 SetStroke(const wxColour &strokecolor, double width=0, a2dStrokeStyle style=a2dSTROKE_SOLID)
Set a stroke for the object which will be used instead of the layer stroke.
void SetChildrenOnSameLayer(bool samelayer)
if set children are rendered on the same layer as this object.
a2dWires is used to generate wires to Connect other a2dCanvasObject's
void Scale(double scalex, double scaley)
Scale in x and y ( > zero)
static a2dHit stock_strokeoutside
Stock object for an outer stroke hit on objects without vertices/edges (like circles) ...
a2dHit HitTestPolygon(const a2dPoint2D &ptest, double margin)
extensive hittesting on vertex list seen as polygon.
wxString GetName() const
get the name given to the pin.
wxString GetAttributeValue(const wxString &attrib, const wxString &defaultv=wxT(""))
Returns the value of an attribute.
a2dRestrictionEngine * GetRestrictionEngine()
Get restriction engine (grid snapping)
double m_start
start angle
bool DoUpdate(UpdateMode mode, const a2dBoundingBox &childbox, const a2dBoundingBox &clipbox, const a2dBoundingBox &propbox)
Update derived Object specific things ( mainly boundingbox)
double GetAbsAngle() const
get absolute angle of the pin ( after applying the parent its matrix and it own matrix ) ...
virtual a2dVertexList * GetAsVertexList(bool &returnIsPolygon) const
return the arrow converted to a polygon.
double m_y1
y endpoint of line
wire classes for connecting objects.
bool InArc(double angle, double start, double end, bool clockwise)
a2dCanvasObjectList * GetAsCanvasVpaths(bool transform=true) const
when implemented the object without its children, is converted to
a2dEndsLine with begin and/or end object.
a2dCanvasObjectList * GetAsCanvasVpaths(bool transform=true) const
when implemented the object without its children, is converted to
double GetMaxY() const
get maximum Y of the boundingbox
double GetWidth() const
returns width of the boundingbox
An object of this class will update a a2dIterC with the required information.
void SetY2(double y2)
Set Y2 of arc being end point of arc.
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
bool DoIsHitWorld(a2dIterC &ic, a2dHitEvent &hitEvent)
Does hit test on the object (exclusif child objects)
wxString GetTagName()
Returns name of the current XML tag.
virtual a2dObject * DoClone(CloneOptions options, a2dRefMap *refs) const
Clone this object and return a pointer to the new object.
static a2dPinClass * Standard
Pins of this class can only connect to pins of the same class.
double m_width
width of rectangle
static a2dPropertyIdDouble * PROPID_Y1
property for class member
void DoRender(a2dIterC &ic, OVERLAP clipparent)
render derived object
void AddPoint(const a2dPoint2D &point, bool atEnd=true)
add point to end or begin
void SetPosXY(double x, double y, bool restrict=false)
set position to x,y
bool Scale(double scale)
Scale by scale (isotropic scaling i.e. the same in x and y):
bool Translate(double x, double y)
Translate by dx, dy:
a2dEndsEllipticChord with begin and/or end object.
void SetBegin(double l1, double l2, double b, bool spline=false)
set begin shape factors if it is a2dArrow derived
bool m_editingCopy
true if the object needs to be rendered in edit mode.
double m_radius
radius of circle
bool DoUpdate(UpdateMode mode, const a2dBoundingBox &childbox, const a2dBoundingBox &clipbox, const a2dBoundingBox &propbox)
Update derived Object specific things ( mainly boundingbox)
a2dAffineMatrix GetBeginTransform() const
Get the coordinate transform for the begin object.
virtual bool EliminateMatrix()
reduce matrix to identity
if set, clone members (e.g. line end styles), otherwise ref-copy them
bool DoIsHitWorld(a2dIterC &ic, a2dHitEvent &hitEvent)
Does hit test on the object (exclusif child objects)
bool DoIsHitWorld(a2dIterC &ic, a2dHitEvent &hitEvent)
Does hit test on the object (exclusif child objects)
virtual void DoSave(wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts, a2dObjectList *towrite)
write object specific CVGL data
a2dCanvasObject * IsHitWorld(a2dIterC &ic, a2dHitEvent &hitEvent)
If the position (x,y) is within the object return this.
void SetBegin(a2dCanvasObject *begin)
set object to draw as begin point
virtual bool RestrictAngle(double *ang, wxUint32 sourceRequired=snapToAll, bool ignoreEngine=false)
Restrict angle.
The a2dBoundingBox class stores one a2dBoundingBox of a a2dCanvasObject.
bool GetChildrenOnSameLayer() const
are children rendered on the same layer as this object?
bool Invert(void)
Invert matrix.
double GetX2() const
Get X2 of arc being end point of arc.
bool m_chord
drawn as a chord ( no fill end no lines to center )
virtual a2dObject * DoClone(CloneOptions options, a2dRefMap *refs) const
Clone this object and return a pointer to the new object.
void Rotate(double rotation)
Rotates this object clockwise.
void SetX2(double x2)
Set X2 of arc being end point of arc.
void DoRender(a2dIterC &ic, OVERLAP clipparent)
render derived object
double m_x2
x of end point
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...
static a2dHit stock_fill
Stock object for a fill hit.
~a2dEllipticArc()
destructor
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
double m_height
height of rectangle
double m_contourwidth
if != 0 the line is contoured at distance m_contourwidth/2
bool DoIsHitWorld(a2dIterC &ic, a2dHitEvent &hitEvent)
Does hit test on the object (exclusif child objects)
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.
virtual void DoSave(wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts, a2dObjectList *towrite)
write object specific CVGL data
double m_x1
x endpoint of line
virtual void DrawEllipse(double x, double y, double width, double height)
Draw Ellipse in world coordinates.
basetype GetPropertyValue(const a2dObject *obj) const
Get the property value in obj.
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...
virtual void DoSave(wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts, a2dObjectList *towrite)
write object specific CVGL data
#define Round(x)
round to integer such that e.g 2.5 < x < 3.5 becomes 3
virtual void DrawCircle(double x, double y, double radius)
Draw Circle in world coordinates.
virtual void Save(wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dObjectList *towrite)
write all needed to an XML type of file called the CVG format
double GetY1() const
Get Y1 of arc being begin point of arc.
a2dCanvasObject for a Vector Path
virtual bool DoUpdate(UpdateMode mode, const a2dBoundingBox &childbox, const a2dBoundingBox &clipbox, const a2dBoundingBox &propbox)
Update derived Object specific things ( mainly boundingbox)
virtual void DoSave(wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts, a2dObjectList *towrite)
write object specific CVGL data
void DoLoad(wxObject *parent, a2dIOHandlerXmlSerIn &parser, a2dXmlSer_flag xmlparts)
load object specific CVG data
a2dDrawingPart * GetDrawingPart() const
get current a2dDrawingPart
a2dCanvasObjectPtr m_endobj
object drawn at end point
bool DoStartEdit(wxUint16 editmode, wxEditStyle editstyle)
only used for editable objects and under control of a editing tool.
This template class is for property ids with a known data type.
bool ConnectWith(a2dCanvasObject *parent, a2dCanvasObject *graph, const wxString &pinname, double margin=1, bool undo=false)
Do connect with another a2dCanvasObject by pinname.
double GetScale()
See GetScale()
double GetPosY1(bool transform=true) const
Get (transformed) position of Y1.
a2dBoundingBox m_bbox
boundingbox in world coordinates
double GetContourWidth() const
get the Contour width of the shape
double RequireAttributeValueDouble(const wxString &attrib)
Forces an attribute and returns its double value.
double m_width
width of rectangle
bool DoUpdate(UpdateMode mode, const a2dBoundingBox &childbox, const a2dBoundingBox &clipbox, const a2dBoundingBox &propbox)
Update derived Object specific things ( mainly boundingbox)
bool m_takeStyleToArrow
if set take style changes on line to the arrow objects
virtual void DoSave(wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts, a2dObjectList *towrite)
write object specific CVGL data
double GetAbsX() const
get absolute X position of the pin ( after applying the parent's matrix and its own matrix ) ...
bool GeneratePins(a2dPinClass *toConnectTo, a2dConnectTask task, double x, double y, double margin=0)
create pins in derived objects.
void SetPosXY2(double x, double y, bool afterinversion=true)
sets position of second point
void Append(a2dCanvasObject *obj)
append a a2dCanvasObject to the childobjects
virtual void DoEndEdit()
only used for editable objects and under control of a editing tool.
double GetHeight() const
return height
double m_contourwidth
if != 0 you get a contour around the rectangle ( donut like ).
a2dCanvasObject * GetParent() const
get parent object of the pin
const a2dAffineMatrix & GetTransform() const
Get the accumulated transform up to and including m_lworld of the current object. ...
virtual a2dObject * DoClone(CloneOptions options, a2dRefMap *refs) const
This is here so that this class cannot be used directly.
a2dControl(double x, double y, double width, double height, wxWindow *control)
constructor
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...
virtual void SetLayer(wxUint16 layer)
set layer index where this object is drawn upon.
bool DoIsHitWorld(a2dIterC &ic, a2dHitEvent &hitEvent)
Does hit test on the object (exclusif child objects)
a2dPATH_END_TYPE m_pathtype
when m_contourwidth != 0 what is the end of the line looking like.
static a2dPropertyIdDouble * PROPID_Height
property to get m_height
a2dCanvasObjectList * GetAsCanvasVpaths(bool transform=true) const
when implemented the object without its children, is converted to
wxEvent * m_event
event to process in case of event processing call
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...
double m_rely
(world coordinates) hit point y relative to the canvas object its parent object(s) ...
#define EVT_CANVASOBJECT_RESIZE_EVENT(func)
static event table macro for a2dCanvasObject resize event
void SetY1(double y1)
Set Y1 of arc being begin point of arc.
CloneOptions
options for cloning
void SetHitFlags(a2dCanvasObjectHitFlags mask)
set hit flags
void SetPreRenderAsChild(bool prerender)
If set, this object has a higher priority in rendering than other children objects.
structure to give as parameter to member functions of a2dCanvasObject
virtual bool DoStartEdit(wxUint16 editmode, wxEditStyle editstyle)
only used for editable objects and under control of a editing tool.
virtual bool RestrictPoint(double &x, double &y, wxUint32 sourceRequired=snapToAll, bool ignoreEngine=false)
Restrict a single point of a line or polyline.
void SetRadius(double radius)
set radius of the Arc
const double wxPI
defines PI
wxInt64 GetUniqueSerializationId() const
return a unique id for this object
void SetFill(const a2dFill &fill)
Set a fill for the object which will be used instead of the layer fill.
double m_radius
radius in case of rounded rectangle
virtual bool DoStartEdit(wxUint16 editmode, wxEditStyle editstyle)
only used for editable objects and under control of a editing tool.
a2dEllipticArc centered at x,y
a2dPropertyIdTyped< double, a2dDoubleProperty > a2dPropertyIdDouble
property of this type
virtual void DoWalker(wxObject *parent, a2dWalkerIOHandler &handler)
iterate over this object and its children
const a2dFill * a2dTRANSPARENT_FILL
global a2dFill stock object for TRANSPARENT filling
void SetEnd(double l1, double l2, double b, bool spline=false)
set end shape factors if it is a2dArrow derived
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.
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...
~a2dScaledEndLine()
destructor
a2dCanvasObjectPtr m_end
object drawn at end point
void GetClippingBox(double &x, double &y, double &w, double &h) const
what is the current clipping region in world coordinates