Commit 36744b8a authored by Sylvain Thery's avatar Sylvain Thery

Merge branch 'develop' into 'develop'

Develop

addd the recording of python script from interface

See merge request !59
parents b547a03f ce636fee
......@@ -40,6 +40,7 @@ void Surface_Deformation_DockTab::positionAttributeChanged(int index)
{
MapHandler<PFP2>* mh = static_cast<MapHandler<PFP2>*>(map);
m_plugin->h_parameterSet[map].positionAttribute = mh->getAttribute<PFP2::VEC3, VERTEX>(combo_positionAttribute->currentText());
m_plugin->pythonRecording("changePositionVBO", "", map->getName(), combo_positionAttribute->currentText());
}
}
}
......@@ -54,6 +55,8 @@ void Surface_Deformation_DockTab::handleSelectorChanged(int index)
{
MapHandler<PFP2>* mh = static_cast<MapHandler<PFP2>*>(map);
m_plugin->h_parameterSet[map].handleSelector = mh->getCellSelector<VERTEX>(combo_handleSelector->currentText());
m_plugin->pythonRecording("changeHandleSelector", "", map->getName(), combo_handleSelector->currentText());
}
}
}
......@@ -67,6 +70,7 @@ void Surface_Deformation_DockTab::freeSelectorChanged(int index)
{
MapHandler<PFP2>* mh = static_cast<MapHandler<PFP2>*>(map);
m_plugin->h_parameterSet[map].freeSelector = mh->getCellSelector<VERTEX>(combo_freeSelector->currentText());
m_plugin->pythonRecording("changeFreeSelector", "", map->getName(), combo_freeSelector->currentText());
}
}
}
......
......@@ -216,6 +216,10 @@ void Surface_DifferentialProperties_Plugin::computeNormal(
ComputeNormalParameters(positionAttributeName, normalAttributeName, autoUpdate);
mh->notifyAttributeModification(normal);
//this->pythonRecording("computeNormal", "", mh->getName(), QString(position.name().c_str()), QString(normal.name().c_str()), autoUpdate);
this->pythonRecording("computeNormal", "", mh->getName(), positionAttributeName, normalAttributeName, autoUpdate);
}
......@@ -307,6 +311,9 @@ void Surface_DifferentialProperties_Plugin::computeCurvature(
mh->notifyAttributeModification(kgaussian);
}
this->pythonRecording("computeCurvature", "", mh->getName(),
positionAttributeName, normalAttributeName, KmaxAttributeName, kmaxAttributeName, KminAttributeName, kminAttributeName, KnormalAttributeName, compute_kmean, compute_kgaussian, autoUpdate);
}
void Surface_DifferentialProperties_Plugin::schnappsClosing()
......
......@@ -129,6 +129,9 @@ void Surface_Distance_Plugin::computeDistance(
// Algo::Geometry::computeDistance<PFP2>(map1, position1, distance1, map2, position2);
// Algo::Geometry::computeDistance<PFP2>(map2, position2, distance2, map1, position1);
this->pythonRecording("computeDistance", "", mapName1, positionAttributeName1, distanceAttributeName1,
mapName2, positionAttributeName2, distanceAttributeName2);
mh1->notifyAttributeModification(distance1);
mh2->notifyAttributeModification(distance2);
}
......
......@@ -30,6 +30,8 @@ MapHandlerGen* Surface_Import_Plugin::importFromFile(const QString& fileName)
QFileInfo fi(fileName);
if(fi.exists())
{
pythonRecording("importFromFile", fi.baseName(), fileName);
MapHandlerGen* mhg = m_schnapps->addMap(fi.baseName(), 2);
if(mhg)
{
......
......@@ -267,6 +267,9 @@ MapHandlerGen* Surface_Radiance_Plugin::importFromFile(const QString& fileName)
mapParams.radiancePerVertexShader = new Utils::ShaderRadiancePerVertex(Utils::SphericalHarmonics<PFP2::REAL, PFP2::VEC3>::get_resolution());
registerShader(mapParams.radiancePerVertexShader);
}
this->pythonRecording("importFile", mhg->getName(), fi.baseName());
return mhg;
}
else
......@@ -564,6 +567,8 @@ void Surface_Radiance_Plugin::exportPLY(
}
out.close() ;
this->pythonRecording("exportPLY", "", mapName, positionAttributeName, normalAttributeName, filename);
}
......
......@@ -37,6 +37,7 @@ void Surface_Radiance_DockTab::positionVBOChanged(int index)
m_plugin->h_mapParameterSet[map].positionVBO = map->getVBO(combo_positionVBO->currentText());
foreach (View* v, map->getLinkedViews())
v->updateGL();
m_plugin->pythonRecording("changePositionVBO", "", map->getName(), combo_positionVBO->currentText());
}
}
}
......@@ -51,6 +52,7 @@ void Surface_Radiance_DockTab::normalVBOChanged(int index)
m_plugin->h_mapParameterSet[map].normalVBO = map->getVBO(combo_normalVBO->currentText());
foreach (View* v, map->getLinkedViews())
v->updateGL();
m_plugin->pythonRecording("changeNormalVBO", "", map->getName(), combo_normalVBO->currentText());
}
}
}
......@@ -78,6 +80,13 @@ void Surface_Radiance_DockTab::decimateClicked()
slider_decimationGoal->value() / 100.0f,
checkbox_halfCollapse->checkState() == Qt::Checked
);
m_plugin->pythonRecording("decimate", "",
m_schnapps->getSelectedMap()->getName(),
combo_positionVBO->currentText(),
combo_normalVBO->currentText(),
slider_decimationGoal->value() / 100.0f,
checkbox_halfCollapse->checkState() == Qt::Checked);
}
......
......@@ -107,7 +107,7 @@ public slots:
void changeVerticesScaleFactor(const QString&view, const QString& map, float f);
void changeRenderEdges(const QString& view, const QString& map, bool b);
void changeRenderFaces(const QString& view, const QString& map, bool b);
void changeFacesStyle(const QString& view, const QString& map, MapParameters::FaceShadingStyle style);
void changeFacesStyle(const QString& view, const QString& map, int);
void changeRenderBoundary(const QString& view, const QString& map, bool b);
void changeFaceColor(const QString& view, const QString& map, float r, float g, float b);
void changeEdgeColor(const QString& view, const QString& map, float r, float g, float b);
......
......@@ -313,8 +313,9 @@ void Surface_Render_Plugin::changeRenderFaces(const QString& view, const QString
}
}
void Surface_Render_Plugin::changeFacesStyle(const QString& view, const QString& map, MapParameters::FaceShadingStyle style)
void Surface_Render_Plugin::changeFacesStyle(const QString& view, const QString& map, int iStyle)
{
MapParameters::FaceShadingStyle style = MapParameters::FaceShadingStyle(iStyle);
DEBUG_SLOT();
View* v = m_schnapps->getView(view);
MapHandlerGen* m = m_schnapps->getMap(map);
......
......@@ -76,6 +76,7 @@ void Surface_Render_DockTab::colorSelected(const QColor& col)
{
m_plugin->h_viewParameterSet[view][map].diffuseColor = rgbCol;
view->updateGL();
m_plugin->pythonRecording("changeFaceColor", "", view->getName(), map->getName(), rgbCol[0], rgbCol[1], rgbCol[2]);
}
}
......@@ -93,6 +94,7 @@ void Surface_Render_DockTab::colorSelected(const QColor& col)
{
m_plugin->h_viewParameterSet[view][map].simpleColor = rgbCol;
view->updateGL();
m_plugin->pythonRecording("changeEdgeColor", "", view->getName(), map->getName(), rgbCol[0], rgbCol[1], rgbCol[2]);
}
}
......@@ -110,6 +112,7 @@ void Surface_Render_DockTab::colorSelected(const QColor& col)
{
m_plugin->h_viewParameterSet[view][map].vertexColor = rgbCol;
view->updateGL();
m_plugin->pythonRecording("changeVertexColor", "", view->getName(), map->getName(), rgbCol[0], rgbCol[1], rgbCol[2]);
}
}
}
......@@ -128,6 +131,7 @@ void Surface_Render_DockTab::positionVBOChanged(int index)
{
m_plugin->h_viewParameterSet[view][map].positionVBO = map->getVBO(combo_positionVBO->currentText());
view->updateGL();
m_plugin->pythonRecording("changePositionVBO", "", view->getName(), map->getName(), combo_positionVBO->currentText());
}
}
}
......@@ -142,6 +146,7 @@ void Surface_Render_DockTab::normalVBOChanged(int index)
{
m_plugin->h_viewParameterSet[view][map].normalVBO = map->getVBO(combo_normalVBO->currentText());
view->updateGL();
m_plugin->pythonRecording("changeNormalVBO", "", view->getName(), map->getName(), combo_normalVBO->currentText());
}
}
}
......@@ -156,6 +161,7 @@ void Surface_Render_DockTab::renderVerticesChanged(bool b)
{
m_plugin->h_viewParameterSet[view][map].renderVertices = b;
view->updateGL();
m_plugin->pythonRecording("changeRenderVertices", "", view->getName(), map->getName(), b);
}
}
}
......@@ -170,6 +176,7 @@ void Surface_Render_DockTab::verticesScaleFactorChanged(int i)
{
m_plugin->h_viewParameterSet[view][map].verticesScaleFactor = i / 50.0;
view->updateGL();
m_plugin->pythonRecording("changeVerticesScaleFactor", "", view->getName(), map->getName(), i / 50.0);
}
}
}
......@@ -184,6 +191,7 @@ void Surface_Render_DockTab::renderEdgesChanged(bool b)
{
m_plugin->h_viewParameterSet[view][map].renderEdges = b;
view->updateGL();
m_plugin->pythonRecording("changeRenderEdges", "", view->getName(), map->getName(), b);
}
}
}
......@@ -198,6 +206,7 @@ void Surface_Render_DockTab::renderFacesChanged(bool b)
{
m_plugin->h_viewParameterSet[view][map].renderFaces = b;
view->updateGL();
m_plugin->pythonRecording("changeRenderFaces", "", view->getName(), map->getName(), b);
}
}
}
......@@ -215,6 +224,7 @@ void Surface_Render_DockTab::faceStyleChanged(QAbstractButton* b)
else if (radio_phongShading->isChecked())
m_plugin->h_viewParameterSet[view][map].faceStyle = MapParameters::PHONG;
view->updateGL();
m_plugin->pythonRecording("changeFacesStyle", "", view->getName(), map->getName(), m_plugin->h_viewParameterSet[view][map].faceStyle);
}
}
}
......@@ -229,6 +239,7 @@ void Surface_Render_DockTab::renderBoundaryChanged(bool b)
{
m_plugin->h_viewParameterSet[view][map].renderBoundary = b;
view->updateGL();
m_plugin->pythonRecording("changeRenderBoundary", "", view->getName(), map->getName(), b);
}
}
}
......
......@@ -194,8 +194,8 @@ void Surface_RenderScalar_Plugin::changePositionVBO(const QString& view, const Q
h_viewParameterSet[v][m].positionVBO = vbuf;
if(v->isSelectedView())
{
if(v->isLinkedToMap(m)) v->updateGL();
if(m->isSelectedMap()) m_dockTab->updateMapParameters();
if (v->isLinkedToMap(m)) v->updateGL();
if (m->isSelectedMap()) m_dockTab->updateMapParameters();
}
}
}
......@@ -209,7 +209,7 @@ void Surface_RenderScalar_Plugin::changeScalarVBO(const QString& view, const QSt
MapParameters& p = h_viewParameterSet[v][m];
Utils::VBO* vbuf = m->getVBO(vbo);
p.positionVBO = vbuf;
p.scalarVBO = vbuf;
if(vbuf)
{
......
......@@ -37,6 +37,7 @@ void Surface_RenderScalar_DockTab::positionVBOChanged(int index)
{
m_plugin->h_viewParameterSet[view][map].positionVBO = map->getVBO(combo_positionVBO->currentText());
view->updateGL();
m_plugin->pythonRecording("changePositionVBO", "", view->getName(), map->getName(), combo_positionVBO->currentText());
}
}
}
......@@ -59,6 +60,7 @@ void Surface_RenderScalar_DockTab::selectedScalarVBOChanged()
if(vbo)
{
m_plugin->pythonRecording("changeScalarVBO", "", view->getName(), map->getName(), selectedItems[0]->text());
MapHandler<PFP2>* mh = static_cast<MapHandler<PFP2>*>(map);
const VertexAttribute<PFP2::REAL, PFP2::MAP>& attr = mh->getAttribute<PFP2::REAL, VERTEX>(QString::fromStdString(vbo->name()));
p.scalarMin = std::numeric_limits<float>::max();
......@@ -87,6 +89,7 @@ void Surface_RenderScalar_DockTab::colorMapChanged(int index)
{
m_plugin->h_viewParameterSet[view][map].colorMap = index;
view->updateGL();
m_plugin->pythonRecording("changeColorMap", "", view->getName(), map->getName(), index);
}
}
}
......@@ -101,6 +104,7 @@ void Surface_RenderScalar_DockTab::expansionChanged(int i)
{
m_plugin->h_viewParameterSet[view][map].expansion = i;
view->updateGL();
m_plugin->pythonRecording("changeExpansion", "", view->getName(), map->getName(), i);
}
}
}
......@@ -166,15 +170,15 @@ void Surface_RenderScalar_DockTab::updateMapParameters()
if(dataSize == 3)
{
combo_positionVBO->addItem(QString::fromStdString(vbo->name()));
if(vbo == p.positionVBO)
if (vbo == p.positionVBO)
combo_positionVBO->setCurrentIndex(i);
++i;
}
else if(dataSize == 1)
{
list_scalarVBO->addItem(QString::fromStdString(vbo->name()));
if(vbo == p.scalarVBO)
list_scalarVBO->item(j)->setSelected(true);
if (vbo == p.scalarVBO)
list_scalarVBO->item(j)->setSelected(true);
++j;
}
}
......
......@@ -95,16 +95,16 @@ private slots:
public slots:
// slots for Python calls
// void changeDrawDarts(const QString& view, const QString& map, bool b);
// void changeDartsColor(const QString& view, const QString& map, QColor c);
// void changeDrawPhi1(const QString& view, const QString& map, bool b);
// void changePhi1Color(const QString& view, const QString& map, QColor c);
// void changeDrawPhi2(const QString& view, const QString& map, bool b);
// void changePhi2Color(const QString& view, const QString& map, QColor c);
// void changePositionAttribute(const QString& map, const QString& attrName);
// void changeEdgesScaleFactor(const QString& map, int i);
// void changeFacesScaleFactor(const QString& map, int i);
void changeDrawDarts(const QString& view, const QString& map, bool b);
void changeDrawPhi1(const QString& view, const QString& map, bool b);
void changeDrawPhi2(const QString& view, const QString& map, bool b);
void changeDartsColor(const QString& view, const QString& map, const QString& color);
void changePhi1Color(const QString& view, const QString& map, const QString& color);
void changePhi2Color(const QString& view, const QString& map, const QString& color);
void changePositionAttribute(const QString& map, const QString& attrName);
void changeEdgesScaleFactor(const QString& map, float s);
void changeFacesScaleFactor(const QString& map, float s);
//signals:
// void dartSelected(Dart d);
......
......@@ -121,22 +121,153 @@ void Surface_RenderTopo_Plugin::attributeAdded(unsigned int orbit, const QString
//void Surface_RenderTopo_Plugin::changePositionAttribute(View* view, MapHandlerGen* map, VertexAttribute<PFP2::VEC3, PFP2::MAP> attribute, bool fromUI)
//{
//// map->updateTopoRender
void Surface_RenderTopo_Plugin::changePositionAttribute(const QString& map, const QString& attrName)
{
MapHandlerGen* m = m_schnapps->getMap(map);
if (m)
{
MapParam& p = h_parameterSet[m];
p.posAttName = attrName;
p.needUpdate = true;
if (m == m_schnapps->getSelectedMap())
{
int index = m_dockTab->combo_positionAttribute->findText(attrName);
if (index > 0)
m_dockTab->combo_positionAttribute->setCurrentIndex(index);
}
}
}
// ParameterSet* params = h_viewParams[view];
// PerMapParameterSet* perMap = params->perMap[map->getName()];
// perMap->positionAttribute = attribute;
// perMap->updateRender();
void Surface_RenderTopo_Plugin::changeEdgesScaleFactor(const QString& map, float s)
{
MapHandlerGen* m = m_schnapps->getMap(map);
if (m)
{
MapParam& p = h_parameterSet[m];
p.edgesScaleFactor = s;
p.needUpdate = true;
if (m == m_schnapps->getSelectedMap())
{
m_dockTab->slider_edgesScaleFactor->setValue(int(100.0f*s));
}
}
}
void Surface_RenderTopo_Plugin::changeFacesScaleFactor(const QString& map, float s)
{
MapHandlerGen* m = m_schnapps->getMap(map);
if (m)
{
MapParam& p = h_parameterSet[m];
p.facesScaleFactor = s;
p.needUpdate = true;
if (m == m_schnapps->getSelectedMap())
{
m_dockTab->slider_facesScaleFactor->setValue(int(100.0f*s));
}
}
}
void Surface_RenderTopo_Plugin::changeDrawDarts(const QString& view, const QString& map, bool b)
{
View* v = m_schnapps->getView(view);
MapHandlerGen* m = m_schnapps->getMap(map);
if (v && m)
{
ViewMapParam& p = h_viewParameterSet[v][m];
p.drawDarts = b;
if (m == m_schnapps->getSelectedMap())
{
m_dockTab->check_drawDarts->setChecked(b);
}
}
}
void Surface_RenderTopo_Plugin::changeDrawPhi1(const QString& view, const QString& map, bool b)
{
View* v = m_schnapps->getView(view);
MapHandlerGen* m = m_schnapps->getMap(map);
if (v && m)
{
ViewMapParam& p = h_viewParameterSet[v][m];
p.drawPhi1 = b;
if (m == m_schnapps->getSelectedMap())
{
m_dockTab->check_drawPhi1->setChecked(b);
}
}
}
void Surface_RenderTopo_Plugin::changeDrawPhi2(const QString& view, const QString& map, bool b)
{
View* v = m_schnapps->getView(view);
MapHandlerGen* m = m_schnapps->getMap(map);
if (v && m)
{
ViewMapParam& p = h_viewParameterSet[v][m];
p.drawPhi2 = b;
if (m == m_schnapps->getSelectedMap())
{
m_dockTab->check_drawPhi2->setChecked(b);
}
}
}
void Surface_RenderTopo_Plugin::changeDartsColor(const QString& view, const QString& map, const QString& color)
{
View* v = m_schnapps->getView(view);
MapHandlerGen* m = m_schnapps->getMap(map);
if (v && m)
{
ViewMapParam& p = h_viewParameterSet[v][m];
p.dartsColor = QColor(color);
if (m == m_schnapps->getSelectedMap())
{
int index = m_dockTab->combo_dartsColor->findText(color);
if (index > 0)
m_dockTab->combo_dartsColor->setCurrentIndex(index);
}
}
}
void Surface_RenderTopo_Plugin::changePhi1Color(const QString& view, const QString& map, const QString& color)
{
View* v = m_schnapps->getView(view);
MapHandlerGen* m = m_schnapps->getMap(map);
if (v && m)
{
ViewMapParam& p = h_viewParameterSet[v][m];
p.phi1Color = QColor(color);
if (m == m_schnapps->getSelectedMap())
{
int index = m_dockTab->combo_phi1Color->findText(color);
if (index > 0)
m_dockTab->combo_phi1Color->setCurrentIndex(index);
}
}
}
void Surface_RenderTopo_Plugin::changePhi2Color(const QString& view, const QString& map, const QString& color)
{
View* v = m_schnapps->getView(view);
MapHandlerGen* m = m_schnapps->getMap(map);
if (v && m)
{
ViewMapParam& p = h_viewParameterSet[v][m];
p.phi2Color = QColor(color);
if (m == m_schnapps->getSelectedMap())
{
int index = m_dockTab->combo_phi2Color->findText(color);
if (index > 0)
m_dockTab->combo_phi2Color->setCurrentIndex(index);
}
}
}
// if(view->isCurrentView())
// {
// if(!fromUI)
// m_dockTab->refreshUI(params);
// view->updateGL();
// }
//}
//void Surface_RenderTopo_Plugin::changeDrawDarts(View* view, MapHandlerGen* map, bool b, bool fromUI)
//{
......@@ -219,35 +350,6 @@ void Surface_RenderTopo_Plugin::attributeAdded(unsigned int orbit, const QString
// }
//}
//void Surface_RenderTopo_Plugin::changeEdgesScaleFactor(View* view, MapHandlerGen* map, int i, bool fromUI)
//{
// ParameterSet* params = h_viewParams[view];
// PerMapParameterSet* perMap = params->perMap[map->getName()];
// perMap->edgesScaleFactor = i / 100.0;
// perMap->updateRender();
// if(view->isCurrentView())
// {
// if(!fromUI)
// m_dockTab->refreshUI(params);
// view->updateGL();
// }
//}
//void Surface_RenderTopo_Plugin::changeFacesScaleFactor(View* view, MapHandlerGen* map, int i, bool fromUI)
//{
// ParameterSet* params = h_viewParams[view];
// PerMapParameterSet* perMap = params->perMap[map->getName()];
// perMap->facesScaleFactor = i / 100.0;
// perMap->updateRender();
// if(view->isCurrentView())
// {
// if(!fromUI)
// m_dockTab->refreshUI(params);
// view->updateGL();
// }
//}
#if CGOGN_QT_DESIRED_VERSION == 5
......
......@@ -40,17 +40,11 @@ void Surface_RenderTopo_DockTab::positionAttributeChanged(int index)
MapHandlerGen* map = m_schnapps->getSelectedMap();
if(view && map)
{
// if(index == 0)
// ;
// else
// m_plugin->h_viewParameterSet[view][map].positionAttribute = map->getAttribute<PFP2::VEC3, VERTEX>(combo_positionAttribute->currentText());
// QString pos = this->combo_positionAttribute->currentText();
QString& pos = m_plugin->h_parameterSet[map].posAttName;
pos = this->combo_positionAttribute->currentText();
map->updateTopoRender(pos);
view->updateGL();
m_plugin->pythonRecording("changePositionAttribute", "", map->getName(), pos);
}
}
}
......@@ -65,6 +59,7 @@ void Surface_RenderTopo_DockTab::drawDartsChanged(bool b)
{
m_plugin->h_viewParameterSet[view][map].drawDarts = b;
view->updateGL();
m_plugin->pythonRecording("changeDrawDarts", "", view->getName(), map->getName(), b);
}
}
}
......@@ -79,6 +74,7 @@ void Surface_RenderTopo_DockTab::dartsColorChanged(int i)
{
m_plugin->h_viewParameterSet[view][map].dartsColor = combo_dartsColor->color();
view->updateGL();
m_plugin->pythonRecording("changeDartsColor", "", view->getName(), map->getName(), combo_dartsColor->currentText());
}
}
}
......@@ -93,6 +89,7 @@ void Surface_RenderTopo_DockTab::drawPhi1Changed(bool b)
{
m_plugin->h_viewParameterSet[view][map].drawPhi1 = b;
view->updateGL();
m_plugin->pythonRecording("changeDrawPhi1", "", view->getName(), map->getName(), b);
}
}
}
......@@ -107,6 +104,7 @@ void Surface_RenderTopo_DockTab::phi1ColorChanged(int i)
{
m_plugin->h_viewParameterSet[view][map].phi1Color = combo_phi1Color->color();
view->updateGL();
m_plugin->pythonRecording("changePhi1Color", "", view->getName(), map->getName(), combo_phi1Color->currentText());
}
}
}
......@@ -121,6 +119,7 @@ void Surface_RenderTopo_DockTab::drawPhi2Changed(bool b)
{
m_plugin->h_viewParameterSet[view][map].drawPhi2 = b;
view->updateGL();
m_plugin->pythonRecording("changeDrawPhi2", "", view->getName(), map->getName(), b);
}
}
}
......@@ -135,6 +134,7 @@ void Surface_RenderTopo_DockTab::phi2ColorChanged(int i)
{
m_plugin->h_viewParameterSet[view][map].phi2Color = combo_phi2Color->color();
view->updateGL();
m_plugin->pythonRecording("changePhi2Color", "", view->getName(), map->getName(), combo_phi2Color->currentText());
}
}
}
......@@ -152,6 +152,7 @@ void Surface_RenderTopo_DockTab::facesScaleFactorChanged(int i)
m_plugin->h_parameterSet[map].facesScaleFactor = i / 100.0f;
m_plugin->h_parameterSet[map].needUpdate = true;
map->updateTopoRender(m_plugin->h_parameterSet[map].posAttName);
m_plugin->pythonRecording("changeFacesScaleFactor", "", map->getName(), i / 100.0f);
}
const ViewSet& vs= m_schnapps->getViewSet();
foreach (View* pv, vs)
......@@ -178,6 +179,7 @@ void Surface_RenderTopo_DockTab::edgesScaleFactorChanged(int i)
{
m_plugin->h_parameterSet[map].edgesScaleFactor = i / 100.0f;
m_plugin->h_parameterSet[map].needUpdate = true;
m_plugin->pythonRecording("changeEdgesScaleFactor", "", map->getName(), i / 100.0f);
}
const ViewSet& vs= m_schnapps->getViewSet();
foreach (View* pv, vs)
......
......@@ -163,8 +163,8 @@ void Surface_RenderVector_Plugin::changePositionVBO(const QString& view, const Q
h_viewParameterSet[v][m].positionVBO = vbuf;
if(v->isSelectedView())
{
if(v->isLinkedToMap(m)) v->updateGL();
if(m->isSelectedMap()) m_dockTab->updateMapParameters();
if (v->isLinkedToMap(m)) v->updateGL();
if (m->isSelectedMap()) m_dockTab->updateMapParameters();
}
}
}
......
......@@ -38,6 +38,7 @@ void Surface_RenderVector_DockTab::positionVBOChanged(int index)
{
m_plugin->h_viewParameterSet[view][map].positionVBO = map->getVBO(combo_positionVBO->currentText());
view->updateGL();
m_plugin->pythonRecording("changePositionVBO", "", view->getName(), map->getName(), combo_positionVBO->currentText());
}
}
}
......@@ -52,8 +53,21 @@ void Surface_RenderVector_DockTab::selectedVectorsVBOChanged()
{
QList<QListWidgetItem*> currentItems = list_vectorVBO->selectedItems();
QList<Utils::VBO*> vbos;
const QList<Utils::VBO*>& vboList = m_plugin->h_viewParameterSet[view][map].vectorVBOs;
foreach(QListWidgetItem* item, currentItems)
vbos.append(map->getVBO(item->text()));
{
Utils::VBO* vbo = map->getVBO(item->text());
vbos.append(vbo);
if (!vboList.contains(vbo))
m_plugin->pythonRecording("addVectorVBO", "", view->getName(), map->getName(), item->text());
}
foreach(Utils::VBO* vbo, vboList)
{
if (!vbos.contains(vbo))
m_plugin->pythonRecording("removeVectorVBO", "", view->getName(), map->getName(), QString(vbo->name().c_str()));
}
m_plugin->h_viewParameterSet[view][map].vectorVBOs = vbos;
view->updateGL();
}
......@@ -127,7 +141,7 @@ void Surface_RenderVector_DockTab::updateMapParameters()
{
const MapParameters& p = m_plugin->h_viewParameterSet[view][map];
unsigned int i = 1;
unsigned int i = 0;
foreach(Utils::VBO* vbo, map->getVBOSet().values())
{
if(vbo->dataSize() == 3)
......
......@@ -34,6 +34,7 @@ void Surface_Selection_DockTab::positionAttributeChanged(int index)
{
MapHandler<PFP2>* mh = static_cast<MapHandler<PFP2>*>(map);
m_plugin->h_parameterSet[map].positionAttribute = mh->getAttribute<PFP2::VEC3, VERTEX>(combo_positionAttribute->currentText());
m_plugin->pythonRecording("changePositionAttribute", "", map->getName(), combo_positionAttribute->currentText());
}