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>, PropHandleT<Entity>> {
88 PropertyTT(
const std::string& _name, ResourceManager& _resMan,
PropertyHandleT _handle,
const T _def = T());
89 virtual ~PropertyTT() =
default;
90 virtual BaseProperty* clone(ResourceManager &_resMan, OpenVolumeMeshHandle _handle)
const;
91 virtual void serialize(std::ostream& _ostr)
const;
92 virtual void deserialize(std::istream& _istr);
93 virtual const std::string entityType()
const {
return entityTypeName<Entity>(); }
94 virtual const std::string typeNameWrapper()
const {
return typeName<T>(); }
96 PropertyTT(OpenVolumeMeshPropertyT<T> *_prop, ResourceManager& _resMan,
PropertyHandleT _handle);
99 template<
typename T>
using VertexPropertyT = PropertyTT<T, Entity::Vertex>;
100 template<
typename T>
using EdgePropertyT = PropertyTT<T, Entity::Edge>;
101 template<
typename T>
using HalfEdgePropertyT = PropertyTT<T, Entity::HalfEdge>;
102 template<
typename T>
using FacePropertyT = PropertyTT<T, Entity::Face>;
103 template<
typename T>
using HalfFacePropertyT = PropertyTT<T, Entity::HalfFace>;
104 template<
typename T>
using CellPropertyT = PropertyTT<T, Entity::Cell>;
105 template<
typename T>
using MeshPropertyT = PropertyTT<T, Entity::Mesh>;
110 #if defined(INCLUDE_TEMPLATES) && !defined(PROPERTYDEFINEST_CC) 111 #include "PropertyDefinesT_impl.hh" DLLEXPORT QString typeName(DataType _id)
Get the name of a type with given id.
The property handle, use it to access the properties.