Commit 3e65eac4 authored by Pierre Kraemer's avatar Pierre Kraemer

fix crash when manipulating plugin dock tab without a current map selected

parent 1a38e382
*** 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)
......
......@@ -27,7 +27,7 @@
#include "Algo/Modelisation/extrusion.h"
#include "Geometry/intersection.h"
#include "NL/nl.h"
#include "Algo/LinearSolving/basic.h"
//#include "Algo/LinearSolving/basic.h"
#include "Algo/Geometry/laplacian.h"
namespace CGoGN
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment