Création d'un compte pour un collaborateur extérieur au laboratoire depuis l'intranet ICube : https://intranet.icube.unistra.fr/fr/labs/member/profile

Commit f86a7f90 authored by untereiner's avatar untereiner
Browse files

Merge cgogn:~thery/CGoGN

parents c403f8c1 e6466e4e
......@@ -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)
......
......@@ -2,16 +2,11 @@
Dépendences Linux:
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 cmake-curses-gui 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:
- on compile d'abord les bibliothèques annexes :
cd CGoGN/ThirdParty/build
cmake ..
make (-j x si vous avez x cores)
make install
- 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)
......@@ -51,10 +46,9 @@ https://iggservis.u-strasbg.fr/Data/data.zip
Linux dependencies:
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
cmake cmake-curses-gui 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:
- first compile third-party libraries:
cd CGoGN/ThirdParty/build
......
*** 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
......@@ -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);
}
}
......
......@@ -94,7 +94,8 @@ void RenderScalarDockTab::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);
}
}
......@@ -104,18 +105,21 @@ void RenderScalarDockTab::selectedScalarVBOChanged()
{
View* view = m_window->getCurrentView();
MapHandlerGen* map = m_currentParams->selectedMap;
QList<QListWidgetItem*> selectedItems = list_scalarVBO->selectedItems();
if(!selectedItems.empty())
if(map)
{
foreach(QListWidgetItem* item, selectedItems)
QList<QListWidgetItem*> selectedItems = list_scalarVBO->selectedItems();
if(!selectedItems.empty())
{
if(item != list_scalarVBO->currentItem())
item->setSelected(false);
foreach(QListWidgetItem* item, selectedItems)
{
if(item != list_scalarVBO->currentItem())
item->setSelected(false);
}
m_plugin->changeScalarVBO(view, map, map->getVBO(list_scalarVBO->currentItem()->text()), true);
}
m_plugin->changeScalarVBO(view, map, map->getVBO(list_scalarVBO->currentItem()->text()), true);
else
m_plugin->changeScalarVBO(view, map, NULL, true);
}
else
m_plugin->changeScalarVBO(view, map, NULL, true);
}
}
......@@ -125,7 +129,8 @@ void RenderScalarDockTab::colorMapChanged(int index)
{
View* view = m_window->getCurrentView();
MapHandlerGen* map = m_currentParams->selectedMap;
m_plugin->changeColorMap(view, map, index, true);
if(map)
m_plugin->changeColorMap(view, map, index, true);
}
}
......@@ -135,7 +140,8 @@ void RenderScalarDockTab::expansionChanged(int i)
{
View* view = m_window->getCurrentView();
MapHandlerGen* map = m_currentParams->selectedMap;
m_plugin->changeExpansion(view, map, i, true);
if(map)
m_plugin->changeExpansion(view, map, i, true);
}
}
......
......@@ -98,7 +98,8 @@ void RenderTopoSurfaceDockTab::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);
}
}
......@@ -108,7 +109,8 @@ void RenderTopoSurfaceDockTab::drawDartsChanged(bool b)
{
View* view = m_window->getCurrentView();
MapHandlerGen* map = m_currentParams->selectedMap;
m_plugin->changeDrawDarts(view, map, b, true);
if(map)
m_plugin->changeDrawDarts(view, map, b, true);
}
}
......@@ -118,7 +120,8 @@ void RenderTopoSurfaceDockTab::dartsColorChanged(int i)
{
View* view = m_window->getCurrentView();
MapHandlerGen* map = m_currentParams->selectedMap;
m_plugin->changeDartsColor(view, map, combo_dartsColor->color(), true);
if(map)
m_plugin->changeDartsColor(view, map, combo_dartsColor->color(), true);
}
}
......@@ -128,7 +131,8 @@ void RenderTopoSurfaceDockTab::drawPhi1Changed(bool b)
{
View* view = m_window->getCurrentView();
MapHandlerGen* map = m_currentParams->selectedMap;
m_plugin->changeDrawPhi1(view, map, b, true);
if(map)
m_plugin->changeDrawPhi1(view, map, b, true);
}
}
......@@ -138,7 +142,8 @@ void RenderTopoSurfaceDockTab::phi1ColorChanged(int i)
{
View* view = m_window->getCurrentView();
MapHandlerGen* map = m_currentParams->selectedMap;
m_plugin->changePhi1Color(view, map, combo_phi1Color->color(), true);
if(map)
m_plugin->changePhi1Color(view, map, combo_phi1Color->color(), true);
}
}
......@@ -148,7 +153,8 @@ void RenderTopoSurfaceDockTab::drawPhi2Changed(bool b)
{
View* view = m_window->getCurrentView();
MapHandlerGen* map = m_currentParams->selectedMap;
m_plugin->changeDrawPhi2(view, map, b, true);
if(map)
m_plugin->changeDrawPhi2(view, map, b, true);
}
}
......@@ -158,7 +164,8 @@ void RenderTopoSurfaceDockTab::phi2ColorChanged(int i)
{
View* view = m_window->getCurrentView();
MapHandlerGen* map = m_currentParams->selectedMap;
m_plugin->changePhi2Color(view, map, combo_phi2Color->color(), true);
if(map)
m_plugin->changePhi2Color(view, map, combo_phi2Color->color(), true);
}
}
......@@ -168,7 +175,8 @@ void RenderTopoSurfaceDockTab::facesScaleFactorChanged(int i)
{
View* view = m_window->getCurrentView();
MapHandlerGen* map = m_currentParams->selectedMap;
m_plugin->changeEdgesScaleFactor(view, map, i, true);
if(map)
m_plugin->changeEdgesScaleFactor(view, map, i, true);
}
}
......@@ -178,7 +186,8 @@ void RenderTopoSurfaceDockTab::edgesScaleFactorChanged(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);
}
}
......
......@@ -88,7 +88,8 @@ void RenderVectorDockTab::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);
}
}
......@@ -98,11 +99,14 @@ void RenderVectorDockTab::selectedVectorsVBOChanged()
{
View* view = m_window->getCurrentView();
MapHandlerGen* map = m_currentParams->selectedMap;
QList<QListWidgetItem*> currentItems = list_vectorVBO->selectedItems();
std::vector<Utils::VBO*> vbos;
foreach(QListWidgetItem* item, currentItems)
vbos.push_back(map->getVBO(item->text()));
m_plugin->changeSelectedVectorsVBO(view, map, vbos, true);
if(map)
{
QList<QListWidgetItem*> currentItems = list_vectorVBO->selectedItems();
std::vector<Utils::VBO*> vbos;
foreach(QListWidgetItem* item, currentItems)
vbos.push_back(map->getVBO(item->text()));
m_plugin->changeSelectedVectorsVBO(view, map, vbos, true);
}
}
}
......@@ -112,7 +116,8 @@ void RenderVectorDockTab::vectorsScaleFactorChanged(int i)
{
View* view = m_window->getCurrentView();
MapHandlerGen* map = m_currentParams->selectedMap;
m_plugin->changeVectorsScaleFactor(view, map, i, true);
if(map)
m_plugin->changeVectorsScaleFactor(view, map, i, true);
}
}
......
......@@ -85,7 +85,8 @@ void SurfaceDeformationDockTab::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);
}
}
......@@ -95,7 +96,8 @@ void SurfaceDeformationDockTab::selectLockedVertices(bool b)
{
View* view = m_window->getCurrentView();
MapHandlerGen* map = m_currentParams->selectedMap;
m_plugin->changeVerticesSelectionMode(view, map, LOCKED, true);
if(map)
m_plugin->changeVerticesSelectionMode(view, map, LOCKED, true);
}
}
......@@ -105,7 +107,8 @@ void SurfaceDeformationDockTab::selectHandleVertices(bool b)
{
View* view = m_window->getCurrentView();
MapHandlerGen* map = m_currentParams->selectedMap;
m_plugin->changeVerticesSelectionMode(view, map, HANDLE, true);
if(map)
m_plugin->changeVerticesSelectionMode(view, map, HANDLE, true);
}
}
......
......@@ -215,7 +215,7 @@ void View::mouseMoveEvent(QMouseEvent* event)
plugin->mouseMove(this, event);
QGLViewer::mouseMoveEvent(event);
QList<View*> views = m_window->getViewsList();
QList<View*> views = m_currentCamera->getLinkedViews();
foreach(View* view, views)
{
if(view != this)
......@@ -229,7 +229,7 @@ void View::wheelEvent(QWheelEvent* event)
plugin->wheelEvent(this, event);
QGLViewer::wheelEvent(event);
QList<View*> views = m_window->getViewsList();
QList<View*> views = m_currentCamera->getLinkedViews();
foreach(View* view, views)
{
if(view != this)
......
/*******************************************************************************
* CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps *
* version 0.1 *
* Copyright (C) 2009-2012, IGG Team, LSIIT, University of Strasbourg *
* Copyright (C) 2009-2013, IGG Team, ICube, 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 *
......@@ -41,21 +41,32 @@ namespace Decimation
enum ApproximatorType
{
A_QEM,
A_MidEdge,
A_CornerCutting,
A_TangentPredict1,
A_TangentPredict2,
A_NormalArea,
A_ColorNaive,
A_ColorQEMext,
A_Lightfield,
// note: the following "h" prefix means that half-edges are prioritized instead of edges.
A_hHalfCollapse,
A_hQEM,
A_hLightfieldHalf
// One approx per edge
// Geometry approximators
A_QEM = 0, /**< Approximates the geometry of an edge collapse by quadric error metric minimization [GH97]. */
A_MidEdge = 1, /**< Approximates the geometry of an edge collapse by placing the resulting vertex in its middle. */
A_CornerCutting = 2,
A_TangentPredict1 = 3,
A_TangentPredict2 = 4,
A_NormalArea = 5, /**< EXPERIMENTAL Approximates the geometry of an edge collapse by minimization of its normal times area measure [Sauvage] */
// Geometry + color approximators
A_ColorNaive = 6, /**< Approximates the color of the resulting vertex by linear interpolation (based on the approximated position) of its two predecessors. */
A_ColorQEMext = 7, /**< Approximates both geometry and color of the resulting vertex by minimization of the extended (R^6) quadric error metric [GH98]. */
A_GeomColorOpt = 8, /**< EXPERIMENTAL. */
// One approx per half-edge
// Generic (considers all provided attributes) approximator
A_hHalfCollapse = 9, /**< Approximates all provided attributes of a half-edge collapse by keeping the attributes of the first of two vertices. */
// Geometry approximator
A_hQEM = 10, /**< Approximates the geometry of a full-edge collapse by quadric error metric minimization [GH97]. Compatible version for half-edge selectors. */
A_OTHER /**< Can be used for extensions. */
} ;
/*!
* \class ApproximatorGen
* \brief Generic class holder for approximators
*/
template <typename PFP>
class ApproximatorGen
{
......@@ -73,7 +84,6 @@ public:
virtual ~ApproximatorGen()
{}
virtual const std::string& getApproximatedAttributeName(unsigned int index = 0) const = 0 ;
// virtual std::vector<std::string> getApproximatedAttributeNames() const = 0 ;
virtual ApproximatorType getType() const = 0 ;
virtual unsigned int getNbApproximated() const = 0 ;
virtual bool init() = 0 ;
......@@ -86,6 +96,10 @@ public:
} ;
/*!
* \class Approximator
* \brief Generic class for approximators
*/
template <typename PFP, typename T, unsigned int ORBIT>
class Approximator : public ApproximatorGen<PFP>
{
......@@ -103,163 +117,33 @@ protected:
std::vector<T> m_app ;
public:
Approximator(MAP& m, std::vector<VertexAttribute<T>* > va, Predictor<PFP, T> * predictor) :
ApproximatorGen<PFP>(m), m_predictor(predictor), m_attrV(va)
{
const unsigned int& size = m_attrV.size() ;
assert(size > 0 || !"Approximator: no attributes provided") ;
m_approx.resize(size) ;
m_detail.resize(size) ;
m_app.resize(size) ;
for (unsigned int i = 0 ; i < size ; ++i)
{
if (!m_attrV[i]->isValid())
std::cerr << "Approximator Warning: attribute number " << i << " is not valid" << std::endl ;
std::stringstream aname ;
aname << "approx_" << m_attrV[i]->name() ;
m_approx[i] = this->m_map.template addAttribute<T, ORBIT>(aname.str()) ;
if(m_predictor) // if predictors are associated to the approximator
{ // create attributes to store the details needed for reconstruction
std::stringstream dname ;
dname << "detail_" << m_attrV[i]->name() ;
m_detail[i] = this->m_map.template addAttribute<T, ORBIT>(dname.str()) ;
}
}
}
virtual ~Approximator()
{
for (unsigned int i = 0 ; i < m_attrV.size() ; ++i)
{
this->m_map.template removeAttribute(m_approx[i]) ;
if(m_predictor)
this->m_map.template removeAttribute(m_detail[i]) ;
}
}
const std::string& getApproximatedAttributeName(unsigned int index = 0) const
{
return m_attrV[index]->name() ;
}
// std::vector<std::string> getApproximatedAttributeNames() const
// {
// std::vector<std::string> names ;
// names.resize(m_attrV.size()) ;
// for (unsigned int i = 0 ; i < m_attrV.size() ; ++i)
// names[i] = m_attrV[i]->name() ;
//
// return names ;
// }
unsigned int getNbApproximated() const
{
return m_attrV.size() ;
}
void saveApprox(Dart d)
{
for (unsigned int i = 0 ; i < m_attrV.size() ; ++i)
m_app[i] = m_approx[i][d] ;
}
void affectApprox(Dart d)
{
for (unsigned int i = 0 ; i < m_attrV.size() ; ++i)
m_attrV[i]->operator[](d) = m_app[i] ;
}
const T& getApprox(Dart d, unsigned int index = 0) const
{
return m_approx[index][d] ;
}
const VertexAttribute<T>& getAttr(unsigned int index = 0) const
{
return *(m_attrV[index]) ;
}
std::vector<T> getAllApprox(Dart d) const
{
std::vector<T> res ;
res.resize(m_attrV.size()) ;
for (unsigned int i = 0 ; i < m_attrV.size() ; ++i)
res[i] = m_approx[i][d] ;
return res ;
}
const Predictor<PFP, T>* getPredictor() const