wxArt2D
Public Member Functions | List of all members
a2dCanvasObjectList Class Reference
Inheritance diagram for a2dCanvasObjectList:
Inheritance graph
[legend]
Collaboration diagram for a2dCanvasObjectList:
Collaboration graph
[legend]

Public Member Functions

a2dCanvasObjectListoperator= (const a2dCanvasObjectList &other)
 this only copies pointer stored in the list. More...
 
a2dCanvasObjectListClone (a2dObject::CloneOptions options) const
 Clone everything ( Clones objects also) in a new created list.
 
a2dCanvasObjectListClone (a2dCanvasObjectFlagsMask mask=a2dCanvasOFlags::ALL, a2dObject::CloneOptions options=a2dObject::clone_deep, a2dlist< long > *objectsIndex=NULL, const a2dBoundingBox &bbox=wxNonValidBbox) const
 clone to new list only objects with certain mask More...
 
a2dCanvasObjectListCloneChecked (a2dObject::CloneOptions options=a2dObject::clone_deep, a2dlist< long > *objectsIndex=NULL) const
 clone to new list only objects with check flag set More...
 
void SortXY ()
 sort in X and is same also Y
 
void SortXRevY ()
 sort in X and is same also in reverse Y
 
void SortYX ()
 sort in Y and is same also X
 
void SortYRevX ()
 sort in Y and is same also in reverse X
 
void MakeUnique ()
 all with reference count > 1 are cloned.
 
bool SetSpecificFlags (bool setOrClear, a2dCanvasObjectFlagsMask which, const wxString &classname=wxT(""), a2dCanvasObjectFlagsMask whichobjects=a2dCanvasOFlags::ALL, const a2dBoundingBox &bbox=wxNonValidBbox, const a2dAffineMatrix &tworld=a2dIDENTITY_MATRIX)
 set all given bit flags at once recursive for all objects in given boundingbox
 
bool ChangeLayer (wxUint16 layer, a2dCanvasObjectFlagsMask mask=a2dCanvasOFlags::ALL)
 move only in this group objects with the given mask to the layer given
 
a2dBoundingBox GetBBox (a2dCanvasObjectFlagsMask mask=a2dCanvasOFlags::ALL)
 
int BringToTop (a2dCanvasObjectFlagsMask mask=a2dCanvasOFlags::ALL, bool check=false)
 move only in this group objects with the given mask to the back of the list drawn last More...
 
int BringToBack (a2dCanvasObjectFlagsMask mask=a2dCanvasOFlags::ALL, bool check=false)
 move only in this group objects with the given mask to the front of the list drawn first More...
 
int Release (a2dCanvasObjectFlagsMask mask=a2dCanvasOFlags::ALL, const wxString &classname=wxT(""), const a2dPropertyId *id=NULL, const wxString &name=wxT(""), bool now=true)
 release only objects with the given mask and classname and has property named propertyname and object name More...
 
int Release (a2dCanvasObject *object, bool backwards=false, bool all=true, bool now=true, const a2dPropertyId *id=NULL)
 release a specific object More...
 
int Copy (double x, double y, a2dCanvasObjectFlagsMask mask=a2dCanvasOFlags::ALL, long target=-1, bool check=false)
 copy only in this group object with the same mask More...
 
int Move (double x, double y, a2dCanvasObjectFlagsMask mask=a2dCanvasOFlags::ALL, long target=-1, bool check=false)
 move only in this group object with the same mask More...
 
a2dCanvasObjectFind (a2dCanvasObject *obj) const
 return the object if it is part of the list More...
 
a2dCanvasObjectFind (const wxString &objectname, const wxString &classname=wxT(""), a2dCanvasObjectFlagsMask mask=a2dCanvasOFlags::ALL, const a2dPropertyId *propid=NULL, const wxString &valueAsString=wxT(""), wxUint32 id=0) const
 return the object which fits the filter. More...
 
bool SwitchObjectNamed (const wxString &objectname, a2dCanvasObject *newobject)
 If object with the given name is found, it is switched to newobject. More...
 
void Transform (const a2dAffineMatrix &tworld, const wxString &type=wxT(""), a2dCanvasObjectFlagsMask mask=a2dCanvasOFlags::ALL, const a2dPropertyId *id=NULL)
 Transform objects fitting the given filter. More...
 
