wxArt2D
Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
a2dDrawingPart Class Reference

Display Part of a a2dDrawing, in which a2dCanvasObjects are shown. More...

#include <drawer.h>

Inheritance diagram for a2dDrawingPart:
Inheritance graph
[legend]
Collaboration diagram for a2dDrawingPart:
Collaboration graph
[legend]

Public Member Functions

 a2dDrawingPart (int width=1000, int height=1000)
 constructor
 
 a2dDrawingPart (int width, int height, a2dDrawer2D *drawer2D)
 constructor More...
 
 a2dDrawingPart (a2dDrawer2D *drawer)
 constructor More...
 
 a2dDrawingPart (const wxSize &size)
 constructor
 
 a2dDrawingPart (const a2dDrawingPart &other)
 copy constructor
 
virtual void SetDisplayWindow (wxWindow *display)
 next to the base its m_display, this also sets m_drawer2d to this display
 
virtual wxWindow * GetDisplayWindow ()
 
a2dCanvasGetCanvas () const
 Get the Display window of the a2dView. But casted to a a2dCanvas. More...
 
virtual wxPrintout * OnCreatePrintout (a2dPrintWhat typeOfPrint, const wxPageSetupDialogData &pageSetupData)
 to create a a2dDrawingPrintOut, used to print a view or its document More...
 
void SetZoomOutBorder (wxUint16 border)
 zoomout leafs a border of this amount of pixels around the drawing
 
wxUint16 GetZoomOutBorder ()
 
virtual void SetBufferSize (int w, int h)
 sets buffersize ( if used ) for the a2dDrawer2D
 
virtual bool GetTrippleBuf ()
 
virtual bool GetTrippleBufHasAlpha ()
 
virtual bool HasAlhpa ()
 
virtual ~a2dDrawingPart ()
 destructor
 
void SetViewDependentObjects (bool viewDependentObjects)
 if set true, drawing can contain objects that depend on this view (size etc). More...
 
bool GetViewDependentObjects () const
 see SetViewDependentObjects()
 
a2dLayerViewList & GetLayerRenderArray ()
 get the layer render array
 
bool Get_UpdateAvailableLayers () const
 update layers available needed? More...
 
void SetAvailable ()
 check which layers do contain objects as seen from the ShowObject()
 
void SetLayerCheck (wxUint16 layer)
 signals the need to check the given layer for visibility/availibility as seen from this drawing part.
 
void Set_UpdateAvailableLayers (bool value)
 Sets a flag for updating available layers checking, which makes sure layers will be checked first when needed. More...
 
void SetReverseOrder (bool revorder)
 Set to draw layers in reverse order.
 
bool GetReverseOrder () const
 Get Setting for draw layers in reverse order.
 
void SetHitMargin (wxUint16 pixels)
 used to extend a hittest with the number of pixels. More...
 
wxUint16 GetHitMarginDevice () const
 Get HitMargin used to extend a hittest with the number of pixels.
 
double GetHitMarginWorld () const
 Get HitMargin used to extend a hittest in world units.
 
virtual bool ProcessEvent (wxEvent &event)
 Special event handling for a2dDrawingPart class. More...
 
void SetMouseEvents (bool onoff)
 If not set do not process mouse events. More...
 
bool GetMouseEvents () const
 return true if this a2dDrawingPart allows mouse events to be processed.
 
void SetCaptured (a2dCanvasObject *captured)
 set the object that is captured for events in the a2dDrawing. More...
 
a2dCanvasObjectGetCaptured () const
 are events redirected to a captured corridor? if so return the captured object in it, else NULL
 
void SetEndCorridorObject (a2dCanvasObject *endCorridorObject)
 use in combination with the a2dIterC class to set a corridor path for events. More...
 
a2dCanvasObjectGetEndCorridorObject () const
 return the corridor object if set else NULL More...
 
a2dCanvasObjectSetShowObject (const wxString &name)
 set object available in the a2dDrawing to be shown on the drawer More...
 
bool SetShowObject (a2dCanvasObject *obj)
 set top object available in the a2dDrawing to be shown on the drawer More...
 
void SetShowObjectAndRender (a2dCanvasObject *obj)
 Used temporarely in rendering bitmas or in printing, to Set the show object and redraw the whole part. More...
 
a2dCanvasObjectGetShowObject () const
 return pointer of then currently shown object on the drawer. More...
 
void PushIn (a2dCanvasObject *pushin)
 set given canvasobject as show object, and store the current on the stack
 
a2dCanvasObjectPopOut ()
 pop last pushed canvasobject from the stack, now last becomes show object.
 
void ClearPushInStack ()
 mak push in stack empty
 
bool HasPopOut () const
 is there structure to popout (see PushIn )
 
a2dDrawingGetDrawing () const
 get drawing via top object
 
void AddPendingUpdateArea (a2dCanvasObject *obj, wxUint8 id=0, bool refsalso=true)
 add pending update for the area that is the boundingbox of the given object More...
 
bool AddObjectPendingUpdates (a2dCanViewUpdateFlagsMask how=a2dCANVIEW_UPDATE_PENDING)
 recursive find pending objects and adds their areas to the updatelist More...
 
void AddPendingUpdateArea (const a2dBoundingBox &box, wxUint8 id=0)
 add boundingbox to update list for updating in idle time
 
void AddPendingUpdateArea (const wxRect &recnew, wxUint8 id=0)
 add rectangle to update list for updating in idle time
 
void AddPendingUpdateArea (int x, int y, int w, int h, wxUint8 id=0)
 add area to update list for updating in idle time More...
 
void AddOverlayAreas (bool update)
 
void AddOverlayObject (a2dCanvasObject *obj)
 add to list of overlay objects (must be children of m_top)
 
void RemoveOverlayObject (a2dCanvasObject *obj)
 remove from the list of overlay objects (must be children of m_top)
 
void OnUpdate (a2dDrawingEvent &event)
 depending on the hint value performs specific updating on the view. More...
 
void Update (unsigned int how=(a2dCANVIEW_UPDATE_ALL|a2dCANVIEW_UPDATE_BLIT), wxObject *hintObject=NULL)
 see OnUpdate More...
 
virtual void UpdateArea (int x, int y, int width, int height, wxUint8 id=0)
 update/redraw part of the buffer, using the given a2dDrawing and ShowObject within that root. More...
 
virtual void ClearArea (int x, int y, int width, int height)
 
virtual void RenderChildObject (a2dCanvasObject *obj)
 
virtual void BlitBuffer (int x, int y, int width, int height, int xbuf, int ybuf)
 blit part of the drawing buffer to the canvas
 
virtual void DrawOrigin ()
 Function to draw the origin. More...
 
virtual void PaintGrid (int x, int y, int width, int height)
 Function to draw the grid. More...
 
virtual void PaintBackground (int x, int y, int width, int height)
 (re)painting of background More...
 
void SetCrossHair (bool onoff)
 set enable crosshair cursor
 
bool GetCrossHair ()
 get enable crosshair cursor
 
void SetCrossHairLengthX (int LengthX)
 set crosshair cursor Length in X in pixels
 
void SetCrossHairLengthY (int LengthY)
 set crosshair cursor Length in Y in pixels
 
