Commit 268227cb authored by Maire Nicolas's avatar Maire Nicolas

Merge branch 'master' of cgogn:~cgogn/CGoGN

Conflicts:
	Apps/Examples/frame_manip.cpp
parents d4a4b03a e664bed6
......@@ -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
......
......@@ -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<Pickable*>& 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
{
......
......@@ -1028,6 +1028,7 @@ void GLSLShader::enableVertexAttribs(unsigned int stride, unsigned int begin) co
void GLSLShader::disableVertexAttribs() const
{
this->bind();
for (std::vector<Utils::GLSLShader::VAStr>::const_iterator it= m_va_vbo_binding.begin(); it != m_va_vbo_binding.end(); ++it)
glDisableVertexAttribArray(it->va_id);
this->unbind();
......
......@@ -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);
}
......
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