Création d'un compte pour un collaborateur extérieur au laboratoire depuis l'intranet ICube : https://intranet.icube.unistra.fr/fr/labs/member/profile

Commit 4eff38ed by Pierre Kraemer

occluding contours v1

parent d204e178
 ... ... @@ -37,9 +37,9 @@ namespace Geometry template typename PFP::REAL triangleArea(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& position) { typename PFP::VEC3 p1 = position[d]; typename PFP::VEC3 p2 = position[map.phi1(d)]; typename PFP::VEC3 p3 = position[map.phi_1(d)]; typename PFP::VEC3 p1 = position[d] ; typename PFP::VEC3 p2 = position[map.phi1(d)] ; typename PFP::VEC3 p3 = position[map.phi_1(d)] ; return Geom::triangleArea(p1, p2, p3) ; } ... ... @@ -47,7 +47,7 @@ typename PFP::REAL triangleArea(typename PFP::MAP& map, Dart d, const typename P template typename PFP::REAL convexFaceArea(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& position) { typedef typename PFP::VEC3 VEC3; typedef typename PFP::VEC3 VEC3 ; if(map.isFaceTriangle(d)) return triangleArea(map, d, position) ; ... ... @@ -58,8 +58,8 @@ typename PFP::REAL convexFaceArea(typename PFP::MAP& map, Dart d, const typename Dart it = d ; do { VEC3 p1 = position[it]; VEC3 p2 = position[map.phi1(it)]; VEC3 p1 = position[it] ; VEC3 p2 = position[map.phi1(it)] ; area += Geom::triangleArea(p1, p2, centroid) ; it = map.phi1(it) ; } while (it != d) ; ... ...
 ... ... @@ -35,7 +35,10 @@ namespace Geometry { template void featureEdgeDetection(typename PFP::MAP& map, const typename PFP::TVEC3& position, DartMarker& feature) ; void featureEdgeDetection(typename PFP::MAP& map, const typename PFP::TVEC3& position, CellMarker& featureEdge) ; template std::vector occludingContoursDetection(typename PFP::MAP& map, const typename PFP::VEC3& viewDir, const typename PFP::TVEC3& position, const typename PFP::TVEC3& normal) ; } // namespace Geometry ... ...
 ... ... @@ -35,28 +35,83 @@ namespace Geometry { template void featureEdgeDetection(typename PFP::MAP& map, typename PFP::TVEC3& position, DartMarker& feature) void featureEdgeDetection(typename PFP::MAP& map, typename PFP::TVEC3& position, CellMarker& featureEdge) { typedef typename PFP::VEC3 VEC3 ; typedef typename PFP::REAL REAL ; feature.unmarkAll() ; featureEdge.unmarkAll() ; AttributeHandler fNormal = map.template addAttribute(FACE, "fNormal") ; AttributeHandler fNormal = map.template getAttribute(FACE, "normal") ; if(!fNormal.isValid()) fNormal = map.template addAttribute(FACE, "normal") ; Algo::Geometry::computeNormalFaces(map, position, fNormal) ; DartMarker m(map) ; CellMarker m(map, EDGE) ; for(Dart d = map.begin(); d != map.end(); map.next(d)) { if(!m.isMarked(d)) { m.markOrbit(EDGE, d) ; m.mark(d) ; if(Geom::angle(fNormal[d], fNormal[map.phi2(d)]) > M_PI / REAL(6)) feature.markOrbit(EDGE, d) ; featureEdge.mark(d) ; } } map.template removeAttribute(fNormal) ; // map.template removeAttribute(fNormal) ; } template std::vector occludingContoursDetection(typename PFP::MAP& map, const typename PFP::VEC3& viewDir, const typename PFP::TVEC3& position, const typename PFP::TVEC3& normal) { typedef typename PFP::VEC3 VEC3 ; typedef typename PFP::REAL REAL ; std::vector occludingContours ; CellMarker m(map, FACE) ; for(Dart d = map.begin(); d != map.end(); map.next(d)) { if(!m.isMarked(d)) { m.mark(d) ; REAL dp1 = viewDir * normal[d] ; REAL dp2 = viewDir * normal[map.phi1(d)] ; REAL dp3 = viewDir * normal[map.phi_1(d)] ; if(dp1 < 0 && dp2 > 0) { REAL alpha = -dp1 / (-dp1 + dp2) ; occludingContours.push_back(alpha * position[d] + (1 - alpha) * position[map.phi1(d)]) ; } if(dp2 < 0 && dp1 > 0) { REAL alpha = dp1 / (dp1 - dp2) ; occludingContours.push_back(alpha * position[d] + (1 - alpha) * position[map.phi1(d)]) ; } if(dp1 < 0 && dp3 > 0) { REAL alpha = -dp1 / (-dp1 + dp3) ; occludingContours.push_back(alpha * position[d] + (1 - alpha) * position[map.phi_1(d)]) ; } if(dp3 < 0 && dp1 > 0) { REAL alpha = dp1 / (dp1 - dp3) ; occludingContours.push_back(alpha * position[d] + (1 - alpha) * position[map.phi_1(d)]) ; } if(dp2 < 0 && dp3 > 0) { REAL alpha = -dp2 / (-dp2 + dp3) ; occludingContours.push_back(alpha * position[map.phi1(d)] + (1 - alpha) * position[map.phi_1(d)]) ; } if(dp3 < 0 && dp2 > 0) { REAL alpha = dp2 / (dp2 - dp3) ; occludingContours.push_back(alpha * position[map.phi1(d)] + (1 - alpha) * position[map.phi_1(d)]) ; } } } return occludingContours ; } } // namespace Geometry ... ...
 ... ... @@ -81,7 +81,7 @@ void pliantRemeshing(typename PFP::MAP& map, typename PFP::TVEC3& position, type } // compute feature edges DartMarker featureEdge(map) ; CellMarker featureEdge(map, EDGE) ; Algo::Geometry::featureEdgeDetection(map, position, featureEdge) ; // compute feature vertices ... ...
 ... ... @@ -169,7 +169,7 @@ void BoundingBox::fusion(const BoundingBox& bb) { VEC bbmin = bb.min() ; VEC bbmax = bb.max() ; for(unsigned int i = 0; i < bbmin.size(); ++i) for(unsigned int i = 0; i < bbmin.dimension(); ++i) { if(bbmin[i] < m_pMin[i]) m_pMin[i] = bbmin[i] ; ... ...
 ... ... @@ -910,14 +910,13 @@ void GLSLShader::addPathFileSeach(const std::string& path) m_pathes.push_back(path); } unsigned int GLSLShader::bindVA_VBO(const std::string& name, VBO* vbo) { GLint idVA = glGetAttribLocation(this->m_program_object, name.c_str()); //valid ? if (idVA < 0) { CGoGNerr << "GLSLShader: Attribute "<m_program_object, name.c_str()); ... ... @@ -971,9 +965,6 @@ void GLSLShader::unbindVA(const std::string& name) CGoGNerr << "GLSLShader: Attribute "<unbind(); } void GLSLShader::updateCurrentMatrices() { glm::mat4 model(currentModelView()); ... ... @@ -1036,9 +1026,6 @@ void GLSLShader::updateCurrentMatrices() it->second->updateMatrices(currentProjection(), model); } } // namespace Utils } // namespace CGoGN
 ... ... @@ -316,9 +316,9 @@ GLfloat SimpleQT::getOrthoScreenRay(int x, int y, Geom::Vec3f& rayA, Geom::Vec3f GLfloat depth_t[25]; glReadPixels(x-2, yy-2, 5, 5, GL_DEPTH_COMPONENT, GL_FLOAT, depth_t); GLfloat depth=0.0f; unsigned int nb=0; for (unsigned int i=0; i< 25; ++i) GLfloat depth = 0.0f; unsigned int nb = 0; for (unsigned int i = 0; i < 25; ++i) { if (depth_t[i] != 1.0f) { ... ... @@ -326,7 +326,7 @@ GLfloat SimpleQT::getOrthoScreenRay(int x, int y, Geom::Vec3f& rayA, Geom::Vec3f nb++; } } if (nb>0) if (nb > 0) depth /= float(nb); else depth = 0.5f; ... ...
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!