App::PropertyLink Class Reference

the general Link Poperty Main Purpose of this property is to Link Objects and Feautures in a document. More...

#include <PropertyLinks.h>

Inheritance diagram for App::PropertyLink:
App::Property Base::Persistence Base::BaseClass App::PropertyPlacementLink

List of all members.

Public Member Functions

virtual PropertyCopy (void) const
 Returns a new copy of the property (mainly for Undo/Redo and transactions).
virtual unsigned int getMemSize (void) const
 This method is used to get the size of objects It is not meant to have the exact size, it is more or less an estimation which runs fast! Is it two bytes or a GB? This method is defined in Base::Persistence.
virtual PyObjectgetPyObject (void)
 This method returns the Python wrapper for a C++ object.
virtual Base::Type getTypeId (void) const
template<typename _type >
_type getValue (void) const
 Returns the link type checked.
App::DocumentObjectgetValue (Base::Type t) const
 Returns the link type checked.
App::DocumentObjectgetValue (void) const
 This method returns the linked DocumentObject.
virtual void Paste (const Property &from)
 PropertyLink ()
 A constructor.
virtual void Restore (Base::XMLReader &reader)
 This method is used to restore properties from an XML document.
virtual void Save (Base::Writer &writer) const
 This method is used to save properties to an XML document.
virtual void setPyObject (PyObject *)
void setValue (App::DocumentObject *)
 Sets the property.
 ~PropertyLink ()
 A destructor.

Static Public Member Functions

static void * create (void)
static Base::Type getClassTypeId (void)
static void init (void)

Protected Attributes

App::DocumentObject_pcLink

Detailed Description

the general Link Poperty Main Purpose of this property is to Link Objects and Feautures in a document.

Definition at line 46 of file PropertyLinks.h.


Constructor & Destructor Documentation

PropertyLink::PropertyLink (  ) 

A constructor.

A more elaborate description of the constructor.

Definition at line 61 of file PropertyLinks.cpp.

Referenced by Copy().

PropertyLink::~PropertyLink (  ) 

A destructor.

A more elaborate description of the destructor.

Definition at line 68 of file PropertyLinks.cpp.


Member Function Documentation

Property * PropertyLink::Copy ( void   )  const [virtual]

Returns a new copy of the property (mainly for Undo/Redo and transactions).

Implements App::Property.

Reimplemented in App::PropertyPlacementLink.

Definition at line 145 of file PropertyLinks.cpp.

References _pcLink, draftTools::p, and PropertyLink().

void * App::PropertyLink::create ( void   )  [static]

Reimplemented from App::Property.

Reimplemented in App::PropertyPlacementLink.

Definition at line 55 of file PropertyLinks.cpp.

Base::Type App::PropertyLink::getClassTypeId ( void   )  [static]
virtual unsigned int App::PropertyLink::getMemSize ( void   )  const [inline, virtual]

This method is used to get the size of objects It is not meant to have the exact size, it is more or less an estimation which runs fast! Is it two bytes or a GB? This method is defined in Base::Persistence.

See also:
Base::Persistence

Reimplemented from App::Property.

Definition at line 91 of file PropertyLinks.h.

PyObject * PropertyLink::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 Base::BaseClass.

Definition at line 93 of file PropertyLinks.cpp.

References _pcLink, App::DocumentObject::getPyObject(), and Py_Return.

Base::Type App::PropertyLink::getTypeId ( void   )  const [virtual]

Reimplemented from App::Property.

Reimplemented in App::PropertyPlacementLink.

Definition at line 55 of file PropertyLinks.cpp.

Referenced by Restore().

template<typename _type >
_type App::PropertyLink::getValue ( void   )  const [inline]

Returns the link type checked.

Definition at line 78 of file PropertyLinks.h.

App::DocumentObject * PropertyLink::getValue ( Base::Type  t  )  const

Returns the link type checked.

Definition at line 88 of file PropertyLinks.cpp.

References _pcLink, App::PropertyContainer::getTypeId(), and Base::Type::isDerivedFrom().

App::DocumentObject * PropertyLink::getValue ( void   )  const

This method returns the linked DocumentObject.

Definition at line 83 of file PropertyLinks.cpp.

References _pcLink.

