Developer Documentation

Public Member Functions | Static Public Attributes | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
OMPropertyModel< MeshT > Class Template Reference
Inheritance diagram for OMPropertyModel< MeshT >:

## Public Member Functions
| OMPropertyModel (MeshT *mesh, int objectID, QObject *parent=0)
virtual void | updateWidget (const QModelIndexList &selectedIndices)
| Updates the widget.
Public Member Functions inherited from OMPropertyModelSubclass
| OMPropertyModelSubclass (QObject *parent=0)
Public Member Functions inherited from SingleObjectPropertyModel
| SingleObjectPropertyModel (QObject *parent=0)
virtual int | rowCount (const QModelIndex &parent=QModelIndex()) const
virtual QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const
virtual QVariant | headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
virtual void | objectUpdated ()
| Revisualizes visualized properties.
virtual void | visualize (QModelIndexList selectedIndices, QWidgetList widgets=QWidgetList())
| Visualizes the selected properties. More...
virtual void | removeProperty (QModelIndexList selectedIndices)
| Removes the selected properties.
virtual void | duplicateProperty (QModelIndexList selectedIndices)
| Duplicates the selected properties.
virtual void | clear (QModelIndexList selectedIndices)
| Clears the selected property visualization.
void | hideWidget ()
| Hides the widget.
QWidget * | getWidget ()
| Returns the widget.
void | connectLogs (PropertyVisualizer *propViz)
| Connects the PropertyVisualizer log signals with the log slot.
virtual PropertyInfo | getPropertyInfo (const QModelIndex index) const
| Returns the property info for the property with the given index.
virtual QScriptValue | getScriptObject (const QModelIndex index, QScriptContext *ctx)
| Returns a qscript object that can be used to access visualisation parameters.
Public Member Functions inherited from PropertyModel
| PropertyModel (QObject *parent=0)
QModelIndex | indexFromFancyPropName (const QString &propName) const
| Returns the index of the property with the given name.
QModelIndex | indexFromPlainPropName (const QString &propName) const
| Returns the index of the property with the given name.

## Static Public Attributes
static const TypeInfoWrapper | proptype_bool = TypeInfoWrapper(typeid(OpenMesh::PropertyT<bool>), "bool")
static const TypeInfoWrapper | proptype_int = TypeInfoWrapper(typeid(OpenMesh::PropertyT<int>), "int")
static const TypeInfoWrapper | proptype_uint = TypeInfoWrapper(typeid(OpenMesh::PropertyT<unsigned int>), "unsigned int")
static const TypeInfoWrapper | proptype_uint8_t = TypeInfoWrapper(typeid(OpenMesh::PropertyT<uint8_t>), "uint8_t")
static const TypeInfoWrapper | proptype_double = TypeInfoWrapper(typeid(OpenMesh::PropertyT<double>), "double")
static const TypeInfoWrapper | proptype_Vec3d = TypeInfoWrapper(typeid(OpenMesh::PropertyT<ACG::Vec3d>), "Vec3d")
static const TypeInfoWrapper | proptype_Vec3f = TypeInfoWrapper(typeid(OpenMesh::PropertyT<ACG::Vec3f>), "Vec3f")
static const TypeInfoWrapper | proptype_Vec2d = TypeInfoWrapper(typeid(OpenMesh::PropertyT<ACG::Vec2d>), "Vec2d")
static const TypeInfoWrapper | proptype_Vec2f = TypeInfoWrapper(typeid(OpenMesh::PropertyT<ACG::Vec2f>), "Vec2f")

## Protected Member Functions
virtual QString | getLoadFilenameFilter ()
| Returns the filename filter for loading.
virtual QString | getSaveFilenameFilter (unsigned int propId)
| Returns the filename filter for saving.
Protected Member Functions inherited from SingleObjectPropertyModel
PropertyVisualizer * | getPropertyVisualizer (QString propName, PropertyInfo::ENTITY_FILTER filter, TypeInfoWrapper typeInfo)
| Returns a PropertyVisualizer.
bool | isPropertyFree (QString propName, PropertyInfo::ENTITY_FILTER filter, TypeInfoWrapper typeInfo)
| Checks if the property name is still available.
QString | getLoadFilename ()
| Asks the user for a file to load.
QString | getSaveFilename (unsigned int propId)
| Asks the user for a file to load.
virtual QString | getDefaultSaveFilename (unsigned int propId)
| Returns the default file name.
void | saveProperty (unsigned int propId)
| Saves property.
void | loadProperty ()
| Loads property.

## Private Types
typedef std::set< TypeInfoWrapper > | TypeInfoWrapperSet