int GetCrossHairLengthX ()
 get crosshair cursor Length in X in pixels
 
int GetCrossHairLengthY ()
 get crosshair cursor Length in Y in pixels
 
void SetCrossHairStroke (const a2dStroke &stroke)
 set stroke for crosshair
 
a2dStrokeGetCrossHairStroke ()
 get stroke for crosshair
 
virtual void UpdateCrossHair (int x, int y)
 blit old areas to remove last drawn crosshair and draw the cross hair at this new position.
 
void SetFixedStyleFill (const a2dFill &fixFill)
 set a2dFill to use when RenderFIX_STYLE is set.
 
void SetFixedStyleStroke (const a2dStroke &fixStroke)
 set a2dStroke to use when RenderFIX_STYLE is set.
 
void SetSelectFill (const a2dFill &selectFill)
 set a2dFill to use when RenderWIREFRAME_SELECT or RenderWIREFRAME_SELECT_INVERT is set.
 
void SetSelectStroke (const a2dStroke &selectStroke)
 set a2dStroke to use when RenderWIREFRAME_SELECT or RenderWIREFRAME_SELECT_INVERT is set.
 
void SetSelect2Fill (const a2dFill &select2Fill)
 set a2dFill to use when RenderWIREFRAME_SELECT2 or RenderWIREFRAME_SELECT2_INVERT is set.
 
void SetSelect2Stroke (const a2dStroke &select2Stroke)
 set a2dStroke to use when RenderWIREFRAME_SELECT2 or RenderWIREFRAME_SELECT2_INVERT is set.
 
void SetHighLight (const a2dFill &hightLightFill)
 set a2dFill to use when RenderWIREFRAME_HighLight.
 
void SetHighLight (const a2dStroke &hightLightStroke)
 set a2dStroke to use when RenderWIREFRAME_HighLight.
 
void SetOverlayFill (const a2dFill &overlayFill)
 set a2dFill to use when RenderFIX_STYLE is set.
 
void SetOverlayStroke (const a2dStroke &overlayStroke)
 set a2dStroke to use when RenderFIX_STYLE is set.
 
void SetBackgroundFill (const a2dFill &backgroundfill)
 background fill for the canvas
 
a2dFillGetBackgroundFill ()
 get current background fill for the canvas
 
void SetGridAtFront (bool gridatfront)
 Set grid setting for drawing grid in front or back.
 
bool GetGridAtFront ()
 Get grid setting for drawing grid in front or back.
 
void SetGridStroke (const a2dStroke &gridstroke)
 set stroke used for grid drawing
 
void SetGridSize (wxUint16 gridsize)
 set size of grid circle
 
void SetGridFill (const a2dFill &gridfill)
 set fill used for grid drawing
 
double GetGridX ()
 Get grid distance in X.
 
void SetGridX (double gridx)
 Set grid distance in X.
 
double GetGridY ()
 Get grid distance in Y.
 
void SetGridY (double gridy)
 Set grid distance in Y.
 
void SetGrid (bool grid)
 Set grid on/off.
 
bool GetGrid ()
 Get grid setting on/off.
 
void SetGridLines (bool gridlines)
 Get grid setting for line drawing. More...
 
bool GetGridLines ()
 Get setting for grid to draw lines instead of points.
 
void SetGridThreshold (wxUint16 gridthres)
 
wxUint16 GetGridThreshold ()
 Get grid threshold.
 
void SetShowOrigin (bool show)
 Set showorigin on/off.
 
bool IsFrozen ()
 Returns if canvas is frozen.
 
void Freeze ()
 prevent changing the a2dDrawingPart buffer and blitting it to the window More...
 
void Thaw (bool update)
 to release Freeze() More...
 
virtual bool BlitPendingUpdateAreas ()
 blit pending update areas, that are already updated to the buffer, now to the screen. More...
 
bool SetCanvasToolContr (a2dToolContr *controller)
 set toolcontroller ( reset with NULL ) More...
 
a2dToolContrGetCanvasToolContr ()
 
void SetCursor (const wxCursor &cursor)
 
void PushCursor (const wxCursor &cursor)
 push a cursor on the cursor stack, and set display cursor to new back being cursor.
 
void PopCursor ()
 pop a cursor from the cursor stack, and set display cursor to back
 
void ClearCursorStack ()
 clear the stack of cursor, and set display cursor ARROW.
 
a2dCanvasObjectIsHitWorld (double x, double y, int layer=wxLAYER_ALL, a2dHitOption option=a2dCANOBJHITOPTION_NONE, bool filterSelectableLayers=false)
 do a hittest on the view at coordinates x,y More...
 
a2dCanvasObjectIsHitWorldPath (double x, double y, int layer=wxLAYER_ALL, a2dHitOption option=a2dCANOBJHITOPTION_NONE, bool filterSelectableLayers=false)
 do a hittest on the view at coordinates x,y More...
 
a2dCanvasObjectIsHitWorld (a2dHitEvent &hitEvent, int layer=wxLAYER_ALL)
 do an advanged hittest on the view More...
 
virtual bool ProcessCanvasObjectEvent (wxEvent &event, bool &isHit, double x, double y, int margin, int layer=wxLAYER_ALL)
 Corridor and captured object event processing. More...
 
virtual bool ProcessCanvasObjectEvent (a2dCanvasObjectEvent &event, bool &isHit, double x, double y, int margin, int layer=wxLAYER_ALL)
 Corridor and captured object event processing. More...
 
void OnPropertyChanged (const a2dPropertyId *id)
 This function is called after a property changed. More...
 
bool FindAndSetCorridorPath (a2dCanvasObject *findObject, bool capture)
 Find the show-object child object, set the path to the given child object and capture it. More...
 
void SetCorridorPath (const a2dCorridor &corridor)
 find object on the current corridor path. More...
 
void ClearCorridorPath (bool uncapture)
 Reset all corridor paths and uncapture object. More...
 
void SetMappingShowAll ()
 use the boundingbox of the ShowObject to set the mapping such that it will be displayed completely on the device. More...
 
void SetDrawer2D (a2dDrawer2D *drawer2d, bool noDelete=false)
 set the internal m_drawer2D to be used for rendering the document More...
 
a2dDrawer2DGetDrawer2D ()
 get the internal m_drawer2D that is used for rendering the document
 
void SetDocumentDrawStyle (wxUint32 drawstyle)
 set drawstyles to use for drawing the document More...
 
void RestoreDrawStyle ()
 restore drawstyle to the one before the last change
 
wxUint32 GetDocumentDrawStyle ()
 get drawstyles used for drawing the document
 
void SetOverlayDrawStyle (a2dDocumentRenderStyle drawstyle)
 
virtual void Scroll (int dxy, bool yscroll, bool total)
 scroll up down or left right More...
 
void OnDrop (wxCoord x, wxCoord y, a2dDrawing *drawing)
 used to drop a drawing object on the drawing part during Drag and Drop.
 
virtual void RenderTopObject (wxUint32 documentDrawStyle, wxUint8 id)
 does render the top object in the given style. More...
 
