Commit 961a702b authored by Pierre Kraemer's avatar Pierre Kraemer

VertexAttribute, ... constructors

parent 77055cac
...@@ -201,7 +201,7 @@ void Viewer::importMesh(std::string& filename) ...@@ -201,7 +201,7 @@ void Viewer::importMesh(std::string& filename)
if (extension == std::string(".map")) if (extension == std::string(".map"))
{ {
myMap.loadMapBin(filename); myMap.loadMapBin(filename);
position = myMap.getAttribute<PFP::VEC3, VERTEX>("position") ; position = myMap.getAttribute<VEC3, VERTEX>("position") ;
} }
else else
{ {
...@@ -226,9 +226,9 @@ void Viewer::importMesh(std::string& filename) ...@@ -226,9 +226,9 @@ void Viewer::importMesh(std::string& filename)
normalBaseSize = bb.diagSize() / 100.0f ; normalBaseSize = bb.diagSize() / 100.0f ;
// vertexBaseSize = normalBaseSize / 5.0f ; // vertexBaseSize = normalBaseSize / 5.0f ;
normal = myMap.getAttribute<PFP::VEC3, VERTEX>("normal") ; normal = myMap.getAttribute<VEC3, VERTEX>("normal") ;
if(!normal.isValid()) if(!normal.isValid())
normal = myMap.addAttribute<PFP::VEC3, VERTEX>("normal") ; normal = myMap.addAttribute<VEC3, VERTEX>("normal") ;
Algo::Geometry::computeNormalVertices<PFP>(myMap, position, normal) ; Algo::Geometry::computeNormalVertices<PFP>(myMap, position, normal) ;
......
...@@ -196,37 +196,45 @@ template <typename T> ...@@ -196,37 +196,45 @@ template <typename T>
class VertexAttribute : public AttributeHandler<T, VERTEX> class VertexAttribute : public AttributeHandler<T, VERTEX>
{ {
public: public:
VertexAttribute<T>& operator=(const AttributeHandler<T, VERTEX>& ta) { this->AttributeHandler<T, VERTEX>::operator=(ta); return *this; } VertexAttribute() : AttributeHandler<T, VERTEX>() {}
VertexAttribute(const AttributeHandler<T, VERTEX>& ah) : AttributeHandler<T, VERTEX>(ah) {}
VertexAttribute<T>& operator=(const AttributeHandler<T, VERTEX>& ah) { this->AttributeHandler<T, VERTEX>::operator=(ah); return *this; }
}; };
/** /**
* shortcut class for Edge Attribute (Handler) * shortcut class for Edge Attribute (Handler)
*/ */
template <typename T> template <typename T>
class EdgeAttribute : public AttributeHandler<T,EDGE> class EdgeAttribute : public AttributeHandler<T, EDGE>
{ {
public: public:
EdgeAttribute<T>& operator=(const AttributeHandler<T, EDGE>& ta) { this->AttributeHandler<T, EDGE>::operator=(ta); return *this; } EdgeAttribute() : AttributeHandler<T, EDGE>() {}
EdgeAttribute(const AttributeHandler<T, EDGE>& ah) : AttributeHandler<T, EDGE>(ah) {}
EdgeAttribute<T>& operator=(const AttributeHandler<T, EDGE>& ah) { this->AttributeHandler<T, EDGE>::operator=(ah); return *this; }
}; };
/** /**
* shortcut class for Face Attribute (Handler) * shortcut class for Face Attribute (Handler)
*/ */
template <typename T> template <typename T>
class FaceAttribute : public AttributeHandler<T,FACE> class FaceAttribute : public AttributeHandler<T, FACE>
{ {
public: public:
FaceAttribute<T>& operator=(const AttributeHandler<T, FACE>& ta) { this->AttributeHandler<T, FACE>::operator=(ta); return *this; } FaceAttribute() : AttributeHandler<T, FACE>() {}
FaceAttribute(const AttributeHandler<T, FACE>& ah) : AttributeHandler<T, FACE>(ah) {}
FaceAttribute<T>& operator=(const AttributeHandler<T, FACE>& ah) { this->AttributeHandler<T, FACE>::operator=(ah); return *this; }
}; };
/** /**
* shortcut class for Volume Attribute (Handler) * shortcut class for Volume Attribute (Handler)
*/ */
template <typename T> template <typename T>
class VolumeAttribute : public AttributeHandler<T,VOLUME> class VolumeAttribute : public AttributeHandler<T, VOLUME>
{ {
public: public:
VolumeAttribute<T>& operator=(const AttributeHandler<T, VOLUME>& ta) { this->AttributeHandler<T, VOLUME>::operator=(ta); return *this; } VolumeAttribute() : AttributeHandler<T, VOLUME>() {}
VolumeAttribute(const AttributeHandler<T, VOLUME>& ah) : AttributeHandler<T, VOLUME>(ah) {}
VolumeAttribute<T>& operator=(const AttributeHandler<T, VOLUME>& ah) { this->AttributeHandler<T, VOLUME>::operator=(ah); return *this; }
}; };
} // namespace CGoGN } // namespace CGoGN
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment