Developer Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
SingleObjectPropertyModel Class Reference

This class manages the visualizers for a single object. More...

#include <Plugin-PropertyVis/SingleObjectPropertyModel.hh>

Inheritance diagram for SingleObjectPropertyModel:
PropertyModel OMPropertyModelSubclass OMPropertyModel< MeshT >


void log (Logtype _type, QString _message)
void log (QString _message)

Public Member Functions

virtual void pickModeChanged (const std::string &_mode)
virtual void mouseEvent (QMouseEvent *_event)
 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 gatherProperties ()
 Searches for properties and creates PropertyVisualizers.
virtual void clear (QModelIndexList selectedIndices)
 Clears the selected property visualization.
void hideWidget ()
 Hides the widget.
QWidget * getWidget ()
 Returns the widget.
virtual void updateWidget (const QModelIndexList &selectedIndices)
 Updates 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.
- 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.

Protected Member Functions

PropertyVisualizergetPropertyVisualizer (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.
virtual QString getLoadFilenameFilter ()
 Returns the filename filter for loading.
QString getSaveFilename (unsigned int propId)
 Asks the user for a file to load.
virtual QString getSaveFilenameFilter (unsigned int propId)
 Returns the filename filter for saving.
virtual QString getDefaultSaveFilename (unsigned int propId)
 Returns the default file name.
void openFile (QString _filename, QFile &file_, QTextStream *&file_stream_)
 Opens a file.
void closeFile (QFile &file_, QTextStream *&file_stream_)
 Closes a file.
QString readLine (QTextStream *file_stream_)
 Read line from a file.
void writeLine (QString _s, QTextStream *&file_stream_)
 Writes a line to a file.
void saveProperty (unsigned int propId)
 Saves property.
void loadProperty ()
 Loads property.
virtual void setPropertyFromFile (QTextStream *&file_stream_, unsigned int n, PropertyVisualizer *propVis)
 Sets the property values from a given file.
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)

Detailed Description

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 80 of file SingleObjectPropertyModel.hh.

Member Function Documentation

virtual bool SingleObjectPropertyModel::parseHeader ( QString  header,
PropertyVisualizer *&  propVis,
unsigned int &  n 

Parses the property file header.

headerThe header.
[out]propVisThe PropertyVisualizer that will visualize the new property.
[out]nThe number of values stored in the file
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 in OMPropertyModel< MeshT >.

Definition at line 194 of file SingleObjectPropertyModel.hh.

void SingleObjectPropertyModel::visualize ( QModelIndexList  selectedIndices,
QWidgetList  widgets = QWidgetList() 

Visualizes the selected properties.


Implements PropertyModel.

Definition at line 74 of file

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