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