FreeCAD C++
List of all members
Mesh::PropertyMeshKernel Class Reference

#include <Mod/Mesh/App/MeshProperties.h>

Detailed Description

The mesh kernel property class.

Author
Werner Mayer

Public Member Functions

Getter/setter
void setValuePtr (MeshObject *m)
 
void setValue (const MeshObject &m)
 
void setValue (const MeshCore::MeshKernel &m)
 
void swapMesh (MeshObject &)
 
void swapMesh (MeshCore::MeshKernel &)
 
const MeshObjectgetValue (void) const
 
const MeshObjectgetValuePtr (void) const
 
virtual unsigned int getMemSize (void) const
 
Getting basic geometric entities
const Data::ComplexGeoDatagetComplexData () const
 
Base::BoundBox3d getBoundingBox () const
 
Modification
MeshObjectstartEditing ()
 
void finishEditing ()
 
void transformGeometry (const Base::Matrix4D &rclMat)
 Transform the real mesh data.
 
void setPointIndices (const std::vector< std::pair< unsigned long, Base::Vector3f > > &)
 
Python interface
PyObject * getPyObject (void)
 
void setPyObject (PyObject *value)
 
Save/restore
void Save (Base::Writer &writer) const
 
void Restore (Base::XMLReader &reader)
 
void SaveDocFile (Base::Writer &writer) const
 
void RestoreDocFile (Base::Reader &reader)
 
App::PropertyCopy (void) const
 
void Paste (const App::Property &from)
 
Modification
Getting basic geometric entities
Modification
- Public Member Functions inherited from App::Property
const char * getName (void) const
 get the name of this property in the belonging container
 
short getType (void) const
 Get the type of the property in the container.
 
const char * getGroup (void) const
 Get the group of this property.
 
const char * getDocumentation (void) const
 Get the documentation of this property.
 
void setContainer (PropertyContainer *Father)
 Is called by the framework to set the father (container)
 
PropertyContainergetContainer (void) const
 Get a pointer to the PropertyContainer derived class the property belongs to.
 
virtual void setPathValue (const App::ObjectIdentifier &path, const boost::any &value)
 Set value of property.
 
virtual const boost::any getPathValue (const App::ObjectIdentifier &path) const
 Get value of property.
 
virtual const App::ObjectIdentifier canonicalPath (const App::ObjectIdentifier &p) const
 Convert p to a canonical representation of it.
 
virtual void getPaths (std::vector< App::ObjectIdentifier > &paths) const
 Get valid paths for this property; used by auto completer.
 
void touch ()
 Set the property touched. More...
 
bool isTouched (void) const
 Test if this property is touched.
 
void purgeTouched (void)
 Reset this property touched.
 
unsigned long getStatus () const
 return the status bits
 
void setReadOnly (bool readOnly)
 Sets property editable/grayed out in property editor.
 
void setSinglePrecision (bool single)
 
bool isSinglePrecision () const
 Gets precision of properties using floating point numbers.
 
- Public Member Functions inherited from Base::BaseClass
 BaseClass ()
 Construction.
 
virtual ~BaseClass ()
 Destruction.
 

Additional Inherited Members

- Static Public Member Functions inherited from Base::Persistence
static std::string encodeAttribute (const std::string &)
 Encodes an attribute upon saving.
 
- Protected Member Functions inherited from App::Property
void hasSetValue (void)
 Gets called by all setValue() methods after the value has changed.
 
void aboutToSetValue (void)
 Gets called by all setValue() methods before the value has changed.
 
virtual void verifyPath (const App::ObjectIdentifier &p) const
 Verify a path for the current property.
 
- Protected Attributes inherited from App::Property
std::bitset< 32 > StatusBits
 

Member Function Documentation

◆ getBoundingBox()

Base::BoundBox3d Mesh::PropertyMeshKernel::getBoundingBox ( ) const
virtual

Returns the bounding box around the underlying mesh kernel

Implements App::PropertyComplexGeoData.

◆ getPyObject()

PyObject* Mesh::PropertyMeshKernel::getPyObject ( void  )
virtual

Returns a Python wrapper for the referenced mesh object. It does NOT create a copy. However, the Python wrapper is marked as immutable so that the mesh object cannot be modified from outside.

Reimplemented from Base::BaseClass.

◆ getValue()

const MeshObject& Mesh::PropertyMeshKernel::getValue ( void  ) const

Returns a the attached mesh object by reference. It cannot be modified from outside.

◆ setPyObject()

void Mesh::PropertyMeshKernel::setPyObject ( PyObject *  value)
virtual

This method copies the content, hence creates an new mesh object to copy the data. The passed argument can be an instance of the Python wrapper for the mesh object or simply a list of triangles, i.e. a list of lists of three floats.

Reimplemented from Base::BaseClass.

◆ setValue() [1/2]

void Mesh::PropertyMeshKernel::setValue ( const MeshObject m)

This method sets the mesh by copying the data.

◆ setValue() [2/2]

void Mesh::PropertyMeshKernel::setValue ( const MeshCore::MeshKernel m)

This method sets the mesh by copying the data.

◆ setValuePtr()

void Mesh::PropertyMeshKernel::setValuePtr ( MeshObject m)

This method references the passed mesh object and takes possession of it, it does NOT create a copy. The currently referenced mesh object gets de-referenced and possibly deleted if its reference counter becomes zero. However, the mesh gets saved before if a transaction is open at this time.

Note
Make sure not to reference the internal mesh pointer pf this class in client code. This could lead to crashes if not handled properly.

◆ swapMesh() [1/2]

void Mesh::PropertyMeshKernel::swapMesh ( MeshObject )

Swaps the mesh data structure.

◆ swapMesh() [2/2]

void Mesh::PropertyMeshKernel::swapMesh ( MeshCore::MeshKernel )

Swaps the mesh data structure.