21 #include "wx/module.h"
23 #include <wx/wfstream.h>
24 #include <wx/tokenzr.h>
38 #if defined(__WXMSW__) && defined(__MEMDEBUG__)
39 #include <wx/msw/msvcrt.h>
53 #define CIRCLE_STEPS 128
55 #if (__GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 4))
60 #pragma warning(disable: 4660)
68 #pragma warning(default: 4660)
71 #endif // (__GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 4))
84 if ( canvasObject->
m_layer != m_layer && m_layer != wxLAYER_ALL && !canvasObject->GetIgnoreLayer() )
94 if ( m_layer != wxLAYER_ALL && !canvasObject->GetIgnoreLayer() &&
105 if ( m_layer == wxLAYER_ALL && !canvasObject->GetIgnoreLayer() && canvasObject->
m_root->
GetLayerSetup() &&
143 m_maskedCanvasObject = canvasObject;
148 if ( !m_maskedCanvasObject )
155 if ( canvasObject == m_maskedCanvasObject )
164 if ( m_maskedCanvasObject )
167 return canvasObject->
CheckMask( m_mask );
172 m_maskedCanvasObject = canvasObject;
174 return canvasObject->
CheckMask( m_mask );
187 if ( canvasObject == m_maskedCanvasObject )
189 m_maskedCanvasObject = NULL;
199 if ( m_maskedCanvasObject )
201 return canvasObject->
CheckMask( m_mask );
207 m_maskedCanvasObject = canvasObject;
209 return canvasObject->
CheckMask( m_mask );
246 if ( canvasObject == m_maskedCanvasObject )
248 m_maskedCanvasObject = NULL;
258 if ( m_maskedCanvasObject )
260 return canvasObject->
CheckMask( m_mask );
266 m_maskedCanvasObject = canvasObject;
268 return canvasObject->
CheckMask( m_mask );
283 if ( canvasObject == m_maskedCanvasObject )
285 m_maskedCanvasObject = NULL;
295 if ( m_maskedCanvasObject )
297 return canvasObject->
CheckMask( m_mask );
300 if ( canvasObject->GetHighLight() )
303 m_maskedCanvasObject = canvasObject;
305 return canvasObject->
CheckMask( m_mask );
342 if ( canvasObject == m_maskedCanvasObject )
344 m_maskedCanvasObject = NULL;
354 if ( m_maskedCanvasObject )
355 return canvasObject->
CheckMask( m_mask );
363 m_maskedCanvasObject = canvasObject;
365 return canvasObject->
CheckMask( m_mask );
369 return canvasObject->
CheckMask( m_mask );
386 if ( canvasObject == m_maskedCanvasObject )
388 m_maskedCanvasObject = NULL;
398 m_pp = ic.Push( matrix, clip );
404 m_pp = ic.Push(
object, clip );
413 m_iterC->m_contextListDeep.pop_back();
415 m_iterC->m_contextList.pop_back();
429 m_localtransform = matrix;
434 if( ic.m_contextList.size() )
447 if ( !ic.m_disableInvert )
463 if( ic.m_contextList.size() )
472 if ( !ic.m_disableInvert )
497 m_disableInvert =
false;
499 m_foundCorridorEnd =
false;
502 m_worldStrokeExtend = 0;
507 m_layer = wxLAYER_ALL;
508 m_perLayerMode =
true;
509 m_generateCommands =
false;
510 m_renderChildDerived =
true;
517 m_disableInvert =
false;
519 m_foundCorridorEnd =
false;
521 m_drawingPart = drawer;
529 m_worldStrokeExtend = 0;
531 m_generateCommands =
false;
533 m_perLayerMode =
true;
534 m_renderChildDerived =
true;
547 m_contextList.push_back( pp );
554 m_contextListDeep.push_back( cup );
562 m_contextList.push_back( pp );
570 m_contextListDeep.push_back( cup );
579 if ( m_contextList.size () && m_contextList.back()->m_objectLevel )
583 m_contextListDeep.pop_back();
585 m_contextList.pop_back();
590 m_worldStrokeExtend = 0;
591 m_perLayerMode =
true;
592 m_renderChildDerived =
true;
603 m_hitmargin_world = world;
608 return m_hitmargin_world;
633 return m_drawingPart;
643 if ( m_contextList.size() > 2 )
657 if ( m_contextList.size() )
658 return m_contextList.back()->GetObject();
665 if ( m_contextList.size() )
666 return m_contextList.back()->m_relativetransform;
673 if ( m_contextList.size() )
674 return m_contextList.back()->m_clip;
681 if ( m_contextList.size() > 2 )
695 if ( m_contextList.size() )
696 m_contextList.back()->m_clip = status;
701 assert( !m_disableInvert );
703 if ( m_contextList.size() )
704 return m_contextList.back()->m_inverseRelativetransform;
711 if ( m_contextList.size() > 2 )
725 assert( !m_disableInvert );
727 if ( m_contextList.size() > 2 )
743 m_foundCorridorEnd =
false;
751 obj->SetIsOnCorridorPath( OnOff );
759 if ( m_contextList.size() )
774 void a2dIterC::SetCorridorPathToParent()
776 m_foundCorridorEnd =
false;
784 obj->SetIsOnCorridorPath(
true );
788 if ( m_contextList.back()->m_object )
789 m_contextList.back()->m_object->SetIsOnCorridorPath(
false );
801 m_foundCorridorEnd =
false;
802 if ( m_contextList.back()->m_object )
811 if ( m_objectFilter )
812 return m_objectFilter->
Filter( *
this, canvasObject );
819 if ( m_objectFilter )
820 m_objectFilter->
EndFilter( *
this, canvasObject );
842 return ( *( s_a2dCanvasObjectSorter ) ) ( a, b );
845 a2dCanvasObjectSorter s_a2dCanvasObjectSorter = NULL;
928 a2dDynamicIdMap& a2dCanvasObject::GetPropertyIdMap()
930 return sm_dymPropIds;
932 bool a2dCanvasObject::AddPropertyId(
a2dPropertyId* dynproperty )
934 if ( sm_dymPropIds.find( dynproperty->
GetName() ) == sm_dymPropIds.end() )
935 sm_dymPropIds[ dynproperty->
GetName() ] = dynproperty;
937 wxASSERT_MSG( 0, _(
"The property id name '" ) + dynproperty->
GetName() + _(
"' already exists in #a2dCanvasObject" ) );
940 bool a2dCanvasObject::HasPropertyId(
const a2dPropertyId*
id )
const
942 a2dDynamicIdMap::iterator iter = sm_dymPropIds.find( id->
GetName() );
943 if ( iter != sm_dymPropIds.end() )
945 return a2dObject::HasPropertyId(
id );
947 a2dPropertyId* a2dCanvasObject::HasPropertyId(
const wxString& name )
949 a2dDynamicIdMap::iterator iter = sm_dymPropIds.find( name );
950 if ( iter != sm_dymPropIds.end() )
951 return sm_dymPropIds[ name ];
953 return a2dObject::HasPropertyId( name );
957 a2dDynamicIdMap::iterator iter = sm_dymPropIds.find( idName );
958 if ( iter != sm_dymPropIds.end() )
968 for ( a2dDynamicIdMap::iterator i = sm_dymPropIds.begin(); i != sm_dymPropIds.end(); i++ )
976 total->push_back( dprop );
979 return a2dObject::CollectProperties2( total,
id, flags );
981 a2dDynamicIdMap a2dCanvasObject::sm_dymPropIds;
982 static bool initPropa2dCanvasObject = a2dCanvasObject::InitializePropertyIds();
983 bool a2dCanvasObject::InitializePropertyIds()
987 a2dPropertyIdMatrix::Get( &a2dCanvasObject::GetTransform ),
988 a2dPropertyIdMatrix::Set( &a2dCanvasObject::SetTransform ) );
989 AddPropertyId( PROPID_TransformMatrix );
995 AddPropertyId( PROPID_Position );
1001 AddPropertyId( PROPID_Layer );
1007 AddPropertyId( PROPID_Selected );
1013 AddPropertyId( PROPID_Selectable );
1017 a2dPropertyIdBool::Get( &a2dCanvasObject::GetSubEdit ),
1018 a2dPropertyIdBool::Set( &a2dCanvasObject::SetSubEdit ) );
1019 AddPropertyId( PROPID_SubEdit );
1023 a2dPropertyIdBool::Get( &a2dCanvasObject::GetSubEditAsChild ),
1024 a2dPropertyIdBool::Set( &a2dCanvasObject::SetSubEditAsChild ) );
1025 AddPropertyId( PROPID_SubEditAsChild );
1031 AddPropertyId( PROPID_Visible );
1037 AddPropertyId( PROPID_Draggable );
1041 a2dPropertyIdBool::Get( &a2dCanvasObject::GetShowshadow ),
1042 a2dPropertyIdBool::Set( &a2dCanvasObject::SetShowshadow ) );
1043 AddPropertyId( PROPID_Showshadow );
1049 AddPropertyId( PROPID_Filled );
1055 AddPropertyId( PROPID_GroupA );
1061 AddPropertyId( PROPID_GroupB );
1067 AddPropertyId( PROPID_GeneratePins );
1073 AddPropertyId( PROPID_Bin );
1077 a2dPropertyIdBool::Get( &a2dCanvasObject::GetBin2 ),
1078 a2dPropertyIdBool::Set( &a2dCanvasObject::SetBin2 ) );
1079 AddPropertyId( PROPID_Bin2 );
1085 AddPropertyId( PROPID_Pending );
1091 AddPropertyId( PROPID_Snap );
1097 AddPropertyId( PROPID_SnapTo );
1101 a2dPropertyIdBool::Get( &a2dCanvasObject::GetPushin ),
1102 a2dPropertyIdBool::Set( &a2dCanvasObject::SetPushin ) );
1103 AddPropertyId( PROPID_Pushin );
1107 a2dPropertyIdBool::Get( &a2dCanvasObject::GetPrerenderaschild ),
1108 a2dPropertyIdBool::Set( &a2dCanvasObject::SetPrerenderaschild ) );
1109 AddPropertyId( PROPID_Prerenderaschild );
1113 a2dPropertyIdBool::Get( &a2dCanvasObject::GetVisiblechilds ),
1114 a2dPropertyIdBool::Set( &a2dCanvasObject::SetVisiblechilds ) );
1115 AddPropertyId( PROPID_Visiblechilds );
1121 AddPropertyId( PROPID_Editable );
1125 a2dPropertyIdBool::Get( &a2dCanvasObject::GetEditing ),
1126 a2dPropertyIdBool::Set( &a2dCanvasObject::SetEditing ) );
1127 AddPropertyId( PROPID_Editing );
1131 a2dPropertyIdBool::Get( &a2dCanvasObject::GetEditingRender ),
1132 a2dPropertyIdBool::Set( &a2dCanvasObject::SetEditingRender ) );
1133 AddPropertyId( PROPID_EditingRender );
1135 PROPID_ChildrenOnSameLayer =
new a2dPropertyIdBool( wxT(
"ChildrenOnSameLayer" ),
1139 AddPropertyId( PROPID_ChildrenOnSameLayer );
1143 a2dPropertyIdBool::Get( &a2dCanvasObject::GetDoConnect ),
1144 a2dPropertyIdBool::Set( &a2dCanvasObject::SetDoConnect ) );
1145 AddPropertyId( PROPID_DoConnect );
1149 a2dPropertyIdBool::Get( &a2dCanvasObject::GetIsOnCorridorPath ),
1150 a2dPropertyIdBool::Set( &a2dCanvasObject::SetIsOnCorridorPath ) );
1151 AddPropertyId( PROPID_IsOnCorridorPath );
1155 a2dPropertyIdBool::Get( &a2dCanvasObject::GetHasPins ),
1156 a2dPropertyIdBool::Set( &a2dCanvasObject::SetHasPins ) );
1157 AddPropertyId( PROPID_HasPins );
1163 AddPropertyId( PROPID_IsProperty );
1167 a2dPropertyIdBool::Get( &a2dCanvasObject::GetMouseInObject ),
1168 a2dPropertyIdBool::Set( &a2dCanvasObject::SetMouseInObject ) );
1169 AddPropertyId( PROPID_MouseInObject );
1173 a2dPropertyIdBool::Get( &a2dCanvasObject::GetHighLight ),
1174 a2dPropertyIdBool::Set( &a2dCanvasObject::SetHighLight ) );
1175 AddPropertyId( PROPID_HighLight );
1179 a2dPropertyIdBool::Get( &a2dCanvasObject::GetTemplate ),
1180 a2dPropertyIdBool::Set( &a2dCanvasObject::SetTemplate ) );
1181 AddPropertyId( PROPID_Template );
1185 a2dPropertyIdBool::Get( &a2dCanvasObject::GetExternal ),
1186 a2dPropertyIdBool::Set( &a2dCanvasObject::SetExternal ) );
1187 AddPropertyId( PROPID_External );
1191 a2dPropertyIdBool::Get( &a2dCanvasObject::GetUsed ),
1192 a2dPropertyIdBool::Set( &a2dCanvasObject::SetUsed ) );
1193 AddPropertyId( PROPID_Used );
1199 AddPropertyId( PROPID_Release );
1203 AddPropertyId( PROPID_DisableFeedback );
1207 AddPropertyId( PROPID_Allowrotation );
1211 AddPropertyId( PROPID_Allowsizing );
1215 AddPropertyId( PROPID_Allowskew );
1219 AddPropertyId( PROPID_IncludeChildren );
1238 AddPropertyId( PROPID_Begin );
1242 AddPropertyId( PROPID_End );
1246 AddPropertyId( PROPID_EndScaleX );
1250 AddPropertyId( PROPID_EndScaleY );
1254 AddPropertyId( PROPID_Spline );
1260 AddPropertyId( PROPID_ContourWidth );
1264 AddPropertyId( PROPID_Original );
1268 AddPropertyId( PROPID_Editcopy );
1272 AddPropertyId( PROPID_Parent );
1276 AddPropertyId( PROPID_Objecttip );
1280 AddPropertyId( PROPID_Controller );
1284 AddPropertyId( PROPID_Editmode );
1288 AddPropertyId( PROPID_Editstyle );
1292 AddPropertyId( PROPID_Index );
1293 PROPID_Index = PROPID_Index;
1297 AddPropertyId( PROPID_RefDesCount );
1301 AddPropertyId( PROPID_RefDesNr );
1305 AddPropertyId( PROPID_Shadowstyle );
1309 *
a2dNullFILL, static_cast < a2dPropertyIdFill::ConstGet >( &a2dCanvasObject::MX_GetFill ), static_cast < a2dPropertyIdFill::ConstSet >( &a2dCanvasObject::MX_SetFill ) );
1310 AddPropertyId( PROPID_Fill );
1314 *
a2dNullSTROKE, static_cast < a2dPropertyIdStroke::ConstGet >( &a2dCanvasObject::MX_GetStroke ), static_cast < a2dPropertyIdStroke::ConstSet >( &a2dCanvasObject::MX_SetStroke ) );
1315 AddPropertyId( PROPID_Stroke );
1327 AddPropertyId( PROPID_FillColour );
1331 AddPropertyId( PROPID_StrokeColour );
1351 AddPropertyId( PROPID_ModificationDateTime );
1355 AddPropertyId( PROPID_AccessDateTime );
1388 EVT_CHAR( a2dCanvasObject::OnChar )
1391 a2dCanvasObject::a2dCanvasObject(
double x,
double y )
1393 m_lworld.Translate( x, y );
1406 m_flags = m_flagsInit;
1490 #if defined(_DEBUG) && defined (SMART_POINTER_DEBUG)
1492 CurrentSmartPointerOwner =
this;
1496 a2dHabitat* a2dCanvasObject::GetHabitat()
const
1499 return m_root->GetHabitat();
1512 bool returnIsPolygon =
true;
1514 if ( segList && returnIsPolygon )
1517 polylist->push_back(
new a2dPolygonL( segList ) );
1530 a2dCanvasObjectList::iterator iter = vpath->begin();
1531 while ( iter != vpath->end() )
1536 iter = vpath->erase( iter );
1537 iter = vpath->begin();
1547 bool returnIsPolygon =
false;
1549 if ( segList && returnIsPolygon )
1570 a2dCanvasObjectList::iterator iter = vpath->begin();
1571 while ( iter != vpath->end() )
1576 iter = vpath->erase( iter );
1577 iter = vpath->begin();
1585 int i, count = polylist->size();
1586 a2dCanvasObjectList::iterator iterp = polylist->begin();
1587 for( i = 0 ; i < count ; i++ )
1591 if ( polyline && polyline->GetNumberOfSegments() > 2 )
1599 polylist->push_back( conv );
1600 iterp = polylist->erase( iterp );
1613 if ( restrictEngine )
1616 if( xold != x || yold != y )
1634 if( xold != x || yold != y )
1678 if ( !editcopy->
DoStartEdit( editmode, editstyle ) )
1780 Append( handle =
new a2dHandle(
this, x + w, y + h , wxT(
"handle3" ) ) );
1784 Append( handle =
new a2dHandle(
this, x, y + h / 2 , wxT(
"handle12" ) ) );
1786 Append( handle =
new a2dHandle(
this, x + w / 2, y + h, wxT(
"handle23" ) ) );
1788 Append( handle =
new a2dHandle(
this, x + w, y + h / 2 , wxT(
"handle34" ) ) );
1790 Append( handle =
new a2dHandle(
this, x + w / 2, y, wxT(
"handle41" ) ) );
1793 if ( allowrotation )
1795 a2dSLine* rotline =
new a2dSLine( x + w / 2, y + h / 2, x + w * 3 / 4, y + h / 2 );
1802 Append( handle =
new a2dHandle(
this, x + w * 3 / 4, y + h / 2, wxT(
"rotate" ) ) );
1804 rotline->SetBin2(
true );
1808 Append( handle =
new a2dHandle(
this, x + w * 3 / 4, y + h, wxT(
"skewx" ) ) );
1810 Append( handle =
new a2dHandle(
this, x + w, y + h * 3 / 4, wxT(
"skewy" ) ) );
1890 if ( handle && handle->
GetName() == name )
1904 switch( event.GetKeyCode() )
1930 win->PopupMenu( prop->GetValue(),
event.GetMouseEvent().GetX(),
event.GetMouseEvent().GetY() );
1956 wxTipWindow* tipWindow =
wxDynamicCast( tipProp->GetValue(), wxTipWindow );
1961 tipWindow->SetTipWindowPtr( NULL );
1965 wxRect tipRect = tipProp->
GetRect();
1966 wxPoint aWinPos( 0, 0 );
1967 aWinPos = win->ClientToScreen( aWinPos );
1968 wxRect aRect( aWinPos.x + event.
GetMouseEvent().GetX() - tipRect.GetX(),
1969 aWinPos.y +
event.GetMouseEvent().GetY() - tipRect.GetY(), tipRect.GetWidth(), tipRect.GetHeight() );
1973 wxPoint aWinPos1 = win->ClientToScreen( aRect.GetTopLeft() );
1974 wxPoint aWinPos2 = win->ClientToScreen( aRect.GetBottomRight() );
1975 aRect = wxRect( aWinPos1, aWinPos2 );
1977 tipWindow =
new wxTipWindow( win, tipProp->
GetString(), 200 , ( wxTipWindow** )tipProp->GetValuePtr(), &aRect );
1978 tipProp->SetValue( tipWindow );
1982 #ifdef _DEBUG_REPORTHIT
1983 wxLogDebug( wxT(
"%s %p" ), wxT(
"enter" ),
this );
2012 wxTipWindow* tipWindow =
wxDynamicCast( tipProp->GetValue(), wxTipWindow );
2025 #ifdef _DEBUG_REPORTHIT
2026 wxLogDebug( wxT(
"%s %p" ), wxT(
"leaf" ),
this );
2042 a2dCanvasObjectList::reverse_iterator iter =
m_childobjects->rbegin();
2048 if ( obj->
m_flags.m_MouseInObject )
2052 obj->
m_flags.m_MouseInObject =
false;
2055 hitEvent.SetProcessed( obj->ProcessEvent( leave ) );
2069 a2dHandle* draghandle =
event.GetCanvasHandle();
2082 bool __includeChildren__ = PROPID_IncludeChildren->
GetPropertyValue(
this );
2084 if ( __includeChildren__ )
2089 double xmin, ymin, xmax, ymax, w, h;
2098 double x1, y1, x2, y2;
2105 if ( restrictEngine )
2118 a2dGeneralGlobals->RecordF(
this, wxT(
"setproperty __M_Transform { matrix ( %g %g %g %g %g %g ) } transform" ),
2127 if ( restrictEngine )
2131 if ( draghandle->
GetName() == wxT(
"handle1" ) )
2141 sx = ( w - dx / 2 ) / w;
2145 sy = ( h - dy / 2 ) / h;
2158 else if ( draghandle->
GetName() == wxT(
"handle2" ) )
2168 sx = ( w - dx / 2 ) / w;
2172 sy = ( h + dy / 2 ) / h;
2185 else if ( draghandle->
GetName() == wxT(
"handle3" ) )
2195 sx = ( w + dx / 2 ) / w;
2199 sy = ( h + dy / 2 ) / h;
2212 else if ( draghandle->
GetName() == wxT(
"handle4" ) )
2222 sx = ( w + dx / 2 ) / w;
2226 sy = ( h - dy / 2 ) / h;
2239 else if ( draghandle->
GetName() == wxT(
"rotate" ) )
2262 else if ( draghandle->
GetName() == wxT(
"skewx" ) )
2267 dx = xwi - ( xmin + w * 3 / 4 );
2268 dy = ywi - ( ymin + h / 2 );
2279 else if ( draghandle->
GetName() == wxT(
"skewy" ) )
2284 dx = xwi - ( xmin + w / 2 );
2285 dy = ywi - ( ymin + h * 3 / 4 );
2296 else if ( draghandle->
GetName() == wxT(
"handle12" ) )
2305 sx = ( w - dx / 2 ) / w;
2318 else if ( draghandle->
GetName() == wxT(
"handle23" ) )
2327 sy = ( h + dy / 2 ) / h;
2340 else if ( draghandle->
GetName() == wxT(
"handle34" ) )
2349 sx = ( w + dx / 2 ) / w;
2362 else if ( draghandle->
GetName() == wxT(
"handle41" ) )
2371 sy = ( h - dy / 2 ) / h;
2404 a2dCanvasObjectMouseEvent popup( ic,
this, wxEVT_CANVASOBJECT_POPUPMENU_EVENT, event.GetX(),
event.GetY(),
event.m_mouseevent );
2405 popup.SetEventObject(
this );
2407 if ( !this->ProcessEvent( popup ) )
2418 static double xshift;
2419 static double yshift;
2448 if ( restrictEngine )
2515 a2dGeneralGlobals->RecordF(
this, wxT(
"setproperty __M_Transform { matrix ( %g %g %g %g %g %g )} transform" ),
2527 if( restrictEngine )
2647 m_flags.SetSpecificFlags( setOrClear, which );
2657 return m_flags.GetFlag( which );
2667 return m_flags.CheckMask( mask );
2731 event.SetEventObject(
this );
2734 ProcessEvent( event );
2736 if ( event.
GetEdited() && !allprop.empty() )
2739 a2dNamedPropertyList::iterator iter;
2740 for( iter = allprop.begin(); iter != allprop.end(); ++iter )
2757 bool a2dCanvasObject::DoIgnoreIfNotMember(
const a2dPropertyId&
id )
2759 return id.IsOnlyMember() ||
id.IsOnlyMemberHint();
2775 if ( visProp && visProp->
GetPropId() ==
event.GetPropertyId() )
2776 visProp->ProcessEvent( event );
2789 object->SetRoot(
m_root );
2790 object->SetIsProperty(
true );
2818 wxASSERT_MSG( !aView || aView->
GetViewDependentObjects() , wxT(
"a2dDrawingPart::GetViewDependentObjects() is not set" ) );
2823 setv.SetSkipNotRenderedInDrawing(
true );
2828 bool enPending = FALSE;
2841 if( onlyinternalarea )
2847 if ( view == aView )
2861 if ( view == aView )
2896 a2dFill a2dCanvasObject::GetFill()
const
2904 if ( !GetFill().IsNoFill() )
2911 return wxColour( 0, 0, 0 );
2946 a2dStroke a2dCanvasObject::GetStroke()
const
2954 if ( !GetStroke().IsNoStroke() )
2960 return wxColour( 0, 0, 0 );
2970 const a2dFill& a2dCanvasObject::MX_GetFill()
const
2974 a2dNamedPropertyList::const_iterator iter;
2978 if ( prop->
GetId() == PROPID_Fill )
2981 return propfill->GetValue();
2989 void a2dCanvasObject::MX_SetFill(
const a2dFill& value )
2996 double x2 = fill.
GetStop().m_x;
2997 double y2 = fill.
GetStop().m_y;
2998 if ( x1 == x2 && y1 == y2 )
3015 if ( xfc == xe && yfc == ye )
3023 double radius = wxMax( ( xe - xr ), ( ye - yr ) );
3031 a2dNamedPropertyList::const_iterator iter;
3035 if ( prop->
GetId() == PROPID_Fill )
3038 propfill->SetValue( fill );
3047 const a2dStroke& a2dCanvasObject::MX_GetStroke()
const
3051 a2dNamedPropertyList::const_iterator iter;
3055 if ( prop->
GetId() == PROPID_Stroke )
3058 return propstroke->GetValue();
3066 void a2dCanvasObject::MX_SetStroke(
const a2dStroke& value )
3070 a2dNamedPropertyList::const_iterator iter;
3074 if ( prop->
GetId() == PROPID_Stroke )
3077 propstroke->SetValue( value );
3159 , wxT(
"pinclass connection generator not set" ) );
3236 tmparea.width = x2 - x1;
3237 tmparea.height = y2 - y1;
3241 tmparea.Inflate( inflate );
3277 if ( clipparent ==
_ON )
3308 a2dCanvasObjectList::reverse_iterator boxiter =
m_childobjects->rbegin();
3315 if ( obj->
m_flags.m_ChildOnlyTranslate )
3327 if ( clipparent !=
_OUT &&
3354 for ( j = 0; j < wxMAXLAYER; j++ )
3365 if ( layerobj == wxNullLayerInfo )
3376 ( !filterSelectableLayers || filterSelectableLayers && layerobj->
GetSelectable() )
3423 ( ! GetIgnoreLayer() &&
3493 double xrel = hitEvent.
m_relx;
3494 double yrel = hitEvent.
m_rely;
3509 a2dNamedPropertyList::const_iterator iter;
3589 double StrokeExtend = 0;
3598 StrokeExtend = layerpen.
GetWidth() / 2;
3600 StrokeExtend = layerpen.
GetWidth() / 2;
3610 StrokeExtend = stroke.
GetWidth() / 2;
3734 wxUint32 optioncurrent = hitEvent.
m_option;
3744 wxASSERT_MSG( ic.
GetLayer() != wxLAYER_ALL, _T(
" a2dIterC::GetPerLayerMode() can only render one layer at the time" ) );
3748 for ( j = 0; j < wxMAXLAYER; j++ )
3758 if ( layerinfo == wxNullLayerInfo )
3818 a2dCanvasObjectList::reverse_iterator iter =
m_childobjects->rbegin();
3840 if ( obj->
m_flags.m_ChildOnlyTranslate )
3874 whichchilds = detectchilds;
3881 #ifdef _DEBUG_REPORTHIT
3886 wxLogDebug( wxT(
"hit = %s %p" ), mes, obj );
3888 wxLogDebug( wxT(
"nohit = %s %p" ), mes, obj );
3903 double StrokeExtend = 0;
3912 StrokeExtend = layerpen.
GetWidth() / 2;
3914 StrokeExtend = layerpen.
GetWidth() / 2;
3922 StrokeExtend = stroke.
GetWidth() / 2;
3975 hitEvent.SetProcessed( ProcessEvent( CanvasObjectMouseEvent ) );
3978 hitEvent.SetProcessed( ProcessEvent( *hitEvent.
m_event ) );
4011 ProcessCanvasEventChild( ic, whichchilds, hitEvent );
4020 if ( ! GetIgnoreLayer() &&
4041 bool sentmousevent =
false;
4042 bool localsentmousevent =
false;
4044 bool wasHit = hitEvent.
m_isHit;
4058 a2dNamedPropertyList::const_iterator iter;
4063 if ( canvasprop && canvasprop->
GetVisible() )
4082 ProcessCanvasEventChild( ic, whichchilds, hitEvent );
4092 sentmousevent =
true;
4096 localsentmousevent = LocalHit( ic, hitEvent );
4097 sentmousevent = hitEvent.
m_isHit = localsentmousevent;
4111 if ( ( *hitEvent.
m_event ).GetEventType() == wxEVT_MOTION )
4114 hitEvent.
m_event->Skip(
true );
4120 m_flags.m_MouseInObject =
true;
4124 hitEvent.SetProcessed( ProcessEvent( enter ) );
4126 hitEvent.
m_event->Skip(
true );
4127 hitEvent.SetProcessed(
false );
4132 if ( sentmousevent )
4145 hitEvent.SetProcessed( ProcessEvent( CanvasObjectMouseEvent ) );
4148 hitEvent.SetProcessed( ProcessEvent( *hitEvent.
m_event ) );
4156 if ( ( *hitEvent.
m_event ).GetEventType() == wxEVT_MOTION )
4159 hitEvent.
m_event->Skip(
true );
4170 m_flags.m_MouseInObject =
false;
4173 hitEvent.SetProcessed( ProcessEvent( leave ) );
4175 hitEvent.
m_event->Skip(
true );
4176 hitEvent.SetProcessed(
false );
4191 double dx = pointToSnap.m_x - pointToSnapTo.m_x;
4192 double dy = pointToSnap.m_y - pointToSnapTo.m_y;
4193 double snappedDx = bestPointSofar.m_x - pointToSnapTo.m_x;
4194 double snappedDy = bestPointSofar.m_y - pointToSnapTo.m_y;
4196 if ( fabs( dx ) < thresHoldWorld && fabs( dy ) < thresHoldWorld )
4198 if ( fabs( dx ) < fabs( snappedDx ) && fabs( dy ) < fabs( snappedDy ) )
4202 bestPointSofar = pointToSnap;
4229 ( ( snapToWhat & a2dRestrictionEngine::snapToPinsUnconnected ) && !pin->
IsConnectedTo() )
4239 if ( snapToWhat & a2dRestrictionEngine::snapToObjectPos )
4253 if ( obj->
RestrictToObject( ic, pointToSnapTo, bestPointSofar, a2dRestrictionEngine::snapToObjectVertexes, thresHoldWorld ) )
4313 snappathlist->push_back( snappath );
4328 ( snapToWhat & a2dRestrictionEngine::snapToPinsUnconnected && !pin->
IsConnectedTo() )
4332 segments->
Add( seg );
4338 if ( snapToWhat & a2dRestrictionEngine::snapToObjectPos )
4341 segments->
Add( seg );
4392 return snappathlist;
4417 if ( obj->
m_flags.m_ChildOnlyTranslate )
4419 childboxOnlyTranslate = obj->
GetBbox();
4420 childboxOnlyTranslate.
MapBbox( transworld );
4428 if ( childboxOnlyTranslate.
GetValid() )
4429 childbox.
Expand( childboxOnlyTranslate );
4478 alignbox.
Expand( alignpoints->Item(0)->
m_x, alignpoints->Item(0)->
m_y );
4479 alignbox.
Expand( alignpoints->Item(1)->
m_x, alignpoints->Item(1)->
m_y );
4480 alignbox.
Expand( alignpoints->Item(2)->
m_x, alignpoints->Item(2)->
m_y );
4481 alignbox.
Expand( alignpoints->Item(3)->
m_x, alignpoints->Item(3)->
m_y );
4508 return m_childobjects->
Find( objectname, classname, mask, propid, valueAsString,
id );
4523 bool childpending =
false;
4577 bool foundMiniUpdate =
false;
4578 a2dNamedPropertyList::const_iterator iter;
4585 foundMiniUpdate =
true;
4590 if ( !foundMiniUpdate )
4649 newRelative *= invertMapping;
4650 newRelative *= withoutScale;
4670 newRelative *= invertMapping;
4671 newRelative *= withoutScale;
4673 propMatrix->SetValue( newRelative );
4777 bool fillset =
false;
4778 bool strokeset =
false;
4779 bool viewSpecific =
false;
4787 bool firstclip =
false;
4789 a2dNamedPropertyList::const_iterator iter;
4839 double dx = cos( shadow->GetExtrudeAngle() ) * shadow->GetExtrudeDepth();
4840 double dy = sin( shadow->GetExtrudeAngle() ) * shadow->GetExtrudeDepth();
4864 torender->GetCanvasObject() &&
4868 torender->GetCanvasObject()->
Render( ic, clipparent );
4872 viewSpecific =
true;
4973 a2dNamedPropertyList::const_iterator iter;
4992 torender->GetCanvasObject() &&
4997 torender->GetCanvasObject()->
Render( ic, clipparent );
5008 canobj->
Render( ic, clipparent );
5043 a2dCanvasObjectList::iterator iter;
5115 bool changed =
false;
5119 a2dCanvasObjectList::value_type obj = *iter;
5121 if ( obj && obj->m_release )
5129 if ( ( parent == NULL ) || ( parent != NULL && parent ==
this ) )
5131 if ( obj->HasPins() )
5132 obj->DisConnectWith();
5133 wxUint16 layer = obj->GetLayer();
5154 bool changed =
false;
5158 wxString str = GetClassInfo()->GetClassName();
5172 if ( ( mode & updatemask_countObjects ) )
5194 a2dNamedPropertyList::const_iterator iter;
5231 else if ( GetAlgoSkip() && ( prop->
GetId() == a2dCanvasObject::PROPID_ToolObject ||
5244 bool childchanged =
false;
5254 childchanged = obj->
Update( mode ) || childchanged;
5263 bool propertychanged =
false;
5267 a2dNamedPropertyList::const_iterator iter;
5274 propertychanged = changed;
5282 propertychanged =
true;
5297 double maxworldextend = 0;
5298 double maxpixelextend = 0;
5304 if ( changed || childchanged || propertychanged )
5319 if ( obj->
m_flags.m_ChildOnlyTranslate )
5321 childboxOnlyTranslate = obj->
GetBbox();
5322 childboxOnlyTranslate.
MapBbox( transworld );
5327 maxworldextend = wxMax( obj->
m_worldExtend, maxworldextend );
5328 maxpixelextend = wxMax( obj->
m_pixelExtend, maxpixelextend );
5332 if ( childboxOnlyTranslate.
GetValid() )
5334 childboxOnlyTranslate.
Enlarge( maxworldextend );
5339 childbox.
Enlarge( maxworldextend );
5346 a2dNamedPropertyList::const_iterator iter;
5379 if ( childboxOnlyTranslate.
GetValid() )
5380 childbox.
Expand( childboxOnlyTranslate );
5389 changed =
DoUpdate( mode, childbox, clipbox, propbox ) || changed;
5399 double dx = cos( shadow->GetExtrudeAngle() ) * shadow->GetExtrudeDepth();
5400 double dy = sin( shadow->GetExtrudeAngle() ) * shadow->GetExtrudeDepth();
5404 propbox.
Expand( shadowbox );
5458 DoWalkerWithContext( ic, parent, handler );
5518 obj->
Walker(
this, handler );
5525 #if defined(_DEBUG) && defined (SMART_POINTER_DEBUG)
5534 obj->
Walker(
this, handler );
5535 #if defined(_DEBUG) && defined (SMART_POINTER_DEBUG)
5549 obj->
Walker(
this, handler );
5556 #if wxART2D_USE_CVGIO
5558 void AddFlag( wxString& flags,
const wxString& name,
bool value,
bool defval )
5560 if ( value != defval )
5563 flags = flags +
" " + name;
5565 flags = flags +
" " + name +
"(0)";
5571 if ( xmlparts == a2dXmlSer_attrib )
5577 out.WriteAttribute( wxT(
"layer" ),
m_layer );
5599 AddFlag( s, wxT(
"ChildOnlyTranslate"),
m_flags.m_ChildOnlyTranslate ,
m_flagsInit.m_ChildOnlyTranslate );
5602 out.WriteAttribute( wxT(
"flags" ), s );
5614 out.WriteAttribute( wxT(
"hitflags" ), s );
5619 s.Printf ( wxT(
"matrix( %g %g %g %g %g %g )" ),
5624 out.WriteAttribute( wxT(
"transform" ), s );
5630 out.WriteAttribute( wxT(
"fill" ), wxT(
"inherit" ) );
5634 out.WriteAttribute( wxT(
"stroke" ), wxT(
"inherit" ) );
5647 obj->
Save(
this, out, towrite );
5670 bool ParseFlag( wxString& str, wxString& flagname,
bool& flagvalue, wxString& error )
5672 if ( str == wxT(
"" ) )
5677 for ( i = 0; i < str.Len(); i++ )
5680 while ( wxIsspace( str[i] ) ) i++;
5683 while ( i < str.Len() && isalnum ( str[i] ) )
5685 flagname += str.GetChar( i );
5690 while ( i < str.Len() && wxIsspace( str[i] ) ) i++;
5692 if ( i == str.Len() )
5698 if ( str[i] != wxT(
'(' ) )
5700 error = _(
"CVG parsing error: missing" );
5705 while ( i < str.Len() && wxIsspace( str[i] ) ) i++;
5707 while ( i < str.Len() && str[i] != wxT(
')' ) )
5710 if ( isdigit( str[i] ) )
5712 numstr = str.GetChar( i );
5717 if ( i == str.Len() || str[i] != wxT(
')' ) )
5719 error = _(
"CVG parsing error: missing" );
5722 flagvalue = numstr !=
"0";
5731 if ( xmlparts == a2dXmlSer_attrib )
5740 wxStringTokenizer tkz( flags );
5742 while ( tkz.HasMoreTokens() )
5744 wxString token = tkz.GetNextToken();
5745 wxString flagname, error;
5746 bool flagvalue =
false;
5748 if ( !ParseFlag( token, flagname, flagvalue, error ) )
5753 if ( flagname == wxT(
"selected" ) )
5755 if ( flagname == wxT(
"selected2" ) )
5757 else if ( flagname == wxT(
"selectable" ) )
5759 else if ( flagname == wxT(
"subedit" ) )
5761 else if ( flagname == wxT(
"subeditaschild" ) )
5763 else if ( flagname == wxT(
"visible" ) )
5765 else if ( flagname == wxT(
"draggable" ) )
5767 else if ( flagname == wxT(
"showshadow" ) )
5769 else if ( flagname == wxT(
"filled" ) )
5771 else if ( flagname == wxT(
"a" ) )
5773 else if ( flagname == wxT(
"b" ) )
5775 else if ( flagname == wxT(
"fixedStyle" ) )
5777 else if ( flagname == wxT(
"generatePins" ) )
5779 else if ( flagname == wxT(
"bin" ) )
5781 else if ( flagname == wxT(
"snap" ) )
5783 else if ( flagname == wxT(
"snap_to" ) )
5785 else if ( flagname == wxT(
"pushin" ) )
5787 else if ( flagname == wxT(
"ChildOnlyTranslate" ) )
5788 m_flags.m_ChildOnlyTranslate = flagvalue;
5813 if ( parser.
GetTagName() == wxT(
"properties" ) )
5823 property->Load(
this, parser );
5825 property->SetToObject(
this );
5865 object->Load(
this, parser );
5884 object->Load(
this, parser );
5897 #endif //wxART2D_USE_CVGIO
5904 a2dNamedPropertyList::const_iterator iter;
5922 wxASSERT_MSG( wxMAXLAYER > layer , wxT(
" layer > wxMAXLAYER, index to high" ) );
5929 wxT(
"layer not defined in layer table" ) );
5946 setRecursive.SetSkipNotRenderedInDrawing(
true );
5947 setRecursive.
Start(
this );
5962 wxASSERT_MSG( ic.
GetLayer() != wxLAYER_ALL, _T(
" a2dIterC::GetPerLayerMode() can only render one layer at the time" ) );
5965 for ( j = 0; j < wxMAXLAYER; j++ )
5976 if ( layerinfo == wxNullLayerInfo )
5982 if ( ic.
GetLayer() == wxLAYER_ALL ||
6056 if ( clipparent !=
_IN )
6059 if ( childclip !=
_OUT )
6077 if ( obj->
m_flags.m_ChildOnlyTranslate )
6085 obj->
Render( ic, childclip );
6088 obj->
Render( ic, childclip );
6097 whichchilds = detectchilds;
6110 a2dCanvasObjectList::value_type obj = *iter;
6111 if ( obj && obj->CheckMask( mask ) )
6127 group->SetIgnoreLayer(
true );
6167 a2dCanvasObjectList::value_type directChild = *iter;
6171 a2dCanvasObjectList::iterator subiter = directChild->m_childobjects->begin();
6172 while( subiter != directChild->m_childobjects->end() )
6174 a2dCanvasObjectList::value_type subchild = *subiter;
6176 if ( subchild && !subchild->GetRelease() )
6178 subchild->
Transform( directChild->GetTransformMatrix() );
6180 subiter = directChild->m_childobjects->erase( subiter );
6267 int totalreleased = 0;
6273 if ( totalreleased )
6293 return totalreleased;
6330 void a2dCanvasObject::SetTemplate(
bool b )
6336 void a2dCanvasObject::SetExternal(
bool b )
6342 void a2dCanvasObject::SetUsed(
bool b )
6348 bool a2dCanvasObject::GetTemplate()
const
6354 bool a2dCanvasObject::GetExternal()
const
6360 bool a2dCanvasObject::GetUsed()
const
6371 if(
HasProperty( a2dCanvasObject::PROPID_ToolObject ) )
6446 pin->
GetName().Matches( pinName ) &&
6478 wxASSERT_MSG( pinClass , wxT(
"pinClass may not be NULL" ) );
6514 a2dCanvasObjectList::value_type obj = *iter;
6563 a2dPinList::const_iterator iter;
6566 a2dPin* otherpin = *iter;
6569 if ( !toConnect || toConnect == otherpin->
GetParent() )
6591 bool hasConnectedPins =
false;
6599 if ( !pinc->
GetBin() && ( !pin || ( pinc == pin ) )
6605 a2dPinList::const_iterator iter;
6608 a2dPin* pincother = *iter;
6615 , _(
"connected pinc not reflected in connected pin" ) );
6628 hasConnectedPins |= pincother->
GetParent()->
FindConnectedPins( result, pincother, walkWires, searchPinClass, isConnectedTo );
6630 ( !searchPinClass || searchPinClass == pincother->
GetPinClass() ) &&
6631 ( !isConnectedTo || isConnectedTo == pincother->
GetParent() )
6634 hasConnectedPins =
true;
6635 result.push_back( pincother );
6641 return hasConnectedPins;
6650 bool branchesOke =
false;
6651 bool allBranchesOke =
true;
6657 if ( selectedEnds && !addToResult )
6676 if ( !pin || ( pinc == pin ) )
6680 a2dPinList::const_iterator iterconp;
6686 a2dPin* pincother = *iterconp;
6695 , _(
"connected pinc not reflected in connected pin" ) );
6697 if ( !parentOther->GetBin() )
6701 if ( parentOther->IsConnect() )
6703 if ( walkWires && ( !stopAtSelectedWire || stopAtSelectedWire && !parentOther->IsSelected() ) )
6705 bool downHereOke = parentOther->
FindConnectedWires( result, NULL, walkWires, selectedEnds,
false,
true );
6706 branchesOke |= downHereOke;
6707 allBranchesOke &= downHereOke;
6712 if ( !selectedEnds || selectedEnds && parentOther->IsSelected() )
6717 allBranchesOke =
false;
6723 if ( parentOther->IsConnect() )
6727 if ( !selectedEnds || selectedEnds && parentOther->IsSelected() )
6732 if ( !selectedEnds || selectedEnds && parentOther->IsSelected() )
6737 allBranchesOke =
false;
6744 if ( !selectedEnds )
6751 if ( addToResult && branchesOke )
6752 result.push_back(
this );
6766 a2dPinList::const_iterator iterconp;
6769 a2dPin* pincother = *iterconp;
6777 connected->push_back( pincother->
GetParent() );
6783 connected->push_back( pincother->
GetParent() );
6898 if ( pinname.IsEmpty() )
7014 a2dPinList::const_iterator iterconp;
7017 a2dPin* pincother = *iterconp;
7023 , _(
"connected pinc not reflected in connected pin" ) );
7025 if ( pin->
GetParent()->GetClassInfo()->IsKindOf( pincother->
GetParent()->GetClassInfo() ) )
7039 wxASSERT_MSG( fabs( pinc->
GetAbsX() - pinother->
GetAbsX() ) < GetHabitat()->ACCUR() &&
7040 fabs( pinc->
GetAbsY() - pinother->
GetAbsY() ) < GetHabitat()->ACCUR()
7041 , _(
"two pins are not at same position" ) );
7057 if ( fabs( pinc->
GetAbsX() - pinother->
GetAbsX() ) < GetHabitat()->ACCUR() &&
7058 fabs( pinc->
GetAbsY() - pinother->
GetAbsY() ) < GetHabitat()->ACCUR() )
7070 if ( fabs( pinc->
GetAbsX() - pinother->
GetAbsX() ) < GetHabitat()->ACCUR() &&
7071 fabs( pinc->
GetAbsY() - pinother->
GetAbsY() ) < GetHabitat()->ACCUR() )
7095 for( a2dCanvasObjectList::iterator itero = toDisConnect->
m_childobjects->begin(); itero != toDisConnect->
m_childobjects->end(); ++itero )
7101 if ( pinname.IsEmpty() || pinname == pinc->
GetName() )
7116 a2dPinList::const_iterator iterconp;
7119 a2dPin* pinother = *iterconp;
7144 if ( pinc && ( pinc == toDisConnect || !toDisConnect ) )
7146 a2dPinList::const_iterator iterconp;
7149 a2dPin* pinother = *iterconp;
7172 for( a2dCanvasObjectList::const_iterator iter = allpinobjects.begin(); iter != allpinobjects.end(); ++iter )
7179 ConnectWith( parent, obj , wxT(
"" ), GetHabitat()->ACCUR(), undo );
7200 a2dPinList::const_iterator iterconp;
7203 a2dPin* other = *iterconp;
7250 a2dPinList::const_iterator iterconp;
7253 a2dPin* pincother = *iterconp;
7261 if ( needsupdateonly )
7281 bool a2dCanvasObject::ProcessCanvasEventChild(
a2dIterC& ic, RenderChild& whichchilds,
a2dHitEvent& hitEvent )
7294 wxASSERT_MSG( ic.
GetLayer() != wxLAYER_ALL, _T(
" a2dIterC::GetPerLayerMode() can only hit one layer at the time" ) );
7298 for ( j = 0; j < wxMAXLAYER; j++ )
7309 if ( layerinfo == wxNullLayerInfo )
7320 ProcessCanvasEventChildOneLayer( ic, whichchilds, hitEvent );
7330 ProcessCanvasEventChildOneLayer( ic, whichchilds, hitEvent );
7336 bool a2dCanvasObject::ProcessCanvasEventChildOneLayer(
a2dIterC& ic, RenderChild& whichchilds,
a2dHitEvent& hitEvent )
7338 RenderChild detectchilds;
7339 detectchilds.m_postrender =
false;
7340 detectchilds.m_prerender =
false;
7341 detectchilds.m_property =
false;
7345 a2dCanvasObjectList::reverse_iterator iter =
m_childobjects->rbegin();
7358 detectchilds.m_property = detectchilds.m_property || obj->
GetIsProperty();
7378 whichchilds = detectchilds;
7385 void a2dCanvasObject::Dump(
int indent )
7387 wxString line( wxT(
' ' ), indent );
7389 line += wxString::Format( wxT(
"a ((%s*)0x%p), x=%lg, y=%lg" ), GetClassInfo()->GetClassName(),
this,
GetPosX(),
GetPosY() );
7391 DoDump( indent, &line );
7398 obj->Dump( indent + 2 );
7402 void a2dCanvasObject::DoDump(
int WXUNUSED( indent ), wxString* line )
7405 *line += wxT(
" pTO" );
7407 *line += wxT(
" pTD" );
7409 *line += wxT(
" pEC" );
7411 *line += wxT(
" pOR" );
7413 *line += wxT(
" fEC" );
7415 *line += wxT(
" fED" );
a2dHit m_how
return in which way the object was hit (stroke, fill, ...)
Display Part of a a2dDrawing, in which a2dCanvasObjects are shown.
bool m_processed
set if event was processed sofar
void PushCursor(const wxCursor &cursor)
push a cursor on the cursor stack, and set display cursor to new back being cursor.
virtual void EndFilter(a2dIterC &ic, a2dCanvasObject *canvasObject)
called from a2dCanvasObject to reset filtering feature when filtered object goes out of context...
virtual void MakeReferencesUnique()
All direct a2dCanvasObject which are part of this one are made unique.
virtual bool ProcessCanvasObjectEvent(a2dIterC &ic, a2dHitEvent &hitEvent)
Hit objects will receive the event.
perform snapping to boundingbox of objects
wxPoint2DDouble a2dPoint2D
this to define if coordinate numbers are integer or doubles
bool IsStrokeHit() const
true if this is a stroke hit (parent or child/member stroke)
void OnHandleEvent(a2dHandleMouseEvent &event)
called if a mouse event occured on a child object, that is a handle
double m_relx
(world coordinates) hit point x relative to the canvas object its parent object(s) ...
a2dPropertyIdTyped< wxMenu *, a2dMenuProperty > a2dPropertyIdMenu
property of this type
a2dAffineMatrix & Mirror(bool y=true, bool x=false)
mirror a matrix in x, y
double GetHeight() const
returns height of the boundingbox
virtual void ConnectPinsCreateConnect(a2dCanvasObject *parent, a2dPin *pinc, a2dPin *pinother, bool undo=false)
connect two pins
bool GetSnap() const
is snap flag set?
virtual void Render(a2dIterC &ic, OVERLAP clipparent)
Render this object to the active a2dDrawingPart.
(In) Visible property that can be added to Docview Objects.
double GetAbsY() const
get absolute Y position of the pin ( after applying the parent's matrix and its own matrix ) ...
virtual bool DisConnectWith(a2dCanvasObject *toDisConnect=NULL, const wxString &pinname=wxT(""), bool undo=false)
Do Disconnect from another a2dCanvasObject by pin name.
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
bool m_objectLevel
indicates type of constructor used.
#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.
void SetRoot(a2dDrawing *root, bool recurse=true)
Sets this object to a a2dCanvasDocument.
virtual void SetTransform(const a2dAffineMatrix &userToWorld)
set user-to-world transform matrix.
virtual bool DoIsHitWorld(a2dIterC &ic, a2dHitEvent &hitEvent)
Does hit test on the object (exclusif child objects)
a2dPoint2D GetCentre() const
get centre
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.
bool GetGeneratePins() const
get the GeneratePins flag
a2dCanvasObjectList * CreateChildObjectList()
create and get the list where the child objects are stored in.
a2dCanvasObjectReference is a reference to any a2dCanvasObject derived class.
virtual bool GetVisible() const
some derived properties can be visible or not and override this
void OnEnterObject(a2dCanvasObjectMouseEvent &event)
called when the mouse enters the object
void SetGeneratePins(bool value)
set the GeneratePins flag
bool m_stroke_non_transparent
only when non transparent stroke
bool HasAttribute(const wxString &attrib)
Does the current tag have this attribute?
virtual bool IsVirtConnect() const
object is a virtual connection (connects invisible with other objects without using wires ) ...
property to hold a a2dAffineMatrix
virtual void SetParent(a2dCanvasObject *parent)
set parent object of the pin or some other objects that needs a parent
void AddPending(a2dIterC &ic)
search objects ( if nested recursive ) that have the pending flag Set
a2dHandle is used inside editing versions of a certain objects.
bool RemoveScale()
Remove Scale:
virtual bool IsTemporary_DontSave() const
Check if this is a temporary object, which should not be saved.
bool GetEditable() const
get if the object may be edited
virtual bool HasProperty(const a2dPropertyId *id, const wxString &stringvalue=wxEmptyString) const
Check if the object has a property with given id and string representation.
bool CanConnectWith(a2dIterC &ic, a2dCanvasObject *toConnect, bool autocreate)
check connect to other object
mouse event sent from a2dCanvasObject to itself
~a2dExtendedResult()
Destructor.
void ClearCorridorPath(bool uncapture)
Reset all corridor paths and uncapture object.
a2dConnectTask
flags for searching a connecting a2dpinClass, for the connecting task at hand.
void SetRotation(double rotation)
Sets a rotation of this object.
static const a2dCanvasObjectFlagsMask HasPins
bool GetConnected(a2dCanvasObjectList *connected, bool needsupdate)
get connected objects that are connected to this object via its pins.
int WorldToDeviceY(double y) const
convert y from world to device coordinates
const a2dStroke * a2dBLACK_STROKE
global a2dStroke stock object for BLACK stroking
a2dAffineMatrix m_relativetransform
the accumulated transforms up to and including m_object->m_lworld
const a2dAffineMatrix & GetParentTransform() const
Get the accumulated transform up to but NOT including m_lworld of the current obejct.
bool ParseCvgTransForm(a2dAffineMatrix &result, a2dIOHandlerXmlSerIn &parser)
parse Cvg transform of object
void SetFoundCorridorEnd(bool foundCorridorEnd)
when there is a corridorPath set, this is used internal to set this flag to indicate that the end of ...
bool m_selected2
object is selected2
virtual void PopTransform(void)
Recall the previously saved user-to-world transform off the matrix stack.
const a2dAffineMatrix & GetTransformMatrix() const
get the matrix used to position the object
void SetRelease(bool value)
set release flag
bool m_fill_non_transparent
only when non transparent fill
virtual a2dObject * DoClone(CloneOptions options, a2dRefMap *refs) const
Clone this object and return a pointer to the new object.
XMLeventType Next()
Walks to next element and returns event type.
bool m_editing
true if the object is currently being edited
if set, set in the clone the PROPID_Original property to the copied object
a2dPoint2D GetStop() const
Get stop for gradient fill colour change.
void OnCanvasObjectMouseEvent(a2dCanvasObjectMouseEvent &event)
default handler for mouse events, sent to the object from the a2dDrawingPart.
const a2dFill * a2dINHERIT_FILL
global a2dFill stock object for INHERTED from parent object filling
a2dCanvasObjectHitFlags
event mask flags for a2dCanvasObject hit
bool ResolveOrAdd(a2dSmrtPtr< a2dObject > *storedHere, const wxString &id=wxT(""))
try to resolve the object that is in storedHere when it is a reference.
a2dPropertyIdTyped< wxUint32, a2dUint32Property > a2dPropertyIdUint32
property of this type
class to map references to objects stored in XML, in order to make the connection later on...
virtual a2dCanvasObject * StartEdit(a2dBaseTool *tool, wxUint16 editmode, wxEditStyle editstyle=wxEDITSTYLE_COPY, a2dRefMap *refs=NULL)
create an editcopy and initialize editing of the editcopy
a2dPin * FindEndPin()
Get the end pin from the childs.
Creates a shadow behind a a2dCanvasObject when added as property.
wxColour GetColour2() const
return colour 2
bool RemoveReleased()
child objects which have relesed flag set, are removed as child, called recursive on rleased child ob...
a2dDrawing * m_root
root group for rendering and accessing the canvas's also contains layer settings
virtual wxString GetName() const
Get the ids print and serialization name.
see a2dCommandProcessorEvent
void DecCurrentDepth()
Decrement recursion depth.
transfer this property via a command processor
a2dCanvasObject * GetDeepestHit() const
get deepest object that was hit during event processing down the hierarchy.
this is a hint for DoIgnoreIfNotMember in derived classes
a2dCanvasOFlags m_flags
holds flags for objects
unsigned int GetChildObjectsCount() const
get number of child objects
void SetDrawerStyle(a2dIterC &ic, a2dStyleProperty *style)
sets fill and stroke of object to a2dDrawingPart
virtual void SetVisible(bool visible)
the object is visible or not.
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
const wxRect & GetRect() const
get rect which keep tip visible
a2dError GetLastError() const
get last error encountered
OVERLAP Intersect(const a2dBoundingBox &, double Marge=0) const
a2dPin is used in a2dCanvasObject to add pins to it.
This is a class/type description for a2dPin's.
polygon defined with list of points.
static a2dCanvasOFlags m_flagsInit
holds value for flags to initialize m_flags
static a2dPropertyIdVoidPtr * PROPID_ToolObject
set for objects that act as tool object, when a tool is in action.
virtual void DoWalker(wxObject *parent, a2dWalkerIOHandler &handler)
iterate over this object and its children
bool GetPending() const
is this object pending for update?
a2dCanvasObjectList * GetAsPolygons()
convert to a list of a2dPolygonL and a2dPolylineL
void OnChar(wxKeyEvent &event)
default handler for character events
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:
snap segments of other objects in a2dCanvasObject::RestrictToObject()
a2dDrawing * GetRoot() const
get a2dCanvasDocument of the object.
void Enlarge(const double Marge)
enlarge with the given amount
proptype * GetPropertyListOnly(const a2dObject *obj) const
Get the property from the list in obj ( no members, not cloned )
a2dLayerViewList & GetLayerRenderArray()
get the layer render array
Flags
Flags for property ids.
bool SwitchChildNamed(const wxString &objectname, a2dCanvasObject *newobject)
the object with the given name is released and switched in place to newobject
virtual void SetContourWidth(double width)
set the Contour width of the shape
a2dCanvasObject * GetCaptured() const
are events redirected to a captured corridor? if so return the captured object in it...
const a2dError a2dError_NoError
When cloning, and this flag is set, the property is cloned deep, else not.
double GetHitMarginWorld() const
Get HitMargin used to extend a hittest in world units.
bool SetConnectedPending(bool onoff, bool needsupdateonly)
set connected pending or not pending
a2dObject * Clone(CloneOptions options, a2dRefMap *refs=NULL) const
create an exact copy of this property
bool m_pending
set when a2dCanvasObject needs an update (redraw).
wxUint16 GetLayer()
get the layer that is to be rendered
a2dCanvasOHitFlags m_hitflags
allow hits on basis of those flags
virtual void EndFilter(a2dIterC &ic, a2dCanvasObject *canvasObject)
called from a2dCanvasObject to reset filtering feature when filtered object goes out of context...
This template class is for property ids meant for properties that do not encapsulate another type...
bool SwitchObjectNamed(const wxString &objectname, a2dCanvasObject *newobject)
If object with the given name is found, it is switched to newobject.
virtual bool Update(UpdateMode mode)
Update the state of the object according to its current position etc.
bool GetDepthFirst()
What is the current recursion depth.
virtual void DependencyPending(a2dWalkerIOHandler *handler)
called by to check if this object becomes pending as a result of other objects
static const a2dCanvasObjectFlagsMask PUSHIN
virtual bool RestrictCanvasObjectAtVertexes(a2dCanvasObject *object, a2dPoint2D &point, double &dx, double &dy, wxUint32 sourceRequired=snapToAll, bool ignoreEngine=false)
return the clossest vertex which can be snapped if any.
bool m_fill
only when over filled area of object
virtual int GetCurrentLineNumber()
where in the input was line the current tag
bool GetCanRender() const
return true if the object can be rendered.
static const a2dAffineMatrix & GetIdentityMatrix()
Return a static identity matrix as reference.
#define EVT_CANVASHANDLE_MOUSE_EVENT(func)
static event table macro for a2dHandle mouse event
void IncCurrentDepth()
Increment recursion depth.
virtual bool GeneratePinsPossibleConnections(a2dPinClass *pinClass, a2dConnectTask task, double x, double y, double margin=0)
generates pins on all possible locations where the object can be connected.
void SetDrawerStroke(const a2dStroke &stroke)
Used to set the current stroke.
bool IsIdentity(void) const
Is the matrix the identity matrix?
a2dBoundingBox GetCalculatedBoundingBox(int nChildLevels)
Like GetBbox, but it always calculcates the bounding box from scratch.
virtual void RemoveHierarchy()
move childs of childs and members which have hierarchy one level up to this object its child list...
Defines a font to be set to a2dDrawer2D or stored in a2dCanvsObject etc.
bool GetReverseOrder() const
Get Setting for draw layers in reverse order.
Input and output handler for the XmlSer format.
proptype * GetProperty(a2dObject *obj) const
Get the property in obj (not cloned)
a2dNamedPropertyList m_propertylist
properties
UpdateMode
Various mode flags for Update.
wxColour GetStrokeColour() const
get first colour of stroke
double GetScale()
See GetScale()
snap to pins in other objects when not connected
void SetStrokeWorldExtend(double worldStrokeExtend)
Set strokeworld extend of last added object, used in a2dCanvasObject::DoIsHitWorld() ...
if set, clone childs, otherwise ref-copy them
bool GetPixelStroke() const
if the width is pixels or not.
double GetValue(int col, int row) const
get the value in the matrix at col,row
a command processor specially designed to work with a a2dCanvasDocument
void SetSelectable(bool selectable)
Allows to select this object.
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 a2dVertexArray * GetAlignmentPoints()
Return a list of points to align object with others.
a2dCanvasObjectPtr m_object
the canvas object at the current level of iteration
bool GetThresholdDrawRectangle() const
underneath the threshold draw a rectangle instead of the real object.
object hit should not have select flag set
virtual bool Filter(a2dIterC &ic, a2dCanvasObject *canvasObject)
called from a2dCanvasObject to filter objects for rendering
a2dPropertyIdTyped< bool, a2dBoolProperty > a2dPropertyIdBool
property of this type
virtual bool Filter(a2dIterC &ic, a2dCanvasObject *canvasObject)
called from a2dCanvasObject to filter objects for rendering
a2dPin * IsConnectedTo(a2dPin *pin=a2dAnyPin) const
Return the pin to which this pin is connected.
a2dNamedProperty * GetProperty(const a2dPropertyId *propertyId, a2dPropertyId::Flags flags=a2dPropertyId::flag_none) const
get property on this object
virtual bool Filter(a2dIterC &ic, a2dCanvasObject *canvasObject)
called from a2dCanvasObject to filter objects for rendering
static const a2dCanvasObjectFlagsMask FILLED
A2DGENERALDLLEXP a2dWalkEvent a2dWalker_a2dCanvasObjectPreChild
id for a2dWalkEvent issued from within a2dWalkerIOHandler
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
void SetViewDependent(a2dDrawingPart *aView, bool viewdependent, bool viewspecific=false, bool onlyinternalarea=false, bool deep=false)
set the object view dependent and maybe process all children to set these flags
This is one hit result from a2dExtendedResult.
set the a2dCanvasObject's view dependent
static const a2dCanvasObjectFlagsMask generatePins
list of a2dNamedProperty objects
bool SkewX(double degrees)
Skew Xaxis:
void foreach_mf(void(a2dCanvasObject::*mfp)())
call fp for each object
wxUint16 GetPrimitiveThreshold() const
get drawing threshold
virtual ~a2dCanvasObject()
destructor called by derived objects
bool GetFlag(const a2dCanvasObjectFlagsMask which) const
get specific bitflag value
virtual bool GetCanRender() const
some derived properties can be renderable or not and override this
wxUint16 m_layer
layer of object, default wxLAYER_DEFAULT
bool CreateWiresOnPins(a2dCanvasObject *parent, bool undo, bool onlyNonSelected=false)
create wires on pins which do not have wires, but directly are connected to other objects...
virtual void DoLoad(wxObject *parent, a2dIOHandlerXmlSerIn &parser, a2dXmlSer_flag xmlparts)
load object specific CVG data
Search the list before searching members.
OVERLAP GetClipStatus(a2dIterC &ic, OVERLAP clipparent)
used for deciding if the object needs to be rendered against the current clipping area of the active ...
vertex array of line and arc segments.
a2dCanvasObjectFlagsMask GetFlags() const
get bitflags as an integer
property to hold a window type variable (for example wxTipWindow) to be associated with a a2dObject ...
a2dPropertyIdTyped< a2dSmrtPtr< a2dObject >, a2dProperty > a2dPropertyIdRefObject
property of this type
a2dCanvasObject is the base class for Canvas Objects.
a2dCanvasObject * GetObject() const
the object where the iterative context is currently
wxColour GetColour() const
return colour 1
std::vector< a2dLayerInfoPtr > & GetLayerIndex()
return array index on Layer
void SetSize(double size)
Set the font size.
a2dAffineMatrix a2dIDENTITY_MATRIX
global a2dAffineMatrix to set/pass the identity matrix.
a2dHit m_type
type of the hit
OVERLAP GetClipStatus() const
what is the clipping withing the current view for the last added object in context ...
a2dCanvasObject * CreateHierarchy(a2dCanvasObjectFlagsMask mask, bool createref=true)
object with the same given mask are made into a group.
virtual bool GeneratePossibleConnections(a2dCanvasObject *object, a2dPinClass *pinClass, a2dConnectTask task, double x, double y, double margin) const
generate temporary pins to which objects can connect
bool And(a2dBoundingBox *, double Marge=0)
intersect the boundingbox with another, return true if the result is non zero
virtual void SetParent(a2dCanvasObject *parent)
set parent object of the pin
bool SetPointIfCloser(const a2dPoint2D &pointToSnapTo, const a2dPoint2D &pointToSnap, a2dPoint2D &bestPointSofar, double thresHoldWorld)
bool m_used
GDSII format flag.
a2dCanvasObject * GetObject()
Get the current object.
virtual a2dObject * GetRefObject() const
when a2dProperty, return its value else assert
void ReStartEdit(wxUint16 editmode)
to restart editing in a different mode
a2dLayers * GetLayerSetup()
Get the layersettings for the canvas.
void SetEditable(bool editable)
Sets if this object may be edited.
a2dCanvasObjectList * GetChildObjectList()
get the list where the child objects are stored in.
a2dCanvas uses a2dCanvasView for displaying a view on a a2dCanvasDocument.
vertex list of line and arc segments.
virtual wxObject * CreateObject(const wxString &symbolicName)
Creates an specific object by name.
void TransformPoint(double x, double y, double &tx, double &ty) const
Transform a point.
void SetObjectFilter(a2dCanvasObjectFilter *filter)
set object filter class.
OVERLAP m_clip
how far this object in the view being rendered
bool m_snap_to
snapping of other objects to this when in place
bool GetUseObjRect() const
is the tip based on a2dCanvasObject boundingbox
double GetRotation() const
return rotation
wxString GetName() const
get the name given to the handle.
virtual void EndEdit()
cleanup an editcopy object
virtual void DoRender(a2dIterC &ic, OVERLAP clipparent)
render derived object
~a2dIterCU()
Restore the iteration context.
double TransformDistance(double distance) const
Transform a distance.
bool GetSelected() const
is the object selected flag set
return to contain edit bbox, suitable for editing matrix of object
void SetFlags(a2dCanvasObjectFlagsMask newmask)
set bit flags of object (true or false) to given newmask values
void SetSelected(bool selected)
Set the object selected flag if allowed.
bool GetVisible()
is the layer visible
a2dAffineMatrix m_inverseRelativetransform
inverse of m_relativetransform
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 SetHitMarginWorld(double world)
used to extend a hittest with the given margin in world coordinates.
bool m_external
GDSII format flag.
bool m_selected
object is selected
double GetHitMarginWorld() const
hit marging in world units.
void SetBin(bool bin)
general flag use at will.
void ReWireConnected(a2dCanvasObject *parent, bool undo=false)
rewire the object to keep connection or to make connection with other objects
bool m_release
when set object is treated as being deleted, and wil be deleted in idle time.
bool IsVisible() const
get visibility (rendering depends on layer settings also)
void EndFilterObject(a2dCanvasObject *canvasObject)
called when filter ends
bool GetPreRender() const
returns the current prerender setting.
int ReleaseChild(a2dCanvasObject *obj, bool backwards=false, bool all=false, bool now=false, bool undoCommands=false)
remove the given object from the childobjects
static a2dPropertyIdBool * PROPID_FirstEventInObject
set in Startedit(), to be used to detect first (mouse)event sent to object.
float m_worldExtend
world extend in world coordinates.
A2DGENERALDLLEXP a2dWalkEvent a2dWalker_a2dCanvasObjectPostChild
id for a2dWalkEvent issued from within a2dWalkerIOHandler
a2dAffineMatrix m_lworld
used for positioning the object (x,y,ang,scale etc.)
static a2dPropertyIdRefObject * PROPID_ViewSpecific
The point hits a child of the object.
wxUint64 a2dCanvasObjectFlagsMask
mask flags for a2dCanvasObject
void SetDrawerFill(const a2dFill &fill)
Used to set the current fill.
bool m_generatePins
generate pins if true
Io handler to iterate through a a2dDocument.
bool GetGroupA() const
get the groupA flag
bool SetPosXYRestrict(double &x, double &y)
set position to x,y but restricted, returns new values
a2dFillStyle
Filling styles for a2dFill.
bool m_b
group B flag (e.g boolean operations)
void OnPropertyChanged(a2dComEvent &event)
a2dWirePolylineL is a polyline that adjusts itself when the objects it connects move ...
wxMouseEvent & GetMouseEvent()
return the original mouse event that was redirected to the a2dHandle
bool GetCheck() const
general flag use at will.
#define EVT_CANVASOBJECT_POPUPMENU_EVENT(func)
static event table macro for a2dCanvasObject mouse Right Down event
void Transform(const a2dAffineMatrix &tworld, const wxString &type=wxT(""), a2dCanvasObjectFlagsMask mask=a2dCanvasOFlags::ALL, const a2dPropertyId *id=NULL)
Transform objects fitting the given filter.
void SetGroupA(bool value)
set the groupA flag
snap to other objects its vertexes, which are decided in a2dCanvasObject::RestrictToObject() ...
bool m_xyRelToChildren
is set, m_x and m_y are supplied relative to the child objects ( object matrix m_world already applie...
a2dObject * GetObjectTip()
quickly get first property with name OBJECTTIP
bool Disconnect(a2dPin *pin=a2dAnyPin, bool forceErase=false)
wxUint32 m_option
the way to hit/traverse the document.
bool m_draggable
can be dragged
void WriteNewLine()
Writes a new line and takes care of indentation.
virtual void PushTransform()
Save the current user-to-world transform on the affine stack.
bool Start(a2dCanvasObject *object)
start setting the root object from here
void SetIgnoreSetpending(bool value=true)
set IgnoreSetpending flag
bool CleanWires(a2dCanvasObjectFlagsMask mask=a2dCanvasOFlags::ALL)
pins one wires to the same kind of wire are removed.
bool GetPreRenderAsChild() const
Returns if this object should be rendered before other children objects.
void ConnectPins(a2dCanvasObject *parent, a2dPin *pinc, a2dPin *pinother, bool undo=false)
connect two pins which must be unconnected and at the same position
a2dText is an abstract base class.
a2dPin * GetPin()
get default pin for graph like structure
a2dCanvasObjectList * wxNullCanvasObjectList
define a NON a2dCanvasObjectList
a2dPropertyIdTyped< wxDateTime, a2dDateTimeProperty > a2dPropertyIdDateTime
property of this type
used to change a property on objects
double ExtendDeviceToWorld(int extend)
Transform a pixel extend from device to world units.
void Mirror(bool x=true, bool y=false)
Mirrors this object in x or y orientation.
void SetTemporaryPin(bool temporaryPin)
void ConnectTo(a2dPin *connectto)
connect this pin to the given pin
bool m_isOnCorridorPath
This object is on the corridor path to a captured object or to a corridored object.
bool GetSelectable()
can objects on this layer be selected
void IncrementObjectCount()
increment currently counted number of objects on this layer inside a document.
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
const a2dBoundingBox & Translate(a2dPoint2D &)
translate with given vector
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
bool GetSelectedOnly() const
returns the current only selected setting.
virtual void DrawRoundedRectangle(double x, double y, double width, double height, double radius, bool pixelsize=false)
Draw RoundedRectangle in world coordinates.
bool CheckFlags(Flags flags) const
check a flag mask (all given flags must be set)
virtual bool Filter(a2dIterC &ic, a2dCanvasObject *canvasObject)
called from a2dCanvasObject to filter objects for rendering
a2dCanvasObjectList * m_childobjects
holds child objects
bool m_selectable
can select object
void AddPendingUpdateArea(a2dCanvasObject *obj, wxUint8 id=0, bool refsalso=true)
add pending update for the area that is the boundingbox of the given object
void Transform(const a2dAffineMatrix &tworld)
transform the object using the given matrix
void SetColour(const wxColour &col)
set colour used for gradient and wxSTROKE_MASK_OPAQUE filling.
bool m_visible
is the object visible (overruled by paranet object in some cases during rendering ...
#define forEachIn(listtype, list)
easy iteration for a2dlist
a2dExtendedResult m_extended
extended result information with e.g path to lead to the nested object hit
class draws nothing, still can be used as a drawing context.
void SkipSubTree()
Skips all child elements / tags of current element / tag.
bool m_NoRenderCanvasObject
true is the object is a a2dCanvasObject (or derived ) without rendering something if there or now chi...
virtual void DoUpdateViewDependentObjects(a2dIterC &ic)
update derived objects
polyline defined with list of points.
void OnPopUpEvent(a2dCanvasObjectMouseEvent &event)
called on Right Down by default.
virtual void RenderChildObjectsOneLayer(a2dIterC &ic, RenderChild &whichchilds, OVERLAP clipparent)
to render the child objects
virtual void EndFilter(a2dIterC &ic, a2dCanvasObject *canvasObject)
called from a2dCanvasObject to reset filtering feature when filtered object goes out of context...
void SetPropertyToObject(a2dObject *obj, const basetype &value, SetFlags setflags=set_none) const
Set the property in obj to value.
a2dHitOption
Enum for hit test options.
void ReleaseMouse(a2dIterC &ic)
release the mouse capture for this object
void Walker(wxObject *parent, a2dWalkerIOHandler &handler)
This is used to recursively walk through an object tree.
virtual a2dCanvasObjectList * GetAsCanvasVpaths(bool transform=true) const
when implemented the object without its children, is converted to
bool GetSnapTo() const
is snap_to flag set?
double GetPosX() const
get x position from affine matrix
void Insert(size_t before, a2dCanvasObject *obj, bool ignoreReleased)
insert at index, taking into account released objects if needed.
static const a2dCanvasObjectFlagsMask SELECTABLE
a2dPropertyIdTyped< wxUint16, a2dUint16Property > a2dPropertyIdUint16
property of this type
void SetHitMarginDevice(int pixels)
used to extend a hittest with the number of pixels.
#define EVT_COM_EVENT(func)
static wxEvtHandler for communication event
bool m_stroke
only when over stroked area of object
void SkewY(double angle)
Skew in Y.
virtual bool WalkTask(a2dIterC &ic, wxObject *parent, wxObject *object, a2dWalkEvent event)=0
called from within a2dCanvasDocument
(In)Visible property that can be added to Canvas Objects.
const a2dError a2dError_XMLparse
a2dPoint2D GetStart() const
Get start for gradient fill colour change.
~a2dIterPP()
Restore the iteration context.
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.
a2dPoint2D GetCenter() const
Get start for gradient fill colour change.
virtual void EndFilter(a2dIterC &ic, a2dCanvasObject *canvasObject)
called from a2dCanvasObject to reset filtering feature when filtered object goes out of context...
wxColour GetFillColour() const
get first colour of fill
a2dVertexListPtr GetSegments()
Get the list of points ( this is not a copy! )
Drawing context abstraction.
snap to intersections in other objects
void SetStrokeColour(const wxColour &colour)
set first colour of stroke
static a2dPropertyIdBool * PROPID_TemporaryObject
set for objects that do not have to be saved
void SetCorridorPathCaptureObject(a2dCanvasObject *captureObject)
virtual void DoEndEdit()
only used for editable objects and under control of a editing tool.
bool m_editable
object can be edited
a2dCanvasObject * GetShowObject() const
return pointer of then currently shown object on the drawer.
a2dExtendedResult()
Default constructor.
void SetDisableDrawing(bool disableDrawing)
when set, all drawing functions return immediately.
double wxRadToDeg(double rad)
conversion from radians to degrees
Normal straight line segment in a2dVertexList and a2dVertexArray.
virtual a2dPolygonL * GetClipObject() const
return a2dPolygonL that is used for clipping
virtual void DoSave(wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts, a2dObjectList *towrite)
Save settings.
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
#define EVT_CANVASOBJECT_MOUSE_EVENT(func)
static event table macro for a2dCanvasObject mouse event
virtual void SetPending(bool pending)
set this object pending for update
a2dCanvasObject * HitChildObjectsOneLayer(a2dIterC &ic, RenderChild &whichchilds, a2dHitEvent &hitEvent)
This is an internal function used by IsHitWorldChildObjects(). Don't use it directly.
void SetPerLayerMode(bool value)
if set the rendering is done layers by layer from the top
A2DGENERALDLLEXP a2dSmrtPtr< a2dGeneralGlobal > a2dGeneralGlobals
a global pointer to get to global instance of important classes.
virtual void DoSave(wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts, a2dObjectList *towrite)
write object specific CVGL data
const a2dAffineMatrix & GetUserToDeviceTransform() const
get matrix which transforms directly from relative world coordinates to device
void SetDeepestHit(a2dCanvasObject *canvasObject)
set during event processing down the hierarchy, to the deepest object that was hit ...
void Translate(double x, double y)
relative translate the object to position x,y in world coordinates
void SetUpdatesPending(bool onoff)
Tells the document that an object has changed.
virtual bool DisConnectAt(a2dPin *pin, bool undo=false)
Do Disconnect from another a2dCanvasObject by pin pointer.
general event sent from a2dHandle to its parent a2dCanvasObject
used to disconnect two pins
int Release(a2dCanvasObjectFlagsMask mask=a2dCanvasOFlags::ALL, const wxString &classname=wxT(""), const a2dPropertyId *id=NULL, const wxString &name=wxT(""), bool now=true)
release only objects with the given mask and classname and has property named propertyname and object...
bool m_extendedWanted
fill m_extended or not
void Add(a2dVpathSegment *seg)
add a segment
Restriction engine for editing restrictions like snapping.
bool m_isHit
in the end if there was a hit (even if not processed event)
bool SkewY(double degrees)
Skew Yaxis:
const a2dPropertyId * GetId() const
Get the a2dPropertyId object identifying this property.
wxUint16 GetLayer() const
Returns the layer index where this object is drawn upon.
bool m_childrenOnSameLayer
const a2dFill & GetFill() const
int CollectObjects(a2dCanvasObjectList *total, const wxString &type=wxT(""), a2dCanvasObjectFlagsMask mask=a2dCanvasOFlags::ALL, const a2dPropertyId *id=NULL, const a2dBoundingBox &bbox=wxNonValidBbox)
Copy objects fitting the given filter to the total list.
void SetColour(const wxColour &col)
set colour used for gradient and wxSTIPPLE_MASK_OPAQUE filling.
bool FindConnectedWires(a2dCanvasObjectList &result, a2dPin *pin, bool walkWires=true, bool selectedEnds=false, bool stopAtSelectedWire=false, bool addToResult=false)
find wires on pins of this objects.
void OnLeaveObject(a2dCanvasObjectMouseEvent &event)
called when the mouse leaves the object
int WorldToDeviceX(double x) const
convert x from world to device coordinates
a2dDrawer2D * GetDrawer2D()
get the internal m_drawer2D that is used for rendering the document
bool m_visible
only when visible
bool HasPins(bool realcheck=false)
are there a2dPin derived children
void Prepend(a2dCanvasObject *obj)
prepend a a2dCanvasObject to the childobjects
contains the layer properties for one layer,
virtual void DrawLine(double x1, double y1, double x2, double y2)
Draw line in world coordinates.
const a2dStroke * a2dINHERIT_STROKE
global a2dStroke stock object for INHERTED from parent object stroking
Input and output handler for the XmlSer format.
bool CheckMask(a2dCanvasObjectFlagsMask mask) const
Compares all flags in object to the given mask and return true is the same.
if set, respect layer order, hit testing is done per layer from the top.
bool IsSelected() const
Is the object selected flag set.
bool GetBin() const
general flag use at will.
Invisible Style property that can be added to Canvas Objects.
const wxString & GetString(void)
when a2dStringProperty, return its value else assert
a2dPin * AddPin(const wxString name, double x, double y, wxUint32 a2dpinFlags, a2dPinClass *pinClass, bool undo=false)
add a a2dPin as child
virtual a2dCanvasObject * GetConnectTemplate(const a2dCanvasObject *object, a2dPinClass *thisPinClass, const a2dCanvasObject *other, a2dPinClass *otherPinClass) const
create connection object based on two pin classes, which (may) need to be connected.
bool IsConnected(bool needsupdate, a2dCanvasObject *toConnect=0)
Is the object connected ( Optinal to specific object ) ?
a2dPin * FindBeginPin()
Get the begin pin from the childs.
void RemovePins(bool NotConnected=false, bool onlyTemporary=false, bool now=false)
Remove all a2dPin children.
bool m_subEditAsChild
allow subedit on this object when child of other object
bool m_ignoreLayer
when this is set DoRender() is called even if layer of the object is not the layer to be rendered...
a2dPoint2D GetFocal() const
Get start for gradient fill colour change.
Search the list only for this dynamic property.
bool GetEdited()
when properties where edited, this must become true
void SetFilled(bool filled)
set the filled flag to render only outlines
const a2dFill * a2dNullFILL
global a2dFill stock object for defining NO filling
a2dCanvasObject(double x=0, double y=0)
constructor called by derived objects
void SetObjectPin(bool objectPin)
set when pin is an object pin
the property is temporary and never saved
a2dCanvasObject flags as a structure
Contains a2dDrawing Class to hold a drawing.
bool Identity(void)
Make into identity matrix.
int GetLevel() const
number of levels deep we are inside a document as seen from the m_top
wxUint32 a2dSnapToWhatMask
mask for a2dSnapToWhat flags
bool PointInBox(const a2dPoint2D &, double Marge=0) const
is the point within the boundingbox
int IndexOf(a2dCanvasObject *obj) const
returns index of the given a2dCanvasObject in this childobjects
virtual a2dCanvasObject * CreateConnectObject(a2dCanvasObject *parent, a2dPin *pinThis, a2dPin *pinOther, bool undo=false) const
generates a connection object with pins and all.
a2dHandle * SetHandlePos(wxString name, double x, double y)
set a2dHandle position with the given name
A2DGENERALDLLEXP a2dWalkEvent a2dWalker_a2dCanvasObjectStart
id for a2dWalkEvent issued from within a2dWalkerIOHandler
virtual bool Submit(a2dCommand *command, bool storeIt=true)
next to the base class submit, it sets a2DocumentCommandProcessor for a2dCommand
bool m_resizeToChilds
when true, the wxEVT_CANVASOBJECT_RESIZE_EVENT is sent to this object, if the child box did change...
used to add object to a a2dCanvasDocument in the current parent
property to hold a tip window type variable to be associated with a a2dObject
virtual void EndFilter(a2dIterC &ic, a2dCanvasObject *canvasObject)
called from a2dCanvasObject to reset filtering feature when filtered object goes out of context...
bool m_snap
snapping of editable object or when moving
defines common settinsg for a habitat for a set of a2dCameleons.
virtual a2dCanvasObjectList * GetSnapVpath(a2dSnapToWhatMask snapToWhat)
return a vectorpath indicating on which point/segments the object likes to be snapped.
a2dCanvasObject * ChildIsHitWorld(a2dIterC &ic, a2dHitEvent &hitEvent, bool filterSelectableLayers=false)
Do hittest on children.
bool GetUseCheck()
see SetUseCheck
a2dCanvasObject * GetEndCorridorObject() const
return the corridor object if set else NULL
void SetVisible(bool visible)
set if this object will visible (be rendered or not)
virtual bool DoStartEdit(wxUint16 editmode, wxEditStyle editstyle)
only used for editable objects and under control of a editing tool.
bool IsTemporaryPin() const
return true if this pin is a temporary pin
void SetFillColour(const wxColour &colour)
set first colour of fill
void SetSnapTo(bool snap)
Sets snap_to flag.
A 2x3 affine matrix class for 2D transformations.
void MakeUnique()
all with reference count > 1 are cloned.
virtual a2dObject * GetRefObjectNA() const
when a2dProperty, return its value else return NULL
static a2dPropertyIdMatrix * PROPID_IntViewDependTransform
used for objects with* PROPID_viewDependent but only for internal area
a2dPoint2D GetPosXY() const
get position of object
wxMouseEvent & GetMouseEvent()
return the original mouse event that was redirected to the a2dCanvasObject
a2dStroke GetDrawerStroke() const
get the current stroke
int GetPinCount()
How many a2dPin derived children are there.
const a2dStroke * a2dNullSTROKE
global a2dStroke stock object for NO stroking
A2DGENERALDLLEXP a2dWalkEvent a2dWalker_a2dCanvasObjectEnd
id for a2dWalkEvent issued from within a2dWalkerIOHandler
static a2dPropertyIdWindow * PROPID_TipWindow
when set used for tip window by default in OnCanvasMouseEvent()
wxUint16 m_pixelExtend
Pixel extend.
if set, don't hit test the root object or object for which IsHitWorld is called
a2dPinClass * GetPinClass() const
return the pin class of this pin
double GetMaxX() const
get maximum X of the boundingbox
static const a2dCanvasObjectFlagsMask DRAGGABLE
a2dPropertyIdTyped< a2dAutoZeroPtr< a2dObject >, a2dAutoZeroProperty > a2dPropertyIdRefObjectAutoZero
property of this type
const a2dPropertyId * GetPropId()
get the id of the property displayed by this object
bool DoConnect()
if return true, connection with other object on this object its pins is allowed.
bool IsCapturedMouse(a2dIterC &ic) const
is the mouse captured for this object
const a2dAffineMatrix & GetInverseParentTransform() const
inverse of GetParentTransform()
a2dPin * HasPinNamed(const wxString pinName, bool NotConnected=false)
are there a2dPin derived children which matches the given pin name?
if set, set in the clone the PROPID_editcopy property to the original object
double GetPosY() const
get y position from affine matrix
bool GetFilling() const
if true, filling is on else filling is transparent.
virtual void DoLoad(wxObject *parent, a2dIOHandlerXmlSerIn &parser, a2dXmlSer_flag xmlparts)
Load settings.
wxUint16 GetAttributeValueUint16(const wxString &attrib, wxUint16 defaultv=0)
cast to wxUint16 of GetAttributeValueInt()
virtual void ClearAllPinConnections(bool withundo=true)
Remove all pin connections by issuing a2dCommand_DisConnectPins commands.
virtual double GetContourWidth() const
get the Contour width of the shape
while iterating a a2dCanvasDocument, this holds the context.
snap segments middle of other objects in a2dCanvasObject::RestrictToObject()
void UpdateViewDependentObjects(a2dIterC &ic)
update the transform matrix for objects with property 'PROPID_viewDependent'
double m_x
x endpoint of line
struct for how a single object on one layer was hit
a2dIterPP(a2dIterC &ic, a2dCanvasObject *object, OVERLAP clip=_IN, a2dHit type=a2dHit())
Update iteration context.
double m_x
(world coordinates) hit point x as in a2dDrawingPart or any other top level
a2dWalker based algorithms
bool GetPerLayerMode()
if set the rendering is done layers by layer from the top
a2dCanvasObject * GetOriginal()
if this is an editcopy, return the orginal else NULL
All updates of these modes force an update (e.g. update non-pending valid bounding boxes) ...
a2dBoundingBox GetClipBox(a2dIterC &ic)
returns boundingbox clipping object if clipping property is set
static const a2dCanvasObjectFlagsMask NON
Flags for a2dCanvasObject.
virtual void DependentCommands(a2dCanvasObject *parent, a2dCommand *command)
call this when a a2dCommands should result in extra commands, to become part of a parent a2dCommandGr...
void SetSnap(bool snap)
Sets snap flag.
void MapBbox(const a2dAffineMatrix &matrix)
virtual void DrawHighLighted(a2dIterC &ic)
called by Render() if m_flags.m_HighLight is set
a2dlist< a2dDumbPtr< a2dPin > > & GetConnectedPins()
Return list fo connected pins.
a2dCommandProcessor * GetCommandProcessor() const
Returns a pointer to the command processor associated with this document.
bool ReleaseChildObjects(a2dCanvasObjectFlagsMask mask=a2dCanvasOFlags::ALL)
removes and release only from the childobjects the objects with the given mask
static a2dPropertyIdMenu * PROPID_PopupMenu
when set used for popup menu by default in OnPopUpEvent()
void CaptureMouse(a2dIterC &ic)
redirect all mouse events for the canvas to this object
#define EVT_CANVASOBJECT_LEAVE_EVENT(func)
static event table macro for a2dCanvasObject mouse leave event
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
void DecrementObjectCount()
decrement currently counted number of objects on this layer inside a document.
double m_y
y endpoint of line
virtual bool Submit(a2dCommand *command, bool storeIt=true)
bool m_doConnect
in case of pins on the object is it currely allowed for other object to connect to it...
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.
bool GetViewDependentObjects() const
see SetViewDependentObjects()
std::vector< a2dLayerInfoPtr > & GetReverseOrderIndex()
return array index on ReverseOrder
int TakeOverFrom(a2dCanvasObjectList *total, const wxString &type=wxT(""), a2dCanvasObjectFlagsMask mask=a2dCanvasOFlags::ALL, const a2dPropertyId *id=NULL)
Move objects fitting the given filter from the total list to this list.
void Scale(double scalex, double scaley)
Scale in x and y ( > zero)
int m_id
application specific use
bool m_subEdit
allow subedit of children within this object
static const a2dCanvasObjectFlagsMask VISIBLE
Clipping Path property that can be added to a2dCanvasObject's.
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.
a2dIterCU(a2dIterC &ic, a2dCanvasObject *object, OVERLAP clip=_IN)
Update iteration context.
void SetRenderConnected(bool RenderConnected)
flag to render connected pin
a2dRestrictionEngine * GetRestrictionEngine()
Get restriction engine (grid snapping)
bool GetFoundCorridorEnd()
when there is a corridor path set, this return if end has bin found while iterating.
virtual bool EditProperties(const a2dPropertyId *id, bool withUndo)
edit properties of the object
static const a2dCanvasObjectFlagsMask SNAP_TO
bool GetGroupB() const
get the groupA flag
a2dText * SetObjectTip(const wxString &tip, double x, double y, double size=30, double angle=0, const a2dFont &font=*a2dDEFAULT_CANVASFONT)
quickly set a property name OBJECTTIP
property to hold a a2dStroke type variable to be associated with a a2dObject
a2dConnectionGenerator * GetConnectionGenerator() const
Get class for generating new connection objects between object and pins.
virtual bool DoCanConnectWith(a2dIterC &ic, a2dPin *pin, double margin, bool autocreate)
prepare an object for being connected to a given pin
bool GetRelease() const
get release flag
a2dCanvasCommandProcessor * GetCanvasCommandProcessor()
get a pointer to the command processor
void SetGroupB(bool value)
set the groupA flag
wire classes for connecting objects.
a2dCanvasObject * GetParent() const
when traversing tree this the object one level higher.
bool m_HasSelectedObjectsBelow
selected objects detected below
virtual bool Filter(a2dIterC &ic, a2dCanvasObject *canvasObject)
called from a2dCanvasObject to filter objects for rendering
bool IsDraggable() const
get if the object can be dragged
virtual bool AddProperty(a2dNamedProperty *property)
This function is called by a2dPropertyId to add a property to the list.
double GetHitMarginWorld()
Get HitMargin in World units.
virtual bool GetVisible() const
return true if the object is visible.
This is the base class for all kinds of property id's for a2dObject.
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.
XMLeventType GetEventType()
Returns the type of current event.
void Require(const XMLeventType &type, wxString name)
Forces a special tag.
bool HasDynamicProperties() const
test if there are dynamic properties in the m_propertylist
void foreach_f(void(*fp)(a2dCanvasObject *item))
call fp for each object
void SetIsProperty(bool IsProperty)
a2dBoundingBox GetAlignmentBbox()
calls GetAlignmentPoints()
virtual a2dCanvasObject * CreateConnectObject(a2dCanvasObject *parent, a2dPin *pinThis, a2dPin *pinOther, bool undo=false) const
create connection object based on two pins which need to be connected.
if set, don't stop at the first hit, but test child/sibling objects anyway
virtual a2dCanvasObject * GetConnectTemplate(a2dPinClass *mapThis, a2dCanvasObject *other, a2dPinClass *mapOther) const
based on the a2dPinClass's of eventually a2dPin's wanted in both objects, a
wxString GetTagName()
Returns name of the current XML tag.
return to contain children bbox
static const a2dCanvasObjectFlagsMask VISIBLECHILDS
void SetLayer(wxUint16 layer)
set the layer that is to be rendered
wxColour GetColour() const
return colour
void SetDraggable(bool draggable)
Sets if this object may be dragged.
void SetClipStatus(OVERLAP status)
set the clipping withing the current view for the last added object in context
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 m_HasToolObjectsBelow
special tool object detected below
bool Translate(double x, double y)
Translate by dx, dy:
property to hold a a2dCanvasObject pointer type variable to be associated with a canvasobject ...
virtual bool Filter(a2dIterC &ic, a2dCanvasObject *canvasObject)
called from a2dCanvasObject to filter objects for rendering
const a2dStroke & GetStroke() const
void SetToObject(a2dObject *obj, a2dPropertyId::SetFlags setflags=a2dPropertyId::set_none)
Set this property to an object.
virtual bool Filter(a2dIterC &ic, a2dCanvasObject *canvasObject)
called from a2dCanvasObject to filter objects for rendering
const a2dStroke * a2dTRANSPARENT_STROKE
global a2dStroke stock object for TRANSPARENT stroking
A list class for reference counted objects.
void SetTipWindow(const wxString &tip)
quickly set a property a2dTipWindowProperty
hit if stroke is not transparent
bool m_editingCopy
true if the object needs to be rendered in edit mode.
virtual bool EliminateMatrix()
reduce matrix to identity
bool m_template
GDSII format flag.
void SetPinClass(a2dPinClass *pinClass)
Set the pin class.
static const a2dCanvasObjectFlagsMask DoConnect
a2dFill GetDrawerFill() const
get the current fill
virtual void DoAddPending(a2dIterC &ic)
called by addPending
if set, clone members (e.g. line end styles), otherwise ref-copy them
bool m_a
group A flag (e.g boolean operations)
a2dCanvasObject * Find(a2dCanvasObject *obj) const
return the object if it is part of the list
void SetEndCorridorObject(a2dCanvasObject *endCorridorObject)
use in combination with the a2dIterC class to set a corridor path for events.
bool GetVisible() const
get visibility (rendering depends on layer settings also)
virtual bool ConnectWith(a2dCanvasObject *parent, a2dCanvasObject *toconnect, const wxString &pinname=wxT(""), double margin=1, bool undo=false)
Do connect with another a2dCanvasObject by pinname.
bool GetSelectable() const
is the object selectable flag set
void ShowPins(bool onoff)
Set a2dPin children visible or not.
a2dCanvasObject * IsHitWorld(a2dIterC &ic, a2dHitEvent &hitEvent)
If the position (x,y) is within the object return this.
Allow adding a specific property with ID more than once to a list.
used to tell which child object to render and to detect the need for it.
virtual void DoUpdateViewDependentTransform(a2dIterC &ic)
update transform matrix klion: I'm not sure that this function necessary as virtual ...
The a2dBoundingBox class stores one a2dBoundingBox of a a2dCanvasObject.
bool GetChildrenOnSameLayer() const
are children rendered on the same layer as this object?
std::vector< a2dLayerInfoPtr > & GetOrderIndex()
return array index on Order
bool Invert(void)
Invert matrix.
virtual bool FindConnectedPins(a2dCanvasObjectList &result, a2dPin *pin=NULL, bool walkWires=true, a2dPinClass *searchPinClass=NULL, a2dCanvasObject *isConnectedTo=NULL)
Find pins in other object which are connected to this object.
void SetDynamicPin(bool dynamicPin)
set when pin is a dynamic pin
void Rotate(double rotation)
Rotates this object clockwise.
static a2dPropertyIdDateTime * PROPID_DateTime
some time property which a user wants to store
virtual bool MayConnectTo(a2dPin *connectto)
Is given pin allowed to connect to this pin.
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...
virtual bool RemoveProperty(const a2dPropertyId *id, bool all=true)
This function is called by a2dPropertyId to remove a property from the list.
bool GetHasToolObjectsBelow() const
tool object itself or one of its recursive children
virtual a2dCanvasObject * PushInto(a2dCanvasObject *parent)
when wanting to traverse hierarchy what level is down here.
when set this type of property has no influence on rendering
void SetValue(int col, int row, double value)
set the value in the matrix at col,row
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
static a2dPropertyIdBoundingBox * PROPID_BoundingBox
used to store state ( redraw area) of the object as it was before a change
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.
void SetPosXyPoint(const a2dPoint2D &pos)
set position to x,y
bool FilterObject(a2dCanvasObject *canvasObject)
apply object filter
void SetCaptured(a2dCanvasObject *captured)
set the object that is captured for events in the a2dDrawing.
void LeaveInObjects(a2dIterC &ic, a2dHitEvent &hitEvent)
basetype GetPropertyValue(const a2dObject *obj) const
Get the property value in obj.
bool GetSelected2() const
is the object selected2 flag set
bool m_bin
general flag ( used for temporarely marking object )
a2dCanvasGlobal * a2dCanvasGlobals
global a2dCanvasGlobal to have easy access to global settings
virtual bool NeedsUpdateWhenConnected() const
used in case of flexible canvas objects (wires).
virtual void Save(wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dObjectList *towrite)
write all needed to an XML type of file called the CVG format
static a2dPropertyIdBool * PROPID_ToolDecoration
set for objects that act as tool decorations, when a tool is in action.
virtual a2dNamedProperty * FindProperty(const a2dPropertyId *id, a2dPropertyId::Flags flags=a2dPropertyId::flag_none)
Find a dynamic property with given id in the property list.
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)
size_t GetNumberOfSegments()
get the number of points in the pointlist
static const a2dCanvasObjectFlagsMask SNAP
const a2dShadowStyleProperty * GetShadowStyle() const
quick way to get the style property containing Shadow property
bool GetStopWalking()
check for stop
void SetRenderConnectedPins(bool onoff)
Calls a2dPin::SetRenderConnected() for all pins.
set the a2dCanvasObject's a2dDrawing root recursive
a2dDrawingPart * GetDrawingPart() const
get current a2dDrawingPart
virtual a2dCanvasObjectList * GetAsPolygons(bool transform=true) const
convert to a list of polygons.
This template class is for property ids with a known data type.
property to hold a a2dBoundingBox type variable to be associated with a canvasobject ...
double GetScale()
See GetScale()
virtual void EndFilter(a2dIterC &ic, a2dCanvasObject *canvasObject)
called from a2dCanvasObject to reset filtering feature when filtered object goes out of context...
a2dBoundingBox m_bbox
boundingbox in world coordinates
Walker taking iterative context into account.
static a2dPropertyIdTagVec * PROPID_Tags
used in tool when grouping using tags
hit if filling is not transparent
virtual a2dCanvasObjectList * GetAsPolylines(bool transform=true) const
convert to a list of polylines.
void Reset()
Reset this object for beeing reused. It will keep the drawer but NULL object infos.
bool CheckCollect(const a2dPropertyId *id, Flags flags) const
check a property id and flags to see if the property shall be collected
wxRect GetAbsoluteArea(a2dIterC &ic, int inflate=2)
Get absolute occupied area in the device coordinates.
virtual void RenderChildObjects(a2dIterC &ic, RenderChild &whichchilds, OVERLAP clipparent)
render only the child objects
void SetRotation(double rotation)
set rotation
a2dCanvasObject * Find(const wxString &objectname, const wxString &classname=wxT(""), a2dCanvasObjectFlagsMask mask=a2dCanvasOFlags::ALL, const a2dPropertyId *propid=NULL, const wxString &valueAsString=wxT(""), wxUint32 id=0) const
return the object which fits the filter.
a2dIterC()
constructor used when drawer is not known
int CollectObjects(a2dCanvasObjectList *total, const wxString &classname=wxT(""), a2dCanvasObjectFlagsMask mask=a2dCanvasOFlags::ALL, const a2dPropertyId *id=0, const a2dBoundingBox &bbox=wxNonValidBbox) const
Copy objects with the right conditions to the total list.
void Insert(size_t before, a2dCanvasObject *obj, bool ignoreReleased=true)
insert a a2dCanvasObject to the childobjects
double GetAbsX() const
get absolute X position of the pin ( after applying the parent's matrix and its own matrix ) ...
static const a2dCanvasObjectFlagsMask SHOWSHADOW
If a property with this id has changed its parent/holder will be notified.
a2dCanvasObjectFlagsMask GetHitFlags() const
return hitflags as mask
bool IsFillHit() const
true if this is a fill hit (parent or child/member fill)
bool GetIsProperty() const
void Append(a2dCanvasObject *obj)
append a a2dCanvasObject to the childobjects
a2dStrokeStyle
stroke styles for a2dStroke
void SetName(const wxString &name)
set the name of the pin (must be unique)
static const a2dCanvasObjectFlagsMask EDITABLE
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. ...
a2dPropertyIdTyped< wxWindow *, a2dWindowProperty > a2dPropertyIdWindow
property of this type
void PopCursor()
pop a cursor from the cursor stack, and set display cursor to back
static a2dPropertyIdUint16 * PROPID_Datatype
used in GDSII and KEY format to specify the DATATYPE of elements
virtual void SetLayer(wxUint16 layer)
set layer index where this object is drawn upon.
property to hold a a2dFill type variable to be associated with a a2dObject
a2dCanvasObject * IsHitWorldChildObjects(a2dIterC &ic, RenderChild &whichchilds, a2dHitEvent &hitEvent)
This is an internal function used by IsHitWorld(). Don't use it directly.
virtual bool IsConnect() const
return true, if this object is used to connect other object's using rubberband like structures...
const a2dAffineMatrix & GetMappingTransform() const
get the mapping matrix
wxEvent * m_event
event to process in case of event processing call
const a2dAffineMatrix & GetMappingMatrix()
get the world-to-device (aka mapping) matrix
double m_rely
(world coordinates) hit point y relative to the canvas object its parent object(s) ...
void SetRestrictPoint(double xSnap, double ySnap)
sets the point for snapping to
double m_y
(world coordinates) hit point y as in a2dDrawingPart or any other top level
OVERLAP GetParentClipStatus() const
what is the clipping withing the current view for the second last added object in context ...
CloneOptions
options for cloning
double DeviceToWorldXRel(double x) const
convert x relative from device to world coordinates
void SetHitFlags(a2dCanvasObjectHitFlags mask)
set hit flags
bool m_ignoreSetpending
ignore this object in a2dCanvasObject::SetPending()
const a2dAffineMatrix & GetUserToDeviceTransform() const
get matrix which transforms directly from user coordinates to device
bool GetDraggable() const
get if the object can be dragged
static a2dPropertyIdRefObject * PROPID_ViewDependent
used for objects that depend on 'aView' view when it comes to size.
void SetCorridorPath(bool OnOff, a2dCanvasObject *captureObject=NULL)
to set corridor path ( also to captured object), its a2dCanvasOFlags::IsOnCorridorPath flag is set on...
void WalkerWithContext(a2dIterC &ic, wxObject *parent, a2dWalkerIOHandlerWithContext &handler)
This is used to recursively walk through an object tree.
void SetPreRenderAsChild(bool prerender)
If set, this object has a higher priority in rendering than other children objects.
virtual bool IsRecursive()
returns if this object does have nested objects
a2dBoundingBox & GetBbox()
get boundingbox in world coordinates exclusive stroke width relative to its parent ...
structure to give as parameter to member functions of a2dCanvasObject
Contain one drawing as hierarchical tree of a2dCanvasObject's.
bool m_pushin
is push into allowed
virtual bool RestrictPoint(double &x, double &y, wxUint32 sourceRequired=snapToAll, bool ignoreEngine=false)
Restrict a single point of a line or polyline.
static bool m_ignoreAllSetpending
when set all SetPending() calss are supressed.
void SetFill(const a2dFill &fill)
Set a fill for the object which will be used instead of the layer fill.
virtual void PushIdentityTransform()
push no transform, to draw directly in device coordinates
a2dPropertyIdTyped< double, a2dDoubleProperty > a2dPropertyIdDouble
property of this type
snap to pins in other objects
virtual void DoWalker(wxObject *parent, a2dWalkerIOHandler &handler)
iterate over this object and its children
bool m_filled
use fill to fill if set
const a2dFill * a2dTRANSPARENT_FILL
global a2dFill stock object for TRANSPARENT filling
static const a2dCanvasObjectFlagsMask PRERENDERASCHILD
general canvas module declarations and classes
int IndexOf(T *object) const
Find the index of a specific object.
bool m_fixedStyle
if set fixed style (stroke and fill )is assumed. Can be used in tools to detect if style should be ch...
a2dPropertyIdTyped< void *, a2dVoidPtrProperty > a2dPropertyIdVoidPtr
property of this type
a base command for the a2dCommandProcessor
void GetClippingBox(double &x, double &y, double &w, double &h) const
what is the current clipping region in world coordinates
bool m_showshadow
show shadow object if true and shadow property is available