wxArt2D
Public Member Functions | Public Attributes | Friends | List of all members
a2dIterC Class Reference

while iterating a a2dCanvasDocument, this holds the context. More...

#include <canobj.h>

Collaboration diagram for a2dIterC:
Collaboration graph
[legend]

Public Member Functions

 a2dIterC ()
 constructor used when drawer is not known
 
 a2dIterC (a2dDrawingPart *drawer, int level=0)
 constructor used when drawer is known ( usually the case ) More...
 
 ~a2dIterC ()
 destructor
 
void SetDisableInvert (bool disableInvert)
 when true, disable inversion of matrixes More...
 
bool GetDisableInvert ()
 see SetDisableInvert()
 
void Reset ()
 Reset this object for beeing reused. It will keep the drawer but NULL object infos.
 
a2dIterPPPush (const a2dAffineMatrix &matrix, OVERLAP clip)
 
a2dIterPPPush (a2dCanvasObject *object, OVERLAP clip)
 
void Pop ()
 
a2dIterPPLast ()
 
void SetHitMarginDevice (int pixels)
 used to extend a hittest with the number of pixels. More...
 
void SetHitMarginWorld (double world)
 used to extend a hittest with the given margin in world coordinates. More...
 
double GetHitMarginWorld ()
 Get HitMargin in World units.
 
double ExtendDeviceToWorld (int extend)
 Transform a pixel extend from device to world units. More...
 
double GetTransformedHitMargin ()
 transformed to object its coordinate system
 
wxUint16 GetLayer ()
 get the layer that is to be rendered
 
void SetLayer (wxUint16 layer)
 set the layer that is to be rendered More...
 
bool GetGenerateCommands ()
 get setting for command generation or not.
 
void SetGenerateCommands (bool generateCommands)
 set to generate command or not in certain situations.
 
const a2dAffineMatrixGetMappingTransform () const
 get the mapping matrix
 
const a2dAffineMatrixGetUserToDeviceTransform () const
 get matrix which transforms directly from relative world coordinates to device
 
a2dDrawingPartGetDrawingPart () const
 get current a2dDrawingPart
 
a2dDrawer2DGetDrawer2D () const
 get current a2dDrawer2D
 
void SetDrawStyle (a2dDocumentRenderStyle drawstyle)
 set drawstyle used for rendering the document More...
 
a2dDocumentRenderStyle GetDrawStyle ()
 get drawstyles used for drawing the document
 
a2dCanvasObjectGetParent () const
 when traversing tree this the object one level higher. More...
 
a2dCanvasObjectGetObject () const
 the object where the iterative context is currently
 
const a2dAffineMatrixGetTransform () const
 Get the accumulated transform up to and including m_lworld of the current object. More...
 
const a2dAffineMatrixGetInverseTransform () const
 Inverse of GetTransform()
 
const a2dAffineMatrixGetParentTransform () const
 Get the accumulated transform up to but NOT including m_lworld of the current obejct. More...
 
const a2dAffineMatrixGetInverseParentTransform () const
 inverse of GetParentTransform()
 
int GetLevel () const
 number of levels deep we are inside a document as seen from the m_top
 
void SetCorridorPath (bool OnOff, a2dCanvasObject *captureObject=NULL)
 to set corridor path ( also to captured object), its a2dCanvasOFlags::IsOnCorridorPath flag is set on or off. More...
 
void SetCorridorPathToParent ()
 
void SetCorridorPathCaptureObject (a2dCanvasObject *captureObject)
 
bool GetFoundCorridorEnd ()
 when there is a corridor path set, this return if end has bin found while iterating.
 
void SetFoundCorridorEnd (bool foundCorridorEnd)
 when there is a corridorPath set, this is used internal to set this flag to indicate that the end of it was found.
 
void SetStrokeWorldExtend (double worldStrokeExtend)
 Set strokeworld extend of last added object, used in a2dCanvasObject::DoIsHitWorld() More...
 
double GetWorldStrokeExtend ()
 
