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