Referenced by App::Document::breakDependency(), Robot::TrajectoryDressUpObject::execute(), Raytracing::RayFeature::execute(), Inspection::Feature::execute(), Drawing::FeatureViewPart::execute(), PartDesign::Revolution::execute(), Part::Revolution::execute(), Drawing::FeatureProjection::execute(), PartDesign::Pocket::execute(), Part::Boolean::execute(), PartDesign::Pad::execute(), Part::Mirroring::execute(), Mesh::SetOperations::execute(), Mesh::SegmentByMesh::execute(), Mesh::Export::execute(), Mesh::RemoveComponents::execute(), Mesh::FillHoles::execute(), Mesh::FixIndices::execute(), Mesh::FixDeformations::execute(), Mesh::FixDegenerations::execute(), Mesh::FixDuplicatedPoints::execute(), Mesh::FixDuplicatedFaces::execute(), Mesh::FixNonManifolds::execute(), Mesh::FlipNormals::execute(), Mesh::HarmonizeNormals::execute(), Mesh::Curvature::execute(), Part::Fillet::execute(), Part::Extrusion::execute(), Part::Chamfer::execute(), Part::Boolean::mustExecute(), Mesh::SetOperations::mustExecute(), Mesh::SegmentByMesh::mustExecute(), Mesh::Export::mustExecute(), Mesh::Curvature::mustExecute(), PartDesignGui::ViewProviderRevolution::onDelete(), PartDesignGui::ViewProviderPocket::onDelete(), PartDesignGui::ViewProviderPad::onDelete(), PartDesignGui::TaskDlgRevolutionParameters::reject(), PartDesignGui::TaskDlgPocketParameters::reject(), PartDesignGui::TaskDlgPadParameters::reject(), PartDesignGui::TaskPadParameters::TaskPadParameters(), and RobotGui::ViewProviderRobotObject::updateData().

void App::PropertyLink::init ( void   )  [static]

Reimplemented from App::Property.

Reimplemented in App::PropertyPlacementLink.

Definition at line 55 of file PropertyLinks.cpp.

void PropertyLink::Paste ( const Property from  )  [virtual]
void PropertyLink::Restore ( Base::XMLReader  )  [virtual]

This method is used to restore properties from an XML document.

It uses the XMLReader class, which bases on SAX, to read the in Save() written information. Again the Vector as an example:

 void PropertyVector::Restore(Base::XMLReader &reader)
 {
   // read my Element
   reader.readElement("PropertyVector");
   // get the value of my Attribute
   _cVec.x = (float)reader.getAttributeAsFloat("valueX");
   _cVec.y = (float)reader.getAttributeAsFloat("valueY");
   _cVec.z = (float)reader.getAttributeAsFloat("valueZ");
 }

Implements Base::Persistence.

Definition at line 122 of file PropertyLinks.cpp.

References Base::Console(), Base::XMLReader::getAttribute(), App::PropertyContainer::getClassTypeId(), App::Property::getContainer(), getTypeId(), Base::BaseClass::isDerivedFrom(), Base::XMLReader::readElement(), setValue(), and Base::ConsoleSingleton::Warning().

void PropertyLink::Save ( Base::Writer  )  const [virtual]

This method is used to save properties to an XML document.

A good example you'll find in PropertyStandard.cpp, e.g. the vector:

  void PropertyVector::Save (Writer &writer) const
  {
     writer << writer.ind() << "<PropertyVector valueX=\"" <<  _cVec.x <<
                                            "\" valueY=\"" <<  _cVec.y <<
                                            "\" valueZ=\"" <<  _cVec.z <<"\"/>" << endl;
  }

The writer.ind() expression writes the indention, just for pretty printing of the XML. As you see, the writing of the XML document is not done with a DOM implementation because of performance reasons. Therefore the programmer has to take care that a valid XML document is written. This means closing tags and writing UTF-8.

See also:
Base::Writer

Implements Base::Persistence.

Definition at line 117 of file PropertyLinks.cpp.

References _pcLink, App::DocumentObject::getNameInDocument(), Base::Writer::ind(), and Base::Writer::Stream().

void PropertyLink::setPyObject ( PyObject value  )  [virtual]
void PropertyLink::setValue ( App::DocumentObject lValue  ) 

Sets the property.

Definition at line 76 of file PropertyLinks.cpp.

References _pcLink, App::Property::aboutToSetValue(), and App::Property::hasSetValue().

Referenced by App::Document::breakDependency(), Restore(), and setPyObject().


Member Data Documentation


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

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