Commit 868e1469 authored by Isaak Lim's avatar Isaak Lim

added multiple object property visualization support for OVM (thanks to Alexander Dielen)

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@21171 383ad7c9-94d9-4d36-a494-682f7c89f535
parent d51a34d8
This diff is collapsed.
......@@ -2,6 +2,7 @@
#define MULTI_OBJECT_PROPERTY_MODEL_H
#include "PropertyModel.hh"
#include "OpenFlipper/common/DataTypes.hh"
class PropertyVisualizer;
......@@ -10,11 +11,11 @@ class MultiObjectPropertyModel: public PropertyModel
Q_OBJECT
public:
MultiObjectPropertyModel(const QStringList& res, QObject *parent = 0);
virtual ~MultiObjectPropertyModel();
MultiObjectPropertyModel(const QStringList& res, QObject *parent = 0);
virtual ~MultiObjectPropertyModel();
virtual int rowCount(const QModelIndex & parent = QModelIndex()) const;
virtual QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const;
virtual int rowCount(const QModelIndex & parent = QModelIndex()) const;
virtual QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const;
virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
/// Revisualizes visualized properties.
......@@ -47,19 +48,20 @@ public:
/// Connects the PropertyVisualizer log signals with the log slot.
virtual void connectLogs(PropertyVisualizer* propViz);
/// Returns the property info for the property with the given index.
virtual PropertyInfo getPropertyInfo(const QModelIndex index) const;
/// Returns the property info for the property with the given index.
virtual PropertyInfo getPropertyInfo(const QModelIndex index) const;
private:
QWidget* createWidgetForType(const TypeInfoWrapper& info) const;
void setRange(const PropertyInfo& info, QWidget* widget) const;
QWidget* createWidgetForType(const TypeInfoWrapper& info) const;
void setRange(const PropertyInfo& info, QWidget* widget) const;
private:
const QStringList restriction;
const QStringList restriction;
const DataType datatypes;
std::vector<QString> propNames;
std::vector<PropertyInfo> propInfos;
std::vector<QWidget*> propWidgets;
QWidget* widget;
std::vector<PropertyInfo> propInfos;
std::vector<QWidget*> propWidgets;
QWidget* widget;
};
#endif /* MULTI_OBJECT_PROPERTY_MODEL_H */
This diff is collapsed.
......@@ -56,9 +56,12 @@
#include <typeinfo>
#include <QObject>
#include <QMessageBox>
#include <ObjectTypes/TriangleMesh/TriangleMesh.hh>
#include <ObjectTypes/PolyMesh/PolyMesh.hh>
#include <ObjectTypes/HexahedralMesh/HexahedralMesh.hh>
#include <ObjectTypes/PolyhedralMesh/PolyhedralMesh.hh>
/*! \class TypeInfoWrapper
* \brief Wraps the information of a type.
......@@ -192,4 +195,19 @@ public:
};
static DataType supportedDataTypes()
{
DataType res = DATA_TRIANGLE_MESH | DATA_POLY_MESH;
#ifdef ENABLE_OPENVOLUMEMESH_POLYHEDRAL_SUPPORT
res |= DATA_POLYHEDRAL_MESH;
#endif
#ifdef ENABLE_OPENVOLUMEMESH_HEXAHEDRAL_SUPPORT
res |= DATA_HEXAHEDRAL_MESH;
#endif
return res;
}
#endif /* UTILS_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment