Commit 3dc1a1ed authored by Pierre Kraemer's avatar Pierre Kraemer

ajout ORIENTED_FACE_ORBIT avec Container

parent 39c7eaff
Dépendences Linux:
installer les paquets suivants:
<<<<<<< HEAD
cmake libXi-dev libXmu-dev freeglut3-dev libdevil-dev libglew-dev libgmp3-dev libxml2-dev libboost-dev libzip-dev libqt4-help qt4-designer qt4-dev-tools
=======
cmake libXi-dev libXmu-dev freeglut3-dev libdevil-dev libglew-dev libgmp3-dev libxml2-dev libboost-dev lizip-dev libqt4-dev qt4-designer qt4-dev-tools
>>>>>>> 84fe346d20a65b08cb049bffc98c793c70f687f2
Pour compiler CGoGN:
......
......@@ -36,14 +36,15 @@
#define EMBNULL 0xffffffff
#define NB_ORBITS 5
#define NB_ORBITS 6
#define NBTHREAD 16
#define VERTEX_ORBIT (unsigned int)(0)
#define EDGE_ORBIT (unsigned int)(1)
#define FACE_ORBIT (unsigned int)(2)
#define VOLUME_ORBIT (unsigned int)(3)
#define DART_ORBIT (unsigned int)(4)
#define VERTEX_ORBIT (unsigned int)(0)
#define EDGE_ORBIT (unsigned int)(1)
#define ORIENTED_FACE_ORBIT (unsigned int)(2)
#define FACE_ORBIT (unsigned int)(3)
#define VOLUME_ORBIT (unsigned int)(4)
#define DART_ORBIT (unsigned int)(5)
#include "Container/attributeContainer.h"
......@@ -386,6 +387,7 @@ public:
virtual bool foreach_dart_of_vertex(Dart d, FunctorType& f, unsigned int thread = 0) = 0;
virtual bool foreach_dart_of_edge(Dart d, FunctorType& f, unsigned int thread = 0) = 0;
virtual bool foreach_dart_of_oriented_face(Dart d, FunctorType& f, unsigned int thread = 0) = 0;
virtual bool foreach_dart_of_face(Dart d, FunctorType& f, unsigned int thread = 0) = 0;
virtual bool foreach_dart_of_volume(Dart d, FunctorType& f, unsigned int thread = 0) = 0;
virtual bool foreach_dart_of_cc(Dart d, FunctorType& f, unsigned int thread = 0) = 0;
......@@ -415,6 +417,7 @@ bool foreach_dart_of_orbit_in_parent(MAP* ptrMap, unsigned int orbit, Dart d, Fu
case DART_ORBIT: return f(d);
case VERTEX_ORBIT: return ptrMap->MAP::ParentMap::foreach_dart_of_vertex(d, f, thread);
case EDGE_ORBIT: return ptrMap->MAP::ParentMap::foreach_dart_of_edge(d, f, thread);
case ORIENTED_FACE_ORBIT: return ptrMap->MAP::ParentMap::foreach_dart_of_oriented_face(d, f, thread);
case FACE_ORBIT: return ptrMap->MAP::ParentMap::foreach_dart_of_face(d, f, thread);
case VOLUME_ORBIT: return ptrMap->MAP::ParentMap::foreach_dart_of_volume(d, f, thread);
default: assert(!"Cells of this dimension are not handled");
......@@ -430,6 +433,7 @@ bool foreach_dart_of_orbit_in_parent2(MAP* ptrMap, unsigned int orbit, Dart d, F
case DART_ORBIT: return f(d);
case VERTEX_ORBIT: return ptrMap->MAP::ParentMap::ParentMap::foreach_dart_of_vertex(d, f,thread);
case EDGE_ORBIT: return ptrMap->MAP::ParentMap::ParentMap::foreach_dart_of_edge(d, f, thread);
case ORIENTED_FACE_ORBIT: return ptrMap->MAP::ParentMap::ParentMap::foreach_dart_of_oriented_face(d, f, thread);
case FACE_ORBIT: return ptrMap->MAP::ParentMap::ParentMap::foreach_dart_of_face(d, f, thread);
case VOLUME_ORBIT: return ptrMap->MAP::ParentMap::ParentMap::foreach_dart_of_volume(d, f, thread);
default: assert(!"Cells of this dimension are not handled");
......
......@@ -38,7 +38,7 @@ protected:
public:
Marker(Mark m, unsigned int cell): Mark(m), m_cell(cell) {}
#ifndef DART_ORBIT
#define DART_ORBIT (unsigned int)(4)
#define DART_ORBIT (unsigned int)(5)
#endif
Marker(): Mark(0), m_cell(DART_ORBIT) {} // TODO trouver un moyen propre de faire ça
......
......@@ -536,11 +536,12 @@ bool GenericMap::foreach_dart_of_orbit(unsigned int orbit, Dart d, FunctorType&
{
switch(orbit)
{
case DART_ORBIT: return f(d);
case VERTEX_ORBIT: return foreach_dart_of_vertex(d, f,thread);
case EDGE_ORBIT: return foreach_dart_of_edge(d, f,thread);
case FACE_ORBIT: return foreach_dart_of_face(d, f,thread);
case VOLUME_ORBIT: return foreach_dart_of_volume(d, f, thread);
case DART_ORBIT: return f(d);
case VERTEX_ORBIT: return foreach_dart_of_vertex(d, f, thread);
case EDGE_ORBIT: return foreach_dart_of_edge(d, f, thread);
case ORIENTED_FACE_ORBIT: return foreach_dart_of_oriented_face(d, f, thread);
case FACE_ORBIT: return foreach_dart_of_face(d, f, thread);
case VOLUME_ORBIT: return foreach_dart_of_volume(d, f, thread);
// case -1: return foreach_dart_of_cc(d,f,thread);
default: assert(!"Cells of this dimension are not handled");
}
......
......@@ -119,14 +119,13 @@ void GLWidget::recalcModelView()
if (m_cbs)
m_cbs->cb_updateMatrix();
}
void GLWidget::changeCenterOfRotation(const glm::vec3& newCenter)
{
oglPushModelViewMatrix();
m_cbs->modelViewMatrix()= glm::mat4(1.0f);
m_cbs->modelViewMatrix() = glm::mat4(1.0f);
// positionne l'objet / mvt souris
oglTranslate(m_cbs->trans_x(), m_cbs->trans_y(), m_cbs->trans_z());
......@@ -137,7 +136,6 @@ void GLWidget::changeCenterOfRotation(const glm::vec3& newCenter)
// update matrice
m_cbs->modelViewMatrix() *= m;
// ajout transformation in screen
m_cbs->modelViewMatrix()*= m_cbs->transfoMatrix();
......@@ -145,12 +143,11 @@ void GLWidget::changeCenterOfRotation(const glm::vec3& newCenter)
oglScale(m_obj_sc, m_obj_sc, m_obj_sc);
oglTranslate(m_obj_pos[0], m_obj_pos[1], m_obj_pos[2]);
oglTranslate(newCenter[0], newCenter[1], newCenter[2]);
oglScale(1.0f/m_obj_sc, 1.0f/m_obj_sc, 1.0f/m_obj_sc);
oglScale(1.0f / m_obj_sc, 1.0f / m_obj_sc, 1.0f / m_obj_sc);
m = glm::inverse(m_cbs->transfoMatrix());
m_cbs->modelViewMatrix()*= m;
m_cbs->modelViewMatrix() *= m;
matrix_to_quat( m_cbs->curquat(), m_cbs->modelViewMatrix());
......@@ -160,10 +157,9 @@ void GLWidget::changeCenterOfRotation(const glm::vec3& newCenter)
oglPopModelViewMatrix();
m_obj_pos = glm::vec3(-newCenter[0],-newCenter[1],-newCenter[2]);
m_obj_pos = glm::vec3(-newCenter[0], -newCenter[1], -newCenter[2]);
}
void GLWidget::initializeGL()
{
glEnable(GL_DEPTH_TEST);
......@@ -240,11 +236,10 @@ void GLWidget::mouseDoubleClickEvent(QMouseEvent* event)
}
}
void GLWidget::mouseMoveEvent(QMouseEvent* event)
{
// move object only if no special keys pressed
if (!(m_state_modifier & ( Qt::ShiftModifier|Qt::ControlModifier|Qt::AltModifier| Qt::MetaModifier)))
if (!(m_state_modifier & ( Qt::ShiftModifier | Qt::ControlModifier | Qt::AltModifier | Qt::MetaModifier)))
{
int x = event->x();
int y = event->y();
......
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