virtual void RenderTopObject (a2dCanvasObjectFlagsMask mask, a2dDocumentRenderStyle drawstyle)
 single drawstyle render cycle called on document More...
 
virtual void RenderOverlay (a2dDocumentRenderStyle drawstyle)
 render of overlay objects stored in m_overlayObjects specific to the view
 
void UpdateViewDependentObjects ()
 update the transform matrix for objects with property 'PROPID_viewDependent' More...
 
void SetPrintTitle (bool val)
 If true render the printout with a title string, otherwise not.
 
void SetPrintFilename (bool val)
 If true render the printout with a filename string, otherwise not.
 
void SetPrintScaleLimit (double val)
 Set the scaling limit for printing, so that small stuff is not zoomed to full page.
 
void SetPrintFrame (bool val)
 If true, draw a frame around printouts.
 
void SetPrintFitToPage (bool val)
 If true, draw a view on all page without real scale.
 
int GetMouseX ()
 get mouse position X
 
int GetMouseY ()
 get mouse position Y
 
int GetWorldMouseX ()
 get mouse position X in world coordinates
 
int GetWorldMouseY ()
 get mouse position Y in world coordinates
 
void MouseToToolWorld (int x, int y, double &xWorldLocal, double &yWorldLocal)
 
void ToolWorldToMouse (double xWorld, double yWorld, int &x, int &y)
 
void SetToolWantsEventToContinue (bool continueEvent=true)
 if tool want an event to be handled by the view, even if already processed.
 
- Public Member Functions inherited from a2dObject
bool SearchDynamicEventTable (wxEvent &event)
 
void Connect (int winid, int lastId, int eventType, wxObjectEventFunction func, wxObject *userData=(wxObject *) NULL, wxEvtHandler *eventSink=(wxEvtHandler *) NULL)
 
bool Disconnect (int winid, int lastId, wxEventType eventType, wxObjectEventFunction func=NULL, wxObject *userData=(wxObject *) NULL, wxEvtHandler *eventSink=(wxEvtHandler *) NULL)
 
void ProcessConnectedEvent (wxEvent &event)
 wxCHECK_VERSION(2,9,0) More...
 
void ConnectEvent (wxEventType type, wxEvtHandler *eventSink)
 
bool DisconnectEvent (wxEventType type, wxEvtHandler *eventSink)
 
bool DisconnectEventAll (wxEvtHandler *eventSink)
 Remove all dynamic events in classA, going to classB (eventSink) More...
 
 a2dObject ()
 constructor
 
virtual ~a2dObject ()
 destructor
 
void operator= (const a2dObject &other)
 assignment operator
 
int GetOwnedBy ()
 like it to be protected, but this does not work with wxList macros More...
 
virtual a2dObjectSetNonDynamic ()
 Call to mark this object as non-dynamic (static/local/auto) More...
 
void CheckReferences ()
 Check zero reference count and delete if count is 0. More...
 
a2dObjectClone (CloneOptions options, a2dRefMap *refs=NULL) const
 create an exact copy of this property
 
 a2dObject (const a2dObject &other, CloneOptions options, a2dRefMap *refs)
 
virtual wxString GetName () const
 Returns the name of this object, if no name is given the internal id will be returned. More...
 
virtual void SetName (const wxString &name)
 Creates the a2dStringProperty PROPID_Name. More...
 
virtual bool IsTemporary_DontSave () const
 Check if this is a temporary object, which should not be saved.
 
void SaveAsDocument (a2dIOHandlerXmlSerOut &out)
 Save this object and all below as an XML document. More...
 
virtual void Save (wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dObjectList *towrite)
 write all needed to an XML type of file called the CVG format More...
 
void LoadFromDocument (a2dIOHandlerXmlSerIn &parser)
 Load this object and all below from an XML document. More...
 
virtual void Load (wxObject *parent, a2dIOHandlerXmlSerIn &parser)
 load object from CVG file More...
 
wxInt64 GetUniqueSerializationId () const
 return a unique id for this object More...
 
virtual bool AlwaysWriteSerializationId () const
 If true, always write an id. More...
 
virtual bool LinkReference (a2dObject *other)
 link a reference in the object to the given value More...
 
virtual void ResolveInform ()
 inform an object that reference resolution was done More...
 
void Walker (wxObject *parent, a2dWalkerIOHandler &handler)
 This is used to recursively walk through an object tree.
 
void SetCheck (bool check)
 general flag use at will. More...
 
bool GetCheck () const
 general flag use at will.
 
void SetRelease (bool value)
 set release flag More...
 
bool GetRelease () const
 get release flag More...
 
a2dAutoZeroPtr< a2dObject > ** GetAutoZeroPtrList ()
 return the list head pointer for autozero pointers to this object More...
 
 DECLARE_PROPERTIES ()
 
a2dNamedPropertyGetProperty (const a2dPropertyId *propertyId, a2dPropertyId::Flags flags=a2dPropertyId::flag_none) const
 get property on this object More...
 
void SetProperty (a2dNamedProperty *propertyHolder, a2dPropertyId::SetFlags flags=a2dPropertyId::set_none)
 Set the property to the this object. More...
 
void SetProperty (const a2dNamedProperty &propertyHolder, a2dPropertyId::SetFlags flags=a2dPropertyId::set_none)
 Set the property to the this object and if enabled, to all childs and object members. More...
 
virtual a2dNamedPropertyFindProperty (const a2dPropertyId *id, a2dPropertyId::Flags flags=a2dPropertyId::flag_none)
 Find a dynamic property with given id in the property list. More...
 
virtual const a2dNamedPropertyFindProperty (const a2dPropertyId *id, a2dPropertyId::Flags flags=a2dPropertyId::flag_none) const
 Find a dynamic property with given id in the property list. More...
 
virtual bool HasProperty (const a2dPropertyId *id, const wxString &stringvalue=wxEmptyString) const
 Check if the object has a property with given id and string representation. More...
 
virtual bool EditProperties (const a2dPropertyId *id, bool withUndo=true)
 edit properties of the object More...
 
void TakeOverProperties (a2dObject *from, a2dPropertyIdList *listOfIds)
 Properties in the id list are taken from the given object, en set to this. More...
 
wxURI GetURI () const
 quick way to get to PROPID_URI property More...
 
void SetURI (const wxURI &url)
 quickly set a property PROPID_URI More...
 
const a2dNamedPropertyListGetPropertyList () const
 Get the Property List. More...
 
bool HasDynamicProperties () const
 test if there are dynamic properties in the m_propertylist
 
virtual bool RemoveProperty (const a2dPropertyId *id, bool all=true)
 This function is called by a2dPropertyId to remove a property from the list. More...
 
void RemoveTemporaryProperties ()
 remove all temporary properties
 
virtual bool AddProperty (a2dNamedProperty *property)
 This function is called by a2dPropertyId to add a property to the list. More...
 

Public Attributes

bool m_skipBuffer
 

Static Public Attributes

static a2dPropertyIdUint16PROPID_drawstyle = NULL
 
static a2dPropertyIdBoolPROPID_gridlines = NULL
 
static a2dPropertyIdBoolPROPID_grid = NULL
 
static a2dPropertyIdBoolPROPID_showorigin = NULL
 
