Commit 09950e47 authored by Thomas Jund's avatar Thomas Jund

merge

parents a9026e1f 5502db65
......@@ -965,7 +965,7 @@ void Clipping::cb_keyPress(int code)
}
}
void Clipping::cb_mousePress(int button, int x, int y)
void Clipping::cb_mousePress(int /*button*/, int x, int y)
{
// Check if no animation is active
if (m_lastAnimatedClippingPreset != NULL)
......
......@@ -145,7 +145,7 @@ void MyQT::cb_redraw()
}
void MyQT::cb_mousePress(int button, int x, int y)
void MyQT::cb_mousePress(int /*button*/, int x, int y)
{
if (!Shift())
return;
......@@ -249,7 +249,7 @@ void MyQT::cb_mouseMove(int buttons, int x, int y)
}
void MyQT::cb_wheelEvent(int delta, int x, int y)
void MyQT::cb_wheelEvent(int delta, int /*x*/, int /*y*/)
{
if (!Shift())
return;
......
......@@ -157,17 +157,17 @@ void TexView::cb_keyPress(int code)
updateGL();
}
void TexView::init(char *fnm, char* fnt)
void TexView::init(const std::string& fnm, const std::string& fnt)
{
if (fnm == NULL)
if (fnm.empty() )
{
computeTore();
m_fileNameTex = std::string(fnt);
m_fileNameTex = fnt;
}
else
{
m_fileNameMesh = std::string(fnm);
m_fileNameTex = std::string(fnt);
m_fileNameMesh = fnm;
m_fileNameTex = fnt;
std::vector<std::string> attrNames;
m_obj.import(m_fileNameMesh,attrNames);
......@@ -260,11 +260,11 @@ int main(int argc, char**argv)
}
else if (argc == 2)
{
tv.init(NULL, argv[1]);
tv.init("", argv[1]);
}
else
{
tv.init(NULL,"x");
tv.init("","x");
}
......
......@@ -89,7 +89,7 @@ public:
~TexView();
void init(char* fnm, char* fnt);
void init(const std::string& fnm, const std::string& fnt);
// callbacks of simpleQT to overdefine:
void cb_redraw();
......
......@@ -31,6 +31,7 @@ Viewer::Viewer() :
m_drawFaces(true),
m_drawNormals(false),
m_drawTopo(false),
m_drawBoundaryTopo(true),
m_render(NULL),
m_phongShader(NULL),
m_flatShader(NULL),
......@@ -229,7 +230,7 @@ void Viewer::importMesh(std::string& filename)
m_render->initPrimitives<PFP>(myMap, Algo::Render::GL2::LINES) ;
m_render->initPrimitives<PFP>(myMap, Algo::Render::GL2::TRIANGLES) ;
m_topoRender->updateData<PFP>(myMap, position, 0.85f, 0.85f) ;
m_topoRender->updateData<PFP>(myMap, position, 0.85f, 0.85f, m_drawBoundaryTopo) ;
bb = Algo::Geometry::computeBoundingBox<PFP>(myMap, position) ;
normalBaseSize = bb.diagSize() / 100.0f ;
......
......@@ -98,6 +98,7 @@ public:
bool m_drawFaces ;
bool m_drawNormals ;
bool m_drawTopo ;
bool m_drawBoundaryTopo;
VertexAttribute<VEC3> position ;
VertexAttribute<VEC3> normal ;
......
......@@ -33,24 +33,26 @@
#include "Utils/chrono.h"
#include "Algo/Export/exportVol.h"
PFP::MAP myMap;
VertexAttribute<PFP::VEC3> position ;
VolumeAttribute<PFP::VEC3> color ;
void MyQT::volumes_onoff(bool x)
void MyQT::volumes_onoff(bool /*x*/)
{
render_volumes = !render_volumes;
updateGL();
}
void MyQT::edges_onoff(bool x)
void MyQT::edges_onoff(bool /*x*/)
{
render_edges = !render_edges;
updateGL();
}
void MyQT::topo_onoff(bool x)
void MyQT::topo_onoff(bool /*x*/)
{
render_topo = !render_topo;
if (render_topo)
......@@ -88,7 +90,7 @@ void MyQT::clipping_onoff(bool x)
updateGL();
}
void MyQT::hide_onoff(bool x)
void MyQT::hide_onoff(bool /*x*/)
{
hide_clipping = !hide_clipping;
updateGL();
......@@ -146,21 +148,21 @@ void MyQT::cb_Open()
size_t pos = filename.rfind("."); // position of "." in filename
std::string extension = filename.substr(pos);
if(extension == std::string(".off"))
{
if(!Algo::Volume::Import::importMeshToExtrude<PFP>(myMap, filename, attrNames))
{
std::cerr << "could not import " << filename << std::endl ;
return ;
}
else
{
position = myMap.getAttribute<PFP::VEC3, VERTEX>(attrNames[0]) ;
myMap.closeMap();
}
}
else
{
// if(extension == std::string(".off"))
// {
// if(!Algo::Volume::Import::importMeshToExtrude<PFP>(myMap, filename, attrNames))
// {
// std::cerr << "could not import " << filename << std::endl ;
// return ;
// }
// else
// {
// position = myMap.getAttribute<PFP::VEC3, VERTEX>(attrNames[0]) ;
// myMap.closeMap();
// }
// }
// else
// {
if(!Algo::Volume::Import::importMesh<PFP>(myMap, filename, attrNames))
{
std::cerr << "could not import " << filename << std::endl ;
......@@ -168,7 +170,7 @@ void MyQT::cb_Open()
}
else
position = myMap.getAttribute<PFP::VEC3,VERTEX>(attrNames[0]) ;
}
// }
color = myMap.addAttribute<PFP::VEC3, VOLUME>("color");
......@@ -270,7 +272,7 @@ void MyQT::cb_redraw()
}
void MyQT::cb_mousePress(int button, int x, int y)
void MyQT::cb_mousePress(int /*button*/, int x, int y)
{
if (!Shift())
return;
......@@ -299,7 +301,7 @@ void MyQT::cb_mousePress(int button, int x, int y)
}
}
void MyQT::cb_mouseRelease(int button, int x, int y)
void MyQT::cb_mouseRelease(int /*button*/, int /*x*/, int /*y*/)
{
if (hide_clipping || !clip_volume)
......@@ -418,6 +420,12 @@ int main(int argc, char **argv)
color[i][0] /= maxV;
color[i][2] = 1.0f - color[i][0];
}
// Algo::Volume::Export::exportNAS<PFP>(myMap,position,"/tmp/test2.nas");
// Algo::Volume::Export::exportMSH<PFP>(myMap,position,"/tmp/test2.msh");
// Algo::Volume::Export::exportTet<PFP>(myMap,position,"/tmp/test2.tet");
// Algo::Volume::Export::exportNodeEle<PFP>(myMap,position,"/tmp/test2");
// Algo::Volume::Export::exportVTU<PFP>(myMap,position,"/tmp/test4.vtu");
}
else
{
......@@ -437,6 +445,9 @@ int main(int argc, char **argv)
TraversorW<PFP::MAP> tra(myMap);
for (Dart d = tra.begin(); d != tra.end(); d = tra.next())
color[d] = position[d] + PFP::VEC3(0.5,0.5,0.5);
// Algo::Volume::Export::exportMSH<PFP>(myMap,position,"/tmp/test2.msh");
// Algo::Volume::Export::exportNAS<PFP>(myMap,position,"/tmp/test1.nas");
// Algo::Volume::Export::exportVTU<PFP>(myMap,position,"/tmp/test3.vtu");
}
// un peu d'interface
QApplication app(argc, argv);
......
......@@ -140,7 +140,7 @@ void MyQT::cb_redraw()
m_drawer.callList();
}
void MyQT::cb_mousePress(int button, int x, int y)
void MyQT::cb_mousePress(int /*button*/, int x, int y)
{
if (Shift())
{
......
......@@ -38,21 +38,21 @@ MAP myMap;
VertexAttribute<VEC3> position ;
Dart dglobal;
void MyQT::balls_onoff(bool x)
void MyQT::balls_onoff(bool /*x*/)
{
render_balls = !render_balls;
updateGL();
CGoGNerr << " balls_onoff "<< CGoGNendl;
}
void MyQT::vectors_onoff(bool x)
void MyQT::vectors_onoff(bool /*x*/)
{
render_vectors = !render_vectors;
updateGL();
CGoGNerr << " vectors_onoff "<< CGoGNflush;
}
void MyQT::text_onoff(bool x)
void MyQT::text_onoff(bool /*x*/)
{
render_text = !render_text;
updateGL();
......@@ -60,7 +60,7 @@ void MyQT::text_onoff(bool x)
}
void MyQT::topo_onoff(bool x)
void MyQT::topo_onoff(bool /*x*/)
{
render_topo = !render_topo;
updateGL();
......@@ -212,7 +212,7 @@ void MyQT::cb_redraw()
}
}
void MyQT::cb_mousePress(int button, int x, int y)
void MyQT::cb_mousePress(int /*button*/, int x, int y)
{
if (Shift())
{
......@@ -301,7 +301,7 @@ int main(int argc, char **argv)
CGoGNout << "CGoGNOut dans la console" << Geom::Vec3f(2.5f, 2.2f, 4.3f) << CGoGNendl;
// CGoGNout.toStatusBar(NULL);
CGoGNout.noStatusBar();
// bounding box
Geom::BoundingBox<PFP::VEC3> bb = Algo::Geometry::computeBoundingBox<PFP>(myMap, position);
......
......@@ -146,7 +146,7 @@ public:
FunctorAttribThreaded(),m_positions(pos),m_positions2(pos2)
{}
void run(unsigned int i, unsigned int threadID)
void run(unsigned int i, unsigned int /*threadID*/)
{
m_positions2[i] = 1.1f * m_positions[i];
}
......@@ -181,7 +181,7 @@ public:
m_positions(pos),m_positions2(pos2)
{}
void run(Dart d, unsigned int threadID)
void run(Dart d, unsigned int /*threadID*/)
{
typename XXX::VEC3 Q(0,0,0);
int nb=0;
......@@ -232,7 +232,7 @@ public:
unsigned int getNb() { return m_nb;}
void run(Dart d, unsigned int threadID)
void run(Dart d, unsigned int /*threadID*/)
{
Dart dd = this->m_map.phi2(d);
typename XXX::VEC3 V = m_positions[dd] - m_positions[d];
......
......@@ -357,8 +357,9 @@ void MyQT::cb_Open()
void MyQT::cb_Save()
{
std::string filename = selectFileSave("Export SVG file ",".","(*.off)");
std::string filename = selectFileSave("Export Off file ",".","(*.off)");
Algo::Surface::Export::exportOFF<PFP>(myMap,position,filename.c_str());
//std::cout << "could not save file : " << filename << std::endl;
}
void MyQT::importMesh(std::string& filename)
......
......@@ -88,7 +88,7 @@ void MyQT::clipping_onoff(bool x)
updateGL();
}
void MyQT::hide_onoff(bool x)
void MyQT::hide_onoff(bool /*x*/)
{
hide_clipping = !hide_clipping;
updateMap();
......@@ -253,15 +253,26 @@ void MyQT::operation(int x)
dock.listOper->setCurrentRow(-1);
}
void MyQT::createMap(int n)
void MyQT::createMap(int /*n*/)
{
myMap.clear(true);
position = myMap.getAttribute<VEC3, VERTEX>("position");
if (!position.isValid())
position = myMap.addAttribute<VEC3, VERTEX>("position");
Algo::Volume::Modelisation::Primitive3D<PFP> prim(myMap, position);
prim.hexaGrid_topo(n,n,n);
prim.embedHexaGrid(1.0f,1.0f,1.0f);
// Algo::Volume::Modelisation::Primitive3D<PFP> prim(myMap, position);
// prim.hexaGrid_topo(n,n,n);
// prim.embedHexaGrid(1.0f,1.0f,1.0f);
// Algo::Surface::Modelisation::Polyhedron<PFP> poly(myMap, position);
// poly.cylinder_topo(6,1,true,true);
// poly.embedCylinder(6.0,6.0,5.0);
// myMap.closeMap();
Dart d = Algo::Surface::Modelisation::embedPrism<PFP>(myMap, position, 5, true,6.0,6.0,5.0);
Dart d2 = Algo::Surface::Modelisation::embedPyramid<PFP>(myMap, position, 4, true,6.0,5.0);
myMap.sewVolumes(myMap.phi2(d),d2);
position[myMap.phi_1(myMap.phi2(d2))] += VEC3(9.0,-5.0,-2.5);
myMap.check();
......@@ -429,7 +440,7 @@ void MyQT::cb_mousePress(int button, int x, int y)
}
}
void MyQT::cb_mouseRelease(int button, int x, int y)
void MyQT::cb_mouseRelease(int /*button*/, int /*x*/, int /*y*/)
{
if (hide_clipping || !clip_volume)
......@@ -565,8 +576,8 @@ void MyQT::cb_keyPress(int keycode)
updateGL();
break;
case 'W':
m_ex1 = 0.9f;
m_ex2 = 0.9f;
m_ex1 = 0.95f;
m_ex2 = 0.95f;
m_render_topo->updateData<PFP>(myMap, position, m_ex1,m_ex2,m_ex3/*, nb*/);
updateGL();
break;
......
......@@ -42,7 +42,7 @@ VertexAttribute<VEC3> position ;
DartAttribute<VEC3> middleDarts;
void MyQT::text_onoff(bool x)
void MyQT::text_onoff(bool /*x*/)
{
render_text = !render_text;
updateGL();
......@@ -162,7 +162,7 @@ void MyQT::cb_redraw()
}
void MyQT::cb_mousePress(int button, int x, int y)
void MyQT::cb_mousePress(int /*button*/, int x, int y)
{
if (Shift())
{
......
......@@ -104,7 +104,7 @@ ENDIF (WITH_ZINRI)
IF (WITH_QT)
add_definitions(-DWITH_QT)
find_package(Qt4 REQUIRED)
find_package(Qt REQUIRED)
SET(QT_USE_QTCORE TRUE)
SET(QT_USE_QTOPENGL TRUE)
SET(QT_USE_QTSVG TRUE)
......@@ -138,8 +138,9 @@ IF(WIN32)
set(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE STRING "Only Release or Debug" FORCE)
# set(CMAKE_CONFIGURATION_TYPES "Release Debug" CACHE STRING "Only Release or Debug" FORCE)
ELSE(WIN32)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fPIC")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -fPIC")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -fPIC")
# SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wclobbered -Wempty-body -Wignored-qualifiers -Wmissing-field-initializers -Wsign-compare -Wtype-limits -Wuninitialized -fPIC")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Woverride-init -fPIC")
add_subdirectory(Release)
add_subdirectory(Debug)
add_subdirectory(${CGoGN_ROOT_DIR}/Apps Apps)
......
......@@ -3,7 +3,10 @@ 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
Pour compiler CGoGN:
- aller dans ThirdParty, cd build, taper "cmake .", puis make ( avec -j x si vous avez x core sur votre machine) suivi de make install
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
......@@ -44,19 +47,28 @@ 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
To compile CGoGN:
- Go ThirdParty, cd build, type "cmake .." and then make (with -j x if you have x core on your machine) followed by make install
We can set some option to not compile everything (see the README.TXT in ThirdParty)
You can also compile debug by creating a directory that ended Debug build instead
- Go to build and type "cmake .." and then make
Options (Boolean) are also available here:
BUILD_SHARED_LIBS (F) experimental!
WITH_ASSIMP (T)
WITH_NUMERICAL (T)
WITH_ZINRI (T)
WITH_QT (T)
to minimize dependencies and compilation time /
- first compile third-party libraries:
cd CGoGN/ThirdParty/build
cmake ..
make (-j x if you have x cores)
make install
Some options are available to not compile everything (see the README.TXT in ThirdParty)
- then compile CGoGN (the libs are generated in CGoGN/lib and some examples in CGoGN/bin):
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)
allow the compilation in 3 mode: mixed(0), multi-resolution(1), mono-resolution(2).
......
*** english version below ***
Pour compiler CGoGN sur MAC (testé sur OS X 10.8.2)
Pour compiler CGoGN sur MAC (testé sur OS X 10.8.3)
Installer avec homebrew
cmake, lzlib, glew, boost149, suite-sparse, qt
Pour pouvoir installer le paquet suite-sparse, il faut avoir
prélablement ajouté le dépôt homebrew/science grâce à la commande suivante :
brew tap homebrew/science
=========================================================================================
ENGLISH VERSION
=========================================================================================
To compile CGoGN on MAC (tested on OSX 10.8.2)
To compile CGoGN on MAC (tested on OSX 10.8.3)
Install with homebrew
cmake, lzlib, glew, boost149, suite-sparse, qt
To install suite-sparse package, you must first
add the homebrew/science repository with the following command :
brew tap homebrew/science
......@@ -137,12 +137,15 @@ void DifferentialPropertiesPlugin::computeCurvatureFromDialog()
else
KnormalName = m_computeCurvatureDialog->KnormalAttributeName->text();
bool compute_kmean = (m_computeCurvatureDialog->check_computeKmean->checkState() == Qt::Checked);
bool compute_kgaussian = (m_computeCurvatureDialog->check_computeKgaussian->checkState() == Qt::Checked);
bool autoUpdate = (currentItems[0]->checkState() == Qt::Checked);
computeCurvature(
mapName,
positionName, normalName,
KmaxName, kmaxName, KminName, kminName, KnormalName,
compute_kmean, compute_kgaussian,
autoUpdate
);
}
......
......@@ -97,7 +97,8 @@ void RenderDockTab::positionVBOChanged(int index)
{
View* view = m_window->getCurrentView();
MapHandlerGen* map = m_currentParams->selectedMap;
m_plugin->changePositionVBO(view, map, map->getVBO(combo_positionVBO->currentText()), true);
if(map)
m_plugin->changePositionVBO(view, map, map->getVBO(combo_positionVBO->currentText()), true);
}
}
......@@ -107,7 +108,8 @@ void RenderDockTab::normalVBOChanged(int index)
{
View* view = m_window->getCurrentView();
MapHandlerGen* map = m_currentParams->selectedMap;
m_plugin->changeNormalVBO(view, map, map->getVBO(combo_normalVBO->currentText()), true);
if(map)
m_plugin->changeNormalVBO(view, map, map->getVBO(combo_normalVBO->currentText()), true);
}
}
......@@ -117,7 +119,8 @@ void RenderDockTab::renderVerticesChanged(bool b)
{
View* view = m_window->getCurrentView();
MapHandlerGen* map = m_currentParams->selectedMap;
m_plugin->changeRenderVertices(view, map, b, true);
if(map)
m_plugin->changeRenderVertices(view, map, b, true);
}
}
......@@ -127,7 +130,8 @@ void RenderDockTab::verticesScaleFactorChanged(int i)
{
View* view = m_window->getCurrentView();
MapHandlerGen* map = m_currentParams->selectedMap;
m_plugin->changeVerticesScaleFactor(view, map, i / 50.0, true);
if(map)
m_plugin->changeVerticesScaleFactor(view, map, i / 50.0, true);
}
}
......@@ -137,7 +141,8 @@ void RenderDockTab::renderEdgesChanged(bool b)
{
View* view = m_window->getCurrentView();
MapHandlerGen* map = m_currentParams->selectedMap;
m_plugin->changeRenderEdges(view, map, b, true);
if(map)
m_plugin->changeRenderEdges(view, map, b, true);
}
}
......@@ -147,7 +152,8 @@ void RenderDockTab::renderFacesChanged(bool b)
{
View* view = m_window->getCurrentView();
MapHandlerGen* map = m_currentParams->selectedMap;
m_plugin->changeRenderFaces(view, map, b, true);
if(map)
m_plugin->changeRenderFaces(view, map, b, true);
}
}
......@@ -157,10 +163,13 @@ void RenderDockTab::faceStyleChanged(QAbstractButton* b)
{
View* view = m_window->getCurrentView();
MapHandlerGen* map = m_currentParams->selectedMap;
if(radio_flatShading->isChecked())
m_plugin->changeFacesStyle(view, map, FLAT, true);
else if(radio_phongShading->isChecked())
m_plugin->changeFacesStyle(view, map, PHONG, true);
if(map)
{
if(radio_flatShading->isChecked())
m_plugin->changeFacesStyle(view, map, FLAT, true);
else if(radio_phongShading->isChecked())
m_plugin->changeFacesStyle(view, map, PHONG, true);
}
}
}
......
......@@ -99,7 +99,8 @@ void RenderExplodDockTab::positionAttributeChanged(int index)
{
View* view = m_window->getCurrentView();
MapHandlerGen* map = m_currentParams->selectedMap;
m_plugin->changePositionAttribute(view, map, map->getAttribute<PFP2::VEC3, VERTEX>(combo_positionAttribute->currentText()), true);
if(map)
m_plugin->changePositionAttribute(view, map, map->getAttribute<PFP2::VEC3, VERTEX>(combo_positionAttribute->currentText()), true);
}
}
......@@ -109,7 +110,8 @@ void RenderExplodDockTab::colorAttributeChanged(int index)
{
View* view = m_window->getCurrentView();
MapHandlerGen* map = m_currentParams->selectedMap;
m_plugin->changeColorAttribute(view, map, map->getAttribute<PFP2::VEC3, VERTEX>(combo_colorAttribute->currentText()), true);
if(map)
m_plugin->changeColorAttribute(view, map, map->getAttribute<PFP2::VEC3, VERTEX>(combo_colorAttribute->currentText()), true);
}
}
......@@ -119,7 +121,8 @@ void RenderExplodDockTab::renderEdgesChanged(bool b)
{
View* view = m_window->getCurrentView();
MapHandlerGen* map = m_currentParams->selectedMap;
m_plugin->changeRenderEdges(view, map, b, true);
if(map)
m_plugin->changeRenderEdges(view, map, b, true);
}
}
......@@ -129,7 +132,8 @@ void RenderExplodDockTab::renderFacesChanged(bool b)
{
View* view = m_window->getCurrentView();
MapHandlerGen* map = m_currentParams->selectedMap;
m_plugin->changeRenderFaces(view, map, b, true);
if(map)
m_plugin->changeRenderFaces(view, map, b, true);
}
}
......@@ -139,7 +143,8 @@ void RenderExplodDockTab::facesScaleFactorChanged(int i)
{
View* view = m_window->getCurrentView();
MapHandlerGen* map = m_currentParams->selectedMap;
m_plugin->changeFacesScaleFactor(view, map, i, true);
if(map)
m_plugin->changeFacesScaleFactor(view, map, i, true);
}
}
......@@ -149,7 +154,8 @@ void RenderExplodDockTab::volumesScaleFactorChanged(int i)
{
View* view = m_window->getCurrentView();
MapHandlerGen* map = m_currentParams->selectedMap;
m_plugin->changeVolumesScaleFactor(view, map, i, true);
if(map)
m_plugin->changeVolumesScaleFactor(view, map, i, true);
}
}
......
......@@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>174</width>
<width>181</width>
<height>545</height>
</rect>
</property>
......@@ -14,29 +14,25 @@
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0" colspan="2">
<item row="0" column="0" colspan="4">
<widget class="QListWidget" name="mapList"/>
</item>
<item row="1" column="0" colspan="2">