Commit 5d77c85c authored by Pierre Kraemer's avatar Pierre Kraemer

bug fix in map handler

parent 71054826
......@@ -136,34 +136,41 @@ void Surface_Deformation_Plugin::keyPress(View* view, QKeyEvent* event)
{
case Qt::Key_D : {
MapHandlerGen* mh = m_schnapps->getSelectedMap();
const MapParameters& p = h_parameterSet[mh];
if(!m_dragging)
if(mh)
{
if(p.handleSelector && !p.handleSelector->getSelectedCells().empty())
const MapParameters& p = h_parameterSet[mh];
if(!m_dragging)
{
m_dragging = true;
if(p.handleSelector && !p.handleSelector->getSelectedCells().empty())
{
m_dragging = true;
m_draginit = false;
view->setMouseTracking(true);
}
}
else
{
m_dragging = false;
m_draginit = false;
view->setMouseTracking(true);
view->setMouseTracking(false);
}
}
else
{
m_dragging = false;
m_draginit = false;
view->setMouseTracking(false);
}
break;
}
case Qt::Key_R : {
// ParameterSet* params = h_viewParams[view];
// MapHandlerGen* map = params->selectedMap;
// if(map)
// {
// asRigidAsPossible(view, map);
// PerMapParameterSet* perMap = params->perMap[map->getName()];
// params->selectedMap->notifyAttributeModification(perMap->positionAttribute);
// view->updateGL();
// }
MapHandlerGen* mh = m_schnapps->getSelectedMap();
if(mh)
{
const MapParameters& p = h_parameterSet[mh];
if(p.initialized)
{
asRigidAsPossible(mh);
mh->notifyAttributeModification(p.positionAttribute);
static_cast<MapHandler<PFP2>*>(mh)->updateBB(p.positionAttribute);
view->updateGL();
}
}
break;
}
}
......@@ -208,10 +215,11 @@ void Surface_Deformation_Plugin::mouseMove(View* view, QMouseEvent* event)
// matchDiffCoord(map);
if(p.initialized)
{
asRigidAsPossible(mh);
mh->notifyAttributeModification(p.positionAttribute);
static_cast<MapHandler<PFP2>*>(mh)->updateBB(p.positionAttribute);
mh->notifyAttributeModification(p.positionAttribute);
static_cast<MapHandler<PFP2>*>(mh)->updateBB(p.positionAttribute);
}
}
view->updateGL();
......
......@@ -111,9 +111,12 @@ public:
void notifyConnectivityModification()
{
m_render->setPrimitiveDirty(Algo::Render::GL2::POINTS);
m_render->setPrimitiveDirty(Algo::Render::GL2::LINES);
m_render->setPrimitiveDirty(Algo::Render::GL2::TRIANGLES);
if (m_render)
{
m_render->setPrimitiveDirty(Algo::Render::GL2::POINTS);
m_render->setPrimitiveDirty(Algo::Render::GL2::LINES);
m_render->setPrimitiveDirty(Algo::Render::GL2::TRIANGLES);
}
emit(connectivityModified());
......
......@@ -113,6 +113,8 @@ public:
bool importPlySLFgeneric(const std::string& filename, std::vector<std::string>& attrNames);
bool importPlySLFgenericBin(const std::string& filename, std::vector<std::string>& attrNames);
bool importFromVoxelGrid(const VoxelGrid& grid);
#ifdef WITH_ASSIMP
bool importASSIMP(const std::string& filename, std::vector<std::string>& attrNames);
#endif
......
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