Commit 1b96b9f3 authored by Pierre Kraemer's avatar Pierre Kraemer

suppression vieux exemples

parent 6041ef2b
......@@ -29,10 +29,6 @@ add_executable( miniTestD ../miniTest.cpp)
target_link_libraries( miniTestD
containerD topologyD utilsD algoD numerical lapack blas f2c ${COMMON_LIBS} )
add_executable( firstD ../first.cpp)
target_link_libraries( firstD
containerD topologyD utilsD algoD ${COMMON_LIBS} )
add_executable( ViewerD ../Viewer.cpp)
target_link_libraries( ViewerD
containerD topologyD utilsD algoD ${COMMON_LIBS} )
......@@ -41,10 +37,6 @@ add_executable( FilterExamplesD ../FilterExamples.cpp)
target_link_libraries( FilterExamplesD
containerD topologyD utilsD algoD ${COMMON_LIBS} )
add_executable( pmViewD ../pmView.cpp)
target_link_libraries( pmViewD
containerD topologyD utilsD algoD numerical lapack blas f2c ${COMMON_LIBS} )
add_executable( linearTestD ../linearTest.cpp)
target_link_libraries( linearTestD
containerD topologyD utilsD algoD numerical lapack blas f2c ${COMMON_LIBS} )
......
This diff is collapsed.
......@@ -30,10 +30,6 @@ add_executable( miniTest ../miniTest.cpp)
target_link_libraries( miniTest
container topology utils algo numerical lapack blas f2c ${COMMON_LIBS} )
add_executable( first ../first.cpp)
target_link_libraries( first
container topology utils algo ${COMMON_LIBS} )
add_executable( Viewer ../Viewer.cpp)
target_link_libraries( Viewer
container topology utils algo ${COMMON_LIBS} )
......@@ -42,58 +38,6 @@ add_executable( FilterExamples ../FilterExamples.cpp)
target_link_libraries( FilterExamples
container topology utils algo numerical lapack blas f2c ${COMMON_LIBS} )
#add_executable( SimpleEMap3 ../simpleEMap3.cpp)
#target_link_libraries( SimpleEMap3
# container topology utils algo ${COMMON_LIBS} )
#add_executable( movingObjects ../movingObjects_Unconstrained-Unoptimized.cpp)
# target_link_libraries( movingObjects
# container topology utils algo ${COMMON_LIBS} )
# add_executable( MeshVBO ../MeshVBO.cpp)
# target_link_libraries( MeshVBO
# topology utils algo ${COMMON_LIBS} )
# add_executable( MeshViewer ../MeshViewer.cpp)
# target_link_libraries( MeshViewer
# topology utils algo gzstream ${COMMON_LIBS} )
# add_executable( primView ../primView.cpp)
# target_link_libraries( primView
# topology utils algo ${COMMON_LIBS} )
# add_executable( test_geo3d ../test_geo3d.cpp)
# target_link_libraries( test_geo3d
# topology utils algo ${COMMON_LIBS} gmp)
# add_executable( vox2mesh ../vox2mesh.cpp)
# target_link_libraries( vox2mesh
# topology utils algo ${COMMON_LIBS} Zinri )
# add_executable( topoSelect ../topoSelect.cpp)
# target_link_libraries( topoSelect
# topology utils algo ${COMMON_LIBS} )
# add_executable( MC_Examples ../MC_Examples.cpp)
# target_link_libraries( MC_Examples
# topology utils algo ${COMMON_LIBS} Zinri )
# add_executable( volumeExample ../volumeExample.cpp)
# target_link_libraries( volumeExample
# topology utils algo ${COMMON_LIBS} )
add_executable( pmView ../pmView.cpp)
target_link_libraries( pmView
container topology utils algo numerical lapack blas f2c ${COMMON_LIBS} )
# add_executable( modeler ../modeler.cpp)
# target_link_libraries( modeler
# topology utils algo ${COMMON_LIBS} )
#add_executable( volumeViewer ../volumeViewer.cpp)
#target_link_libraries( volumeViewer
# topology utils algo ${COMMON_LIBS} )
add_executable( linearTest ../linearTest.cpp)
target_link_libraries( linearTest
container topology utils algo numerical lapack blas f2c ${COMMON_LIBS} )
......@@ -102,22 +46,6 @@ add_executable( simpleGMap2 ../simpleGMap2.cpp)
target_link_libraries( simpleGMap2
container topology utils algo ${COMMON_LIBS} Zinri)
# add_executable( simpleXMap ../simpleXMap.cpp)
# target_link_libraries( simpleXMap
# topology utils algo ${COMMON_LIBS} Zinri)
# add_executable( objTexViewer ../objTexViewer.cpp)
# target_link_libraries( objTexViewer
# topology utils algo gzstream ${COMMON_LIBS} )
# add_executable( Viz3Map ../Viz3Map.cpp)
# target_link_libraries( Viz3Map
# topology utils algo ${COMMON_LIBS} Zinri)
# add_executable( volumeTopoDraw ../volumeTopoDraw.cpp)
# target_link_libraries( volumeTopoDraw
# topology utils algo ${COMMON_LIBS})
# add_executable( hm_convexhull ../hm_convexhull.cpp)
# target_link_libraries( hm_convexhull
# topology utils algo ${COMMON_LIBS})
......@@ -142,7 +70,7 @@ add_executable( ter_meshes ../ter_meshes.cpp)
target_link_libraries( ter_meshes
container topology utils algo ${COMMON_LIBS} )
add_executable( polyhedronsView ../polyhedronsView.cpp)
add_executable( polyhedronsView ../polyhedronsView.cpp)
target_link_libraries( polyhedronsView
container topology utils algo ${COMMON_LIBS} )
......
/*******************************************************************************
* CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps *
* version 0.1 *
* Copyright (C) 2009, IGG Team, LSIIT, University of Strasbourg *
* *
* This library is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Lesser General Public License as published by the *
* Free Software Foundation; either version 2.1 of the License, or (at your *
* option) any later version. *
* *
* This library is distributed in the hope that it will be useful, but WITHOUT *
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License *
* for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with this library; if not, write to the Free Software Foundation, *
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
* *
* Web site: https://iggservis.u-strasbg.fr/CGoGN/ *
* Contact information: cgogn@unistra.fr *
* *
*******************************************************************************/
#include <iostream>
#include "Algo/Import/import.h"
#include "Algo/Import/export.h"
#include "map_dual/mapd2_xpt.h"
#include "Algo/Render/map_glRender.h"
#include "point3d.h"
#include <gmtl/Output.h>
gmtl::Vec3f gMax;
gmtl::Vec3f gMin;
struct PFP: public PFP_STANDARD
{
typedef DartObj<DP::DefaultDartParameters> DART;
typedef e0mapd2<DART> MAP;
typedef Point3D EMB;
static const unsigned id0=0;
};
PFP::MAP myMap;
int getFileType(char* filenameIN)
{
std::string fstr(filenameIN);
if (fstr.rfind(".trianbgz")!=std::string::npos)
return 6;
if (fstr.rfind(".trianb")!=std::string::npos)
return 5;
if (fstr.rfind(".trian")!=std::string::npos)
return 1;
if (fstr.rfind(".ply")!=std::string::npos)
return 2;
if (fstr.rfind(".off")!=std::string::npos)
return 3;
if (fstr.rfind(".obj")!=std::string::npos)
return 4;
return -1;
}
int main(int argc, char **argv)
{
gmtl::Vec3f gMax;
gmtl::Vec3f gMin;
char* filenameIN = argv[1];
char* filenameOUT = argv[2];
if (argc < 3)
{
std::cerr << argv[0]<<" fich_in fich_out"<<std::endl;
return 1;
}
if ( std::string(filenameIN) == std::string(filenameOUT) )
{
std::cerr << "Meme nom entree/sotie non autorise"<<std::endl;
return 1;
}
int ft = getFileType(filenameIN);
std::cout << "Type entree: "<<ft<<std::endl;
switch (ft)
{
case 1: Import::importTrian<PFP>(myMap,filenameIN);
break;
case 2: Import::importPly<PFP>(myMap,filenameIN);
break;
case 3: Import::importOff<PFP>(myMap,filenameIN);
break;
case 4: Import::importObj<PFP>(myMap,filenameIN);
break;
case 5: Import::importTrianBin<PFP>(myMap,filenameIN);
break;
case 6: Import::importTrianBinGz<PFP>(myMap,filenameIN);
break;
default: std:: cerr << "type fichier non reconnu" << std::endl;
return 1;
break;
}
std::cout<< "objet importe ..."<<std::endl;
ft = getFileType(filenameOUT);
std::cout << "Type sortie: "<<ft<<std::endl;
switch (ft)
{
case 1: Import::computeNeighbourOptimized<PFP>(myMap,gMin,gMax);
Export::exportTrian<PFP>(myMap,filenameOUT);
break;
case 2: Export::exportPly<PFP>(myMap,filenameOUT);
break;
case 3: Export::exportOff<PFP>(myMap,filenameOUT);
break;
case 4: Export::exportObj<PFP>(myMap,filenameOUT);
break;
case 5: Import::computeNeighbourOptimized<PFP>(myMap,gMin,gMax);
Export::exportTrianBin<PFP>(myMap,filenameOUT);
break;
case 6: Import::computeNeighbourOptimized<PFP>(myMap,gMin,gMax);
Export::exportTrianBinGz<PFP>(myMap,filenameOUT);
break;
default: std:: cerr << "type fichier non reconnu" << std::endl;
return 1;
break;
}
std::cout<< "... et exporte"<<std::endl;
return 0;
}
This diff is collapsed.
/*******************************************************************************
* CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps *
* version 0.1 *
* Copyright (C) 2009, IGG Team, LSIIT, University of Strasbourg *
* *
* This library is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Lesser General Public License as published by the *
* Free Software Foundation; either version 2.1 of the License, or (at your *
* option) any later version. *
* *
* This library is distributed in the hope that it will be useful, but WITHOUT *
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License *
* for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with this library; if not, write to the Free Software Foundation, *
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
* *
* Web site: https://iggservis.u-strasbg.fr/CGoGN/ *
* Contact information: cgogn@unistra.fr *
* *
*******************************************************************************/
#include <iostream>
#define RENDU_COULEUR 1
#include "glutwin.h"
#include "Algo/Import/import.h"
#include "Algo/Import/export.h"
#include "map_dual/mapd2_xpt.h"
#include "Algo/Render/map_glRender.h"
#include "point3d_col.h"
//#include "point6d.h"
//#include "pointBDF.h"
#include <gmtl/Output.h>
gmtl::Vec3f gMax;
gmtl::Vec3f gMin;
struct PFP {
typedef DartObj<DP::MAPD2_V0U1> DART;
typedef e0mapd2<DART> MAP;
typedef Emb::Point3D_Col EMB;
// typedef Emb::Point6D EMB; // Pour fichier fred avec couleur, tout en float: #include "point6d.h"
// typedef Emb::Point_BRDF EMB; // Pour fichier fred avec donnee, pos + 9 float + 16 float: #include "pointBDF.h"
static const unsigned id0=0;
};
PFP::MAP myMap;
class myGlutWin: public SimpleGlutWin
{
public:
gmtl::Vec3f gPosObj;
float gWidthObj;
GLuint dl;
void myRedraw();
void myKeyboard(unsigned char keycode, int x, int y);
void initDL();
bool useDL;
std::vector<gmtl::Vec3f> vnormals;
};
void myGlutWin::initDL(void)
{
if (glIsList(dl))
glDeleteLists(dl,1);
dl = glGenLists(1);
glNewList(dl,GL_COMPILE);
glEnable(GL_NORMALIZE);
glFrontFace(GL_CCW);
glEnable(GL_CULL_FACE);
glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_FALSE);
SelectorTrue<PFP::MAP::Dart> allDarts;
glPolygonMode(GL_FRONT_AND_BACK,GL_FILL);
glColor3f(1.,0.5,0.);
MapGLRender::renderTriQuadPoly<PFP>(myMap, MapGLRender::FLAT, 0.8f, allDarts, vnormals, false);
glEndList();
std::cout <<"Using GL display list"<<std::endl;
useDL=true;
}
void myGlutWin::myRedraw(void)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glPushMatrix();
float sc = 8./gWidthObj;
glScalef(sc,sc,sc);
glTranslatef(-gPosObj[0],-gPosObj[1],-gPosObj[2]);
if (useDL)
glCallList(dl);
glPopMatrix();
}
void myGlutWin::myKeyboard(unsigned char keycode, int x, int y)
{
}
int main(int argc, char **argv)
{
myGlutWin mgw;
mgw.init(argc,argv,500,500);
gmtl::Vec3f gMax;
gmtl::Vec3f gMin;
char* filename = argv[1];
// import
Import::importPlyV2<PFP>(myMap,filename);
std::cout<< "objet importe"<<std::endl;
GLint t1 = glutGet(GLUT_ELAPSED_TIME);
// calcule les voisins (phi2)
Import::computeNeighbourOptimized<PFP>(myMap,gMin,gMax);
// ferme la carte en cas de surface ouverte
myMap.setBoundaryMarkerValue(myMap.closeMap());
GLint t2 = glutGet(GLUT_ELAPSED_TIME);
GLfloat seconds = (t2 - t1) / 1000.0f;
cout << "phi2isation et fermeture: "<< seconds<<"sec"<<endl;
MapGLRender::computeBoundingBox<PFP>(myMap,gMin,gMax);
mgw.gPosObj[0] = (gMax[0]+gMin[0])/2;
mgw.gPosObj[1] = (gMax[1]+gMin[1])/2;
mgw.gPosObj[2] = (gMax[2]+gMin[2])/2;
float tailleX = gMax[0] - gMin[0];
float tailleY = gMax[1] - gMin[1];
float tailleZ = gMax[2] - gMin[2];
mgw.gWidthObj = std::max( std::max(tailleX,tailleY) ,tailleZ);
mgw.initDL();
mgw.mainLoop();
return 0;
}
/*******************************************************************************
* CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps *
* version 0.1 *
* Copyright (C) 2009, IGG Team, LSIIT, University of Strasbourg *
* *
* This library is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Lesser General Public License as published by the *
* Free Software Foundation; either version 2.1 of the License, or (at your *
* option) any later version. *
* *
* This library is distributed in the hope that it will be useful, but WITHOUT *
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License *
* for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with this library; if not, write to the Free Software Foundation, *
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
* *
* Web site: https://iggservis.u-strasbg.fr/CGoGN/ *
* Contact information: cgogn@unistra.fr *
* *
*******************************************************************************/
#include <iostream>
#include <gmtl/gmtl.h>
#include "Utils/glutwin_atb.h"
#include "trackball.h"
#include "Topology/map/emap2.h"
#include "point3d.h"
#include "Algo/Selection/raySelector.h"
#include "Algo/Modelisation/subdivision.h"
#include "Algo/Modelisation/extrusion.h"
#include "Algo/Render/helpRender.h"
#include "Algo/Render/map_glRender.h"
using namespace CGoGN;
struct PFP
{
typedef DartObj<DP::MAPD2_V0U1> DART ;
typedef e0map2<DART> MAP ;
typedef Emb::Point3D EMB ;
};
PFP::MAP myMap ;
Emb::Point3D P ;
unsigned int skipCount = 0 ;
class MyGlutWin : public Utils::GlutWin_ATB
{
public:
gmtl::Vec4f colDif ;
gmtl::Vec4f colSpec ;
gmtl::Vec4f colClear ;
gmtl::Vec4f colNormal ;
float shininess ;
gmtl::Vec3f gPosObj ;
float gWidthObj ;
float normalBaseSize ;
float normalScaleFactor ;
float selectionSize;
std::vector<gmtl::Vec3f> vNormals ;
bool vNormals_dirty ;
//view and select
enum { FLAT, GOURAUD, PHONG, LINE, NORMAL } ;
enum { VERTEX, EDGE, FACE} ;
bool invertedNormals ;
bool invertedObject ;
bool renderAxis ;
bool renderObject ;
bool renderNormals ;
bool renderLines ;
bool renderHelp ;
int renderStyle ;
int selectionStyle ;
bool selecting ;
bool deselecting ;
Marker selectionMarker ;
bool dragging ;
GLuint dl_obj ;
GLuint dl_line ;
GLuint dl_norm ;
//modeler options
bool editMode;
std::vector<gmtl::Vec3f> newFace;
//topological options
bool sewingMode;
unsigned int remainingVertices ;
bool quantize ;
std::vector<gmtl::Vec3f> originalPos ;
std::vector<gmtl::Vec3f*> dVectors_down ;
std::vector<gmtl::Vec3f*> dVectors_up ;
Marker inactiveMarker ;
SelectorUnmarked<PFP::MAP>* activeDartsSelector ;
TwBar* file_bar ;
TwBar* viewer_bar ;
TwBar* selection_bar ;
TwBar* primitive_bar;
TwBar* topology_bar;
TwBar* transform_bar;
std::string fileName;
std::vector<PFP::MAP::Dart> selected_vertices ;
MyGlutWin(int* argc, char **argv, int winX, int winY) :
GlutWin_ATB(argc, argv, winX, winY),
vNormals_dirty(true),
invertedNormals(false),
invertedObject(false),
renderAxis(true),
renderObject(true),
renderNormals(false),
renderLines(false),
editMode(false),
selecting(false),
deselecting(false),
dragging(false),
renderHelp(true),
renderStyle(FLAT),
selectionStyle(VERTEX)
{
dl_obj = glGenLists(1) ;
dl_line = glGenLists(1) ;
dl_norm = glGenLists(1) ;
if(this->shaderOk)
shaders[0].loadShaders("phong_vs.txt", "phong_ps.txt") ;
remainingVertices = 10 ;
quantize = false ;
inactiveMarker = myMap.getNewMarker() ;
activeDartsSelector = new SelectorUnmarked<PFP::MAP>(myMap, inactiveMarker) ;
selectionMarker = myMap.getNewMarker() ;
}
void initGUI() ;
void myRedraw() ;
void myKeyboard(unsigned char keycode, int x, int y) ;
void myMouse(int button, int state, int x, int y) ;
void myMotion(int x, int y) ;
void updateDisplay() ;
void initDL() ;
void initDLNormals() ;
void initDLLines() ;
void render(int renderMode) ;
void renderSelected() ;
void renderDetailVectors() ;
void selectVertices(PFP::MAP::Dart d, float dist) ;
void selectVertex(PFP::MAP::Dart d) ;
void deselectVertex(PFP::MAP::Dart d) ;
void deselectAllVertices() ;
} ;
//Pixel_Shader
varying vec3 normal, lightDir, eyeVec;
void main (void)
{
vec4 final_color =
(gl_FrontLightModelProduct.sceneColor * gl_FrontMaterial.ambient) +
(gl_LightSource[0].ambient * gl_FrontMaterial.ambient);
vec3 N = normalize(normal);
vec3 L = normalize(lightDir);
float lambertTerm = dot(N,L);
if(lambertTerm > 0.0)
{
final_color += gl_LightSource[0].diffuse *
gl_FrontMaterial.diffuse *
lambertTerm;
vec3 E = normalize(eyeVec);
vec3 R = reflect(-L, N);
float specular = pow( max(dot(R, E), 0.0),
gl_FrontMaterial.shininess );
final_color += gl_LightSource[0].specular *
gl_FrontMaterial.specular *
specular;
}
gl_FragColor = final_color;
}
\ No newline at end of file
//Vertex_Shader
varying vec3 normal, lightDir, eyeVec;
void main()
{
normal = gl_NormalMatrix * gl_Normal;
vec3 vVertex = vec3(gl_ModelViewMatrix * gl_Vertex);
lightDir = vec3(gl_LightSource[0].position.xyz - vVertex);
eyeVec = -vVertex;
gl_Position = ftransform();
}
This diff is collapsed.
/*******************************************************************************
* CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps *
* version 0.1 *
* Copyright (C) 2009, IGG Team, LSIIT, University of Strasbourg *
* *
* This library is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Lesser General Public License as published by the *
* Free Software Foundation; either version 2.1 of the License, or (at your *
* option) any later version. *
* *
* This library is distributed in the hope that it will be useful, but WITHOUT *
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License *
* for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with this library; if not, write to the Free Software Foundation, *
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
* *
* Web site: https://iggservis.u-strasbg.fr/CGoGN/ *
* Contact information: cgogn@unistra.fr *
* *
*******************************************************************************/
#include <iostream>
#include "Utils/glutwin_atb.h"
#include "Topology/generic/parameters.h"
#include "Topology/map/map2.h"
#include "Topology/generic/embeddedMap2.h"
#include "Algo/Export/export.h"
#include "Algo/Import/import.h"
#include "Algo/Geometry/boundingbox.h"
#include "Algo/Render/map_glRender.h"
#include "Algo/Render/vbo_MapRender.h"
#include "Topology/generic/ecell.h"
#include "Algo/ProgressiveMesh/pmesh.h"
using namespace CGoGN ;
struct PFP: public PFP_STANDARD
{
// definition of the map
typedef EmbeddedMap2<Map2> MAP;
};
typedef PFP::MAP MAP;
MAP myMap ;
SelectorTrue allDarts ;
class MyGlutWin : public Utils::GlutWin_ATB
{
public:
TwBar* viewer_bar ;
enum renderMode { FLAT, GOURAUD, PHONG, LINES, NORMALS } ;
Geom::Vec4f colDif ;
Geom::Vec4f colSpec ;
Geom::Vec4f colClear ;
Geom::Vec4f colNormal ;
float shininess ;
PFP::VEC3 gPosObj ;
float gWidthObj ;
float normalBaseSize ;
float normalScaleFactor ;
float faceShrinkage ;
int renderStyle ;
bool renderObject ;