Commit 721eb1c3 authored by Thomas's avatar Thomas

correction include pickable, correction check 3gmap

parent 68b2491a
......@@ -32,17 +32,19 @@
SimpleGMap3::SimpleGMap3()
{
position = myMap.addAttribute<PFP::VEC3>(VERTEX, "position");
normal = myMap.addAttribute<PFP::VEC3>(VERTEX, "position");
normal = myMap.addAttribute<PFP::VEC3>(VERTEX, "normal");
volume = myMap.addAttribute<PFP::VEC3>(VOLUME, "volume");
Algo::Modelisation::Primitive3D<PFP> primCat(myMap,position);
Dart d = primCat.hexaGrid_topo(2,1,1);
primCat.embedHexaGrid(1,1,1);
Dart d = primCat.hexaGrid_topo(3,1,1);
primCat.embedHexaGrid(2,1,1);
myMap.check();
DartMarker markOrient(myMap);
std::vector<Dart> orient;
FunctorStore fs(orient);
d = 49;
myMap.foreach_dart_of_oriented_volume(d,fs);
for(std::vector<Dart>::iterator it = orient.begin() ; it != orient.end() ; ++it)
......
......@@ -55,6 +55,7 @@ public:
PFP::TVEC3 position ;
PFP::TVEC3 normal ;
PFP::TVEC3 volume ;
SimpleGMap3() ;
......
......@@ -113,7 +113,6 @@ void catmullClarkVol(typename PFP::MAP& map, EMBV& attributs, const FunctorSelec
//memorize each vertices per volumes
if(selected(d) && !mv.isMarked(d))
{
std::cout << " d " << d << std::endl;
l_vertices.push_back(d);
mv.markOrbitInParent<typename PFP::MAP>(VERTEX,d);
}
......@@ -145,12 +144,6 @@ void catmullClarkVol(typename PFP::MAP& map, EMBV& attributs, const FunctorSelec
}
}
unsigned int nb_=0;
for(unsigned int nb= attributs.begin() ; nb != attributs.end() ; attributs.next(nb))
nb_++;
std::cout << "first " << nb_ << std::endl;
// second pass: quandrangule faces
std::map<Dart,Dart> toSew;
for (Dart d = map.begin(); d != map.end(); map.next(d))
......@@ -230,12 +223,6 @@ void catmullClarkVol(typename PFP::MAP& map, EMBV& attributs, const FunctorSelec
}
}
nb_=0;
for(unsigned int nb= attributs.begin() ; nb != attributs.end() ; attributs.next(nb))
nb_++;
std::cout << "then " << nb_ << std::endl;
map.check();
//sew all faces leading to the central vertex
......
......@@ -182,7 +182,7 @@ void TopoRenderMapD::updateData(typename PFP::MAP& map, const typename PFP::TVEC
template<typename PFP>
void TopoRenderGMap::updateData(typename PFP::MAP& map, const typename PFP::TVEC3& positions, float ke, float kf, const FunctorSelect& good)
{
/*
/*
typedef typename PFP::VEC3 VEC3;
typedef typename PFP::REAL REAL;
......
......@@ -24,7 +24,7 @@
#ifndef __PICKABLES_H_
#define __PICKABLE_H_
#define __PICKABLES_H_
#include "Utils/vbo.h"
#include "glm/glm.hpp"
......@@ -270,7 +270,7 @@ class Grid: public LineDrawable
public:
/**
* constructor
* @param sub number of subdivision of grig
* @param sub number of subdivision of grid
*/
Grid(unsigned int sub=5);
......
......@@ -477,6 +477,30 @@ bool EmbeddedGMap3::check()
}
}
if (isOrbitEmbedded(VERTEX))
{
delete dvMark;
delete vMark;
}
if (isOrbitEmbedded(EDGE))
{
delete deMark;
delete eMark;
}
if (isOrbitEmbedded(FACE))
{
delete dfMark;
delete fMark;
}
if (isOrbitEmbedded(VOLUME))
{
delete dvolMark;
delete volMark;
}
CGoGNout << "Check: embedding ok" << CGoGNendl ;
return true ;
}
......
......@@ -134,7 +134,6 @@ glm::mat4& Pickable::transfo()
return m_transfo;
}
void Pickable::rotate(float angle, const Geom::Vec3f& Axis)
{
m_transfo = glm::rotate(m_transfo, angle, glm::vec3(Axis[0],Axis[1],Axis[2]));
......@@ -472,7 +471,7 @@ unsigned int Sphere::pick(const Geom::Vec3f& P, const Geom::Vec3f& V, Geom::Vec3
I=P;
I.normalize(); // grossiere approximation TODO amelioerer approxim ?
I.normalize(); // grossiere approximation TODO ameliorer approxim ?
return 1;
}
......
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