38 #include <GLUT/glut.h>
45 #include "attribute-vertex.hh"
53 using namespace GMap3d;
59 Euclidian_View::Euclidian_View(CGMap * GM)
75 void Euclidian_View::Wire_Draw()
82 int markEdge = G->getNewMark();
91 CDynamicCoverageAll C(G);
92 for (C.reinit(); C.cont(); C++)
96 if (!G->isMarked(dgm, markEdge))
100 p1 = (CAttributeVertex*)alpha;
111 glVertex3f(p1->getX(), p1->getY(), p1->getZ());
116 G->setMark(dgm, markEdge);
123 alpha = G->getAttribute(G->alpha0(dgm), ORBIT_123,
125 p2 = (CAttributeVertex*)alpha;
153 glVertex3f(p1->getX(), p1->getY(), p1->getZ());
154 glVertex3f(p2->getX(), p2->getY(), p2->getZ());
160 CCoverage* DC = G->getDynamicCoverage(dgm, ORBIT_023);
164 G->setMark(**DC, markEdge);
171 for (C.reinit(); C.cont(); C++)
172 G->unsetMark(*C, markEdge);
173 G->freeMark(markEdge);
189 void Euclidian_View::Solid_Draw()
197 int markFace = G->getNewMark();
201 glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE);
202 glShadeModel(GL_SMOOTH);
207 CDynamicCoverageAll C(G);
208 for (C.reinit(); C.cont(); C++)
212 if (!G->isMarked(dgm, markFace))
219 p1 = (CAttributeVertex*)alpha;
224 glVertex3f(p1->getX(), p1->getY(), p1->getZ());
229 G->setMark(dgm, markFace);
241 CCoverage* DC01 = G->getDynamicCoverage(dgm, ORBIT_01);
248 if (!G->isMarked(d01, markFace))
251 alpha = G->getAttribute(d01, ORBIT_123,
253 p1 = (CAttributeVertex*)alpha;
255 alpha = G->getAttribute(G->alpha0(d01), ORBIT_123,
257 p2 = (CAttributeVertex*)alpha;
259 glVertex3f(p1->getX(), p1->getY(), p1->getZ());
260 glVertex3f(p2->getX(), p2->getY(), p2->getZ());
263 G->setMark(d01, markFace);
264 G->setMark(G->alpha0(d01), markFace);
276 list<CVertex*> ptList;
280 CCoverage* DC01 = G->getDynamicCoverage(dgm, ORBIT_01);
287 if (!G->isMarked(d01, markFace))
290 alpha = G->getAttribute(d01, ORBIT_123,
294 ptList.push_front((CAttributeVertex*)alpha);
299 G->setMark(d01, markFace);
300 G->setMark(G->alpha1(d01), markFace);
304 if (!G->isFree3(d01))
306 G->setMark(G->alpha3(d01), markFace);
307 G->setMark(G->alpha3(G->alpha1(d01)),markFace);
317 list<CVertex*>::iterator iter;
319 for(iter=ptList.begin();iter!=ptList.end() && i<3; iter++)
331 glEnable(GL_LIGHTING);
335 glNormal3f(normal.getX(),
339 for (iter=ptList.begin();
343 CVertex *curPt = *iter;
344 glVertex3f(curPt->getX(),
351 glDisable(GL_LIGHTING);
359 list<CVertex*>::iterator iter;
361 for(iter=ptList.begin();iter!=ptList.end() && i<2; iter++)
367 glVertex3f(p1->getX(), p1->getY(), p1->getZ());
369 glVertex3f(p1->getX(), p1->getY(), p1->getZ());
381 for (C.reinit(); C.cont(); C++)
382 G->unsetMark(*C, markFace);
383 G->freeMark(markFace);
387 glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_FALSE);
388 glShadeModel(GL_FLAT);