App::DocumentObjectGroup Class Reference

#include <DocumentObjectGroup.h>

Inheritance diagram for App::DocumentObjectGroup:
App::DocumentObject App::PropertyContainer Base::Persistence Base::BaseClass Drawing::FeaturePage Drawing::PageGroup Inspection::Group Raytracing::RayProject

List of all members.

Public Member Functions

 DocumentObjectGroup (void)
 Constructor.
virtual PyObjectgetPyObject (void)
 This method returns the Python wrapper for a C++ object.
virtual const char * getViewProviderName (void) const
 returns the type name of the ViewProvider
virtual ~DocumentObjectGroup ()

Public Attributes

PropertyLinkList Group
 Properties.

Object handling



void addObject (DocumentObject *obj)
DocumentObjectaddObject (const char *sType, const char *pObjectName)
 Adds an object of sType with pObjectName to the document this group belongs to and append it to this group as well.
int countObjectsOfType (const Base::Type &typeId) const
 Returns the number of objects of typeId this group does have.
DocumentObjectgetObject (const char *Name) const
 Returns the object of this group with Name.
std::vector< DocumentObject * > getObjects () const
 Returns a list of all objects this group does have.
std::vector< DocumentObject * > getObjectsOfType (const Base::Type &typeId) const
 Returns a list of all objects of typeId this group does have.
bool hasObject (DocumentObject *obj) const
 Checks whether the object obj is part of this group.
bool isChildOf (DocumentObjectGroup *) const
 Checks whether this group object is a child (or sub-child) of the given group object.
void removeObject (DocumentObject *obj)
 Removes an object from this group.
void removeObjectsFromDocument ()
 Removes all children objects from this group and the document.
static DocumentObjectGroupgetGroupOfObject (DocumentObject *obj)
 Returns the object group of the document which the given object obj is part of.

Detailed Description

Definition at line 37 of file DocumentObjectGroup.h.


Constructor & Destructor Documentation

DocumentObjectGroup::DocumentObjectGroup ( void   ) 

Constructor.

Definition at line 38 of file DocumentObjectGroup.cpp.

References ADD_PROPERTY_TYPE, App::Prop_Output, and App::Prop_ReadOnly.

DocumentObjectGroup::~DocumentObjectGroup (  )  [virtual]

Definition at line 43 of file DocumentObjectGroup.cpp.


Member Function Documentation

void DocumentObjectGroup::addObject ( DocumentObject obj  ) 
DocumentObject * DocumentObjectGroup::addObject ( const char *  sType,
const char *  pObjectName 
)

Adds an object of sType with pObjectName to the document this group belongs to and append it to this group as well.

Definition at line 47 of file DocumentObjectGroup.cpp.

References App::Document::addObject(), and App::DocumentObject::getDocument().

Referenced by App::DocumentObjectGroupPy::addObject(), App::DocumentObjectGroupPy::newObject(), and MeshGui::Annotation::show().

int DocumentObjectGroup::countObjectsOfType ( const Base::Type typeId  )  const

Returns the number of objects of typeId this group does have.

Definition at line 148 of file DocumentObjectGroup.cpp.

References App::PropertyLinkList::getValues(), Group, and Py::type().

DocumentObjectGroup * DocumentObjectGroup::getGroupOfObject ( DocumentObject obj  )  [static]

Returns the object group of the document which the given object obj is part of.

In case this object is not part of a group 0 is returned.

Definition at line 160 of file DocumentObjectGroup.cpp.

References App::PropertyContainer::getClassTypeId(), App::DocumentObject::getDocument(), App::Document::getObjectsOfType(), and hasObject().

Referenced by CmdMeshVertexCurvature::activated(), and Gui::TreeWidget::dropEvent().

DocumentObject * DocumentObjectGroup::getObject ( const char *  Name  )  const

Returns the object of this group with Name.

If the group doesn't have such an object 0 is returned.

Note:
This method might return 0 even if the document this group belongs to contains an object with this name.

Definition at line 97 of file DocumentObjectGroup.cpp.

References App::DocumentObject::getDocument(), App::Document::getObject(), and hasObject().

Referenced by App::DocumentObjectGroupPy::getObject().

std::vector< DocumentObject * > DocumentObjectGroup::getObjects (  )  const

Returns a list of all objects this group does have.

Definition at line 131 of file DocumentObjectGroup.cpp.

References App::PropertyLinkList::getValues(), and Group.

Referenced by Gui::ViewProviderDocumentObjectGroup::getViewProviders().

std::vector< DocumentObject * > DocumentObjectGroup::getObjectsOfType ( const Base::Type typeId  )  const

Returns a list of all objects of typeId this group does have.

Definition at line 136 of file DocumentObjectGroup.cpp.

References App::PropertyLinkList::getValues(), Group, and Py::type().

PyObject * DocumentObjectGroup::getPyObject ( void   )  [virtual]

This method returns the Python wrapper for a C++ object.

It's in the responsibility of the programmer to do the correct reference counting. Basically there are two ways how to implement that: Either always return a new Python object then reference counting is not a matter or return always the same Python object then the reference counter must be incremented by one. However, it's absolutely forbidden to return always the same Python object without incrementing the reference counter.

The default implementation returns 'None'.

Reimplemented from App::DocumentObject.

Definition at line 173 of file DocumentObjectGroup.cpp.

References Py::_None(), Py::Object::is(), Py::new_reference_to(), and App::DocumentObject::PythonObject.

virtual const char* App::DocumentObjectGroup::getViewProviderName ( void   )  const [inline, virtual]

returns the type name of the ViewProvider

Reimplemented from App::DocumentObject.

Reimplemented in Drawing::FeaturePage, Drawing::PageGroup, and Inspection::Group.

Definition at line 90 of file DocumentObjectGroup.h.

bool DocumentObjectGroup::hasObject ( DocumentObject obj  )  const

Checks whether the object obj is part of this group.

Definition at line 105 of file DocumentObjectGroup.cpp.

References App::PropertyLinkList::getValues(), and Group.

Referenced by addObject(), getGroupOfObject(), and getObject().

bool DocumentObjectGroup::isChildOf ( DocumentObjectGroup group  )  const

Checks whether this group object is a child (or sub-child) of the given group object.

Definition at line 116 of file DocumentObjectGroup.cpp.

References App::PropertyContainer::getClassTypeId(), App::PropertyLinkList::getValues(), and Group.

Referenced by App::DocumentObjectGroupPy::addObject().

void DocumentObjectGroup::removeObject ( DocumentObject obj  ) 

Removes an object from this group.

Definition at line 63 of file DocumentObjectGroup.cpp.

References App::PropertyLinkList::getValues(), Group, and App::PropertyLinkList::setValues().

Referenced by App::DocumentObjectGroupPy::removeObject().

void DocumentObjectGroup::removeObjectsFromDocument (  ) 

Removes all children objects from this group and the document.

Definition at line 75 of file DocumentObjectGroup.cpp.

References App::PropertyLinkList::getValues(), and Group.

Referenced by App::DocumentObjectGroupPy::removeObjectsFromDocument().


Member Data Documentation


The documentation for this class was generated from the following files:

Generated on Wed Nov 23 19:01:43 2011 for FreeCAD by  doxygen 1.6.1