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 "OVMPropertyVisualizerVector.hh" 52 #include "OVMPropertyVisualizerVectorFieldDifference.hh" 54 #include "../Utils.hh" 55 #include <OpenVolumeMesh/Core/BaseProperty.hh> 57 #include "Widgets/LoadSaveWidget.hh" 58 #include "Widgets/PickWidget.hh" 62 #include "../Utils.hh" 64 #define PROP_VIS "PropertyVisualization" 66 #include "OVMPropertyModelSubclass.hh" 70 template<
typename MeshT>
77 virtual void updateWidget(
const QModelIndexList& selectedIndices);
99 static bool isUnsignedIntType(
const PropertyInfo& propInfo);
108 #define DECLARE_PROPTYPES(primitive) \ 109 static const TypeInfoWrapper proptype_##primitive##_bool; \ 110 static const TypeInfoWrapper proptype_##primitive##_int; \ 111 static const TypeInfoWrapper proptype_##primitive##_uint; \ 112 static const TypeInfoWrapper proptype_##primitive##_double; \ 113 static const TypeInfoWrapper proptype_##primitive##_Vec3d; \ 114 static const TypeInfoWrapper proptype_##primitive##_Vec3f; 116 DECLARE_PROPTYPES(Cell)
117 DECLARE_PROPTYPES(Face)
118 DECLARE_PROPTYPES(HalfFace)
119 DECLARE_PROPTYPES(Edge)
120 DECLARE_PROPTYPES(HalfEdge)
121 DECLARE_PROPTYPES(Vertex)
122 #undef DECLARE_PROPTYPES 142 typename MeshT::Properties::const_iterator props_first,
143 typename MeshT::Properties::const_iterator props_last,
144 PropertyInfo::ENTITY_FILTER filter);
166 bool isEntityType(
const TypeInfoWrapper& typeInfo, PropertyInfo::ENTITY_FILTER entity_type)
const;
172 void addProperty(QString propName, QString friendlyTypeName, PropertyInfo::ENTITY_FILTER filter);
174 void initializeSupportedPropertyTypes();
180 QPushButton bCombine;
189 std::string lastPickMode;
192 typedef std::set<TypeInfoWrapper> TypeInfoWrapperSet;
193 TypeInfoWrapperSet supportedPropertyTypes;
197 #define INITIALIZE_PROPTYPES(primitive) \ 198 template <typename T> const TypeInfoWrapper OVMPropertyModel<T>::proptype_##primitive##_bool \ 199 = TypeInfoWrapper(typeid(OpenVolumeMesh::primitive##PropertyT<bool>), "bool"); \ 200 template <typename T> const TypeInfoWrapper OVMPropertyModel<T>::proptype_##primitive##_int \ 201 = TypeInfoWrapper(typeid(OpenVolumeMesh::primitive##PropertyT<int>), "int"); \ 202 template <typename T> const TypeInfoWrapper OVMPropertyModel<T>::proptype_##primitive##_uint \ 203 = TypeInfoWrapper(typeid(OpenVolumeMesh::primitive##PropertyT<unsigned int>), "unsigned int"); \ 204 template <typename T> const TypeInfoWrapper OVMPropertyModel<T>::proptype_##primitive##_double \ 205 = TypeInfoWrapper(typeid(OpenVolumeMesh::primitive##PropertyT<double>), "double"); \ 206 template <typename T> const TypeInfoWrapper OVMPropertyModel<T>::proptype_##primitive##_Vec3d \ 207 = TypeInfoWrapper(typeid(OpenVolumeMesh::primitive##PropertyT<ACG::Vec3d>), "Vec3d"); \ 208 template <typename T> const TypeInfoWrapper OVMPropertyModel<T>::proptype_##primitive##_Vec3f \ 209 = TypeInfoWrapper(typeid(OpenVolumeMesh::primitive##PropertyT<ACG::Vec3f>), "Vec3f"); 211 INITIALIZE_PROPTYPES(Cell)
212 INITIALIZE_PROPTYPES(Face)
213 INITIALIZE_PROPTYPES(HalfFace)
214 INITIALIZE_PROPTYPES(Edge)
215 INITIALIZE_PROPTYPES(HalfEdge)
216 INITIALIZE_PROPTYPES(Vertex)
218 #undef INITIALIZE_PROPTYPES 221 #if defined(INCLUDE_TEMPLATES) && !defined(OVM_PROPERTY_MODEL_CC) 222 #include "OVMPropertyModelT_impl.hh" virtual void saveProperty()
Saves the currently slected properties.
virtual void mouseEvent(QMouseEvent *_event)
Handles mouse events for picking.
void addPropertyVisualizer(OpenVolumeMesh::BaseProperty *const baseProp, MeshT *mesh, PropertyInfo::ENTITY_FILTER filter)
Adds a new PropertyVisualizer.
virtual QString getLoadFilenameFilter()
Returns the filename filter for loading.
virtual void pickProperty()
Toggle picking on and off.
void gatherProperties()
Searches for all properties and creates the visualizers.
ActionMode
Enum listing action modes of the viewers.
Wraps the information of a type.
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.
TypeInfoWrapper getSupportedTypeInfoWrapper(OpenVolumeMesh::BaseProperty *const baseProp) const
Returns the TypeInfoWrapper for the property if it is supported.
This class vizualizes a property.
bool isNew(OpenVolumeMesh::BaseProperty *const baseProp, PropertyInfo::ENTITY_FILTER filter) const
Checks if we already created a PropertyVisualizer for this property.
void resetPicking()
Disables picking.
virtual bool parseHeader(QString header, PropertyVisualizer *&propVis, unsigned int &n)
Parses the property file header.
bool combinable(PropertyVisualizer *propertyVisualizer1, PropertyVisualizer *propertyVisualizer2) const
Checks if two properties are combinable.
virtual void updateWidget(const QModelIndexList &selectedIndices)
Updates the widget.
bool isSupported(OpenVolumeMesh::BaseProperty *const baseProp) const
Checks if visualizing this property is supported.
Cellection of information about a property.
void addProperty(QString propName, QString friendlyTypeName, PropertyInfo::ENTITY_FILTER filter)
Adds a new property to the mesh.
virtual void pickModeChanged(const std::string &_mode)
Handles changing of pick mode.
virtual void combine()
Combines two properties.
virtual QString getSaveFilenameFilter(unsigned int propId)
Returns the filename filter for saving.