Developer Documentation
|
Public Member Functions | |
OMPropertyModel (MeshT *mesh, int objectID, QObject *parent=0) | |
virtual void | updateWidget (const QModelIndexList &selectedIndices) |
Updates the widget. More... | |
![]() | |
OMPropertyModelSubclass (QObject *parent=0) | |
![]() | |
virtual void | pickModeChanged (const std::string &_mode) override |
virtual void | mouseEvent (QMouseEvent *_event) override |
SingleObjectPropertyModel (QObject *parent=0) | |
virtual int | rowCount (const QModelIndex &parent=QModelIndex()) const override |
virtual QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const override |
virtual QVariant | headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override |
virtual QModelIndex | index (int row, int column, QModelIndex const &parent=QModelIndex()) const override |
virtual void | objectUpdated () override |
Revisualizes visualized properties. More... | |
virtual void | visualize (QModelIndexList selectedIndices, QWidgetList widgets=QWidgetList()) override |
Visualizes the selected properties. More... | |
virtual void | removeProperty (QModelIndexList selectedIndices) override |
Removes the selected properties. More... | |
virtual void | duplicateProperty (QModelIndexList selectedIndices) override |
Duplicates the selected properties. More... | |
virtual void | gatherProperties () override |
Searches for properties and creates PropertyVisualizers. More... | |
virtual void | clear (QModelIndexList selectedIndices) override |
Clears the selected property visualization. More... | |
void | hideWidget () override |
Hides the widget. More... | |
QWidget * | getWidget () override |
Returns the widget. More... | |
virtual void | updateWidget (const QModelIndexList &selectedIndices) override |
Updates the widget. More... | |
void | connectLogs (PropertyVisualizer *propViz) override |
Connects the PropertyVisualizer log signals with the log slot. More... | |
virtual PropertyInfo | getPropertyInfo (const QModelIndex index) const override |
Returns the property info for the property with the given index. More... | |
virtual QScriptValue | getScriptObject (const QModelIndex index, QScriptContext *ctx) |
Returns a qscript object that can be used to access visualisation parameters. More... | |
![]() | |
virtual void | pickModeChanged (const std::string &_mode) |
virtual void | mouseEvent (QMouseEvent *_event) |
PropertyModel (QObject *parent=0) | |
virtual int | rowCount (const QModelIndex &parent=QModelIndex()) const =0 |
virtual QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const =0 |
virtual QVariant | headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const =0 |
virtual QModelIndex | index (int row, int column, QModelIndex const &parent=QModelIndex()) const =0 |
virtual void | objectUpdated ()=0 |
Revisualizes visualized properties. More... | |
virtual void | visualize (QModelIndexList selectedIndices, QWidgetList widgets=QWidgetList())=0 |
Visualizes the selected properties. More... | |
virtual void | removeProperty (QModelIndexList selectedIndices)=0 |
Removes the selected properties. More... | |
virtual void | duplicateProperty (QModelIndexList selectedIndices)=0 |
Duplicates the selected properties. More... | |
virtual void | gatherProperties ()=0 |
Searches for properties and creates PropertyVisualizers. More... | |
virtual void | clear (QModelIndexList selectedIndices)=0 |
Clears the selected property visualization. More... | |
virtual void | hideWidget ()=0 |
Hides the widget. More... | |
virtual QWidget * | getWidget ()=0 |
Returns the widget. More... | |
virtual void | updateWidget (const QModelIndexList &selectedIndices)=0 |
Updates the widget. More... | |
virtual void | connectLogs (PropertyVisualizer *propViz)=0 |
Connects the PropertyVisualizer log signals with the log slot. More... | |
virtual PropertyInfo | getPropertyInfo (const QModelIndex index) const =0 |
Returns the property info for the property with the given index. More... | |
QModelIndex | indexFromFancyPropName (const QString &propName) const |
Returns the index of the property with the given name. More... | |
QModelIndex | indexFromPlainPropName (const QString &propName) const |
Returns the index of the property with the given name. More... | |
Protected Member Functions | |
virtual QString | getLoadFilenameFilter () |
Returns the filename filter for loading. More... | |
virtual QString | getSaveFilenameFilter (unsigned int propId) |
Returns the filename filter for saving. More... | |
![]() | |
PropertyVisualizer * | getPropertyVisualizer (QString propName, PropertyInfo::ENTITY_FILTER filter, TypeInfoWrapper typeInfo) |
Returns a PropertyVisualizer. More... | |
bool | isPropertyFree (QString propName, PropertyInfo::ENTITY_FILTER filter, TypeInfoWrapper typeInfo) |
Checks if the property name is still available. More... | |
QString | getLoadFilename () |
Asks the user for a file to load. More... | |
virtual QString | getLoadFilenameFilter () |
Returns the filename filter for loading. More... | |
QString | getSaveFilename (unsigned int propId) |
Asks the user for a file to load. More... | |
virtual QString | getSaveFilenameFilter (unsigned int propId) |
Returns the filename filter for saving. More... | |
virtual QString | getDefaultSaveFilename (unsigned int propId) |
Returns the default file name. More... | |
void | saveProperty (unsigned int propId) |
Saves property. More... | |
void | loadProperty () |
Loads property. More... | |
virtual void | setPropertyFromFile (QTextStream &file_stream, unsigned int n, PropertyVisualizer *propVis) |
Sets the property values from a given file. More... | |
virtual bool | parseHeader (QString header, PropertyVisualizer *&propVis, unsigned int &n) |
Parses the property file header. More... | |
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. More... | |
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. More... | |
void | resetPicking () |
Disables picking. More... | |
virtual void | pickProperty () |
Toggle picking on and off. More... | |
virtual void | pickModeChanged (const std::string &_mode) |
Handles changing of pick mode. More... | |
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. More... | |
void | gatherProperties () |
Searches for all properties and creates the visualizers. More... | |
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 | |
![]() | |
virtual void | slotCombine () |
virtual void | slotSaveProperty () |
virtual void | slotLoadProperty () |
virtual void | slotPickProperty () |
![]() | |
void | log (Logtype _type, QString _message) |
void | log (QString _message) |
![]() | |
std::vector< PropertyVisualizer * > | propertyVisualizers |
QWidget * | widgets |
QModelIndexList | currentlySelectedIndices |
std::vector< unsigned int > | currentlyVisualizedIndices |
Definition at line 56 of file OMPropertyModel.hh.
|
private |
Definition at line 158 of file OMPropertyModel.hh.
OMPropertyModel< MeshT >::OMPropertyModel | ( | MeshT * | mesh, |
int | objectID, | ||
QObject * | parent = 0 |
||
) |
Definition at line 69 of file OMPropertyModelT_impl.hh.
|
inlinevirtual |
Definition at line 60 of file OMPropertyModel.hh.
|
private |
Adds a new property to the mesh.
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 582 of file OMPropertyModelT_impl.hh.
|
private |
Adds a new PropertyVisualizer.
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 545 of file OMPropertyModelT_impl.hh.
|
private |
Checks if two properties are combinable.
propertyVisualizer1 | First PropertyVisualizer for combination. |
propertyVisualizer2 | Second PropertyVisualizer for combination. |
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.
|
privatevirtual |
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.
|
privatevirtual |
Searches for all properties and creates the visualizers.
Reimplemented from SingleObjectPropertyModel.
Definition at line 427 of file OMPropertyModelT_impl.hh.
|
private |
Searches for properties with a specific entity type and creates visualizers.
Definition at line 414 of file OMPropertyModelT_impl.hh.
|
protectedvirtual |
Returns the filename filter for loading.
Reimplemented from SingleObjectPropertyModel.
Definition at line 138 of file OMPropertyModelT_impl.hh.
|
protectedvirtual |
Returns the filename filter for saving.
Reimplemented from SingleObjectPropertyModel.
Definition at line 150 of file OMPropertyModelT_impl.hh.
|
private |
Returns the TypeInfoWrapper for the property if it is supported.
baseProp | A pointer to the property. |
Definition at line 506 of file OMPropertyModelT_impl.hh.
|
private |
Returns the TypeInfoWrapper for the type of property if it is supported.
friendlyName | The type we want to visualize in text form. |
Definition at line 521 of file OMPropertyModelT_impl.hh.
|
private |
Definition at line 766 of file OMPropertyModelT_impl.hh.
|
private |
Checks if we already created a PropertyVisualizer for this property.
baseProp | A pointer to the property. |
filter | The entity type. |
Definition at line 487 of file OMPropertyModelT_impl.hh.
|
private |
Checks if visualizing this property is supported.
baseProp | A pointer to the property that we want to visualize. |
Definition at line 448 of file OMPropertyModelT_impl.hh.
|
private |
Checks if visualizing this type of property is supported.
Checks if visualizing this property is supported.
friendlyName | The type we want to visualize in text form. |
Currently supported are the types "bool", "int", "unsigned int", "double", "Vec3d", "Vec3f" and "SkinWeights"
Definition at line 466 of file OMPropertyModelT_impl.hh.
|
private |
Definition at line 408 of file OMPropertyModelT_impl.hh.
|
privatevirtual |
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 381 of file OMPropertyModelT_impl.hh.
|
privatevirtual |
Parses the property file header.
header | The header. | |
[out] | propVis | The PropertyVisualizer that will visualize the new property. |
[out] | n | The number of values stored in the file |
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.
|
privatevirtual |
Handles changing of pick mode.
Reimplemented from SingleObjectPropertyModel.
Definition at line 362 of file OMPropertyModelT_impl.hh.
|
privatevirtual |
Toggle picking on and off.
This method will start and stop the picking.
Reimplemented from OMPropertyModelSubclass.
Definition at line 345 of file OMPropertyModelT_impl.hh.
|
private |
Disables picking.
Definition at line 332 of file OMPropertyModelT_impl.hh.
|
privatevirtual |
Saves the currently slected properties.
Reimplemented from OMPropertyModelSubclass.
Definition at line 212 of file OMPropertyModelT_impl.hh.
|
privatevirtual |
Sets the property values from a given file.
Reimplemented from SingleObjectPropertyModel.
Definition at line 310 of file OMPropertyModelT_impl.hh.
|
virtual |
Updates the widget.
Reimplemented from SingleObjectPropertyModel.
Definition at line 107 of file OMPropertyModelT_impl.hh.
|
private |
Definition at line 147 of file OMPropertyModel.hh.
|
private |
Definition at line 156 of file OMPropertyModel.hh.
|
private |
Definition at line 155 of file OMPropertyModel.hh.
|
private |
Definition at line 148 of file OMPropertyModel.hh.
|
private |
Definition at line 149 of file OMPropertyModel.hh.
|
private |
Definition at line 143 of file OMPropertyModel.hh.
|
private |
Definition at line 151 of file OMPropertyModel.hh.
|
private |
Definition at line 152 of file OMPropertyModel.hh.
|
private |
Definition at line 145 of file OMPropertyModel.hh.
|
private |
Definition at line 154 of file OMPropertyModel.hh.
|
static |
Definition at line 129 of file OMPropertyModel.hh.
|
static |
Definition at line 133 of file OMPropertyModel.hh.
|
static |
Definition at line 130 of file OMPropertyModel.hh.
|
static |
Definition at line 131 of file OMPropertyModel.hh.
|
static |
Definition at line 132 of file OMPropertyModel.hh.
|
static |
Definition at line 136 of file OMPropertyModel.hh.
|
static |
Definition at line 137 of file OMPropertyModel.hh.
|
static |
Definition at line 134 of file OMPropertyModel.hh.
|
static |
Definition at line 135 of file OMPropertyModel.hh.
|
private |
Definition at line 159 of file OMPropertyModel.hh.