00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef __WXRECUR_H__
00025 #define __WXRECUR_H__
00026
00027 #ifndef WX_PRECOMP
00028 #include "wx/wx.h"
00029 #endif
00030
00031 #include "wx/canvas/canprim.h"
00032 #include "wx/canvas/canimage.h"
00033 #include "wx/canvas/cantext.h"
00034
00035 #define __USE_EVENTS 1
00036
00037 #define newline wxString("\n")
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053 class A2DCANVASDLLEXP a2dCanvasObjectReference: public a2dCanvasObject
00054 {
00055 public:
00056
00057 a2dCanvasObjectReference();
00058
00059 a2dCanvasObjectReference(double x, double y, a2dCanvasObject* obj);
00060
00061 ~a2dCanvasObjectReference();
00062
00063 a2dCanvasObjectReference( const a2dCanvasObjectReference &other, CloneOptions options );
00064
00065 virtual a2dObject* Clone( CloneOptions options ) const;
00066
00067
00068 a2dCanvasObject* GetCanvasObject();
00069
00070
00071 void SetCanvasObject( a2dCanvasObject* object );
00072
00073 virtual void DoWalker( wxObject* parent, a2dWalkerIOHandler& handler );
00074
00075
00076 virtual bool LinkReference( a2dObject *other );
00077
00078 void MakeReferencesUnique();
00079
00080 DECLARE_DYNAMIC_CLASS(a2dCanvasObjectReference)
00081
00082 bool IsRecursive() { return true; }
00083
00084 void RemoveHierarchy();
00085
00086 protected:
00087
00088 virtual void DoAddPending( a2dIterC& ic );
00089
00090 #if wxART2D_USE_CVGIO
00091 void DoLoad( wxObject* parent, a2dIOHandlerXmlSerIn& parser, a2dXmlSer_flag xmlparts );
00092
00093 void DoSave( wxObject* parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts , a2dObjectList* towrite );
00094 #endif //wxART2D_USE_CVGIO
00095
00096 void DoRender( a2dIterC& ic, OVERLAP clipparent );
00097
00098 bool DoIsHitWorld( a2dIterC& ic, a2dHitEvent& hitEvent );
00099
00100 a2dBoundingBox DoGetUnTransformedBbox( a2dBboxFlags flags = a2dCANOBJ_BBOX_NON ) const;
00101
00102 bool DoUpdate( UpdateMode mode, const a2dBoundingBox& childbox, const a2dBoundingBox& clipbox, const a2dBoundingBox& propbox );
00103
00104 a2dCanvasObjectPtr m_object;
00105
00106 static const a2dPropertyIdCanvasObject PROPID_refobject;
00107
00108 private:
00109
00110 virtual void DoWalkerWithContext( a2dIterC& ic, wxObject* parent, a2dWalkerIOHandlerWithContext& handler );
00111
00112
00113 a2dCanvasObjectReference( const a2dCanvasObjectReference &other );
00114
00115 };
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129 class A2DCANVASDLLEXP a2dCanvasObjectArrayReference: public a2dCanvasObjectReference
00130 {
00131 public:
00132
00133 a2dCanvasObjectArrayReference();
00134
00135 a2dCanvasObjectArrayReference( double x, double y, int rows, int columns, double horzSpace, double vertSpace, a2dCanvasObject* obj );
00136
00137 ~a2dCanvasObjectArrayReference();
00138
00139 a2dCanvasObjectArrayReference( const a2dCanvasObjectArrayReference &other, CloneOptions options );
00140
00141 virtual a2dObject* Clone( CloneOptions options ) const;
00142
00143 void SetHorzSpace( double horzSpace ) { m_horzSpace = horzSpace; SetPending( true ); }
00144
00145 double GetHorzSpace() { return m_horzSpace; }
00146
00147 void SetVertSpace( double vertSpace) { m_vertSpace = vertSpace; SetPending( true ); }
00148
00149 double GetVertSpace() { return m_vertSpace; }
00150
00151 int GetRows() { return m_rows; }
00152
00153 void SetRows( int rows ) { m_rows = rows; SetPending( true ); }
00154
00155 int GetColumns() { return m_columns; }
00156
00157 void SetColumns( int columns ) { m_columns = columns; SetPending( true ); }
00158
00159
00160 double GetWidth() { return m_columns*m_horzSpace; }
00161
00162
00163 double GetHeight() { return m_rows*m_vertSpace; }
00164
00165 void RemoveHierarchy();
00166
00167 private:
00168
00169 #if wxART2D_USE_CVGIO
00170 void DoLoad( wxObject* parent, a2dIOHandlerXmlSerIn& parser, a2dXmlSer_flag xmlparts );
00171
00172 void DoSave( wxObject* parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts , a2dObjectList* towrite );
00173 #endif //wxART2D_USE_CVGIO
00174
00175 void DoRender( a2dIterC& ic, OVERLAP clipparent );
00176
00177 bool DoIsHitWorld( a2dIterC& ic, a2dHitEvent& hitEvent );
00178
00179 a2dBoundingBox DoGetUnTransformedBbox( a2dBboxFlags flags = a2dCANOBJ_BBOX_NON ) const;
00180
00181 bool DoUpdate( UpdateMode mode, const a2dBoundingBox& childbox, const a2dBoundingBox& clipbox, const a2dBoundingBox& propbox );
00182
00183
00184 int m_columns;
00185
00186
00187 int m_rows;
00188
00189
00190 double m_horzSpace;
00191
00192
00193 double m_vertSpace;
00194
00195 DECLARE_DYNAMIC_CLASS(a2dCanvasObjectArrayReference)
00196
00197 private:
00198
00199 a2dCanvasObjectArrayReference( const a2dCanvasObjectArrayReference &other );
00200 };
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211 class A2DCANVASDLLEXP a2dLibraryReference: public a2dImage
00212 {
00213 public:
00214 a2dLibraryReference();
00215
00216 a2dLibraryReference( double x, double y, a2dCanvasObject* obj, const wxString& name, double totalheight = 100,
00217 a2dCanvasObject* symbol = 0,
00218 const a2dFont& font = *a2dDEFAULT_CANVASFONT,
00219 int imagew = 100, int imageh = 100 );
00220
00221 ~a2dLibraryReference();
00222
00223 a2dLibraryReference( const a2dLibraryReference &other, CloneOptions options );
00224
00225
00226 a2dCanvasObject* GetCanvasObject();
00227
00228
00229 void SetCanvasObject( a2dCanvasObject* object );
00230
00231
00232 a2dCanvasObject* GetSymbol();
00233
00234
00235 void SetSymbol( a2dCanvasObject* symbol );
00236
00237 virtual a2dObject* Clone( CloneOptions options ) const;
00238
00239 DECLARE_DYNAMIC_CLASS(a2dLibraryReference)
00240
00241 protected:
00242
00243 void DoWalker( wxObject *parent, a2dWalkerIOHandler& handler );
00244
00245 void DoRender( a2dIterC& ic, OVERLAP clipparent );
00246 bool DoIsHitWorld( a2dIterC& ic, a2dHitEvent& hitEvent );
00247 a2dBoundingBox DoGetUnTransformedBbox( a2dBboxFlags flags = a2dCANOBJ_BBOX_NON ) const;
00248 bool DoUpdate( UpdateMode mode, const a2dBoundingBox& childbox, const a2dBoundingBox& clipbox, const a2dBoundingBox& propbox );
00249
00250 #if wxART2D_USE_CVGIO
00251 virtual void DoSave( wxObject* parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts , a2dObjectList* towrite );
00252
00253 void DoLoad( wxObject* parent, a2dIOHandlerXmlSerIn& parser, a2dXmlSer_flag xmlparts );
00254 #endif //wxART2D_USE_CVGIO
00255
00256 a2dCanvasObjectPtr m_symbol;
00257
00258 wxString m_description;
00259
00260 a2dSmrtPtr<a2dText> m_text;
00261
00262
00263 a2dCanvasObjectPtr m_object;
00264
00265 double m_height;
00266 double m_width;
00267
00268 private:
00269
00270 a2dLibraryReference( const a2dLibraryReference &other );
00271 };
00272
00273
00274
00275
00276
00277
00278
00279
00280
00281
00282 class A2DCANVASDLLEXP a2dExternalReference: public a2dText
00283 {
00284 public:
00285 a2dExternalReference();
00286
00287 a2dExternalReference( double x, double y, a2dCanvasObject* obj = 0, const wxString &text = wxT(""),
00288 double angle = 0, const a2dFont& font = *a2dDEFAULT_CANVASFONT );
00289
00290 ~a2dExternalReference();
00291
00292 a2dExternalReference( const a2dExternalReference &other, CloneOptions options );
00293
00294
00295 a2dCanvasObject* GetCanvasObject();
00296
00297
00298 void SetCanvasObject( a2dCanvasObject* object );
00299
00300 virtual a2dObject* Clone( CloneOptions options ) const;
00301
00302 DECLARE_DYNAMIC_CLASS(a2dExternalReference)
00303
00304 protected:
00305
00306 void DoWalker( wxObject *parent, a2dWalkerIOHandler& handler );
00307
00308
00309 a2dCanvasObjectPtr m_object;
00310
00311 private:
00312
00313 a2dExternalReference( const a2dExternalReference &other );
00314 };
00315
00316
00317
00318
00319
00320
00321
00322
00323
00324 class A2DCANVASDLLEXP a2dNameReference: public a2dText
00325 {
00326 public:
00327 a2dNameReference();
00328
00329 a2dNameReference( double x, double y, a2dCanvasObject* obj = 0, const wxString &text = wxT(""),
00330 double angle = 0, const a2dFont& font = *a2dDEFAULT_CANVASFONT );
00331
00332 ~a2dNameReference();
00333
00334 a2dNameReference( const a2dNameReference &other, CloneOptions options );
00335
00336
00337 a2dCanvasObject* GetCanvasObject();
00338
00339
00340 void SetCanvasObject( a2dCanvasObject* object );
00341
00342 virtual a2dObject* Clone( CloneOptions options ) const;
00343
00344 DECLARE_DYNAMIC_CLASS(a2dNameReference)
00345
00346 protected:
00347
00348
00349 a2dCanvasObjectPtr m_objectRef;
00350
00351 private:
00352
00353 a2dNameReference( const a2dNameReference &other );
00354 };
00355
00356
00357
00358
00359
00360 class A2DCANVASDLLEXP a2dCanvasDocumentReference: public a2dLibraryReference
00361 {
00362 public:
00363
00364
00365 a2dCanvasDocumentReference( double x = 0, double y = 0, a2dCanvasDocument* doc = 0, double totalheight = 100,
00366 const a2dFont& font = *a2dDEFAULT_CANVASFONT,
00367 int imagew = 100, int imageh = 100, a2dCanvasObject* symbol = 0 );
00368
00369 ~a2dCanvasDocumentReference();
00370
00371 void SetDocumentReference( a2dCanvasDocument* doc ) { m_doc = doc; }
00372
00373 a2dCanvasDocument* GetDocumentReference() const { return m_doc; }
00374
00375 protected:
00376
00377 void DependencyPending(a2dWalkerIOHandler* WXUNUSED(handler));
00378
00379 a2dSmrtPtr<a2dCanvasDocument> m_doc;
00380
00381 DECLARE_DYNAMIC_CLASS( a2dCanvasDocumentReference )
00382 };
00383
00384 #endif
00385