Commit 6f6cb139 authored by Sylvain Thery's avatar Sylvain Thery
Browse files

Merge cgogn:~cgogn/CGoGN

Conflicts:
	CMakeLists.txt
parents 66c71a0c b34bc7c1
...@@ -114,6 +114,7 @@ void Viewer::cb_initGL() ...@@ -114,6 +114,7 @@ void Viewer::cb_initGL()
m_pointSprite = new Utils::PointSprite() ; m_pointSprite = new Utils::PointSprite() ;
m_pointSprite->setAttributePosition(m_positionVBO) ; m_pointSprite->setAttributePosition(m_positionVBO) ;
m_pointSprite->setColor(Geom::Vec4f(0.0f, 0.0f, 1.0f, 1.0f)) ;
registerShader(m_phongShader) ; registerShader(m_phongShader) ;
registerShader(m_flatShader) ; registerShader(m_flatShader) ;
...@@ -126,11 +127,8 @@ void Viewer::cb_redraw() ...@@ -126,11 +127,8 @@ void Viewer::cb_redraw()
{ {
if(m_drawVertices) if(m_drawVertices)
{ {
float size = vertexScaleFactor ; m_pointSprite->setSize(vertexScaleFactor) ;
m_pointSprite->setSize(size) ;
m_pointSprite->predraw(Geom::Vec3f(0.0f, 0.0f, 1.0f)) ;
m_render->draw(m_pointSprite, Algo::Render::GL2::POINTS) ; m_render->draw(m_pointSprite, Algo::Render::GL2::POINTS) ;
m_pointSprite->postdraw() ;
} }
if(m_drawEdges) if(m_drawEdges)
......
...@@ -163,15 +163,15 @@ void MyQT::cb_Save() ...@@ -163,15 +163,15 @@ void MyQT::cb_Save()
Utils::SVG::SVGOut svg1(modelViewMatrix(), projectionMatrix()); Utils::SVG::SVGOut svg1(modelViewMatrix(), projectionMatrix());
m_drawer.toSVG(svg1); m_drawer.toSVG(svg1);
svg1.addOpacityAnimation(1.0f); // svg1.addOpacityAnimation(1.0f);
svg1.addOpacityAnimation(1.0f); // svg1.addOpacityAnimation(1.0f);
svg1.addOpacityAnimation(0.0f); // svg1.addOpacityAnimation(0.0f);
Utils::SVG::SVGOut svg2(modelViewMatrix(), projectionMatrix()); Utils::SVG::SVGOut svg2(modelViewMatrix(), projectionMatrix());
m_render_topo->toSVG(svg2); m_render_topo->toSVG(svg2);
svg2.addOpacityAnimation(1.0f); // svg2.addOpacityAnimation(1.0f);
svg2.addOpacityAnimation(0.0f); // svg2.addOpacityAnimation(0.0f);
svg2.addOpacityAnimation(1.0f); // svg2.addOpacityAnimation(1.0f);
Utils::SVG::AnimatedSVGOut anim; Utils::SVG::AnimatedSVGOut anim;
......
...@@ -129,6 +129,7 @@ void MyQT::cb_initGL() ...@@ -129,6 +129,7 @@ void MyQT::cb_initGL()
m_sprite = new Utils::PointSprite(); m_sprite = new Utils::PointSprite();
m_sprite->setAttributePosition(m_positionVBO); m_sprite->setAttributePosition(m_positionVBO);
m_sprite->setColor(Geom::Vec4f(1.0f, 0.0f , 0.0f, 1.0f));
m_strings = new Utils::Strings3D(true, Geom::Vec3f(0.1f,0.0f,0.3f)); m_strings = new Utils::Strings3D(true, Geom::Vec3f(0.1f,0.0f,0.3f));
storeVerticesInfo(); storeVerticesInfo();
...@@ -200,9 +201,7 @@ void MyQT::cb_redraw() ...@@ -200,9 +201,7 @@ void MyQT::cb_redraw()
if (render_balls) if (render_balls)
{ {
m_sprite->predraw(Geom::Vec3f(1.0f, 0.0f ,0.0f));
m_render->draw(m_sprite, Algo::Render::GL2::POINTS); m_render->draw(m_sprite, Algo::Render::GL2::POINTS);
m_sprite->postdraw();
} }
if (render_vectors) if (render_vectors)
...@@ -237,13 +236,13 @@ void MyQT::cb_keyPress(int code) ...@@ -237,13 +236,13 @@ void MyQT::cb_keyPress(int code)
{ {
std::string filename = selectFileSave("Export SVG file ",".","(*.svg)"); std::string filename = selectFileSave("Export SVG file ",".","(*.svg)");
Utils::SVG::SVGOut svg(filename, modelViewMatrix(), projectionMatrix()); Utils::SVG::SVGOut svg(filename, modelViewMatrix(), projectionMatrix());
svg.setWidth(1.0f); // svg.setWidth(1.0f);
svg.setColor(Geom::Vec3f(0.0f,0.0f,0.5f)); // svg.setColor(Geom::Vec3f(0.0f,0.0f,0.5f));
Algo::Render::SVG::renderEdges<PFP>(svg, myMap, position); Algo::Render::SVG::renderEdges<PFP>(svg, myMap, position);
svg.setColor(Geom::Vec3f(0.0f,0.8f,0.0f)); // svg.setColor(Geom::Vec3f(0.0f,0.8f,0.0f));
svg.setWidth(5.0f); // svg.setWidth(5.0f);
Algo::Render::SVG::renderVertices<PFP>(svg, myMap, position); Algo::Render::SVG::renderVertices<PFP>(svg, myMap, position);
svg.setColor(Geom::Vec3f(1.0f,0.0f,0.0f)); // svg.setColor(Geom::Vec3f(1.0f,0.0f,0.0f));
m_strings->toSVG(svg); m_strings->toSVG(svg);
//svg destruction close the file //svg destruction close the file
} }
......
...@@ -235,6 +235,16 @@ void MyQT::operation(int x) ...@@ -235,6 +235,16 @@ void MyQT::operation(int x)
std::cout << "nb darts after = " << myMap.getNbDarts() << std::endl; std::cout << "nb darts after = " << myMap.getNbDarts() << std::endl;
} }
break; break;
case 11 :
CGoGNout <<"unsew volumes"<<CGoGNendl;
if (m_selected != NIL)
{
myMap.unsewVolumes(m_selected);
dm.markAll();
m_selected = NIL;
updateMap();
}
break;
default: default:
break; break;
} }
......
...@@ -145,6 +145,11 @@ ...@@ -145,6 +145,11 @@
<string>splitVertex</string> <string>splitVertex</string>
</property> </property>
</item> </item>
<item>
<property name="text">
<string>unsewVolumes</string>
</property>
</item>
</widget> </widget>
</item> </item>
<item row="6" column="0"> <item row="6" column="0">
......
...@@ -33,7 +33,7 @@ find_package(Boost COMPONENTS regex thread system REQUIRED) ...@@ -33,7 +33,7 @@ find_package(Boost COMPONENTS regex thread system REQUIRED)
find_package(ZLIB REQUIRED) find_package(ZLIB REQUIRED)
find_package(LibXml2 REQUIRED) find_package(LibXml2 REQUIRED)
find_package(GLEW REQUIRED) find_package(GLEW REQUIRED)
find_package(SuiteSparse REQUIRED) #find_package(SuiteSparse REQUIRED)
IF (DEFINED ASSERTON) IF (DEFINED ASSERTON)
add_definitions(-DCGOGN_ASSERT_BOOL=${ASSERTON}) add_definitions(-DCGOGN_ASSERT_BOOL=${ASSERTON})
...@@ -73,6 +73,7 @@ SET (CGoGN_EXT_INCLUDES ...@@ -73,6 +73,7 @@ SET (CGoGN_EXT_INCLUDES
${ZLIB_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIRS}
${LIBXML2_INCLUDE_DIR} ${LIBXML2_INCLUDE_DIR}
${Boost_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}
# ${SUITESPARSE_INCLUDE_DIRS}
) )
# define libs for external libs # define libs for external libs
...@@ -85,7 +86,7 @@ SET (CGoGN_EXT_LIBS ...@@ -85,7 +86,7 @@ SET (CGoGN_EXT_LIBS
${Boost_SYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY}
${Boost_REGEX_LIBRARY} ${Boost_REGEX_LIBRARY}
${Boost_THREAD_LIBRARY} ${Boost_THREAD_LIBRARY}
${SUITESPARSE_LIBRARIES} # ${SUITESPARSE_LIBRARIES}
) )
#optionnal libs #optionnal libs
......
*** english version below ***
Dépendences Linux: Dépendences Linux:
installer les paquets suivants: installer les paquets suivants:
cmake libXi-dev libXmu-dev libglew-dev libxml2-dev libboost-all-dev zlib1g-dev qt4-designer qt4-dev-tools uuid-dev libgsl0-dev libsuitesparse-dev cmake libXi-dev libXmu-dev libglew-dev libxml2-dev libboost-all-dev zlib1g-dev qt4-designer qt4-dev-tools uuid-dev libgsl0-dev libsuitesparse-dev
Pour compiler CGoGN: Pour compiler CGoGN:
- aller dans ThirdParty, cd build, taper "cmake .", puis make ( avec -j x si vous avez x core sur votre machine)
- on compile d'abord les bibliothèques annexes :
cd CGoGN/ThirdParty/build
cmake ..
make (-j x si vous avez x cores)
make install
On peut fixer certaines option pour ne pas tout compiler (cf le README.TXT dans ThirdParty) On peut fixer certaines option pour ne pas tout compiler (cf le README.TXT dans ThirdParty)
On peut aussi compiler en debug en créant un répertoir qui fini par Debug à la place de build
- ensuite on compile CGoGN (compile les libs dans CGoGN/lib et des exemples dans CGoGN/bin) :
- aller dans build et taper "cmake ..", puis make
Des options (booléennes) sont ici aussi disponible: cd CGoGN/build
cmake ..
make (-j x si vous avez x cores)
Certaines options (booléennes) sont ici aussi disponible:
BUILD_SHARED_LIBS (F) experimental ! BUILD_SHARED_LIBS (F) experimental !
WITH_ASSIMP (T) WITH_ASSIMP (T)
WITH_NUMERICAL (T) WITH_NUMERICAL (T)
WITH_ZINRI (T) WITH_ZINRI (T)
WITH_QT (T) WITH_QT (T)
afin de limiter les dépendances et le temps de compilation/ afin de limiter les dépendances et le temps de compilation
FORCE_MR (2) FORCE_MR (2)
permet de compiler dans 3 modes: mixte (0), multi-resolution(1), mono-resolution(2). permet de compiler dans 3 modes: mono-resolution (0), multi-resolution (1)
ONELIB (F) ONELIB (F)
permet de forcer la compilation en une seule lib (libcgogn.a) au lieu de quatre. permet de forcer la compilation en une seule lib (libcgogn.a) au lieu de quatre.
- on peut ensuite compiler SCHNApps ainsi que les plugins fournis :
- la compilation des sous-parties se fait en allant dans les sous-repertoires de build
Les applications (Examples et Tutos) sont dans le répertoire Apps cd CGoGN/SCHNApps/build
cmake ..
make (-j x si vous avez x cores)
Les binaires sont générés dans le repertoire bin
Des exemples de données: Des exemples de données:
- fichiers trianbgz, off, etc - fichiers trianbgz, off, etc
...@@ -44,31 +54,40 @@ install the following packages: ...@@ -44,31 +54,40 @@ install the following packages:
ccmake libXi-dev libXmu-dev libglew-dev libxml2-dev libboost-all-dev zlib1g-dev qt4-designer qt4-dev-tools uuid-dev libgsl0-dev libsuitesparse-dev ccmake libXi-dev libXmu-dev libglew-dev libxml2-dev libboost-all-dev zlib1g-dev qt4-designer qt4-dev-tools uuid-dev libgsl0-dev libsuitesparse-dev
To compile CGoGN: To compile CGoGN:
- Go ThirdParty, cd build, type "cmake .." and then make (with -j x if you have x core on your machine)
We can set some option to not compile everything (see the README.TXT in ThirdParty) - first compile third-party libraries:
You can also compile debug by creating a directory that ended Debug build instead
cd CGoGN/ThirdParty/build
- Go to build and type "cmake .." and then make cmake ..
Options (Boolean) are also available here: make (-j x if you have x cores)
BUILD_SHARED_LIBS (F) experimental! make install
WITH_ASSIMP (T)
WITH_NUMERICAL (T) Some options are available to not compile everything (see the README.TXT in ThirdParty)
WITH_ZINRI (T)
WITH_QT (T) - then compile CGoGN (the libs are generated in CGoGN/lib and some examples in CGoGN/bin):
to minimize dependencies and compilation time /
cd CGoGN/build
cmake ..
make (-j x if you have x cores)
Some options are available:
BUILD_SHARED_LIBS (F) experimental !
WITH_ASSIMP (T)
WITH_NUMERICAL (T)
WITH_ZINRI (T)
WITH_QT (T)
to minimize dependencies and compilation time
FORCE_MR (2) FORCE_MR (2)
allow the compilation in 3 mode: mixed(0), multi-resolution(1), mono-resolution(2). allows the compilation in 3 modes: mono-resolution (0), multi-resolution (1)
ONELIB (F) ONELIB (F)
allow compilation in one lib (libcgogn.a) instead of four. allowss to force the compilation in one lib (libcgogn.a) instead of four.
- the compilation of each sub-parts is done by going in the subdirectories of build - we can then compile SCHNApps and the provided plugins :
Applications (examples and tutorials) are in the Apps directory cd CGoGN/SCHNApps/build
cmake ..
make (-j x if you have x cores)
The binaries are generated in the bin directory
Examples of data: Examples of data:
- Trianbgz files, off, etc. - Trianbgz files, off, etc.
......
Principe des applications dans CGoGN_Apps (english version bellow Principe des applications dans CGoGN_Apps (english version below)
......
*** English version below *** *** english version below ***
Pour utiliser Eclipse (testé avec la version Helios, Galileo, Indigo & Juno) Pour utiliser Eclipse (testé avec la version Helios, Galileo, Indigo & Juno)
* Configurer un projet dans Eclipse : * Configurer un projet dans Eclipse :
......
Pour compiler CGoGN sur MAC (testé sur OS X 10.6) *** english version below ***
1) créer un lien de sys/malloc vers malloc.h dans usr/include: Pour compiler CGoGN sur MAC (testé sur OS X 10.8.2)
cd /usr/include; sudo ln -s sys/malloc.h .
Ceci permet d'éviter pas mal de pb de compilation de source linux.
2) installer avec macports ou homebrew Installer avec homebrew
zlib, glew (sudo port install xxxx) cmake, lzlib, glew, boost149, suite-sparse, qt
3) installer Qt (http://qt.nokia.com/downloads/)
4) Ajouter (si ce n'est déjà fait) dans bash_profile:
export LD_LIBRARY_PATH=/opt/local/lib
export C_INCLUDE_PATH=/opt/local/include:/usr/X11/include
export CPLUS_INCLUDE_PATH=/opt/local/include:/usr/X11/include
export LIBRARY_PATH=/opt/local/lib:/usr/X11/lib
========================================================================================= =========================================================================================
ENGLISH VERSION ENGLISH VERSION
========================================================================================= =========================================================================================
To compile CGoGN on MAC (tested on OSX 10.6 and OSX 10.7.2)
1) create a link from sys/malloc to malloc.h in usr/include:
cd /usr/include; sudo ln -s sys/malloc.h .
This solve compilation problems of some linux codes on mac
2) install with macports or homebrew
zlib, glew, boost (sudo port install xxxx)
3) install Qt (http://qt.nokia.com/downloads/) To compile CGoGN on MAC (tested on OSX 10.8.2)
4) Add if not already done (by homebrew) in bash_profile: Install with homebrew
export LD_LIBRARY_PATH=/opt/local/lib cmake, lzlib, glew, boost149, suite-sparse, qt
export C_INCLUDE_PATH=/opt/local/include:/usr/X11/include
export CPLUS_INCLUDE_PATH=/opt/local/include:/usr/X11/include
export LIBRARY_PATH=/opt/local/lib:/usr/X11/lib
Compilation sous VisualExpress C++ (english version bellow) *** english version below ***
Compilation sous VisualExpress C++
Prérequis: Prérequis:
Visual Studio ou C++ Express (au moins 2005, si possible 2010) Visual Studio ou C++ Express (au moins 2005, si possible 2010)
......
...@@ -18,6 +18,8 @@ find_package(Qt4 REQUIRED) ...@@ -18,6 +18,8 @@ find_package(Qt4 REQUIRED)
find_package(QGLViewer REQUIRED) find_package(QGLViewer REQUIRED)
find_package(PythonLibs 2.7 REQUIRED) find_package(PythonLibs 2.7 REQUIRED)
find_package(SuiteSparse REQUIRED) find_package(SuiteSparse REQUIRED)
#find_package(SuperLU REQUIRED)
SET( QT_USE_QTOPENGL TRUE ) SET( QT_USE_QTOPENGL TRUE )
SET( QT_USE_QTXML TRUE ) SET( QT_USE_QTXML TRUE )
...@@ -68,6 +70,7 @@ SET (EXT_INCLUDES ...@@ -68,6 +70,7 @@ SET (EXT_INCLUDES
${QGLVIEWER_INCLUDE_DIR} ${QGLVIEWER_INCLUDE_DIR}
${PYTHON_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS}
${SUITESPARSE_INCLUDE_DIRS} ${SUITESPARSE_INCLUDE_DIRS}
# ${SUPERLU_INCLUDE_DIRS}
) )
# define libs for external libs # define libs for external libs
...@@ -85,6 +88,7 @@ SET (EXT_LIBS ...@@ -85,6 +88,7 @@ SET (EXT_LIBS
${QGLVIEWER_LIBRARIES} ${QGLVIEWER_LIBRARIES}
${PYTHON_LIBRARIES} ${PYTHON_LIBRARIES}
${SUITESPARSE_LIBRARIES} ${SUITESPARSE_LIBRARIES}
# ${SUPERLU_LIBRARIES}
) )
...@@ -134,6 +138,7 @@ SET(SCHNApps_QOBJECT_FILES ...@@ -134,6 +138,7 @@ SET(SCHNApps_QOBJECT_FILES
${SCHNApps_ROOT_DIR}/include/dialogs/cameraViewDialog.h ${SCHNApps_ROOT_DIR}/include/dialogs/cameraViewDialog.h
${SCHNApps_ROOT_DIR}/include/dialogs/pluginsViewDialog.h ${SCHNApps_ROOT_DIR}/include/dialogs/pluginsViewDialog.h
${SCHNApps_ROOT_DIR}/include/dialogs/mapsViewDialog.h ${SCHNApps_ROOT_DIR}/include/dialogs/mapsViewDialog.h
${SCHNApps_ROOT_DIR}/include/colorComboBox.h
) )
......
...@@ -5,6 +5,7 @@ ADD_SUBDIRECTORY(importVolume) ...@@ -5,6 +5,7 @@ ADD_SUBDIRECTORY(importVolume)
ADD_SUBDIRECTORY(differentialProperties) ADD_SUBDIRECTORY(differentialProperties)
ADD_SUBDIRECTORY(render) ADD_SUBDIRECTORY(render)
ADD_SUBDIRECTORY(renderVector) ADD_SUBDIRECTORY(renderVector)
ADD_SUBDIRECTORY(renderScalar)
ADD_SUBDIRECTORY(renderExplod) ADD_SUBDIRECTORY(renderExplod)
ADD_SUBDIRECTORY(renderTopoSurface) ADD_SUBDIRECTORY(renderTopoSurface)
ADD_SUBDIRECTORY(subdivideSurface) ADD_SUBDIRECTORY(subdivideSurface)
......
...@@ -6,19 +6,19 @@ ...@@ -6,19 +6,19 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>570</width> <width>568</width>
<height>452</height> <height>442</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>Compute Curvature</string> <string>Compute Curvature</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QGridLayout" name="gridLayout_2">
<item> <item row="0" column="0">
<widget class="QListWidget" name="mapList"/> <widget class="QListWidget" name="mapList"/>
</item> </item>
<item> <item row="1" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_2"> <layout class="QHBoxLayout" name="horizontalLayout">
<item> <item>
<widget class="QLabel" name="label_2"> <widget class="QLabel" name="label_2">
<property name="text"> <property name="text">
...@@ -61,25 +61,52 @@ ...@@ -61,25 +61,52 @@
</item> </item>
</layout> </layout>
</item> </item>
<item> <item row="2" column="0">
<widget class="QGroupBox" name="groupBox"> <widget class="QGroupBox" name="groupBox">
<property name="title"> <property name="title">
<string>Computed attributes</string> <string>Computed attributes</string>
</property> </property>
<layout class="QGridLayout" name="gridLayout"> <layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label_4">
<property name="font">
<font>
<weight>75</weight>
<italic>true</italic>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Kmax :</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Existing attribute :</string>
</property>
</widget>
</item>
<item row="0" column="2"> <item row="0" column="2">
<layout class="QHBoxLayout" name="horizontalLayout_4"> <widget class="QComboBox" name="combo_KmaxAttribute">
<item> <property name="sizePolicy">
<widget class="QLabel" name="label"> <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<property name="text"> <horstretch>0</horstretch>
<string>New attribute :</string> <verstretch>0</verstretch>
</property> </sizepolicy>
</widget> </property>
</item> </widget>
<item> </item>
<widget class="QLineEdit" name="KmaxAttributeName"/> <item row="0" column="3">
</item> <widget class="QLabel" name="label">
</layout> <property name="text">
<string>New attribute :</string>
</property>
</widget>
</item>
<item row="0" column="4">
<widget class="QLineEdit" name="KmaxAttributeName"/>
</item> </item>
<item row="1" column="0"> <item row="1" column="0">
<widget class="QLabel" name="label_10"> <widget class="QLabel" name="label_10">
...@@ -96,39 +123,31 @@ ...@@ -96,39 +123,31 @@
</widget> </widget>
</item> </item>
<item row="1" column="1"> <item row="1" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_8"> <widget class="QLabel" name="label_9">
<item> <property name="text">
<widget class="QLabel" name="label_9"> <string>Existing attribute :</string>
<property name="text"> </property>
<string>Existing attribute :</string> </widget>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="combo_kmaxAttribute">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
</item> </item>
<item row="1" column="2"> <item row="1" column="2">
<layout class="QHBoxLayout" name="horizontalLayout_7"> <widget class="QComboBox" name="combo_kmaxAttribute">
<item> <property name="sizePolicy">
<widget class="QLabel" name="label_8"> <sizepolicy hsizetype="Expanding" vsizetype="Fixed">