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

Contain one drawing as hierarchical tree of a2dCanvasObject's. More...

#include <drawing.h>

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

Public Member Functions

 a2dDrawing (const wxString &name=wxT(""), a2dHabitat *habitat=NULL)
 Constructor.
 
 a2dDrawing (const a2dDrawing &other, CloneOptions options, a2dRefMap *refs)
 Copy constructor.
 
a2dHabitatGetHabitat () const
 
void SetHabitat (a2dHabitat *habitat)
 
a2dDrawingTClone (CloneOptions options, a2dRefMap *refs=NULL)
 
void SetParent (a2dObject *parent)
 set parent object of the drawing ( in case there is always only one )
 
a2dObjectGetParent () const
 
void SetAvailable ()
 
void SetRootRecursive ()
 set a2dDrawing to its nested a2dCanvasObject's recursive for whole tree
 
void SetLayerSetup (a2dLayers *layersetup)
 set the layersettings for the canvas. More...
 
a2dLayersGetLayerSetup ()
 Get the layersettings for the canvas. More...
 
void SetSaveLayers (bool saveLayers)
 
void SetInitLayersGlobal (bool initLayersGlobal)
 
a2dCanvasObjectGetRootObject () const
 get the root object, which holds the objects in the document
 
void SetRootObject (a2dCanvasObject *newRoot)
 set new root object ( may not be NULL )
 
void Append (a2dCanvasObject *obj)
 
void Prepend (a2dCanvasObject *obj)
 
void SetInitialSize (double sizeX, double sizeY)
 set size for view in userunits, when still empty
 
double GetInitialSizeX ()
 get size for view in userunits, when still empty
 
double GetInitialSizeY ()
 get size for view in userunits, when still empty
 
virtual void CreateCommandProcessor ()
 create a command processor and set it for the document. More...
 
a2dCommandProcessorGetCommandProcessor () const
 Returns a pointer to the command processor associated with this document.
 
a2dCanvasCommandProcessorGetCanvasCommandProcessor ()
 get a pointer to the command processor
 
void SetCommandProcessor (a2dCommandProcessor *proc)
 Sets the command processor to be used for this document. More...
 
void SetSpecificFlags (bool setOrClear, a2dCanvasObjectFlagsMask which, const wxString &classname=wxT(""), a2dCanvasObjectFlagsMask whichobjects=a2dCanvasOFlags::ALL)
 set all bit flags in object that or true in mask to true or false More...
 
void SetUpdatesPending (bool onoff)
 Tells the document that an object has changed. More...
 
void DependencyPending ()
 call DependencyPending on root object and recursive on childs. More...
 
bool GetUpdatesPending ()
 returns true if some objects have changed recently within this document
 
void SetIgnorePendingObjects (bool onoff)
 Switches ignorance of pending objects on and off. More...
 
bool GetIgnorePendingObjects ()
 get setting of ignore pending objects /sa GetUpdatesPending()
 
virtual void DoWalker (wxObject *parent, a2dWalkerIOHandler &handler)
 also walks m_layersetup and m_rootobject.
 
void UpdateAllViews (unsigned int hint, wxObject *objecthint=NULL)
 
bool AddPendingUpdatesOldNew ()
 adds current and future boundingbox of the objects with pending flag set, to the pendinglist of all a2dCanvasView's More...
 
bool IsModified () const
 Has the document been modified.
 
void Modify (bool increment)
 set the drawing as modified or not More...
 
double GetUnitsAccuracy ()
 this is the number that defines the number of decimal places in the fraction More...
 
void SetUnitsAccuracy (double accuracy)
 this is the number that defines the number of decimal places in the fraction More...
 
double GetUnitsScale ()
 this is the number that defines the physical dimension in meters / inch/ etc. More...
 
void SetUnitsScale (double scale)
 this is the number that defines the physical dimension in meters / inch/ etc. More...
 
double GetNormalizeScale ()
 Normalize objects ( defined in coordinates -1 to 1 ranges ) will be multiplied by this factor. More...
 
void SetNormalizeScale (double scale)
 see GetNormalizeScale()
 
wxString GetUnits ()
 this string defines the unit e.g. meters / inch/ etc. More...
 
void SetUnits (const wxString &unitString)
 this string defines the unit e.g. meters / inch/ etc. More...
 
a2dDrawingId GetDrawingId ()
 set special id to differentiate drawings
 