OVERLAP GetClipStatus () const
 what is the clipping withing the current view for the last added object in context
 
OVERLAP GetParentClipStatus () const
 what is the clipping withing the current view for the second last added object in context
 
void SetClipStatus (OVERLAP status)
 set the clipping withing the current view for the last added object in context
 
a2dCanvasObjectFilterGetObjectFilter ()
 get the filter set for the iteration context.
 
void SetObjectFilter (a2dCanvasObjectFilter *filter)
 set object filter class.
 
bool FilterObject (a2dCanvasObject *canvasObject)
 apply object filter
 
void EndFilterObject (a2dCanvasObject *canvasObject)
 called when filter ends
 
void SetPerLayerMode (bool value)
 if set the rendering is done layers by layer from the top
 
bool GetPerLayerMode ()
 if set the rendering is done layers by layer from the top
 
void SetRenderChildDerived (bool value)
 when set child object in derived a2dCanvasObject are rendered, else only the object itself.
 
bool GetRenderChildDerived ()
 when set child object in derived a2dCanvasObject are rendered, else only the object itself.
 
void SetDeepestHit (a2dCanvasObject *canvasObject)
 set during event processing down the hierarchy, to the deepest object that was hit
 
a2dCanvasObjectGetDeepestHit () const
 get deepest object that was hit during event processing down the hierarchy.
 
void SetUpdateHint (a2dCanViewUpdateFlagsMask updateHint)
 
a2dCanViewUpdateFlagsMask GetUpdateHint ()
 

Public Attributes

a2dSmrtPtrList< a2dIterPPm_contextList
 
a2dSmrtPtrList< a2dIterPPm_contextListDeep
 

Friends

class a2dIterPP
 
class a2dIterCU
 
class a2dCorridor
 

Detailed Description

while iterating a a2dCanvasDocument, this holds the context.

The context is a collection of information, which might be needed when traversing the document. e.g. Transforms for drawing and conversion to absolute coordinates are stored here.

Specific information in the context can be valid or not. If the information is set and is valid, a flag is set too. This flag is checked when information is asked for. Asking for non valid information will result in an assert.

Definition at line 3212 of file canobj.h.

Constructor & Destructor Documentation

a2dIterC::a2dIterC ( a2dDrawingPart drawer,
int  level = 0 
)

constructor used when drawer is known ( usually the case )

Parameters
drawerthe drawer that is currently in use.
levelhow deep is the starting object to render from the ShowObject of the a2dDrawingPart.

Definition at line 514 of file canobj.cpp.

Member Function Documentation

double a2dIterC::ExtendDeviceToWorld ( int  extend)

Transform a pixel extend from device to world units.

If no drawer is there (e.g. command procesing) the return value will be zero

Definition at line 611 of file canobj.cpp.

a2dCanvasObject * a2dIterC::GetParent ( void  ) const

when traversing tree this the object one level higher.

Used internal during rendering etc. During recursive traversing a a2dCanvasDocument from top group that is displayed this holds the a2dCanvasObject that is one level higher in the branch that is traversed used during rendering etc., to know what is the parent object in a branch that is being rendered

Definition at line 641 of file canobj.cpp.

const a2dAffineMatrix & a2dIterC::GetParentTransform ( ) const

Get the accumulated transform up to but NOT including m_lworld of the current obejct.

This converts from local coordinates of the curent object to world coordinates !!!! I am not sure if it should contains the view transform (world->device) as well !!!!

Definition at line 709 of file canobj.cpp.

const a2dAffineMatrix & a2dIterC::GetTransform ( ) const

Get the accumulated transform up to and including m_lworld of the current object.

This converts from relative local coordinates of the current object to world coordinates. This matrix transforms all drawing primitives used to draw a a2dCanvasObject from relative world coordinates to absolute world coordinates.

Definition at line 663 of file canobj.cpp.

double a2dIterC::GetWorldStrokeExtend ( )
inline
See Also
SetWorldStrokeExtend()