static a2dPropertyIdUint16PROPID_hitmargin = NULL
 
static a2dPropertyIdBoolPROPID_gridatfront = NULL
 
static a2dPropertyIdUint16PROPID_gridsize = NULL
 
static a2dPropertyIdUint16PROPID_gridthres = NULL
 
static a2dPropertyIdDoublePROPID_gridx = NULL
 
static a2dPropertyIdDoublePROPID_gridy = NULL
 
static const a2dSignal sig_changedLayers = wxNewId()
 when more layers changed ( rerendering view is needed).
 
static const a2dSignal sig_changedLayerAvailable = wxNewId()
 when an object is added to a layer, and therefore makes this layer available.
 
static const a2dSignal sig_changedLayerVisibleInView = wxNewId()
 when one layer is set visible in a2dDrawingPart
 
static const a2dSignal sig_changedShowObject = wxNewId()
 
- Static Public Attributes inherited from a2dObject
static a2dPropertyIdBoolPROPID_Check = NULL
 used for linking multiple referenced objects when serializing
 
static a2dPropertyIdUriPROPID_URI = NULL
 attach an URL to the object
 
static a2dPropertyIdStringPROPID_Name = NULL
 Name property, to return name of this object.
 
static a2dPropertyIdVoidPtrPROPID_autozeroptrlist = NULL
 
static const a2dSignal sm_Edit_properties = wxNewId()
 edit properties event, see EditProperties()
 

Protected Member Functions

void OnSetFocus (wxFocusEvent &focusevent)
 
void OnKillFocus (wxFocusEvent &focusevent)
 
void OnEnter (wxMouseEvent &event)
 
void OnIdle (wxIdleEvent &event)
 redraw and/or blit pending areas to the device
 
void OnMouseEvent (wxMouseEvent &event)
 normally sent from wxWindow containing the view, via its ProcessEvent(wxEvent& event)
 
void OnCharEvent (wxKeyEvent &event)
 normally sent from wxWindow containing the view, via its ProcessEvent(wxEvent& event)
 
void OnComEvent (a2dComEvent &event)
 called for a2dComEvent events.
 
void OnBusyBegin (a2dCommandProcessorEvent &event)
 do this at command start
 
void OnBusyEnd (a2dCommandProcessorEvent &event)
 do this at command end
 
void RedrawPendingUpdateAreas (bool noblit=false)
 redraw the pending update areas to the buffer given in device coordinates.
 
void DeleteAllPendingAreas ()
 pending update areas in the update list are deleted. More...
 
void Aberration (double angle, double radius, double &dphi, unsigned int &segments)
 based on angle and radius and m_aberration calculate a proper delta phi and number of segments More...
 
- Protected Member Functions inherited from a2dObject
virtual bool DoIgnoreIfNotMember (const a2dPropertyId *id) const
 used to decide if a property shall be ignored, if it is not a member More...
 
virtual void DoWalker (wxObject *parent, a2dWalkerIOHandler &handler)
 iterate over this object and its children More...
 
virtual void DoSave (wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts, a2dObjectList *towrite)
 Save settings.
 
virtual void DoLoad (wxObject *parent, a2dIOHandlerXmlSerIn &parser, a2dXmlSer_flag xmlparts)
 Load settings.
 

Protected Attributes

bool m_frozen
 buffer updating activity possible or not
 
a2dCanvasObjectPtr m_capture
 object that is receiving events
 
a2dCanvasObjectPtr m_endCorridorObject
 when a corridor is active, this is set.
 
bool m_mouseevents
 enable/ disable mouse events handling by canvas
 
a2dCanvasObjectPtr m_top
 top object for drawer object, from here the rendering starts
 
a2dFill m_backgroundfill
 background fill of canvas and background color of background fill in case of mono colour fill
 
wxUint16 m_border
 border zoomout but leaf around a border of this amount of pixels.
 
bool m_showorigin
 showorigin?
 
bool m_gridatfront
 grid drawn at front or back
 
bool m_crosshair
 is croshair visible
 
int m_crosshairx
 crosshair x
 
int m_crosshairy
 crosshair y
 
int m_crosshairLengthX
 crosshair cursor Length in X in pixels
 
int m_crosshairLengthY
 crosshair cursor Length in Y in pixels
 
a2dStroke m_crosshairStroke
 stroke to use for crosshair
 
int m_mouse_x
 last mouse position
 
int m_mouse_y
 
a2dStroke m_gridstroke
 grid stroke
 
a2dFill m_gridfill
 grid fill
 
a2dStroke m_fixStroke
 fixed style stroke
 
a2dFill m_fixFill
 fixed style fill
 
a2dStroke m_overlayStroke
 overlay style stroke
 
a2dFill m_overlayFill
 overlay style fill
 
a2dStroke m_selectStroke
 select style stroke
 
a2dFill m_selectFill
 select style fill
 
a2dStroke m_select2Stroke
 select style stroke
 
a2dFill m_select2Fill
 select style fill
 
a2dStroke m_highLightStroke
 highLight style stroke
 
a2dFill m_highLightFill
 highLight style fill
 
double m_gridx
 grid distance in x
 
double m_gridy
 grid distance in y
 
wxUint16 m_gridsize
 grid point size
 
bool m_gridlines
 show grid as lines
 
wxUint16 m_gridthres
 threshold for grid.
 
bool m_grid
 grid on/off
 
bool m_virtualarea_set
 is the virtual area set already (used during startup)
 
int m_width
 device size width
 
int m_height
 device size height
 
double m_splineaberration
 accuracy of spline
 
a2dClipRegionList m_clipregionlist
 pushed clipping regions
 
double m_displayaberration
 accuracy of arc segment calculation etc. in device coordinates
 
a2dUpdateList m_updateareas
 list of rectangles that need to be blited to the screen. More...
 
bool m_recur
 to prevent recursive updates
 
a2dSmrtPtr< a2dToolContrm_toolcontroller
 toolscontroller plugged in as first event handler
 
a2dDrawer2Dm_drawer2D
 
wxWindow * m_drawingDisplay
 
wxUint16 m_hitmargin
 how close does a hit need to be to the object you are trying to hit. More...
 
bool m_asrectangle
 underneath the threshold draw rectangles.
 
wxUint32 m_documentDrawStyle
 drawstyles to use when rendering document
 
a2dDocumentRenderStyle m_overlayDrawStyle
 drawstyles to use when rendering overlay
 
wxUint32 m_documentDrawStyleRestore
 to restore style after a temporary change.
 
bool m_printtitle
 if true, a printout is done with title (document name (description?)), otherwise not
 
bool m_printfilename
 if true, a printout is done with filename (document file path), otherwise not
 
double m_printscalelimit
 Set the scaling limit for printing, so that small stuff is not zoomed to full page.
 
bool m_printframe
 If true, draw a frame around printouts.
 
bool m_printfittopage
 If true, draw a view on all page without real scale.
 
a2dLayerViewList m_layerRenderArray
 which layer should be rendered ( visible and/or available )
 
bool m_update_available_layers
 flag to updatelayers that are available. More...
 
