Developer Documentation
|
This class manages the visualizers for a single object. More...
#include <Plugin-PropertyVis/Models/SingleObjectPropertyModel.hh>
Signals | |
void | log (Logtype _type, QString _message) |
void | log (QString _message) |
Public Member Functions | |
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 | |
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... | |
Protected Attributes | |
std::vector< PropertyVisualizer * > | propertyVisualizers |
QWidget * | widgets |
QModelIndexList | currentlySelectedIndices |
std::vector< unsigned int > | currentlyVisualizedIndices |
Private Slots | |
void | slotLog (Logtype _type, QString _message) |
void | slotLog (QString _message) |
This class manages the visualizers for a single object.
For each mesh object a SingleObjectPropertyModel is created. It searches for properties and creates a PropertyVisualizer for each of them. It provides the GUI for all selected properties. Also loading and saving of properties is handled here.
Note that for each type of object (OpenMesh, OpenVolumeMesh and others that might follow) a subclass should be derived from this class.
Definition at line 76 of file SingleObjectPropertyModel.hh.
|
explicit |
Definition at line 48 of file SingleObjectPropertyModel.cc.
|
virtual |
Definition at line 60 of file SingleObjectPropertyModel.cc.
|
overridevirtual |
Clears the selected property visualization.
Implements PropertyModel.
Definition at line 133 of file SingleObjectPropertyModel.cc.
|
overridevirtual |
Connects the PropertyVisualizer log signals with the log slot.
Implements PropertyModel.
Definition at line 162 of file SingleObjectPropertyModel.cc.
|
overridevirtual |
Implements PropertyModel.
Definition at line 172 of file SingleObjectPropertyModel.cc.
|
overridevirtual |
Duplicates the selected properties.
Implements PropertyModel.
Definition at line 127 of file SingleObjectPropertyModel.cc.
|
inlineoverridevirtual |
Searches for properties and creates PropertyVisualizers.
Implements PropertyModel.
Reimplemented in OMPropertyModel< MeshT >, and OVMPropertyModel< MeshT >.
Definition at line 113 of file SingleObjectPropertyModel.hh.
|
protectedvirtual |
Returns the default file name.
Definition at line 238 of file SingleObjectPropertyModel.cc.
|
protected |
Asks the user for a file to load.
Definition at line 206 of file SingleObjectPropertyModel.cc.
|
protectedvirtual |
Returns the filename filter for loading.
Reimplemented in OMPropertyModel< MeshT >, and OVMPropertyModel< MeshT >.
Definition at line 216 of file SingleObjectPropertyModel.cc.
|
overridevirtual |
Returns the property info for the property with the given index.
Implements PropertyModel.
Definition at line 338 of file SingleObjectPropertyModel.cc.
|
protected |
Returns a PropertyVisualizer.
Definition at line 322 of file SingleObjectPropertyModel.cc.
|
protected |
Asks the user for a file to load.
Definition at line 221 of file SingleObjectPropertyModel.cc.
|
protectedvirtual |
Returns the filename filter for saving.
Reimplemented in OMPropertyModel< MeshT >, and OVMPropertyModel< MeshT >.
Definition at line 231 of file SingleObjectPropertyModel.cc.
|
virtual |
Returns a qscript object that can be used to access visualisation parameters.
Definition at line 344 of file SingleObjectPropertyModel.cc.
|
inlineoverridevirtual |
Returns the widget.
Implements PropertyModel.
Definition at line 122 of file SingleObjectPropertyModel.hh.
|
overridevirtual |
Implements PropertyModel.
Definition at line 182 of file SingleObjectPropertyModel.cc.
|
inlineoverridevirtual |
Hides the widget.
Implements PropertyModel.
Definition at line 119 of file SingleObjectPropertyModel.hh.
|
overridevirtual |
Implements PropertyModel.
Definition at line 192 of file SingleObjectPropertyModel.cc.
|
protected |
Checks if the property name is still available.
Definition at line 333 of file SingleObjectPropertyModel.cc.
|
protected |
Loads property.
Definition at line 284 of file SingleObjectPropertyModel.cc.
|
inlineoverridevirtual |
Reimplemented from PropertyModel.
Reimplemented in OMPropertyModel< MeshT >, and OVMPropertyModel< MeshT >.
Definition at line 90 of file SingleObjectPropertyModel.hh.
|
overridevirtual |
Revisualizes visualized properties.
Implements PropertyModel.
Definition at line 198 of file SingleObjectPropertyModel.cc.
|
inlineprotectedvirtual |
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 in OMPropertyModel< MeshT >, and OVMPropertyModel< MeshT >.
Definition at line 183 of file SingleObjectPropertyModel.hh.
|
inlineoverridevirtual |
Reimplemented from PropertyModel.
Reimplemented in OMPropertyModel< MeshT >, and OVMPropertyModel< MeshT >.
Definition at line 89 of file SingleObjectPropertyModel.hh.
|
overridevirtual |
Removes the selected properties.
Implements PropertyModel.
Definition at line 92 of file SingleObjectPropertyModel.cc.
|
overridevirtual |
Implements PropertyModel.
Definition at line 168 of file SingleObjectPropertyModel.cc.
|
protected |
Saves property.
Definition at line 260 of file SingleObjectPropertyModel.cc.
|
protectedvirtual |
Sets the property values from a given file.
Reimplemented in OMPropertyModel< MeshT >.
Definition at line 313 of file SingleObjectPropertyModel.cc.
|
inlineprivateslot |
Definition at line 85 of file SingleObjectPropertyModel.hh.
|
inlineprivateslot |
Definition at line 86 of file SingleObjectPropertyModel.hh.
|
overridevirtual |
Updates the widget.
Implements PropertyModel.
Reimplemented in OMPropertyModel< MeshT >, and OVMPropertyModel< MeshT >.
Definition at line 142 of file SingleObjectPropertyModel.cc.
|
overridevirtual |
Visualizes the selected properties.
selectedIndices | The |
Implements PropertyModel.
Definition at line 70 of file SingleObjectPropertyModel.cc.
|
protected |
Definition at line 188 of file SingleObjectPropertyModel.hh.
|
protected |
Definition at line 189 of file SingleObjectPropertyModel.hh.
|
protected |
Definition at line 186 of file SingleObjectPropertyModel.hh.
|
protected |
Definition at line 187 of file SingleObjectPropertyModel.hh.