Definition at line 3403 of file canobj.h.

void a2dIterC::SetCorridorPath ( bool  OnOff,
a2dCanvasObject captureObject = NULL 
)

to set corridor path ( also to captured object), its a2dCanvasOFlags::IsOnCorridorPath flag is set on or off.

The iteration context knows its parent object via its m_bottom and m_parent a2dIterCU. Each a2dIterCU added when going deeper into the drawing hierarchy, knows from which object it came. This way, it is possible to iterate back to the top/show object in a a2dDrawingPart. All canvasobjects passed that way is called the event path. Of course when going up in hierarchy, the event path is becoming smaller again. And when arriving at the top it will be zero. To preserve the event path to a specific canvas object, a flag can be set along the canvas objects in the current event path. Those flags will be kept intact inside the canvasobjects, even if the event path is changing after setting the flags. The a2dCanvasOFlags::IsOnCorridorPath set this way, is/can be used to find and redirect events to the objects along or at the end of this path. The path created like this is called the Corridor path.

When capturing an object, the corridor is used to redirect events to that object, even if the object is a deeper nested child. A non captured corridor also redirects events to the last object in the corridor, but still does normal event processing from that point on. So only a positive hittest will really make the event go to the object. When also capturing the object at the end of a corridor, the mouse event is always going to that object, even if it does not hit it.

Parameters
OnOffto set the corridor path on or off.
captureObjectto set this as a captured object at the end of the corridor, if NULL non is captured.

Definition at line 739 of file canobj.cpp.

void a2dIterC::SetCorridorPathCaptureObject ( a2dCanvasObject captureObject)

leaves corridorpath as is, but resets the capture object at the end of the corridor to the given object. If NULL, the corridor is set to non captured.

Definition at line 799 of file canobj.cpp.

void a2dIterC::SetDisableInvert ( bool  disableInvert)
inline

when true, disable inversion of matrixes

e.g. when rendering a document the inverted matrix is not needed, so we disable the calculation to gain speed.

Definition at line 3237 of file canobj.h.

void a2dIterC::SetDrawStyle ( a2dDocumentRenderStyle  drawstyle)
inline

set drawstyle used for rendering the document

The drawstyle is set in a2dCanvasDocument when rendering parts of the document.

Parameters
drawstyleone of the draw styles

Definition at line 3316 of file canobj.h.

void a2dIterC::SetHitMarginDevice ( int  pixels)

used to extend a hittest with the number of pixels.

to be able to hit a line of width zero, a margin is needed to hit it, which is set here. In fact this value is directly converted to a value in world coordinates, using the current GetDrawer2D(). GetHitMarginWorld() returns this value.

Remarks
default value is taken from a2dDrawingPart or a2dCanvasGlobal

Definition at line 596 of file canobj.cpp.

void a2dIterC::SetHitMarginWorld ( double  world)

used to extend a hittest with the given margin in world coordinates.

to be able to hit a line of width zero, a margin is needed to hit it, which is set here.

Remarks
default value is taken from a2dCanvasGlobal::GetHitMarginWorld

Definition at line 601 of file canobj.cpp.

void a2dIterC::SetLayer ( wxUint16  layer)
inline

set the layer that is to be rendered

wxLAYER_ALL has the special meaning that it renderers all layers at once.

Definition at line 3288 of file canobj.h.

void a2dIterC::SetStrokeWorldExtend ( double  worldStrokeExtend)
inline

Set strokeworld extend of last added object, used in a2dCanvasObject::DoIsHitWorld()

Holds the size/width of the Stroke in world coordinates, else 0. This can be used in derived a2dCanvasObject to do a proper hittest. If the stroke is of type pixel, that value will be converted into world coordinates.

Definition at line 3400 of file canobj.h.


The documentation for this class was generated from the following files:
a2dIterC Class Reference -- Sun Oct 12 2014 17:04:41 -- Sun Oct 12 2014 -- 1.8.5 -- wxArt2D -- . -- Main Page Reference Documentation