wxArt2D
canobj3d.h
Go to the documentation of this file.
1 /*! \file wx/canextobj/canobj3d.h
2  \author Klaas Holwerda
3 
4  Copyright: 2000-2004 (c) Klaas Holwerda
5 
6  Licence: wxWidgets Licence
7 
8  RCS-ID: $Id: canobj3d.h,v 1.11 2008/09/05 19:01:10 titato Exp $
9 */
10 
11 #ifndef __WXCANOBJ3D_H__
12 #define __WXCANOBJ3D_H__
13 
14 #ifndef WX_PRECOMP
15 #include "wx/wx.h"
16 #endif
17 
18 #include "wx/canvas/canmod.h"
19 #include "wx/canvas/sttool.h"
20 
21 #define __USE_EVENTS 1
22 
23 //! to make object having a shadow behind it OR to extrude them in 3D
24 /*!
25 This object is a special kind of reference.
26 This object is initiated with a a2dCanvasObject, for that shape it
27 renders a shadow or 3D extruded structure.
28 The shadow uses the brush and pen set while the referenced object itself
29 uses it's own brush and pen.
30 
31  \ingroup canvasobject meta
32 */
33 class A2DEDITORDLLEXP a2d3DShape: public a2dCanvasObject
34 {
35 public:
36 
37  a2d3DShape( a2dCanvasObject* toshadow, double depth, double angle );
38 
39  a2d3DShape( const a2d3DShape& other, CloneOptions options, a2dRefMap* refs );
40 
41  virtual ~a2d3DShape();
42 
43  double GetExtrudeDepth() { return m_depth; }
44  double GetExtrudeAngle() { return wxRadToDeg( m_angle3d ); }
45 
46  void SetExtrudeDepth( double depth ) { m_depth = depth; SetPending( true ); }
47  void SetExtrudeAngle( double angle3d ) { m_angle3d = wxDegToRad( angle3d ); SetPending( true ); }
48 
49  void SetExtrudeFillFromShape();
50  void SetExtrudeStrokeFromShape();
51 
52  DECLARE_CLASS( a2d3DShape )
53 
54 protected:
55  virtual a2dObject* DoClone( CloneOptions options, a2dRefMap* refs ) const;
56 
57  void DoWalker( wxObject* parent, a2dWalkerIOHandler& handler );
58 
59 #if wxART2D_USE_CVGIO
60  virtual void DoSave( wxObject* parent, a2dIOHandlerXmlSerOut& out, a2dXmlSer_flag xmlparts , a2dObjectList* towrite );
61 
62  void DoLoad( wxObject* parent, a2dIOHandlerXmlSerIn& parser, a2dXmlSer_flag xmlparts );
63 #endif //wxART2D_USE_CVGIO
64 
65  bool DoUpdate( UpdateMode mode, const a2dBoundingBox& childbox, const a2dBoundingBox& clipbox, const a2dBoundingBox& propbox );
66 
67  void DoRender( a2dIterC& ic, OVERLAP clipparent );
68 
69  bool DoIsHitWorld( a2dIterC& ic, a2dHitEvent& hitEvent );
70 
71  void Set3DBrushPen();
72 
73  double m_depth;
74  double m_angle3d;
75 
76  a2dCanvasObjectPtr m_shape;
77 
78 private:
79  //!this is a not implemented copy constructor that avoids automatic creation of one
80  a2d3DShape( const a2d3DShape& other );
81 };
82 
83 #if defined(WXART2D_USINGDLL)
84 template class A2DEDITORDLLEXP a2dSmrtPtr<a2d3DShape>;
85 #endif
86 
87 #endif
88 
virtual bool DoIsHitWorld(a2dIterC &ic, a2dHitEvent &hitEvent)
Does hit test on the object (exclusif child objects)
Definition: canobj.cpp:3713
virtual a2dObject * DoClone(CloneOptions options, a2dRefMap *refs) const
Clone this object and return a pointer to the new object.
Definition: canobj.cpp:1426
class to map references to objects stored in XML, in order to make the connection later on...
Definition: gen.h:3462
Ref Counted base object.
Definition: gen.h:1045
double wxDegToRad(double deg)
conversion from degrees to radians
Definition: artglob.cpp:30
Input and output handler for the XmlSer format.
Definition: genxmlpars.h:819
UpdateMode
Various mode flags for Update.
Definition: canobj.h:1091
virtual void SetPending(bool pending)
set this object pending for update
Definition: canobj.cpp:2585
OVERLAP
Result of a a2dBoundingBox intersection or hittest.
Definition: bbox.h:24
virtual void DoLoad(wxObject *parent, a2dIOHandlerXmlSerIn &parser, a2dXmlSer_flag xmlparts)
load object specific CVG data
Definition: canobj.cpp:5728
a2dCanvasObject is the base class for Canvas Objects.
Definition: canobj.h:371
virtual void DoRender(a2dIterC &ic, OVERLAP clipparent)
render derived object
Definition: canobj.cpp:4695
Io handler to iterate through a a2dDocument.
Definition: gen.h:3911
double wxRadToDeg(double rad)
conversion from radians to degrees
Definition: artglob.cpp:31
virtual void DoSave(wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts, a2dObjectList *towrite)
write object specific CVGL data
Definition: canobj.cpp:5569
Input and output handler for the XmlSer format.
Definition: genxmlpars.h:862
while iterating a a2dCanvasDocument, this holds the context.
Definition: canobj.h:3212
The a2dBoundingBox class stores one a2dBoundingBox of a a2dCanvasObject.
Definition: bbox.h:39
all headers of the canvas module
virtual bool DoUpdate(UpdateMode mode, const a2dBoundingBox &childbox, const a2dBoundingBox &clipbox, const a2dBoundingBox &propbox)
Update derived Object specific things ( mainly boundingbox)
Definition: canobj.cpp:5098
stack based tools controller and tools for drawing and editing.
list of a2dObject&#39;s
Definition: gen.h:3157
CloneOptions
options for cloning
Definition: gen.h:1200
structure to give as parameter to member functions of a2dCanvasObject
Definition: canobj.h:252
to make object having a shadow behind it OR to extrude them in 3D
Definition: canobj3d.h:33
virtual void DoWalker(wxObject *parent, a2dWalkerIOHandler &handler)
iterate over this object and its children
Definition: canobj.cpp:5504
canobj3d.h Source File -- Sun Oct 12 2014 17:04:14 -- Sun Oct 12 2014 -- 1.8.5 -- wxArt2D -- . -- Main Page Reference Documentation