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,6 +97,7 @@ void RenderDockTab::positionVBOChanged(int index)
{
View* view = m_window->getCurrentView();
MapHandlerGen* map = m_currentParams->selectedMap;
if(map)
m_plugin->changePositionVBO(view, map, map->getVBO(combo_positionVBO->currentText()), true);
}
}
......@@ -107,6 +108,7 @@ void RenderDockTab::normalVBOChanged(int index)
{
View* view = m_window->getCurrentView();
MapHandlerGen* map = m_currentParams->selectedMap;
if(map)
m_plugin->changeNormalVBO(view, map, map->getVBO(combo_normalVBO->currentText()), true);
}
}
......@@ -117,6 +119,7 @@ void RenderDockTab::renderVerticesChanged(bool b)
{
View* view = m_window->getCurrentView();
MapHandlerGen* map = m_currentParams->selectedMap;
if(map)
m_plugin->changeRenderVertices(view, map, b, true);
}
}
......@@ -127,6 +130,7 @@ void RenderDockTab::verticesScaleFactorChanged(int i)
{
View* view = m_window->getCurrentView();
MapHandlerGen* map = m_currentParams->selectedMap;
if(map)
m_plugin->changeVerticesScaleFactor(view, map, i / 50.0, true);
}
}
......@@ -137,6 +141,7 @@ void RenderDockTab::renderEdgesChanged(bool b)
{
View* view = m_window->getCurrentView();
MapHandlerGen* map = m_currentParams->selectedMap;
if(map)
m_plugin->changeRenderEdges(view, map, b, true);
}
}
......@@ -147,6 +152,7 @@ void RenderDockTab::renderFacesChanged(bool b)
{
View* view = m_window->getCurrentView();
MapHandlerGen* map = m_currentParams->selectedMap;
if(map)
m_plugin->changeRenderFaces(view, map, b, true);
}
}
......@@ -157,11 +163,14 @@ void RenderDockTab::faceStyleChanged(QAbstractButton* b)
{
View* view = m_window->getCurrentView();
MapHandlerGen* map = m_currentParams->selectedMap;
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);
}
}
}
void RenderDockTab::addVBOToList(Utils::VBO* vbo)
......
......@@ -99,6 +99,7 @@ void RenderExplodDockTab::positionAttributeChanged(int index)
{
View* view = m_window->getCurrentView();
MapHandlerGen* map = m_currentParams->selectedMap;
if(map)
m_plugin->changePositionAttribute(view, map, map->getAttribute<PFP2::VEC3, VERTEX>(combo_positionAttribute->currentText()), true);
}
}
......@@ -109,6 +110,7 @@ void RenderExplodDockTab::colorAttributeChanged(int index)
{
View* view = m_window->getCurrentView();
MapHandlerGen* map = m_currentParams->selectedMap;
if(map)
m_plugin->changeColorAttribute(view, map, map->getAttribute<PFP2::VEC3, VERTEX>(combo_colorAttribute->currentText()), true);
}
}
......@@ -119,6 +121,7 @@ void RenderExplodDockTab::renderEdgesChanged(bool b)
{
View* view = m_window->getCurrentView();
MapHandlerGen* map = m_currentParams->selectedMap;
if(map)
m_plugin->changeRenderEdges(view, map, b, true);
}
}
......@@ -129,6 +132,7 @@ void RenderExplodDockTab::renderFacesChanged(bool b)
{
View* view = m_window->getCurrentView();
MapHandlerGen* map = m_currentParams->selectedMap;
if(map)
m_plugin->changeRenderFaces(view, map, b, true);
}
}
......@@ -139,6 +143,7 @@ void RenderExplodDockTab::facesScaleFactorChanged(int i)
{
View* view = m_window->getCurrentView();
MapHandlerGen* map = m_currentParams->selectedMap;
if(map)
m_plugin->changeFacesScaleFactor(view, map, i, true);
}
}
......@@ -149,6 +154,7 @@ void RenderExplodDockTab::volumesScaleFactorChanged(int i)
{
View* view = m_window->getCurrentView();
MapHandlerGen* map = m_currentParams->selectedMap;
if(map)
m_plugin->changeVolumesScaleFactor(view, map, i, true);
}
}
......
......@@ -94,6 +94,7 @@ void RenderScalarDockTab::positionVBOChanged(int index)
{
View* view = m_window->getCurrentView();
MapHandlerGen* map = m_currentParams->selectedMap;
if(map)
m_plugin->changePositionVBO(view, map, map->getVBO(combo_positionVBO->currentText()), true);
}
}
......@@ -104,6 +105,8 @@ void RenderScalarDockTab::selectedScalarVBOChanged()
{
View* view = m_window->getCurrentView();
MapHandlerGen* map = m_currentParams->selectedMap;
if(map)
{
QList<QListWidgetItem*> selectedItems = list_scalarVBO->selectedItems();
if(!selectedItems.empty())
{
......@@ -117,6 +120,7 @@ void RenderScalarDockTab::selectedScalarVBOChanged()
else
m_plugin->changeScalarVBO(view, map, NULL, true);
}
}
}
void RenderScalarDockTab::colorMapChanged(int index)
......@@ -125,6 +129,7 @@ void RenderScalarDockTab::colorMapChanged(int index)
{
View* view = m_window->getCurrentView();
MapHandlerGen* map = m_currentParams->selectedMap;
if(map)
m_plugin->changeColorMap(view, map, index, true);
}
}
......@@ -135,6 +140,7 @@ void RenderScalarDockTab::expansionChanged(int i)
{
View* view = m_window->getCurrentView();
MapHandlerGen* map = m_currentParams->selectedMap;
if(map)
m_plugin->changeExpansion(view, map, i, true);
}
}
......
......@@ -98,6 +98,7 @@ void RenderTopoSurfaceDockTab::positionAttributeChanged(int index)
{
View* view = m_window->getCurrentView();
MapHandlerGen* map = m_currentParams->selectedMap;
if(map)
m_plugin->changePositionAttribute(view, map, map->getAttribute<PFP2::VEC3, VERTEX>(combo_positionAttribute->currentText()), true);
}
}
......@@ -108,6 +109,7 @@ void RenderTopoSurfaceDockTab::drawDartsChanged(bool b)
{
View* view = m_window->getCurrentView();
MapHandlerGen* map = m_currentParams->selectedMap;
if(map)
m_plugin->changeDrawDarts(view, map, b, true);
}
}
......@@ -118,6 +120,7 @@ void RenderTopoSurfaceDockTab::dartsColorChanged(int i)
{
View* view = m_window->getCurrentView();
MapHandlerGen* map = m_currentParams->selectedMap;
if(map)
m_plugin->changeDartsColor(view, map, combo_dartsColor->color(), true);
}
}
......@@ -128,6 +131,7 @@ void RenderTopoSurfaceDockTab::drawPhi1Changed(bool b)
{
View* view = m_window->getCurrentView();
MapHandlerGen* map = m_currentParams->selectedMap;
if(map)
m_plugin->changeDrawPhi1(view, map, b, true);
}
}
......@@ -138,6 +142,7 @@ void RenderTopoSurfaceDockTab::phi1ColorChanged(int i)
{
View* view = m_window->getCurrentView();
MapHandlerGen* map = m_currentParams->selectedMap;
if(map)
m_plugin->changePhi1Color(view, map, combo_phi1Color->color(), true);
}
}
......@@ -148,6 +153,7 @@ void RenderTopoSurfaceDockTab::drawPhi2Changed(bool b)
{
View* view = m_window->getCurrentView();
MapHandlerGen* map = m_currentParams->selectedMap;
if(map)
m_plugin->changeDrawPhi2(view, map, b, true);
}
}
......@@ -158,6 +164,7 @@ void RenderTopoSurfaceDockTab::phi2ColorChanged(int i)
{
View* view = m_window->getCurrentView();
MapHandlerGen* map = m_currentParams->selectedMap;
if(map)
m_plugin->changePhi2Color(view, map, combo_phi2Color->color(), true);
}
}
......@@ -168,6 +175,7 @@ void RenderTopoSurfaceDockTab::facesScaleFactorChanged(int i)
{
View* view = m_window->getCurrentView();
MapHandlerGen* map = m_currentParams->selectedMap;
if(map)
m_plugin->changeEdgesScaleFactor(view, map, i, true);
}
}
......@@ -178,6 +186,7 @@ void RenderTopoSurfaceDockTab::edgesScaleFactorChanged(int i)
{
View* view = m_window->getCurrentView();
MapHandlerGen* map = m_currentParams->selectedMap;
if(map)
m_plugin->changeFacesScaleFactor(view, map, i, true);
}
}
......
......@@ -88,6 +88,7 @@ void RenderVectorDockTab::positionVBOChanged(int index)
{
View* view = m_window->getCurrentView();
MapHandlerGen* map = m_currentParams->selectedMap;
if(map)
m_plugin->changePositionVBO(view, map, map->getVBO(combo_positionVBO->currentText()), true);
}
}
......@@ -98,12 +99,15 @@ void RenderVectorDockTab::selectedVectorsVBOChanged()
{
View* view = m_window->getCurrentView();
MapHandlerGen* map = m_currentParams->selectedMap;
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);
}
}
}
void RenderVectorDockTab::vectorsScaleFactorChanged(int i)
......@@ -112,6 +116,7 @@ void RenderVectorDockTab::vectorsScaleFactorChanged(int i)
{
View* view = m_window->getCurrentView();
MapHandlerGen* map = m_currentParams->selectedMap;
if(map)
m_plugin->changeVectorsScaleFactor(view, map, i, true);
}
}
......
......@@ -85,6 +85,7 @@ void SurfaceDeformationDockTab::positionAttributeChanged(int index)
{
View* view = m_window->getCurrentView();
MapHandlerGen* map = m_currentParams->selectedMap;
if(map)
m_plugin->changePositionAttribute(view, map, map->getAttribute<PFP2::VEC3, VERTEX>(combo_positionAttribute->currentText()), true);
}
}
......@@ -95,6 +96,7 @@ void SurfaceDeformationDockTab::selectLockedVertices(bool b)
{
View* view = m_window->getCurrentView();
MapHandlerGen* map = m_currentParams->selectedMap;
if(map)
m_plugin->changeVerticesSelectionMode(view, map, LOCKED, true);
}
}
......@@ -105,6 +107,7 @@ void SurfaceDeformationDockTab::selectHandleVertices(bool b)
{
View* view = m_window->getCurrentView();
MapHandlerGen* map = m_currentParams->selectedMap;
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