## Private Member Functions
virtual void | combine ()
| Combines two properties. More...
bool | combinable (PropertyVisualizer *propertyVisualizer1, PropertyVisualizer *propertyVisualizer2)
| Checks if two properties are combinable. More...
virtual void | saveProperty ()
| Saves the currently slected properties.
virtual bool | parseHeader (QString header, PropertyVisualizer *&propVis, unsigned int &n)
| Parses the property file header. More...
virtual void | setPropertyFromFile (QTextStream &file_stream, unsigned int n, PropertyVisualizer *propVis)
| Sets the property values from a given file.
void | resetPicking ()
| Disables picking.
virtual void | pickProperty ()
| Toggle picking on and off. More...
virtual void | pickModeChanged (const std::string &_mode)
| Handles changing of pick mode.
virtual void | mouseEvent (QMouseEvent *_event)
| Handles mouse events for picking. More...
bool | isVectorType (const TypeInfoWrapper &typeInfo) const
void | gatherProperties (MeshT *mesh, typename MeshT::prop_iterator props_first, typename MeshT::prop_iterator props_last, PropertyInfo::ENTITY_FILTER filter)
| Searches for properties with a specific entity type and creates visualizers.
void | gatherProperties ()
| Searches for all properties and creates the visualizers.
bool | isSupported (OpenMesh::BaseProperty *const baseProp) const
| Checks if visualizing this property is supported. More...
bool | isSupported (QString friendlyName) const
| Checks if visualizing this type of property is supported. More...
bool | isNew (OpenMesh::BaseProperty *const baseProp, PropertyInfo::ENTITY_FILTER filter)
| Checks if we already created a PropertyVisualizer for this property. More...
TypeInfoWrapper | getSupportedTypeInfoWrapper (OpenMesh::BaseProperty *const baseProp)
| Returns the TypeInfoWrapper for the property if it is supported. More...
TypeInfoWrapper | getSupportedTypeInfoWrapper (QString friendlyName)
| Returns the TypeInfoWrapper for the type of property if it is supported. More...
void | addPropertyVisualizer (OpenMesh::BaseProperty *const baseProp, MeshT *mesh, PropertyInfo::ENTITY_FILTER filter)
| Adds a new PropertyVisualizer. More...
void | addProperty (QString propName, QString friendlyTypeName, PropertyInfo::ENTITY_FILTER filter)
| Adds a new property to the mesh. More...
void | initializeSupportedPropertyTypes ()

## Private Attributes
MeshT * | mesh_
int | objectID_
QPushButton | bCombine
const PropertyInfo * | mCombineProperty1
const PropertyInfo * | mCombineProperty2
LoadSaveWidget | mLoadSaveWidget
PickWidget | mPickWidget
bool | pickModeActive
std::string | lastPickMode
Viewer::ActionMode | lastActionMode
TypeInfoWrapperSet | supportedPropertyTypes

## Additional Inherited Members
Public Slots inherited from OMPropertyModelSubclass
virtual void | slotCombine ()
virtual void | slotSaveProperty ()
virtual void | slotLoadProperty ()
virtual void | slotPickProperty ()
Signals inherited from SingleObjectPropertyModel
void | log (Logtype _type, QString _message)
void | log (QString _message)
Protected Attributes inherited from SingleObjectPropertyModel
std::vector< PropertyVisualizer * > | propertyVisualizers
QWidget * | widgets
QModelIndexList | currentlySelectedIndices
std::vector< unsigned int > | currentlyVisualizedIndices

## Detailed Description

### template<typename MeshT>
class OMPropertyModel< MeshT >

Definition at line 56 of file OMPropertyModel.hh.

## Member Function Documentation

## ◆ addProperty()

template<typename MeshT >

void OMPropertyModel< MeshT >::addProperty | ( | QString | propName,
|  | QString | friendlyTypeName,
|  | PropertyInfo::ENTITY_FILTER | filter
| ) |  |
| private

Adds a new property to the mesh.

Parameters

  propName | The name of the property that should be added.
  friendlyTypeName | The type of the property.
  filter | The entity type of the property.

This method adds a new property to the mesh. The types "Vec3d", "Vec3d", "double", "unsigned int", "int" and "bool" can be added for every entity type. "SkinWeights" can only be added for vertices.

Definition at line 575 of file OMPropertyModelT_impl.hh.

## ◆ addPropertyVisualizer()

template<typename MeshT >

void OMPropertyModel< MeshT >::addPropertyVisualizer | ( | OpenMesh::BaseProperty *const | baseProp,
|  | MeshT * | mesh,
|  | PropertyInfo::ENTITY_FILTER | filter
| ) |  |
| private

Adds a new PropertyVisualizer.

Parameters

  baseProp | A pointer to the property that should be visualized.
  mesh | A pointer to the mesh whose properties should be visualized.
  filter | The entity type that should be visualized.

This method creates a new PropertyVisualizer depending on the provieded parameters and adds it to the list of PropertyVisualizers.

Definition at line 538 of file OMPropertyModelT_impl.hh.

## ◆ combinable()

template<typename MeshT >

bool OMPropertyModel< MeshT >::combinable | ( | PropertyVisualizer * | propertyVisualizer1,
|  | PropertyVisualizer * | propertyVisualizer2
| ) |  |
| private

Checks if two properties are combinable.

Parameters

  propertyVisualizer1 | First PropertyVisualizer for combination.
  propertyVisualizer2 | Second PropertyVisualizer for combination.