void SetDrawingId (a2dDrawingId id)
 get special id to differentiate drawings
 
void SetMayEdit (bool mayEdit)
 if true, editing drawing is allowed
 
bool GetMayEdit () const
 if true, editing drawing is allowed
 
void SetTitle (const wxString &title)
 Sets the title for this drawing. More...
 
wxString GetTitle () const
 Returns the title for this document.
 
void SetDescription (const wxString &desc)
 Sets a description of the drawing. More...
 
wxString & GetDescription ()
 Returns the description of the document. More...
 
bool LoadFromFile (const wxString &filename, a2dIOHandlerStrIn *handler=new a2dIOHandlerCVGIn())
 load document from a file with the given filename and given parser type
 
bool SaveToFile (const wxString &filename, a2dIOHandlerStrOut *handler=new a2dIOHandlerCVGOut()) const
 save document to a file with the given name and given output writer type
 
virtual void Load (wxObject *parent, a2dIOHandlerXmlSerIn &parser)
 load object from CVG file More...
 
virtual void Save (wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dObjectList *towrite, a2dCanvasObject *start)
 
bool LinkReference (a2dObject *other)
 link a reference in the object to the given value More...
 
a2dCanvasObjectPushInto (a2dCanvasObject *parent)
 
wxDateTime & GetInternalChangedTime ()
 gives time when a change was made to the drawing More...
 
void TriggerChangedTime ()
 make the changed time Now
 
bool ProcessEvent (wxEvent &event)
 
- 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...
 
wxInt64 GetUniqueSerializationId () const
 return a unique id for this object More...
 
virtual bool AlwaysWriteSerializationId () const
 If true, always write an id. 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 void OnPropertyChanged (const a2dPropertyId *id)
 This function is called after a property changed. 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...
 

Static Public Member Functions

static void SetSaveLayersInit (bool saveLayers)
 
static void SetInitLayersGlobalInit (bool initLayersGlobal)
 

Static Public Attributes

static const a2dDrawingId sm_cameleonrefs = wxNewId()
 
static const a2dDrawingId sm_normal = wxNewId()
 
static const a2dDrawingId sm_physical = wxNewId()
 
static const a2dDrawingId sm_programming = wxNewId()
 
static const a2dDrawingId sm_appearances = wxNewId()
 
static const a2dSignal sig_layersetupChanged = wxNewId()
 layer info changed id sent around when m_layersetup is changed.
 
static const a2dSignal sig_changedLayer = wxNewId()
 when an object is removed from a layer,
 
- 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

virtual a2dObjectDoClone (CloneOptions options, a2dRefMap *refs) const
 
void OnDoEvent (a2dCommandProcessorEvent &event)
 track modification of document
 
void OnRedoEvent (a2dCommandProcessorEvent &event)
 track modification of document
 
void OnUndoEvent (a2dCommandProcessorEvent &event)
 track modification of document
 
void OnChangeDrawings (a2dDrawingEvent &event)
 
void OnAddCameleon (a2dCameleonEvent &event)
 
void DoAddPending (a2dIterC &ic)
 
void OnIdle (wxIdleEvent &event)
 Called by ProcessEvent(wxEvent& event) of document. More...
 
void OnComEvent (a2dComEvent &event)
 
virtual void DoLoad (wxObject *parent, a2dIOHandlerXmlSerIn &parser, a2dXmlSer_flag xmlparts)
 Load settings.
 
virtual void DoSave (wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts, a2dObjectList *towrite)
 Save settings.
 
- 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...
 

Protected Attributes

a2dDrawingId m_drawingId
 
a2dSmrtPtr< a2dLayersm_layersetup
 setup for layers in this document More...
 
a2dSmrtPtr< a2dCommandProcessorm_commandProcessor
 A pointer to the command processor associated with this document.
 
a2dCanvasObjectPtr m_rootObject
 
a2dCanvasObjectPtr m_saveStartObject
 
a2dObjectm_parent
 in case of a single parent, this can be set.
 
bool m_updatespending
 set by object in this a2dCanvasDocument, to tell they have changed and therefore it needs to be rerendered
 
bool m_ignorePendingObjects
 if set ignore all setting for pendingobjects
 
long m_documentModified
 
double m_initialSizeX
 for new document views what will be the size in userunits in X
 
double m_initialSizeY
 for new document views what will be the size in userunits in Y
 
