Commit f80538a5 authored by Sylvain Thery's avatar Sylvain Thery

resolve bug of removeMap in schnapps

parent 2e3d2fa2
......@@ -15,6 +15,8 @@ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fPIC -std=c++11")
SET(CGoGN_ROOT_DIR ${CMAKE_SOURCE_DIR}/.. CACHE STRING "CGoGN root dir")
SET(CMAKE_MODULE_PATH ${CGoGN_ROOT_DIR}/cmake_modules/)
SET( SLOT_DEBUG_MODE OFF CACHE BOOL "build with slot debugging mode" )
find_package(OpenGL REQUIRED)
find_package(Boost COMPONENTS regex system REQUIRED)
......@@ -48,12 +50,15 @@ ELSE()
SET(CGoGN_LIBS topology algo container utils)
ENDIF()
IF (DEFINED ASSERTON)
IF(DEFINED ASSERTON)
add_definitions(-DCGOGN_ASSERT_BOOL=${ASSERTON})
ELSE (DEFINED ASSERTON)
ELSE(DEFINED ASSERTON)
add_definitions(-DCGOGN_ASSERT_BOOL=false)
ENDIF (DEFINED ASSERTON)
IF(SLOT_DEBUG_MODE)
add_definitions(-DSLOT_DEBUG_MODE=1)
ENDIF()
# define includes of external libs
SET (EXT_INCLUDES
......
#include "surface_render.h"
#include "mapHandler.h"
#include "slot_debug.h"
namespace CGoGN
{
......@@ -128,11 +129,13 @@ void Surface_Render_Plugin::drawMap(View* view, MapHandlerGen* map)
void Surface_Render_Plugin::selectedViewChanged(View *prev, View *cur)
{
DEBUG_SLOT();
m_dockTab->updateMapParameters();
}
void Surface_Render_Plugin::selectedMapChanged(MapHandlerGen *prev, MapHandlerGen *cur)
{
DEBUG_SLOT();
m_dockTab->updateMapParameters();
if (cur==NULL)
m_dockTab->setDisabled(true);
......@@ -142,12 +145,14 @@ void Surface_Render_Plugin::selectedMapChanged(MapHandlerGen *prev, MapHandlerGe
void Surface_Render_Plugin::mapAdded(MapHandlerGen *map)
{
DEBUG_SLOT();
connect(map, SIGNAL(vboAdded(Utils::VBO*)), this, SLOT(vboAdded(Utils::VBO*)));
connect(map, SIGNAL(vboRemoved(Utils::VBO*)), this, SLOT(vboRemoved(Utils::VBO*)));
}
void Surface_Render_Plugin::mapRemoved(MapHandlerGen *map)
{
DEBUG_SLOT();
disconnect(map, SIGNAL(vboAdded(Utils::VBO*)), this, SLOT(vboAdded(Utils::VBO*)));
disconnect(map, SIGNAL(vboRemoved(Utils::VBO*)), this, SLOT(vboRemoved(Utils::VBO*)));
}
......@@ -158,6 +163,7 @@ void Surface_Render_Plugin::mapRemoved(MapHandlerGen *map)
void Surface_Render_Plugin::vboAdded(Utils::VBO *vbo)
{
DEBUG_SLOT();
MapHandlerGen* map = static_cast<MapHandlerGen*>(QObject::sender());
if(map == m_schnapps->getSelectedMap())
......@@ -172,6 +178,7 @@ void Surface_Render_Plugin::vboAdded(Utils::VBO *vbo)
void Surface_Render_Plugin::vboRemoved(Utils::VBO *vbo)
{
DEBUG_SLOT();
MapHandlerGen* map = static_cast<MapHandlerGen*>(QObject::sender());
if(map == m_schnapps->getSelectedMap())
......@@ -213,6 +220,7 @@ void Surface_Render_Plugin::vboRemoved(Utils::VBO *vbo)
void Surface_Render_Plugin::changePositionVBO(const QString& view, const QString& map, const QString& vbo)
{
DEBUG_SLOT();
View* v = m_schnapps->getView(view);
MapHandlerGen* m = m_schnapps->getMap(map);
if(v && m)
......@@ -229,6 +237,7 @@ void Surface_Render_Plugin::changePositionVBO(const QString& view, const QString
void Surface_Render_Plugin::changeNormalVBO(const QString& view, const QString& map, const QString& vbo)
{
DEBUG_SLOT();
View* v = m_schnapps->getView(view);
MapHandlerGen* m = m_schnapps->getMap(map);
if(v && m)
......@@ -245,6 +254,7 @@ void Surface_Render_Plugin::changeNormalVBO(const QString& view, const QString&
void Surface_Render_Plugin::changeRenderVertices(const QString& view, const QString& map, bool b)
{
DEBUG_SLOT();
View* v = m_schnapps->getView(view);
MapHandlerGen* m = m_schnapps->getMap(map);
if(v && m)
......@@ -260,6 +270,7 @@ void Surface_Render_Plugin::changeRenderVertices(const QString& view, const QStr
void Surface_Render_Plugin::changeVerticesScaleFactor(const QString& view, const QString& map, float f)
{
DEBUG_SLOT();
View* v = m_schnapps->getView(view);
MapHandlerGen* m = m_schnapps->getMap(map);
if(v && m)
......@@ -275,6 +286,7 @@ void Surface_Render_Plugin::changeVerticesScaleFactor(const QString& view, const
void Surface_Render_Plugin::changeRenderEdges(const QString& view, const QString& map, bool b)
{
DEBUG_SLOT();
View* v = m_schnapps->getView(view);
MapHandlerGen* m = m_schnapps->getMap(map);
if(v && m)
......@@ -290,6 +302,7 @@ void Surface_Render_Plugin::changeRenderEdges(const QString& view, const QString
void Surface_Render_Plugin::changeRenderFaces(const QString& view, const QString& map, bool b)
{
DEBUG_SLOT();
View* v = m_schnapps->getView(view);
MapHandlerGen* m = m_schnapps->getMap(map);
if(v && m)
......@@ -305,6 +318,7 @@ void Surface_Render_Plugin::changeRenderFaces(const QString& view, const QString
void Surface_Render_Plugin::changeFacesStyle(const QString& view, const QString& map, MapParameters::FaceShadingStyle style)
{
DEBUG_SLOT();
View* v = m_schnapps->getView(view);
MapHandlerGen* m = m_schnapps->getMap(map);
if(v && m)
......@@ -320,6 +334,7 @@ void Surface_Render_Plugin::changeFacesStyle(const QString& view, const QString&
void Surface_Render_Plugin::changeRenderBoundary(const QString& view, const QString& map, bool b)
{
DEBUG_SLOT();
View* v = m_schnapps->getView(view);
MapHandlerGen* m = m_schnapps->getMap(map);
if(v && m)
......@@ -335,6 +350,7 @@ void Surface_Render_Plugin::changeRenderBoundary(const QString& view, const QStr
void Surface_Render_Plugin::changeFaceColor(const QString& view, const QString& map, float r, float g, float b)
{
DEBUG_SLOT();
View* v = m_schnapps->getView(view);
MapHandlerGen* m = m_schnapps->getMap(map);
if(v && m)
......@@ -350,6 +366,7 @@ void Surface_Render_Plugin::changeFaceColor(const QString& view, const QString&
void Surface_Render_Plugin::changeEdgeColor(const QString& view, const QString& map, float r, float g, float b)
{
DEBUG_SLOT();
View* v = m_schnapps->getView(view);
MapHandlerGen* m = m_schnapps->getMap(map);
if(v && m)
......@@ -365,6 +382,7 @@ void Surface_Render_Plugin::changeEdgeColor(const QString& view, const QString&
void Surface_Render_Plugin::changeVertexColor(const QString& view, const QString& map, float r, float g, float b)
{
DEBUG_SLOT();
View* v = m_schnapps->getView(view);
MapHandlerGen* m = m_schnapps->getMap(map);
if(v && m)
......
......@@ -47,7 +47,6 @@ void Surface_RenderTopo_Plugin::disable()
void Surface_RenderTopo_Plugin::drawMap(View* view, MapHandlerGen* map)
{
// std::cout << "Surface_RenderTopo_Plugin::drawMap"<< std::endl;
ViewMapParam& p = h_viewParameterSet[view][map];
map->getTopoRender()->setInitialDartsColor(p.dartsColor.redF(),p.dartsColor.greenF(),p.dartsColor.blueF());
......@@ -58,7 +57,6 @@ void Surface_RenderTopo_Plugin::drawMap(View* view, MapHandlerGen* map)
if (pm.needUpdate)
{
// std::cout << "NEED UPDATE"<< std::endl;
map->getTopoRender()->setExplodeEdge(pm.edgesScaleFactor);
map->getTopoRender()->setExplodeFace(pm.facesScaleFactor);
QString pos = m_dockTab->combo_positionAttribute->currentText();
......@@ -112,7 +110,6 @@ void Surface_RenderTopo_Plugin::mapRemoved(MapHandlerGen* map)
void Surface_RenderTopo_Plugin::attributeAdded(unsigned int orbit, const QString& name)
{
// std::cout << "attributeAdded"<< std::endl;
MapHandlerGen* map = static_cast<MapHandlerGen*>(QObject::sender());
if(orbit == VERTEX && map == m_schnapps->getSelectedMap())
{
......
......@@ -9,6 +9,8 @@
#include "Topology/generic/genericmap.h"
#include "Topology/generic/cellmarker.h"
#include "slot_debug.h"
namespace CGoGN
{
......@@ -38,6 +40,7 @@ public:
{
if(m_selectionChanged)
{
DEBUG_EMIT("selectedCellsChanged");
emit(selectedCellsChanged());
m_selectionChanged = false;
}
......@@ -92,7 +95,10 @@ public:
cs->unselect(c, emitSignal);
}
if(emitSignal)
{
DEBUG_EMIT("selectedCellsChanged");
emit(selectedCellsChanged());
}
else
m_selectionChanged = true;
}
......@@ -128,7 +134,10 @@ public:
m_cells[i-1] = m_cells.back();
m_cells.pop_back();
if(emitSignal)
{
DEBUG_EMIT("selectedCellsChanged");
emit(selectedCellsChanged());
}
else
m_selectionChanged = true;
}
......
......@@ -58,6 +58,7 @@ AttributeHandler<T, ORBIT, typename PFP::MAP> MapHandler<PFP>::addAttribute(cons
if(ah.isValid() && registerAttr)
{
registerAttribute(ah);
DEBUG_EMIT("attributeAdded");
emit(attributeAdded(ORBIT, nameAttr));
}
return ah;
......@@ -166,6 +167,7 @@ CellSelectorGen* MapHandler<PFP>::addCellSelector(unsigned int orbit, const QStr
return NULL;
m_cellSelectors[orbit].insert(name, cs);
DEBUG_EMIT("cellSelectorAdded");
emit(cellSelectorAdded(orbit, name));
connect(cs, SIGNAL(selectedCellsChanged()), this, SLOT(selectedCellsChanged()));
......
......@@ -6,6 +6,7 @@
#include "types.h"
#include "PythonQt/PythonQt.h"
#include "PythonQt/gui/PythonQtScriptingConsole.h"
#include "slot_debug.h"
class QVBoxLayout;
class QSplitter;
......@@ -95,11 +96,11 @@ public slots:
MapHandlerGen* getMap(const QString& name) const;
const MapSet& getMapSet() const { return m_maps; }
void notifySelectedMapChanged(MapHandlerGen* old, MapHandlerGen* cur) { emit(selectedMapChanged(old, cur)); }
void notifySelectedMapChanged(MapHandlerGen* old, MapHandlerGen* cur) { DEBUG_EMIT("selectedMapChanged"); emit(selectedMapChanged(old, cur)); }
MapHandlerGen* getSelectedMap() const;
unsigned int getCurrentOrbit() const;
void notifySelectedCellSelectorChanged(CellSelectorGen* cs) { emit(selectedCellSelectorChanged(cs)); }
void notifySelectedCellSelectorChanged(CellSelectorGen* cs) { DEBUG_EMIT("selectedCellSelectorChanged"); emit(selectedCellSelectorChanged(cs)); }
CellSelectorGen* getSelectedSelector(unsigned int orbit) const;
const StaticPointers& getStaticPointers() const {return m_sp;}
......
#ifndef _SLOT_DBG_H_
#define _SLOT_DBG_H_
#include <iostream>
namespace CGoGN
{
namespace SCHNApps
{
// TO USE DEBUGGING INFO ON SLOT
// USE cmake .. -DSLOT_DEBUG_MODE=1
class PrettyPrintShiftMessage
{
protected:
static unsigned int s_nb;
std::string m_msg;
public:
PrettyPrintShiftMessage(const char *fname);
~PrettyPrintShiftMessage();
static void shift();
};
} // namespace SCHNApps
} // namespace CGoGN
//#define SLOT_DBG_MODE 1
#ifdef SLOT_DEBUG_MODE
#define DEBUG_SLOT() PrettyPrintShiftMessage ppslots(__PRETTY_FUNCTION__);
#define DEBUG_EMIT(SIGNALS) PrettyPrintShiftMessage::shift(); std::cout << "Emitting signal " << SIGNALS << " from " << __PRETTY_FUNCTION__ << std::endl;
#else
#define DEBUG_SLOT()
#define DEBUG_EMIT(SIGNALS)
#endif
#endif
......@@ -34,7 +34,7 @@ public:
const QString& getName() const { return m_name; }
MapHandlerGen* lastSelectedMap() { return m_lastSelectedMap;}
void setLastSelectedMap(MapHandlerGen* m);
void setLastSelectedMap(MapHandlerGen* m) { m_lastSelectedMap=m; }
public slots:
QString getName() { return m_name; }
......
......@@ -24,6 +24,7 @@ Camera::~Camera()
void Camera::setProjectionType(int t)
{
setType(qglviewer::Camera::Type(t));
DEBUG_EMIT("projectionTypeChanged");
emit(projectionTypeChanged(t));
foreach(View* view, m_schnapps->getViewSet().values())
view->updateGL();
......@@ -32,6 +33,7 @@ void Camera::setProjectionType(int t)
void Camera::setDraw(bool b)
{
m_draw = b;
DEBUG_EMIT("drawChanged");
emit(drawChanged(b));
foreach(View* view, m_schnapps->getViewSet().values())
view->updateGL();
......@@ -40,6 +42,7 @@ void Camera::setDraw(bool b)
void Camera::setDrawPath(bool b)
{
m_drawPath = b;
DEBUG_EMIT("drawPathChanged");
emit(drawPathChanged(b));
foreach(View* view, m_schnapps->getViewSet().values())
view->updateGL();
......
......@@ -292,6 +292,35 @@ void ControlDock_MapTab::selectedViewChanged(View* prev, View* cur)
connect(cur, SIGNAL(mapLinked(MapHandlerGen*)), this, SLOT(selectedViewMapLinked(MapHandlerGen*)));
connect(cur, SIGNAL(mapUnlinked(MapHandlerGen*)), this, SLOT(selectedViewMapUnlinked(MapHandlerGen*)));
}
if( (cur->lastSelectedMap() != NULL) && (cur->isLinkedToMap(cur->lastSelectedMap())))
{
setSelectedMap(cur->lastSelectedMap()->getName());
}
else
{
MapHandlerGen* map = m_schnapps->getSelectedMap();
if ((map == NULL) || (! map->isLinkedToView(cur)))
{
bool changed = false;
const MapSet& ms = m_schnapps->getMapSet();
foreach(MapHandlerGen* mhg, ms)
{
if (mhg->isLinkedToView(cur))
{
setSelectedMap(mhg->getName());
changed = true;
break; // out of the loop, not nice but ...
}
}
if (!changed)// no possibility to selected a map automatically so none
{
setSelectedMap(QString("NONE"));
}
}
}
}
......@@ -470,19 +499,21 @@ void ControlDock_MapTab::updateSelectedMapInfo()
void ControlDock_MapTab::setSelectedMap(const QString& mapName)
{
QList<QListWidgetItem *> lm = list_maps->findItems(mapName,Qt::MatchExactly);
if (!lm.empty())
{
lm[0]->setSelected(true);
}
else
if (mapName == QString("NONE"))
{
QList<QListWidgetItem*> items = list_maps->selectedItems();
if(!items.empty())
{
m_selectedMap = NULL;
items[0]->setSelected(false);
m_selectedMap = NULL;
}
return;
}
QList<QListWidgetItem *> lm = list_maps->findItems(mapName,Qt::MatchExactly);
if (!lm.empty())
{
lm[0]->setSelected(true);
}
}
......
......@@ -7,13 +7,13 @@ namespace SCHNApps
{
MapHandlerGen::MapHandlerGen(const QString& name, SCHNApps* s, GenericMap* map) :
m_topoRender(NULL),
m_name(name),
m_schnapps(s),
m_map(map),
m_frame(NULL),
m_bbDrawer(NULL),
m_render(NULL),
m_topoRender(NULL)
m_render(NULL)
{
m_frame = new qglviewer::ManipulatedFrame();
......@@ -43,6 +43,7 @@ void MapHandlerGen::notifyAttributeModification(const AttributeHandlerGen& attr)
if(m_vbo.contains(nameAttr))
m_vbo[nameAttr]->updateData(attr);
DEBUG_EMIT("attributeModified");
emit(attributeModified(attr.getOrbit(), nameAttr));
foreach(View* view, l_views)
......@@ -65,6 +66,7 @@ void MapHandlerGen::notifyConnectivityModification()
cs->rebuild();
}
DEBUG_EMIT("connectivityModified");
emit(connectivityModified());
foreach(View* view, l_views)
......@@ -109,17 +111,20 @@ void MapHandlerGen::clear(bool removeAttrib)
{
if (orbit == VERTEX)
deleteVBO(name);
DEBUG_EMIT("attributeRemoved");
emit(attributeRemoved(orbit, name));
}
else
{
if (orbit == VERTEX)
updateVBO(name);
DEBUG_EMIT("attributeModified");
emit(attributeModified(orbit, name));
}
}
}
DEBUG_EMIT("connectivityModified");
emit(connectivityModified());
}
......@@ -138,6 +143,7 @@ Utils::VBO* MapHandlerGen::createVBO(const AttributeMultiVectorGen* attr)
vbo = new Utils::VBO(attr->getName());
vbo->updateData(attr);
m_vbo.insert(name, vbo);
DEBUG_EMIT("vboAdded");
emit(vboAdded(vbo));
}
else
......@@ -192,6 +198,7 @@ void MapHandlerGen::deleteVBO(const QString& name)
{
Utils::VBO* vbo = m_vbo[name];
m_vbo.remove(name);
DEBUG_EMIT("vboRemoved");
emit(vboRemoved(vbo));
delete vbo;
}
......@@ -207,6 +214,7 @@ void MapHandlerGen::removeCellSelector(unsigned int orbit, const QString& name)
if (cs)
{
m_cellSelectors[orbit].remove(name);
DEBUG_EMIT("cellSelectorRemoved");
emit(cellSelectorRemoved(orbit, name));
disconnect(cs, SIGNAL(selectedCellsChanged()), this, SIGNAL(selectedCellsChanged()));
......@@ -226,6 +234,7 @@ CellSelectorGen* MapHandlerGen::getCellSelector(unsigned int orbit, const QStrin
void MapHandlerGen::selectedCellsChanged()
{
CellSelectorGen* cs = static_cast<CellSelectorGen*>(QObject::sender());
DEBUG_EMIT("selectedCellsChanged");
emit(selectedCellsChanged(cs));
}
......
......@@ -145,6 +145,7 @@ Camera* SCHNApps::addCamera(const QString& name)
Camera* camera = new Camera(name, this);
m_cameras.insert(name, camera);
DEBUG_EMIT("cameraAdded");
emit(cameraAdded(camera));
return camera;
}
......@@ -160,6 +161,7 @@ void SCHNApps::removeCamera(const QString& name)
if (camera && !camera->isUsed())
{
m_cameras.remove(name);
DEBUG_EMIT("cameraRemoved");
emit(cameraRemoved(camera));
delete camera;
}
......@@ -189,6 +191,7 @@ View* SCHNApps::addView(const QString& name)
view = new View(name, this, m_firstView);
m_views.insert(name, view);
DEBUG_EMIT("viewAdded");
emit(viewAdded(view));
return view;
......@@ -225,6 +228,7 @@ void SCHNApps::removeView(const QString& name)
m_views.remove(name);
DEBUG_EMIT("viewRemoved");
emit(viewRemoved(view));
delete view;
......@@ -263,7 +267,7 @@ void SCHNApps::setSelectedView(View* view)
m_pluginDockTabWidget->setCurrentIndex(currentTab);
DEBUG_EMIT("selectedViewChanged");
emit(selectedViewChanged(oldSelected, m_selectedView));
if(oldSelected)
......@@ -271,35 +275,32 @@ void SCHNApps::setSelectedView(View* view)
m_selectedView->updateGL();
// check if selected map is correct
if( (view->lastSelectedMap() != NULL) && (view->lastSelectedMap()->isLinkedToView(view)))
{
this->setSelectedMap(view->lastSelectedMap()->getName());
}
else
{
MapHandlerGen* map = this->getSelectedMap();
if ((map == NULL) || (! map->isLinkedToView(view)))
{
bool changed = false;
const MapSet& ms = this->getMapSet();
foreach(MapHandlerGen* mhg,ms)
{
if (mhg->isLinkedToView(view))
{
this->setSelectedMap(mhg->getName());
changed = true;
break; // out of the loop, not nice but ...
}
}
if (!changed)// no possibility to selected a map automatically so none
{
setSelectedMap(QString("NONE"));
}
}
}
// if( (view->lastSelectedMap() != NULL) && (view->lastSelectedMap()->isLinkedToView(view)))
// {
// this->setSelectedMap(view->lastSelectedMap()->getName());
// }
// else
// {
// MapHandlerGen* map = this->getSelectedMap();
// if ((map == NULL) || (! map->isLinkedToView(view)))
// {
// bool changed = false;
// const MapSet& ms = this->getMapSet();
// foreach(MapHandlerGen* mhg, ms)
// {
// if (mhg->isLinkedToView(view))
// {
// this->setSelectedMap(mhg->getName());
// changed = true;
// break; // out of the loop, not nice but ...
// }
// }
// if (!changed)// no possibility to selected a map automatically so none
// {
// setSelectedMap(QString("NONE"));
// }
// }
// }
}
......@@ -352,6 +353,7 @@ void SCHNApps::registerPluginsDirectory(const QString& path)
if(!m_availablePlugins.contains(pluginName))
{
m_availablePlugins.insert(pluginName, pluginFilePath);
DEBUG_EMIT("pluginAvailableAdded");
emit(pluginAvailableAdded(pluginName));
}
}
......@@ -386,6 +388,7 @@ Plugin* SCHNApps::enablePlugin(const QString& pluginName)
m_plugins.insert(pluginName, plugin);
statusbar->showMessage(pluginName + QString(" successfully loaded."), 2000);
DEBUG_EMIT("pluginEnabled");
emit(pluginEnabled(plugin));
// method success
......@@ -439,6 +442,7 @@ void SCHNApps::disablePlugin(const QString& pluginName)
loader.unload();
statusbar->showMessage(pluginName + QString(" successfully unloaded."), 2000);
DEBUG_EMIT("pluginDisabled");
emit(pluginDisabled(plugin));
delete plugin;
......@@ -532,6 +536,7 @@ MapHandlerGen* SCHNApps::addMap(const QString& name, unsigned int dim)
m_maps.insert(name, mh);
DEBUG_EMIT("mapAdded");
emit(mapAdded(mh));
return mh;
......@@ -542,14 +547,24 @@ void SCHNApps::removeMap(const QString& name)
if (m_maps.contains(name))
{
MapHandlerGen* map = m_maps[name];
std::cout << "REMOVE MAP:"<< std::hex<< long(map) << std::dec<< std::endl;
foreach(View* view, map->getLinkedViews())
{
view->unlinkMap(map);
if (view->lastSelectedMap() == map)
view->setLastSelectedMap(NULL);
}
m_maps.remove(name);
DEBUG_EMIT("mapRemoved");
emit(mapRemoved(map));
// unselect map if it is removed
if (this->getSelectedMap() == map)
setSelectedMap(QString("NONE"));
delete map;
}
}
......
#include "slot_debug.h"
namespace CGoGN
{
namespace SCHNApps
{
unsigned int PrettyPrintShiftMessage::s_nb = 0;
PrettyPrintShiftMessage::PrettyPrintShiftMessage(const char *fname):
m_msg(fname)
{
for (unsigned int i = 0; i < s_nb; ++i)
{
std::cout << " ";
}
std::cout << "Entering slot "<< m_msg << std::endl;
s_nb++;
}
PrettyPrintShiftMessage::~PrettyPrintShiftMessage()
{
for (unsigned int i = 0; i < s_nb; ++i)
{
std::cout << " ";
}
std::cout << "Exiting slot "<< m_msg << std::endl;
s_nb--;
}
void PrettyPrintShiftMessage::shift()
{
for (unsigned int i = 0; i < s_nb; ++i)
{
std::cout << " ";
}
}
} // namespace SCHNApps
} // namespace CGoGN
......@@ -8,6 +8,8 @@
#include "Utils/GLSLShader.h"
#include "Algo/Geometry/boundingbox.h"
#include "slot_debug.h"
#include <QKeyEvent>
#include <QMouseEvent>
#include <QWheelEvent>
......@@ -56,6 +58,7 @@ View::~View()
void View::setCurrentCamera(Camera* c)
{
DEBUG_SLOT();
if(c != m_currentCamera && c != NULL)
{
Camera* prev = m_currentCamera;
......@@ -66,6 +69,7 @@ void View::setCurrentCamera(Camera* c)
this->setCamera(m_currentCamera);
m_currentCamera->linkView(this);
DEBUG_EMIT("currentCameraChanged");
emit(currentCameraChanged(prev, c));
updateCurrentCameraBB();
......@@ -74,7 +78,7 @@ void View::setCurrentCamera(Camera* c)
}
void View::setCurrentCamera(const QString& name)
{
{
Camera* c = m_schnapps->getCamera(name);
if(c)
setCurrentCamera(c);
......@@ -87,10 +91,12 @@ bool View::usesCamera(const QString& cameraName) const
void View::linkPlugin(PluginInteraction* plugin)
{
DEBUG_SLOT();
if(plugin && !l_plugins.contains(plugin))
{
l_plugins.push_back(plugin);
plugin->linkView(this);
DEBUG_EMIT("pluginLinked");
emit(pluginLinked(plugin));
updateGL();
}
......@@ -105,9 +111,11 @@ void View::linkPlugin(const QString& name)
void View::unlinkPlugin(PluginInteraction* plugin)
{
DEBUG_SLOT();
if(l_plugins.removeOne(plugin))
{
plugin->unlinkView(this);
DEBUG_EMIT("pluginUnlinked");