Returns
  True if the two properties are combinable, False if not.

If the user selects two properties which are both of a vector type (Vec3f or Vec3d) they can be combined. This method will check if the two provided PropertyVisualizers can be comined. Currently PropertyVisualizers can only be combined if both visualize a property with a vector type and the same entity type.

Definition at line 201 of file OMPropertyModelT_impl.hh.

## ◆ combine()

template<typename MeshT >

void OMPropertyModel< MeshT >::combine | ( |  | ) |
| private virtual

Combines two properties.

If the user selects two properties which are both of a vector type (Vec3f or Vec3d) they can be combined. This method will create a new PropertyVisualizer (an OMPropertyVisualizerVectorFieldDifference<MeshT> to be exact) but not an additional property.

Reimplemented from OMPropertyModelSubclass.

Definition at line 179 of file OMPropertyModelT_impl.hh.

## ◆ getSupportedTypeInfoWrapper() [1/2]

template<typename MeshT >

TypeInfoWrapper OMPropertyModel< MeshT >::getSupportedTypeInfoWrapper | ( | OpenMesh::BaseProperty *const | baseProp | ) |
| private

Returns the TypeInfoWrapper for the property if it is supported.

Parameters

  baseProp | A pointer to the property.

Returns
  A TypeInfoWrapper containing all the type information for the provided property.

Definition at line 499 of file OMPropertyModelT_impl.hh.

## ◆ getSupportedTypeInfoWrapper() [2/2]

template<typename MeshT >

TypeInfoWrapper OMPropertyModel< MeshT >::getSupportedTypeInfoWrapper | ( | QString | friendlyName | ) |
| private

Returns the TypeInfoWrapper for the type of property if it is supported.

Parameters

  friendlyName | The type we want to visualize in text form.

Returns
  A TypeInfoWrapper containing all the type information for the property type.

Definition at line 514 of file OMPropertyModelT_impl.hh.

## ◆ isNew()

template<typename MeshT >

bool OMPropertyModel< MeshT >::isNew | ( | OpenMesh::BaseProperty *const | baseProp,
|  | PropertyInfo::ENTITY_FILTER | filter
| ) |  |
| private

Checks if we already created a PropertyVisualizer for this property.

Parameters

  baseProp | A pointer to the property.
  filter | The entity type.

Returns
  True if we do not have PropertyVisualizer yet for that property, False if we do

Definition at line 480 of file OMPropertyModelT_impl.hh.

## ◆ isSupported() [1/2]

template<typename MeshT >

bool OMPropertyModel< MeshT >::isSupported | ( | OpenMesh::BaseProperty *const | baseProp | ) | const
| private

Checks if visualizing this property is supported.

Parameters

  baseProp | A pointer to the property that we want to visualize.

Returns
  True if the property can be visualized, False if not.

Definition at line 441 of file OMPropertyModelT_impl.hh.

## ◆ isSupported() [2/2]

template<typename MeshT >

bool OMPropertyModel< MeshT >::isSupported | ( | QString | friendlyName | ) | const
| private

Checks if visualizing this type of property is supported.

Checks if visualizing this property is supported.

Parameters

  friendlyName | The type we want to visualize in text form.

Returns
  True if the property type can be visualized, False if not.

Currently supported are the types "bool", "int", "unsigned int", "double", "Vec3d", "Vec3f" and "SkinWeights"

Definition at line 459 of file OMPropertyModelT_impl.hh.

## ◆ mouseEvent()

template<typename MeshT >

void OMPropertyModel< MeshT >::mouseEvent | ( | QMouseEvent * | _event | ) |
| private virtual

Handles mouse events for picking.

If picking mode is active this method will find the picked entity and display its handle and value in the PickWidget.

Reimplemented from SingleObjectPropertyModel.

Definition at line 376 of file OMPropertyModelT_impl.hh.

## ◆ parseHeader()

template<typename MeshT >

bool OMPropertyModel< MeshT >::parseHeader | ( | QString | header,
|  | PropertyVisualizer *& | propVis,
|  | unsigned int & | n
| ) |  |
| private virtual

Parses the property file header.

Parameters

  | header | The header.
  [out] | propVis | The PropertyVisualizer that will visualize the new property.
  [out] | n | The number of values stored in the file

Returns
  True if parsing was successfull, False if not.

When loading a property from a file this method parses the header placed in the file's first line. If parsing was successfull a new property and a PropertyVisualizer will be created.

Reimplemented from SingleObjectPropertyModel.

Definition at line 221 of file OMPropertyModelT_impl.hh.

## ◆ pickProperty()

template<typename MeshT >

void OMPropertyModel< MeshT >::pickProperty | ( |  | ) |
| private virtual

Toggle picking on and off.

This method will start and stop the picking.

Reimplemented from OMPropertyModelSubclass.

Definition at line 340 of file OMPropertyModelT_impl.hh.

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

- Plugin-PropertyVis/OpenMesh/OMPropertyModel.hh
- Plugin-PropertyVis/OpenMesh/OMPropertyModelT_impl.hh