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

Merge cgogn:~cgogn/CGoGN

Conflicts:
	CMakeLists.txt
parents 66c71a0c b34bc7c1
......@@ -114,6 +114,7 @@ void Viewer::cb_initGL()
m_pointSprite = new Utils::PointSprite() ;
m_pointSprite->setAttributePosition(m_positionVBO) ;
m_pointSprite->setColor(Geom::Vec4f(0.0f, 0.0f, 1.0f, 1.0f)) ;
registerShader(m_phongShader) ;
registerShader(m_flatShader) ;
......@@ -126,11 +127,8 @@ void Viewer::cb_redraw()
{
if(m_drawVertices)
{
float size = vertexScaleFactor ;
m_pointSprite->setSize(size) ;
m_pointSprite->predraw(Geom::Vec3f(0.0f, 0.0f, 1.0f)) ;
m_pointSprite->setSize(vertexScaleFactor) ;
m_render->draw(m_pointSprite, Algo::Render::GL2::POINTS) ;
m_pointSprite->postdraw() ;
}
if(m_drawEdges)
......
......@@ -163,15 +163,15 @@ void MyQT::cb_Save()
Utils::SVG::SVGOut svg1(modelViewMatrix(), projectionMatrix());
m_drawer.toSVG(svg1);
svg1.addOpacityAnimation(1.0f);
svg1.addOpacityAnimation(1.0f);
svg1.addOpacityAnimation(0.0f);
// svg1.addOpacityAnimation(1.0f);
// svg1.addOpacityAnimation(1.0f);
// svg1.addOpacityAnimation(0.0f);
Utils::SVG::SVGOut svg2(modelViewMatrix(), projectionMatrix());
m_render_topo->toSVG(svg2);
svg2.addOpacityAnimation(1.0f);
svg2.addOpacityAnimation(0.0f);
svg2.addOpacityAnimation(1.0f);
// svg2.addOpacityAnimation(1.0f);
// svg2.addOpacityAnimation(0.0f);
// svg2.addOpacityAnimation(1.0f);
Utils::SVG::AnimatedSVGOut anim;
......
......@@ -129,6 +129,7 @@ void MyQT::cb_initGL()
m_sprite = new Utils::PointSprite();
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));
storeVerticesInfo();
......@@ -200,9 +201,7 @@ void MyQT::cb_redraw()
if (render_balls)
{
m_sprite->predraw(Geom::Vec3f(1.0f, 0.0f ,0.0f));
m_render->draw(m_sprite, Algo::Render::GL2::POINTS);
m_sprite->postdraw();
}
if (render_vectors)
......@@ -237,13 +236,13 @@ void MyQT::cb_keyPress(int code)
{
std::string filename = selectFileSave("Export SVG file ",".","(*.svg)");
Utils::SVG::SVGOut svg(filename, modelViewMatrix(), projectionMatrix());
svg.setWidth(1.0f);
svg.setColor(Geom::Vec3f(0.0f,0.0f,0.5f));
// svg.setWidth(1.0f);
// svg.setColor(Geom::Vec3f(0.0f,0.0f,0.5f));
Algo::Render::SVG::renderEdges<PFP>(svg, myMap, position);
svg.setColor(Geom::Vec3f(0.0f,0.8f,0.0f));
svg.setWidth(5.0f);
// svg.setColor(Geom::Vec3f(0.0f,0.8f,0.0f));
// svg.setWidth(5.0f);
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);
//svg destruction close the file
}
......
......@@ -235,6 +235,16 @@ void MyQT::operation(int x)
std::cout << "nb darts after = " << myMap.getNbDarts() << std::endl;
}
break;
case 11 :
CGoGNout <<"unsew volumes"<<CGoGNendl;
if (m_selected != NIL)
{
myMap.unsewVolumes(m_selected);
dm.markAll();
m_selected = NIL;
updateMap();
}
break;
default:
break;
}
......
......@@ -145,6 +145,11 @@
<string>splitVertex</string>
</property>
</item>
<item>
<property name="text">
<string>unsewVolumes</string>
</property>
</item>
</widget>
</item>
<item row="6" column="0">
......
......@@ -33,7 +33,7 @@ find_package(Boost COMPONENTS regex thread system REQUIRED)
find_package(ZLIB REQUIRED)
find_package(LibXml2 REQUIRED)
find_package(GLEW REQUIRED)
find_package(SuiteSparse REQUIRED)
#find_package(SuiteSparse REQUIRED)
IF (DEFINED ASSERTON)
add_definitions(-DCGOGN_ASSERT_BOOL=${ASSERTON})
......@@ -73,6 +73,7 @@ SET (CGoGN_EXT_INCLUDES
${ZLIB_INCLUDE_DIRS}
${LIBXML2_INCLUDE_DIR}
${Boost_INCLUDE_DIRS}
# ${SUITESPARSE_INCLUDE_DIRS}
)
# define libs for external libs
......@@ -85,7 +86,7 @@ SET (CGoGN_EXT_LIBS
${Boost_SYSTEM_LIBRARY}
${Boost_REGEX_LIBRARY}
${Boost_THREAD_LIBRARY}
${SUITESPARSE_LIBRARIES}
# ${SUITESPARSE_LIBRARIES}
)
#optionnal libs
......
*** english version below ***
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
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 aussi compiler en debug en créant un répertoir qui fini par Debug à la place de build
- aller dans build et taper "cmake ..", puis make
Des options (booléennes) sont ici aussi disponible:
- ensuite on compile CGoGN (compile les libs dans CGoGN/lib et des exemples dans CGoGN/bin) :
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 !
WITH_ASSIMP (T)
WITH_NUMERICAL (T)
WITH_ZINRI (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)
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)
permet de forcer la compilation en une seule lib (libcgogn.a) au lieu de quatre.
- la compilation des sous-parties se fait en allant dans les sous-repertoires de build
- on peut ensuite compiler SCHNApps ainsi que les plugins fournis :
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:
- fichiers trianbgz, off, etc
......@@ -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
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)
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).
allows the compilation in 3 modes: mono-resolution (0), multi-resolution (1)
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:
- 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)
* 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:
cd /usr/include; sudo ln -s sys/malloc.h .
Ceci permet d'éviter pas mal de pb de compilation de source linux.
Pour compiler CGoGN sur MAC (testé sur OS X 10.8.2)
2) installer avec macports ou homebrew
zlib, glew (sudo port install xxxx)
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
Installer avec homebrew
cmake, lzlib, glew, boost149, suite-sparse, qt
=========================================================================================
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:
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
Install with homebrew
cmake, lzlib, glew, boost149, suite-sparse, qt
Compilation sous VisualExpress C++ (english version bellow)
*** english version below ***
Compilation sous VisualExpress C++
Prérequis:
Visual Studio ou C++ Express (au moins 2005, si possible 2010)
......
......@@ -18,6 +18,8 @@ find_package(Qt4 REQUIRED)
find_package(QGLViewer REQUIRED)
find_package(PythonLibs 2.7 REQUIRED)
find_package(SuiteSparse REQUIRED)
#find_package(SuperLU REQUIRED)
SET( QT_USE_QTOPENGL TRUE )
SET( QT_USE_QTXML TRUE )
......@@ -68,6 +70,7 @@ SET (EXT_INCLUDES
${QGLVIEWER_INCLUDE_DIR}
${PYTHON_INCLUDE_DIRS}
${SUITESPARSE_INCLUDE_DIRS}
# ${SUPERLU_INCLUDE_DIRS}
)
# define libs for external libs
......@@ -85,6 +88,7 @@ SET (EXT_LIBS
${QGLVIEWER_LIBRARIES}
${PYTHON_LIBRARIES}
${SUITESPARSE_LIBRARIES}
# ${SUPERLU_LIBRARIES}
)
......@@ -134,6 +138,7 @@ SET(SCHNApps_QOBJECT_FILES
${SCHNApps_ROOT_DIR}/include/dialogs/cameraViewDialog.h
${SCHNApps_ROOT_DIR}/include/dialogs/pluginsViewDialog.h
${SCHNApps_ROOT_DIR}/include/dialogs/mapsViewDialog.h
${SCHNApps_ROOT_DIR}/include/colorComboBox.h
)
......
......@@ -5,6 +5,7 @@ ADD_SUBDIRECTORY(importVolume)
ADD_SUBDIRECTORY(differentialProperties)
ADD_SUBDIRECTORY(render)
ADD_SUBDIRECTORY(renderVector)
ADD_SUBDIRECTORY(renderScalar)
ADD_SUBDIRECTORY(renderExplod)
ADD_SUBDIRECTORY(renderTopoSurface)
ADD_SUBDIRECTORY(subdivideSurface)
......
......@@ -62,6 +62,8 @@ public slots:
const QString& KminAttributeName = "Kmin",
const QString& kminAttributeName = "kmin",
const QString& KnormalAttributeName = "Knormal",
bool compute_kmean = true,
bool compute_kgaussian = true,
bool autoUpdate = true
);
......@@ -90,10 +92,10 @@ private:
ComputeCurvatureParameters(
const QString& p, const QString& n,
const QString& Kmax, const QString& kmax, const QString& Kmin, const QString& kmin, const QString& Knormal,
bool update) :
bool kmean, bool kgaussian, bool update) :
positionName(p), normalName(n),
KmaxName(Kmax), kmaxName(kmax), KminName(Kmin), kminName(kmin), KnormalName(Knormal),
autoUpdate(update)
compute_kmean(kmean), compute_kgaussian(kgaussian), autoUpdate(update)
{}
QString positionName;
QString normalName;
......@@ -102,6 +104,8 @@ private:
QString KminName;
QString kminName;
QString KnormalName;
bool compute_kmean;
bool compute_kgaussian;
bool autoUpdate;
};
QHash<QString, ComputeCurvatureParameters> computeCurvatureLastParameters;
......
......@@ -29,7 +29,10 @@ ComputeCurvatureDialog::ComputeCurvatureDialog(Window* w) :
const QList<MapHandlerGen*>& maps = m_window->getMapsList();
foreach(MapHandlerGen* map, maps)
mapList->addItem(map->getName());
{
QListWidgetItem* item = new QListWidgetItem(map->getName(), mapList);
item->setCheckState(Qt::Unchecked);
}
}
void ComputeCurvatureDialog::selectedMapChanged()
......@@ -106,7 +109,8 @@ void ComputeCurvatureDialog::selectedMapChanged()
void ComputeCurvatureDialog::addMapToList(MapHandlerGen* m)
{
mapList->addItem(m->getName());
QListWidgetItem* item = new QListWidgetItem(m->getName(), mapList);
item->setCheckState(Qt::Unchecked);
}
void ComputeCurvatureDialog::removeMapFromList(MapHandlerGen* m)
......
......@@ -28,7 +28,6 @@ ComputeNormalDialog::ComputeNormalDialog(Window* w) :
{
QListWidgetItem* item = new QListWidgetItem(map->getName(), mapList);
item->setCheckState(Qt::Unchecked);
connect(map, SIGNAL(attributeModified(unsigned int, QString)), this, SLOT(attributeModified(unsigned int, QString)));
}
}
......
......@@ -49,8 +49,19 @@ void DifferentialPropertiesPlugin::attributeModified(unsigned int orbit, QString
if(computeNormalLastParameters.contains(map->getName()))
{
ComputeNormalParameters& params = computeNormalLastParameters[map->getName()];
if(params.positionName == nameAttr && params.autoUpdate)
computeNormal(map->getName(), params.positionName, params.normalName);
if(params.autoUpdate && params.positionName == nameAttr)
computeNormal(map->getName(), params.positionName, params.normalName, true);
}
if(computeCurvatureLastParameters.contains(map->getName()))
{
ComputeCurvatureParameters& params = computeCurvatureLastParameters[map->getName()];
if(params.autoUpdate && (params.positionName == nameAttr || params.normalName == nameAttr))
computeCurvature(
map->getName(),
params.positionName, params.normalName,
params.KmaxName, params.kmaxName, params.KminName, params.kminName, params.KnormalName,
true
);
}
}
}
......@@ -175,6 +186,8 @@ void DifferentialPropertiesPlugin::computeCurvature(
const QString& KminAttributeName,
const QString& kminAttributeName,
const QString& KnormalAttributeName,
bool compute_kmean,
bool compute_kgaussian,
bool autoUpdate)
{
MapHandler<PFP2>* mh = static_cast<MapHandler<PFP2>*>(m_window->getMap(mapName));
......@@ -215,13 +228,13 @@ void DifferentialPropertiesPlugin::computeCurvature(
PFP2::MAP* map = mh->getMap();
Algo::Surface::Geometry::computeAnglesBetweenNormalsOnEdges<PFP2>(*map, position, edgeAngle);
Algo::Surface::Geometry::computeCurvatureVertices_NormalCycles_Projected<PFP2>(*map, 0.02f * mh->getBBdiagSize(), position, normal, edgeAngle, kmax, kmin, Kmax, Kmin, Knormal);
Algo::Surface::Geometry::computeCurvatureVertices_NormalCycles_Projected<PFP2>(*map, 0.01f * mh->getBBdiagSize(), position, normal, edgeAngle, kmax, kmin, Kmax, Kmin, Knormal);
computeCurvatureLastParameters[mapName] =
ComputeCurvatureParameters(
positionAttributeName, normalAttributeName,
KmaxAttributeName, kmaxAttributeName, KminAttributeName, kminAttributeName, KnormalAttributeName,
autoUpdate);
compute_kmean, compute_kgaussian, autoUpdate);
mh->createVBO(Kmax);
mh->createVBO(kmax);
......@@ -234,6 +247,32 @@ void DifferentialPropertiesPlugin::computeCurvature(
mh->notifyAttributeModification(Kmin);
mh->notifyAttributeModification(kmin);
mh->notifyAttributeModification(Knormal);
if(compute_kmean)
{
VertexAttribute<PFP2::REAL> kmean = mh->getAttribute<PFP2::REAL, VERTEX>("kmean");
if(!kmean.isValid())
kmean = mh->addAttribute<PFP2::REAL, VERTEX>("kmean");
for(unsigned int i = kmin.begin(); i != kmin.end(); kmin.next(i))
kmean[i] = (kmin[i] + kmax[i]) / 2.0;
mh->createVBO(kmean);
mh->notifyAttributeModification(kmean);
}
if(compute_kgaussian)
{
VertexAttribute<PFP2::REAL> kgaussian = mh->getAttribute<PFP2::REAL, VERTEX>("kgaussian");
if(!kgaussian.isValid())
kgaussian = mh->addAttribute<PFP2::REAL, VERTEX>("kgaussian");
for(unsigned int i = kmin.begin(); i != kmin.end(); kmin.next(i))
kgaussian[i] = kmin[i] * kmax[i];
mh->createVBO(kgaussian);
mh->notifyAttributeModification(kgaussian);
}
}
#ifndef DEBUG
......
......@@ -56,8 +56,12 @@ MapHandlerGen* ImportSurfacePlugin::importFromFile(const QString& fileName)
void ImportSurfacePlugin::importFromFileDialog()
{
QString fileName = QFileDialog::getOpenFileName(m_window, "Import file", m_window->getAppPath(), "Mesh Files (*.ply *.off *.trian)");
importFromFile(fileName);
QStringList fileNames = QFileDialog::getOpenFileNames(m_window, "Import surfaces", m_window->getAppPath(), "Surface mesh Files (*.ply *.off *.trian)");
QStringList::Iterator it = fileNames.begin();
while(it != fileNames.end()) {
importFromFile(*it);
++it;
}
}
#ifndef DEBUG
......
......@@ -56,8 +56,12 @@ MapHandlerGen* ImportVolumePlugin::importFromFile(const QString& fileName)
void ImportVolumePlugin::importFromFileDialog()
{
QString fileName = QFileDialog::getOpenFileName(m_window, "Import file", m_window->getAppPath(), "Mesh Files (*.node *.ts *.off *.tet)");
importFromFile(fileName);
QStringList fileNames = QFileDialog::getOpenFileNames(m_window, "Import volumes", m_window->getAppPath(), "Volume mesh Files (*.node *.ts *.off *.tet)");
QStringList::Iterator it = fileNames.begin();
while(it != fileNames.end()) {
importFromFile(*it);
++it;
}
}
#ifndef DEBUG
......
......@@ -49,7 +49,7 @@ struct ParameterSet
ParameterSet() : selectedMap(NULL)
{}
QHash<QString, PerMapParameterSet> perMap;
QHash<QString, PerMapParameterSet*> perMap;
MapHandlerGen* selectedMap;
};
......@@ -97,14 +97,21 @@ public slots:
void mapLinked(MapHandlerGen* m);
void mapUnlinked(MapHandlerGen* m);
protected:
void addManagedMap(View *v, MapHandlerGen* m);
void removeManagedMap(View *v, MapHandlerGen* m);
public slots:
void vboAdded(Utils::VBO* vbo);
void vboRemoved(Utils::VBO* vbo);
void changeSelectedMap(View* view, MapHandlerGen* map, bool fromUI = false);
void changeSelectedMap(View* view, MapHandlerGen* map);
void changePositionVBO(View* view, MapHandlerGen* map, Utils::VBO* vbo, bool fromUI = false);
void changeNormalVBO(View* view, MapHandlerGen* map, Utils::VBO* vbo, bool fromUI = false);
void changeRenderVertices(View* view, MapHandlerGen* map, bool b, bool fromUI = false);
void changeVerticesScaleFactor(View* view, MapHandlerGen* map, int i, bool fromUI = false);
void changeVerticesScaleFactor(View* view, MapHandlerGen* map, float f, bool fromUI = false);
void changeRenderEdges(View* view, MapHandlerGen* map, bool b, bool fromUI = false);
void changeRenderFaces(View* view, MapHandlerGen* map, bool b, bool fromUI = false);
void changeFacesStyle(View* view, MapHandlerGen* map, FaceShadingStyle style, bool fromUI = false);
......
......@@ -2,6 +2,7 @@
#define _RENDER_DOCK_TAB_H_
#include "ui_render.h"
#include "Utils/vbo.h"
namespace CGoGN
{
......@@ -30,8 +31,7 @@ public slots:
void refreshUI(ParameterSet* params);
void selectedMapChanged();
void addVBOToList(QString name);
void removeVBOFromList(QString name);
void positionVBOChanged(int index);
void normalVBOChanged(int index);
void renderVerticesChanged(bool b);
......@@ -39,6 +39,8 @@ public slots:
void renderEdgesChanged(bool b);
void renderFacesChanged(bool b);
void faceStyleChanged(QAbstractButton* b);
void addVBOToList(Utils::VBO* vbo);
};
} // namespace SCHNApps
......
......@@ -92,40 +92,39 @@ void RenderPlugin::redraw(View* view)
const QList<MapHandlerGen*>& maps = view->getLinkedMaps();
foreach(MapHandlerGen* m, maps)
{
const PerMapParameterSet& p = params->perMap[m->getName()];
if(p.positionVBO != NULL)
PerMapParameterSet* p = params->perMap[m->getName()];
if(p->positionVBO != NULL)
{
if(p.renderVertices)
if(p->renderVertices)
{
m_pointSprite->setSize(m->getBBdiagSize() / 200.0f * p.verticesScaleFactor);
m_pointSprite->setAttributePosition(p.positionVBO);
m_pointSprite->predraw(CGoGN::Geom::Vec3f(0.0f, 0.0f, 1.0f));
m_pointSprite->setSize(m->getBBdiagSize() / 200.0f * p->verticesScaleFactor);
m_pointSprite->setAttributePosition(p->positionVBO);
m_pointSprite->setColor(CGoGN::Geom::Vec4f(0.0f, 0.0f, 1.0f, 1.0f));
m->draw(m_pointSprite, CGoGN::Algo::Render::GL2::POINTS);
m_pointSprite->postdraw();
}
if(p.renderEdges)
if(p->renderEdges)
{
glLineWidth(1.0f);
m_simpleColorShader->setAttributePosition(p.positionVBO);
m_simpleColorShader->setAttributePosition(p->positionVBO);
m->draw(m_simpleColorShader, CGoGN::Algo::Render::GL2::LINES);
}
if(p.renderFaces)
if(p->renderFaces)
{
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
glEnable(GL_LIGHTING);
glEnable(GL_POLYGON_OFFSET_FILL);
glPolygonOffset(1.0f, 1.0f);
switch(p.faceStyle)
switch(p->faceStyle)
{
case FLAT :
m_flatShader->setAttributePosition(p.positionVBO);
m_flatShader->setAttributePosition(p->positionVBO);
m->draw(m_flatShader, CGoGN::Algo::Render::GL2::TRIANGLES);
break ;
case PHONG :
if(p.normalVBO != NULL)
if(p->normalVBO != NULL)
{
m_phongShader->setAttributePosition(p.positionVBO