void SetTransform (const a2dAffineMatrix &tworld, const wxString &type=wxT(""), a2dCanvasObjectFlagsMask mask=a2dCanvasOFlags::ALL, const a2dPropertyId *id=NULL)
 Transform objects fitting the given filter. More...
 
int TakeOverTo (a2dCanvasObjectList *total, const wxString &type=wxT(""), a2dCanvasObjectFlagsMask mask=a2dCanvasOFlags::ALL, const a2dPropertyId *id=NULL)
 Move objects fitting the given filter to the total list. More...
 
int TakeOverFrom (a2dCanvasObjectList *total, const wxString &type=wxT(""), a2dCanvasObjectFlagsMask mask=a2dCanvasOFlags::ALL, const a2dPropertyId *id=NULL)
 Move objects fitting the given filter from the total list to this list. More...
 
int CollectObjects (a2dCanvasObjectList *total, const wxString &type=wxT(""), a2dCanvasObjectFlagsMask mask=a2dCanvasOFlags::ALL, const a2dPropertyId *id=NULL, const a2dBoundingBox &bbox=wxNonValidBbox)
 Copy objects fitting the given filter to the total list. More...
 
bool SetDrawerStyle (const a2dFill &brush, const a2dStroke &stroke, a2dCanvasObjectFlagsMask mask=a2dCanvasOFlags::ALL)
 set only in this list fill and stroke of objects with the given mask
 
void AssertUnique ()
 Check if all objects are only once in the list.
 
void Insert (size_t before, a2dCanvasObject *obj, bool ignoreReleased)
 insert at index, taking into account released objects if needed.
 
- Public Member Functions inherited from a2dSmrtPtrList< a2dCanvasObject >
itSmart Find (a2dCanvasObject *object)
 Find a specific object.
 
const_itSmart Find (a2dCanvasObject *object) const
 Find a specific object.
 
int IndexOf (a2dCanvasObject *object) const
 Find the index of a specific object.
 
bool ReleaseObject (a2dCanvasObject *object)
 release a certain object from the list
 
- Public Member Functions inherited from a2dlist< a2dSmrtPtr< a2dCanvasObject > >
 a2dlist ()
 Default constructor.
 
 a2dlist (const a2dlist &other)
 Copy constructor.
 
 ~a2dlist ()
 Destructor.
 
a2dlist< a2dSmrtPtr
< a2dCanvasObject >
>::const_iterator 
item (size_t index) const
 
a2dlist< a2dSmrtPtr
< a2dCanvasObject >
>::iterator 
item (size_t index)
 
a2dlist< a2dSmrtPtr
< a2dCanvasObject >
>::reverse_iterator 
rerase (typename std::list< a2dSmrtPtr< a2dCanvasObject >, std::allocator< a2dSmrtPtr< a2dCanvasObject > > >::reverse_iterator iterr)
 
std::list< a2dSmrtPtr
< a2dCanvasObject >
, std::allocator< a2dSmrtPtr
< a2dCanvasObject >
> >::iterator 
GetPreviousAround (typename std::list< a2dSmrtPtr< a2dCanvasObject >, std::allocator< a2dSmrtPtr< a2dCanvasObject > > >::iterator iter)
 get the previous node ( –end() if no previous )
 
std::list< a2dSmrtPtr
< a2dCanvasObject >
, std::allocator< a2dSmrtPtr
< a2dCanvasObject >
> >::iterator 
GetNextAround (typename std::list< a2dSmrtPtr< a2dCanvasObject >, std::allocator< a2dSmrtPtr< a2dCanvasObject > > >::iterator iter)
 get the next node ( begin() if no next )
 

Additional Inherited Members

- Public Types inherited from a2dSmrtPtrList< a2dCanvasObject >
typedef a2dlist< a2dSmrtPtr
< a2dCanvasObject >
>::iterator 
itSmart
 
typedef a2dlist< a2dSmrtPtr
< a2dCanvasObject >
>::const_iterator 
const_itSmart
 

Detailed Description

Definition at line 60 of file objlist.h.

Member Function Documentation

