Commit bb14948f authored by Thomas Pitiot 's avatar Thomas Pitiot

some change

parent 9d618d97
......@@ -57,8 +57,8 @@ public:
bool removeGeneralNeighbor (Dart d);
std::vector<Dart> * belonging_cells;
std::vector<Dart> * neighbor_cells;
std::vector< std::vector<Dart> > belonging_cells;
std::vector< std::vector<Dart> > neighbor_cells;
std::vector<std::pair<Dart, int> > general_belonging;
std::vector<std::pair<Dart, int> > general_neighbors;
......
......@@ -11,8 +11,8 @@ ArticulatedObject::ArticulatedObject() :
,nbEdges(0u)
,parts_(std::vector<PARTICULE*>())
,Segments_(std::vector<Segment *>())
,belonging_cells(NULL)
,neighbor_cells(NULL)
,belonging_cells(std::vector<std::vector<Dart>>())
,neighbor_cells(std::vector<std::vector<Dart>>())
, width(0.)
, sim_(NULL)
,index_articulated(0u)
......
......@@ -286,7 +286,6 @@ void EnvMap::FirstRegistrationSegment(Segment * o)// réenregistre l'Segment en
if(memo.size() == 1u)
{
std::cout << "COUCOU !! " << std::endl;
pushAOneCellSegment(o , d1);
}
else
......
......@@ -26,8 +26,8 @@ void Simulator::init(int argc, char **argv)
else
Needle_or_knife=true;
// initFixedObjects();
initSurfaces();
initFixedObjects();
// initSurfaces();
initMovingObject();
// initEmptyMovingObject();
......@@ -60,20 +60,20 @@ void Simulator::initFixedObjects()
p.second=envMap_.getBelongingCell(pos);
startingPoints.push_back(p);
pos=VEC3(-4.68,1.36,2.15);
pos=VEC3(1.23,1.36,2.15);
p.first=pos;
p.second=envMap_.getBelongingCell(pos);
startingPoints.push_back(p);
pos=VEC3(4,-2,3);
p.first=pos;
p.second=envMap_.getBelongingCell(pos);
startingPoints.push_back(p);
// pos=VEC3(4,-2,3);
// p.first=pos;
// p.second=envMap_.getBelongingCell(pos);
// startingPoints.push_back(p);
pos=VEC3(1,-1,1);
p.first=pos;
p.second=envMap_.getBelongingCell(pos);
startingPoints.push_back(p);
// pos=VEC3(1,-1,1);
// p.first=pos;
// p.second=envMap_.getBelongingCell(pos);
// startingPoints.push_back(p);
// pos=VEC3(2,-2.5f,0.5f);
// p.first=pos;
......@@ -84,13 +84,13 @@ void Simulator::initFixedObjects()
ind.second=1;
segmentParts.push_back(ind);
ind.first=2;
ind.second=3;
segmentParts.push_back(ind);
// ind.first=2;
// ind.second=3;
// segmentParts.push_back(ind);
ind.first=0;
ind.second=2;
segmentParts.push_back(ind);
// ind.first=0;
// ind.second=2;
// segmentParts.push_back(ind);
// ind.first=0;
// ind.second=4;
// segmentParts.push_back(ind);
......
......@@ -44,8 +44,6 @@ Surface::Surface(Simulator* sim,VEC3 offset):
{
nbTriangles ++;
}
belonging_cells = new std::vector<Dart>[nbTriangles];
neighbor_cells = new std::vector<Dart>[nbTriangles];
......
......@@ -386,12 +386,12 @@ void Volusion::displayMO()
if(val_comboEdge==0)
{
for(unsigned int i =0;i<simul.aiguille->nbEdges;i++)
for(auto vect : simul.aiguille->belonging_cells)
{
// m_topo_render->overdrawDart(simul.aiguille->parts_[i]->d,10.0f,1.0f,0,0);
for(auto it = simul.aiguille->belonging_cells[i].begin(); it !=simul.aiguille->belonging_cells[i].end();++it)
for(Dart it : vect)
{
for (Edge d : edgesIncidentToVolume3(simul.envMap_.map,(*it)))
for (Edge d : edgesIncidentToVolume3(simul.envMap_.map,it))
{
m_topo_render->overdrawDart(d,5.0f,0,1.0f,0);
......@@ -408,10 +408,10 @@ void Volusion::displayMO()
// m_topo_render->overdrawDart(simul.aiguille->parts_[val_comboEdge-1]->d,10.0f,1.0f,0,0);
// m_topo_render->overdrawDart(simul.aiguille->parts_[val_comboEdge]->d,10.0f,1.0f,0,0);
int i = val_comboEdge-1;
for(auto it = simul.aiguille->belonging_cells[i].begin(); it !=simul.aiguille->belonging_cells[i].end();++it)
for(Dart it : simul.aiguille->belonging_cells[i])
{
for (Edge d : edgesIncidentToVolume3(simul.envMap_.map,(*it)))
for (Edge d : edgesIncidentToVolume3(simul.envMap_.map,(it)))
{
m_topo_render->overdrawDart(d,5.0f,0,1.0f,0);
......@@ -428,12 +428,12 @@ void Volusion::displayMO()
m_topo_render->updateData(simul.envMap_.map, simul.envMap_.position, 0.8f, 0.8f, 0.8f);
if(val_comboEdge==0)
{
for(unsigned int i =0;i<simul.aiguille->nbEdges;i++)
for(auto vect : simul.aiguille->neighbor_cells)
{
for(auto it = simul.aiguille->neighbor_cells[i].begin(); it !=simul.aiguille->neighbor_cells[i].end();++it)
// m_topo_render->overdrawDart(simul.aiguille->parts_[i]->d,10.0f,1.0f,0,0);
for(Dart it : vect)
{
for (Edge d : edgesIncidentToVolume3(simul.envMap_.map,(*it)))
for (Edge d : edgesIncidentToVolume3(simul.envMap_.map,(it)))
{
m_topo_render->overdrawDart(d,5.0f,1.0f,0.0f,0.8f);
......@@ -447,9 +447,9 @@ void Volusion::displayMO()
else
{
int i = val_comboEdge-1;
for(auto it = simul.aiguille->neighbor_cells[i].begin(); it !=simul.aiguille->neighbor_cells[i].end();++it)
for(Dart it : simul.aiguille->neighbor_cells[i])
{
for (Edge d : edgesIncidentToVolume3(simul.envMap_.map,(*it)))
for (Edge d : edgesIncidentToVolume3(simul.envMap_.map,(it)))
{
m_topo_render->overdrawDart(d,5.0f,1.0f,0.0f,0.8f);
}
......@@ -551,12 +551,12 @@ void Volusion::displayObj()
m_topo_render->updateData(simul.envMap_.map, simul.envMap_.position, 0.8f, 0.8f, 0.8f);
for (ArticulatedObject * o : simul.objects)
{
for(unsigned int i =0;i<o->nbEdges;i++)
for(auto vect : o->belonging_cells)
{
// m_topo_render->overdrawDart(simul.aiguille->parts_[i]->d,10.0f,1.0f,0,0);
for(auto it = o->belonging_cells[i].begin(); it !=o->belonging_cells[i].end();++it)
for(Dart it : vect)
{
for (Edge d : edgesIncidentToVolume3(simul.envMap_.map,(*it)))
for (Edge d : edgesIncidentToVolume3(simul.envMap_.map,(it)))
{
m_topo_render->overdrawDart(d,5.0f,0.0f,0.6f,0.4f);
}
......@@ -573,9 +573,9 @@ void Volusion::displayObj()
// for(unsigned int i =0;i<o->nbTriangles;i++)
{
// m_topo_render->overdrawDart(simul.aiguille->parts_[i]->d,10.0f,1.0f,0,0);
for(auto it = o->belonging_cells[i].begin(); it !=o->belonging_cells[i].end();++it)
for(Dart it : o->belonging_cells[i])
{
for (Edge d : edgesIncidentToVolume3(simul.envMap_.map,(*it)))
for (Edge d : edgesIncidentToVolume3(simul.envMap_.map,(it)))
{
m_topo_render->overdrawDart(d,5.0f,0.0f,0.6f,0.4f);
}
......
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