add function to property that return a unique string for their type
This commit is contained in:
@@ -133,6 +133,9 @@ public: // I/O support
|
|||||||
/// persistency.
|
/// persistency.
|
||||||
virtual void set_persistent( bool _yn ) = 0;
|
virtual void set_persistent( bool _yn ) = 0;
|
||||||
|
|
||||||
|
///returns a unique string for the type of the elements
|
||||||
|
virtual std::string get_storage_name() const = 0;
|
||||||
|
|
||||||
/// Number of elements in property
|
/// Number of elements in property
|
||||||
virtual size_t n_elements() const = 0;
|
virtual size_t n_elements() const = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -54,6 +54,7 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <OpenMesh/Core/Utils/typename.hh>
|
||||||
|
|
||||||
|
|
||||||
//== NAMESPACES ===============================================================
|
//== NAMESPACES ===============================================================
|
||||||
@@ -207,6 +208,10 @@ public: // data access interface
|
|||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string get_storage_name() const override
|
||||||
|
{
|
||||||
|
return get_string_for_type(T());
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
@@ -371,6 +376,11 @@ public:
|
|||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string get_storage_name() const override
|
||||||
|
{
|
||||||
|
return get_string_for_type(bool());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
@@ -457,6 +467,11 @@ public:
|
|||||||
PropertyT<value_type>* p = new PropertyT<value_type>( *this );
|
PropertyT<value_type>* p = new PropertyT<value_type>( *this );
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string get_storage_name() const override
|
||||||
|
{
|
||||||
|
return get_string_for_type(std::string());
|
||||||
|
}
|
||||||
private:
|
private:
|
||||||
|
|
||||||
vector_type data_;
|
vector_type data_;
|
||||||
|
|||||||
Reference in New Issue
Block a user