00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef __WXCANPROP_H__
00013 #define __WXCANPROP_H__
00014
00015 #ifndef WX_PRECOMP
00016 #include "wx/wx.h"
00017 #endif
00018
00019 #include "wx/canvas/candefs.h"
00020 #include "wx/canvas/layerinf.h"
00021 #include "wx/canvas/canobj.h"
00022 #include "wx/canvas/canprim.h"
00023 #include "wx/canvas/cantext.h"
00024 #include "wx/canvas/polygon.h"
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053 class A2DCANVASDLLEXP a2dStyleProperty: public a2dNamedProperty
00054 {
00055 public:
00056
00057 a2dStyleProperty();
00058
00059 a2dStyleProperty( const a2dPropertyId* id );
00060
00061 a2dStyleProperty(const a2dStyleProperty &other);
00062
00063 virtual ~a2dStyleProperty();
00064
00065 a2dNamedProperty* Clone( a2dObject::CloneOptions options ) const;
00066
00067 virtual void Assign( const a2dNamedProperty &other );
00068
00069
00070 bool AllNo();
00071
00072
00073
00074 inline const a2dFill& GetFill() const { return m_fill; }
00075
00076
00077
00078 inline const a2dStroke& GetStroke() const { return m_stroke; }
00079
00080
00081
00082
00083
00084
00085
00086
00087 void SetFill( const a2dFill& fill );
00088
00089
00090
00091
00092
00093
00094
00095
00096 void SetFill( const wxColour& fillcolor, a2dFillStyle style = a2dFILL_SOLID );
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106 void SetFill( const wxColour& fillcolor, const wxColour& fillcolor2, a2dFillStyle style = a2dFILL_SOLID );
00107
00108
00109 void SetStroke( const wxColour& strokecolor, float width = 0, a2dStrokeStyle style = a2dSTROKE_SOLID );
00110
00111
00112 void SetStroke( const wxColour& strokecolor, int width , a2dStrokeStyle style = a2dSTROKE_SOLID );
00113
00114
00115
00116
00117
00118
00119 void SetStroke( const a2dStroke& stroke);
00120
00121 wxString StringRepresentation() const;
00122 wxString StringValueRepresentation() const;
00123
00124 DECLARE_DYNAMIC_CLASS(a2dStyleProperty)
00125
00126 protected:
00127
00128 #if wxART2D_USE_CVGIO
00129 virtual void DoSave( wxObject* parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts , a2dObjectList* towrite );
00130 virtual void DoLoad( wxObject* parent, a2dIOHandlerXmlSerIn& parser, a2dXmlSer_flag xmlparts );
00131 #endif //wxART2D_USE_CVGIO
00132
00133
00134
00135 a2dStroke m_stroke;
00136
00137
00138
00139
00140 a2dFill m_fill;
00141 };
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151 class A2DCANVASDLLEXP a2dShadowStyleProperty: public a2dStyleProperty
00152 {
00153 public:
00154
00155 a2dShadowStyleProperty();
00156
00157 a2dShadowStyleProperty( const a2dPropertyIdCanvasShadowStyle* id, double depth, double angle = 30);
00158
00159 a2dShadowStyleProperty(const a2dShadowStyleProperty &other);
00160
00161 virtual ~a2dShadowStyleProperty();
00162
00163 a2dNamedProperty* Clone( a2dObject::CloneOptions options ) const;
00164
00165 double GetExtrudeDepth() const { return m_depth; }
00166
00167 double GetExtrudeAngle() const { return m_angle3d; }
00168
00169 void SetExtrudeDepth( double depth ) { m_depth = depth; }
00170 void SetExtrudeAngle( double angle3d ) { m_angle3d = wxDegToRad(angle3d); }
00171
00172 DECLARE_DYNAMIC_CLASS(a2dShadowStyleProperty)
00173
00174 protected:
00175
00176 #if wxART2D_USE_CVGIO
00177 virtual void DoSave( wxObject* parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts , a2dObjectList* towrite );
00178 virtual void DoLoad( wxObject* parent, a2dIOHandlerXmlSerIn& parser, a2dXmlSer_flag xmlparts );
00179 #endif //wxART2D_USE_CVGIO
00180
00181 double m_depth;
00182 double m_angle3d;
00183
00184 };
00185
00186
00187
00188
00189
00190
00191
00192 class A2DCANVASDLLEXP a2dCanvasObjectPtrProperty: public a2dNamedProperty
00193 {
00194 public:
00195
00196 a2dCanvasObjectPtrProperty();
00197
00198 a2dCanvasObjectPtrProperty( const a2dPropertyIdCanvasObject* id, a2dCanvasObject* object, bool visible=false, bool render=false );
00199
00200 a2dCanvasObjectPtrProperty( const a2dCanvasObjectPtrProperty &other, a2dObject::CloneOptions options );
00201
00202 virtual ~a2dCanvasObjectPtrProperty();
00203
00204 a2dNamedProperty* Clone( a2dObject::CloneOptions options ) const;
00205
00206 virtual void Assign( const a2dNamedProperty &other );
00207
00208
00209 void SetObject( wxObject* object );
00210
00211 inline a2dCanvasObject* GetCanvasObject() const { return m_object; }
00212
00213
00214 virtual a2dObject* GetRefObject() const { return m_object; }
00215 virtual a2dObject* GetRefObjectNA() const { return m_object; }
00216
00217 DECLARE_DYNAMIC_CLASS(a2dCanvasObjectPtrProperty)
00218
00219
00220
00221
00222
00223
00224 virtual void SetVisible(bool visible) { m_visible = visible; }
00225
00226 virtual bool GetVisible() const { return m_visible; }
00227
00228
00229
00230
00231
00232 void SetCanRender(bool render) { m_render = render; }
00233
00234 bool GetCanRender() const { return m_render; }
00235
00236
00237
00238
00239
00240 void SetPreRender( bool prerender ) { m_prerender = prerender; }
00241
00242
00243 bool GetPreRender() const { return m_prerender; }
00244
00245
00246
00247
00248
00249 void SetSelectedOnly( bool selectedonly ) { m_selectedonly = selectedonly; }
00250
00251
00252 bool GetSelectedOnly() const { return m_selectedonly; }
00253
00254
00255 a2dCanvasObject *GetValue() const { return m_object; }
00256
00257
00258 void SetValue( a2dCanvasObject *newvalue ) { m_object = newvalue; }
00259
00260 a2dCanvasObjectPtr *GetValuePtr() { return &m_object; }
00261
00262 a2dCanvasObjectPtr &GetValueRef() { return m_object; }
00263
00264 const a2dCanvasObjectPtr *GetValuePtr() const { return &m_object; }
00265
00266 const a2dCanvasObjectPtr &GetValueRef() const { return m_object; }
00267
00268
00269
00270 static a2dCanvasObjectPtrProperty *CreatePropertyFromString( const a2dPropertyIdCanvasObject* id, const wxString &value );
00271
00272 protected:
00273
00274 void DoWalker( wxObject *parent, a2dWalkerIOHandler& handler );
00275
00276 #if wxART2D_USE_CVGIO
00277 virtual void DoSave( wxObject* parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts , a2dObjectList* towrite );
00278 virtual void DoLoad( wxObject* parent, a2dIOHandlerXmlSerIn& parser, a2dXmlSer_flag xmlparts );
00279 #endif //wxART2D_USE_CVGIO
00280
00281
00282 bool m_prerender;
00283
00284 bool m_selectedonly;
00285
00286 bool m_visible;
00287
00288 bool m_render;
00289
00290
00291 wxUint32 m_resolveid;
00292
00293
00294 a2dCanvasObjectPtr m_object;
00295 };
00296
00297 #if defined(WXART2D_USINGDLL)
00298 template class A2DCANVASDLLEXP a2dPropertyIdProp<class a2dClipPathProperty>;
00299 #endif
00300 typedef a2dPropertyIdProp<class a2dClipPathProperty> a2dPropertyIdCanvasClipPath;
00301
00302
00303
00304
00305
00306
00307
00308
00309
00310
00311
00312
00313 class A2DCANVASDLLEXP a2dClipPathProperty: public a2dNamedProperty
00314 {
00315 public:
00316
00317 a2dClipPathProperty();
00318
00319 a2dClipPathProperty( const a2dPropertyIdCanvasClipPath* id, a2dPolygonL* clip );
00320
00321 a2dClipPathProperty(const a2dClipPathProperty &other, a2dObject::CloneOptions options );
00322
00323 virtual ~a2dClipPathProperty();
00324
00325 a2dNamedProperty* Clone( a2dObject::CloneOptions options ) const;
00326
00327 void Assign( const a2dNamedProperty &other );
00328
00329
00330 virtual a2dPolygonL* GetClipObject() const { return m_clip; }
00331
00332
00333 void SetCanvasObject( a2dPolygonL* clip );
00334
00335 void PushClip( a2dCanvasView* drawer, a2dBooleanClip clipoperation = a2dCLIP_AND );
00336 void PopClip( a2dCanvasView* drawer );
00337
00338
00339
00340
00341
00342
00343 virtual void SetVisible(bool visible) { m_visible = visible; }
00344
00345 virtual bool GetVisible() const { return m_visible; }
00346
00347
00348
00349
00350
00351 void SetCanRender(bool render) { m_render = render; }
00352
00353 bool GetCanRender() const { return m_render; }
00354
00355 DECLARE_DYNAMIC_CLASS(a2dClipPathProperty)
00356
00357 virtual a2dObject* GetRefObject() const;
00358 virtual a2dObject* GetRefObjectNA() const;
00359
00360 protected:
00361
00362 void DoWalker( wxObject *parent, a2dWalkerIOHandler& handler );
00363
00364 void DoRender( a2dIterC& ic, a2dAffineMatrix* cworld, OVERLAP clipparent, int layer , a2dCanvasObjectFlagsMask mask );
00365
00366 #if wxART2D_USE_CVGIO
00367 virtual void DoSave( wxObject* parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts , a2dObjectList* towrite );
00368 virtual void DoLoad( wxObject* parent, a2dIOHandlerXmlSerIn& parser, a2dXmlSer_flag xmlparts );
00369 #endif //wxART2D_USE_CVGIO
00370
00371 a2dSmrtPtr<a2dPolygonL> m_clip;
00372
00373 bool m_visible;
00374
00375 bool m_render;
00376 };
00377
00378
00379
00380
00381
00382
00383
00384
00385
00386
00387
00388 class A2DCANVASDLLEXP a2dVisibleProperty: public a2dText
00389 {
00390 A2D_DECLARE_EVENT_TABLE()
00391
00392 public:
00393
00394
00395 a2dVisibleProperty();
00396
00397
00398 a2dVisibleProperty( const a2dVisibleProperty& other, CloneOptions options );
00399
00400
00401 a2dVisibleProperty( a2dCanvasObject* parent, const a2dPropertyId* property, double x, double y, double angle = 0 );
00402
00403
00404 a2dVisibleProperty( a2dCanvasObject* parent, const a2dPropertyId* property, double x, double y, bool visible = true,
00405 const a2dFont& font = *a2dDEFAULT_CANVASFONT, double angle = 0);
00406
00407 virtual ~a2dVisibleProperty();
00408
00409 virtual a2dObject* Clone( CloneOptions options ) const;
00410
00411
00412 void ShowName( bool show = false );
00413
00414
00415 void SetParent( a2dCanvasObject* parent );
00416
00417
00418 inline a2dCanvasObject* GetParent( void ) const { return m_parent; }
00419
00420
00421 inline const a2dPropertyId* GetPropId() { return m_propId; }
00422
00423 #if wxART2D_USE_CVGIO
00424 virtual void DoSave( wxObject* parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts , a2dObjectList* towrite );
00425
00426 virtual void DoLoad( wxObject* parent, a2dIOHandlerXmlSerIn& parser, a2dXmlSer_flag xmlparts );
00427 #endif //wxART2D_USE_CVGIO
00428
00429 void OnChar(wxKeyEvent& event);
00430
00431 void OnMouseEvent(a2dCanvasObjectMouseEvent &event);
00432
00433 DECLARE_DYNAMIC_CLASS(a2dVisibleProperty);
00434
00435 protected:
00436
00437 void DoEndEdit();
00438
00439 virtual bool DoUpdate( UpdateMode mode, const a2dBoundingBox& childbox, const a2dBoundingBox& clipbox, const a2dBoundingBox& propbox );
00440
00441
00442 a2dCanvasObject* m_parent;
00443
00444
00445 const a2dPropertyId* m_propId;
00446
00447
00448 bool m_showname;
00449
00450 private:
00451
00452 a2dVisibleProperty( const a2dVisibleProperty &other );
00453 };
00454
00455
00456
00457
00458
00459
00460 class A2DCANVASDLLEXP a2dBoudingBoxProperty: public a2dNamedProperty
00461 {
00462 public:
00463
00464 a2dBoudingBoxProperty();
00465
00466 a2dBoudingBoxProperty( const a2dPropertyIdBoundingBox* id, const a2dBoundingBox& value );
00467
00468 a2dBoudingBoxProperty( const a2dPropertyIdBoundingBox* id, const wxString& value );
00469
00470 a2dBoudingBoxProperty( const a2dBoudingBoxProperty &other );
00471
00472 virtual a2dNamedProperty *Clone( a2dObject::CloneOptions options ) const;
00473
00474 virtual void Assign( const a2dNamedProperty &other );
00475
00476 virtual ~a2dBoudingBoxProperty();
00477
00478
00479
00480 static a2dBoudingBoxProperty *CreatePropertyFromString( const a2dPropertyIdBoundingBox* id, const wxString &value );
00481
00482 void SetValue( const a2dBoundingBox& value );
00483
00484 a2dBoundingBox& GetValue() { return m_value; }
00485
00486 a2dBoundingBox* GetValuePtr() { return &m_value; }
00487
00488 const a2dBoundingBox& GetValue() const { return m_value; }
00489
00490 const a2dBoundingBox* GetValuePtr() const { return &m_value; }
00491
00492 virtual wxString StringRepresentation() const;
00493
00494 virtual wxString StringValueRepresentation() const;
00495
00496 #if wxART2D_USE_CVGIO
00497 virtual void DoSave( wxObject* parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts , a2dObjectList* towrite );
00498 virtual void DoLoad( wxObject* parent, a2dIOHandlerXmlSerIn& parser, a2dXmlSer_flag xmlparts );
00499 #endif //wxART2D_USE_CVGIO
00500
00501 DECLARE_DYNAMIC_CLASS(a2dBoudingBoxProperty)
00502
00503 protected:
00504
00505 a2dBoundingBox m_value;
00506 };
00507
00508
00509
00510 #endif
00511
00512