double m_units_accuracy
 how many decimal places in fraction are valid
 
double m_units_scale
 scaling factor (how many "m_units_measure" is one unit)
 
double m_normalize_scale
 normalization factor to scale normalized objects.
 
wxString m_units
 unit (e.g. Meters Inch Microns etc.)
 
wxString m_units_measure
 measuring unit (e.g. Meters Inch Microns etc.)
 
wxDateTime m_changedTime
 gives time when a change was made to the drawing
 
wxDateTime m_lastCheck
 
bool m_mayEdit
 if true, editing drawing is allowed
 
bool m_saveLayers
 save layers or not
 
bool m_initLayersGlobal
 
wxString m_title
 
wxString m_description
 
a2dHabitatm_habitat
 
- 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
 

Static Protected Attributes

static bool m_saveLayersInit = true
 
static bool m_initLayersGlobalInit = true
 

Friends

class a2dSmrtPtrBase
 

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

Contain one drawing as hierarchical tree of a2dCanvasObject's.

A a2dDrawing contains a drawing and related data, such as units. A drawing start at the m_rootObject, and its children is what is seen as the top level of the drawing. The m_rootObject and its children are a2dCanvasObject's. But a a2dCanvasObject itslef can have children, therefore the drawing can be hierarchy, where children are drawn releative to their parent canvasobject.

The drawing can be displayed on a a2dDrawingPart. And any level in the drawing hierarchy can set as the start object to a2dDrawingPart. More then one a2dDrawingPart can be used at the same time, each displaying different parts and/or different levels of the a2dDrawing. Changes in the canvasobjects within the a2dDrawing are reported to the top level, and from there reported to the a2dDrawingPart's set on the drawing. The a2dDrawingPart is used on its turn by a a2dCanvas to display part of the drawing in a window. The same way a2dDrawingPart can be used to print or to draw into bitmap's.

The drawing in a2dDrawing can be on layers, the m_layersetup is used to store the colours and othere features of the layers in use. Each canvas object rendered, refers to the layer setup by an id. Layers are rendered from top to bottom, as defined by the layer order. For each layer to be rendered on a a2dDrawingPart's, the drawing is traversed, and only objects with that layer id are rendered.

A a2dDrawing does have its own a2dCommandProcessor, changes to the drawing are (can be) recorded using commands submitted to the command processor. The changes can be Undone by reverse applying the commands.

When used in combination with the wxArt2d document view framework, one a2dCanvasDocument can contain many a2dDrawing objects. One can even place drawings inside other drawings. The classes a2dCameleonInst and a2dCameleon together with related classes, are used to do this.

Definition at line 434 of file drawing.h.

Member Function Documentation

bool a2dDrawing::AddPendingUpdatesOldNew ( )

adds current and future boundingbox of the objects with pending flag set, to the pendinglist of all a2dCanvasView's

which are using this document. The areas will only be updated from the a2dCanvasView's, which are using this document in idle time. It first check's for pending object's stored in this a2dCanvasDocument. If true, it searches those object starting from the displayed showgroup in each drawer, and adds the boundingbox of the current state the object is in, to the update area list of the those a2dCanvasView's If the boundingbox of an object is not available, it will be calcualted at that moment. In Next step the new boundingboxes are calculated for the pending objects and those are also added to the pending arae list's of all a2dCanvasView's. This functions adds areas of all places where this object is rendered also when referenced. In the end, the pending flag in all objects is reset.

AddPendingUpdatesOldNew() makes sure all objects that where pending are processed.

In idle time a2dCanvasView's will only redraw the areas that are damaged because of changes to canvas objects.

Returns
if there were pendingobjects it return true

Definition at line 525 of file drawing.cpp.

void a2dDrawing::CreateCommandProcessor ( )
virtual

create a command processor and set it for the document.

If available the existing commandprocessor will be deleted. A new CommandProcessor will be created and set for the document.

Override if you need a more application specific commandhandler.

Definition at line 380 of file drawing.cpp.

void a2dDrawing::DependencyPending ( )

call DependencyPending on root object and recursive on childs.

This call is repeated until no more a2dCanvasObject were set pending.

See Also
a2dCanvasObject::DependencyPending

Definition at line 389 of file drawing.cpp.

wxString& a2dDrawing::GetDescription ( )
inline

Returns the description of the document.