int a2dCanvasObjectList::BringToBack ( a2dCanvasObjectFlagsMask  mask = a2dCanvasOFlags::ALL,
bool  check = false 
)

move only in this group objects with the given mask to the front of the list drawn first

Parameters
maskobject must have this mask.
checkif true, moved objects will have check flag set
Returns
number of moved objects

Definition at line 494 of file objlist.cpp.

int a2dCanvasObjectList::BringToTop ( a2dCanvasObjectFlagsMask  mask = a2dCanvasOFlags::ALL,
bool  check = false 
)

move only in this group objects with the given mask to the back of the list drawn last

Parameters
maskobject must have this mask.
checkif true, moved objects will have check flag set
Returns
number of moved objects

Definition at line 461 of file objlist.cpp.

a2dCanvasObjectList * a2dCanvasObjectList::Clone ( a2dCanvasObjectFlagsMask  mask = a2dCanvasOFlags::ALL,
a2dObject::CloneOptions  options = a2dObject::clone_deep,
a2dlist< long > *  objectsIndex = NULL,
const a2dBoundingBox bbox = wxNonValidBbox 
) const

clone to new list only objects with certain mask

Parameters
maskobject must have this mask.
optionsway to clone
objectsIndexlist with indexes of cloned objects
bboxonly find objects within this box.
Returns
cloned objects list

Definition at line 195 of file objlist.cpp.

a2dCanvasObjectList * a2dCanvasObjectList::CloneChecked ( a2dObject::CloneOptions  options = a2dObject::clone_deep,
a2dlist< long > *  objectsIndex = NULL 
) const

clone to new list only objects with check flag set

Parameters
optionsway to clone
objectsIndexlist with indexes of cloned objects
Returns
cloned objects list

Definition at line 238 of file objlist.cpp.

int a2dCanvasObjectList::CollectObjects ( a2dCanvasObjectList total,
const wxString &  type = wxT( "" ),
a2dCanvasObjectFlagsMask  mask = a2dCanvasOFlags::ALL,
const a2dPropertyId id = NULL,
const a2dBoundingBox bbox = wxNonValidBbox 
)

Copy objects fitting the given filter to the total list.

Parameters
totallist of object found (may already contain elements found in earlier call)
typeIf type is empty it collects all objects else only object with this class name.
maskobject must have this mask.
idif a property id is given, the object must have a property with this id
bboxonly find objects within this box.
Returns
number of objects found

Definition at line 663 of file objlist.cpp.

int a2dCanvasObjectList::Copy ( double  x,
double  y,
a2dCanvasObjectFlagsMask  mask = a2dCanvasOFlags::ALL,
long  target = -1,
bool  check = false 
)

copy only in this group object with the same mask

Parameters
xcopy object at distance x
ycopy object at distance y
maskobject must have this mask.
targetif not -1, objects will be copied to this layer
checkif true, copied objects will have check flag set
Returns
number of copied objects

Definition at line 406 of file objlist.cpp.

a2dCanvasObject * a2dCanvasObjectList::Find ( a2dCanvasObject obj) const

return the object if it is part of the list

Parameters
objobject to search for

Definition at line 553 of file objlist.cpp.

a2dCanvasObject * a2dCanvasObjectList::Find ( const wxString &  objectname,
const wxString &  classname = wxT( "" ),
a2dCanvasObjectFlagsMask  mask = a2dCanvasOFlags::ALL,
const a2dPropertyId propid = NULL,
const wxString &  valueAsString = wxT( "" ),
wxUint32  id = 0 
) const

return the object which fits the filter.

Parameters
objectnameobject with this name to search for
classnameIf classname is empty it collects all objects else only object with this class name.
maskobject must have this mask.
propidif a property id is given, the object must have a property with this id
valueAsStringStringValueRepresentation of the property that is required (if not empty).
idGetUniqueSerializationId() should be this unless 0

Definition at line 567 of file objlist.cpp.

int a2dCanvasObjectList::Move ( double  x,
double  y,
a2dCanvasObjectFlagsMask  mask = a2dCanvasOFlags::ALL,
long  target = -1,
bool  check = false 
)

move only in this group object with the same mask

