diff --git a/wrap/dae/meshaccessors.h b/wrap/dae/meshaccessors.h deleted file mode 100644 index c4fd927c..00000000 --- a/wrap/dae/meshaccessors.h +++ /dev/null @@ -1,254 +0,0 @@ -#ifndef _MESH_ACCESSORS_H -#define _MESH_ACCESSORS_H - - -template -struct CoordNumber -{ -public: - static unsigned int coord() - { - return 0; - } -}; - -template<> -struct CoordNumber -{ -public: - static unsigned int coord() - { - return 2; - } -}; - -template<> -struct CoordNumber -{ -public: - static unsigned int coord() - { - return 3; - } -}; - -template<> -struct CoordNumber -{ -public: - static unsigned int coord() - { - return 4; - } -}; - - - - -namespace MeshAccessors -{ -template -class VertexAccessor -{ -public: - typedef typename MESHTYPE::ConstVertexIterator ConstIterator; - typedef typename MESHTYPE::VertexIterator Iterator; - - VertexAccessor(MESHTYPE& m) - :_m(m) - { - - } - - ConstIterator begin() const - { - return _m.vert.begin(); - } - - ConstIterator end() const - { - return _m.vert.end(); - } - - Iterator begin() - { - return _m.vert.begin(); - } - - Iterator end() - { - return _m.vert.end(); - } - - MESHTYPE& _m; -}; - -template -class VertexPositionAccessor : public VertexAccessor -{ -public: - VertexPositionAccessor(MESHTYPE& m) - :VertexAccessor(m) - { - } - - template - typename const VERTEXTYPE::CoordType operator()(VERTEXTYPE& v) const - { - return v.P(); - } -}; - -template -class VertexNormalAccessor : public VertexAccessor -{ -public: - VertexNormalAccessor(MESHTYPE& m) - :VertexAccessor(m) - { - } - - template - typename const VERTEXTYPE::NormalType operator()(VERTEXTYPE& v) const - { - return v.N(); - } -}; - -template -class VertexTextureCoordinateAccessor : public VertexAccessor -{ -public: - VertexTextureCoordinateAccessor(MESHTYPE& m) - :VertexAccessor(m) - { - } - - template - typename const VERTEXTYPE::TexCoordType operator()(VERTEXTYPE& v) const - { - return v.T(); - } -}; - -template -class PolygonAccessor -{ -public: - typedef typename MESHTYPE::ConstFaceIterator ConstIterator; - typedef typename MESHTYPE::FaceIterator Iterator; - - PolygonAccessor(MESHTYPE& m) - :_m(m) - { - - } - - ConstIterator begin() const - { - return _m.face.begin(); - } - - ConstIterator end() const - { - return _m.face.end(); - } - - Iterator begin() - { - return _m.face.begin(); - } - - Iterator end() - { - return _m.face.end(); - } - - MESHTYPE& _m; -}; - -template -class PolygonPositionAccessor : public PolygonAccessor -{ -public: - PolygonPositionAccessor(MESHTYPE& m) - :PolygonAccessor(m) - { - } - - template - typename const POLYGONTYPE::CoordType operator()(POLYGONTYPE& p,const unsigned int index) const - { - return p.V(i)->P(); - } -}; - -template -class PolygonNormalAccessor : public PolygonAccessor -{ -public: - PolygonNormalAccessor(MESHTYPE& m) - :PolygonAccessor(m) - { - } - - template - typename const POLYGONTYPE::NormalType operator()(const POLYGONTYPE& p) const - { - POLYGONTYPE::NormalType r = p.cN(); - return r.Normalize(); - } -}; - -template -class PolygonWedgeTextureCoordinateAccessor : public PolygonAccessor -{ -public: - template - typename const POLYGONTYPE::TexCoordType operator()(POLYGONTYPE& p,const unsigned int index) const - { - return p.cWT(index); - } - - PolygonWedgeTextureCoordinateAccessor(MESHTYPE& m) - :PolygonAccessor(m) - { - } -}; -} //MeshAccessors - -template -struct AccessorInfo -{ - AccessorInfo(const MESHTYPE& m) - :_a(m) - { - - } - - ACCESSOR _a; -}; - -template -struct AccessorComponentNumberInfo : public AccessorInfo -{ - AccessorComponentNumberInfo(const MESHTYPE& m) - :AccessorInfo(m) - { - } - - unsigned int _return_value_component_number; -}; - -template -struct AccessorPolygonEdgeNumberInfo : public AccessorInfo -{ - AccessorPolygonEdgeNumberInfo(const MESHTYPE& m) - :AccessorInfo(m) - { - } - - unsigned int _edge_number; -}; - -#endif \ No newline at end of file