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

bug fix in map handler

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