wxArt2D
styleprop.h
Go to the documentation of this file.
1 /*! \file wx/canvas/styleprop.h
2  \brief style properties that are specific to the canvas modules.
3  \author Klaas Holwerda
4 
5  Copyright: 2000-2004 (c) Klaas Holwerda
6 
7  Licence: wxWidgets Licence
8 
9  RCS-ID: $Id: styleprop.h,v 1.15 2008/09/05 19:01:10 titato Exp $
10 */
11 
12 #ifndef __STYLEPROP_H__
13 #define __STYLEPROP_H__
14 
15 #ifndef WX_PRECOMP
16 #include "wx/wx.h"
17 #endif
18 
19 #include "wx/geometry.h"
20 #include "wx/artbase/afmatrix.h"
21 #include "wx/canvas/xmlpars.h"
22 #include "wx/canvas/canobj.h"
23 #include "wx/artbase/liner.h"
24 #include "wx/artbase/bbox.h"
25 #include "wx/artbase/stylebase.h"
26 
27 class A2DARTBASEDLLEXP a2dDrawer2D;
28 class A2DCANVASDLLEXP a2dCanvasObject;
29 class A2DCANVASDLLEXP a2dIterC;
30 
31 #if defined(WXART2D_USINGDLL)
32 template class A2DCANVASDLLEXP a2dSmrtPtr<a2dCanvasObject>;
33 #endif
35 
36 class A2DGENERALDLLEXP a2dFillProperty;
38 
39 
40 //! property to hold a a2dFill type variable to be associated with a a2dObject
41 /*!
42  \ingroup property
43 */
44 class A2DGENERALDLLEXP a2dFillProperty: public a2dNamedProperty
45 {
46 public:
47 
49 
50  a2dFillProperty( const a2dPropertyIdFill* id, const a2dFill& value );
51 
52  a2dFillProperty( const a2dFillProperty* ori );
53 
54  a2dFillProperty( const a2dFillProperty& other );
55 
56  virtual a2dNamedProperty* Clone( a2dObject::CloneOptions options ) const;
57 
58  virtual void Assign( const a2dNamedProperty& other );
59 
60  virtual ~a2dFillProperty();
61 
62  //! Construct a new property object from a string
63  //! If this is not appropriate, this may return NULL
64  static a2dFillProperty* CreatePropertyFromString( const a2dPropertyIdFill* id, const wxString& value );
65 
66  void SetValue( const a2dFill& value );
67 
68  const a2dFill& GetValue() const { return m_value; }
69 
70  virtual wxString StringRepresentation() const;
71 
72  virtual wxString StringValueRepresentation() const;
73 
74 #if wxART2D_USE_CVGIO
75  virtual void DoSave( wxObject* parent, a2dIOHandlerXmlSerOut& out, a2dXmlSer_flag xmlparts , a2dObjectList* towrite );
76  virtual void DoLoad( wxObject* parent, a2dIOHandlerXmlSerIn& parser, a2dXmlSer_flag xmlparts );
77 #endif //wxART2D_USE_CVGIO
78 
79  DECLARE_DYNAMIC_CLASS( a2dFillProperty )
80 
81 protected:
82 
83  a2dFill m_value;
84 
85 private:
86  virtual a2dNamedProperty* DoClone( a2dObject::CloneOptions options, a2dRefMap* refs ) const { return new a2dFillProperty( *this ); }
87 
88 };
89 
90 class A2DGENERALDLLEXP a2dStrokeProperty;
92 
93 
94 //! property to hold a a2dStroke type variable to be associated with a a2dObject
95 /*!
96  \ingroup property
97 */
98 class A2DGENERALDLLEXP a2dStrokeProperty: public a2dNamedProperty
99 {
100 public:
101 
103 
104  a2dStrokeProperty( const a2dPropertyIdStroke* id, const a2dStroke& value );
105 
106  a2dStrokeProperty( const a2dStrokeProperty* ori );
107 
108  a2dStrokeProperty( const a2dStrokeProperty& other );
109 
110  virtual a2dNamedProperty* Clone( a2dObject::CloneOptions options ) const;
111 
112  virtual void Assign( const a2dNamedProperty& other );
113 
114  virtual ~a2dStrokeProperty();
115 
116  //! Construct a new property object from a string
117  //! If this is not appropriate, this may return NULL
118  static a2dStrokeProperty* CreatePropertyFromString( const a2dPropertyIdStroke* id, const wxString& value );
119 
120  void SetValue( const a2dStroke& value );
121 
122  const a2dStroke& GetValue() const { return m_value; }
123 
124  virtual wxString StringRepresentation() const;
125 
126  virtual wxString StringValueRepresentation() const;
127 
128 #if wxART2D_USE_CVGIO
129  virtual void DoSave( wxObject* parent, a2dIOHandlerXmlSerOut& out, a2dXmlSer_flag xmlparts , a2dObjectList* towrite );
130  virtual void DoLoad( wxObject* parent, a2dIOHandlerXmlSerIn& parser, a2dXmlSer_flag xmlparts );
131 #endif //wxART2D_USE_CVGIO
132 
133  DECLARE_DYNAMIC_CLASS( a2dStrokeProperty )
134 
135 protected:
136 
137  a2dStroke m_value;
138 
139 private:
140  virtual a2dNamedProperty* DoClone( a2dObject::CloneOptions options, a2dRefMap* refs ) const { return new a2dStrokeProperty( *this ); }
141 };
142 
143 class A2DGENERALDLLEXP a2dFontProperty;
145 
146 
147 //! property to hold a a2dFont type variable to be associated with a a2dObject
148 /*!
149  \ingroup property
150 */
151 class A2DGENERALDLLEXP a2dFontProperty: public a2dNamedProperty
152 {
153 public:
154 
155  a2dFontProperty();
156 
157  a2dFontProperty( const a2dPropertyIdFont* id, const a2dFont& value );
158 
159  a2dFontProperty( const a2dFontProperty* ori );
160 
161  a2dFontProperty( const a2dFontProperty& other );
162 
163  virtual a2dNamedProperty* Clone( a2dObject::CloneOptions options ) const;
164 
165  virtual void Assign( const a2dNamedProperty& other );
166 
167  virtual ~a2dFontProperty();
168 
169  //! Construct a new property object from a string
170  //! If this is not appropriate, this may return NULL
171  static a2dFontProperty* CreatePropertyFromString( const a2dPropertyIdFont* id, const wxString& value );
172 
173  void SetValue( const a2dFont& value );
174 
175  const a2dFont& GetValue() const { return m_value; }
176 
177  virtual wxString StringRepresentation() const;
178 
179  virtual wxString StringValueRepresentation() const;
180 
181 #if wxART2D_USE_CVGIO
182  virtual void DoSave( wxObject* parent, a2dIOHandlerXmlSerOut& out, a2dXmlSer_flag xmlparts , a2dObjectList* towrite );
183  virtual void DoLoad( wxObject* parent, a2dIOHandlerXmlSerIn& parser, a2dXmlSer_flag xmlparts );
184 #endif //wxART2D_USE_CVGIO
185 
186  DECLARE_DYNAMIC_CLASS( a2dFontProperty )
187 
188 protected:
189 
190  a2dFont m_value;
191 
192 private:
193  virtual a2dNamedProperty* DoClone( a2dObject::CloneOptions options, a2dRefMap* refs ) const { return new a2dFontProperty( *this ); }
194 
195 };
196 
197 //! To draw an object along the a2dCanvasObject its stroke.
198 /*!
199  Any a2dCanvasObject can be used to draw along the outline
200  of the a2dCanvasObject that is drawn.
201  The distance between the object on the outline can be set.
202 
203  \ingroup property style
204 */
205 /*
206 class A2DCANVASDLLEXP a2dCanvasObjectStroke : public a2dOneColourStroke
207 {
208 public:
209 
210  //!constructor
211  a2dCanvasObjectStroke();
212 
213  //!constructor
214  a2dCanvasObjectStroke( const a2dCanvasObjectStroke& stroke );
215 
216  //!give object for stroke
217  a2dCanvasObjectStroke( a2dCanvasObject* object );
218 
219  //!width defined in world coordinates.
220  a2dCanvasObjectStroke( a2dCanvasObject* object, const wxColour& col, float width = 0, a2dStrokeStyle style = a2dSTROKE_SOLID);
221 
222  //!width gets defined in pixels.
223  a2dCanvasObjectStroke( a2dCanvasObject* object, const wxPen& stroke );
224 
225  //!width gets defined in pixels.
226  a2dCanvasObjectStroke( a2dCanvasObject* object, const wxColour& col, int width, a2dStrokeStyle style = a2dSTROKE_SOLID);
227 
228  //!Clone this object and return a pointer to the new object
229  virtual a2dObject* Clone() const;
230 
231  //! destuctor
232  ~a2dCanvasObjectStroke();
233 
234  float GetExtend() const;
235 
236  void Render( a2dIterC& ic, a2dDrawer2D* drawer, const a2dBoundingBox& clipobj, int n, wxPoint points[] );
237 
238  void SetDistance( double distance ) { m_distance = distance; }
239 
240  DECLARE_DYNAMIC_CLASS(a2dCanvasObjectStroke)
241 
242 protected:
243 
244 #if wxART2D_USE_CVGIO
245  virtual void DoLoad( wxObject* parent, a2dIOHandlerXmlSerIn& parser, a2dXmlSer_flag xmlparts );
246  virtual void DoSave( wxObject* parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts , a2dObjectList* towrite );
247 #endif //wxART2D_USE_CVGIO
248 
249  a2dCanvasObjectPtr m_obj;
250 
251  double m_distance;
252 
253 };
254 */
255 #endif /* __STYLEPROP_H__ */
256 
(In) Visible property that can be added to Docview Objects.
Definition: gen.h:1785
Base class for all types of strokes, understood by a2dDrawer2D classes.
Definition: stylebase.h:378
Stroke and fill base classes.
class to map references to objects stored in XML, in order to make the connection later on...
Definition: gen.h:3462
a2dIOHandlerCVGIn and a2dIOHandlerCVGOut - XML I/O classes for the CVG format.
Defines a font to be set to a2dDrawer2D or stored in a2dCanvsObject etc.
Definition: stylebase.h:779
Input and output handler for the XmlSer format.
Definition: genxmlpars.h:819
The base class for all drawable objects in a a2dCanvasDocument.
a2dCanvasObject is the base class for Canvas Objects.
Definition: canobj.h:371
property to hold a a2dFont type variable to be associated with a a2dObject
Definition: styleprop.h:151
bounding class for optimizing drawing speed.
Drawing context abstraction.
Definition: drawer2d.h:177
Input and output handler for the XmlSer format.
Definition: genxmlpars.h:862
while iterating a a2dCanvasDocument, this holds the context.
Definition: canobj.h:3212
property to hold a a2dStroke type variable to be associated with a a2dObject
Definition: styleprop.h:98
affine matrix class
This template class is for property ids with a known data type.
Definition: id.h:477
property to hold a a2dFill type variable to be associated with a a2dObject
Definition: styleprop.h:44
list of a2dObject&#39;s
Definition: gen.h:3157
CloneOptions
options for cloning
Definition: gen.h:1200
basic 2 point line class for intersection and contouring routines.
styleprop.h Source File -- Sun Oct 12 2014 17:04:26 -- Sun Oct 12 2014 -- 1.8.5 -- wxArt2D -- . -- Main Page Reference Documentation