a2dTiles m_tiles
 tiles on drawing surface, used to optimize update areas.
 
a2dTiles m_tiles2
 
bool m_reverse_order
 draw in reverse order if set
 
bool m_viewDependentObjects
 
a2dCursorStack m_cursorStack
 
a2dPushInStack m_pushInStack
 
a2dCanvasObjectList m_overlayObjects
 
bool m_toolWantsIt
 
a2dSmrtPtrList< a2dIterPPm_patToHitPrev
 
a2dSmrtPtrList< a2dIterPPm_patToHitCur
 
- Protected Attributes inherited from a2dObject
a2dNamedPropertyList m_propertylist
 properties
 
int m_refcount
 how many references to this object do exist
 
bool m_check: 1
 used for linking multiple referenced objects when serializing
 
bool m_release: 1
 when set object is treated as being deleted, and wil be deleted in idle time.
 
bool m_recursion_active: 1
 this is used as a recursion stopper
 
bool m_pendingDisconnects: 1
 
unsigned int m_iteratorCount
 
a2dAutoZeroPtr< a2dObject > * m_autozeroptrlist
 this is a list of all a2dAutoZeroPtr object pointing to this object
 

Additional Inherited Members

- Public Types inherited from a2dObject
enum  CloneOptions {
  clone_members = 0x00000001, clone_properties = 0x00000002, clone_childs = 0x00000004, clone_unused = 0x00000008,
  clone_setoriginal = 0x00000010, clone_seteditcopy = 0x00000020, clone_noReference = 0x00000040, clone_noCameleonRef = 0x00000080,
  clone_toDrag = 0x00000100, clone_flat = 0x00000000, clone_deep = clone_members | clone_properties | clone_childs
}
 options for cloning More...
 
typedef a2dAutoZeroPtr< a2dObjectTAutoZeroPtrListClass
 this is needed inside the smart pointer template code
 
- Protected Types inherited from a2dObject
enum  { refcount_nondynamic = 0x76543210 }
 special refcount value for non-dynamic objects
 

Detailed Description

Display Part of a a2dDrawing, in which a2dCanvasObjects are shown.

a2dDrawingPart is a specialized view to display parts of a a2dDrawing. Such a part always starts at one a2dCanvasObject which is inside of a a2dDrawing object. The a2dCanvasObject itself contains as children a2dCanvasObject derived drawable objects. A hierarchy of recursively nexted objects is what forms the actual drawing. The parent object to start the drawing is called the ShowObject. The member functions SetShowObject(...) are used to set the ShowObject to be displayed. All objects are defined in relative world coordinates, which are relative to the parent object(s).

a2dDrawing is given as a drawing and/or updating context an a2dDrawingPart. E.g. in a2dDrawingPart::RenderTopObject() is used by the a2dCanvasObject render functions to get to a2dDrawingPart::m_drawer2D, which is the Drawing Context used to do the actual drawing within the a2dCanvasObjects. But a2dDrawingPart::RenderTopObject() defines what drawing style is used to draw.

The real purpose of a2dDrawingPart, is to maintain a list of damaged/changed areas in the view/drawing, and when time is ready, start redrawing those areas. When a a2dCanvasObject did change in position or size etc., the a2dDrawing reports this change as a rectangular redraw areas to the a2dDrawingPart's of that drawing. The update areas are based on the boundingbox of the object in its old state and in its new state. This reporting is done in idle time, and for all changed objects at once. When reporting of all changed areas is done, each a2dDrawingPart knows what parts of its drawing need to be redrawn. It will then start redrawing those areas, but only after optimizing to the minimum areas to redraw. So overlapping areas will only be redrawn once. The mechanism for that is called tilling.

The size of the drawing in world coordinates and the size of the view in pixels is all indirectly defined by a2dDrawingPart::m_drawer2D and a2dView::m_display. The area of the drawing in world coordinates that is visible, can be set via a2dDrawingPart::m_drawer2D. Also if World coordinates is with the Y axis going up are down. a2dDrawer2D has methods to convert from world to device coordinates and visa versa. a2dDrawingPart::m_drawer2D draws into a buffer. After rendering an update of all damaged parts into this buffer, it will be blitted from the buffer to the a2dView::m_display of the a2dDrawingPart. This is done in Idle time, but can also be forced. In the end a2dDrawingPart automatically always displays an up to date part of the drawing which is stored inside the a2dDrawing. The user just changes a a2dCanvasObject inside the a2dDrawing, and the redrawing on all the views will be done automatically.

A a2dDrawingPart its a2dDrawingPart::m_drawer2D knows where to draw to, this can be a bitmap buffer or a window etc. The job to update a window in case of drawing to a bitmap buffer, is not part of the a2dDrawer2D. This is/needs to be done by the class using the drawer, like a2dDrawingPart and indirectly a2dCanvas here. The a2dCanvas receives a paint event, e.g. when moving an overlapping window or dialog, and it then blits the right parts from a2dDrawingPart::m_drawer2D its drawing buffer to the canvas window. a2dDrawingPart also takes care of scrolling the view, it does this by re-using the contents of the a2dDrawer2D drawing buffer when possible. The drawing buffer can be bigger then the size of the canvas window. a2dDrawingPart always makes sure the whole buffer contains an up to date contents, as being the drawing to display form its a2dDrawing. Therefore if the canvas windows which uses the a2dDrawingPart for drawing, implements scrolling and resizing, the canvas window is responsible for optimizing the scroll to take maximum advantage from the buffer of a2dDrawingPart. Like if the buffer is bigger in size then the canvas windows size, a resize of the canvas window only needs to increase the buffer size of a2dDrawingPart, when the size of the window exeeds the buffer size. One can even decide to set the buffer to the size of the complete virtual area that can be scrolled. This way one can make a trade of between buffer size and scrolling/resizing speed. Knowing this, one needs to realize that mouse coordinates as received inside a canvas window, are different if the origin in the drawing context is not at the orginin of the canvas window. The a2dDrawingPart::m_drawer2D takes (0,0) of the buffer as the origin of device coodinates.

Definition at line 470 of file drawer.h.

Constructor & Destructor Documentation

a2dDrawingPart::a2dDrawingPart ( int  width,
int  height,
a2dDrawer2D drawer2D 
)

constructor

Width and hight is given, mapping is as in drawer given.

Definition at line 516 of file drawer.cpp.

a2dDrawingPart::a2dDrawingPart ( a2dDrawer2D drawer)

constructor

Width and hight and mapping is as in drawer given.

Definition at line 532 of file drawer.cpp.

Member Function Documentation

void a2dDrawingPart::Aberration ( double  angle,
double  radius,
double &  dphi,
unsigned int &  segments 
)
protected

based on angle and radius and m_aberration calculate a proper delta phi and number of segments

The calculation is used for circular arc segments

bool a2dDrawingPart::AddObjectPendingUpdates ( a2dCanViewUpdateFlagsMask  how = a2dCANVIEW_UPDATE_PENDING)

recursive find pending objects and adds their areas to the updatelist

it does first test if the a2dDrawing has the flag set to tell it has pending objects inside.

