00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef __WXCANPRIM_H__
00017 #define __WXCANPRIM_H__
00018
00019 #ifndef WX_PRECOMP
00020 #include "wx/wx.h"
00021 #endif
00022
00023 #include "wx/image.h"
00024 #include "wx/canvas/candefs.h"
00025 #include "wx/canvas/canobj.h"
00026
00027 class A2DARTBASEDLLEXP a2dVpath;
00028
00029
00030
00031 class A2DCANVASDLLEXP a2dOrigin: public a2dCanvasObject
00032 {
00033 public:
00034
00035
00036
00037 a2dOrigin();
00038
00039
00040
00041
00042
00043
00044 a2dOrigin( double w, double h);
00045
00046 a2dOrigin( const a2dOrigin &other, CloneOptions options );
00047
00048 ~a2dOrigin();
00049
00050 virtual a2dObject* Clone( CloneOptions options ) const;
00051
00052
00053 double GetWidth() { return m_width; }
00054
00055
00056 double GetHeight() { return m_height; }
00057
00058
00059
00060
00061
00062 void SetWidth( double width ) { m_width = width; SetPending(true); }
00063
00064
00065
00066
00067
00068 void SetHeight( double height ) { m_height = height; SetPending(true); }
00069
00070 #if wxART2D_USE_CVGIO
00071 virtual void DoSave( wxObject* parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts , a2dObjectList* towrite );
00072 #endif //wxART2D_USE_CVGIO
00073
00074 DECLARE_CLASS(a2dOrigin)
00075
00076 protected:
00077 void DoRender( a2dIterC& ic, OVERLAP clipparent );
00078
00079 bool DoIsHitWorld( a2dIterC& ic, a2dHitEvent& hitEvent );
00080 a2dBoundingBox DoGetUnTransformedBbox( a2dBboxFlags flags = a2dCANOBJ_BBOX_NON ) const;
00081
00082
00083 double m_width;
00084
00085
00086 double m_height;
00087
00088 private:
00089
00090 a2dOrigin( const a2dOrigin &other );
00091 };
00092
00093
00094
00095
00096
00097
00098
00099 class A2DCANVASDLLEXP a2dHandle: public a2dCanvasObject
00100 {
00101
00102 A2D_DECLARE_EVENT_TABLE()
00103
00104 public:
00105
00106
00107 a2dHandle();
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120 a2dHandle( a2dCanvasObject* parent, double xc, double yc, const wxString& name = wxT(""), int w = 0, int h = 0, double angle = 0 , int radius = 0 );
00121 a2dHandle( const a2dHandle& other, CloneOptions options );
00122 ~a2dHandle();
00123
00124 virtual a2dObject* Clone( CloneOptions options ) const;
00125
00126
00127 wxString GetName() const { return m_name; }
00128
00129
00130 void SetName(const wxString& name) { m_name=name; }
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141 void Set(double xc, double yc, int w, int h, double angle = 0 , int radius = 0 );
00142
00143
00144
00145
00146
00147
00148
00149 void Set2( double xc, double yc, const wxString& name = wxT("") );
00150
00151
00152 void SetParent( a2dCanvasObject* parent );
00153
00154
00155 a2dEvtHandler* GetParentEvtHandler() { return m_parent; }
00156
00157 a2dCanvasObject* GetParent() const { return m_parent; }
00158
00159
00160 int GetWidth() const { return m_width; }
00161
00162
00163 int GetHeight() const { return m_height; }
00164
00165
00166 int GetRadius() const { return m_radius; }
00167
00168 void SetMode( int mode ) {
00169 m_mode = mode; SetPending( true ); }
00170
00171 int GetMode() const { return m_mode; }
00172
00173 #if wxART2D_USE_CVGIO
00174 virtual void DoLoad( wxObject* parent, a2dIOHandlerXmlSerIn& parser, a2dXmlSer_flag xmlparts );
00175 virtual void DoSave( wxObject* parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts , a2dObjectList* towrite );
00176 #endif //wxART2D_USE_CVGIO
00177 virtual bool IsTemporary_DontSave() const;
00178
00179 DECLARE_CLASS(a2dHandle)
00180
00181 protected:
00182
00183 void OnEnterObject(a2dCanvasObjectMouseEvent &event);
00184
00185 void OnLeaveObject(a2dCanvasObjectMouseEvent &event);
00186
00187 void OnCanvasObjectMouseEvent( a2dCanvasObjectMouseEvent& event );
00188
00189 void DoRender( a2dIterC& ic, OVERLAP clipparent );
00190
00191 bool DoIsHitWorld( a2dIterC& ic, a2dHitEvent& hitEvent );
00192
00193 a2dBoundingBox DoGetUnTransformedBbox( a2dBboxFlags flags = a2dCANOBJ_BBOX_NON ) const;
00194
00195 bool DoUpdate( UpdateMode mode, const a2dBoundingBox& childbox, const a2dBoundingBox& clipbox, const a2dBoundingBox& propbox );
00196
00197
00198 wxString m_name;
00199
00200
00201 int m_width;
00202
00203
00204 int m_height;
00205
00206
00207 int m_radius;
00208
00209
00210 int m_mode;
00211
00212
00213
00214 a2dCanvasObject* m_parent;
00215
00216 public:
00217 static a2dPropertyIdInt32* PROPID_Width;
00218 static a2dPropertyIdInt32* PROPID_Height;
00219 static a2dPropertyIdInt32* PROPID_Radius;
00220
00221 DECLARE_PROPERTIES()
00222
00223 public:
00224 const static long sm_HandleNoHit;
00225 const static long sm_HandleHit;
00226
00227
00228
00229
00230 private:
00231
00232 a2dHandle( const a2dHandle& other );
00233 };
00234
00235 #if (defined(__WXMSW__) && defined(WXUSINGDLL) )
00236 template class A2DCANVASDLLEXP a2dSmrtPtr<a2dHandle>;
00237 #endif
00238
00239
00240 typedef a2dSmrtPtr<a2dHandle> a2dHandlePtr;
00241
00242
00243 class A2DCANVASDLLEXP a2dPinClass;
00244 #if (defined(__WXMSW__) && defined(WXUSINGDLL) )
00245 template class A2DCANVASDLLEXP std::allocator<a2dPinClass*>;
00246 template class A2DCANVASDLLEXP std::allocator< std::_List_nod<a2dPinClass*, std::allocator<a2dPinClass* > >::_Node >;
00247 template class A2DCANVASDLLEXP std::allocator< std::_List_ptr<a2dPinClass*, std::allocator<a2dPinClass* > >::_Nodeptr >;
00248 template class A2DCANVASDLLEXP std::list< a2dPinClass* >;
00249 #endif
00250
00251
00252
00253
00254
00255
00256
00257
00258
00259
00260
00261
00262
00263
00264
00265
00266
00267
00268
00269
00270
00271
00272
00273
00274
00275
00276
00277
00278
00279
00280
00281
00282
00283
00284
00285
00286
00287 class A2DCANVASDLLEXP a2dPin: public a2dHandle
00288 {
00289
00290 A2D_DECLARE_EVENT_TABLE()
00291
00292 public:
00293
00294 enum a2dPinFlags
00295 {
00296
00297 NON = 0x0,
00298
00299
00300 dynamic = 0x0001,
00301
00302
00303 temporary = 0x0002,
00304
00305
00306 objectPin = 0x0004,
00307
00308
00309 internal = 0x0008,
00310
00311
00312 temporaryObjectPin = temporary | objectPin,
00313
00314
00315 ALLSET = 0xFFFFFFFF
00316 };
00317
00318
00319 a2dPin();
00320
00321
00322 a2dPin( a2dCanvasObject* parent, const wxString& name, a2dPinClass* pinclass, double xc, double yc, double angle = 0 , int w = 0, int h = 0, int radius = 0 );
00323
00324
00325 a2dPin( const a2dPin &other, CloneOptions options );
00326
00327
00328 ~a2dPin();
00329
00330
00331
00332
00333
00334
00335
00336 inline void SetRenderConnected(bool RenderConnected) { SetPending(true); m_RenderConnected = RenderConnected; }
00337
00338
00339 inline bool GetRenderConnected() { return m_RenderConnected; }
00340
00341 virtual void SetPending( bool pending );
00342
00343
00344 virtual a2dObject* Clone( CloneOptions options ) const;
00345
00346
00347 virtual void SetParent( a2dCanvasObject* parent );
00348
00349
00350
00351
00352
00353
00354
00355
00356
00357 void Set(double xc, double yc, double angle =0 , const wxString& name = wxT(""), bool dynamic = false );
00358
00359
00360 a2dPoint2D GetAbsXY() const;
00361
00362
00363 double GetAbsX() const;
00364
00365
00366 double GetAbsY() const;
00367
00368
00369 void SetAbsXY( double x, double y );
00370
00371
00372 void SetAbsXY( const a2dPoint2D & point );
00373
00374
00375 double GetAbsAngle() const;
00376
00377
00378 a2dPinClass *GetPinClass() const { return m_pinclass; }
00379
00380
00381 void SetPinClass( a2dPinClass* pinClass ) { m_pinclass = pinClass; }
00382
00383
00384
00385
00386
00387
00388
00389
00390 virtual bool MayConnectTo( a2dPin* connectto );
00391
00392
00393 void ConnectTo( a2dPin* connectto );
00394
00395
00396 a2dPin* ConnectedTo() const { return m_canvaspin; }
00397
00398
00399
00400 a2dPin* FindConnectablePin( a2dCanvasObject *root, double margin, bool autocreate );
00401
00402
00403 void AutoConnect( a2dCanvasObject *root, double margin );
00404
00405
00406 bool IsDislocated() const;
00407
00408
00409
00410
00411
00412
00413
00414 bool IsDynamicPin() const { return m_dynamicPin; }
00415
00416
00417 void SetDynamicPin( bool dynamicPin ) { m_dynamicPin = dynamicPin; }
00418
00419
00420
00421
00422
00423
00424
00425
00426
00427
00428
00429 bool IsTemporaryPin() const { return m_temporaryPin; }
00430
00431
00432
00433 void SetTemporaryPin( bool temporaryPin ) { m_temporaryPin = temporaryPin; }
00434
00435
00436
00437
00438
00439
00440 void SetInternal( bool internal ) { m_internal = internal; }
00441
00442
00443 bool IsInternal() const { return m_internal; }
00444
00445
00446 void SetObjectPin( bool objectPin ) { m_objectPin = objectPin; }
00447
00448
00449 bool IsObjectPin() const { return m_objectPin; }
00450
00451 #if wxART2D_USE_CVGIO
00452 virtual void DoLoad( wxObject* parent, a2dIOHandlerXmlSerIn& parser, a2dXmlSer_flag xmlparts );
00453 virtual void DoSave( wxObject* parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts , a2dObjectList* towrite );
00454 #endif //wxART2D_USE_CVGIO
00455 virtual bool IsTemporary_DontSave() const;
00456 virtual bool AlwaysWriteSerializationId() const;
00457 virtual bool LinkReference( a2dObject *other );
00458
00459 DECLARE_CLASS(a2dPin)
00460
00461
00462 const static a2dFeedbackId sm_feedbackStart;
00463
00464
00465
00466
00467
00468 const static a2dFeedbackId sm_feedbackGeneratePin;
00469
00470 const static a2dFeedbackId sm_feedbackEnd;
00471
00472
00473 const static a2dFeedbackId sm_feedbackCanConnect;
00474
00475
00476
00477
00478
00479
00480 static a2dFeedbackIdPinMapping sm_feedbackOnPinmapConnect;
00481
00482 const static long sm_PinUnConnected;
00483 const static long sm_PinConnected;
00484 const static long sm_PinCanConnect;
00485 const static long sm_PinCannotConnect;
00486 const static long sm_PinCanConnectToPinClass;
00487
00488 protected:
00489
00490 void OnEnterObject(a2dCanvasObjectMouseEvent &event);
00491
00492 void OnLeaveObject(a2dCanvasObjectMouseEvent &event);
00493
00494
00495
00496
00497
00498
00499
00500
00501
00502 virtual void EditFeedback( a2dIterC& ic, const a2dFeedbackId *id, a2dCanvasObject *currentEdit=0, int depth=INT_MAX, a2dCanvasObjectFlagsMask flags=0, double x=0, double y=0 );
00503 virtual void DrawHighLighted( a2dIterC& ic );
00504
00505 virtual void RestoreConnectionsAfterCloning( class a2dCanvasCommandProcessor *cp = 0 );
00506 virtual void ClearAllPinConnections( class a2dCanvasCommandProcessor *cp );
00507
00508 void DoRender( a2dIterC& ic, OVERLAP clipparent );
00509 a2dBoundingBox DoGetUnTransformedBbox( a2dBboxFlags flags = a2dCANOBJ_BBOX_NON ) const;
00510 bool DoUpdate( UpdateMode mode, const a2dBoundingBox& childbox, const a2dBoundingBox& clipbox, const a2dBoundingBox& propbox );
00511
00512 #ifdef _DEBUG
00513 virtual void DoDump( int indent, wxString *line );
00514 #endif
00515
00516
00517 a2dPinClass* m_pinclass;
00518
00519
00520 bool m_dynamicPin: 1;
00521
00522
00523
00524 bool m_temporaryPin: 1;
00525
00526
00527 bool m_RenderConnected: 1;
00528
00529
00530 bool m_internal: 1;
00531
00532
00533 bool m_objectPin: 1;
00534
00535
00536
00537
00538
00539 a2dPin* m_canvaspin;
00540
00541
00542 a2dPin* m_clonebrother;
00543
00544 private:
00545
00546 a2dPin( const a2dPin &other );
00547 };
00548
00549 #if (defined(__WXMSW__) && defined(WXUSINGDLL) )
00550
00551 template class A2DCANVASDLLEXP a2dSmrtPtr<a2dPin>;
00552 #endif
00553 typedef a2dSmrtPtr<a2dPin> a2dPinPtr;
00554
00555
00556
00557
00558
00559
00560
00561
00562
00563
00564
00565
00566
00567
00568
00569
00570
00571
00572
00573
00574
00575
00576
00577
00578
00579
00580
00581
00582 class A2DCANVASDLLEXP a2dPinClass
00583 {
00584 public:
00585
00586 enum a2dPinClassFlags
00587 {
00588
00589 PC_input = 0x0001,
00590
00591
00592 PC_output = 0x0002,
00593
00594
00595 PC_angle = 0x0004,
00596
00597
00598 PC_ALLSET = 0xFFFFFFFF
00599 };
00600
00601
00602
00603
00604
00605
00606 a2dPinClass( const wxString &name, wxUint32 flags = PC_input | PC_output );
00607
00608
00609 ~a2dPinClass();
00610
00611
00612 void AddConnect( a2dPinClass* pinClass ) { m_canConnectTo.push_back( pinClass ); }
00613
00614
00615 void RemoveConnect( a2dPinClass* pinClass );
00616
00617
00618 static void InitializeStockPinClasses();
00619
00620
00621 static void DeleteStockPinClasses();
00622
00623 const wxString &GetName() const { return m_name; }
00624
00625
00626 bool IsInputPin() const { return (m_flags & PC_input) == PC_input; }
00627
00628
00629 bool IsOutputPin() const { return (m_flags & PC_output) == PC_output; }
00630
00631
00632 bool HasAngleLine() const { return (m_flags & PC_angle) == PC_angle; }
00633
00634
00635 void SetAngleLine( bool value ) { value?(m_flags = m_flags | PC_angle) :
00636 m_flags = m_flags & ( PC_ALLSET ^ PC_angle ); }
00637
00638
00639 wxUint32 GetFlags() { return m_flags; }
00640
00641
00642
00643
00644
00645
00646
00647
00648
00649 a2dPinClass* CanConnectTo( a2dPinClass *other = NULL, wxUint32 flags = PC_input | PC_output ) const;
00650
00651
00652 std::list< a2dPinClass* >& GetConnectList() { return m_canConnectTo; }
00653
00654
00655
00656
00657
00658
00659
00660
00661
00662 a2dPinClass* CanConnectToAsWire( a2dPinClass *specific = NULL, wxUint32 flags = PC_input | PC_output ) const;
00663
00664
00665
00666
00667
00668
00669
00670
00671
00672 a2dPinClass* CanConnectToAsObject( a2dPinClass *specific = NULL, wxUint32 flags = PC_input | PC_output ) const;
00673
00674
00675
00676
00677
00678
00679 void SetConnectObject( a2dCanvasObject *tmplObject );
00680
00681
00682 a2dCanvasObject* GetConnectObject() const;
00683
00684
00685 static a2dPinClass *GetClassByName( const wxString &name );
00686
00687
00688 void SetPin( a2dPin* newpin );
00689
00690
00691 a2dPin* GetPin();
00692
00693
00694 void SetPinCanConnect( a2dPin* newpin );
00695
00696
00697
00698 a2dPin* GetPinCanConnect();
00699
00700
00701 void SetPinCannotConnect( a2dPin* newpin );
00702
00703
00704
00705 a2dPin* GetPinCannotConnect();
00706
00707
00708 void SetConnectionGenerator( a2dConnectionGenerator *connectionGenerator ) { m_connectionGenerator = connectionGenerator; };
00709
00710
00711 a2dConnectionGenerator* GetConnectionGenerator() const { return m_connectionGenerator; }
00712
00713 a2dPinClass* GetPinClassForTask( a2dConnectTask task, a2dCanvasObject* obj ) const
00714 { return m_connectionGenerator->GetPinClassForTask( const_cast<a2dPinClass*>(this), task, obj ); }
00715
00716 protected:
00717
00718
00719 wxString m_name;
00720
00721
00722
00723
00724
00725
00726 std::list< a2dPinClass* > m_canConnectTo;
00727
00728
00729 wxUint32 m_flags;
00730
00731
00732 a2dCanvasObjectPtr m_tmplObject;
00733
00734 a2dPinPtr m_defPin;
00735
00736 a2dPinPtr m_defCanConnectPin;
00737
00738 a2dPinPtr m_defCannotConnectPin;
00739
00740
00741 a2dConnectionGeneratorPtr m_connectionGenerator;
00742
00743 public:
00744
00745
00746 static std::list< a2dPinClass* > m_allPinClasses;
00747
00748
00749
00750
00751
00752 static a2dPinClass* Any;
00753
00754
00755 static a2dPinClass* Standard;
00756
00757
00758 static a2dPinClass* Object;
00759
00760 static a2dPinClass* Wire;
00761
00762
00763 static a2dPinClass* Input;
00764
00765 static a2dPinClass* Output;
00766
00767
00768 static a2dPinClass* ObjectInput;
00769
00770 static a2dPinClass* ObjectOutput;
00771
00772 static a2dPinClass* WireInput;
00773
00774 static a2dPinClass* WireOutput;
00775 };
00776
00777
00778
00779
00780
00781
00782
00783 class A2DCANVASDLLEXP a2dRectC: public a2dCanvasObject
00784 {
00785 public:
00786
00787
00788 a2dRectC();
00789
00790
00791
00792
00793
00794
00795
00796
00797
00798
00799 a2dRectC( double xc, double yc, double w, double h, double angle =0 , double radius=0);
00800
00801
00802 a2dRectC( const a2dRectC& ori, CloneOptions options );
00803
00804
00805 ~a2dRectC();
00806
00807 virtual a2dObject* Clone( CloneOptions options ) const;
00808
00809
00810
00811
00812
00813
00814
00815
00816
00817
00818 void Set(double xc, double yc, double w, double h, double angle =0 , double radius=0);
00819
00820
00821
00822
00823
00824 void SetWidth( double w) { m_width=w; SetPending(true); }
00825
00826
00827
00828
00829
00830 void SetHeight( double h) { m_height=h; SetPending(true); }
00831
00832
00833 double GetWidth() const { return m_width; }
00834
00835 double GetHeight() const { return m_height; }
00836
00837 double GetRadius() const { return m_height; }
00838
00839 #if wxART2D_USE_CVGIO
00840 virtual void DoSave( wxObject* parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts , a2dObjectList* towrite );
00841 #endif //wxART2D_USE_CVGIO
00842
00843 a2dVertexList* GetAsPolygon();
00844
00845 a2dCanvasObjectList* GetAsCanvasVpaths( bool transform = true );
00846
00847 DECLARE_CLASS(a2dRectC)
00848
00849 protected:
00850
00851 void DoRender( a2dIterC& ic, OVERLAP clipparent );
00852 bool DoIsHitWorld( a2dIterC& ic, a2dHitEvent& hitEvent );
00853 a2dBoundingBox DoGetUnTransformedBbox( a2dBboxFlags flags = a2dCANOBJ_BBOX_NON ) const;
00854
00855
00856 double m_width;
00857
00858 double m_height;
00859
00860 double m_radius;
00861
00862 public:
00863
00864 static a2dPropertyIdDouble* PROPID_Width;
00865 static a2dPropertyIdDouble* PROPID_Height;
00866 static a2dPropertyIdDouble* PROPID_Radius;
00867
00868 DECLARE_PROPERTIES()
00869
00870 private:
00871
00872 a2dRectC( const a2dRectC& ori );
00873 };
00874
00875
00876
00877
00878
00879
00880
00881
00882 class A2DCANVASDLLEXP a2dArrow: public a2dCanvasObject
00883 {
00884 public:
00885
00886
00887
00888
00889
00890
00891
00892
00893
00894
00895 a2dArrow( double xt, double yt, double l1, double l2, double b, bool spline = false);
00896
00897
00898 a2dArrow();
00899
00900
00901 a2dArrow( const a2dArrow& ori, CloneOptions options );
00902
00903 ~a2dArrow();
00904
00905 virtual a2dObject* Clone( CloneOptions options ) const;
00906
00907
00908
00909
00910
00911
00912
00913
00914
00915 void Set(double xt, double yt, double l1, double l2, double b, bool spline = false );
00916
00917
00918
00919
00920
00921
00922
00923 void Set( double l1, double l2, double b, bool spline = false );
00924
00925
00926 double GetL1() { return m_l1; }
00927
00928
00929 double GetL2() { return m_l2; }
00930
00931
00932 double GetBase() { return m_b; }
00933
00934
00935 bool GetSpline() { return m_spline; }
00936
00937
00938 a2dVertexList* GetAsPolygon();
00939
00940
00941 a2dCanvasObjectList* GetAsCanvasVpaths( bool transform = true );
00942
00943 DECLARE_CLASS(a2dArrow)
00944
00945 protected:
00946
00947 #if wxART2D_USE_CVGIO
00948 virtual void DoSave( wxObject* parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts , a2dObjectList* towrite );
00949
00950 void DoLoad( wxObject* parent, a2dIOHandlerXmlSerIn& parser, a2dXmlSer_flag xmlparts );
00951 #endif //wxART2D_USE_CVGIO
00952
00953 void DoRender( a2dIterC& ic, OVERLAP clipparent );
00954
00955 bool DoIsHitWorld( a2dIterC& ic, a2dHitEvent& hitEvent );
00956
00957 a2dBoundingBox DoGetUnTransformedBbox( a2dBboxFlags flags = a2dCANOBJ_BBOX_NON ) const;
00958
00959
00960 double m_l1;
00961
00962
00963 double m_l2;
00964
00965
00966 double m_b;
00967
00968
00969 bool m_spline;
00970
00971
00972 private:
00973
00974 a2dArrow( const a2dArrow& ori );
00975 };
00976
00977
00978
00979
00980
00981
00982
00983
00984 class A2DCANVASDLLEXP a2dWH: public a2dCanvasObject
00985 {
00986 A2D_DECLARE_EVENT_TABLE()
00987
00988 public:
00989
00990 a2dWH();
00991
00992
00993
00994
00995
00996
00997
00998
00999 a2dWH( double x, double y, double w, double h);
01000
01001
01002 ~a2dWH();
01003
01004
01005 a2dWH( const a2dWH& other, CloneOptions options );
01006
01007
01008 virtual a2dObject* Clone( CloneOptions options ) const = 0;
01009
01010
01011
01012
01013
01014 void SetWidth( double w) { m_width = w; SetPending(true); }
01015
01016
01017
01018
01019
01020 void SetHeight( double h) { m_height = h; SetPending(true); }
01021
01022
01023 double GetWidth() const { return m_width; }
01024
01025 double GetHeight() const { return m_height; }
01026
01027 #if wxART2D_USE_CVGIO
01028 virtual void DoSave( wxObject* parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts , a2dObjectList* towrite );
01029
01030 void DoLoad( wxObject* parent, a2dIOHandlerXmlSerIn& parser, a2dXmlSer_flag xmlparts );
01031 #endif //wxART2D_USE_CVGIO
01032
01033 a2dCanvasObjectList* GetAsCanvasVpaths( bool transform = true );
01034
01035 bool RestrictToObject( a2dRestrictionEngine* engine, a2dSnapToWhatMask snapToWhat );
01036
01037 DECLARE_CLASS(a2dWH)
01038
01039 protected:
01040
01041
01042 a2dBoundingBox DoGetUnTransformedBbox( a2dBboxFlags flags = a2dCANOBJ_BBOX_NON ) const;
01043 bool DoIsHitWorld( a2dIterC& ic, a2dHitEvent& hitEvent );
01044 bool DoStartEdit( wxUint16 editmode, wxEditStyle editstyle );
01045 void OnHandleEvent(a2dHandleMouseEvent &event);
01046
01047 bool DoUpdate( UpdateMode mode, const a2dBoundingBox& childbox, const a2dBoundingBox& clipbox, const a2dBoundingBox& propbox );
01048 void OnResizeObjectToChildBox(a2dCanvasObjectEvent &event);
01049
01050
01051 double m_width;
01052
01053 double m_height;
01054
01055 public:
01056
01057
01058 static a2dPropertyIdDouble* PROPID_Width;
01059
01060 static a2dPropertyIdDouble* PROPID_Height;
01061
01062 DECLARE_PROPERTIES()
01063
01064 private:
01065
01066 a2dWH( const a2dWH& other );
01067 };
01068
01069
01070
01071
01072
01073
01074
01075
01076 class A2DCANVASDLLEXP a2dWHCenter: public a2dWH
01077 {
01078 A2D_DECLARE_EVENT_TABLE()
01079
01080 public:
01081
01082 a2dWHCenter();
01083
01084
01085
01086
01087
01088
01089
01090
01091 a2dWHCenter( double xc, double yc, double w, double h);
01092
01093
01094 ~a2dWHCenter();
01095
01096
01097 a2dWHCenter( const a2dWHCenter& other, CloneOptions options );
01098
01099
01100 virtual a2dObject* Clone( CloneOptions options ) const = 0;
01101
01102 DECLARE_CLASS(a2dWHCenter)
01103
01104 public:
01105
01106 static a2dPropertyIdDouble* PROPID_Width;
01107 static a2dPropertyIdDouble* PROPID_Height;
01108
01109 DECLARE_PROPERTIES()
01110
01111 private:
01112
01113 a2dWHCenter( const a2dWHCenter& other );
01114 };
01115
01116
01117
01118
01119
01120
01121
01122 class A2DCANVASDLLEXP a2dRect: public a2dWH
01123 {
01124
01125 A2D_DECLARE_EVENT_TABLE()
01126
01127 public:
01128
01129 a2dRect();
01130
01131
01132
01133
01134
01135
01136
01137
01138
01139
01140 a2dRect( double x, double y, double w, double h , double radius=0, double contourwidth = 0 );
01141
01142
01143
01144
01145
01146
01147
01148
01149 a2dRect( const a2dPoint2D& p1, const a2dPoint2D& p2, double radius=0, double contourwidth = 0 );
01150
01151
01152
01153
01154
01155
01156
01157 a2dRect( const a2dBoundingBox& bbox, double radius=0, double contourwidth = 0 );
01158
01159 a2dRect( const a2dRect& rec, CloneOptions options );
01160
01161 ~a2dRect();
01162
01163 virtual a2dObject* Clone( CloneOptions options ) const;
01164
01165
01166 void SetContourWidth(double width) { m_contourwidth = width; SetPending(true); }
01167
01168
01169 double GetContourWidth() const { return m_contourwidth; }
01170
01171
01172
01173
01174
01175 void SetRadius( double radius ) { m_radius = radius; SetPending(true); }
01176
01177
01178 double GetRadius() const { return m_radius; }
01179
01180
01181
01182 void SetBoxType( int type ) { m_boxtype = type; }
01183
01184
01185
01186 int GetBoxType() const { return m_boxtype; }
01187
01188 #if wxART2D_USE_CVGIO
01189 virtual void DoSave( wxObject* parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts , a2dObjectList* towrite );
01190
01191 void DoLoad( wxObject* parent, a2dIOHandlerXmlSerIn& parser, a2dXmlSer_flag xmlparts );
01192 #endif //wxART2D_USE_CVGIO
01193
01194 a2dVertexList* GetAsPolygon();
01195
01196 a2dCanvasObjectList* GetAsCanvasVpaths( bool transform = true );
01197
01198 bool GeneratePins( a2dPinClass* toConnectTo, a2dConnectTask task, double x, double y );
01199
01200 void OnHandleEvent(a2dHandleMouseEvent &event);
01201
01202 DECLARE_DYNAMIC_CLASS(a2dRect)
01203
01204 protected:
01205
01206 virtual void EditFeedback( a2dIterC& ic, const a2dFeedbackId *id, a2dCanvasObject *currentEdit=0, int depth=INT_MAX, a2dCanvasObjectFlagsMask flags=0, double x=0, double y=0 );
01207
01208 virtual bool DoStartEdit( wxUint16 editmode, wxEditStyle editstyle );
01209
01210 void DoRender( a2dIterC& ic, OVERLAP clipparent );
01211 bool DoIsHitWorld( a2dIterC& ic, a2dHitEvent& hitEvent );
01212 a2dBoundingBox DoGetUnTransformedBbox( a2dBboxFlags flags = a2dCANOBJ_BBOX_NON ) const;
01213
01214
01215 int m_boxtype;
01216
01217
01218 double m_radius;
01219
01220
01221 double m_contourwidth;
01222
01223 public:
01224
01225 static a2dPropertyIdDouble* PROPID_Radius;
01226
01227 DECLARE_PROPERTIES()
01228
01229 private:
01230
01231 a2dRect( const a2dRect &other );
01232 };
01233
01234
01235
01236
01237
01238 class A2DCANVASDLLEXP a2dCircle: public a2dCanvasObject
01239 {
01240 public:
01241 a2dCircle( const a2dCircle& ori, CloneOptions options );
01242
01243 a2dCircle();
01244
01245
01246
01247
01248
01249
01250
01251
01252 a2dCircle( double x, double y, double radius, double width = 0 );
01253
01254
01255 ~a2dCircle();
01256
01257 virtual a2dObject* Clone( CloneOptions options ) const;
01258
01259
01260
01261
01262
01263
01264 void SetRadius(double radius) { m_radius = radius; SetPending(true); }
01265
01266
01267 double GetRadius() const { return m_radius; }
01268
01269
01270 void SetContourWidth(double width) { m_contourwidth = width; SetPending(true); }
01271
01272
01273 double GetContourWidth() const { return m_contourwidth; }
01274
01275 #if wxART2D_USE_CVGIO
01276 virtual void DoSave( wxObject* parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts , a2dObjectList* towrite );
01277
01278 void DoLoad( wxObject* parent, a2dIOHandlerXmlSerIn& parser, a2dXmlSer_flag xmlparts );
01279 #endif //wxART2D_USE_CVGIO
01280
01281 a2dVertexList* GetAsPolygon();
01282
01283 a2dCanvasObjectList* GetAsCanvasVpaths( bool transform = true );
01284
01285 bool GeneratePins( a2dPinClass* toConnectTo, a2dConnectTask task, double x, double y );
01286
01287 DECLARE_DYNAMIC_CLASS(a2dCircle)
01288
01289 protected:
01290
01291 virtual bool DoStartEdit( wxUint16 editmode, wxEditStyle editstyle );
01292
01293 void DoRender( a2dIterC& ic, OVERLAP clipparent );
01294 bool DoIsHitWorld( a2dIterC& ic, a2dHitEvent& hitEvent );
01295 a2dBoundingBox DoGetUnTransformedBbox( a2dBboxFlags flags = a2dCANOBJ_BBOX_NON ) const;
01296 bool DoUpdate( UpdateMode mode, const a2dBoundingBox& childbox, const a2dBoundingBox& clipbox, const a2dBoundingBox& propbox );
01297
01298
01299 double m_radius;
01300
01301
01302 double m_contourwidth;
01303
01304 public:
01305
01306 static a2dPropertyIdDouble* PROPID_Radius;
01307
01308 DECLARE_PROPERTIES()
01309
01310 private:
01311
01312 a2dCircle( const a2dCircle &other );
01313 };
01314
01315
01316
01317
01318
01319 class A2DCANVASDLLEXP a2dEllipse: public a2dWHCenter
01320 {
01321 public:
01322
01323 a2dEllipse();
01324
01325
01326
01327
01328
01329
01330
01331
01332
01333 a2dEllipse( double xc, double yc, double width, double height, double contourwidth = 0 );
01334 a2dEllipse( const a2dEllipse& ori, CloneOptions options );
01335 ~a2dEllipse();
01336
01337 virtual a2dObject* Clone( CloneOptions options ) const;
01338
01339 #if wxART2D_USE_CVGIO
01340 virtual void DoSave( wxObject* parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts , a2dObjectList* towrite );
01341
01342 void DoLoad( wxObject* parent, a2dIOHandlerXmlSerIn& parser, a2dXmlSer_flag xmlparts );
01343 #endif //wxART2D_USE_CVGIO
01344
01345 a2dVertexList* GetAsPolygon();
01346
01347 a2dCanvasObjectList* GetAsCanvasVpaths( bool transform = true );
01348
01349
01350 void SetContourWidth(double width) { m_contourwidth = width; SetPending(true); }
01351
01352
01353 double GetContourWidth() const { return m_contourwidth; }
01354
01355 bool GeneratePins( a2dPinClass* toConnectTo, a2dConnectTask task, double x, double y );
01356
01357 DECLARE_DYNAMIC_CLASS(a2dEllipse)
01358
01359 protected:
01360
01361 virtual bool DoStartEdit( wxUint16 editmode, wxEditStyle editstyle );
01362
01363 void DoRender( a2dIterC& ic, OVERLAP clipparent );
01364 bool DoIsHitWorld( a2dIterC& ic, a2dHitEvent& hitEvent );
01365 a2dBoundingBox DoGetUnTransformedBbox( a2dBboxFlags flags = a2dCANOBJ_BBOX_NON ) const;
01366 bool DoUpdate( UpdateMode mode, const a2dBoundingBox& childbox, const a2dBoundingBox& clipbox, const a2dBoundingBox& propbox );
01367
01368 private:
01369
01370 a2dEllipse( const a2dEllipse &other );
01371
01372
01373 double m_contourwidth;
01374
01375 };
01376
01377
01378
01379
01380
01381 class A2DCANVASDLLEXP a2dEllipticArc: public a2dWHCenter
01382 {
01383 A2D_DECLARE_EVENT_TABLE()
01384
01385 public:
01386
01387
01388 a2dEllipticArc();
01389
01390
01391
01392
01393
01394
01395
01396
01397
01398
01399
01400
01401 a2dEllipticArc( double xc, double yc, double width, double height, double start, double end, bool chord = false, double contourwidth = 0 );
01402
01403
01404 a2dEllipticArc( const a2dEllipticArc& ori, CloneOptions options );
01405
01406
01407 ~a2dEllipticArc();
01408
01409 virtual a2dObject* Clone( CloneOptions options ) const;
01410
01411
01412
01413
01414
01415
01416 void SetStart(double start) { m_start = start; SetPending(true); }
01417
01418
01419 double GetStart() { return m_start; }
01420
01421
01422
01423
01424
01425
01426 void SetEnd(double end) { m_end = end; SetPending(true); }
01427
01428
01429 double GetEnd() { return m_end; }
01430
01431
01432 void SetChord( bool chord );
01433
01434
01435 bool GetChord() { return m_chord; }
01436
01437 #if wxART2D_USE_CVGIO
01438 virtual void DoSave( wxObject* parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts , a2dObjectList* towrite );
01439
01440 void DoLoad( wxObject* parent, a2dIOHandlerXmlSerIn& parser, a2dXmlSer_flag xmlparts );
01441 #endif //wxART2D_USE_CVGIO
01442
01443 a2dVertexList* GetAsPolygon();
01444
01445 a2dCanvasObjectList* GetAsCanvasVpaths( bool transform = true );
01446
01447
01448 void SetContourWidth(double width) { m_contourwidth = width; SetPending(true); }
01449
01450
01451 double GetContourWidth() const { return m_contourwidth; }
01452
01453 DECLARE_DYNAMIC_CLASS(a2dEllipticArc)
01454
01455 protected:
01456
01457 virtual bool DoStartEdit( wxUint16 editmode, wxEditStyle editstyle );
01458
01459 void OnChar(wxKeyEvent& event);
01460
01461 void OnHandleEvent(a2dHandleMouseEvent &event);
01462
01463 void DoRender( a2dIterC& ic, OVERLAP clipparent );
01464 bool DoIsHitWorld( a2dIterC& ic, a2dHitEvent& hitEvent );
01465 a2dBoundingBox DoGetUnTransformedBbox( a2dBboxFlags flags = a2dCANOBJ_BBOX_NON ) const;
01466 bool DoUpdate( UpdateMode mode, const a2dBoundingBox& childbox, const a2dBoundingBox& clipbox, const a2dBoundingBox& propbox );
01467
01468
01469 bool m_chord;
01470
01471
01472 double m_start;
01473
01474
01475 double m_end;
01476
01477
01478 double m_contourwidth;
01479
01480 public:
01481
01482 static a2dPropertyIdDouble* PROPID_StartAngle;
01483 static a2dPropertyIdDouble* PROPID_EndAngle;
01484 static a2dPropertyIdBool* PROPID_Chord;
01485
01486 DECLARE_PROPERTIES()
01487
01488 private:
01489
01490 a2dEllipticArc( const a2dEllipticArc &other );
01491 };
01492
01493 #if (defined(__WXMSW__) && defined(WXUSINGDLL) )
01494 template class A2DCANVASDLLEXP a2dSmrtPtr<a2dEllipticArc>;
01495 #endif
01496
01497
01498
01499
01500
01501
01502
01503
01504
01505
01506
01507 class A2DCANVASDLLEXP a2dArc: public a2dCanvasObject
01508 {
01509 A2D_DECLARE_EVENT_TABLE()
01510
01511 public:
01512
01513
01514 a2dArc();
01515
01516
01517
01518
01519
01520
01521
01522
01523
01524
01525
01526
01527
01528 a2dArc( double xc, double yc, double radius, double start, double end, bool chord = false, double contourwidth = 0 );
01529
01530
01531
01532
01533
01534
01535
01536
01537
01538
01539
01540
01541 a2dArc( double x1, double y1, double x2, double y2, double xc, double yc, bool chord = false, double contourwidth = 0 );
01542
01543
01544 a2dArc( const a2dArc& ori, CloneOptions options );
01545
01546
01547 ~a2dArc();
01548
01549
01550 double GetX1() const { return m_x1; }
01551
01552 double GetY1() const { return m_y1; }
01553
01554 double GetX2() const { return m_x2; }
01555
01556 double GetY2() const{ return m_y2; }
01557
01558 double GetStartAngle() const;
01559
01560 double GetEndAngle() const;
01561
01562
01563 a2dPoint2D GetMidPoint() const;
01564
01565
01566 void SetX1( double x1 ) { m_x1 = x1; SetPending(true); }
01567
01568 void SetY1( double y1 ) { m_y1 = y1; SetPending(true); }
01569
01570 void SetX2( double x2 ) { m_x2 = x2; SetPending(true); }
01571
01572 void SetY2( double y2 ) { m_y2 = y2; SetPending(true); }
01573
01574 void SetStartAngle( double a );
01575
01576 void SetEndAngle( double a );
01577
01578
01579 void Set( double xs, double ys, double xm, double ym, double xe, double ye );
01580
01581 virtual a2dObject* Clone( CloneOptions options ) const;
01582
01583
01584 void SetRadius( double radius );
01585
01586
01587 double GetRadius() const;
01588
01589
01590 void SetChord( bool chord );
01591
01592
01593 bool GetChord() const { return m_chord; }
01594
01595 #if wxART2D_USE_CVGIO
01596 virtual void DoSave( wxObject* parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts , a2dObjectList* towrite );
01597
01598 void DoLoad( wxObject* parent, a2dIOHandlerXmlSerIn& parser, a2dXmlSer_flag xmlparts );
01599 #endif //wxART2D_USE_CVGIO
01600
01601
01602 a2dVertexList* GetAsPolygon();
01603
01604 a2dCanvasObjectList* GetAsCanvasVpaths( bool transform = true );
01605
01606 void SetContourWidth(double width) { m_contourwidth = width; SetPending(true); }
01607
01608
01609 double GetContourWidth() const { return m_contourwidth; }
01610
01611 DECLARE_DYNAMIC_CLASS(a2dArc)
01612
01613 protected:
01614
01615 virtual bool DoStartEdit( wxUint16 editmode, wxEditStyle editstyle );
01616
01617 void OnChar(wxKeyEvent& event);
01618
01619 void OnHandleEvent(a2dHandleMouseEvent &event);
01620
01621 void DoRender( a2dIterC& ic, OVERLAP clipparent );
01622 bool DoIsHitWorld( a2dIterC& ic, a2dHitEvent& hitEvent );
01623 a2dBoundingBox DoGetUnTransformedBbox( a2dBboxFlags flags = a2dCANOBJ_BBOX_NON ) const;
01624 bool DoUpdate( UpdateMode mode, const a2dBoundingBox& childbox, const a2dBoundingBox& clipbox, const a2dBoundingBox& propbox );
01625
01626
01627 bool m_chord;
01628
01629
01630 double m_x1;
01631
01632 double m_y1;
01633
01634
01635 double m_x2;
01636
01637
01638 double m_y2;
01639
01640
01641 double m_contourwidth;
01642
01643 public:
01644
01645
01646 static a2dPropertyIdDouble* PROPID_X1;
01647
01648 static a2dPropertyIdDouble* PROPID_X2;
01649
01650 static a2dPropertyIdDouble* PROPID_Y1;
01651
01652 static a2dPropertyIdDouble* PROPID_Y2;
01653
01654 static a2dPropertyIdBool* PROPID_Chord;
01655
01656 static a2dPropertyIdDouble* PROPID_StartAngle;
01657
01658 static a2dPropertyIdDouble* PROPID_EndAngle;
01659
01660 DECLARE_PROPERTIES()
01661
01662 private:
01663
01664 a2dArc( const a2dArc &other );
01665 };
01666
01667
01668
01669
01670
01671 class A2DCANVASDLLEXP a2dSLine: public a2dCanvasObject
01672 {
01673 A2D_DECLARE_EVENT_TABLE()
01674
01675 public:
01676
01677 a2dSLine();
01678
01679
01680
01681
01682
01683
01684
01685
01686
01687 a2dSLine( double x1, double y1, double x2, double y2, double contourwidth = 0 );
01688
01689
01690 a2dSLine( const a2dSLine& ori, CloneOptions options );
01691
01692
01693
01694 ~a2dSLine();
01695
01696 virtual a2dObject* Clone( CloneOptions options ) const;
01697
01698
01699
01700
01701
01702 double GetPosX1( bool transform = true ) const;
01703
01704
01705
01706
01707
01708 double GetPosY1( bool transform = true ) const;
01709
01710
01711
01712
01713
01714 double GetPosX2( bool transform = true ) const;
01715
01716
01717
01718
01719
01720 double GetPosY2( bool transform = true ) const;
01721
01722
01723
01724
01725
01726 double GetLength() const;
01727
01728
01729 bool EliminateMatrix();
01730
01731
01732
01733
01734
01735
01736
01737
01738
01739
01740
01741 void SetPosXY1( double x, double y, bool afterinversion = true );
01742
01743
01744
01745
01746
01747
01748
01749
01750
01751
01752
01753 void SetPosXY2( double x, double y, bool afterinversion = true );
01754
01755
01756
01757
01758
01759
01760
01761
01762
01763
01764
01765
01766
01767 void SetPosXY12( double x1, double y1, double x2, double y2, bool afterinversion = true );
01768
01769
01770 virtual void SetBegin(a2dCanvasObject *WXUNUSED(begin)) {}
01771
01772 virtual void SetEnd(a2dCanvasObject *WXUNUSED(end)) {}
01773
01774
01775 virtual a2dCanvasObject* GetBegin() { return NULL; }
01776
01777
01778 virtual a2dCanvasObject* GetEnd() { return NULL; }
01779
01780
01781 virtual void SetEndScaleX(double WXUNUSED(xs)) {}
01782
01783 virtual void SetEndScaleY(double WXUNUSED(ys)) {}
01784
01785
01786 double GetEndScaleX(){ return 1; }
01787
01788 double GetEndScaleY(){ return 1; }
01789
01790
01791 void SetContourWidth(double width) { m_contourwidth = width; SetPending(true); }
01792
01793
01794 double GetContourWidth() const { return m_contourwidth; }
01795
01796
01797 void SetPathType( a2dPATH_END_TYPE pathtype ) { m_pathtype = pathtype; }
01798
01799
01800 a2dPATH_END_TYPE GetPathType() { return m_pathtype; }
01801
01802 a2dCanvasObjectList* GetAsCanvasVpaths( bool transform = true );
01803
01804 bool RestrictToObject( a2dRestrictionEngine* engine, a2dSnapToWhatMask snapToWhat );
01805
01806 #if wxART2D_USE_CVGIO
01807 virtual void DoSave( wxObject* parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts , a2dObjectList* towrite );
01808
01809 void DoLoad( wxObject* parent, a2dIOHandlerXmlSerIn& parser, a2dXmlSer_flag xmlparts );
01810 #endif //wxART2D_USE_CVGIO
01811
01812 DECLARE_DYNAMIC_CLASS(a2dSLine)
01813
01814 protected:
01815
01816 virtual bool DoStartEdit( wxUint16 editmode, wxEditStyle editstyle );
01817
01818 void OnChar(wxKeyEvent& event);
01819
01820 void OnHandleEvent(a2dHandleMouseEvent &event);
01821
01822 void DoRender( a2dIterC& ic, OVERLAP clipparent );
01823 bool DoIsHitWorld( a2dIterC& ic, a2dHitEvent& hitEvent );
01824 a2dBoundingBox DoGetUnTransformedBbox( a2dBboxFlags flags = a2dCANOBJ_BBOX_NON ) const;
01825
01826
01827 double m_x1;
01828
01829 double m_y1;
01830
01831 double m_x2;
01832
01833 double m_y2;
01834
01835
01836 double m_contourwidth;
01837
01838
01839 a2dPATH_END_TYPE m_pathtype;
01840
01841 public:
01842 static a2dPropertyIdDouble* PROPID_X1;
01843 static a2dPropertyIdDouble* PROPID_X2;
01844 static a2dPropertyIdDouble* PROPID_Y1;
01845 static a2dPropertyIdDouble* PROPID_Y2;
01846
01847 DECLARE_PROPERTIES()
01848
01849 private:
01850
01851 a2dSLine( const a2dSLine &other );
01852 };
01853
01854
01855
01856
01857
01858 class A2DCANVASDLLEXP a2dEndsLine: public a2dSLine
01859 {
01860 public:
01861
01862 a2dEndsLine();
01863
01864
01865
01866
01867
01868
01869
01870
01871 a2dEndsLine( double x1, double y1, double x2, double y2, double contourwidth = 0 );
01872
01873
01874
01875 a2dEndsLine( const a2dEndsLine& ori, CloneOptions options );
01876
01877
01878 a2dEndsLine( const a2dSLine& ori, CloneOptions options );
01879
01880 ~a2dEndsLine();
01881
01882 virtual a2dObject* Clone( CloneOptions options ) const;
01883
01884
01885 void SetBegin(a2dCanvasObject* begin);
01886
01887 a2dCanvasObject* GetBegin() { return m_begin; }
01888
01889
01890 void SetEnd(a2dCanvasObject* end);
01891
01892 a2dCanvasObject* GetEnd() { return m_end; }
01893
01894
01895
01896
01897
01898 void SetEndScaleX(double xs){ m_xscale=xs; SetPending(true); }
01899
01900 double GetEndScaleX(){ return m_xscale; }
01901
01902
01903
01904
01905
01906 void SetEndScaleY(double ys){ m_yscale=ys; SetPending(true); }
01907
01908 double GetEndScaleY(){ return m_yscale; }
01909
01910
01911 void SetStyleToArrow( bool takeStyleToArrow ) { m_takeStyleToArrow = takeStyleToArrow; }
01912
01913 bool GetStyleToArrow() { return m_takeStyleToArrow; }
01914
01915 #if wxART2D_USE_CVGIO
01916 virtual void DoSave( wxObject* parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts , a2dObjectList* towrite );
01917
01918 void DoLoad( wxObject* parent, a2dIOHandlerXmlSerIn& parser, a2dXmlSer_flag xmlparts );
01919 #endif //wxART2D_USE_CVGIO
01920
01921 virtual void DoWalker( wxObject* parent, a2dWalkerIOHandler& handler );
01922
01923 DECLARE_DYNAMIC_CLASS(a2dEndsLine)
01924
01925 protected:
01926
01927 void DoRender( a2dIterC& ic, OVERLAP clipparent );
01928 bool DoIsHitWorld( a2dIterC& ic, a2dHitEvent& hitEvent );
01929 a2dBoundingBox DoGetUnTransformedBbox( a2dBboxFlags flags = a2dCANOBJ_BBOX_NON ) const;
01930 bool DoUpdate( UpdateMode mode, const a2dBoundingBox& childbox, const a2dBoundingBox& clipbox, const a2dBoundingBox& propbox );
01931
01932
01933 a2dCanvasObjectPtr m_begin;
01934
01935
01936 a2dCanvasObjectPtr m_end;
01937
01938
01939 double m_xscale;
01940
01941
01942 double m_yscale;
01943
01944
01945 bool m_takeStyleToArrow;
01946
01947 private:
01948
01949 a2dEndsLine( const a2dEndsLine &other );
01950 };
01951
01952
01953
01954
01955
01956
01957
01958
01959
01960
01961
01962 class A2DCANVASDLLEXP a2dScaledEndLine: public a2dEndsLine
01963 {
01964 A2D_DECLARE_EVENT_TABLE()
01965
01966 public:
01967
01968 a2dScaledEndLine();
01969
01970
01971
01972
01973
01974
01975
01976
01977
01978 a2dScaledEndLine( double x1, double y1, double x2, double y2, double contourwidth = 0 );
01979
01980
01981 a2dScaledEndLine( const a2dScaledEndLine& ori, CloneOptions options );
01982
01983
01984 a2dScaledEndLine( const a2dSLine& ori, CloneOptions options );
01985
01986
01987 ~a2dScaledEndLine();
01988
01989 virtual a2dObject* Clone( CloneOptions options ) const;
01990
01991
01992 void SetBegin( double l1, double l2, double b, bool spline = false );
01993
01994 void SetEnd( double l1, double l2, double b, bool spline = false );
01995
01996 DECLARE_DYNAMIC_CLASS(a2dScaledEndLine)
01997
01998 protected:
01999
02000 bool DoUpdate( UpdateMode mode, const a2dBoundingBox& childbox, const a2dBoundingBox& clipbox, const a2dBoundingBox& propbox );
02001
02002 void DoRender( a2dIterC& ic, OVERLAP clipparent );
02003
02004 private:
02005
02006 a2dScaledEndLine( const a2dScaledEndLine &other );
02007 };
02008
02009
02010
02011
02012
02013 class A2DCANVASDLLEXP a2dEndsEllipticChord: public a2dEllipticArc
02014 {
02015 public:
02016
02017
02018 a2dEndsEllipticChord();
02019
02020
02021
02022
02023
02024
02025
02026
02027
02028
02029 a2dEndsEllipticChord( double xc, double yc, double width, double height, double start, double end );
02030
02031
02032
02033 a2dEndsEllipticChord( const a2dEndsEllipticChord& ori, CloneOptions options );
02034
02035
02036 ~a2dEndsEllipticChord();
02037
02038 virtual a2dObject* Clone( CloneOptions options ) const;
02039
02040
02041 void SetBeginObj(a2dCanvasObject* begin);
02042
02043
02044 a2dCanvasObject* GetBeginObj() { return m_beginobj; }
02045
02046
02047 void SetEndObj(a2dCanvasObject* endob);
02048
02049
02050 a2dCanvasObject* GetEndObj() { return m_endobj; }
02051
02052
02053
02054
02055
02056 void SetEndScaleX(double xs){ m_xscale=xs; SetPending(true); }
02057
02058
02059 double GetEndScaleX(){ return m_xscale; }
02060
02061
02062
02063
02064
02065 void SetEndScaleY(double ys){ m_yscale=ys; SetPending(true); }
02066
02067
02068 double GetEndScaleY(){ return m_yscale; }
02069
02070 void DoWalker( wxObject *parent, a2dWalkerIOHandler& handler );
02071
02072 #if wxART2D_USE_CVGIO
02073 virtual void DoSave( wxObject* parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts , a2dObjectList* towrite );
02074
02075 void DoLoad( wxObject* parent, a2dIOHandlerXmlSerIn& parser, a2dXmlSer_flag xmlparts );
02076 #endif //wxART2D_USE_CVGIO
02077
02078 DECLARE_DYNAMIC_CLASS(a2dEndsEllipticChord)
02079
02080 protected:
02081
02082 void DoRender( a2dIterC& ic, OVERLAP clipparent );
02083 bool DoIsHitWorld( a2dIterC& ic, a2dHitEvent& hitEvent );
02084 a2dBoundingBox DoGetUnTransformedBbox( a2dBboxFlags flags = a2dCANOBJ_BBOX_NON ) const;
02085 bool DoUpdate( UpdateMode mode, const a2dBoundingBox& childbox, const a2dBoundingBox& clipbox, const a2dBoundingBox& propbox );
02086
02087
02088 a2dAffineMatrix GetBeginTransform() const;
02089
02090 a2dAffineMatrix GetEndTransform() const;
02091
02092
02093 a2dCanvasObjectPtr m_beginobj;
02094
02095
02096 a2dCanvasObjectPtr m_endobj;
02097
02098
02099 double m_xscale;
02100
02101
02102 double m_yscale;
02103 public:
02104
02105 private:
02106
02107 a2dEndsEllipticChord( const a2dEndsEllipticChord &other );
02108 };
02109
02110
02111
02112
02113
02114 class A2DCANVASDLLEXP a2dControl: public a2dRect
02115 {
02116 public:
02117
02118
02119
02120
02121
02122
02123
02124
02125
02126 a2dControl( double x, double y, double width, double height, wxWindow *control );
02127
02128 a2dControl( const a2dControl& ori, CloneOptions options );
02129
02130 ~a2dControl();
02131
02132 virtual a2dObject* Clone( CloneOptions options ) const;
02133
02134
02135 wxWindow* GetControl(){return m_control;}
02136
02137 DECLARE_CLASS(a2dControl)
02138
02139 protected:
02140
02141 virtual bool DoStartEdit( wxUint16 editmode, wxEditStyle editstyle );
02142
02143 virtual void DoEndEdit();
02144
02145 void DoRender( a2dIterC& ic, OVERLAP clipparent );
02146 bool DoIsHitWorld( a2dIterC& ic, a2dHitEvent& hitEvent );
02147 bool DoUpdate( UpdateMode mode, const a2dBoundingBox& childbox, const a2dBoundingBox& clipbox, const a2dBoundingBox& propbox );
02148
02149
02150 wxWindow *m_control;
02151
02152 private:
02153
02154
02155 a2dControl( const a2dControl &other );
02156 };
02157
02158
02159
02160
02161
02162
02163
02164
02165
02166
02167
02168
02169
02170 class A2DCANVASDLLEXP a2dWires: public a2dCanvasObject
02171 {
02172 public:
02173
02174
02175 a2dWires();
02176
02177
02178 a2dWires( a2dCanvasObject* toconnect, const wxString& pinname );
02179
02180
02181 a2dWires( a2dCanvasObject* toconnect, a2dPin* pinc );
02182
02183
02184 ~a2dWires();
02185
02186 virtual a2dObject* Clone( CloneOptions options ) const;
02187
02188
02189 virtual bool IsConnect() const;
02190
02191 bool NeedsUpdateWhenConnected() const { return !m_frozen; }
02192
02193 bool ConnectWith( a2dCanvasObject* parent, a2dCanvasObject* graph, const wxString& pinname, double margin = 1, bool undo = false );
02194
02195 bool ConnectWith( a2dCanvasObject* parent, a2dPin* pin, double margin = 1, bool undo = false );
02196
02197 bool GetFrozen() { return m_frozen; }
02198 void SetFrozen( bool freeze ) { m_frozen = freeze; }
02199
02200 DECLARE_CLASS(a2dWires)
02201
02202 protected:
02203
02204 virtual void CreateWires();
02205 bool DoUpdate( UpdateMode mode, const a2dBoundingBox& childbox, const a2dBoundingBox& clipbox, const a2dBoundingBox& propbox );
02206 void DoRender( a2dIterC& ic, OVERLAP clipparent );
02207
02208
02209 bool m_frozen;
02210 };
02211
02212 #endif
02213