See Also
SetDescription
Returns
the description

Definition at line 755 of file drawing.h.

wxDateTime& a2dDrawing::GetInternalChangedTime ( )
inline

gives time when a change was made to the drawing

Comparing this time in a different object its own update time, one can easily keep them up to date.

e.g. set in SetUpdatesPending()

Definition at line 784 of file drawing.h.

a2dLayers* a2dDrawing::GetLayerSetup ( )
inline

Get the layersettings for the canvas.

A default Layer Setting is taken from a2dCanvasGlobal.

See Also
a2dCanvasGlobal for central layers settings, used for initializing a a2dCanvasDocument

Definition at line 506 of file drawing.h.

double a2dDrawing::GetNormalizeScale ( )
inline

Normalize objects ( defined in coordinates -1 to 1 ranges ) will be multiplied by this factor.

Libraries containing object which are defined in normalized coordinates, need to be multiplied by a certain factor before they can be added to a document. This factor defines by how much that should be done. As an example a libary containing arrow objects for placing at the end of a2dEndsLine objects, will use this factor.

Definition at line 693 of file drawing.h.

a2dObject* a2dDrawing::GetParent ( void  ) const
inline

get parent object of the drawing ( in case there is always only one ) return pointer of the current parent object

Returns
: pointer to the current object that is used to Get to for instance a2dCameleon.

Definition at line 466 of file drawing.h.

wxString a2dDrawing::GetUnits ( )
inline

this string defines the unit e.g. meters / inch/ etc.

numbers used for storing length or position or always stored as doubles. The real dimension is: (anynumber) * GetUnitsScale() * GetUnits()

Remarks
the value may also be "trees" "pixels" or "people" etc.
conversion to other units is not just simply changing this string. You must Change the SetUnitsScale(double) or really scale the data itself.

Definition at line 707 of file drawing.h.

double a2dDrawing::GetUnitsAccuracy ( )
inline

this is the number that defines the number of decimal places in the fraction

when writing numbers to a file. When reading a file, this number is set to the accuracy information available in the file. 1/GetUnitsAccuracy() == 100 means 2 decimal places will be written, or the data just read is accurate to this number of decimal places.

Remarks
GetUnitsAccuracy() can also be > 1

Definition at line 661 of file drawing.h.

double a2dDrawing::GetUnitsScale ( )
inline

this is the number that defines the physical dimension in meters / inch/ etc.

numbers used for storing length or position or always stored as doubles. The real dimension is: (anynumber) * GetUnitsScale() * GetUnits()

Definition at line 676 of file drawing.h.

bool a2dDrawing::LinkReference ( a2dObject other)
virtual

link a reference in the object to the given value

This is intended for e.g. paired links as in a2dPin, where the usual a2dResolveIdInfo mechanism cannot be used.

Reimplemented from a2dObject.

Definition at line 339 of file drawing.cpp.

void a2dDrawing::Load ( wxObject *  parent,
a2dIOHandlerXmlSerIn parser 
)
virtual

load object from CVG file

Parameters
parentparent object from where this was called.
parserbasic pull parser for XML content

Reimplemented from a2dObject.

Definition at line 730 of file drawing.cpp.

void a2dDrawing::Modify ( bool  increment)

set the drawing as modified or not

If the modified status changes an ::wxEVT_CHANGEDMODIFY_DRAWING event will be send.

Parameters
incrementto decrement or increment document modified counter.

Definition at line 146 of file drawing.cpp.

void a2dDrawing::OnIdle ( wxIdleEvent &  event)
protected

Called by ProcessEvent(wxEvent& event) of document.

Event processing is called by wxView and therefore a2dCanvasView. In a a2dDocumentCommandProcessor controller application wxDocChildFrame and wxDocParentFrame redirect events to wxView and a2dDocumentCommandProcessor. In a non a2dDocumentCommandProcessor the a2dCanvas is calling ProcessEvent(wxEvent& event) of document. Onidle updates all drawers if pending updates are available

Definition at line 886 of file drawing.cpp.

void a2dDrawing::SetCommandProcessor ( a2dCommandProcessor proc)
inline

Sets the command processor to be used for this document.

Use in case you need one a2dCommandProcessor to be used for several a2dDocument's, Make sure you set it to NULL before deleting the document itself, else the a2dDocument destructor will delete it ( leaving the others with dangling pointers ).

