Commit 88b0df6d authored by Pierre Kraemer's avatar Pierre Kraemer

mutually exclusive selectors OK & surface deformation OK

parent 1803052b
...@@ -88,7 +88,7 @@ private slots: ...@@ -88,7 +88,7 @@ private slots:
void attributeAdded(unsigned int orbit, const QString& name); void attributeAdded(unsigned int orbit, const QString& name);
void cellSelectorAdded(unsigned int orbit, const QString& name); void cellSelectorAdded(unsigned int orbit, const QString& name);
void cellSelectorRemoved(unsigned int orbit, const QString& name); void cellSelectorRemoved(unsigned int orbit, const QString& name);
void selectedCellsChanged(); void selectedCellsChanged(CellSelectorGen *cs);
public slots: public slots:
// slots for Python calls // slots for Python calls
......
...@@ -232,6 +232,7 @@ void Surface_Deformation_Plugin::mapAdded(MapHandlerGen* map) ...@@ -232,6 +232,7 @@ void Surface_Deformation_Plugin::mapAdded(MapHandlerGen* map)
connect(map, SIGNAL(attributeAdded(unsigned int, const QString&)), this, SLOT(attributeAdded(unsigned int, const QString&))); connect(map, SIGNAL(attributeAdded(unsigned int, const QString&)), this, SLOT(attributeAdded(unsigned int, const QString&)));
connect(map, SIGNAL(cellSelectorAdded(unsigned int, const QString&)), this, SLOT(cellSelectorAdded(unsigned int, const QString&))); connect(map, SIGNAL(cellSelectorAdded(unsigned int, const QString&)), this, SLOT(cellSelectorAdded(unsigned int, const QString&)));
connect(map, SIGNAL(cellSelectorRemoved(unsigned int, const QString&)), this, SLOT(cellSelectorRemoved(unsigned int, const QString&))); connect(map, SIGNAL(cellSelectorRemoved(unsigned int, const QString&)), this, SLOT(cellSelectorRemoved(unsigned int, const QString&)));
connect(map, SIGNAL(selectedCellsChanged(CellSelectorGen*)), this, SLOT(selectedCellsChanged(CellSelectorGen*)));
} }
void Surface_Deformation_Plugin::mapRemoved(MapHandlerGen* map) void Surface_Deformation_Plugin::mapRemoved(MapHandlerGen* map)
...@@ -239,6 +240,7 @@ void Surface_Deformation_Plugin::mapRemoved(MapHandlerGen* map) ...@@ -239,6 +240,7 @@ void Surface_Deformation_Plugin::mapRemoved(MapHandlerGen* map)
disconnect(map, SIGNAL(attributeAdded(unsigned int, const QString&)), this, SLOT(attributeAdded(unsigned int, const QString&))); disconnect(map, SIGNAL(attributeAdded(unsigned int, const QString&)), this, SLOT(attributeAdded(unsigned int, const QString&)));
disconnect(map, SIGNAL(cellSelectorAdded(unsigned int, const QString&)), this, SLOT(cellSelectorAdded(unsigned int, const QString&))); disconnect(map, SIGNAL(cellSelectorAdded(unsigned int, const QString&)), this, SLOT(cellSelectorAdded(unsigned int, const QString&)));
disconnect(map, SIGNAL(cellSelectorRemoved(unsigned int, const QString&)), this, SLOT(cellSelectorRemoved(unsigned int, const QString&))); disconnect(map, SIGNAL(cellSelectorRemoved(unsigned int, const QString&)), this, SLOT(cellSelectorRemoved(unsigned int, const QString&)));
disconnect(map, SIGNAL(selectedCellsChanged(CellSelectorGen*)), this, SLOT(selectedCellsChanged(CellSelectorGen*)));
} }
...@@ -284,10 +286,15 @@ void Surface_Deformation_Plugin::cellSelectorRemoved(unsigned int orbit, const Q ...@@ -284,10 +286,15 @@ void Surface_Deformation_Plugin::cellSelectorRemoved(unsigned int orbit, const Q
} }
} }
void Surface_Deformation_Plugin::selectedCellsChanged() void Surface_Deformation_Plugin::selectedCellsChanged(CellSelectorGen* cs)
{ {
// nlMakeCurrent(perMap->nlContext) ; MapHandlerGen* map = static_cast<MapHandlerGen*>(QObject::sender());
// nlReset(NL_FALSE) ; MapParameters& p = h_parameterSet[map];
if(p.initialized && (p.handleSelector == cs || p.freeSelector == cs))
{
nlMakeCurrent(p.nlContext) ;
nlReset(NL_FALSE) ;
}
} }
......
...@@ -34,6 +34,9 @@ bool Surface_DifferentialProperties_Plugin::enable() ...@@ -34,6 +34,9 @@ bool Surface_DifferentialProperties_Plugin::enable()
connect(m_schnapps, SIGNAL(mapAdded(MapHandlerGen*)), this, SLOT(mapAdded(MapHandlerGen*))); connect(m_schnapps, SIGNAL(mapAdded(MapHandlerGen*)), this, SLOT(mapAdded(MapHandlerGen*)));
connect(m_schnapps, SIGNAL(mapRemoved(MapHandlerGen*)), this, SLOT(mapRemoved(MapHandlerGen*))); connect(m_schnapps, SIGNAL(mapRemoved(MapHandlerGen*)), this, SLOT(mapRemoved(MapHandlerGen*)));
foreach(MapHandlerGen* map, m_schnapps->getMapSet().values())
mapAdded(map);
return true; return true;
} }
......
...@@ -148,6 +148,8 @@ public slots: ...@@ -148,6 +148,8 @@ public slots:
CellSelectorGen* getCellSelector(unsigned int orbit, const QString& name) const; CellSelectorGen* getCellSelector(unsigned int orbit, const QString& name) const;
const CellSelectorSet& getCellSelectorSet(unsigned int orbit) const { return m_cellSelectors[orbit]; } const CellSelectorSet& getCellSelectorSet(unsigned int orbit) const { return m_cellSelectors[orbit]; }
void selectedCellsChanged();
public: public:
template <unsigned int ORBIT> template <unsigned int ORBIT>
CellSelector<ORBIT>* getCellSelector(const QString& name) const; CellSelector<ORBIT>* getCellSelector(const QString& name) const;
...@@ -177,7 +179,7 @@ signals: ...@@ -177,7 +179,7 @@ signals:
void cellSelectorAdded(unsigned int orbit, const QString& name); void cellSelectorAdded(unsigned int orbit, const QString& name);
void cellSelectorRemoved(unsigned int orbit, const QString& name); void cellSelectorRemoved(unsigned int orbit, const QString& name);
void selectedCellsChanged(); void selectedCellsChanged(CellSelectorGen* cs);
protected: protected:
QString m_name; QString m_name;
......
...@@ -129,7 +129,7 @@ CellSelectorGen* MapHandlerGen::addCellSelector(unsigned int orbit, const QStrin ...@@ -129,7 +129,7 @@ CellSelectorGen* MapHandlerGen::addCellSelector(unsigned int orbit, const QStrin
m_cellSelectors[orbit].insert(name, cs); m_cellSelectors[orbit].insert(name, cs);
emit(cellSelectorAdded(orbit, name)); emit(cellSelectorAdded(orbit, name));
connect(cs, SIGNAL(selectedCellsChanged()), this, SIGNAL(selectedCellsChanged())); connect(cs, SIGNAL(selectedCellsChanged()), this, SLOT(selectedCellsChanged()));
return cs; return cs;
} }
...@@ -156,6 +156,12 @@ CellSelectorGen* MapHandlerGen::getCellSelector(unsigned int orbit, const QStrin ...@@ -156,6 +156,12 @@ CellSelectorGen* MapHandlerGen::getCellSelector(unsigned int orbit, const QStrin
return NULL; return NULL;
} }
void MapHandlerGen::selectedCellsChanged()
{
CellSelectorGen* cs = static_cast<CellSelectorGen*>(QObject::sender());
emit(selectedCellsChanged(cs));
}
void MapHandlerGen::updateMutuallyExclusiveSelectors(unsigned int orbit) void MapHandlerGen::updateMutuallyExclusiveSelectors(unsigned int orbit)
{ {
QList<CellSelectorGen*> mex; QList<CellSelectorGen*> mex;
......
...@@ -137,7 +137,7 @@ void View::linkMap(MapHandlerGen* map) ...@@ -137,7 +137,7 @@ void View::linkMap(MapHandlerGen* map)
updateGL(); updateGL();
connect(map->getFrame(), SIGNAL(modified()), this, SLOT(updateGL())); connect(map->getFrame(), SIGNAL(modified()), this, SLOT(updateGL()));
connect(map, SIGNAL(selectedCellsChanged()), this, SLOT(updateGL())); connect(map, SIGNAL(selectedCellsChanged(CellSelectorGen*)), this, SLOT(updateGL()));
if(map->isSelectedMap()) if(map->isSelectedMap())
setManipulatedFrame(map->getFrame()); setManipulatedFrame(map->getFrame());
......
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