42 #include "Entities.hh" 43 #include "PropertyHandles.hh" 44 #include "PropertyPtr.hh" 49 class OpenVolumeMeshPropertyT;
51 class ResourceManager;
56 template <>
const std::string typeName<int>();
57 template <>
const std::string typeName<unsigned int>();
58 template <>
const std::string typeName<short>();
59 template <>
const std::string typeName<long>();
60 template <>
const std::string typeName<unsigned long>();
61 template <>
const std::string typeName<char>();
62 template <>
const std::string typeName<unsigned char>();
63 template <>
const std::string typeName<bool>();
64 template <>
const std::string typeName<float>();
65 template <>
const std::string typeName<double>();
66 template <>
const std::string typeName<std::string>();
67 template <>
const std::string typeName<std::map<HalfEdgeHandle, int> >();
68 template <>
const std::string typeName<std::vector<double> >();
69 template <>
const std::string typeName<std::vector<VertexHandle> >();
70 template <>
const std::string typeName<std::vector<HalfFaceHandle> >();
71 template <>
const std::string typeName<std::vector<std::vector<HalfFaceHandle> > >();
73 template<
typename Entity>
74 const std::string entityTypeName();
76 template <>
const std::string entityTypeName<Entity::Vertex>();
77 template <>
const std::string entityTypeName<Entity::HalfEdge>();
78 template <>
const std::string entityTypeName<Entity::Edge>();
79 template <>
const std::string entityTypeName<Entity::Face>();
80 template <>
const std::string entityTypeName<Entity::HalfFace>();
81 template <>
const std::string entityTypeName<Entity::Cell>();
82 template <>
const std::string entityTypeName<Entity::Mesh>();
84 template<
typename T,
typename Entity>
85 class PropertyTT :
public PropertyPtr<OpenVolumeMeshPropertyT<T>, Entity> {
88 using entity_type = Entity;
89 template<
typename MeshT>
90 PropertyTT(MeshT *mesh,
const std::string& _name,
const T &_def = T())
91 : PropertyTT(
std::move(mesh->template request_property<T, Entity>(_name, _def)))
94 PropertyTT(
const std::string& _name,
const std::string& _internal_type_name, ResourceManager& _resMan,
PropertyHandleT _handle,
const T &_def = T());
95 ~PropertyTT()
override =
default;
96 BaseProperty* clone(ResourceManager &_resMan, OpenVolumeMeshHandle _handle)
const override;
97 const std::string entityType()
const override {
return entityTypeName<Entity>(); }
98 const std::string typeNameWrapper()
const override {
return typeName<T>(); }
100 PropertyTT(OpenVolumeMeshPropertyT<T> *_prop, ResourceManager& _resMan,
PropertyHandleT _handle);
103 template<
typename T>
using VertexPropertyT = PropertyTT<T, Entity::Vertex>;
104 template<
typename T>
using EdgePropertyT = PropertyTT<T, Entity::Edge>;
105 template<
typename T>
using HalfEdgePropertyT = PropertyTT<T, Entity::HalfEdge>;
106 template<
typename T>
using FacePropertyT = PropertyTT<T, Entity::Face>;
107 template<
typename T>
using HalfFacePropertyT = PropertyTT<T, Entity::HalfFace>;
108 template<
typename T>
using CellPropertyT = PropertyTT<T, Entity::Cell>;
109 template<
typename T>
using MeshPropertyT = PropertyTT<T, Entity::Mesh>;
114 #if defined(INCLUDE_TEMPLATES) && !defined(PROPERTYDEFINEST_CC) 115 #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.