If that is the case, it traverses the a2dDrawing, and adds the absolute boundingbox of the pending object to the a2dDrawingPart updatelist. This is for all paths leading to the object from the current ShowObject, so also a2dCanvasObjectReference's.

Returns
true if did add pendingobject's else false

Definition at line 2920 of file drawer.cpp.

void a2dDrawingPart::AddPendingUpdateArea ( a2dCanvasObject obj,
wxUint8  id = 0,
bool  refsalso = true 
)

add pending update for the area that is the boundingbox of the given object

Updates the boundingbox area of the given object at idle time. If obj is NULL nothing will be done If refalso is true then all references to this object will be updated also.

Parameters
objthe object where to take the bounding box from
refsalsotrue to update all references, else false

Definition at line 2891 of file drawer.cpp.

void a2dDrawingPart::AddPendingUpdateArea ( int  x,
int  y,
int  w,
int  h,
wxUint8  id = 0 
)

add area to update list for updating in idle time

the given area will be added to the list of rectangles to be blitted to the screen later in idle time, at repaint or after an UpdateNow action. The given area will be combined (merged/ignored) with the already available update areas. This to prevent un necessary redraws.

Definition at line 2851 of file drawer.cpp.

bool a2dDrawingPart::BlitPendingUpdateAreas ( )
virtual

blit pending update areas, that are already updated to the buffer, now to the screen.

does the second stage in the two stage process of updating

Definition at line 1932 of file drawer.cpp.

void a2dDrawingPart::ClearCorridorPath ( bool  uncapture)

Reset all corridor paths and uncapture object.

See Also
a2dIterC::SetCorridorPath Reset a corridor path set with FindAndSetCorridorPath
Parameters
uncaptureif true uncaptured the captured object

Definition at line 1549 of file drawer.cpp.

void a2dDrawingPart::DeleteAllPendingAreas ( )
protected

pending update areas in the update list are deleted.

use when ready with updates, or when they become useless because of scroll etc.

Definition at line 1855 of file drawer.cpp.

void a2dDrawingPart::DrawOrigin ( )
virtual

Function to draw the origin.

override this function in a derived class to redefine painting of the origin

Definition at line 3199 of file drawer.cpp.

bool a2dDrawingPart::FindAndSetCorridorPath ( a2dCanvasObject findObject,
bool  capture 
)

Find the show-object child object, set the path to the given child object and capture it.

See Also
a2dIterC::SetCorridorPath This is used to redirect events in the wxDocview library to a specific child object, e.g. one found by extended hit testing.
Parameters
findObject(child) object to be searched for.
captureif true the findObject is captured
Returns
true if findObject was found

Definition at line 1516 of file drawer.cpp.

void a2dDrawingPart::Freeze ( )

prevent changing the a2dDrawingPart buffer and blitting it to the window

This makes sure the contents displayed into the a2dDrawingPart buffer does not change. Pending objects inside a root will be added to the update list of the a2dDrawingPart, but not redrawn into the buffer until Thaw.

See Also
Thaw

Definition at line 1026 of file drawer.cpp.

bool a2dDrawingPart::Get_UpdateAvailableLayers ( ) const
inline

update layers available needed?

See Also
Set_UpdateAvailableLayers

Definition at line 570 of file drawer.h.

a2dCanvas* a2dDrawingPart::GetCanvas ( ) const
inline

Get the Display window of the a2dView. But casted to a a2dCanvas.

when a a2dCanvas is used in this a2dDrawingPart return it else 0. a2dDrawingPart needs to know the window (a2dCanvas) to display itself. The a2dDrawingPart updates to this window in idel time. Paint event to the a2dCanvas are using the a2dDrawingPart its buffer for quick updating the a2dCanvas window.

See Also
a2dView::SetDisplayWindow()

Definition at line 525 of file drawer.h.

a2dCanvasObject* a2dDrawingPart::GetEndCorridorObject ( ) const
inline

return the corridor object if set else NULL

See Also
SetEndCorridorObject()

Definition at line 654 of file drawer.h.

a2dCanvasObject* a2dDrawingPart::GetShowObject ( ) const
inline

return pointer of then currently shown object on the drawer.

Returns
: pointer to the current object that is shown.

Definition at line 680 of file drawer.h.

wxUint16 a2dDrawingPart::GetZoomOutBorder ( )
inline
See Also
SetZoomOutBorder()

Definition at line 540 of file drawer.h.

a2dCanvasObject * a2dDrawingPart::IsHitWorld ( double  x,
double  y,
int  layer = wxLAYER_ALL,
a2dHitOption  option = a2dCANOBJHITOPTION_NONE,
bool  filterSelectableLayers = false 
)

do a hittest on the view at coordinates x,y

Parameters
xx of point to do hittest
yy of point to do hittest
layertest only if objects are on this layer or if set to wxLAYER_ALL test obejcts on all layers
optionways to hit
maskonly object with this mask set will be hit
Returns
the top object that was hit (e.g.in case of groups)
Remarks
hit margin is defined in a2dDrawing containing the root group

Definition at line 1565 of file drawer.cpp.

a2dCanvasObject * a2dDrawingPart::IsHitWorld ( a2dHitEvent hitEvent,
int  layer = wxLAYER_ALL 
)

do an advanged hittest on the view

Parameters
hitEventstores hit information
layertest only if objects are on this layer or if set to wxLAYER_ALL test obejcts on all layers
Returns
the top object that was hit (e.g.in case of groups)
Remarks
hit margin is defined in a2dDrawing containing the root group

Definition at line 1623 of file drawer.cpp.

a2dCanvasObject * a2dDrawingPart::IsHitWorldPath ( double  x,
double  y,
int  layer = wxLAYER_ALL,
a2dHitOption  option = a2dCANOBJHITOPTION_NONE,
bool  filterSelectableLayers = false 
)

do a hittest on the view at coordinates x,y

Parameters
xx of point to do hittest
yy of point to do hittest
layertest only if objects are on this layer or if set to wxLAYER_ALL test obejcts on all layers
optionways to hit
maskonly object with this mask set will be hit
Returns
the top object that was hit (e.g.in case of groups)
Remarks
hit margin is defined in a2dDrawing containing the root group

Definition at line 1593 of file drawer.cpp.

void a2dDrawingPart::MouseToToolWorld ( int  x,
int  y,
double &  xWorldLocal,
double &  yWorldLocal 
)

convert mouse position as seen from the display window, into world coordinates. If no display window is defined,

Definition at line 1097 of file drawer.cpp.

wxPrintout * a2dDrawingPart::OnCreatePrintout ( a2dPrintWhat  typeOfPrint,
const wxPageSetupDialogData &  pageSetupData 
)
virtual

to create a a2dDrawingPrintOut, used to print a view or its document

The a2dDrawingPrintOut created will take as much possible from the this drawing part. a2dDrawingPrintOut will create itself a view which fits the size of the paper, but important setting are taken from this view.

Definition at line 720 of file drawer.cpp.

void a2dDrawingPart::OnPropertyChanged ( const a2dPropertyId id)
virtual

This function is called after a property changed.

This is overloaded to update the view if needed.

Reimplemented from a2dObject.

Definition at line 460 of file drawer.cpp.

