a2dIterC Class Reference

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

#include <canobj.h>

Collaboration diagram for a2dIterC:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 a2dIterC ()
 constructor used when drawer is not known
 a2dIterC (a2dCanvasView *drawer, int level=0)
 constructor used when drawer is known ( usually the case )
 ~a2dIterC ()
 destructor
void SetDisableInvert (bool disableInvert)
 when true, disable inversion of matrixes
bool GetDisableInvert ()
 see SetDisableInvert()
void Reset ()
 Reset this object for beeing reused. It will keep the drawer but NULL object infos.
void SetHitMarginDevice (int pixels)
 used to extend a hittest with the number of pixels.
void SetHitMarginWorld (double world)
 used to extend a hittest with the given margin in world coordinates.
double GetHitMarginWorld ()
 Get HitMargin in World units.
double ExtendDeviceToWorld (int extend)
 Transform a pixel extend from device to world units.
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
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
a2dCanvasViewGetCanvasView () const
 get current a2dCanvasView
a2dDrawer2DGetDrawer2D () const
 get current a2dDrawer2D
void SetDrawStyle (a2dDocumentRenderStyle drawstyle)
 set drawstyle used for rendering the document
a2dDocumentRenderStyle GetDrawStyle ()
 get drawstyles used for drawing the document
a2dCanvasObjectGetParent ()
 when traversing tree this the object one level higher.
a2dCanvasObjectGetObject ()
 the object where the iterative context is currently
a2dCanvasObjectGetPreviousDeep ()
 Get the last object, for which the recursive function was called.
a2dCanvasObjectGetPreviousSibling ()
 Get the last sibling, for which the recursive function was called.
a2dCanvasObjectGetPreviousOrParent ()
 Like GetPreviousSibling, but returns the Parent if PreviousSibling is 0.
const a2dAffineMatrixGetTransform () const
 Get the accumulated transform up to and including m_lworld of the current object.
const a2dAffineMatrixGetInverseTransform () const
 Inverse of GetTransform().
const a2dAffineMatrixGetParentTransform () const
 Get the accumulated transform up to but NOT including m_lworld of the current obejct.
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.
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().
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.

Friends

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 3478 of file canobj.h.


Constructor & Destructor Documentation

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

constructor used when drawer is known ( usually the case )

Parameters:
drawer the drawer that is currently in use.
level how deep is the starting object to render from the ShowObject of the a2dCanvasView.

Definition at line 477 of file canobj.cpp.


Member Function Documentation

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 3502 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 a2dCanvasView or a2dCanvasGlobal

Definition at line 519 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 524 of file canobj.cpp.

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 534 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 3545 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:
drawstyle one of the draw styles

Definition at line 3573 of file canobj.h.

a2dCanvasObject * a2dIterC::GetParent (  ) 

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 564 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 605 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 647 of file canobj.cpp.

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 a2dCanvasView. 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:
OnOff to set the corridor path on or off.
captureObject to set this as a captured object at the end of the corridor, if NULL non is captured.

Definition at line 668 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 725 of file canobj.cpp.

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 3666 of file canobj.h.

double a2dIterC::GetWorldStrokeExtend (  )  [inline]

See also:
SetWorldStrokeExtend()

Definition at line 3669 of file canobj.h.


The documentation for this class was generated from the following files:
a2dIterC Class Reference -- Tue Aug 31 18:29:33 2010 -- 31 Aug 2010 -- 1.5.5 -- wxArt2D -- . -- Main Page Reference Documentation