Parameters
xmove object distance x
ymove object distance y
maskobject must have this mask.
targetif not -1, objects will be copied to this layer
checkif true, moved objects will have check flag set
Returns
number of moved objects

Definition at line 438 of file objlist.cpp.

a2dCanvasObjectList & a2dCanvasObjectList::operator= ( const a2dCanvasObjectList other)

this only copies pointer stored in the list.

if you want the object itself copied also, use Clone

Definition at line 157 of file objlist.cpp.

int a2dCanvasObjectList::Release ( a2dCanvasObjectFlagsMask  mask = a2dCanvasOFlags::ALL,
const wxString &  classname = wxT( "" ),
const a2dPropertyId id = NULL,
const wxString &  name = wxT( "" ),
bool  now = true 
)

release only objects with the given mask and classname and has property named propertyname and object name

Parameters
maskobject must have this mask.
classnameif set, this classname is required
idis object contains this property, it will be released. If NULL, this parameter is ignored.
nameif set, this name is required for the objects
nowif true remove all references to object right now, else only set its delete flag for delete in update cycle. empty string means ignore.

Definition at line 306 of file objlist.cpp.

int a2dCanvasObjectList::Release ( a2dCanvasObject object,
bool  backwards = false,
bool  all = true,
bool  now = true,
const a2dPropertyId id = NULL 
)

release a specific object

Parameters
objectobject to release
backwardsstart at the end
allif true remove all references to object
nowif true remove all references to object right now, else only set its delete flag for delete in update cycle.
idis object contains this property, it will be released. If NULL, this parameter is ignored.
Returns
number of released objects

Definition at line 339 of file objlist.cpp.

void a2dCanvasObjectList::SetTransform ( const a2dAffineMatrix tworld,
const wxString &  type = wxT( "" ),
a2dCanvasObjectFlagsMask  mask = a2dCanvasOFlags::ALL,
const a2dPropertyId id = NULL 
)

Transform objects fitting the given filter.

Parameters
tworldtransform matrix to be set as the new transform for the objects
typeIf type is empty it collects all objects else only object with this class name.
maskobject must have this mask.
idif a property id is given, the object must have a property with this id

Definition at line 644 of file objlist.cpp.

bool a2dCanvasObjectList::SwitchObjectNamed ( const wxString &  objectname,
a2dCanvasObject newobject 
)

If object with the given name is found, it is switched to newobject.

The old object will be released. The new object will be owned.

Returns
true is object was found.

Definition at line 588 of file objlist.cpp.

int a2dCanvasObjectList::TakeOverFrom ( a2dCanvasObjectList total,
const wxString &  type = wxT( "" ),
a2dCanvasObjectFlagsMask  mask = a2dCanvasOFlags::ALL,
const a2dPropertyId id = NULL 
)

Move objects fitting the given filter from the total list to this list.

Parameters
totallist of object found (may already contain elements found in earlier call)
typeIf type is empty it collects all objects else only object with this class name.
maskobject must have this mask.
idthe object needs to have this property set if not NULL
Returns
number of objects found

Definition at line 724 of file objlist.cpp.

int a2dCanvasObjectList::TakeOverTo ( a2dCanvasObjectList total,
const wxString &  type = wxT( "" ),
a2dCanvasObjectFlagsMask  mask = a2dCanvasOFlags::ALL,
const a2dPropertyId id = NULL 
)

Move objects fitting the given filter to the total list.

Parameters
totallist of object found (may already contain elements found in earlier call)
typeIf type is empty it collects all objects else only object with this class name.
maskobject must have this mask.
idthe object needs to have this property set if not NULL
Returns
number of objects found

Definition at line 693 of file objlist.cpp.

void a2dCanvasObjectList::Transform ( const a2dAffineMatrix tworld,
const wxString &  type = wxT( "" ),
a2dCanvasObjectFlagsMask  mask = a2dCanvasOFlags::ALL,
const a2dPropertyId id = NULL 
)

Transform objects fitting the given filter.

Parameters
tworldtransform matrix to transform the objects
typeIf type is empty it collects all objects else only object with this class name.
maskobject must have this mask.
idif a property id is given, the object must have a property with this id

Definition at line 625 of file objlist.cpp.


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