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

Merge cgogn:~jund/CGoGN

parents d4283bc0 5b0bb7a3
...@@ -218,18 +218,21 @@ Dart EnvMap::getBelongingCell(const PFP::VEC3& pos) ...@@ -218,18 +218,21 @@ Dart EnvMap::getBelongingCell(const PFP::VEC3& pos)
void EnvMap::insertObstacleOfFace(PFP::AGENTS agents,const Dart d) void EnvMap::insertObstacleOfFace(PFP::AGENTS agents,const Dart d)
{ {
Dart dd =d; if(map.getDartLevel(map.faceOldestDart(d))==0) {
do {
if(closeMark.isMarked(dd) /*&& (position[map.phi2(dd)][2]==0.0 || position[map.phi1(map.phi2(dd))][2] ==0.0f)*/) { Dart dd =d;
for(PFP::AGENTS::iterator it=agents.begin(); it!= agents.end(); ++it) { do {
// if(leftOf((*it)->part->m_position,position[dd],position[map.phi1(dd)])<0.0f) { if(closeMark.isMarked(dd) /*&& (position[map.phi2(dd)][2]==0.0 || position[map.phi1(map.phi2(dd))][2] ==0.0f)*/) {
(*it)->insertObstacleNeighbor(dd); for(PFP::AGENTS::iterator it=agents.begin(); it!= agents.end(); ++it) {
// } // if(leftOf((*it)->part->m_position,position[dd],position[map.phi1(dd)])<0.0f) {
(*it)->insertObstacleNeighbor(dd);
// }
}
// return;
} }
// return; dd = map.phi1(dd);
} } while (dd!=d);
dd = map.phi1(dd); }
} while (dd!=d);
} }
void EnvMap::getAllFacesOfAgents(Dart d) void EnvMap::getAllFacesOfAgents(Dart d)
......
...@@ -75,10 +75,9 @@ void ParticleCell2D<PFP>::vertexState(const VEC3& current) ...@@ -75,10 +75,9 @@ void ParticleCell2D<PFP>::vertexState(const VEC3& current)
} }
else { else {
//orientation step //orientation step
if(m_positions[d][0]==m_positions[m.phi1(d)][0] && m_positions[d][1]==m_positions[m.phi1(d)][1])
d=m.alpha1(d);
if(getOrientationEdge(current,m.alpha1(d))!=Geom::RIGHT) { if(getOrientationEdge(current,m.alpha1(d))!=Geom::RIGHT) {
if(m_positions[d][0]==m_positions[m.phi1(d)][0] && m_positions[d][1]==m_positions[m.phi1(d)][1])
d=m.alpha1(d);
Dart dd_vert = d; Dart dd_vert = d;
do { do {
d = m.alpha1(d); d = m.alpha1(d);
...@@ -100,21 +99,24 @@ void ParticleCell2D<PFP>::vertexState(const VEC3& current) ...@@ -100,21 +99,24 @@ void ParticleCell2D<PFP>::vertexState(const VEC3& current)
} }
} }
else { else {
if(m_positions[d][0]==m_positions[m.phi1(d)][0] && m_positions[d][1]==m_positions[m.phi1(d)][1]) std::cout << "ploc" << std::endl;
d=m.alpha1(d);
Dart dd_vert = m.alpha1(d); Dart dd_vert = m.alpha1(d);
while(getOrientationEdge(current,d)==Geom::RIGHT && dd_vert!=d) { while(getOrientationEdge(current,d)==Geom::RIGHT && dd_vert!=d) {
std::cout << "tourne" << std::endl;
d = m.alpha_1(d); d = m.alpha_1(d);
if(m_positions[d][0]==m_positions[m.phi1(d)][0] && m_positions[d][1]==m_positions[m.phi1(d)][1]) if(m_positions[d][0]==m_positions[m.phi1(d)][0] && m_positions[d][1]==m_positions[m.phi1(d)][1]) {
d=m.alpha_1(d); d=m.alpha_1(d);
}
} }
} }
//displacement step //displacement step
// if(!obstacle.isMarked(d)) { // if(!obstacle.isMarked(d)) {
if(getOrientationEdge(current,d)==Geom::ALIGNED) if(getOrientationEdge(current,d)==Geom::ALIGNED && Algo::Geometry::isPointOnHalfEdge<PFP>(m,d,m_positions,current)) {
std::cout << m.vertexDegree(d) << std::endl;
edgeState(current); edgeState(current);
}
else { else {
d = m.phi1(d); d = m.phi1(d);
faceState(current); faceState(current);
...@@ -200,7 +202,6 @@ void ParticleCell2D<PFP>::faceState(const VEC3& current) ...@@ -200,7 +202,6 @@ void ParticleCell2D<PFP>::faceState(const VEC3& current)
edgeState(current); edgeState(current);
return; return;
case Geom::RIGHT : case Geom::RIGHT :
std::cout << std::setprecision(10);
std::cout << "smthg went bad " << m_position << " " << current << std::endl; std::cout << "smthg went bad " << m_position << " " << current << std::endl;
std::cout << "d1 " << m_positions[d] << " d2 " << m_positions[m.phi1(d)] << std::endl; std::cout << "d1 " << m_positions[d] << " d2 " << m_positions[m.phi1(d)] << std::endl;
m_position = intersectLineEdge(current,m_position,d); m_position = intersectLineEdge(current,m_position,d);
......
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