Commit bc3fdd63 authored by Pierre Kraemer's avatar Pierre Kraemer

Merge cgogn:~jund/CGoGN

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