27 #include <wx/wfstream.h>
42 a2dHasParameters::~a2dHasParameters()
57 void a2dHasParameters::AddStringParameter(
const wxString& name,
const wxString& value )
65 wxLogWarning( _T(
"property with this name already exists, but with different type, skipped" ) );
69 m_parametermap[ propid ] = nprop;
73 void a2dHasParameters::AddIntegerParameter(
const wxString& name, wxInt32 value )
81 wxLogWarning( _T(
"property with this name already exists, but with different type, skipped" ) );
85 m_parametermap[ propid ] = nprop;
89 void a2dHasParameters::AddBoolParameter(
const wxString& name,
bool value )
97 wxLogWarning( _T(
"property with this name already exists, but with different type, skipped" ) );
101 m_parametermap[ propid ] = nprop;
105 void a2dHasParameters::AddDoubleParameter(
const wxString& name,
double value )
113 wxLogWarning( _T(
"property with this name already exists, but with different type, skipped" ) );
117 m_parametermap[ propid ] = nprop;
123 for ( a2dParameterMap::const_iterator i = m_parametermap.begin(); i != m_parametermap.end(); i++ )
129 namedprop = namedprop->
Clone( clone_deep );
130 parInst->GetParameters().operator[](propId) = namedprop;
137 m_parametermap[ dynproperty ] = namedproperty;
142 m_parametermap.find(
id );
143 return (* m_parametermap.find(
id )).second;
146 a2dPropertyId* a2dHasParameters::GetParameterId(
const wxString &idName )
const
148 for ( a2dParameterMap::const_iterator i = m_parametermap.begin(); i != m_parametermap.end(); i++ )
151 if ( propId->
GetName() == idName )
157 a2dNamedProperty* a2dHasParameters::GetParameter(
const wxString &idName )
const
159 for ( a2dParameterMap::const_iterator i = m_parametermap.begin(); i != m_parametermap.end(); i++ )
162 if ( propId->
GetName() == idName )
179 bool a2dPort::m_doRender = true;
195 a2dPin* pin =
new a2dPin(
this, wxT(
"1" ), pinclass, 0.0, 0.0 );
197 m_parPinClass = parPinClass;
210 wxString strNr = wxString::Format(
"%d", nr);
211 m_name = other.m_name + strNr;
212 m_parPinClass = other.m_parPinClass;
221 a2dPin* a2dPort::GetPin()
const
224 a2dCanvasObjectList::const_iterator iter =
m_childobjects->begin();
237 void a2dPort::Set(
double l1,
double l2,
double l3,
double b )
304 portPin->GetPosX(), portPin->GetPosY(),
305 portPin->GetPin()->GetAbsAngle(),
306 parPinClass->GetParPin()->GetWidth(),
307 parPinClass->GetParPin()->GetHeight(),
308 parPinClass->GetParPin()->GetRadius() )
328 a2dParPin::~a2dParPin()
333 :
a2dPin( other, options, refs )
335 m_port = other.m_port;
357 wxString reference_name =
GetName();
366 #if wxART2D_USE_CVGIO
370 if ( xmlparts == a2dXmlSer_attrib )
383 if ( xmlparts == a2dXmlSer_attrib )
395 #endif //wxART2D_USE_CVGIO
401 bool a2dAppear::m_nextLine =
false;
408 m_cameleon = cameleon;
417 a2dAppear::~a2dAppear()
423 return new a2dAppear( *
this, options, refs );
426 #if wxART2D_USE_CVGIO
436 #endif //wxART2D_USE_CVGIO
448 a2dDiagram::a2dDiagram()
450 m_diagramDrawing( NULL ),
455 a2dDiagram::a2dDiagram(
a2dCameleon* cameleon,
double x,
double y )
459 wxASSERT_MSG(
m_cameleon, wxT(
"a2dCamelon not set in a2dDiagram" ) );
465 m_diagramDrawing =
new a2dDrawing( wxEmptyString, NULL );
466 m_diagramDrawing->SetHabitat(
m_cameleon->GetHabitat() );
476 m_diagramDrawing = other.m_diagramDrawing;
478 else if ( options & clone_members && other.m_diagramDrawing )
486 m_diagramDrawing = other.m_diagramDrawing;
492 return new a2dDiagram( *
this, options, refs );
495 a2dDiagram::~a2dDiagram()
513 childbox.
Expand( ( *iter )->GetBbox() );
516 childbox.
Expand( ( *iter )->GetPosXY() );
547 return m_diagramDrawing->PushInto( parent );
563 parPin->SetPort( find );
568 parInst->
Append( parPin );
591 double xmin = DBL_MAX;
592 double ymax = -DBL_MAX;
607 else if ( xmin == find->
GetPosX() )
627 if ( find && find->GetName() == symPin->GetName() )
641 if ( find && find->GetName() == parPin->
GetName() )
655 if ( find && find->GetName() == parPinName )
673 parInst->
Append( visPar );
692 if ( m_diagramDrawing )
693 m_diagramDrawing->
Walker(
this, handler );
696 #if wxART2D_USE_CVGIO
700 if ( xmlparts == a2dXmlSer_attrib )
702 if ( m_diagramDrawing )
707 if ( m_diagramDrawing && !m_diagramDrawing->
GetCheck() )
712 m_diagramDrawing->Save(
this, out, towrite, NULL );
721 if ( xmlparts == a2dXmlSer_attrib )
730 if ( parser.
GetTagName() != wxT(
"drawing" ) )
744 #endif //wxART2D_USE_CVGIO
752 bbox.
Expand( 30*grid, m_nextLine ? 4*grid: -4*grid );
761 int align = m_nextLine ? wxMINX|wxMAXY: wxMINX|wxMINY;
763 d->DrawRoundedRectangle( 0, 0, 30*grid, m_nextLine ? 4*grid: -4*grid , 1*grid );
764 d->SetFont( a2dCanvasModule::GetFontMedBold() );
765 d->DrawText(
" diagram : " +
GetName(), 0, m_nextLine ? 1.5*grid: -1.5*grid, align,
false);
766 d->SetFont( a2dCanvasModule::GetFontSmall() );
767 wxString classn = GetClassInfo()->GetClassName();
768 classn =
"type: " + classn;
769 d->DrawText( classn, 2, m_nextLine ? 2.6*grid: -2.6*grid, align,
false);
797 wxASSERT_MSG(
m_cameleon, wxT(
"a2dCamelon not set in a2dDiagram" ) );
803 m_diagramDrawing =
new a2dDrawing( wxEmptyString, NULL );
804 m_diagramDrawing->SetHabitat(
m_cameleon->GetHabitat() );
816 return new a2dSymbol( *
this, options, refs );
819 a2dSymbol::~a2dSymbol()
828 int align = m_nextLine ? wxMINX|wxMAXY: wxMINX|wxMINY;
830 d->DrawRoundedRectangle( 0, 0, 30*grid, m_nextLine ? 4*grid: -4*grid , 1 );
831 d->SetFont( a2dCanvasModule::GetFontMedBold() );
832 d->DrawText(
" symbol : " +
GetName(), 0, m_nextLine ? 1.5*grid: -1.5*grid, align,
false);
833 d->SetFont( a2dCanvasModule::GetFontSmall() );
834 wxString classn = GetClassInfo()->GetClassName();
835 classn =
"type: " + classn;
836 d->DrawText( classn, 2*grid, m_nextLine ? 2.6*grid: -2.6*grid, align,
false);
849 a2dBuildIn::a2dBuildIn()
860 wxASSERT_MSG(
m_cameleon, wxT(
"a2dCamelon not set in a2dDiagram" ) );
866 m_drawing =
new a2dDrawing( wxEmptyString, NULL );
867 m_drawing->SetHabitat(
m_cameleon->GetHabitat() );
878 m_drawing = other.m_drawing;
880 else if ( options & clone_members && other.m_drawing )
887 m_drawing = other.m_drawing;
893 return new a2dBuildIn( *
this, options, refs );
896 a2dBuildIn::~a2dBuildIn()
932 #if wxART2D_USE_CVGIO
936 if ( xmlparts == a2dXmlSer_attrib )
939 out.WriteAttribute(
"buildin", GetBuildIn()->GetClassInfo()->GetClassName() );
959 static wxString lastBuildIn;
962 if ( xmlparts == a2dXmlSer_attrib )
995 #endif //wxART2D_USE_CVGIO
1003 bbox.
Expand( 30*grid, -4*grid );
1012 m_drawing->
Walker(
this, handler );
1022 int align = m_nextLine ? wxMINX|wxMAXY: wxMINX|wxMINY;
1024 d->SetFont( a2dCanvasModule::GetFontMedBold() );
1025 wxString nameBuildIn =
"Not Defined";
1027 nameBuildIn = GetBuildIn()->GetClassInfo()->GetClassName();
1028 d->DrawText(
" buildin : " +
GetName() +
" : "+ nameBuildIn, 0, -2*grid, align,
false);
1029 d->SetFont( a2dCanvasModule::GetFontSmall() );
1030 wxString classn = GetClassInfo()->GetClassName();
1031 classn =
"type: " + classn;
1032 d->DrawText( classn, 2*grid, -3.1*grid, align,
false);
1047 return m_drawing->PushInto( parent );
1072 #if wxART2D_USE_CVGIO
1082 #endif //wxART2D_USE_CVGIO
1101 return new a2dGui( *
this, options, refs );
1104 #if wxART2D_USE_CVGIO
1114 #endif //wxART2D_USE_CVGIO
1120 bool a2dCameleon::m_nextLine =
false;
1123 DEFINE_EVENT_TYPE( wxEVT_NEW_CAMELEON )
1141 m_habitat( habitat )
1145 m_appearances = (
a2dDrawing*) m_habitat->GetDrawingTemplate()->
Clone( clone_deep );
1146 m_appearances->
SetName( name );
1150 m_appearances =
new a2dDrawing( wxEmptyString );
1151 m_habitat = a2dCanvasObject::GetHabitat();
1153 m_appearances->SetHabitat( m_habitat );
1154 m_appearances->SetParent(
this );
1155 m_appearances->SetDrawingId( a2dDrawing::sm_appearances );
1156 m_changedInternalAccesstime = wxDateTime::Now();
1167 m_habitat = other.m_habitat;
1171 SetName( wxString::Format( wxT(
"drag" ) ) );
1172 m_appearances = other.m_appearances;
1180 m_appearances = other.m_appearances;
1182 else if ( options & clone_members && other.m_appearances )
1186 while ( iter != m_appearances->GetRootObject()->GetChildObjectList()->end() )
1196 m_appearances = other.m_appearances;
1224 m_changedInternalAccesstime = wxDateTime::Now();
1227 a2dCameleon::~a2dCameleon()
1263 ProcessEvent( eventNewCameleon );
1286 a2dPoint2D a2dCameleon::GetSuitblePointForNewAppearance()
const
1298 if ( appear && appear->
GetName() == name )
1311 if ( appear && appear->GetClassInfo()->GetClassName() == appearranceClassName )
1318 a2dDiagram* a2dCameleon::GetDiagram(
bool autoCreate )
1321 if ( !ret && autoCreate )
1330 a2dSymbol* a2dCameleon::GetSymbol(
bool autoCreate )
1333 if ( !ret && autoCreate )
1342 a2dBuildIn* a2dCameleon::GetBuildIn(
bool autoCreate )
1345 if ( !ret && autoCreate )
1354 a2dGui* a2dCameleon::GetGui(
bool autoCreate )
1357 if ( !ret && autoCreate )
1359 ret =
new a2dGui(
this );
1366 void a2dCameleon::AddAppearance(
a2dAppear* appearance )
1380 return GetDiagram()->
PushInto( parent );
1385 return GetDiagram()->
PushInto( parent );
1386 return GetSymbol()->
PushInto( parent );
1389 return m_appearances->PushInto( parent );
1396 if ( handler.GetSkipNotRenderedInDrawing() )
1402 m_appearances->
Walker( parent, handler );
1404 m_appearances->
Walker( parent, handler );
1412 bbox.
Expand( 30*grid, m_nextLine ? 10*grid: -10*grid );
1416 #define BBOX2XYWH(bbox) (bbox).GetMinX(), (bbox).GetMinY(), (bbox).GetWidth(), (bbox).GetHeight()
1427 int align = m_nextLine ? wxMINX|wxMAXY: wxMINX|wxMINY;
1429 d->DrawRoundedRectangle( 0, 0, 30*grid, m_nextLine ? 10*grid: -10*grid , 1*grid );
1430 d->SetFont( a2dCanvasModule::GetFontMedBold() );
1431 d->DrawText(
" cam : " +
GetName(), 0, m_nextLine ? 2*grid: -2*grid, align,
false);
1432 d->SetFont( a2dCanvasModule::GetFontSmall() );
1434 double y = m_nextLine ? 3.1*grid: -3.1*grid;
1441 if ( appearance && !appearance->
GetRelease() )
1443 wxString classn = appearance->GetClassInfo()->GetClassName();
1444 classn =
"type: " + classn;
1445 d->DrawText( classn, 2*grid, y, align,
false);
1446 d->SetFont( a2dCanvasModule::GetFontSmall() );
1447 y += m_nextLine ? 1.2*grid: -1.2*grid;
1448 d->DrawText(
"name: " + appearance->
GetName(), 2*grid, y, align,
false);
1449 y += m_nextLine ? 1.2*grid: -1.2*grid;
1466 #if wxART2D_USE_CVGIO
1470 if ( xmlparts == a2dXmlSer_attrib )
1472 if ( m_appearances )
1477 if ( m_appearances && !m_appearances->
GetCheck() )
1482 m_appearances->Save(
this, out, towrite, NULL );
1492 if ( xmlparts == a2dXmlSer_attrib )
1501 if ( parser.
GetTagName() != wxT(
"appearances" ) )
1527 #endif //wxART2D_USE_CVGIO
1547 a2dBoundingBox a2dCameleon::GetUnTransformedBboxData(
a2dAppear* appearance, a2dBboxFlags WXUNUSED( flags ) )
const
1568 bool a2dCameleon::UpdateData(
a2dAppear* appearance, UpdateMode mode )
1587 m_bbox = GetUnTransformedBboxData( appearance );
1604 if ( clipparent !=
_IN )
1618 if ( childclip !=
_OUT )
1620 bool skip = a2dPin::GetDoRender();
1623 a2dPin::SetDoRender(
false );
1624 a2dPort::SetDoRender(
false );
1638 a2dPin::SetDoRender(
true );
1639 a2dPort::SetDoRender(
true );
1674 void a2dVisibleParameter::OnPropertyChanged(
a2dComEvent& event )
1676 if ( event.GetPropertyId() == m_propId )
1702 Connect( wxID_ANY, wxID_ANY, a2dEVT_COM_EVENT, wxObjectEventFunction( &a2dVisibleParameter::OnPropertyChanged ), 0,
this );
1707 : a2dText( wxT(
"" ), x, y, font, angle )
1714 Connect( wxID_ANY, wxID_ANY, a2dEVT_COM_EVENT, wxObjectEventFunction( &a2dVisibleParameter::OnPropertyChanged ), 0,
this );
1718 a2dVisibleParameter::~a2dVisibleParameter()
1720 Disconnect( wxID_ANY, wxID_ANY, a2dEVT_COM_EVENT, wxObjectEventFunction( &a2dVisibleParameter::OnPropertyChanged ), 0,
this );
1724 : a2dText( other, options, refs )
1761 void a2dVisibleParameter::OnChar( wxKeyEvent& event )
1765 a2dText::OnChar( event );
1785 m_text =
m_text +
property->StringValueRepresentation();
1792 #if wxART2D_USE_CVGIO
1797 if ( xmlparts == a2dXmlSer_attrib )
1799 out.WriteAttribute( wxT(
"showname" ),
m_showname,
true );
1812 if ( xmlparts == a2dXmlSer_attrib )
1814 wxString resolveKey;
1825 #endif //wxART2D_USE_CVGIO
1838 m_appearance = NULL;
1839 m_cameleon = cameleon;
1842 a2dCameleonSymbolicRef::a2dCameleonSymbolicRef(
double x,
double y,
a2dSymbol* symbol )
1845 m_appearance = symbol;
1847 wxASSERT_MSG( m_cameleon, wxT(
"a2dCamelon not set in a2dSymbol" ) );
1850 a2dCameleonSymbolicRef::a2dCameleonSymbolicRef(
double x,
double y,
a2dDiagram* diagram )
1855 wxASSERT_MSG( m_cameleon, wxT(
"a2dCamelon not set in a2dDiagram" ) );
1858 a2dCameleonSymbolicRef::a2dCameleonSymbolicRef(
double x,
double y,
const wxString& appearanceName )
1865 a2dCameleonSymbolicRef::~a2dCameleonSymbolicRef()
1873 m_cameleon = other.m_cameleon;
1882 void a2dCameleonSymbolicRef::SetAppearanceName(
const wxString& appearanceName )
1902 bbox.
Expand( 30*grid, -3*grid );
1926 wxASSERT_MSG( m_cameleon, wxT(
"a2dCamelon not set" ) );
1935 error.Printf( wxT(
"Appearance with name: %s not found in a2dCameleonSymbolicRef" ),
m_appearanceName.c_str() );
1948 wxString name = linkto->
GetName();
1950 error.Printf( wxT(
"cannot Link To: %s with name %s" ), linkto->GetClassInfo()->GetClassName(), name.c_str() );
1971 else if ( m_cameleon )
1980 m_cameleon->
Walker(
this, handler );
1990 int align = m_nextLine ? wxMINX|wxMAXY: wxMINX|wxMINY;
1992 d->DrawRoundedRectangle( 0, 0, 30*grid, -3*grid, 0.2*grid);
1993 d->SetFont( a2dCanvasModule::GetFontMedBold() );
1994 d->DrawText(
" cam : " + m_cameleon->
GetName(), 0, -1*grid, align,
false);
1995 d->SetFont( a2dCanvasModule::GetFontSmall() );
1998 wxString classn =
m_appearance->GetClassInfo()->GetClassName();
1999 classn =
" type: " + classn;
2000 d->DrawText( classn, 0, -2.1*grid, align,
false);
2001 d->SetFont( a2dCanvasModule::GetFontSmall() );
2005 #if wxART2D_USE_CVGIO
2009 if ( xmlparts == a2dXmlSer_attrib )
2015 out.WriteAttribute( wxT(
"appearanceClassName" ),
m_appearance->GetClassInfo()->GetClassName() );
2022 if ( m_cameleon && !m_cameleon->
GetCheck() )
2028 m_cameleon->
Save(
this, out, towrite );
2037 if ( xmlparts == a2dXmlSer_attrib )
2053 if ( parser.
GetTagName() != wxT(
"cameleon" ) )
2065 #endif //wxART2D_USE_CVGIO
2086 TriggerCameleonUpdateTime();
2088 m_appearance = symbol;
2089 m_appearanceName =
"a2dSymbol";
2093 wxASSERT_MSG( m_cameleon, wxT(
"a2dCameleon not set in a2dSymbol" ) );
2103 a2dCameleonInst::a2dCameleonInst(
double x,
double y,
a2dDiagram* diagram )
2112 wxASSERT_MSG( m_cameleon, wxT(
"a2dCameleon not set in a2dDiagram" ) );
2120 a2dCameleonInst::a2dCameleonInst(
double x,
double y,
const wxString& appearanceName )
2129 a2dCameleonInst::~a2dCameleonInst()
2155 m_cameleon = other.m_cameleon;
2160 wxASSERT_MSG(
m_appearance == appear, wxT(
"Appearance with name different from pointer" ) );
2172 void a2dCameleonInst::SetAppearanceName(
const wxString& appearanceName )
2179 void a2dCameleonInst::SetAppearance(
a2dAppear* appearance )
2200 drawing = diagram->GetDrawing();
2213 parent->
Append( cloned );
2221 #define BBOX2XYWH(bbox) (bbox).GetMinX(), (bbox).GetMinY(), (bbox).GetWidth(), (bbox).GetHeight()
2236 wxASSERT_MSG( m_cameleon, wxT(
"a2dCamelon not set in a2dDiagram" ) );
2242 error.Printf( wxT(
"Appearance with name: %s not found in a2dCameleonInst" ),
m_appearanceName.c_str() );
2254 wxString name = linkto->
GetName();
2256 error.Printf( wxT(
"cannot Link To: %s with name %s" ), linkto->GetClassInfo()->GetClassName(), name.c_str() );
2284 wxString handlername = handler.GetClassInfo()->GetClassName();
2285 if ( m_cameleon.Get() && handlername != wxT(
"a2dWalker_SetRoot") )
2286 m_cameleon->
Walker(
this, handler );
2299 bbox.
Expand( diagram->GetUnTransformedBboxNoPorts() );
2315 if ( find && find == parPin->GetPort() )
2328 if ( pin && port == pin->GetPort() )
2330 wxASSERT_MSG( port == pin->GetPort(), wxT(
"pin must be same in both" ) );
2356 parPin->SetPort( port );
2376 a2dPort* portInDrawing = HasPort(drawing, pin );
2377 if ( !portInDrawing )
2380 a2dPinList::const_iterator iterconp;
2383 a2dPin* other = *iterconp;
2407 if ( m_CameleonUpdateTime < m_cameleon->GetInternalChangedTime() )
2467 if ( clipparent !=
_IN )
2469 m_cameleon->GetClipStatusData(
m_appearance, ic, clipparent );
2472 if ( childclip !=
_OUT )
2491 return m_cameleon->IsHitWorldData(
m_appearance, ic, hitEvent ) != 0;
2498 #if wxART2D_USE_CVGIO
2502 if ( xmlparts == a2dXmlSer_attrib )
2519 m_cameleon->
Save(
this, out, towrite );
2528 if ( xmlparts == a2dXmlSer_attrib )
2541 if ( parser.
GetTagName() != wxT(
"cameleon" ) )
2555 #endif //wxART2D_USE_CVGIO
2566 wxString portNr = wxString::Format(
"port_%ld", nr);
2568 static int camnr = 0;
2570 wxString camNr = wxString::Format(
"cam_%ld", camnr);
2574 m_objects = objects->
Clone( m_mask, a2dObject::clone_flat, &m_objectsIndex );
2579 a2dCanvasObjectList::iterator iterp = objects->begin();
2580 while ( iterp != objects->end() )
2592 a2dPinList::iterator iterpins;
2609 wxString camName = wxGetTextFromUser( _T(
"Give Name For Created Cameleon:" ), _T(
"Create Cameleon" ) , camNr );
2617 diagram =
new a2dSymbol( m_groupobject );
2619 if ( currentDrawing )
2622 m_groupobject->AddAppearance( diagram );
2628 if ( currentDrawing )
2631 m_groupobject->AddAppearance( diagram );
2633 m_groupobject->SetIgnoreLayer(
true );
2635 a2dCanvasObjectList::iterator iter = objects->begin();
2636 while ( iter != objects->end() )
2654 drawingroot->
Append( obj );
2656 iter = objects->erase( iter );
2679 if ( !m_name.IsEmpty() )
2680 m_groupobject->
SetName( m_name );
2688 m_parent->
Append( m_camref );
2693 setflags.
Start( m_parent,
false );
2704 objects->
Release( m_groupobject,
false,
false,
true );
2705 double x = m_groupobject->
GetPosX();
2706 double y = m_groupobject->
GetPosY();
2709 while ( index != m_objectsIndex.end() )
2715 objects->
Insert( *index, obj,
true );
2731 m_objects = objects->
Clone( m_mask, a2dObject::clone_flat, &m_objectsIndex );
2737 if ( group && group->
CheckMask( m_mask ) )
2753 while ( index != m_objectsIndex.end() )
2758 objects->
Insert( *index, obj,
true );
2776 wxString camNr = wxString::Format(
"ref_%ld", nr);
2780 m_objects = objects->
Clone( m_mask, a2dObject::clone_flat );
2783 a2dCanvasObjectList::iterator iter = m_objects->begin();
2784 while ( iter != m_objects->end() )
2802 m_parent->
Append( camref );
2803 m_newobjects->push_back( camref );
2808 iter = m_objects->erase( iter );
2830 const a2dCommandId a2dCommand_CreateCameleonMask::Id( wxT(
"Create Cameleon Selected" ) );
2831 const a2dCommandId a2dCommand_FlattenCameleonMask::Id( wxT(
"Flatten Cameleon" ) );
2832 const a2dCommandId a2dCommand_CloneCameleonFromInstMask::Id( wxT(
"CloneCameleonFromInstMask" ) );
Prevent cloning a a2dCameleon reference at a deeper level.
a2dHit m_how
return in which way the object was hit (stroke, fill, ...)
bool DoUpdate(UpdateMode mode, const a2dBoundingBox &childbox, const a2dBoundingBox &clipbox, const a2dBoundingBox &propbox)
Update derived Object specific things ( mainly boundingbox)
set check on a2dObject flag false or true
virtual void MakeReferencesUnique()
All direct a2dCanvasObject which are part of this one are made unique.
double GetObjectGridSize()
used for objects which depend in size on this grid
a2dParameters(a2dCameleon *cameleon=NULL, double x=0, double y=0)
Constructor.
bool GetAttributeValueBool(const wxString &attrib, bool defaultv=false)
Returns the boolean value of an attribute.
wxPoint2DDouble a2dPoint2D
this to define if coordinate numbers are integer or doubles
double m_relx
(world coordinates) hit point x relative to the canvas object its parent object(s) ...
const a2dError a2dError_LinkRef
user interface appearance for a2dCameleon
virtual a2dObject * DoClone(CloneOptions options, a2dRefMap *refs) const
Clone this object and return a pointer to the new object.
virtual void Render(a2dIterC &ic, OVERLAP clipparent)
Render this object to the active a2dDrawingPart.
parameters appearance for a2dCameleon
(In) Visible property that can be added to Docview Objects.
a2dGui(a2dCameleon *cameleon=NULL, double x=0, double y=0)
Constructor.
#define wxDynamicCast(obj, className)
Define wxDynamicCast so that it will give a compiler error for unrelated types.
void SetRoot(a2dDrawing *root, bool recurse=true)
Sets this object to a a2dCanvasDocument.
virtual void DoSave(wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts, a2dObjectList *towrite)
write object specific CVGL data
a2dCanvasObjectList * CreateChildObjectList()
create and get the list where the child objects are stored in.
a2dObject * LoadOneObject(wxObject *parent)
load one object from a CVG file.
bool HasAttribute(const wxString &attrib)
Does the current tag have this attribute?
bool Undo(void)
Override this to undo a command.
virtual void DoWalker(wxObject *parent, a2dWalkerIOHandler &handler)
iterate over this object and its children
diagram is an appearance for a2dCameleon
mouse event sent from a2dCanvasObject to itself
virtual void DoLoad(wxObject *parent, a2dIOHandlerXmlSerIn &parser, a2dXmlSer_flag xmlparts)
load object specific CVG data
Port to be used in a diagram for connecting to symbol.
int WorldToDeviceY(double y) const
convert y from world to device coordinates
virtual wxString GetName() const
Returns the name of this object, if no name is given the internal id will be returned.
void Flatten(a2dCanvasObject *parent)
bring the contents in a2dSymbol or a2dDiagram to parent.
virtual void PopTransform(void)
Recall the previously saved user-to-world transform off the matrix stack.
void SetRelease(bool value)
set release flag
a2dDrawingId GetDrawingId()
set special id to differentiate drawings
XMLeventType Next()
Walks to next element and returns event type.
virtual void DoLoad(wxObject *parent, a2dIOHandlerXmlSerIn &parser, a2dXmlSer_flag xmlparts)
load object specific CVG data
a2dPort * FindPortByName(const wxString &parPinName) const
find a2dPort with given name.
virtual a2dObject * DoClone(CloneOptions options, a2dRefMap *refs) const
Clone this object and return a pointer to the new object.
bool ResolveOrAdd(a2dSmrtPtr< a2dObject > *storedHere, const wxString &id=wxT(""))
try to resolve the object that is in storedHere when it is a reference.
class to map references to objects stored in XML, in order to make the connection later on...
a2dCameleon * GetCameleon()
get referenced a2dCameleon
virtual wxString GetName() const
Get the ids print and serialization name.
a2dPropertyIdTyped< wxString, a2dStringProperty > a2dPropertyIdString
property of this type
bool m_showname
Indicates if both name and value of the property are visible, or just the value.
bool Do(void)
Override this to perform a command.
#define EVT_UPDATE_DRAWING(func)
event from a drawing when updated
a2dCanvasOFlags m_flags
holds flags for objects
a2dCanvasObject * GetRootObject() const
get the root object, which holds the objects in the document
virtual void DoSave(wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts, a2dObjectList *towrite)
write object specific CVGL data
a2dPin is used in a2dCanvasObject to add pins to it.
This is a class/type description for a2dPin's.
a2dPort * FindPort(a2dPort *symPin) const
search a2dPort in this a2dDiagram with same name as input a2dPort (coming from e.g a a2dSymbol) ...
a2dVisibleParameter()
constructor
bool GetPending() const
is this object pending for update?
a2dDrawing * GetRoot() const
get a2dCanvasDocument of the object.
virtual a2dObject * DoClone(CloneOptions options, a2dRefMap *refs) const
Clone this object and return a pointer to the new object.
void DoLoad(wxObject *parent, a2dIOHandlerXmlSerIn &parser, a2dXmlSer_flag xmlparts)
Load object specific CVG data.
a2dObject * Clone(CloneOptions options, a2dRefMap *refs=NULL) const
create an exact copy of this property
virtual a2dObject * DoClone(CloneOptions options, a2dRefMap *refs) const
Clone this object and return a pointer to the new object.
bool DoUpdate(UpdateMode mode, const a2dBoundingBox &childbox, const a2dBoundingBox &clipbox, const a2dBoundingBox &propbox)
Update derived Object specific things ( mainly boundingbox)
bool IsHit() const
true if this is a hit
virtual bool Update(UpdateMode mode)
Update the state of the object according to its current position etc.
Base class for adding to the list of appearances in a a2dCameleon.
property to hold a double type variable to be associated with a a2dObject
void ConnectEvent(wxEventType type, wxEvtHandler *eventSink)
virtual a2dObject * DoClone(CloneOptions options, a2dRefMap *refs) const
Clone this object and return a pointer to the new object.
int m_caret
position of caret within text string
a2dPropertyIdTyped< wxInt32, a2dInt32Property > a2dPropertyIdInt32
property of this type
property to hold a bool type variable to be associated with a a2dObject
Defines a font to be set to a2dDrawer2D or stored in a2dCanvsObject etc.
void OnDoEvent(a2dCommandProcessorEvent &event)
track modification of document
Input and output handler for the XmlSer format.
virtual void DrawPolygon(a2dVertexArray *points, bool spline=false, wxPolygonFillMode fillStyle=wxODDEVEN_RULE)
Draw polygon in world coordinates using pointarray.
UpdateMode
Various mode flags for Update.
virtual bool LinkReference(a2dObject *other)
when resolving this refrence via a a2dIOHandler, this is used.
virtual void SetPending(bool pending)
set this object pending for update
OVERLAP
Result of a a2dBoundingBox intersection or hittest.
a2dParPin points to a2dPort
virtual void DoSave(wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts, a2dObjectList *towrite)
write object specific CVGL data
a2dPropertyIdTyped< bool, a2dBoolProperty > a2dPropertyIdBool
property of this type
a2dCameleon * m_cameleon
point to the a2dCameleon of which this appearance is a part.
(In)Visible parameters that can be added to Canvas Objects.
void OnChangeDrawings(a2dDrawingEvent &event)
called when a drawing in a document did change.
double GetTransformedHitMargin()
transformed to object its coordinate system
void DoRender(a2dIterC &ic, OVERLAP clipparent)
render derived object
void OnRedoEvent(a2dCommandProcessorEvent &event)
track modification of document
a2dCanvasObject * PushInto(a2dCanvasObject *parent)
when wanting to traverse hierarchy what level is down here.
virtual void DoLoad(wxObject *parent, a2dIOHandlerXmlSerIn &parser, a2dXmlSer_flag xmlparts)
load object specific CVG data
virtual a2dObject * DoClone(CloneOptions options, a2dRefMap *refs) const
Clone this object and return a pointer to the new object.
static double m_l2
length from top of arrow to inside point in X
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.
object to show several appearance views on what it contains
void SetDrawingId(a2dDrawingId id)
get special id to differentiate drawings
a2dCanvasObject is the base class for Canvas Objects.
virtual bool DoUpdate(UpdateMode mode, const a2dBoundingBox &childbox, const a2dBoundingBox &clipbox, const a2dBoundingBox &propbox)
Update derived Object specific things ( mainly boundingbox)
virtual void DoWalker(wxObject *parent, a2dWalkerIOHandler &handler)
iterate over this object and its children
void DoWalker(wxObject *parent, a2dWalkerIOHandler &handler)
iterate over this object and its children
a2dParPin * GetParPin()
Pin to use in a2dCameleonInst when creating a2dParPin from an a2dPort.
void SetMayEdit(bool mayEdit)
if true, editing drawing is allowed
a2dPort * FindLeftUp() const
find the port in the diagram that is most left up.
wxString m_appearanceName
if m_appearance is not set, this is used to establish link
void DoRender(a2dIterC &ic, OVERLAP clipparent)
render derived object
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...
a2dCanvasObjectList * GetChildObjectList()
get the list where the child objects are stored in.
virtual wxObject * CreateObject(const wxString &symbolicName)
Creates an specific object by name.
void DoRender(a2dIterC &ic, OVERLAP clipparent)
render derived object
void TransformPoint(double x, double y, double &tx, double &ty) const
Transform a point.
a2dAppear(a2dCameleon *cameleon, double x=0, double y=0)
Constructor.
void SetSelected(bool selected)
Set the object selected flag if allowed.
virtual void SetName(const wxString &name)
Creates the a2dStringProperty PROPID_Name.
void WriteEndElement(bool newLine=true)
Writes correspondending end tag for the current start tag.
a2dAppear * GetAppearanceByName(const wxString &name) const
get appearance by its name
static double m_l1
length from top of arrow to outside points in X
bool DoUpdate(UpdateMode mode, const a2dBoundingBox &childbox, const a2dBoundingBox &clipbox, const a2dBoundingBox &propbox)
Update derived Object specific things ( mainly boundingbox)
a2dBoundingBox DoGetUnTransformedBbox(a2dBboxFlags flags=a2dCANOBJ_BBOX_NON) const
In derived object this should be overriden to calculate the boundingbox of the object without its chi...
void OnUndoEvent(a2dCommandProcessorEvent &event)
track modification of document
a2dPinClass * GetParPinClass() const
get pinclass to be used for a2dParPin to generate when making instances from a2dCameleons using this ...
void AddToRoot(bool autoPlace=true)
add this to ms_centralCameleonRoot at a suitable position
a2dAffineMatrix m_lworld
used for positioning the object (x,y,ang,scale etc.)
size_t m_firsteditable
The first editable character, usually 0, but may be different for a2dVisibleProperty.
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...
Io handler to iterate through a a2dDocument.
property to hold a 2 byte integer type variable to be associated with a a2dObject ...
bool GetCheck() const
general flag use at will.
a2dBoundingBox DoGetUnTransformedBbox(a2dBboxFlags flags=a2dCANOBJ_BBOX_NON) const
In derived object this should be overriden to calculate the boundingbox of the object without its chi...
bool Disconnect(a2dPin *pin=a2dAnyPin, bool forceErase=false)
bool Undo(void)
Override this to undo a command.
a2dText is an abstract base class.
a2dCanvasObjectList * wxNullCanvasObjectList
define a NON a2dCanvasObjectList
static a2dCanvasObject * GetCameleonRoot()
return the root where all a2dCameleon's are stored
static double ms_dy
dy position for next a2dCameleon;
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
double GetMinX() const
get minimum X of the boundingbox
a2dBoundingBox DoGetUnTransformedBbox(a2dBboxFlags flags=a2dCANOBJ_BBOX_NON) const
In derived object this should be overriden to calculate the boundingbox of the object without its chi...
virtual void DrawRoundedRectangle(double x, double y, double width, double height, double radius, bool pixelsize=false)
Draw RoundedRectangle in world coordinates.
virtual a2dObject * DoClone(CloneOptions options, a2dRefMap *refs) const
Clone this object and return a pointer to the new object.
a2dCanvasObjectList * m_childobjects
holds child objects
void DoSave(wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts, a2dObjectList *towrite)
write object specific CVGL data
a2dCameleon * GetCameleon()
this appearance is for the returned a2dCameleon here.
bool m_visible
is the object visible (overruled by paranet object in some cases during rendering ...
#define forEachIn(listtype, list)
easy iteration for a2dlist
bool IsUserDefined() const
true if this property is user defined
a2dSmrtPtr< a2dAppear > m_appearance
points to an appearance in a2dCameleon
void Set(double xc, double yc, double angle=0, const wxString &name=wxT(""), bool dynamic=false)
set postion angle and name of the pin
void SetParent(a2dObject *parent)
set parent object of the drawing ( in case there is always only one )
bool DoIsHitWorld(a2dIterC &ic, a2dHitEvent &hitEvent)
Does hit test on the object (exclusif child objects)
virtual void DoLoad(wxObject *parent, a2dIOHandlerXmlSerIn &parser, a2dXmlSer_flag xmlparts)
load object specific CVG data
a2dCameleonInst to show one appearance of an a2dCameleon.
void Walker(wxObject *parent, a2dWalkerIOHandler &handler)
This is used to recursively walk through an object tree.
virtual void DoSave(wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts, a2dObjectList *towrite)
write object specific CVGL data
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.
a2dSmrtPtr< a2dAppear > m_appearance
points to an appearance in a2dCameleon
void DependencyPending(a2dWalkerIOHandler *handler)
called by to check if this object becomes pending as a result of other objects
virtual void DoLoad(wxObject *parent, a2dIOHandlerXmlSerIn &parser, a2dXmlSer_flag xmlparts)
load object specific CVG data
a2dDrawer2D * GetDrawer2D() const
get current a2dDrawer2D
#define wxStaticCast(obj, className)
The wxWindows 2.4.2 wxStaticCast is buggy. It evaluates its argument twice.
Drawing context abstraction.
Normal straight line segment in a2dVertexList and a2dVertexArray.
virtual a2dObject * DoClone(CloneOptions options, a2dRefMap *refs) const
Clone this object and return a pointer to the new object.
#define EVT_CANVASOBJECT_MOUSE_EVENT(func)
static event table macro for a2dCanvasObject mouse event
a2dCameleon * GetCameleon()
get referenced a2dCameleon
A2DGENERALDLLEXP a2dSmrtPtr< a2dGeneralGlobal > a2dGeneralGlobals
a global pointer to get to global instance of important classes.
void TriggerChangedTime()
make the changed time Now
virtual void DoSave(wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts, a2dObjectList *towrite)
write object specific CVGL data
void Translate(double x, double y)
relative translate the object to position x,y in world coordinates
a2dNamedProperty * Clone(a2dObject::CloneOptions options, a2dRefMap *refs=NULL) const
Virtual copy constructor.
virtual void DoLoad(wxObject *parent, a2dIOHandlerXmlSerIn &parser, a2dXmlSer_flag xmlparts)
load object specific CVG data
virtual void Initialize()
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...
virtual void DoSave(wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts, a2dObjectList *towrite)
write object specific CVGL data
void TranslateTo(double dx, double dy)
origin of drawing is shifted to the pos given.
static a2dPoint2D GetSuitblePoint()
Get a suitable location for a new a2dCameleon();.
int WorldToDeviceX(double x) const
convert x from world to device coordinates
Hint to clone enough of the object to do proper dragging in graphics.
a2dCanvasObject * PushInto(a2dCanvasObject *parent)
when wanting to traverse hierarchy what level is down here.
virtual void DrawLine(double x1, double y1, double x2, double y2)
Draw line in world coordinates.
virtual void DoSave(wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts, a2dObjectList *towrite)
Write object specific CVG data.
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.
bool DoIsHitWorld(a2dIterC &ic, a2dHitEvent &hitEvent)
Does hit test on the object (exclusif child objects)
bool IsSelected() const
Is the object selected flag set.
void TriggerCameleonUpdateTime()
make the update time Now
virtual void DoLoad(wxObject *parent, a2dIOHandlerXmlSerIn &parser, a2dXmlSer_flag xmlparts)
load object specific CVG data
Tappear * GetAppearance(bool autoCreate=false)
Get a specific a2dAppear derived class instance from here.
bool m_subEditAsChild
allow subedit on this object when child of other object
a2dCanvasObject(double x=0, double y=0)
constructor called by derived objects
Symbolic appearance for a2dCameleon.
Contains a2dDrawing Class to hold a drawing.
set a2dCanvasObjects flags in a hierarchy of a a2dCanvasDocument
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...
Each a2dCommand is given a command id at construction.
bool DoIsHitWorld(a2dIterC &ic, a2dHitEvent &hitEvent)
Does hit test on the object (exclusif child objects)
void SetCheck(bool check)
general flag use at will.
property to hold a wxString type variable to be associated with a a2dObject
defines common settinsg for a habitat for a set of a2dCameleons.
void SetVisible(bool visible)
set if this object will visible (be rendered or not)
void DoEndEdit()
only used for editable objects and under control of a editing tool.
bool LinkReference(a2dObject *other)
link a reference in the object to the given value
a2dPropertyIdPtr m_propId
the property id for which the value needs to be displayed.
a2dParPin * HasParPinForPort(a2dPort *pin)
find equivalent a2dParPin voor the given a2dPort.
virtual void DoSave(wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts, a2dObjectList *towrite)
write object specific CVGL data
virtual a2dObject * DoClone(CloneOptions options, a2dRefMap *refs) const
Clone this object and return a pointer to the new object.
if set, set in the clone the PROPID_editcopy property to the original object
double GetPosY() const
get y position from affine matrix
bool Do(void)
Override this to perform a command.
double GetWorldStrokeExtend()
while iterating a a2dCanvasDocument, this holds the context.
void DoLoad(wxObject *parent, a2dIOHandlerXmlSerIn &parser, a2dXmlSer_flag xmlparts)
load object specific CVG data
virtual a2dCanvasObject * PushInto(a2dCanvasObject *parent)
when wanting to traverse hierarchy what level is down here.
void DoLoad(wxObject *parent, a2dIOHandlerXmlSerIn &parser, a2dXmlSer_flag xmlparts)
load object specific CVG data
a2dWalker based algorithms
All updates of these modes force an update (e.g. update non-pending valid bounding boxes) ...
void MapBbox(const a2dAffineMatrix &matrix)
a2dlist< a2dDumbPtr< a2dPin > > & GetConnectedPins()
Return list fo connected pins.
bool ReleaseChildObjects(a2dCanvasObjectFlagsMask mask=a2dCanvasOFlags::ALL)
removes and release only from the childobjects the objects with the given mask
special a2dCanvasObject to make a multi view hierachy.
const a2dFont * a2dDEFAULT_CANVASFONT
global a2dFont stock object for default font
a2dHasParameters * m_parent
object which contains m_propId
static double m_l3
length from top of arrow to inside point in X
virtual void DoSave(wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts, a2dObjectList *towrite)
Write object specific CVG data.
void DoWalker(wxObject *parent, a2dWalkerIOHandler &handler)
iterate over this object and its children
a2dHit HitTestPolygon(const a2dPoint2D &ptest, double margin)
extensive hittesting on vertex list seen as polygon.
wxString GetAttributeValue(const wxString &attrib, const wxString &defaultv=wxT(""))
Returns the value of an attribute.
wxString GetName() const
get the name given to the pin.
void DoSave(wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts, a2dObjectList *towrite)
write object specific CVGL data
bool LinkReference(a2dObject *linkto)
link a reference in the object to the given value
int GetOwnedBy()
like it to be protected, but this does not work with wxList macros
void TakePortsTo(a2dCameleonInst *parInst)
a2dPort objects result in pins for the instance
bool GetRelease() const
get release flag
virtual a2dObject * DoClone(CloneOptions options, a2dRefMap *refs) const
Clone this object and return a pointer to the new object.
virtual a2dCanvasObject * PushInto(a2dCanvasObject *parent)
when wanting to traverse hierarchy what level is down here.
bool GetRenderChildDerived()
when set child object in derived a2dCanvasObject are rendered, else only the object itself...
bool DoIsHitWorld(a2dIterC &ic, a2dHitEvent &hitEvent)
Does hit test on the object (exclusif child objects)
virtual void DoWalker(wxObject *parent, a2dWalkerIOHandler &handler)
iterate over this object and its children
This is the base class for all kinds of property id's for a2dObject.
virtual void DoLoad(wxObject *parent, a2dIOHandlerXmlSerIn &parser, a2dXmlSer_flag xmlparts)
load object specific CVG data
double GetWidth() const
returns width of the boundingbox
void Require(const XMLeventType &type, wxString name)
Forces a special tag.
wxString GetTagName()
Returns name of the current XML tag.
static a2dPinClass * Standard
Pins of this class can only connect to pins of the same class.
bool DoIsHitWorld(a2dIterC &ic, a2dHitEvent &hitEvent)
Does hit test on the object (exclusif child objects)
void DoRender(a2dIterC &ic, OVERLAP clipparent)
render derived object
a2dAppear * GetAppearance()
get referenced a2dCameleon
void SetPosXY(double x, double y, bool restrict=false)
set position to x,y
a2dHasParameters(double x=0, double y=0)
Constructor.
bool Start(a2dCanvasObject *object, bool setTo)
start removing properties from the object given, and down.
virtual void DependencyPending(a2dWalkerIOHandler *handler)
called by to check if this object becomes pending as a result of other objects
void ShowName(bool show=false)
Show both name and value of the property or just the value.
bool m_editingCopy
true if the object needs to be rendered in edit mode.
Event sent to a2dCommandProcessor.
void SetName(const wxString &name)
Creates the a2dStringProperty PROPID_Name.
bool m_utbbox_changed
Untransformed bounding box changed.
if set, clone members (e.g. line end styles), otherwise ref-copy them
virtual a2dObject * DoClone(CloneOptions options, a2dRefMap *refs) const
Clone this object and return a pointer to the new object.
class to define a set of properties/parameters on derived classes.
virtual void DoLoad(wxObject *parent, a2dIOHandlerXmlSerIn &parser, a2dXmlSer_flag xmlparts)
load object specific CVG data
virtual a2dObject * DoClone(CloneOptions options, a2dRefMap *refs) const
Clone this object and return a pointer to the new object.
a2dCanvasObject * IsHitWorld(a2dIterC &ic, a2dHitEvent &hitEvent)
If the position (x,y) is within the object return this.
void TakeVisibleParameters(a2dCameleonInst *parInst)
take visible parameters instances into a pameterized instance, to make them unique per instance...
The a2dBoundingBox class stores one a2dBoundingBox of a a2dCanvasObject.
void SyncPinsTo(a2dDrawing *drawing)
synchronize pins here to the a2dPorts in the drawing.
a2dCanvasObjectList * Clone(a2dObject::CloneOptions options) const
Clone everything ( Clones objects also) in a new created list.
A property id defined by user.
double GetMinY() const
get minimum Y of the boundingbox
bool Undo(void)
Override this to undo a command.
double GetAngle() const
get absolute angle of the pin ( after applying the parent its matrix and it own matrix ) ...
void SetPosXyPoint(const a2dPoint2D &pos)
set position to x,y
void DoLoad(wxObject *parent, a2dIOHandlerXmlSerIn &parser, a2dXmlSer_flag xmlparts)
load object specific CVG data
a2dCanvasGlobal * a2dCanvasGlobals
global a2dCanvasGlobal to have easy access to global settings
virtual void Save(wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dObjectList *towrite)
write all needed to an XML type of file called the CVG format
virtual bool DoUpdate(UpdateMode mode, const a2dBoundingBox &childbox, const a2dBoundingBox &clipbox, const a2dBoundingBox &propbox)
Update derived Object specific things ( mainly boundingbox)
virtual void DoSave(wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts, a2dObjectList *towrite)
write object specific CVGL data
bool m_prerenderaschild
as child this object will be rendered before the parent object itself when true (default) ...
This template class is for property ids with a known data type.
a2dBoundingBox m_bbox
boundingbox in world coordinates
void MakeReferencesUnique()
All direct a2dCanvasObject which are part of this one are made unique.
void Append(a2dCanvasObject *obj)
append a a2dCanvasObject to the childobjects
wxString m_text
the text to display
a2dCanvasObject * PushInto(a2dCanvasObject *parent)
when wanting to traverse hierarchy what level is down here.
static double m_b
base of arrow
a2dCanvasObject * GetParent() const
get parent object of the pin
const a2dAffineMatrix & GetTransform() const
Get the accumulated transform up to and including m_lworld of the current object. ...
virtual void DoSave(wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts, a2dObjectList *towrite)
write object specific CVGL data
virtual a2dObject * DoClone(CloneOptions options, a2dRefMap *refs) const
bool DoIsHitWorld(a2dIterC &ic, a2dHitEvent &hitEvent)
Does hit test on the object (exclusif child objects)
void SetCameleon(a2dCameleon *cam)
this appearance is from this a2dCameleon
virtual bool LinkReferences(bool ignoreNonResolved=false)
link references to their destination
double m_rely
(world coordinates) hit point y relative to the canvas object its parent object(s) ...
void DoRender(a2dIterC &ic, OVERLAP clipparent)
render derived object
wxString m_appearanceName
if m_appearance is not set, this is used to establish link
void DoRender(a2dIterC &ic, OVERLAP clipparent)
render derived object
CloneOptions
options for cloning
bool DisconnectEvent(wxEventType type, wxEvtHandler *eventSink)
bool ResolveOrAddLink(a2dObject *obj, const wxString &id=wxT(""))
try to resolve an object referenced by obj using the LinkReference function
void SetParent(a2dHasParameters *parent)
to set the parent where the m_propId is searched for.
virtual void DoEndEdit()
only used for editable objects and under control of a editing tool.
a2dAppear * GetAppearanceByClassName(const wxString &appearranceClassName) const
get appearance by its Classname
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.
virtual a2dNamedProperty * CreatePropertyFromString(const wxString &value) const
Create a new property object from a value string.
void DoRender(a2dIterC &ic, OVERLAP clipparent)
render derived object
wxInt64 GetUniqueSerializationId() const
return a unique id for this object
virtual void PushIdentityTransform()
push no transform, to draw directly in device coordinates
a2dPropertyIdTyped< double, a2dDoubleProperty > a2dPropertyIdDouble
property of this type
static a2dCanvasObject * ms_centralCameleonRoot
virtual void DoWalker(wxObject *parent, a2dWalkerIOHandler &handler)
iterate over this object and its children
general canvas module declarations and classes
void WriteStartElement(const wxString &name, bool newLine=true)
Writes start tag which has no attributes.
bool Do(void)
Override this to perform a command.