diff --git a/Apps/Examples/frame_manip.cpp b/Apps/Examples/frame_manip.cpp index 2f6d015aabdd2e8c355a2dd2be8aaaf22e846470..28d7d4f1cc9bf818ad047203a2f4272f95b259f1 100644 --- a/Apps/Examples/frame_manip.cpp +++ b/Apps/Examples/frame_manip.cpp @@ -47,8 +47,6 @@ #include "glm/gtc/type_precision.hpp" #include "glm/gtc/type_ptr.hpp" -//#include "Utils/textures.h" - using namespace CGoGN; struct PFP: public PFP_STANDARD diff --git a/include/Utils/frameManipulator.h b/include/Utils/frameManipulator.h index da0fa139cb10e9570cdf6a10b1fedeca1b2e6cae..77676d6251858ac483ef0bfa6e9943f8a8c5de95 100644 --- a/include/Utils/frameManipulator.h +++ b/include/Utils/frameManipulator.h @@ -28,7 +28,6 @@ #include "Utils/vbo.h" #include "glm/glm.hpp" -//#include "Utils/Shaders/shaderColorPerVertex.h" #include "Utils/Shaders/shaderSimpleColor.h" #include "Utils/pickables.h" @@ -39,271 +38,6 @@ namespace Utils { -// -// -//class LineDrawable -//{ -//protected: -// -// /** -// * VBO for position -// */ -// Utils::VBO* m_vboPos; -// -// /** -// * Shader -// */ -// Utils::ShaderSimpleColor* m_shader; -// -// /** -// * number of indices in vbo -// */ -// unsigned int m_nb; -// -//public: -// /** -// * constructor -// */ -// LineDrawable(); -// -// /** -// * destructor -// */ -// virtual ~LineDrawable(); -// -// /** -// * set the color of drawing -// */ -// void setColor(const Geom::Vec4f& col); -// -// /** -// * draw the Drawable at origin with size=1 -// */ -// virtual void draw(); -// -// /** -// * picking -// * @param P camera point -// * @param V vector ray direction -// * @param epsilon distance epsilon for picking -// * @return code picking (0: nothing picked / != 0 something picked) -// */ -// virtual unsigned int pick(const Geom::Vec3f& P, const Geom::Vec3f& V, float epsilon=0.0f) = 0; -// -//}; -// -// -//class Pickable -//{ -//protected: -// /** -// * type of drawable -// */ -// LineDrawable* m_drawable; -// -// /** -// * transformation matrix -// */ -// glm::mat4 m_transfo; -// -// /** -// * id of pickable -// */ -// unsigned int m_id; -// -//public: -// /** -// * constructor -// * @param ld LineDrawable to use for drawing & picking -// */ -// Pickable(LineDrawable* ld, unsigned int id): -// m_drawable(ld),m_transfo(1.0f), m_id(id) -// {} -// -// /** -// * picking -// * @param P camera point -// * @param V vector ray direction -// * @param epsilon distance epsilon for picking -// * @return code picking (0: nothing picked / != 0 something picked) -// */ -// unsigned int pick(const Geom::Vec3f& P, const Geom::Vec3f& V, float epsilon=0.0f); -// -// /** -// * apply inverse transfo on picking ray -// */ -// static void invertPV(const Geom::Vec3f& P, const Geom::Vec3f& V, const glm::mat4& transfo, Geom::Vec3f& PP, Geom::Vec3f& VV); -// -// /** -// * draw -// */ -// void draw() { m_drawable->draw();} -// -// /** -// * return a ref on the transformation matrix -// */ -// glm::mat4& transfo(); -// -// void rotate(float angle, const Geom::Vec3f& Axis); -// -// void translate(const Geom::Vec3f& P); -// -// void scale(const Geom::Vec3f& S); -// -// /** -// * pick a vector of pickable and return the closest -// */ -// static unsigned int pick(const std::vector& picks,const Geom::Vec3f& P, const Geom::Vec3f& V, Pickable*& res); -// -// float distancefrom(const Geom::Vec3f& P); -// -// -//}; -// -// -///** -// * Grid (-1,-1,0 ; 1,1,0) -// */ -//class Grid: public LineDrawable -//{ -//public: -// /** -// * constructor -// * @param sub number of subdivision of grig -// */ -// Grid(unsigned int sub=5); -// -// /** -// * change topo subdivision -// */ -// void changeTopo(unsigned int sub); -// -// /** -// * picking -// */ -// unsigned int pick(const Geom::Vec3f& P, const Geom::Vec3f& V, float epsilon=0.0f); -//}; -// -// -///** -// * Sphere of radius 1 drawon with lines -// */ -//class Sphere: public LineDrawable -//{ -//protected: -// GLuint m_ind; -//public: -// /** -// * constructor -// * @param par number of parallels -// * @param mer number of meridians -// */ -// Sphere(unsigned int par=5, unsigned int mer=5); -// -// /** -// * change topo subdivision -// */ -// void changeTopo(unsigned int par, unsigned int mer); -// -// /** -// * specific drawing function for sphere (with indexed vbos) -// */ -// void draw(); -// -// /** -// * picking -// */ -// unsigned int pick(const Geom::Vec3f& P, const Geom::Vec3f& V, float epsilon=0.0f); -//}; -// -// -///** -// * Cone of radius 1 drawon with lines -// */ -//class Cone: public Sphere -//{ -//public: -// /** -// * constructor -// * @param par number of parallels -// * @param mer number of meridians -// */ -// Cone(unsigned int par=5, unsigned int mer=5); -// -// /** -// * change topo subdivision -// */ -// void changeTopo(unsigned int par, unsigned int mer); -// -// /** -// * picking -// */ -// unsigned int pick(const Geom::Vec3f& P, const Geom::Vec3f& V, float epsilon=0.0f); -//}; -// -///** -// * Cone of radius 1 drawon with lines -// */ -//class Cylinder: public Sphere -//{ -//public: -// /** -// * constructor -// * @param par number of parallels -// * @param mer number of meridians -// */ -// Cylinder(unsigned int par=5, unsigned int mer=5); -// -// /** -// * change topo subdivision -// */ -// void changeTopo(unsigned int par, unsigned int mer); -// -// /** -// * picking -// */ -// unsigned int pick(const Geom::Vec3f& P, const Geom::Vec3f& V, float epsilon=0.0f); -//}; -// -// -///** -// * Sphere of radius 1 drawon with lines -// */ -//class Cube: public LineDrawable -//{ -//protected: -// GLuint m_ind; -//public: -// /** -// * constructor -// * @param par number of parallels -// * @param mer number of meridians -// */ -// Cube(unsigned int sub=0); -// -// /** -// * destructor -// */ -// ~Cube(); -// -// /** -// * change topo subdivision -// */ -// void changeTopo(unsigned int sub); -// -// /** -// * specific drawing function for sphere (with indexed vbos) -// */ -// void draw(); -// -// /** -// * picking -// */ -// unsigned int pick(const Geom::Vec3f& P, const Geom::Vec3f& V, float epsilon=0.0f); -//}; -// -// - class FrameManipulator//: public Pickable { diff --git a/src/Utils/GLSLShader.cpp b/src/Utils/GLSLShader.cpp index 8ab0cceaad42a96f42042c38396d4cb5c6d44583..c52b9cb2792e2f9a3518f89f640a9def32ddf442 100644 --- a/src/Utils/GLSLShader.cpp +++ b/src/Utils/GLSLShader.cpp @@ -1028,6 +1028,7 @@ void GLSLShader::enableVertexAttribs(unsigned int stride, unsigned int begin) co void GLSLShader::disableVertexAttribs() const { + this->bind(); for (std::vector::const_iterator it= m_va_vbo_binding.begin(); it != m_va_vbo_binding.end(); ++it) glDisableVertexAttribArray(it->va_id); this->unbind(); diff --git a/src/Utils/clippingShader.cpp b/src/Utils/clippingShader.cpp index 9f0626f7dd5a5aedc065f735ed3d8b0aae423f43..2fe67632440b799ae1d69a47ffb507a313254059 100644 --- a/src/Utils/clippingShader.cpp +++ b/src/Utils/clippingShader.cpp @@ -119,8 +119,8 @@ void ClippingShader::setClipPlanesCount(int planesCount) } else { - //for (int i = planesCount; i < previousPlanesCount; i++) - //delete m_clipPlanesDrawers[i]; // TODO : Bug dans drawer, crash le prochain affichage + for (int i = planesCount; i < previousPlanesCount; i++) + delete m_clipPlanesDrawers[i]; // TODO : Bug dans drawer, crash le prochain affichage m_clipPlanesDrawers.resize((size_t)planesCount); } @@ -521,8 +521,8 @@ void ClippingShader::setClipSpheresCount(int spheresCount) } else { - //for (int i = spheresCount; i < previousSpheresCount; i++) - //delete m_clipSpheresDrawers[i]; // TODO : Bug dans drawer, crash le prochain affichage + for (int i = spheresCount; i < previousSpheresCount; i++) + delete m_clipSpheresDrawers[i]; // TODO : Bug dans drawer, crash le prochain affichage m_clipSpheresDrawers.resize((size_t)spheresCount); }