00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef __WXCURVE_H__
00017 #define __WXCURVE_H__
00018
00019 #ifndef WX_PRECOMP
00020 #include "wx/wx.h"
00021 #endif
00022
00023 #include "wx/curves/meta.h"
00024 #include <wx/general/a2dlist.h>
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 class A2DCURVESDLLEXP a2dCurveObject: public a2dCanvasObject
00043 {
00044
00045 public:
00046
00047 a2dCurveObject();
00048
00049
00050 ~a2dCurveObject();
00051
00052
00053 a2dCurveObject( const a2dCurveObject& other, CloneOptions options );
00054
00055
00056
00057
00058
00059 void SetCurvesArea( a2dCurvesArea* curvesArea ) { m_curvesArea = curvesArea; }
00060
00061
00062 virtual a2dObject* Clone( CloneOptions options ) const = 0;
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072 virtual void World2Curve( double xw, double yw, double& xcurve, double& ycurve ) const;
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082 virtual void Curve2World( double xcurve, double ycurve, double& xw, double& yw ) const;
00083
00084 DECLARE_CLASS(a2dCurveObject)
00085
00086 protected:
00087
00088 bool DoUpdate( UpdateMode mode, const a2dBoundingBox& childbox, const a2dBoundingBox& clipbox, const a2dBoundingBox& propbox );
00089
00090
00091 a2dCurvesArea* m_curvesArea;
00092
00093
00094 a2dBoundingBox m_untransbbox;
00095
00096 private:
00097
00098 a2dCurveObject( const a2dCurveObject& other );
00099 };
00100
00101
00102
00103
00104
00105
00106
00107
00108 class A2DCURVESDLLEXP a2dCurve: public a2dCurveObject
00109 {
00110 public:
00111
00112
00113 enum a2dCurveRenderFlags
00114 {
00115 a2dCURVES_RENDER_NO_POINTS = 0x0001,
00116 a2dCURVES_RENDER_NORMAL = 0x0002,
00117 a2dCURVES_RENDER_FILL_LINE = 0x0004,
00118 a2dCURVES_RENDER_FILL = 0x0008,
00119 a2dCURVES_RENDER_3D = 0x0010,
00120 a2dCURVES_RENDER_DEFAULT = a2dCURVES_RENDER_NORMAL
00121 };
00122
00123
00124 enum a2dCurveEditFlags
00125 {
00126 a2dCURVES_EDIT_NORMAL = 0x0001,
00127 a2dCURVES_EDIT_FIXED_X = 0x0002,
00128 a2dCURVES_EDIT_FIXED_Y = 0x0004,
00129 a2dCURVES_EDIT_ALLOW_ADD = 0x0008,
00130 a2dCURVES_EDIT_DEFAULT = a2dCURVES_EDIT_NORMAL
00131 };
00132
00133 a2dCurve();
00134
00135 virtual ~a2dCurve();
00136
00137 a2dCurve( const a2dCurve &other, CloneOptions options );
00138
00139
00140 void SetBoundaries( double xmin, double ymin, double xmax, double ymax );
00141
00142
00143
00144
00145
00146
00147 a2dBoundingBox GetClippedCurveBoundaries();
00148
00149
00150
00151
00152
00153 a2dBoundingBox GetCurveBoundaries();
00154
00155 #if 0
00156
00157
00158
00159
00160 virtual double GetBoundaryMinX();
00161
00162
00163
00164
00165
00166 virtual double GetBoundaryMaxX();
00167
00168
00169
00170
00171
00172 virtual double GetBoundaryMinY();
00173
00174
00175
00176
00177
00178 virtual double GetBoundaryMaxY();
00179 #endif
00180
00181
00182
00183
00184
00185
00186
00187
00188 virtual bool GetXyAtSweep( double sweepValue, a2dPoint2D& point ) const = 0;
00189
00190 a2dlist< a2dFill >& GetPointFillList() { return m_pointsFill; }
00191
00192 void SetPointFillList( const a2dlist< a2dFill >& fillList) { m_pointsFill = fillList; }
00193
00194 bool IsHighlighted() const { return m_highlightmode == 1; }
00195
00196 void SetRenderLogicalFunction( wxRasterOperationMode logFunction ) { m_logFunction = logFunction; SetPending(true);}
00197
00198 wxRasterOperationMode GetRenderLogicalFunction() { return m_logFunction; }
00199
00200
00201 DECLARE_CLASS(a2dCurve)
00202
00203 protected:
00204
00205 #if wxART2D_USE_CVGIO
00206 virtual void DoSave( wxObject* parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts , a2dObjectList* towrite );
00207
00208 void DoLoad( wxObject* parent, a2dIOHandlerXmlSerIn& parser, a2dXmlSer_flag xmlparts );
00209 #endif //wxART2D_USE_CVGIO
00210
00211 int m_highlightmode;
00212 wxRasterOperationMode m_logFunction;
00213
00214
00215 a2dBoundingBox m_clipdata;
00216
00217
00218 mutable a2dBoundingBox m_curveBox;
00219
00220 a2dlist< a2dFill > m_pointsFill;
00221
00222 private:
00223
00224 a2dCurve( const a2dCurve &other );
00225 };
00226
00227 #if defined(WXART2D_USINGDLL)
00228 template class A2DCURVESDLLEXP a2dSmrtPtr<a2dCurve>;
00229 #endif
00230
00231
00232
00233
00234
00235
00236
00237 class A2DCURVESDLLEXP a2dFunctionCurve: public a2dCurve
00238 {
00239 public:
00240
00241 a2dFunctionCurve( const wxString& curve = _T("Not Specified") );
00242
00243 a2dFunctionCurve( const a2dFunctionCurve& other, CloneOptions options );
00244
00245 virtual ~a2dFunctionCurve();
00246
00247 virtual a2dObject* Clone( CloneOptions options ) const;
00248
00249 void SetXstep( double xstep ) { m_xstep=xstep; SetPending(true); }
00250
00251 virtual bool GetXyAtSweep( double sweepValue, a2dPoint2D& point ) const;
00252
00253 DECLARE_DYNAMIC_CLASS(a2dFunctionCurve)
00254
00255 protected:
00256
00257 #if wxART2D_USE_CVGIO
00258 virtual void DoSave( wxObject* parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts , a2dObjectList* towrite );
00259
00260 void DoLoad( wxObject* parent, a2dIOHandlerXmlSerIn& parser, a2dXmlSer_flag xmlparts );
00261 #endif //wxART2D_USE_CVGIO
00262
00263 a2dBoundingBox DoGetUnTransformedBbox( a2dBboxFlags flags = a2dCANOBJ_BBOX_NON ) const;
00264
00265 bool DoUpdate( UpdateMode mode, const a2dBoundingBox& childbox, const a2dBoundingBox& clipbox, const a2dBoundingBox& propbox );
00266
00267 void DoRender( a2dIterC& ic, OVERLAP clipparent );
00268
00269 bool DoIsHitWorld( a2dIterC& ic, a2dHitEvent& hitEvent );
00270
00271 wxString m_curve;
00272
00273 double m_xstep;
00274
00275 double m_xstart;
00276
00277 double m_xstop;
00278
00279 private:
00280
00281 #if wxART2D_USE_CANEXTOBJ
00282 mutable a2dEval m_toeval;
00283 #endif //wxART2D_USE_CANEXTOBJ
00284
00285 private:
00286
00287 a2dFunctionCurve( const a2dFunctionCurve &other );
00288 };
00289
00290
00291
00292
00293
00294
00295 class A2DCURVESDLLEXP a2dVertexCurve: public a2dCurve
00296 {
00297 A2D_DECLARE_EVENT_TABLE()
00298
00299 public:
00300
00301 a2dVertexCurve( a2dVertexArray* points );
00302
00303 a2dVertexCurve( );
00304
00305 a2dVertexCurve( const a2dVertexCurve& other, CloneOptions options );
00306
00307 virtual ~a2dVertexCurve();
00308
00309 virtual a2dObject* Clone( CloneOptions options ) const;
00310
00311
00312 virtual bool GetXyAtSweep( double sweepValue, a2dPoint2D& point ) const;
00313
00314
00315 a2dVertexArray* GetPoints() { return m_points; }
00316
00317
00318 int GetNumberOfPoints() { return m_points->size(); }
00319
00320
00321
00322
00323
00324
00325
00326
00327
00328
00329
00330 void SetPosXYPoint(int index, double x, double y );
00331
00332
00333
00334
00335
00336
00337
00338 void GetPosXYPoint(int index, double& x, double& y );
00339
00340
00341
00342
00343
00344
00345
00346
00347 void GetPosXYPointWorld(int index, double& x, double& y, bool transform );
00348
00349
00350
00351
00352
00353
00354
00355 void RemovePoint( double& x, double& y , int index = -1 );
00356
00357
00358
00359
00360
00361
00362
00363
00364 void RemovePointWorld( double& x, double& y , int index = -1, bool transformed = true );
00365
00366
00367 bool EliminateMatrix();
00368
00369
00370 void SetSpline(bool on) { m_spline=on; SetPending(true); }
00371
00372
00373 bool GetSpline() { return m_spline; }
00374
00375
00376 void AddPoint(const a2dPoint2D& P, int index = -1 );
00377
00378
00379 void AddPoint( double x, double y, int index = -1 );
00380
00381
00382
00383
00384
00385
00386
00387 void Alloc(size_t count) { m_points->reserve( count ); }
00388
00389
00390 void Clear() { m_points->clear(); }
00391
00392
00393 bool IsEmpty() const { return m_points->empty(); }
00394
00395
00396 a2dLineSegmentPtr operator[](size_t index) const { return m_points->operator[](index); }
00397
00398
00399
00400
00401
00402
00403 a2dLineSegmentPtr Item(size_t index) const { return m_points->operator[](index); }
00404
00405
00406
00407
00408
00409
00410 a2dLineSegmentPtr Last() const { return m_points->back(); }
00411
00412
00413
00414
00415
00416
00417 void RemoveAt(size_t index) { m_points->RemoveAt( index ); }
00418
00419
00420 bool PointOnCurve(const a2dPoint2D& P, double marge);
00421
00422
00423
00424
00425
00426 void SetRenderMode( wxUint32 rendermode ) { m_rendermode = rendermode; }
00427
00428
00429 int GetRenderMode() { return m_rendermode; }
00430
00431
00432
00433
00434
00435 void SetEditMode( wxUint32 editmode ) { m_editmode = editmode; }
00436
00437
00438 int GetEditMode() { return m_editmode; }
00439
00440 DECLARE_DYNAMIC_CLASS(a2dVertexCurve)
00441
00442 protected:
00443
00444 bool DoStartEdit( wxUint16 editmode, wxEditStyle editstyle );
00445
00446 void OnHandleEvent(a2dHandleMouseEvent &event);
00447
00448 void OnEnterObject(a2dCanvasObjectMouseEvent &event);
00449 void OnLeaveObject(a2dCanvasObjectMouseEvent &event);
00450
00451 void OnCanvasObjectMouseEvent( a2dCanvasObjectMouseEvent& event );
00452
00453 #if wxART2D_USE_CVGIO
00454 virtual void DoSave( wxObject* parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts , a2dObjectList* towrite );
00455
00456 void DoLoad( wxObject* parent, a2dIOHandlerXmlSerIn& parser, a2dXmlSer_flag xmlparts );
00457 #endif //wxART2D_USE_CVGIO
00458
00459 a2dBoundingBox DoGetUnTransformedBbox( a2dBboxFlags flags = a2dCANOBJ_BBOX_NON ) const;
00460
00461 bool DoUpdate( UpdateMode mode, const a2dBoundingBox& childbox, const a2dBoundingBox& clipbox, const a2dBoundingBox& propbox );
00462
00463 void DoRender( a2dIterC& ic, OVERLAP clipparent );
00464
00465 bool DoIsHitWorld( a2dIterC& ic, a2dHitEvent& hitEvent );
00466
00467 bool m_spline;
00468
00469 wxUint32 m_rendermode, m_editmode;
00470
00471 a2dVertexArray* m_points;
00472
00473 private:
00474
00475 a2dVertexCurve( const a2dVertexCurve &other );
00476 };
00477
00478
00479
00480
00481
00482 class A2DCURVESDLLEXP a2dSweepPoint
00483 {
00484 public:
00485 a2dSweepPoint( double sweep, double a, double b );
00486
00487 a2dPoint2D GetPoint() { return a2dPoint2D( m_a, m_b ); }
00488 a2dPoint2D GetPointUp() { return a2dPoint2D( m_sweep, m_a ); }
00489 a2dPoint2D GetPointLow() { return a2dPoint2D( m_sweep, m_b ); }
00490 double m_sweep;
00491 double m_a;
00492 double m_b;
00493 };
00494
00495 WX_DECLARE_OBJARRAY_WITH_DECL( a2dSweepPoint, a2dSweepPointArray, class A2DCURVESDLLEXP );
00496
00497
00498
00499
00500
00501
00502 class A2DCURVESDLLEXP a2dSweepCurve: public a2dCurve
00503 {
00504 A2D_DECLARE_EVENT_TABLE()
00505
00506 public:
00507
00508 a2dSweepCurve( a2dSweepPointArray* points );
00509
00510 a2dSweepCurve( );
00511
00512 a2dSweepCurve( const a2dSweepCurve& other, CloneOptions options );
00513
00514 virtual ~a2dSweepCurve();
00515
00516 virtual a2dObject* Clone( CloneOptions options ) const;
00517
00518
00519 virtual bool GetXyAtSweep( double sweepValue, a2dPoint2D& point ) const;
00520
00521
00522 a2dSweepPointArray* GetPoints() { return m_points; }
00523
00524
00525 int GetNumberOfPoints() { return m_points->GetCount(); }
00526
00527
00528
00529
00530
00531
00532
00533
00534
00535
00536
00537 void SetPosXYPoint(int index, double x, double y );
00538
00539
00540
00541
00542
00543
00544
00545 void GetPosXYPoint(int index, double& x, double& y );
00546
00547
00548
00549
00550
00551
00552
00553
00554 void GetPosXYPointWorld(int index, double& x, double& y, bool transform );
00555
00556
00557
00558
00559
00560
00561
00562 void RemovePoint( double& x, double& y , int index = -1 );
00563
00564
00565
00566
00567
00568
00569
00570
00571 void RemovePointWorld( double& x, double& y , int index = -1, bool transformed = true );
00572
00573
00574 bool EliminateMatrix();
00575
00576
00577 void SetSpline(bool on) { m_spline=on; SetPending(true); }
00578
00579
00580 bool GetSpline() { return m_spline; }
00581
00582
00583 void AddPoint( double sweep, const a2dPoint2D& P );
00584
00585
00586 void AddPoint( double sweep, double x, double y );
00587
00588
00589
00590
00591
00592
00593
00594 void Alloc(size_t count) { m_points->Alloc( count ); }
00595
00596
00597 void Clear() { m_points->Clear(); }
00598
00599
00600
00601 a2dSweepPoint* Detach(size_t index) { return m_points->Detach( index ); }
00602
00603
00604
00605 void Empty() { m_points->Empty(); }
00606
00607
00608
00609 void Insert( a2dSweepPoint *item, size_t n ) { m_points->Insert( item, n ); }
00610
00611
00612 bool IsEmpty() const { return m_points->IsEmpty(); }
00613
00614
00615 a2dSweepPoint* operator[](size_t index) const { return &(m_points->Item( index )); }
00616
00617
00618
00619
00620 a2dSweepPoint* Item(size_t index) const { return &(m_points->Item( index )); }
00621
00622
00623
00624 a2dSweepPoint* Last() const { return &(m_points->Last()); }
00625
00626
00627
00628 void RemoveAt(size_t index) { m_points->RemoveAt( index ); }
00629
00630
00631
00632
00633
00634
00635 void Shrink() { m_points->Shrink(); }
00636
00637
00638 bool PointOnCurve(const a2dPoint2D& P, double marge);
00639
00640
00641
00642
00643
00644 void SetRenderMode( wxUint32 rendermode ) { m_rendermode = rendermode; }
00645
00646
00647 int GetRenderMode() { return m_rendermode; }
00648
00649
00650
00651
00652
00653 void SetEditMode( wxUint32 editmode ) { m_editmode = editmode; }
00654
00655
00656 int GetEditMode() { return m_editmode; }
00657
00658 DECLARE_DYNAMIC_CLASS(a2dSweepCurve)
00659
00660 protected:
00661
00662 bool DoStartEdit( wxUint16 editmode, wxEditStyle editstyle );
00663
00664 void OnHandleEvent(a2dHandleMouseEvent &event);
00665
00666 void OnEnterObject(a2dCanvasObjectMouseEvent &event);
00667 void OnLeaveObject(a2dCanvasObjectMouseEvent &event);
00668
00669 void OnCanvasObjectMouseEvent( a2dCanvasObjectMouseEvent& event );
00670
00671 #if wxART2D_USE_CVGIO
00672 virtual void DoSave( wxObject* parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts , a2dObjectList* towrite );
00673
00674 void DoLoad( wxObject* parent, a2dIOHandlerXmlSerIn& parser, a2dXmlSer_flag xmlparts );
00675 #endif //wxART2D_USE_CVGIO
00676
00677 a2dBoundingBox DoGetUnTransformedBbox( a2dBboxFlags flags = a2dCANOBJ_BBOX_NON ) const;
00678
00679 bool DoUpdate( UpdateMode mode, const a2dBoundingBox& childbox, const a2dBoundingBox& clipbox, const a2dBoundingBox& propbox );
00680
00681 void DoRender( a2dIterC& ic, OVERLAP clipparent );
00682
00683 bool DoIsHitWorld( a2dIterC& ic, a2dHitEvent& hitEvent );
00684
00685 bool m_spline;
00686
00687 wxUint32 m_rendermode, m_editmode;
00688
00689 a2dSweepPointArray* m_points;
00690
00691 private:
00692
00693 a2dSweepCurve( const a2dSweepCurve &other );
00694 };
00695
00696 #if defined(WXART2D_USINGDLL)
00697 template class A2DCURVESDLLEXP a2dSmrtPtr<a2dSweepCurve>;
00698 #endif
00699
00700
00701
00702
00703
00704 class A2DCURVESDLLEXP a2dBandCurve: public a2dCurve
00705 {
00706 A2D_DECLARE_EVENT_TABLE()
00707
00708 public:
00709
00710 a2dBandCurve( a2dSweepPointArray* points );
00711
00712 a2dBandCurve( );
00713
00714 a2dBandCurve( const a2dBandCurve& other, CloneOptions options );
00715
00716 virtual ~a2dBandCurve();
00717
00718 virtual a2dObject* Clone( CloneOptions options ) const;
00719
00720
00721 virtual bool GetXyAtSweep( double sweepValue, a2dPoint2D& point ) const;
00722
00723
00724 a2dSweepPointArray* GetPoints() { return m_points; }
00725
00726
00727 int GetNumberOfPoints() { return m_points->GetCount(); }
00728
00729
00730 void SetMarkerUpLow( bool markerUpLow ) { m_markerUpLow = markerUpLow; }
00731
00732
00733
00734
00735
00736
00737
00738
00739
00740
00741
00742 void SetPosXYPoint(int index, double sweep, double y, bool upper );
00743
00744
00745
00746
00747
00748
00749
00750 void GetPosXYPoint(int index, double& sweep, double& y, bool upper );
00751
00752
00753
00754
00755
00756
00757
00758
00759 void GetPosXYPointWorld(int index, double& sweep, double& y, bool upper, bool transform );
00760
00761
00762
00763
00764
00765
00766
00767 void RemovePoint( double& sweep, double& y ,bool upper, int index = -1);
00768
00769
00770
00771
00772
00773
00774
00775
00776 void RemovePointWorld( double& sweep, double& y ,bool upper, int index = -1, bool transformed = true );
00777
00778
00779 bool EliminateMatrix();
00780
00781
00782 void SetSpline(bool on) { m_spline=on; SetPending(true); }
00783
00784
00785 bool GetSpline() { return m_spline; }
00786
00787
00788 void AddPoint( double sweep, const a2dPoint2D& P );
00789
00790
00791 void AddPoint( double sweep, double x, double y );
00792
00793
00794
00795
00796
00797
00798
00799 void Alloc(size_t count) { m_points->Alloc( count ); }
00800
00801
00802 void Clear() { m_points->Clear(); }
00803
00804
00805
00806 a2dSweepPoint* Detach(size_t index) { return m_points->Detach( index ); }
00807
00808
00809
00810 void Empty() { m_points->Empty(); }
00811
00812
00813
00814 void Insert( a2dSweepPoint *item, size_t n ) { m_points->Insert( item, n ); }
00815
00816
00817 bool IsEmpty() const { return m_points->IsEmpty(); }
00818
00819
00820 a2dSweepPoint* operator[](size_t index) const { return &(m_points->Item( index )); }
00821
00822
00823
00824
00825 a2dSweepPoint* Item(size_t index) const { return &(m_points->Item( index )); }
00826
00827
00828
00829 a2dSweepPoint* Last() const { return &(m_points->Last()); }
00830
00831
00832
00833 void RemoveAt(size_t index) { m_points->RemoveAt( index ); }
00834
00835
00836
00837
00838
00839
00840 void Shrink() { m_points->Shrink(); }
00841
00842
00843 bool PointOnCurve(const a2dPoint2D& P, double marge);
00844
00845
00846
00847
00848
00849 void SetRenderMode( wxUint32 rendermode ) { m_rendermode = rendermode; }
00850
00851
00852 int GetRenderMode() { return m_rendermode; }
00853
00854
00855
00856
00857
00858 void SetEditMode( wxUint32 editmode ) { m_editmode = editmode; }
00859
00860
00861 int GetEditMode() { return m_editmode; }
00862
00863 DECLARE_DYNAMIC_CLASS(a2dBandCurve)
00864
00865 protected:
00866
00867 bool DoStartEdit( wxUint16 editmode, wxEditStyle editstyle );
00868
00869 void SyncHandlesWithLineSegments();
00870
00871 void OnHandleEvent(a2dHandleMouseEvent &event);
00872
00873 void OnEnterObject( a2dCanvasObjectMouseEvent &event);
00874 void OnLeaveObject(a2dCanvasObjectMouseEvent &event);
00875
00876 void OnCanvasObjectMouseEvent( a2dCanvasObjectMouseEvent& event );
00877
00878 #if wxART2D_USE_CVGIO
00879 virtual void DoSave( wxObject* parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts , a2dObjectList* towrite );
00880
00881 void DoLoad( wxObject* parent, a2dIOHandlerXmlSerIn& parser, a2dXmlSer_flag xmlparts );
00882 #endif //wxART2D_USE_CVGIO
00883
00884 a2dBoundingBox DoGetUnTransformedBbox( a2dBboxFlags flags = a2dCANOBJ_BBOX_NON ) const;
00885
00886 bool DoUpdate( UpdateMode mode, const a2dBoundingBox& childbox, const a2dBoundingBox& clipbox, const a2dBoundingBox& propbox );
00887
00888 void DoRender( a2dIterC& ic, OVERLAP clipparent );
00889
00890 bool DoIsHitWorld( a2dIterC& ic, a2dHitEvent& hitEvent );
00891
00892 bool m_spline;
00893
00894 wxUint32 m_rendermode, m_editmode;
00895
00896 a2dSweepPointArray* m_points;
00897
00898
00899 bool m_markerUpLow;
00900
00901 private:
00902
00903 a2dBandCurve( const a2dBandCurve &other );
00904 };
00905
00906 #if defined(WXART2D_USINGDLL)
00907 template class A2DCURVESDLLEXP a2dSmrtPtr<a2dBandCurve>;
00908 #endif
00909
00910
00911
00912
00913 class A2DCURVESDLLEXP a2dCanvasBandCurveHandle: public a2dHandle
00914 {
00915 public:
00916
00917 DECLARE_DYNAMIC_CLASS(a2dCanvasBandCurveHandle)
00918
00919
00920 a2dCanvasBandCurveHandle();
00921
00922
00923
00924
00925
00926
00927
00928
00929
00930
00931
00932
00933 a2dCanvasBandCurveHandle( a2dBandCurve* parent, unsigned int index, bool arcMid, double xc, double yc, const wxString& name = wxT("") );
00934
00935
00936 a2dCanvasBandCurveHandle( const a2dCanvasBandCurveHandle &other, CloneOptions options );
00937
00938
00939 ~a2dCanvasBandCurveHandle();
00940
00941
00942 bool m_arcMid;
00943
00944 unsigned int GetIndex() { return m_index; }
00945
00946 private:
00947
00948
00949 unsigned int m_index;
00950 };
00951
00952
00953
00954 #if defined(WXART2D_USINGDLL)
00955 template class A2DCURVESDLLEXP a2dSmrtPtr<a2dCanvasBandCurveHandle>;
00956 #endif
00957
00958
00959
00960
00961
00962
00963 class A2DCURVESDLLEXP a2dBarCurve: public a2dVertexCurve
00964 {
00965
00966 public:
00967
00968
00969 enum a2dBarRenderFlags
00970 {
00971 a2dBAR_RENDER_NO_POINTS = 0x0001,
00972 a2dBAR_RENDER_NORMAL = 0x0002,
00973 a2dBAR_RENDER_3D = 0x0004,
00974 a2dBAR_RENDER_LINE = 0x0008,
00975 a2dBAR_RENDER_DEFAULT = a2dCURVES_RENDER_NORMAL
00976 };
00977
00978 a2dBarCurve( a2dVertexArray* points );
00979
00980 a2dBarCurve( );
00981
00982 ~a2dBarCurve( );
00983
00984 a2dBarCurve( const a2dBarCurve& other, CloneOptions options );
00985
00986 void SetBarWidth( double barwidth ) { m_barwidth = barwidth; }
00987
00988 double GetBarWidth() { return m_barwidth; }
00989
00990 virtual a2dObject* Clone( CloneOptions options ) const;
00991
00992 double GetExtrudeDepth() { return m_depth; }
00993 double GetExtrudeAngle() { return wxRadToDeg( m_angle3d ); }
00994
00995 void SetExtrudeDepth( double depth ) { m_depth = depth; SetPending(true); }
00996 void SetExtrudeAngle( double angle3d ) { m_angle3d = wxDegToRad( angle3d ); SetPending(true); }
00997
00998 void SetExtrudeFill( const a2dFill& fill );
00999
01000 const a2dFill& GetExtrudeFill() { return m_extrudeFill; }
01001
01002 DECLARE_DYNAMIC_CLASS(a2dBarCurve)
01003
01004 protected:
01005
01006 void DoWalker( wxObject* parent, a2dWalkerIOHandler& handler );
01007
01008 #if wxART2D_USE_CVGIO
01009 virtual void DoSave( wxObject* parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts , a2dObjectList* towrite );
01010
01011 void DoLoad( wxObject* parent, a2dIOHandlerXmlSerIn& parser, a2dXmlSer_flag xmlparts );
01012 #endif //wxART2D_USE_CVGIO
01013
01014 void DoRender( a2dIterC& ic, OVERLAP clipparent );
01015
01016 double m_barwidth;
01017 double m_depth;
01018 double m_angle3d;
01019
01020 a2dFill m_extrudeFill;
01021
01022 static const a2dPropertyIdRefObject PROPID_extrudeFill;
01023
01024
01025 private:
01026
01027 a2dBarCurve( const a2dBarCurve &other );
01028 };
01029
01030
01031
01032
01033
01034
01035
01036
01037 class A2DCURVESDLLEXP a2dVertexListCurve: public a2dCurve
01038 {
01039 A2D_DECLARE_EVENT_TABLE()
01040
01041 public:
01042
01043 a2dVertexListCurve( a2dVertexList* points );
01044
01045 a2dVertexListCurve( );
01046
01047 a2dVertexListCurve( const a2dVertexListCurve& other, CloneOptions options );
01048
01049 virtual ~a2dVertexListCurve();
01050
01051 virtual a2dObject* Clone( CloneOptions options ) const;
01052
01053
01054 virtual bool GetXyAtSweep( double sweepValue, a2dPoint2D& point ) const;
01055
01056
01057 a2dVertexList* GetPoints() { return m_lpoints; }
01058
01059
01060 int GetNumberOfPoints() { return m_lpoints->size(); }
01061
01062
01063 void AddPoint(const a2dPoint2D& P, int index = -1, bool afterinversion = true );
01064
01065
01066 void AddPoint( double x, double y, int index = -1, bool afterinversion = true );
01067
01068
01069
01070
01071
01072
01073
01074
01075 void RemovePoint( double& x, double& y , int index = -1, bool transformed = true );
01076
01077
01078 bool EliminateMatrix();
01079
01080
01081
01082
01083
01084
01085
01086
01087
01088
01089
01090
01091
01092 void SetPosXYPoint(int index, double x, double y, bool afterinversion = true );
01093
01094
01095
01096
01097
01098
01099
01100
01101 void GetPosXYPoint(int index, double& x, double& y, bool transform = true );
01102
01103
01104 void SetSpline(bool on) { m_spline=on; SetPending(true); }
01105
01106
01107 bool GetSpline() { return m_spline; }
01108
01109
01110 bool PointOnCurve(const a2dPoint2D& P, double marge);
01111
01112
01113
01114
01115
01116 void SetRenderMode( wxUint32 rendermode ) { m_rendermode = rendermode; }
01117
01118
01119 int GetRenderMode() { return m_rendermode; }
01120
01121
01122
01123
01124
01125 void SetEditMode( wxUint32 editmode ) { m_editmode = editmode; }
01126
01127
01128 int GetEditMode() { return m_editmode; }
01129
01130 DECLARE_DYNAMIC_CLASS(a2dVertexListCurve)
01131
01132 protected:
01133
01134 bool DoStartEdit( wxUint16 editmode, wxEditStyle editstyle );
01135
01136 void OnHandleEvent(a2dHandleMouseEvent &event);
01137
01138 void OnEnterObject(a2dCanvasObjectMouseEvent &event);
01139 void OnLeaveObject(a2dCanvasObjectMouseEvent &event);
01140
01141 void OnCanvasObjectMouseEvent( a2dCanvasObjectMouseEvent& event );
01142
01143 #if wxART2D_USE_CVGIO
01144 virtual void DoSave( wxObject* parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts , a2dObjectList* towrite );
01145
01146 void DoLoad( wxObject* parent, a2dIOHandlerXmlSerIn& parser, a2dXmlSer_flag xmlparts );
01147 #endif //wxART2D_USE_CVGIO
01148
01149 a2dBoundingBox DoGetUnTransformedBbox( a2dBboxFlags flags = a2dCANOBJ_BBOX_NON ) const;
01150
01151 bool DoUpdate( UpdateMode mode, const a2dBoundingBox& childbox, const a2dBoundingBox& clipbox, const a2dBoundingBox& propbox );
01152
01153 void DoRender( a2dIterC& ic, OVERLAP clipparent );
01154
01155 bool DoIsHitWorld( a2dIterC& ic, a2dHitEvent& hitEvent );
01156
01157 bool m_spline;
01158
01159 int m_rendermode, m_editmode;
01160
01161 a2dVertexList* m_lpoints;
01162
01163 private:
01164
01165 a2dVertexListCurve( const a2dVertexListCurve &other );
01166 };
01167
01168
01169
01170
01171
01172
01173 class A2DCURVESDLLEXP a2dPieCurve: public a2dCurve
01174 {
01175 A2D_DECLARE_EVENT_TABLE()
01176
01177 public:
01178
01179 a2dPieCurve( a2dVertexArray* points );
01180
01181 a2dPieCurve( );
01182
01183 a2dPieCurve( const a2dPieCurve& other, CloneOptions options );
01184
01185 virtual ~a2dPieCurve();
01186
01187 virtual a2dObject* Clone( CloneOptions options ) const;
01188
01189
01190 virtual bool GetXyAtSweep( double sweepValue, a2dPoint2D& point ) const;
01191
01192
01193 a2dVertexArray* GetPoints() { return m_points; }
01194
01195
01196 int GetNumberOfPoints() { return m_points->size(); }
01197
01198
01199
01200
01201
01202
01203
01204
01205 void GetPosXYPointWorld(int index, double& x, double& y, bool transform );
01206
01207
01208
01209
01210
01211
01212
01213
01214 void RemovePointWorld( double& x, double& y , int index = -1, bool transformed = true );
01215
01216
01217
01218 void AddPoint(const a2dPoint2D& P, int index = -1 );
01219
01220
01221 void AddPoint( double x, double y, int index = -1 );
01222
01223
01224
01225
01226
01227
01228
01229 void Alloc(size_t count) { m_points->reserve( count ); }
01230
01231
01232 void Clear() { m_points->clear(); }
01233
01234
01235 bool IsEmpty() const { return m_points->empty(); }
01236
01237
01238
01239
01240
01241
01242 a2dLineSegmentPtr Item(size_t index) const { return m_points->operator[](index); }
01243
01244
01245
01246
01247
01248
01249 a2dLineSegmentPtr Last() const { return m_points->back(); }
01250
01251
01252
01253
01254
01255
01256 void RemoveAt(size_t index) { m_points->RemoveAt( index ); }
01257
01258
01259
01260
01261
01262 void SetRenderMode( wxUint32 rendermode ) { m_rendermode = rendermode; }
01263
01264
01265 int GetRenderMode() { return m_rendermode; }
01266
01267 DECLARE_DYNAMIC_CLASS(a2dPieCurve)
01268
01269 protected:
01270
01271 bool DoStartEdit( wxUint16 editmode, wxEditStyle editstyle );
01272
01273 void OnHandleEvent(a2dHandleMouseEvent &event);
01274
01275 void OnEnterObject(a2dCanvasObjectMouseEvent &event);
01276 void OnLeaveObject(a2dCanvasObjectMouseEvent &event);
01277
01278 void OnCanvasObjectMouseEvent( a2dCanvasObjectMouseEvent& event );
01279
01280 #if wxART2D_USE_CVGIO
01281 virtual void DoSave( wxObject* parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts , a2dObjectList* towrite );
01282
01283 void DoLoad( wxObject* parent, a2dIOHandlerXmlSerIn& parser, a2dXmlSer_flag xmlparts );
01284 #endif //wxART2D_USE_CVGIO
01285
01286 a2dBoundingBox DoGetUnTransformedBbox( a2dBboxFlags flags = a2dCANOBJ_BBOX_NON ) const;
01287
01288 bool DoUpdate( UpdateMode mode, const a2dBoundingBox& childbox, const a2dBoundingBox& clipbox, const a2dBoundingBox& propbox );
01289
01290 void DoRender( a2dIterC& ic, OVERLAP clipparent );
01291
01292 bool DoIsHitWorld( a2dIterC& ic, a2dHitEvent& hitEvent );
01293
01294 wxUint32 m_rendermode;
01295
01296 a2dVertexArray* m_points;
01297
01298 double m_width;
01299 double m_height;
01300
01301 private:
01302
01303 a2dPieCurve( const a2dPieCurve &other );
01304 };
01305
01306 #endif
01307