43 #include "Entities.hh" 44 #include "PropertyHandles.hh" 45 #include "PropertyPtr.hh" 50 class OpenVolumeMeshPropertyT;
52 class ResourceManager;
57 template <> OVM_EXPORT
const std::string typeName<int>();
58 template <> OVM_EXPORT
const std::string typeName<unsigned int>();
59 template <> OVM_EXPORT
const std::string typeName<short>();
60 template <> OVM_EXPORT
const std::string typeName<long>();
61 template <> OVM_EXPORT
const std::string typeName<unsigned long>();
62 template <> OVM_EXPORT
const std::string typeName<char>();
63 template <> OVM_EXPORT
const std::string typeName<unsigned char>();
64 template <> OVM_EXPORT
const std::string typeName<bool>();
65 template <> OVM_EXPORT
const std::string typeName<float>();
66 template <> OVM_EXPORT
const std::string typeName<double>();
67 template <> OVM_EXPORT
const std::string typeName<std::string>();
68 template <> OVM_EXPORT
const std::string typeName<std::map<HalfEdgeHandle, int> >();
69 template <> OVM_EXPORT
const std::string typeName<std::vector<double> >();
70 template <> OVM_EXPORT
const std::string typeName<std::vector<VertexHandle> >();
71 template <> OVM_EXPORT
const std::string typeName<std::vector<HalfFaceHandle> >();
72 template <> OVM_EXPORT
const std::string typeName<std::vector<std::vector<HalfFaceHandle> > >();
74 template<
typename Entity>
75 const std::string entityTypeName();
77 template <> OVM_EXPORT
const std::string entityTypeName<Entity::Vertex>();
78 template <> OVM_EXPORT
const std::string entityTypeName<Entity::HalfEdge>();
79 template <> OVM_EXPORT
const std::string entityTypeName<Entity::Edge>();
80 template <> OVM_EXPORT
const std::string entityTypeName<Entity::Face>();
81 template <> OVM_EXPORT
const std::string entityTypeName<Entity::HalfFace>();
82 template <> OVM_EXPORT
const std::string entityTypeName<Entity::Cell>();
83 template <> OVM_EXPORT
const std::string entityTypeName<Entity::Mesh>();
85 template<
typename T,
typename Entity>
86 class PropertyTT :
public PropertyPtr<OpenVolumeMeshPropertyT<T>, Entity> {
89 using entity_type = Entity;
90 template<
typename MeshT>
91 PropertyTT(MeshT *mesh,
const std::string& _name,
const T &_def = T())
92 : PropertyTT(
std::move(mesh->template request_property<T, Entity>(_name, _def)))
94 PropertyTT (
const PropertyTT<T, Entity>&) =
default;
95 PropertyTT (PropertyTT<T,Entity>&&) =
default;
98 PropertyTT<T, Entity>& operator=(
const PropertyTT<T, Entity>&) =
delete;
99 PropertyTT<T, Entity>& operator=(PropertyTT<T, Entity>&&) =
default;
102 PropertyTT(
const std::string& _name,
const std::string& _internal_type_name, ResourceManager& _resMan,
PropertyHandleT _handle,
const T &_def = T());
103 ~PropertyTT()
override =
default;
104 BaseProperty* clone(ResourceManager &_resMan, OpenVolumeMeshHandle _handle)
const override;
105 const std::string entityType()
const override {
return entityTypeName<Entity>(); }
106 const std::string typeNameWrapper()
const override {
return typeName<T>(); }
108 PropertyTT(OpenVolumeMeshPropertyT<T> *_prop, ResourceManager& _resMan,
PropertyHandleT _handle);
111 template<
typename T>
using VertexPropertyT = PropertyTT<T, Entity::Vertex>;
112 template<
typename T>
using EdgePropertyT = PropertyTT<T, Entity::Edge>;
113 template<
typename T>
using HalfEdgePropertyT = PropertyTT<T, Entity::HalfEdge>;
114 template<
typename T>
using FacePropertyT = PropertyTT<T, Entity::Face>;
115 template<
typename T>
using HalfFacePropertyT = PropertyTT<T, Entity::HalfFace>;
116 template<
typename T>
using CellPropertyT = PropertyTT<T, Entity::Cell>;
117 template<
typename T>
using MeshPropertyT = PropertyTT<T, Entity::Mesh>;
122 #if defined(INCLUDE_TEMPLATES) && !defined(PROPERTYDEFINEST_CC) 123 #include "PropertyDefinesT_impl.hh" The property handle, use it to access the properties.
DLLEXPORT QString typeName(DataType _id)
Get the name of a type with given id.