45 #include "Models/PropertyModel.hh" 46 #include "PropertyVisualizer/PropertyVisualizer.hh" 57 #include <QPushButton> 58 #include <QScriptValue> 59 #include <QScriptContext> 61 #include <Widgets/VectorWidget.hh> 79 void log(
Logtype _type, QString _message);
80 void log(QString _message);
83 void slotLog(
Logtype _type, QString _message){ emit log(_type, _message); }
84 void slotLog(QString _message){ emit log(_message);}
87 virtual void pickModeChanged(
const std::string& _mode)
override {}
88 virtual void mouseEvent(QMouseEvent* _event)
override {}
93 virtual int rowCount(
const QModelIndex & parent = QModelIndex())
const override;
94 virtual QVariant data(
const QModelIndex & index,
int role = Qt::DisplayRole)
const override;
95 virtual QVariant headerData(
int section, Qt::Orientation orientation,
int role = Qt::DisplayRole)
const override;
101 virtual void visualize(QModelIndexList selectedIndices, QWidgetList widgets = QWidgetList())
override;
104 virtual void removeProperty(QModelIndexList selectedIndices)
override;
113 virtual void clear(QModelIndexList selectedIndices)
override;
119 inline QWidget*
getWidget()
override {
return widgets; }
122 virtual void updateWidget(
const QModelIndexList& selectedIndices)
override;
131 virtual QScriptValue
getScriptObject(
const QModelIndex index, QScriptContext *ctx);
181 std::vector<PropertyVisualizer*> propertyVisualizers;
183 QModelIndexList currentlySelectedIndices;
184 std::vector<unsigned int> currentlyVisualizedIndices;
This class manages the visualizers for a single object.
Wraps the information of a type.
bool isPropertyFree(QString propName, PropertyInfo::ENTITY_FILTER filter, TypeInfoWrapper typeInfo)
Checks if the property name is still available.
virtual void removeProperty(QModelIndexList selectedIndices) override
Removes the selected properties.
QString getSaveFilename(unsigned int propId)
Asks the user for a file to load.
Logtype
Log types for Message Window.
virtual PropertyInfo getPropertyInfo(const QModelIndex index) const override
Returns the property info for the property with the given index.
virtual QString getDefaultSaveFilename(unsigned int propId)
Returns the default file name.
void connectLogs(PropertyVisualizer *propViz) override
Connects the PropertyVisualizer log signals with the log slot.
virtual QString getSaveFilenameFilter(unsigned int propId)
Returns the filename filter for saving.
void saveProperty(unsigned int propId)
Saves property.
virtual void gatherProperties() override
Searches for properties and creates PropertyVisualizers.
virtual void visualize(QModelIndexList selectedIndices, QWidgetList widgets=QWidgetList()) override
Visualizes the selected properties.
QString getLoadFilename()
Asks the user for a file to load.
void hideWidget() override
Hides the widget.
Cellection of information about a property.
virtual void objectUpdated() override
Revisualizes visualized properties.
This class vizualizes a property.
virtual bool parseHeader(QString header, PropertyVisualizer *&propVis, unsigned int &n)
Parses the property file header.
PropertyVisualizer * getPropertyVisualizer(QString propName, PropertyInfo::ENTITY_FILTER filter, TypeInfoWrapper typeInfo)
Returns a PropertyVisualizer.
virtual QScriptValue getScriptObject(const QModelIndex index, QScriptContext *ctx)
Returns a qscript object that can be used to access visualisation parameters.
virtual void updateWidget(const QModelIndexList &selectedIndices) override
Updates the widget.
virtual void setPropertyFromFile(QTextStream &file_stream, unsigned int n, PropertyVisualizer *propVis)
Sets the property values from a given file.
void loadProperty()
Loads property.
QWidget * getWidget() override
Returns the widget.
virtual QString getLoadFilenameFilter()
Returns the filename filter for loading.
virtual void clear(QModelIndexList selectedIndices) override
Clears the selected property visualization.
virtual void duplicateProperty(QModelIndexList selectedIndices) override
Duplicates the selected properties.