void a2dDrawingPart::OnUpdate ( a2dDrawingEvent event)

depending on the hint value performs specific updating on the view.

Hint is unsigned int containing flags of type

See Also
a2dCanViewUpdateFlags which actions will be executed in the right order. In principle the view its internal data ( this is mostly the buffer ) should be updated, and be made ready for redisplay on the view its DisplayWindow(). A reason for updating a view, is a change in the a2dDrawing. The document is checked for changes in idle time, and updates all views on the document at once when a change exists. First all changed areas on the view because of changes to the document, are reported by the document to the a2dDrawingPart. The a2dDrawingPart keeps an internal list of areas needing a redraw. The areas reported are found on the basis of the old and new boundingboxes of the changed objects. Next the areas in the updatelist are redrawn in the buffer of the a2dDrawingPart, and at last those areas will be blitted.

The above is done automatic, but one is free for whatever reason to add pending areas directly to the a2dDrawingPart its update arealist. Those will be updated also in idle time, along with all others areas as a result of changing objects.

Remarks
OnUpdate is the key routine to speedy redraws, proper use asures only redraw of changed or damaged areas in idle time.
Called in a2dDrawing from UpdateAllViews() and AddPendingUpdatesOldNew() to update this view.
a2dCANVIEW_UPDATE_BLIT means, blit all updated areas for this a2dCanvas now to the screen, else it will happen in idle time. Use a2dCANVIEW_UPDATE_OLDNEW |a2dCANVIEW_UPDATE_BLIT | a2dCANVIEW_UPDATE_BLIT to support dragging for instance, because in such cases idle time will take to long. Other a2dCanvas using the same a2dDrawing will not be redrawn and blitted when double buffered.

Definition at line 1753 of file drawer.cpp.

void a2dDrawingPart::PaintBackground ( int  x,
int  y,
int  width,
int  height 
)
virtual

(re)painting of background

override this function in a derived class to redefine painting of the background

Definition at line 3312 of file drawer.cpp.

void a2dDrawingPart::PaintGrid ( int  x,
int  y,
int  width,
int  height 
)
virtual

Function to draw the grid.

override this function in a derived class to redefine painting of the grid

Definition at line 3217 of file drawer.cpp.

bool a2dDrawingPart::ProcessCanvasObjectEvent ( wxEvent &  event,
bool &  isHit,
double  x,
double  y,
int  margin,
int  layer = wxLAYER_ALL 
)
virtual

Corridor and captured object event processing.

Follow corridor set, and redirect the event to last object in the corridor. The event is first sent to the child objects, and if not processed there, testing for a hit on the object itself is done, and if true wxEvtHandler::ProcessEvent is called.

Parameters
eventthe event to process
isHitreturn if there was a hit on an object
xx of point to do hittest
yy of point to do hittest
marginmargin that still gives a valid hittest.
layeronly if object is on this layer or if set to wxLAYER_ALL ignore layer id.
Returns
true if Object (or a child ) did process the event and did not call event.Skip()

Definition at line 1304 of file drawer.cpp.

bool a2dDrawingPart::ProcessCanvasObjectEvent ( a2dCanvasObjectEvent event,
bool &  isHit,
double  x,
double  y,
int  margin,
int  layer = wxLAYER_ALL 
)
virtual

Corridor and captured object event processing.

This is the same as the function ProcessCanvasObjectEvent( wxEvent& event, bool& isHit, double x, double y, int margin, int layer = wxLAYER_ALL ), but it sets the iteration context pointer of the event. This is used when sending a2dCanvasObjectEvents from a simple (handle less) tool.

Parameters
eventthe event to process
isHitreturn if there was a hit on an object
xx of point to do hittest
yy of point to do hittest
marginmargin that still gives a valid hittest.
layeronly if object is on this layer or if set to wxLAYER_ALL ignore layer id.
Returns
true if Object (or a child ) did process the event and did not call event.Skip()

Definition at line 1491 of file drawer.cpp.

bool a2dDrawingPart::ProcessEvent ( wxEvent &  event)
virtual

Special event handling for a2dDrawingPart class.

If eventprocessing is enabled and the view is enabled. OR in case this event ( wxEVT_ENABLE_VIEW | wxEVT_ENABLE_VIEWS ) is to enable this a2dView, the event is processed.

wxEVT_IDLE is first processed by the view, and next by the m_toolcontroller is set. wxEVT_PAINT is first processed by the m_display if set, next by the view, and next by the m_toolcontroller is set. This garantees proper redrawing of tools on top of the window.

Next to this check the command processor for its current parent object, and sent a command to set it right if change is needed.

Reimplemented from a2dObject.

Definition at line 803 of file drawer.cpp.

void a2dDrawingPart::RenderTopObject ( wxUint32  documentDrawStyle,
wxUint8  id 
)
virtual

does render the top object in the given style.

This function can be used from tools to render the tool its objects which do become part of the document in a certain style.

Definition at line 2306 of file drawer.cpp.

void a2dDrawingPart::RenderTopObject ( a2dCanvasObjectFlagsMask  mask,
a2dDocumentRenderStyle  drawstyle 
)
virtual

single drawstyle render cycle called on document

Render the given topobject and all that is below it Will recursive call the render routines of all the objects seen from the topobject. This rendering iterates over layers.

Parameters
maskobject must have this mask
drawstylewhich drawstyle should be used for this render action .
Remarks
If a layer is Invisible it will not be rendered.

Definition at line 2547 of file drawer.cpp.

void a2dDrawingPart::Scroll ( int  dxy,
bool  yscroll,
bool  total 
)
virtual

scroll up down or left right

Parameters
dxyscroll distance in X or Y
yscrollif true scrolling is in Y else X
totalupdate whole device after scroll

Definition at line 3398 of file drawer.cpp.

void a2dDrawingPart::Set_UpdateAvailableLayers ( bool  value)
inline

Sets a flag for updating available layers checking, which makes sure layers will be checked first when needed.

Eventually results in updating the layers table settings on layers available in drawing before rendering starts or simular functions.

Definition at line 583 of file drawer.h.

bool a2dDrawingPart::SetCanvasToolContr ( a2dToolContr controller)

set toolcontroller ( reset with NULL )

Toolcontrollers are meant to implement tools that manipulate the objects

displayed on the a2dCanvas. All events to the canvas window or first redirected to the controller. When skipped in the controller the events will eventually reach the a2dCanvas itself.

Returns
true is there was a controller set already.
Remarks
The controller is owned by the canvas and will be deleted by the canvas on destruction or when changed.

Definition at line 785 of file drawer.cpp.

void a2dDrawingPart::SetCaptured ( a2dCanvasObject captured)
inline

set the object that is captured for events in the a2dDrawing.

Used in combination with the a2dIterC class to set a corridor path for events. Do not use this function directly from outside a2dCorridor or a2diterC

Definition at line 638 of file drawer.h.

void a2dDrawingPart::SetCorridorPath ( const a2dCorridor corridor)

find object on the current corridor path.

The a2dCanvasObject in the document with the m_flags.m_isOnCorridorPath set, are pushed into a list, which is returned. If non found the return is false, else true and the list of objects leading to the end of the corridor.set a corridor from a list of objects

