Commit 0bc4ace7 authored by Jan's avatar Jan
Browse files

Hide adaptor template

parent 446b8725
......@@ -73,6 +73,62 @@ static const int COLORRANGE_0_1 = 0;
//== IMPLEMENTATION ==============================================
template <typename MeshT>
class AdaptorMesh : public AdaptorBase {
public:
AdaptorMesh(MeshT& _mesh) : mesh_(_mesh),currentPoint_(0) {}
void clear() override {
mesh_.clear();
};
void add_point(ACG::Vec3d _point) override {
currentPoint_ = mesh_.add_vertex(_point);
};
void setNormal(ACG::Vec3d _normal) override{
mesh_.set_normal( currentPoint_,_normal );
};
void setColor(ACG::Vec4f _color) override{
mesh_.set_color( currentPoint_,_color );
};
void setPointSize(double /*_size*/ ) override {
};
void setIndex(int /*_size*/ ) override {
};
void request_vertex_normals() override {
mesh_.request_vertex_normals();
}
void request_vertex_colors() override {
mesh_.request_vertex_colors();
}
virtual void request_point_sizes() override {
}
virtual void request_indices() override {
}
void reserve(int _size) override {
mesh_.reserve(_size,0,0);
};
private :
MeshT& mesh_;
typename MeshT::VertexHandle currentPoint_;
};
FilePTSPlugin::FilePTSPlugin() :
loadOptions_( 0 ),
......
......@@ -96,57 +96,10 @@ public:
virtual void request_vertex_normals() = 0;
virtual void request_vertex_colors() = 0;
virtual void request_point_sizes() = 0;
virtual void request_indices() = 0;
virtual void reserve(int _size) = 0;
};
template <typename MeshT>
class AdaptorMesh : public AdaptorBase {
public:
AdaptorMesh(MeshT& _mesh) : mesh_(_mesh),currentPoint_(0) {}
void clear() override {
mesh_.clear();
};
void add_point(ACG::Vec3d _point) override {
currentPoint_ = mesh_.add_vertex(_point);
};
void setNormal(ACG::Vec3d _normal) override{
mesh_.set_normal( currentPoint_,_normal );
};
void setColor(ACG::Vec4f _color) override{
mesh_.set_color( currentPoint_,_color );
};
void setPointSize(double /*_size*/ ) override {
};
void setIndex(int /*_size*/ ) override {
};
void request_vertex_normals(){
mesh_.request_vertex_normals();
}
void request_vertex_colors() {
mesh_.request_vertex_colors();
}
void reserve(int _size) {
mesh_.reserve(_size,0,0);
};
private :
MeshT& mesh_;
typename MeshT::VertexHandle currentPoint_;
};
......
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