50 #ifndef SINGLE_OBJECT_PROPERTY_MODEL_H 51 #define SINGLE_OBJECT_PROPERTY_MODEL_H 53 #include "PropertyModel.hh" 54 #include "PropertyVisualizer.hh" 65 #include <QPushButton> 67 #include <Widgets/VectorWidget.hh> 85 void log(
Logtype _type, QString _message);
86 void log(QString _message);
89 void slotLog(
Logtype _type, QString _message){ emit log(_type, _message); }
90 void slotLog(QString _message){ emit log(_message);}
93 virtual void pickModeChanged(
const std::string& _mode) {}
94 virtual void mouseEvent(QMouseEvent* _event) {}
99 virtual int rowCount(
const QModelIndex & parent = QModelIndex())
const;
100 virtual QVariant data(
const QModelIndex & index,
int role = Qt::DisplayRole)
const;
101 virtual QVariant headerData(
int section, Qt::Orientation orientation,
int role = Qt::DisplayRole)
const;
107 virtual void visualize(QModelIndexList selectedIndices, QWidgetList widgets = QWidgetList());
119 virtual void clear(QModelIndexList selectedIndices);
128 virtual void updateWidget(
const QModelIndexList& selectedIndices);
162 void openFile(QString _filename, QFile &file_, QTextStream *&file_stream_);
165 void closeFile(QFile& file_, QTextStream*& file_stream_);
168 QString
readLine(QTextStream *file_stream_);
171 void writeLine(QString _s, QTextStream *&file_stream_);
197 std::vector<PropertyVisualizer*> propertyVisualizers;
199 QModelIndexList currentlySelectedIndices;
200 std::vector<unsigned int> currentlyVisualizedIndices;
virtual void setPropertyFromFile(QTextStream *&file_stream_, unsigned int n, PropertyVisualizer *propVis)
Sets the property values from a given file.
virtual void removeProperty(QModelIndexList selectedIndices)
Removes the selected properties.
void writeLine(QString _s, QTextStream *&file_stream_)
Writes a line to a file.
virtual void updateWidget(const QModelIndexList &selectedIndices)
Updates the widget.
Cellection of information about a property.
Logtype
Log types for Message Window.
This class vizualizes a property.
QString getSaveFilename(unsigned int propId)
Asks the user for a file to load.
virtual void clear(QModelIndexList selectedIndices)
Clears the selected property visualization.
virtual QString getDefaultSaveFilename(unsigned int propId)
Returns the default file name.
void openFile(QString _filename, QFile &file_, QTextStream *&file_stream_)
Opens a file.
virtual void gatherProperties()
Searches for properties and creates PropertyVisualizers.
virtual void visualize(QModelIndexList selectedIndices, QWidgetList widgets=QWidgetList())
Visualizes the selected properties.
virtual PropertyInfo getPropertyInfo(const QModelIndex index) const
Returns the property info for the property with the given index.
virtual QString getLoadFilenameFilter()
Returns the filename filter for loading.
virtual bool parseHeader(QString header, PropertyVisualizer *&propVis, unsigned int &n)
Parses the property file header.
void loadProperty()
Loads property.
QString getLoadFilename()
Asks the user for a file to load.
bool isPropertyFree(QString propName, PropertyInfo::ENTITY_FILTER filter, TypeInfoWrapper typeInfo)
Checks if the property name is still available.
void connectLogs(PropertyVisualizer *propViz)
Connects the PropertyVisualizer log signals with the log slot.
PropertyVisualizer * getPropertyVisualizer(QString propName, PropertyInfo::ENTITY_FILTER filter, TypeInfoWrapper typeInfo)
Returns a PropertyVisualizer.
void closeFile(QFile &file_, QTextStream *&file_stream_)
Closes a file.
void hideWidget()
Hides the widget.
QString readLine(QTextStream *file_stream_)
Read line from a file.
void saveProperty(unsigned int propId)
Saves property.
Wraps the information of a type.
virtual void objectUpdated()
Revisualizes visualized properties.
QWidget * getWidget()
Returns the widget.
virtual void duplicateProperty(QModelIndexList selectedIndices)
Duplicates the selected properties.
virtual QString getSaveFilenameFilter(unsigned int propId)
Returns the filename filter for saving.
This class manages the visualizers for a single object.