Commit e1f184ce authored by Kenneth Vanhoey's avatar Kenneth Vanhoey

Merge branch 'master' of cgogn:~cgogn/CGoGN

parents 58207224 de44d2ff
......@@ -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,7 +73,7 @@ SET (CGoGN_EXT_INCLUDES
${ZLIB_INCLUDE_DIRS}
${LIBXML2_INCLUDE_DIR}
${Boost_INCLUDE_DIRS}
# ${SUITESPARSE_INCLUDE_DIRS}
)
# define libs for external libs
......@@ -86,7 +86,7 @@ SET (CGoGN_EXT_LIBS
${Boost_SYSTEM_LIBRARY}
${Boost_REGEX_LIBRARY}
${Boost_THREAD_LIBRARY}
${SUITESPARSE_LIBRARIES}
# ${SUITESPARSE_LIBRARIES}
)
#optionnal libs
......
......@@ -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) ;
m_phongShader->setAttributeNormal(p.normalVBO) ;
m_phongShader->setAttributePosition(p->positionVBO) ;
m_phongShader->setAttributeNormal(p->normalVBO) ;
m->draw(m_phongShader, CGoGN::Algo::Render::GL2::TRIANGLES);
}
break ;
......@@ -142,14 +141,10 @@ void RenderPlugin::viewLinked(View* view, Plugin* plugin)
{
ParameterSet* params = new ParameterSet();
h_viewParams.insert(view, params);
const QList<MapHandlerGen*>& maps = view->getLinkedMaps();
foreach(MapHandlerGen* map, maps)
{
PerMapParameterSet p(map);
params->perMap.insert(map->getName(), p);
}
if (!maps.empty())
changeSelectedMap(view, maps[0]);
foreach(MapHandlerGen* mh, maps)
addManagedMap(view, mh);
connect(view, SIGNAL(mapLinked(MapHandlerGen*)), this, SLOT(mapLinked(MapHandlerGen*)));
connect(view, SIGNAL(mapUnlinked(MapHandlerGen*)), this, SLOT(mapUnlinked(MapHandlerGen*)));
......@@ -163,6 +158,12 @@ void RenderPlugin::viewUnlinked(View* view, Plugin* plugin)
{
if(plugin == this)
{
const QList<MapHandlerGen*>& maps = view->getLinkedMaps();
foreach(MapHandlerGen* mh, maps)
removeManagedMap(view, mh);
ParameterSet* params = h_viewParams[view];
delete params;
h_viewParams.remove(view);
disconnect(view, SIGNAL(mapLinked(MapHandlerGen*)), this, SLOT(mapLinked(MapHandlerGen*)));
......@@ -173,68 +174,62 @@ void RenderPlugin::viewUnlinked(View* view, Plugin* plugin)
void RenderPlugin::currentViewChanged(View* view)
{
if(isLinkedToView(view))
{
ParameterSet* params = h_viewParams[view];
changeSelectedMap(view, params->selectedMap);
m_dockTab->refreshUI(h_viewParams[view]);
}
}
void RenderPlugin::mapLinked(MapHandlerGen* m)
{
View* view = static_cast<View*>(QObject::sender());
assert(isLinkedToView(view));
addManagedMap(view, m);
}
void RenderPlugin::mapUnlinked(MapHandlerGen* m)
{
View* view = static_cast<View*>(QObject::sender());
assert(isLinkedToView(view));
removeManagedMap(view, m);
}
void RenderPlugin::addManagedMap(View* v, MapHandlerGen *m)
{
// connect(m, SIGNAL(attributeModified(unsigned int, QString)), this, SLOT(attributeModified(unsigned int, QString)));
// connect(m, SIGNAL(connectivityModified()), this, SLOT(connectivityModified()));
ParameterSet* params = h_viewParams[v];
PerMapParameterSet* perMap = new PerMapParameterSet(m);
params->perMap.insert(m->getName(), perMap);
ParameterSet* params = h_viewParams[view];
PerMapParameterSet p(m);
params->perMap.insert(m->getName(), p);
if(params->selectedMap == NULL || params->perMap.count() == 1)
changeSelectedMap(view, m);
changeSelectedMap(v, m);
else
m_dockTab->refreshUI(params);
}
void RenderPlugin::mapUnlinked(MapHandlerGen* m)
void RenderPlugin::removeManagedMap(View *v, MapHandlerGen *m)
{
View* view = static_cast<View*>(QObject::sender());
assert(isLinkedToView(view));
// disconnect(m, SIGNAL(attributeModified(unsigned int, QString)), this, SLOT(attributeModified(unsigned int, QString)));
// disconnect(m, SIGNAL(connectivityModified()), this, SLOT(connectivityModified()));
ParameterSet* params = h_viewParams[view];
ParameterSet* params = h_viewParams[v];
PerMapParameterSet* perMap = params->perMap[m->getName()];
delete perMap;
params->perMap.remove(m->getName());
if(params->selectedMap == m)
{
if(!params->perMap.empty())
changeSelectedMap(view, m_window->getMap(params->perMap.begin().key()));
changeSelectedMap(v, m_window->getMap(params->perMap.begin().key()));
else
changeSelectedMap(view, NULL);
changeSelectedMap(v, NULL);
}
else
m_dockTab->refreshUI(params);
}
void RenderPlugin::vboAdded(Utils::VBO* vbo)
{
assert(h_viewParams[m_window->getCurrentView()]->selectedMap == static_cast<MapHandlerGen*>(QObject::sender()));
if(vbo->dataSize() == 3)
m_dockTab->addVBOToList(QString::fromStdString(vbo->name()));
}
void RenderPlugin::vboRemoved(Utils::VBO* vbo)
{
MapHandlerGen* map = static_cast<MapHandlerGen*>(QObject::sender());
View* view = m_window->getCurrentView();
ParameterSet* params = h_viewParams[view];
if(params->perMap[map->getName()].positionVBO == vbo)
changePositionVBO(view, map, NULL);
if(params->perMap[map->getName()].normalVBO == vbo)
changeNormalVBO(view, map, NULL);
m_dockTab->refreshUI(h_viewParams[view]);
}
void RenderPlugin::changeSelectedMap(View* view, MapHandlerGen* map, bool fromUI)
void RenderPlugin::changeSelectedMap(View* view, MapHandlerGen* map)
{
ParameterSet* params = h_viewParams[view];
......@@ -244,20 +239,18 @@ void RenderPlugin::changeSelectedMap(View* view, MapHandlerGen* map, bool fromUI
if(view->isCurrentView())
{
if(prev)
disconnect(prev, SIGNAL(vboAdded(Utils::VBO*)), this, SLOT(vboAdded(Utils::VBO*)));
disconnect(prev, SIGNAL(vboAdded(Utils::VBO*)), m_dockTab, SLOT(addVBOToList(Utils::VBO*)));
if(map)
connect(map, SIGNAL(vboAdded(Utils::VBO*)), this, SLOT(vboAdded(Utils::VBO*)));
connect(map, SIGNAL(vboAdded(Utils::VBO*)), m_dockTab, SLOT(addVBOToList(Utils::VBO*)));
if(!fromUI)
m_dockTab->refreshUI(params);
view->updateGL();
m_dockTab->refreshUI(params);
}
}
void RenderPlugin::changePositionVBO(View* view, MapHandlerGen* map, Utils::VBO* vbo, bool fromUI)
{
ParameterSet* params = h_viewParams[view];
params->perMap[map->getName()].positionVBO = vbo;
params->perMap[map->getName()]->positionVBO = vbo;
if(view->isCurrentView())
{
......@@ -270,7 +263,7 @@ void RenderPlugin::changePositionVBO(View* view, MapHandlerGen* map, Utils::VBO*
void RenderPlugin::changeNormalVBO(View* view, MapHandlerGen* map, Utils::VBO* vbo, bool fromUI)
{
ParameterSet* params = h_viewParams[view];
params->perMap[map->getName()].normalVBO = vbo;