Definition at line 562 of file drawing.h.

void a2dDrawing::SetDescription ( const wxString &  desc)
inline

Sets a description of the drawing.

A description may describe the content of this drawing or contain keywords etc. The default value is "".

Parameters
descdescription of the drawing

Definition at line 747 of file drawing.h.

void a2dDrawing::SetIgnorePendingObjects ( bool  onoff)

Switches ignorance of pending objects on and off.

If set to true pending objects won't be updated. This method is used by several tools (i.e. a2dDragTool) to avoid updates while the tool is working.

See Also
GetUpdatesPending()
Parameters
onofftrue to ignore pending objects, else false

Definition at line 432 of file drawing.cpp.

void a2dDrawing::SetLayerSetup ( a2dLayers layersetup)

set the layersettings for the canvas.

A default Layer Setting is created in the constructor a2dCanvasDocument::a2dCanvasDocument

An example how to set another layer setup

// Clone the current layer setup
a2dLayers* docLayers = doc->GetLayerSetup()->Clone( bool deep = true );
// Create a new layer with an index above the predefined layers
a2dLayerInfo* lr = new a2dLayerInfo(wxLAYER_USER_FIRST, "MyLayer");
// Set layer available
lr->Set_Available(true);
// Add layer to to the a2dLayers
docLayers->Append(lr);
doc->SetLayerSetup(docLayers);
Remarks
You don't have to call Set_UpdateAvailableLayers it will be done automatically
Parameters
layersetupthe new layersetup

Definition at line 280 of file drawing.cpp.

void a2dDrawing::SetSaveLayers ( bool  saveLayers)
inline

Set if layers will be save to CVG or not. If layers are shared with other drawing or not, savcing of layers in drawing can de disabled here.

Definition at line 511 of file drawing.h.

void a2dDrawing::SetSpecificFlags ( bool  setOrClear,
a2dCanvasObjectFlagsMask  which,
const wxString &  classname = wxT( "" ),
a2dCanvasObjectFlagsMask  whichobjects = a2dCanvasOFlags::ALL 
)

set all bit flags in object that or true in mask to true or false

set specific flags to true or false, also recursive for children objects

Remarks
the object is not setpending when soemthing changed ( actually the pending flag can be set here also )
Parameters
setOrClearif true sets the flag to true else to false
whichset only those flags in object to true or false
classnameif not empty, object must have this classname
whichobjectsset flags only for object having this flags set already

Definition at line 907 of file drawing.cpp.

void a2dDrawing::SetTitle ( const wxString &  title)

Sets the title for this drawing.

Parameters
titleThe title of the drawing.
void a2dDrawing::SetUnits ( const wxString &  unitString)
inline

this string defines the unit e.g. meters / inch/ etc.

numbers used for storing length or position or always stored as doubles. The real dimension is: (anynumber) * GetUnitsScale() * GetUnits()

Remarks
the value may also be "trees" "pixels" or "people" etc.
conversion to other units is not just simply changing this string. You must Change the SetUnitsScale(double) or really scale the data itself.

Definition at line 718 of file drawing.h.

void a2dDrawing::SetUnitsAccuracy ( double  accuracy)
inline

this is the number that defines the number of decimal places in the fraction

when writing numbers to a file. When reading a file, this number is set to the accuracy information available in the file. 1/GetAccuracyUserUnits() == 100 means 2 decimal places will be written, or the data just read is accurate to this number of decimal places.

Remarks
SetUnitsAccuracy() can also be > 1

Definition at line 670 of file drawing.h.

void a2dDrawing::SetUnitsScale ( double  scale)
inline

this is the number that defines the physical dimension in meters / inch/ etc.

numbers used for storing length or position or always stored as doubles. The real dimension is: (anynumber) * GetUnitsScale() * GetUnits()

Definition at line 683 of file drawing.h.

void a2dDrawing::SetUpdatesPending ( bool  onoff)

Tells the document that an object has changed.

If an object has changed and and needs an update, this method informes the document about this. The update of pending objects will be proceed in Idle time.

Definition at line 405 of file drawing.cpp.

Member Data Documentation

a2dSmrtPtr<a2dLayers> a2dDrawing::m_layersetup
protected

setup for layers in this document

Remarks
will contain if a layer is available/visible for rendering
object without style will take the layer style to draw itself.

Definition at line 836 of file drawing.h.


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