Commit b7085890 authored by Pierre Kraemer's avatar Pierre Kraemer
Browse files

Merge branch 'develop' of icube-forge.unistra.fr:cgogn/cgogn into develop

parents e1ddbb94 b29a40b3
......@@ -78,7 +78,9 @@ void Viewer::initGUI()
void Viewer::cb_initGL()
{
Utils::GLSLShader::setCurrentOGLVersion(2) ;
Utils::GLSLShader::setCurrentOGLVersion(3) ;
CGoGNout << "GL VERSION = "<< glGetString(GL_VERSION)<< CGoGNendl;
Utils::GLSLShader::areShadersSupported();
m_render = new Algo::Render::GL2::MapRender() ;
m_topoRender = new Algo::Render::GL2::TopoRenderMap<PFP>() ;
......
......@@ -206,6 +206,8 @@ void MyQT::cb_initGL()
{
// choose to use GL version 2
Utils::GLSLShader::setCurrentOGLVersion(2);
CGoGNout << "GL VERSION = "<< glGetString(GL_VERSION)<< CGoGNendl;
Utils::GLSLShader::areShadersSupported();
// create the renders
m_topo_render = new Algo::Render::GL2::Topo3RenderMap<PFP>();
......
......@@ -110,6 +110,9 @@ void MapParameters::stop(MapHandlerGen* mh)
bool Surface_Deformation_Plugin::enable()
{
// magic line that init static variables of GenericMap in the plugins
GenericMap::copyAllStatics(m_schnapps->getStaticPointers());
m_dockTab = new Surface_Deformation_DockTab(m_schnapps, this);
m_schnapps->addPluginDockTab(this, m_dockTab, "Surface_Deformation");
......@@ -539,11 +542,7 @@ void Surface_Deformation_Plugin::asRigidAsPossible(MapHandlerGen* mh)
}
}
#ifndef DEBUG
Q_EXPORT_PLUGIN2(Surface_Deformation_Plugin, Surface_Deformation_Plugin)
#else
Q_EXPORT_PLUGIN2(Surface_Deformation_PluginD, Surface_Deformation_Plugin)
#endif
} // namespace SCHNApps
......
......@@ -13,6 +13,9 @@ namespace SCHNApps
bool Surface_DifferentialProperties_Plugin::enable()
{
// magic line that init static variables of GenericMap in the plugins
GenericMap::copyAllStatics(m_schnapps->getStaticPointers());
m_computeNormalDialog = new Dialog_ComputeNormal(m_schnapps);
m_computeCurvatureDialog = new Dialog_ComputeCurvature(m_schnapps);
......@@ -292,11 +295,7 @@ void Surface_DifferentialProperties_Plugin::computeCurvature(
}
}
#ifndef DEBUG
Q_EXPORT_PLUGIN2(Surface_DifferentialProperties_Plugin, Surface_DifferentialProperties_Plugin)
#else
Q_EXPORT_PLUGIN2(Surface_DifferentialProperties_PluginD, Surface_DifferentialProperties_Plugin)
#endif
} // namespace SCHNApps
......
......@@ -16,7 +16,8 @@ class Surface_Import_Plugin : public PluginProcessing
public:
Surface_Import_Plugin()
{}
{
}
~Surface_Import_Plugin()
{}
......
......@@ -16,6 +16,9 @@ namespace SCHNApps
bool Surface_Import_Plugin::enable()
{
// magic line that init static variables of GenericMap in the plugins
GenericMap::copyAllStatics(m_schnapps->getStaticPointers());
importAction = new QAction("import", this);
m_schnapps->addMenuAction(this, "Surface;Import", importAction);
connect(importAction, SIGNAL(triggered()), this, SLOT(importFromFileDialog()));
......@@ -62,11 +65,7 @@ void Surface_Import_Plugin::importFromFileDialog()
}
}
#ifndef DEBUG
Q_EXPORT_PLUGIN2(Surface_Import_Plugin, Surface_Import_Plugin)
#else
Q_EXPORT_PLUGIN2(Surface_Import_PluginD, Surface_Import_Plugin)
#endif
} // namespace SCHNApps
......
......@@ -24,6 +24,9 @@ Surface_Modelisation_Plugin::Surface_Modelisation_Plugin()
bool Surface_Modelisation_Plugin::enable()
{
// magic line that init static variables of GenericMap in the plugins
GenericMap::copyAllStatics(m_schnapps->getStaticPointers());
m_dockTab = new Surface_Modelisation_DockTab(m_schnapps, this);
m_schnapps->addPluginDockTab(this, m_dockTab, "Surface_Modelisation");
......@@ -790,11 +793,7 @@ void Surface_Modelisation_Plugin::pathExtrudeFace(MapHandlerGen *mhg)
}
#ifndef DEBUG
Q_EXPORT_PLUGIN2(Surface_Modelisation_Plugin, Surface_Modelisation_Plugin)
#else
Q_EXPORT_PLUGIN2(Surface_Modelisation_PluginD, Surface_Modelisation_Plugin)
#endif
} // namespace SCHNApps
......
......@@ -10,6 +10,9 @@ namespace SCHNApps
bool Surface_Render_Plugin::enable()
{
// magic line that init static variables of GenericMap in the plugins
GenericMap::copyAllStatics(m_schnapps->getStaticPointers());
m_dockTab = new Surface_Render_DockTab(m_schnapps, this);
m_schnapps->addPluginDockTab(this, m_dockTab, "Surface_Render");
......@@ -323,11 +326,7 @@ void Surface_Render_Plugin::changeRenderBoundary(const QString& view, const QStr
}
}
#ifndef DEBUG
Q_EXPORT_PLUGIN2(Surface_Render_Plugin, Surface_Render_Plugin)
#else
Q_EXPORT_PLUGIN2(Surface_Render_PluginD, Surface_Render_Plugin)
#endif
} // namespace SCHNApps
......
......@@ -10,6 +10,9 @@ namespace SCHNApps
bool Surface_RenderScalar_Plugin::enable()
{
// magic line that init static variables of GenericMap in the plugins
GenericMap::copyAllStatics(m_schnapps->getStaticPointers());
m_dockTab = new Surface_RenderScalar_DockTab(m_schnapps, this);
m_schnapps->addPluginDockTab(this, m_dockTab, "Surface_RenderScalar");
......@@ -255,11 +258,7 @@ void Surface_RenderScalar_Plugin::changeExpansion(const QString& view, const QSt
}
}
#ifndef DEBUG
Q_EXPORT_PLUGIN2(Surface_RenderScalar_Plugin, Surface_RenderScalar_Plugin)
#else
Q_EXPORT_PLUGIN2(Surface_RenderScalar_PluginD, Surface_RenderScalar_Plugin)
#endif
} // namespace SCHNApps
......
......@@ -10,6 +10,9 @@ namespace SCHNApps
bool Surface_RenderTopo_Plugin::enable()
{
// magic line that init static variables of GenericMap in the plugins
GenericMap::copyAllStatics(m_schnapps->getStaticPointers());
m_dockTab = new Surface_RenderTopo_DockTab(m_schnapps, this);
m_schnapps->addPluginDockTab(this, m_dockTab, "Surface_RenderTopo");
......@@ -217,11 +220,7 @@ void Surface_RenderTopo_Plugin::attributeAdded(unsigned int orbit, const QString
// }
//}
#ifndef DEBUG
Q_EXPORT_PLUGIN2(Surface_RenderTopo_Plugin, Surface_RenderTopo_Plugin)
#else
Q_EXPORT_PLUGIN2(Surface_RenderTopo_PluginD, Surface_RenderTopo_Plugin)
#endif
} // namespace SCHNApps
......
......@@ -10,6 +10,9 @@ namespace SCHNApps
bool Surface_RenderVector_Plugin::enable()
{
// magic line that init static variables of GenericMap in the plugins
GenericMap::copyAllStatics(m_schnapps->getStaticPointers());
m_dockTab = new Surface_RenderVector_DockTab(m_schnapps, this);
m_schnapps->addPluginDockTab(this, m_dockTab, "Surface_RenderVector");
......@@ -209,11 +212,7 @@ void Surface_RenderVector_Plugin::changeVectorsScaleFactor(const QString& view,
}
}
#ifndef DEBUG
Q_EXPORT_PLUGIN2(Surface_RenderVector_Plugin, Surface_RenderVector_Plugin)
#else
Q_EXPORT_PLUGIN2(Surface_RenderVector_PluginD, Surface_RenderVector_Plugin)
#endif
} // namespace SCHNApps
......
......@@ -23,6 +23,9 @@ Surface_Selection_Plugin::Surface_Selection_Plugin() :
bool Surface_Selection_Plugin::enable()
{
// magic line that init static variables of GenericMap in the plugins
GenericMap::copyAllStatics(m_schnapps->getStaticPointers());
m_dockTab = new Surface_Selection_DockTab(m_schnapps, this);
m_schnapps->addPluginDockTab(this, m_dockTab, "Surface_Selection");
......@@ -625,11 +628,7 @@ void Surface_Selection_Plugin::changeSelectionMethod(const QString& map, unsigne
}
}
#ifndef DEBUG
Q_EXPORT_PLUGIN2(Surface_Selection_Plugin, Surface_Selection_Plugin)
#else
Q_EXPORT_PLUGIN2(Surface_Selection_PluginD, Surface_Selection_Plugin)
#endif
} // namespace SCHNApps
......
......@@ -12,6 +12,9 @@ namespace SCHNApps
bool Surface_Subdivision_Plugin::enable()
{
// magic line that init static variables of GenericMap in the plugins
GenericMap::copyAllStatics(m_schnapps->getStaticPointers());
m_subdivisionDialog = new Dialog_Surface_Subdivision(m_schnapps);
m_subdivisionAction = new QAction("Subdivide surface", this);
......@@ -122,11 +125,7 @@ void Surface_Subdivision_Plugin::trianguleFaces(
view->updateGL();
}
#ifndef DEBUG
Q_EXPORT_PLUGIN2(Surface_Subdivision_Plugin, Surface_Subdivision_Plugin)
#else
Q_EXPORT_PLUGIN2(Surface_Subdivision_PluginD, Surface_Subdivision_Plugin)
#endif
} // namespace SCHNApps
......
......@@ -16,7 +16,12 @@ class Volume_Import_Plugin : public PluginProcessing
public:
Volume_Import_Plugin()
{}
{
std::cout << "VOL IMPORT CONSTR" << std::endl;
std::cout << "&PTR="<< &(GenericMap::s_instances)<< std::endl;
std::cout << "PTR="<< GenericMap::s_instances<< std::endl;
}
~Volume_Import_Plugin()
{}
......
......@@ -16,6 +16,9 @@ namespace SCHNApps
bool Volume_Import_Plugin::enable()
{
// magic line that init static variables of GenericMap in the plugins
GenericMap::copyAllStatics(m_schnapps->getStaticPointers());
importAction = new QAction("import", this);
m_schnapps->addMenuAction(this, "Volume;Import", importAction);
connect(importAction, SIGNAL(triggered()), this, SLOT(importFromFileDialog()));
......@@ -62,11 +65,7 @@ void Volume_Import_Plugin::importFromFileDialog()
}
}
#ifndef DEBUG
Q_EXPORT_PLUGIN2(Volume_Import_Plugin, Volume_Import_Plugin)
#else
Q_EXPORT_PLUGIN2(Volume_Import_PluginD, Volume_Import_Plugin)
#endif
} // namespace SCHNApps
......
......@@ -101,6 +101,8 @@ public slots:
void notifySelectedCellSelectorChanged(CellSelectorGen* cs) { emit(selectedCellSelectorChanged(cs)); }
CellSelectorGen* getSelectedSelector(unsigned int orbit) const;
const StaticPointers& getStaticPointers() const {return m_sp;}
/*********************************************************
* MANAGE TEXTURES
*********************************************************/
......@@ -180,6 +182,8 @@ protected:
MapSet m_maps;
TextureSet m_textures;
StaticPointers m_sp;
};
} // namespace SCHNApps
......
......@@ -24,9 +24,13 @@ int main(int argc, char* argv[])
// get a smart pointer to the __main__ module of the Python interpreter
PythonQtObjectPtr pythonContext = PythonQt::self()->getMainModule();
PythonQtScriptingConsole pythonConsole(NULL, pythonContext);
CGoGN::SCHNApps::SCHNApps schnapps(app.applicationDirPath(), pythonContext, pythonConsole);
// PythonQtScriptingConsole pythonConsole(NULL, pythonContext);
// CGoGN::SCHNApps::SCHNApps schnapps(app.applicationDirPath(), pythonContext, pythonConsole);
PythonQtScriptingConsole* pythonConsole = new PythonQtScriptingConsole(NULL, pythonContext);
CGoGN::SCHNApps::SCHNApps schnapps(app.applicationDirPath(), pythonContext, *pythonConsole);
schnapps.show();
pythonContext.addObject("schnapps", &schnapps);
......
......@@ -26,6 +26,7 @@
#include "plugin_processing.h"
#include "plugins_default_directory.h"
#include "Topology/generic/genericmap.h"
namespace CGoGN
{
......@@ -41,6 +42,8 @@ SCHNApps::SCHNApps(const QString& appPath, PythonQtObjectPtr& pythonContext, Pyt
m_firstView(NULL),
m_selectedView(NULL)
{
GenericMap::initAllStatics(&m_sp);
this->setupUi(this);
// create & setup control dock
......
......@@ -108,7 +108,8 @@ void View::unlinkPlugin(PluginInteraction* plugin)
{
plugin->unlinkView(this);
emit(pluginUnlinked(plugin));
updateGL();
// removed because of crash when application close
// updateGL();
}
}
......@@ -159,7 +160,8 @@ void View::unlinkMap(MapHandlerGen* map)
emit(mapUnlinked(map));
updateCurrentCameraBB();
updateGL();
// removed because of crash when application close
// updateGL();
disconnect(map->getFrame(), SIGNAL(modified()), this, SLOT(updateGL()));
disconnect(map, SIGNAL(selectedCellsChanged(CellSelectorGen*)), this, SLOT(updateGL()));
......
......@@ -106,7 +106,7 @@ void uniformOrientationCC(MAP& map, Dart faceSeed)
DartMarker<MAP> cmf(map);
cmf.markOrbit<FACE>(faceSeed);
cmf.template markOrbit<FACE>(faceSeed);
propag.push_back(faceSeed);
while (!propag.empty() || !propag_inv.empty())
......@@ -120,7 +120,7 @@ void uniformOrientationCC(MAP& map, Dart faceSeed)
do
{
Dart e = map.phi2(d);
if (map.isBoundaryMarked2(e))
if (map.template isBoundaryMarked<2>(e))
{
e = findOtherInCouplesOfDarts(couples,d);
if (e!=NIL)
......@@ -129,7 +129,7 @@ void uniformOrientationCC(MAP& map, Dart faceSeed)
{
propag_inv.push_back(e);
face2invert.push_back(e);
cmf.markOrbit<FACE>(e);
cmf.template markOrbit<FACE>(e);
}
cmf.mark(map.phi2(e));// use cmf also to mark boudary cycle to invert
}
......@@ -140,7 +140,7 @@ void uniformOrientationCC(MAP& map, Dart faceSeed)
if (!cmf.isMarked(e))
{
propag.push_back(e);
cmf.markOrbit<FACE>(e);
cmf.template markOrbit<FACE>(e);
}
}
d= map.phi1(d);
......@@ -157,7 +157,7 @@ void uniformOrientationCC(MAP& map, Dart faceSeed)
do
{
Dart e = map.phi2(d);
if (map.isBoundaryMarked2(e))
if (map.template isBoundaryMarked<2>(e))
{
e = findOtherInCouplesOfDarts(couples,d);
if (e!=NIL)
......@@ -165,7 +165,7 @@ void uniformOrientationCC(MAP& map, Dart faceSeed)
if (!cmf.isMarked(e))
{
propag.push_back(e);
cmf.markOrbit<FACE>(e);
cmf.template markOrbit<FACE>(e);
}
cmf.mark(map.phi2(d));// use cmf also to mark boudary cycle to invert
}
......@@ -176,7 +176,7 @@ void uniformOrientationCC(MAP& map, Dart faceSeed)
{
propag_inv.push_back(e);
face2invert.push_back(e);
cmf.markOrbit<FACE>(e);
cmf.template markOrbit<FACE>(e);
}
}
d= map.phi1(d); // traverse all edges of face
......@@ -195,7 +195,7 @@ void uniformOrientationCC(MAP& map, Dart faceSeed)
if (cmf.isMarked(e)) // check cmf for wrong orientation
{
reverse2MapFaceKeepPhi2<MAP>(map,e);
cmf.unmarkOrbit<FACE>(e);
cmf.template unmarkOrbit<FACE>(e);
}
}
......
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