Commit cb5cee7a authored by Sylvain Thery's avatar Sylvain Thery

Merge branch 'master' of cgogn:/home/kraemer/CGoGN

parents dfec0f93 e3b35f88
......@@ -443,15 +443,14 @@ int main(int argc, char **argv)
char* filename = argv[1] ;
mgw->position = myMap.addAttribute<PFP::VEC3>(VERTEX_ORBIT, "position") ;
GLint t1 = glutGet(GLUT_ELAPSED_TIME) ;
bool success = Algo::Import::importMesh<PFP>(myMap, filename, mgw->position, Algo::Import::ImportSurfacique::UNKNOWNSURFACE) ;
if(!success)
std::vector<std::string> attrNames ;
if(!Algo::Import::importMesh<PFP>(myMap, filename, attrNames))
{
std::cerr << "could not import "<< filename << std::endl ;
return 1 ;
}
mgw->position = myMap.getAttribute<PFP::VEC3>(VERTEX_ORBIT, attrNames[0]) ;
GLint t2 = glutGet(GLUT_ELAPSED_TIME) ;
GLfloat seconds = (t2 - t1) / 1000.0f ;
std::cout << "import: " << seconds << " sec" << std::endl ;
......
......@@ -44,12 +44,15 @@
using namespace CGoGN ;
struct PFP {
// definition de la carte
struct PFP
{
// definition of the map
typedef Map2 MAP;
// definition du type de reel utilise
// definition of the type of real value
typedef float REAL;
// other types definitions
typedef Geom::Vector<3,REAL> VEC3;
typedef Geom::Vector<6,REAL> VEC6;
typedef Geom::Matrix<3,3,REAL> MATRIX33;
......@@ -58,14 +61,9 @@ struct PFP {
typedef AttributeHandler<VEC3> TVEC3;
typedef AttributeHandler<REAL> TREAL;
typedef AttributeHandler<MATRIX33> TFRAME;
typedef AttributeHandler<MATRIX36> TRGBFUNCS;
};
INIT_STATICS_MAP() ;
typedef PFP::MAP MAP ;
......
......@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 2.6)
project(SocialAgents)
SET(CMAKE_BUILD_TYPE Release)
SET(CMAKE_BUILD_TYPE Debug)
link_directories(
${CGoGN_ROOT_DIR}/lib/Debug/
......
......@@ -148,7 +148,7 @@ void generateSmallCity(typename PFP::MAP& map, EMBV& position, DartMarker& close
// sideSize *= 0.2f;
unsigned int nbBuilding=1000;
float height = sideSize/2.0f;
unsigned int side = 25;
unsigned int side = 18;
generateGrid<PFP,EMBV>(map,position,side,side,sideSize,closeMark);
Dart dEnd = map.end();
......
......@@ -42,11 +42,8 @@
// #include "Algo/Render/topo_vboRender.h"
#include "Algo/Render/topo_render.h"
using namespace CGoGN ;
INIT_STATICS_MAP() ;
typedef PFP::MAP MAP;
class MyGlutWin : public Utils::GlutWin_ATB
......
......@@ -339,8 +339,24 @@ void EnvMap::addNeighborAgents(PFP::AGENTS agentsFrom,PFP::AGENTS agentsTo)
void EnvMap::updateMap()
{
// simplifyFaces();
// subdivideFaces() ;
// map.setCurrentLevel(map.getMaxLevel()) ;
CellMarker m(map, FACE_CELL) ;
for(Dart d = map.begin(); d != map.end(); map.next(d))
{
if(!m.isMarked(d))
{
m.mark(d) ;
std::vector<Agent*>& agents = agentvect[d] ;
for(std::vector<Agent*>::iterator it = agents.begin(); it != agents.end(); ++it)
{
if(!map.sameFace(d, (*it)->part->d))
std::cout << "aaaaaaaaaaaaaaaaaaa" << std::endl ;
}
}
}
subdivideFaces() ;
map.setCurrentLevel(map.getMaxLevel()) ;
}
void EnvMap::subdivideFaces()
......
......@@ -14,18 +14,17 @@ Simulator::Simulator() : agents_(), defaultAgent_(0), globalTime_(0.0f), timeSte
// CGoGN::CityGenerator::generateGrid<PFP,PFP::TVEC3>(envMap.map,envMap.position,100,100,50.0f,envMap.closeMark);
envMap.sideSize = 70.0f;
// CGoGN::CityGenerator::generateSmallCity<PFP,PFP::TVEC3>(envMap.map,envMap.position,envMap.closeMark,envMap.sideSize);
CGoGN::CityGenerator::generateSmallCity<PFP,PFP::TVEC3>(envMap.map,envMap.position,envMap.closeMark,envMap.sideSize);
// CGoGN::CityGenerator::generateAbsolutSpiralOfDeath<PFP>(envMap.map,envMap.position,envMap.closeMark,2000,0.25,110,100);
CGoGN::CityGenerator::generateToboggan<PFP>(envMap.map,envMap.position,envMap.closeMark,100,0.25,200,10);
// CGoGN::CityGenerator::generateToboggan<PFP>(envMap.map,envMap.position,envMap.closeMark,100,0.25,200,10);
// std::cout << "simplify" << std::endl;
// envMap.simplify();
// envMap.map.init();
envMap.map.init();
std::cout << "setup scenario" << std::endl;
// setupScenario();
setupHelicoidScenario(1,50);
setupScenario();
// setupHelicoidScenario(1,50);
// Dart dStop=envMap.map.begin();
// for(unsigned int i=0;i<5000;++i) envMap.map.next(dStop);
......
......@@ -388,9 +388,9 @@ void MyGlutWin::animate(void)
// std::cout << "pos to reach : " << posToReach << std::endl;
// std::cout << sim->getGlobalTime() << " " << std::endl;
updateVisualization(sim);
// sim->setPreferredVelocities(posToReach);
sim->setPreferredVelocities(posToReach);
// sim->setPreferredPathVelocities();
sim->setPreferredNextCellVelocities();
// sim->setPreferredNextCellVelocities();
sim->doStep();
// sim->envMap.simplify();
glutPostRedisplay();
......
......@@ -21,6 +21,7 @@
* Contact information: cgogn@unistra.fr *
* *
*******************************************************************************/
#include <iostream>
#include "Utils/os_spec.h"
......@@ -52,16 +53,17 @@
#include "Algo/Export/export.h"
using namespace CGoGN;
struct PFP
{
// definition de la carte
// definition of the map
typedef EmbeddedMap2<Map2> MAP;
// definition du type de reel utilise
// definition of the type of real value
typedef float REAL;
// other types definitions
typedef Geom::Vector<3,REAL> VEC3;
typedef Geom::Vector<6,REAL> VEC6;
typedef Geom::Matrix<3,3,REAL> MATRIX33;
......@@ -70,14 +72,9 @@ struct PFP
typedef AttributeHandler<VEC3> TVEC3;
typedef AttributeHandler<REAL> TREAL;
typedef AttributeHandler<MATRIX33> TFRAME;
typedef AttributeHandler<MATRIX36> TRGBFUNCS;
};
INIT_STATICS_MAP();
PFP::MAP myMap;
SelectorTrue allDarts;
PFP::TVEC3 position;
......@@ -345,11 +342,11 @@ int main(int argc, char **argv)
// GLint t1 = glutGet(GLUT_ELAPSED_TIME);
position = myMap.addAttribute<Geom::Vec3f>(VERTEX_ORBIT, "position");
if (argc == 1)
{
std::cout <<"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"<<std::endl;
position = myMap.addAttribute<Geom::Vec3f>(VERTEX_ORBIT, "position");
std::cout <<"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"<<std::endl;
// typedef uint8 DATATYPE;
// Algo::MC::Image<DATATYPE> myImg;
// myImg.loadPNG3D("liver.png");
......@@ -391,8 +388,6 @@ std::cout <<"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"<<std::endl;
//
// //realisation du maillage
// mc.simpleMeshing();
//
std::vector<Geom::Vec3f> objV;
objV.push_back(Geom::Vec3f(-1,-1,37));
......@@ -423,8 +418,6 @@ std::cout <<"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"<<std::endl;
pathV.push_back(Geom::Vec3f(5,0 ,-10)); pathRadius.push_back(1.);
// Algo::Modelisation::extrusion<PFP>(myMap, objV, Geom::Vec3f(0.0,0.0,37.0), Geom::Vec3f(0.0,0.0,1.0),false, pathV, false);
Algo::Modelisation::extrusion_scale_prim<PFP>(myMap, position, objV, Geom::Vec3f(0.0,0.0,37.0), Geom::Vec3f(0.0,0.0,1.0),false, pathV, false, pathRadius);
}
// {
......@@ -475,13 +468,14 @@ std::cout <<"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"<<std::endl;
SelectorTrue allDarts;
// GLint t1 = glutGet(GLUT_ELAPSED_TIME);
DartMarker mi(myMap);
bool success = Algo::Import::importMesh<PFP>(myMap, std::string(argv[1]), position, Algo::Import::ImportSurfacique::UNKNOWNSURFACE);
if(!success)
std::vector<std::string> attrNames ;
if(!Algo::Import::importMesh<PFP>(myMap, std::string(argv[1]), attrNames))
{
std::cerr << "could not import "<< std::string(argv[1]) << std::endl ;
std::cerr << "could not import " << std::string(argv[1]) << std::endl ;
exit(1);
}
position = myMap.getAttribute<PFP::VEC3>(VERTEX_ORBIT, attrNames[0]) ;
GLint t1 = glutGet(GLUT_ELAPSED_TIME);
// Algo::Export::exportCTM<PFP>(myMap, position, std::string("pipo.ctm"));
......@@ -525,16 +519,6 @@ std::cout <<"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"<<std::endl;
// GLfloat seconds = (t2 - t1) / 1000.0f;
// std::cout << "import: "<< seconds << "sec" << std::endl;
if (!success)
{
std::cerr << "not possible to import "<<argv[1] << std::endl;
return 1;
}
// else
// for (unsigned int it = position.begin(); it != position.end(); position.next(it))
// {
// std::cout << position[it] << " / "<< normal.at(it)<< std::endl;
// }
}
float area = Algo::Geometry::totalArea<PFP>(myMap, position) ;
......
......@@ -348,12 +348,10 @@ void maillageTest()
int main(int argc, char **argv)
{
//Initilisation du plongement geometrique
position = myMap.addAttribute<PFP::VEC3>(VERTEX_ORBIT, "position");
/*
* Chargement de maillages
*/
std::vector<std::string> attrNames ;
if(argc < 2)
{
std::cerr << "usage : " << argv[0] << " -off" << std::endl;
......@@ -371,7 +369,8 @@ int main(int argc, char **argv)
return 1;
}
Algo::Import::importOFFWithELERegions<PFP>(myMap,position,argv[2],argv[3]);
Algo::Import::importOFFWithELERegions<PFP>(myMap,argv[2],argv[3],attrNames);
position = myMap.getAttribute<PFP::VEC3>(VERTEX_ORBIT, attrNames[0]) ;
}
else if(std::string(argv[1]) == "-tet")
{
......@@ -380,7 +379,8 @@ int main(int argc, char **argv)
return 1;
}
Algo::Import::importTet<PFP>(myMap,position,argv[2]);
Algo::Import::importTet<PFP>(myMap, argv[2], attrNames);
position = myMap.getAttribute<PFP::VEC3>(VERTEX_ORBIT, attrNames[0]) ;
}
else if(std::string(argv[1]) == "-ts")
{
......@@ -389,7 +389,8 @@ int main(int argc, char **argv)
return 1;
}
Algo::Import::importTs<PFP>(myMap,position,argv[2]);
Algo::Import::importTs<PFP>(myMap,argv[2],attrNames);
position = myMap.getAttribute<PFP::VEC3>(VERTEX_ORBIT, attrNames[0]) ;
//scalar = myMap.getAttribute<PFP::REAL>(VERTEX_ORBIT, "scalar");
}
......
......@@ -21,6 +21,7 @@
* Contact information: cgogn@unistra.fr *
* *
*******************************************************************************/
#ifndef __DECIMATIONVOLUMIQUE__
#define __DECIMATIONVOLUMIQUE__
......@@ -45,30 +46,25 @@
using namespace CGoGN ;
struct PFP {
// definition de la carte
struct PFP
{
// definition of the map
typedef Map3 MAP;
// definition du type de reel utilise
// definition of the type of real value
typedef float REAL;
// definition du type de vecteur (point) utilise
// other types definitions
typedef Geom::Vector<3,REAL> VEC3;
// definition du type de matrice 3x3 utilise
typedef Geom::Vector<6,REAL> VEC6;
typedef Geom::Matrix<3,3,REAL> MATRIX33;
// definition du type de matrice 4x4 utilise
typedef Geom::Matrix<4,4,REAL> MATRIX44;
typedef Geom::Matrix<3,6,REAL> MATRIX36;
// definition du type du AttributeHandler de vecteur 3D
typedef AttributeHandler<VEC3> TVEC3;
// definition du type du AttributeHandler de reels
typedef AttributeHandler<REAL> TREAL;
};
// qq initialisation cachees (car penible syntaxiquement)
INIT_STATICS_MAP();
PFP::MAP myMap;
SelectorTrue allDarts;
PFP::TVEC3 position ;
......
......@@ -82,12 +82,15 @@ inline X lerp( X u, X v, double a )
struct PFP {
// definition de la carte
struct PFP
{
// definition of the map
typedef Map2 MAP;
// definition du type de reel utilise
// definition of the type of real value
typedef float REAL;
// other types definitions
typedef Geom::Vector<3,REAL> VEC3;
typedef Geom::Vector<6,REAL> VEC6;
typedef Geom::Matrix<3,3,REAL> MATRIX33;
......@@ -96,15 +99,9 @@ struct PFP {
typedef AttributeHandler<VEC3> TVEC3;
typedef AttributeHandler<REAL> TREAL;
typedef AttributeHandler<MATRIX33> TFRAME;
typedef AttributeHandler<MATRIX36> TRGBFUNCS;
};
INIT_STATICS_MAP();
//class MyPosFunctor : public FunctorAttribute<Geom::Vec3f>
//{
//public:
......@@ -338,16 +335,16 @@ int main(int argc, char **argv)
AttributeHandler< NoMathIOAttribute<Pipos> > tablestring = myMap.addAttribute< NoMathIOAttribute<Pipos> >(VERTEX_ORBIT, "strings");
PFP::TVEC3 tablePosition = myMap.addAttribute<Geom::Vec3f>(VERTEX_ORBIT, "position");
PFP::TVEC3 tableNormal = myMap.addAttribute<Geom::Vec3f>(VERTEX_ORBIT, "normals");
bool success = Algo::Import::importMesh<PFP>(myMap, "liver.trian", tablePosition, Algo::Import::ImportSurfacique::UNKNOWNSURFACE);
if (!success)
std::vector<std::string> attrNames ;
if (!Algo::Import::importMesh<PFP>(myMap, "liver.trian", attrNames))
{
std::cerr << "Import fail" << std::endl;
exit(1);
}
PFP::TVEC3 tablePosition = myMap.getAttribute<PFP::VEC3>(VERTEX_ORBIT, attrNames[0]);
std::cout << "Nombre de sommets: "<< myMap.getNbCells(VERTEX_ORBIT)<<std::endl;
SelectorTrue allDarts;
......
......@@ -45,11 +45,12 @@ using namespace CGoGN ;
struct PFP
{
// definition de la carte
// definition of the map
typedef Algo::IHM::ImplicitHierarchicalMap MAP;
// definition du type de reel utilise
// definition of the type of real value
typedef float REAL;
typedef Geom::Vector<3,REAL> VEC3;
typedef Geom::Vector<6,REAL> VEC6;
typedef Geom::Matrix<3,3,REAL> MATRIX33;
......@@ -58,11 +59,8 @@ struct PFP
typedef Algo::IHM::AttributeHandler_IHM<VEC3> TVEC3;
typedef Algo::IHM::AttributeHandler_IHM<REAL> TREAL;
typedef Algo::IHM::AttributeHandler_IHM<MATRIX33> TFRAME;
typedef Algo::IHM::AttributeHandler_IHM<MATRIX36> TRGBFUNCS;
};
INIT_STATICS_MAP() ;
PFP::MAP myMap ;
SelectorTrue allDarts ;
......@@ -573,24 +571,22 @@ int main(int argc, char** argv)
{
MyGlutWin* mgw = new MyGlutWin(&argc, argv, 1200, 800) ;
mgw->position = myMap.addAttribute<PFP::VEC3>(VERTEX_ORBIT, "position") ;
mgw->normal = myMap.addAttribute<PFP::VEC3>(VERTEX_ORBIT, "normal") ;
std::cout << "position -> " << mgw->position.isValid() << std::endl ;
std::cout << "normal -> " << mgw->normal.isValid() << std::endl ;
char* filename = argv[1] ;
GLint t1 = glutGet(GLUT_ELAPSED_TIME) ;
bool success = Algo::Import::importMesh<PFP>(myMap, filename, mgw->position, Algo::Import::ImportSurfacique::UNKNOWNSURFACE) ;
if(!success)
std::vector<std::string> attrNames ;
if(!Algo::Import::importMesh<PFP>(myMap, filename, attrNames))
{
std::cerr << "could not import "<< filename << std::endl ;
return 1 ;
}
mgw->position = myMap.getAttribute<PFP::VEC3>(VERTEX_ORBIT, attrNames[0]) ;
GLint t2 = glutGet(GLUT_ELAPSED_TIME) ;
GLfloat seconds = (t2 - t1) / 1000.0f ;
std::cout << "import: " << seconds << " sec" << std::endl ;
mgw->normal = myMap.addAttribute<PFP::VEC3>(VERTEX_ORBIT, "normal") ;
myMap.init() ;
// compute width and position of object for centering
......
......@@ -1033,15 +1033,14 @@ int main(int argc, char** argv)
char* filename = argv[1] ;
mgw->position = myMap.addAttribute<PFP::VEC3>(VERTEX_ORBIT, "position") ;
GLint t1 = glutGet(GLUT_ELAPSED_TIME) ;
bool success = Algo::Import::importMesh<PFP>(myMap, filename, mgw->position, Algo::Import::ImportSurfacique::UNKNOWNSURFACE) ;
if(!success)
std::vector<std::string> attrNames ;
if(!Algo::Import::importMesh<PFP>(myMap, filename, attrNames))
{
std::cerr << "could not import "<< filename << std::endl ;
return 1 ;
}
mgw->position = myMap.getAttribute<PFP::VEC3>(VERTEX_ORBIT, attrNames[0]) ;
GLint t2 = glutGet(GLUT_ELAPSED_TIME) ;
GLfloat seconds = (t2 - t1) / 1000.0f ;
std::cout << "import: " << seconds << " sec" << std::endl ;
......
......@@ -53,16 +53,18 @@
#endif
using namespace CGoGN ;
struct PFP {
// definition de la carte
struct PFP
{
// definition of the map
typedef Map2 MAP;
// definition du type de reel utilise
// definition of the type of real value
typedef float REAL;
// other types definitions
typedef Geom::Vector<3,REAL> VEC3;
typedef Geom::Vector<6,REAL> VEC6;
typedef Geom::Matrix<3,3,REAL> MATRIX33;
......@@ -71,12 +73,8 @@ struct PFP {
typedef AttributeHandler<VEC3> TVEC3;
typedef AttributeHandler<REAL> TREAL;
typedef AttributeHandler<MATRIX33> TFRAME;
typedef AttributeHandler<MATRIX36> TRGBFUNCS;
};
INIT_STATICS_MAP() ;
typedef PFP::MAP MAP;
......
......@@ -48,11 +48,13 @@ using namespace CGoGN ;
struct PFP
{
// definition de la carte
// definition of the map
typedef EmbeddedMap2<Map2> MAP;
// definition du type de reel utilise
// definition of the type of real value
typedef float REAL;
// other types definitions
typedef Geom::Vector<3,REAL> VEC3;
typedef Geom::Vector<6,REAL> VEC6;
typedef Geom::Matrix<3,3,REAL> MATRIX33;
......@@ -61,12 +63,8 @@ struct PFP
typedef AttributeHandler<VEC3> TVEC3;
typedef AttributeHandler<REAL> TREAL;
typedef AttributeHandler<MATRIX33> TFRAME;
typedef AttributeHandler<MATRIX36> TRGBFUNCS;
};
INIT_STATICS_MAP() ;
typedef PFP::MAP MAP;
MAP myMap ;
......@@ -629,8 +627,6 @@ int main(int argc, char** argv)
{
MyGlutWin* mgw = new MyGlutWin(&argc, argv, 1200, 800) ;
mgw->position = myMap.addAttribute<PFP::VEC3>(VERTEX_ORBIT, "position") ;
if(argc < 2)
{
Dart d1 = myMap.newFace(3) ;
......@@ -643,12 +639,13 @@ int main(int argc, char** argv)
char* filename = argv[1] ;
GLint t1 = glutGet(GLUT_ELAPSED_TIME) ;
bool success = Algo::Import::importMesh<PFP>(myMap, filename, mgw->position, Algo::Import::ImportSurfacique::UNKNOWNSURFACE) ;
if(!success)
std::vector<std::string> attrNames ;
if(!Algo::Import::importMesh<PFP>(myMap, filename, attrNames))
{
std::cerr << "could not import "<< filename << std::endl ;
std::cerr << "could not import " << filename << std::endl ;
return 1 ;
}
mgw->position = myMap.getAttribute<PFP::VEC3>(VERTEX_ORBIT, attrNames[0]) ;
GLint t2 = glutGet(GLUT_ELAPSED_TIME) ;
GLfloat seconds = (t2 - t1) / 1000.0f ;
std::cout << "import: " << seconds << " sec" << std::endl ;
......
......@@ -884,15 +884,14 @@ int main(int argc, char** argv)
char* filename = argv[1] ;
mgw->position = myMap.addAttribute<PFP::VEC3>(VERTEX_ORBIT, "position") ;
GLint t1 = glutGet(GLUT_ELAPSED_TIME) ;
bool success = Algo::Import::importMesh<PFP>(myMap, filename, mgw->position, Algo::Import::ImportSurfacique::UNKNOWNSURFACE) ;
if(!success)
std::vector<std::string> attrNames ;
if(!Algo::Import::importMesh<PFP>(myMap, filename, attrNames))
{
std::cerr << "could not import "<< filename << std::endl ;
exit(1);
}
mgw->position = myMap.getAttribute<PFP::VEC3>(VERTEX_ORBIT, attrNames[0]) ;
GLint t2 = glutGet(GLUT_ELAPSED_TIME) ;
GLfloat seconds = (t2 - t1) / 1000.0f ;
std::cout << "import: " << seconds << " sec" << std::endl ;
......
......@@ -40,12 +40,15 @@
using namespace CGoGN ;
struct PFP {
// definition de la carte
struct PFP
{
// definition of the map
typedef EmbeddedMap2<Map2> MAP;
// definition du type de reel utilise
// definition of the type of real value
typedef float REAL;
// other types definitions
typedef Geom::Vector<3,REAL> VEC3;
typedef Geom::Vector<6,REAL> VEC6;
typedef Geom::Matrix<3,3,REAL> MATRIX33;
......@@ -54,12 +57,8 @@ struct PFP {
typedef AttributeHandler<VEC3> TVEC3;
typedef AttributeHandler<REAL> TREAL;
typedef AttributeHandler<MATRIX33> TFRAME;
typedef AttributeHandler<MATRIX36> TRGBFUNCS;
};
INIT_STATICS_MAP() ;
typedef PFP::MAP MAP;
MAP myMap ;
......
......@@ -44,10 +44,13 @@ using namespace CGoGN;
// definition des parametres de la carte
struct PFP
{
// definition of the map
typedef EmbeddedMap2<GMap2> MAP;
// definition du type de reel utilise
// definition of the type of real value
typedef float REAL;
// other types definitions
typedef Geom::Vector<3,REAL> VEC3;
typedef Geom::Vector<6,REAL> VEC6;
typedef Geom::Matrix<3,3,REAL> MATRIX33;
......@@ -56,12 +59,8 @@ struct PFP
typedef AttributeHandler<VEC3> TVEC3;
typedef AttributeHandler<REAL> TREAL;
typedef AttributeHandler<MATRIX33> TFRAME;
typedef AttributeHandler<MATRIX36> TRGBFUNCS;
};
INIT_STATICS_MAP() ;
PFP::MAP myMap;
// interface
......@@ -392,14 +391,13 @@ int main(int argc, char **argv)
char* filename = argv[1] ;
mgw.position = myMap.addAttribute<PFP::VEC3>(VERTEX_ORBIT, "position") ;
mgw.normal = myMap.addAttribute<PFP::VEC3>(VERTEX_ORBIT, "normal") ;
PFP::VEC3 gMax;
PFP::VEC3 gMin;
if(argc < 2)
{
mgw.position = myMap.addAttribute<PFP::VEC3>(VERTEX_ORBIT, "position") ;
Dart d = myMap.newFace(4);
Dart e = myMap.newFace(3);
......@@ -423,14 +421,17 @@ int main(int argc, char **argv)
}
else
{
bool success = Algo::Import::importMesh<PFP>(myMap, filename, mgw.position, Algo::Import::ImportSurfacique::UNKNOWNSURFACE) ;
if (!success)
std::vector<std::string> attrNames ;
if(!Algo::Import::importMesh<PFP>(myMap, filename, attrNames))
{
std::cerr <<"Import fail"<< std::endl;
exit(1);
}
mgw.position = myMap.getAttribute<PFP::VEC3>(VERTEX_ORBIT, attrNames[0]) ;
}
mgw.normal = myMap.addAttribute<PFP::VEC3>(VERTEX_ORBIT, "normal") ;
// pour le rendu
Geom::BoundingBox<PFP::VEC3> bb = Algo::Geometry::computeBoundingBox<PFP>(myMap, mgw.position) ;
......