21 #include <wx/wfstream.h>
26 #include "wx/editor/candoc.h"
36 #define CIRCLE_STEPS 128
52 a2d3DShape::~a2d3DShape()
59 m_depth = other.m_depth;
60 m_angle3d = other.m_angle3d;
61 m_shape = other.m_shape;
69 void a2d3DShape::SetExtrudeFillFromShape()
74 void a2d3DShape::SetExtrudeStrokeFromShape()
84 m_shape->
Walker(
this, handler );
95 calc = m_shape->
Update( mode );
102 tworld.
Translate( cos( m_angle3d )*m_depth, sin( m_angle3d )*m_depth );
178 #if wxART2D_USE_CVGIO
182 if ( xmlparts == a2dXmlSer_attrib )
190 m_shape->
Save(
this, out, towrite );
200 #endif //wxART2D_USE_CVGIO
a2dHit m_how
return in which way the object was hit (stroke, fill, ...)
#define wxDynamicCast(obj, className)
Define wxDynamicCast so that it will give a compiler error for unrelated types.
virtual void SetTransform(const a2dAffineMatrix &userToWorld)
set user-to-world transform matrix.
void DoRender(a2dIterC &ic, OVERLAP clipparent)
render derived object
double GetWidth() const
return width
const a2dStroke * a2dBLACK_STROKE
global a2dStroke stock object for BLACK stroking
const a2dAffineMatrix & GetTransformMatrix() const
get the matrix used to position the object
class to map references to objects stored in XML, in order to make the connection later on...
a2dDrawing * m_root
root group for rendering and accessing the canvas's also contains layer settings
const a2dFill * a2dBLACK_FILL
global a2dFill stock object for BLACK filling
bool DoUpdate(UpdateMode mode, const a2dBoundingBox &childbox, const a2dBoundingBox &clipbox, const a2dBoundingBox &propbox)
Update derived Object specific things ( mainly boundingbox)
a2dDrawing * GetRoot() const
get a2dCanvasDocument of the object.
double wxDegToRad(double deg)
conversion from degrees to radians
virtual bool Update(UpdateMode mode)
Update the state of the object according to its current position etc.
Input and output handler for the XmlSer format.
virtual void DrawPolygon(a2dVertexArray *points, bool spline=false, wxPolygonFillMode fillStyle=wxODDEVEN_RULE)
Draw polygon in world coordinates using pointarray.
UpdateMode
Various mode flags for Update.
virtual a2dObject * DoClone(CloneOptions options, a2dRefMap *refs) const
Clone this object and return a pointer to the new object.
virtual void SetPending(bool pending)
set this object pending for update
OVERLAP
Result of a a2dBoundingBox intersection or hittest.
a2dRectC is a centered rectangle
virtual void DoLoad(wxObject *parent, a2dIOHandlerXmlSerIn &parser, a2dXmlSer_flag xmlparts)
load object specific CVG data
vertex array of line and arc segments.
a2dCanvasObject is the base class for Canvas Objects.
void DoWalker(wxObject *parent, a2dWalkerIOHandler &handler)
iterate over this object and its children
a2dAffineMatrix m_lworld
used for positioning the object (x,y,ang,scale etc.)
Io handler to iterate through a a2dDocument.
bool GetValid() const
returns true if boundingbox is calculated properly and therefore its valid flag is set...
void Expand(const a2dPoint2D &, const a2dPoint2D &)
expand boundingbox width two points
void Walker(wxObject *parent, a2dWalkerIOHandler &handler)
This is used to recursively walk through an object tree.
a2dDrawer2D * GetDrawer2D() const
get current a2dDrawer2D
Normal straight line segment in a2dVertexList and a2dVertexArray.
virtual void DoSave(wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts, a2dObjectList *towrite)
write object specific CVGL data
Input and output handler for the XmlSer format.
A 2x3 affine matrix class for 2D transformations.
virtual void DoSave(wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts, a2dObjectList *towrite)
write object specific CVGL data
while iterating a a2dCanvasDocument, this holds the context.
All updates of these modes force an update (e.g. update non-pending valid bounding boxes) ...
a2dBoundingBox GetMappedBbox(a2dIterC &ic, bool withExtend=true)
first translate boundingbox with cworld and recalculate at new position
void SetStroke(const wxColour &strokecolor, double width=0, a2dStrokeStyle style=a2dSTROKE_SOLID)
Set a stroke for the object which will be used instead of the layer stroke.
bool DoIsHitWorld(a2dIterC &ic, a2dHitEvent &hitEvent)
Does hit test on the object (exclusif child objects)
bool Translate(double x, double y)
Translate by dx, dy:
The a2dBoundingBox class stores one a2dBoundingBox of a a2dCanvasObject.
bool Invert(void)
Invert matrix.
static a2dHit stock_fill
Stock object for a fill hit.
all polygon and polyline a2dCanvasObject are here.
the a2dDrawingPart is a a2dView specially designed for displaying parts of a a2dDrawing. It uses a a2dDrawer2D to actually redraw things from the document, by giving that a2dDrawer2D as drawing context to the document, and telling the document to redraw a certain rectangular area. At that last is what this class is for. It optimizes the areas to be redrawn after object in the document were changed. To do that it combines redraw areas to a minimal set of redrawing areas. All the administration for this and the way things will be redrawn is from this view.
virtual void Save(wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dObjectList *towrite)
write all needed to an XML type of file called the CVG format
void DoLoad(wxObject *parent, a2dIOHandlerXmlSerIn &parser, a2dXmlSer_flag xmlparts)
load object specific CVG data
a2dBoundingBox m_bbox
boundingbox in world coordinates
const a2dAffineMatrix & GetTransform() const
Get the accumulated transform up to and including m_lworld of the current object. ...
double GetHeight() const
return height
CloneOptions
options for cloning
structure to give as parameter to member functions of a2dCanvasObject
const double wxPI
defines PI
to make object having a shadow behind it OR to extrude them in 3D
void SetFill(const a2dFill &fill)
Set a fill for the object which will be used instead of the layer fill.
virtual void DoWalker(wxObject *parent, a2dWalkerIOHandler &handler)
iterate over this object and its children