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;
Wraps the information of a type.
virtual QString getLoadFilenameFilter()
Returns the filename filter for loading.
virtual void updateWidget(const QModelIndexList &selectedIndices)
Updates the widget.
void openFile(QString _filename, QFile &file_, QTextStream *&file_stream_)
Opens a file.
virtual PropertyInfo getPropertyInfo(const QModelIndex index) const
Returns the property info for the property with the given index.
void connectLogs(PropertyVisualizer *propViz)
Connects the PropertyVisualizer log signals with the log slot.
bool isPropertyFree(QString propName, PropertyInfo::ENTITY_FILTER filter, TypeInfoWrapper typeInfo)
Checks if the property name is still available.
void closeFile(QFile &file_, QTextStream *&file_stream_)
Closes a file.
void hideWidget()
Hides the widget.
QString getLoadFilename()
Asks the user for a file to load.
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.
virtual void clear(QModelIndexList selectedIndices)
Clears the selected property visualization.
virtual void visualize(QModelIndexList selectedIndices, QWidgetList widgets=QWidgetList())
Visualizes the selected properties.
virtual bool parseHeader(QString header, PropertyVisualizer *&propVis, unsigned int &n)
Parses the property file header.
QWidget * getWidget()
Returns the widget.
virtual void duplicateProperty(QModelIndexList selectedIndices)
Duplicates the selected properties.
QString getSaveFilename(unsigned int propId)
Asks the user for a file to load.
virtual void gatherProperties()
Searches for properties and creates PropertyVisualizers.
void loadProperty()
Loads property.
Logtype
Log types for Message Window.
This class vizualizes a property.
QString readLine(QTextStream *file_stream_)
Read line from a file.
void writeLine(QString _s, QTextStream *&file_stream_)
Writes a line to a file.
virtual QString getSaveFilenameFilter(unsigned int propId)
Returns the filename filter for saving.
void saveProperty(unsigned int propId)
Saves property.
virtual void objectUpdated()
Revisualizes visualized properties.
PropertyVisualizer * getPropertyVisualizer(QString propName, PropertyInfo::ENTITY_FILTER filter, TypeInfoWrapper typeInfo)
Returns a PropertyVisualizer.
This class manages the visualizers for a single object.
Cellection of information about a property.
virtual QString getDefaultSaveFilename(unsigned int propId)
Returns the default file name.