44 #ifndef OVM_PROPERTY_MODEL_H 45 #define OVM_PROPERTY_MODEL_H 47 #include "OVMPropertyVisualizer.hh" 48 #include "OVMPropertyVisualizerBoolean.hh" 49 #include "OVMPropertyVisualizerDouble.hh" 50 #include "OVMPropertyVisualizerInteger.hh" 51 #include "OVMPropertyVisualizerMatrix3x3.hh" 52 #include "OVMPropertyVisualizerVector.hh" 53 #include "OVMPropertyVisualizerVectorFieldDifference.hh" 55 #include "../Utils.hh" 56 #include <OpenVolumeMesh/Core/BaseProperty.hh> 58 #include "Widgets/LoadSaveWidget.hh" 59 #include "Widgets/PickWidget.hh" 63 #include "../Utils.hh" 65 #define PROP_VIS "PropertyVisualization" 67 #include "OVMPropertyModelSubclass.hh" 71 template<
typename MeshT>
78 virtual void updateWidget(
const QModelIndexList& selectedIndices);
100 static bool isUnsignedIntType(
const PropertyInfo& propInfo);
108 static bool isMatrix3x3Type(
const PropertyInfo& propInfo);
111 #define DECLARE_PROPTYPES(primitive) \ 112 static const TypeInfoWrapper proptype_##primitive##_bool; \ 113 static const TypeInfoWrapper proptype_##primitive##_int; \ 114 static const TypeInfoWrapper proptype_##primitive##_uint; \ 115 static const TypeInfoWrapper proptype_##primitive##_double; \ 116 static const TypeInfoWrapper proptype_##primitive##_Vec3d; \ 117 static const TypeInfoWrapper proptype_##primitive##_Vec3f; \ 118 static const TypeInfoWrapper proptype_##primitive##_Matrix3x3d; 120 DECLARE_PROPTYPES(Cell)
121 DECLARE_PROPTYPES(Face)
122 DECLARE_PROPTYPES(HalfFace)
123 DECLARE_PROPTYPES(Edge)
124 DECLARE_PROPTYPES(HalfEdge)
125 DECLARE_PROPTYPES(Vertex)
126 #undef DECLARE_PROPTYPES 146 typename MeshT::Properties::const_iterator props_first,
147 typename MeshT::Properties::const_iterator props_last,
148 PropertyInfo::ENTITY_FILTER filter);
170 bool isEntityType(
const TypeInfoWrapper& typeInfo, PropertyInfo::ENTITY_FILTER entity_type)
const;
176 void addProperty(QString propName, QString friendlyTypeName, PropertyInfo::ENTITY_FILTER filter);
178 void initializeSupportedPropertyTypes();
184 QPushButton bCombine;
193 std::string lastPickMode;
196 typedef std::set<TypeInfoWrapper> TypeInfoWrapperSet;
197 TypeInfoWrapperSet supportedPropertyTypes;
201 #define INITIALIZE_PROPTYPES(primitive) \ 202 template <typename T> const TypeInfoWrapper OVMPropertyModel<T>::proptype_##primitive##_bool \ 203 = TypeInfoWrapper(typeid(OpenVolumeMesh::primitive##PropertyT<bool>), "bool"); \ 204 template <typename T> const TypeInfoWrapper OVMPropertyModel<T>::proptype_##primitive##_int \ 205 = TypeInfoWrapper(typeid(OpenVolumeMesh::primitive##PropertyT<int>), "int"); \ 206 template <typename T> const TypeInfoWrapper OVMPropertyModel<T>::proptype_##primitive##_uint \ 207 = TypeInfoWrapper(typeid(OpenVolumeMesh::primitive##PropertyT<unsigned int>), "unsigned int"); \ 208 template <typename T> const TypeInfoWrapper OVMPropertyModel<T>::proptype_##primitive##_double \ 209 = TypeInfoWrapper(typeid(OpenVolumeMesh::primitive##PropertyT<double>), "double"); \ 210 template <typename T> const TypeInfoWrapper OVMPropertyModel<T>::proptype_##primitive##_Vec3d \ 211 = TypeInfoWrapper(typeid(OpenVolumeMesh::primitive##PropertyT<ACG::Vec3d>), "Vec3d"); \ 212 template <typename T> const TypeInfoWrapper OVMPropertyModel<T>::proptype_##primitive##_Vec3f \ 213 = TypeInfoWrapper(typeid(OpenVolumeMesh::primitive##PropertyT<ACG::Vec3f>), "Vec3f"); \ 214 template <typename T> const TypeInfoWrapper OVMPropertyModel<T>::proptype_##primitive##_Matrix3x3d \ 215 = TypeInfoWrapper(typeid(OpenVolumeMesh::primitive##PropertyT<ACG::Matrix3x3d>), "Matrix3x3d"); 217 INITIALIZE_PROPTYPES(Cell)
218 INITIALIZE_PROPTYPES(Face)
219 INITIALIZE_PROPTYPES(HalfFace)
220 INITIALIZE_PROPTYPES(Edge)
221 INITIALIZE_PROPTYPES(HalfEdge)
222 INITIALIZE_PROPTYPES(Vertex)
224 #undef INITIALIZE_PROPTYPES 227 #if defined(INCLUDE_TEMPLATES) && !defined(OVM_PROPERTY_MODEL_CC) 228 #include "OVMPropertyModelT_impl.hh"
virtual void pickProperty()
Toggle picking on and off.
Wraps the information of a type.
ActionMode
Enum listing action modes of the viewers.
virtual void mouseEvent(QMouseEvent *_event)
Handles mouse events for picking.
virtual void updateWidget(const QModelIndexList &selectedIndices)
Updates the widget.
void addProperty(QString propName, QString friendlyTypeName, PropertyInfo::ENTITY_FILTER filter)
Adds a new property to the mesh.
TypeInfoWrapper getSupportedTypeInfoWrapper(OpenVolumeMesh::BaseProperty *const baseProp) const
Returns the TypeInfoWrapper for the property if it is supported.
bool isPropertyFree(QString propName, PropertyInfo::ENTITY_FILTER filter, TypeInfoWrapper typeInfo)
Checks if a property name is still available for an entity type and a property type.
virtual void pickModeChanged(const std::string &_mode)
Handles changing of pick mode.
virtual void saveProperty()
Saves the currently slected properties.
bool isSupported(OpenVolumeMesh::BaseProperty *const baseProp) const
Checks if visualizing this property is supported.
void addPropertyVisualizer(OpenVolumeMesh::BaseProperty *const baseProp, MeshT *mesh, PropertyInfo::ENTITY_FILTER filter)
Adds a new PropertyVisualizer.
Cellection of information about a property.
virtual QString getLoadFilenameFilter()
Returns the filename filter for loading.
void resetPicking()
Disables picking.
This class vizualizes a property.
void gatherProperties()
Searches for all properties and creates the visualizers.
virtual void combine()
Combines two properties.
virtual bool parseHeader(QString header, PropertyVisualizer *&propVis, unsigned int &n)
Parses the property file header.
virtual QString getSaveFilenameFilter(unsigned int propId)
Returns the filename filter for saving.
bool combinable(PropertyVisualizer *propertyVisualizer1, PropertyVisualizer *propertyVisualizer2) const
Checks if two properties are combinable.
bool isNew(OpenVolumeMesh::BaseProperty *const baseProp, PropertyInfo::ENTITY_FILTER filter) const
Checks if we already created a PropertyVisualizer for this property.