diff --git a/Apps/Examples/viewer.cpp b/Apps/Examples/viewer.cpp index a566c24c360cd015d59064db50fa9954b176a7ff..551c7b4bd6090dbc6ac1dec5d6895189920b9cff 100644 --- a/Apps/Examples/viewer.cpp +++ b/Apps/Examples/viewer.cpp @@ -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() ; diff --git a/Apps/Examples/volumeExplorer.cpp b/Apps/Examples/volumeExplorer.cpp index 023213b394aee82ff55742a078065d141fe5adff..208639175f49980c9b153a0c2bbe759ab8dd9f46 100644 --- a/Apps/Examples/volumeExplorer.cpp +++ b/Apps/Examples/volumeExplorer.cpp @@ -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(); diff --git a/SCHNApps/Plugins/surface_import/src/surface_import.cpp b/SCHNApps/Plugins/surface_import/src/surface_import.cpp index 5c4e088df29dba840ecb656570e3d053c2d5b089..7439b184816d5d48031a02db53f8905fbfb31e95 100644 --- a/SCHNApps/Plugins/surface_import/src/surface_import.cpp +++ b/SCHNApps/Plugins/surface_import/src/surface_import.cpp @@ -31,12 +31,6 @@ MapHandlerGen* Surface_Import_Plugin::importFromFile(const QString& fileName) if(fi.exists()) { MapHandlerGen* mhg = m_schnapps->addMap(fi.baseName(), 2); - - std::cout << "IMPORT PLUGIN 2" << std::endl; - std::cout << "PTR="<< GenericMap::s_instances<< std::endl; - for (auto inst : *GenericMap::s_instances) - std::cout << inst<< std::endl; - if(mhg) { MapHandler* mh = static_cast*>(mhg); diff --git a/SCHNApps/src/main.cpp b/SCHNApps/src/main.cpp index e4c2be66bcbd0116ae6f93800d34aa0230f5e675..9ff849bb1832ec98072b026e17e13147dba76a05 100644 --- a/SCHNApps/src/main.cpp +++ b/SCHNApps/src/main.cpp @@ -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); diff --git a/SCHNApps/src/view.cpp b/SCHNApps/src/view.cpp index 817204366fc6168d4ac6cb5937d06a21ebfcd6b7..e758b2f39110c74db0830b80fa006b2dccdbe03e 100644 --- a/SCHNApps/src/view.cpp +++ b/SCHNApps/src/view.cpp @@ -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())); diff --git a/include/Algo/Topo/Map2/uniformOrientation.hpp b/include/Algo/Topo/Map2/uniformOrientation.hpp index ce016a0df623cfe24d3abd44551f548869a4f8f9..b52e1dc260042e763f2431a20216748f0c9bf606 100644 --- a/include/Algo/Topo/Map2/uniformOrientation.hpp +++ b/include/Algo/Topo/Map2/uniformOrientation.hpp @@ -106,7 +106,7 @@ void uniformOrientationCC(MAP& map, Dart faceSeed) DartMarker cmf(map); - cmf.markOrbit(faceSeed); + cmf.template markOrbit(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(e); + cmf.template markOrbit(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(e); + cmf.template markOrbit(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(e); + cmf.template markOrbit(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(e); + cmf.template markOrbit(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,e); - cmf.unmarkOrbit(e); + cmf.template unmarkOrbit(e); } } diff --git a/include/Utils/Shaders/shaderFlat.geom b/include/Utils/Shaders/shaderFlat.geom index 514db96c9bcd93806430b9b975fa16e67bf0ec8f..9f516ba26e6efc3076664a77dc21ab683b174d08 100644 --- a/include/Utils/Shaders/shaderFlat.geom +++ b/include/Utils/Shaders/shaderFlat.geom @@ -16,13 +16,13 @@ void main(void) N = normalize (vec3(NormalMatrix*vec4(N,0.0))); vec3 center = POSITION_IN(0).xyz + POSITION_IN(1).xyz + POSITION_IN(2).xyz; center /= 3.0; - vec4 newPos = ModelViewMatrix * vec4(center,0.0); + vec4 newPos = ModelViewMatrix * vec4(center,1.0); vec3 L = normalize (lightPosition - newPos.xyz); float lambertTerm = dot(N,L); - ColorFS = ambient; + ColorFS = ambient; - if(lambertTerm > 0.0) - ColorFS += diffuse * lambertTerm; + if(lambertTerm > 0.0) + ColorFS += diffuse * lambertTerm; int i; for(i=0; i< NBVERTS_IN; i++) diff --git a/src/Utils/GLSLShader.cpp b/src/Utils/GLSLShader.cpp index f030e2f70bbff9b9b152a2e6c8aaa382d62aaa6e..5948a9d65da353eedfa774c11325251badc403d7 100644 --- a/src/Utils/GLSLShader.cpp +++ b/src/Utils/GLSLShader.cpp @@ -148,10 +148,35 @@ bool GLSLShader::areGeometryShadersSupported() bool GLSLShader::areShadersSupported() { - if ( ! glewGetExtension("GL_ARB_vertex_shader")) return false; - if ( ! glewGetExtension("GL_ARB_fragment_shader")) return false; - if ( ! glewGetExtension("GL_ARB_shader_objects")) return false; - if ( ! glewGetExtension("GL_ARB_shading_language_100")) return false; + if ( ! glewIsSupported("GL_ARB_vertex_shader")) + { + CGoGNerr << " vertex shaders not supported!" <bind(); for (std::vector::const_iterator it = m_va_vbo_binding.begin(); it != m_va_vbo_binding.end(); ++it) { + assert(((it->vbo_ptr->nbElts()==0) || (it->vbo_ptr->dataSize()!=0) ) || !"dataSize of VBO is 0 ! could not draw"); glBindBuffer(GL_ARRAY_BUFFER, it->vbo_ptr->id()); glEnableVertexAttribArray(it->va_id); - assert((it->vbo_ptr->dataSize()!=0) || !"dataSize of VBO is 0 ! could not draw"); glVertexAttribPointer(it->va_id, it->vbo_ptr->dataSize(), GL_FLOAT, false, stride, (const GLvoid*)((unsigned long)(begin))); } // this->unbind(); diff --git a/src/Utils/Qt/qtgl.cpp b/src/Utils/Qt/qtgl.cpp index 8b8214ecf106972d61bcb7da6c2c62cb09311db2..9d3b1021e2106eeee60c1497878cde9d80c85873 100644 --- a/src/Utils/Qt/qtgl.cpp +++ b/src/Utils/Qt/qtgl.cpp @@ -193,7 +193,6 @@ glm::vec3& GLWidget::getObjPos() void GLWidget::initializeGL() { - std::cout << "GL VERSION = "<< glGetString(GL_VERSION)<< std::endl; glEnable(GL_DEPTH_TEST); if (m_cbs)