Commit ac39444a authored by Sylvain Thery's avatar Sylvain Thery Committed by Pierre Kraemer

schnapps python record

parent f4411e8d
......@@ -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,14 +30,8 @@ MapHandlerGen* Surface_Import_Plugin::importFromFile(const QString& fileName)
QFileInfo fi(fileName);
if(fi.exists())
{
// RECORDING
//QTextStream* rec = m_schnapps->pythonStreamRecorder();
//if (rec)
// *rec << fi.baseName() << " = " << this->getName() << ".importFromFile(\"" << fileName << "\");" << endl;
pythonRecording("importFromFile", fi.baseName(), fileName);
MapHandlerGen* mhg = m_schnapps->addMap(fi.baseName(), 2);
if(mhg)
{
......
......@@ -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,8 +76,8 @@ 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]);
}
m_plugin->pythonRecording("changeFaceColor", "", view->getName(), map->getName(), rgbCol[0], rgbCol[1], rgbCol[2]);
}
if (m_currentColorDial == 2)
......@@ -94,8 +94,8 @@ 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]);
}
m_plugin->pythonRecording("changeEdgeColor", "", view->getName(), map->getName(), rgbCol[0], rgbCol[1], rgbCol[2]);
}
if (m_currentColorDial == 3)
......@@ -112,8 +112,8 @@ 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]);
}
m_plugin->pythonRecording("changVertexColor", "", view->getName(), map->getName(), rgbCol[0], rgbCol[1], rgbCol[2]);
}
}
......@@ -131,8 +131,8 @@ 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());
}
m_plugin->pythonRecording("changePositionVBO", "", view->getName(), map->getName(), combo_positionVBO->currentText());
}
}
......@@ -146,8 +146,8 @@ 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());
}
m_plugin->pythonRecording("changeNormalVBO","", view->getName(), map->getName(), combo_normalVBO->currentText());
}
}
......@@ -161,8 +161,8 @@ 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);
}
m_plugin->pythonRecording("changeRenderVertices", "", view->getName(), map->getName(), b);
}
}
......@@ -176,8 +176,8 @@ 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);
}
m_plugin->pythonRecording("changeVerticesScaleFactor", "", view->getName(), map->getName(), i / 50.0);
}
}
......@@ -191,8 +191,8 @@ 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);
}
m_plugin->pythonRecording("changeRenderEdges", "", view->getName(), map->getName(), b);
}
}
......@@ -206,8 +206,8 @@ 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);
}
m_plugin->pythonRecording("changeRenderFaces", "", view->getName(), map->getName(), b);
}
}
......@@ -224,8 +224,8 @@ 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);
}
m_plugin->pythonRecording("changeFacesStyle", "", view->getName(), map->getName(), m_plugin->h_viewParameterSet[view][map].faceStyle);
}
}
......@@ -239,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());
}
}
}
......@@ -47,6 +48,7 @@ void Surface_Selection_DockTab::normalAttributeChanged(int index)
{
MapHandler<PFP2>* mh = static_cast<MapHandler<PFP2>*>(map);
m_plugin->h_parameterSet[map].normalAttribute = mh->getAttribute<PFP2::VEC3, VERTEX>(combo_normalAttribute->currentText());
m_plugin->pythonRecording("changeNormalAttribute", "", map->getName(), combo_normalAttribute->currentText());
}
}
}
......@@ -56,8 +58,12 @@ void Surface_Selection_DockTab::selectionMethodChanged(int index)
if(!b_updatingUI)
{
MapHandlerGen* map = m_schnapps->getSelectedMap();
if(map)
if (map)
{
m_plugin->h_parameterSet[map].selectionMethod = SelectionMethod(index);
m_plugin->pythonRecording("changeSelectionMethod", "", map->getName(), index);
}
}
}
......
......@@ -75,6 +75,8 @@ void Surface_Subdivision_Plugin::loopSubdivision(
if(!position.isValid())
return;
pythonRecording("loopSubdivision", "", mapName, positionAttributeName);
PFP2::MAP* map = mh->getMap();
Algo::Surface::Modelisation::LoopSubdivision<PFP2>(*map, position);
......@@ -97,6 +99,8 @@ void Surface_Subdivision_Plugin::CCSubdivision(
if(!position.isValid())
return;
pythonRecording("CCSubdivision", "", mapName, positionAttributeName);
PFP2::MAP* map = mh->getMap();
Algo::Surface::Modelisation::CatmullClarkSubdivision<PFP2>(*map, position);
......@@ -119,6 +123,8 @@ void Surface_Subdivision_Plugin::trianguleFaces(
if(!position.isValid())
return;
pythonRecording("trianguleFaces", "", mapName, positionAttributeName);
PFP2::MAP* map = mh->getMap();
Algo::Surface::Modelisation::trianguleFaces<PFP2>(*map, position);
......
......@@ -30,6 +30,7 @@ MapHandlerGen* Volume_Import_Plugin::importFromFile(const QString& fileName)
QFileInfo fi(fileName);
if(fi.exists())
{
pythonRecording("importFromFile", fi.baseName(), fileName);
MapHandlerGen* mhg = m_schnapps->addMap(fi.baseName(), 3);
if(mhg)
{
......
......@@ -32,8 +32,8 @@
<addaction name="action_ShowHidePluginDock"/>
<addaction name="action_ShowHidePythonDock"/>
<addaction name="action_LoadPythonScript"/>
<addaction name="action_Begin_Python_Recording"/>
<addaction name="action_End_Python_Recording"/>
<addaction name="action_Python_Recording"/>
<addaction name="action_Append_Python_Recording"/>
<addaction name="separator"/>
<addaction name="action_Quit"/>
</widget>
......@@ -82,9 +82,9 @@
<string>Show/Hide Control Dock</string>
</property>
</action>
<action name="action_Begin_Python_Recording">
<action name="action_Python_Recording">
<property name="text">
<string>Begin Python Recording</string>
<string>Python Recording</string>
</property>
</action>
<action name="action_End_Python_Recording">
......@@ -92,6 +92,11 @@
<string>End Python Recording</string>
</property>
</action>
<action name="action_Append_Python_Recording">
<property name="text">
<string>Append Python Recording</string>