Definition at line 1534 of file drawer.cpp.

void a2dDrawingPart::SetDocumentDrawStyle ( wxUint32  drawstyle)

set drawstyles to use for drawing the document

The internal m_drawer2D is set to this style before rendering of the document starts.

Remarks
m_drawstyleRestore is set to the current drawstyle. So a temporary change can easily be restored.
Parameters
drawstyleone of the draw styles

Definition at line 1016 of file drawer.cpp.

void a2dDrawingPart::SetDrawer2D ( a2dDrawer2D drawer2d,
bool  noDelete = false 
)

set the internal m_drawer2D to be used for rendering the document

The drawing context is owned by a2dDrawingPart, it will delete it. Still you set it to NULL or othere context without deletion using the noDelete parameter.

Parameters
drawer2dthe drawing context object to set
noDeletedefault the old drawing context object is deleted, but not is this is set true. This can be used to simulate ownership of the drawing context by another class.

Definition at line 765 of file drawer.cpp.

void a2dDrawingPart::SetEndCorridorObject ( a2dCanvasObject endCorridorObject)

use in combination with the a2dIterC class to set a corridor path for events.

A corridor path leads event to a specific a2dCanvasObject in a a2dDrawing. This feature is used to do editing of nested a2dCanvasObject 's, and to captures events to such objects. The a2dCanvasObject's on a corridor path get the m_flags.m_isOnCorridorPath set, which result in redirecting events to the m_endCorridorObject.

Definition at line 1041 of file drawer.cpp.

void a2dDrawingPart::SetGridLines ( bool  gridlines)
inline

Get grid setting for line drawing.

Note: SetGridSize must be 0, if gridlines=false

Definition at line 912 of file drawer.h.

void a2dDrawingPart::SetGridThreshold ( wxUint16  gridthres)
inline

Set grid threshold, if grid distance is below this in pixels, it will be increased by factors of 2 until it fits.

Definition at line 919 of file drawer.h.

void a2dDrawingPart::SetHitMargin ( wxUint16  pixels)
inline

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.

Remarks
default value is 2 pixels

Definition at line 597 of file drawer.h.

void a2dDrawingPart::SetMappingShowAll ( )

use the boundingbox of the ShowObject to set the mapping such that it will be displayed completely on the device.

See Also
SetMappingDeviceRect to map to a different device/buffer rectangle.

Definition at line 3149 of file drawer.cpp.

void a2dDrawingPart::SetMouseEvents ( bool  onoff)

If not set do not process mouse events.

Mouse events are handled by the canvas. They are redirected to the a2dCanvasObject hit. You can switch this off here, and skip the event from being processed. This is often used in tools, to prevent a2dCanvasObjects from receiving events.

Remarks
most events go to the m_toolcontroller first if set.
See Also
ProcessEvent()

Definition at line 1081 of file drawer.cpp.

a2dCanvasObject * a2dDrawingPart::SetShowObject ( const wxString &  name)

set object available in the a2dDrawing to be shown on the drawer

Parameters
namename of top object
Returns
pointer to the object found else NULL

end of updating routines

Definition at line 2947 of file drawer.cpp.

bool a2dDrawingPart::SetShowObject ( a2dCanvasObject obj)

set top object available in the a2dDrawing to be shown on the drawer

Parameters
obj,:pointer to object to show

Definition at line 3013 of file drawer.cpp.

void a2dDrawingPart::SetShowObjectAndRender ( a2dCanvasObject obj)

Used temporarely in rendering bitmas or in printing, to Set the show object and redraw the whole part.

Notification in the form of signals and/or events is not done. Also connection to event in othere objects is not done.

Definition at line 3069 of file drawer.cpp.

void a2dDrawingPart::SetViewDependentObjects ( bool  viewDependentObjects)
inline

if set true, drawing can contain objects that depend on this view (size etc).

If set those objects will be automatically updated for this view. Else the drawing is assumed to not contain viewdependent objects for this view, and that update cycle is skipped.

Definition at line 558 of file drawer.h.

void a2dDrawingPart::Thaw ( bool  update)

to release Freeze()

The Frozen view ( Freeze() ), is released. Pending update araes in the update list will be redrawn in OnIdle at the next idle event.

See Also
Freeze
Parameters
updateif true all shown on this view will be redrawn.

Definition at line 1031 of file drawer.cpp.

void a2dDrawingPart::ToolWorldToMouse ( double  xWorld,
double  yWorld,
int &  x,
int &  y 
)

get mouse position as seen from the display window, in world coordinates. If no display window is defined,

Definition at line 1114 of file drawer.cpp.

void a2dDrawingPart::Update ( unsigned int  how = a2dCANVIEW_UPDATE_ALL | a2dCANVIEW_UPDATE_BLIT ),
wxObject *  hintObject = NULL 
)

see OnUpdate

by default adds a full pending update for the drawer and all in it, and redraws this to the device. Use how = a2dCANVIEW_UPDATE_ALL when the contents/data of the canvas has changed without specific updates applied to areas. This will do the redraw in idle time. For example: after adding many new objects to the root object or other objects referenced or after changing the root object

Remarks
the default value is brute force redraw all, but in general not wise to use since it means a total redraw. instead most often a2dCANVIEW_UPDATE_OLDNEW is used, or if result needs to be displayed directly, use ( a2dCANVIEW_UPDATE_OLDNEW |a2dCANVIEW_UPDATE_AREAS | a2dCANVIEW_UPDATE_BLIT )

Definition at line 1744 of file drawer.cpp.

void a2dDrawingPart::UpdateArea ( int  x,
int  y,
int  width,
int  height,
wxUint8  id = 0 
)
virtual

update/redraw part of the buffer, using the given a2dDrawing and ShowObject within that root.

This method also takes care of redrawing the background and the grid

Definition at line 1999 of file drawer.cpp.

void a2dDrawingPart::UpdateViewDependentObjects ( )

update the transform matrix for objects with property 'PROPID_viewDependent'

will recursive call the UpdateViewDependentObjects routines of all the objects seen from the topobject.

Remarks
TODO: Check all child objects (TODO for optimize: with flag 'm_childpixelsize=true').

Definition at line 2288 of file drawer.cpp.

Member Data Documentation

wxUint16 a2dDrawingPart::m_hitmargin
protected

how close does a hit need to be to the object you are trying to hit.

This is given in device units (pixels) and tranformed to world units using the drawers transform

Definition at line 1419 of file drawer.h.

bool a2dDrawingPart::m_update_available_layers
protected

flag to updatelayers that are available.

It is set when m_layerRenderArray does not contain all layers used by a2dCanvasObject's

Definition at line 1455 of file drawer.h.

a2dUpdateList a2dDrawingPart::m_updateareas
protected

list of rectangles that need to be blited to the screen.

This list holds several rectangles, which should be updated. The are blitted from the buffer, since they were damaged they first need to be updated.

Definition at line 1403 of file drawer.h.

const a2dSignal a2dDrawingPart::sig_changedShowObject = wxNewId()
static

id for changed a2dObject a new show object was chosen in a2dDrawingPart

Definition at line 1513 of file drawer.h.


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