示例#1
0
	Slice* Mesh::getSlice()
	{
		Slice *s = new Slice();
		Contour *c = new Contour();
		
		while (!segments.empty())
        {
            segIt = segments.begin();
            std::string lbl = static_cast<Point*>(segIt->second->getGeometry(0))->getLabel();
			
            while (segments.count(lbl))
            {				
				//if (lbl.compare("50.79235|15.27517|75.54418") == 0)
//					std::cout << lbl << std::endl;
				Rect *l = segments[lbl];
				c->addGeometry(l);
				segments.erase(segments.find(lbl));
				Point *p2 = static_cast<Point*>(l->getGeometry(1));
				lbl = p2->getLabel();
            }
            c->setInterface(new Graphics(static_cast<GraphicsImp*>(new OpenGLImp())));
			s->addGeometry(c);
			c = new Contour();
        } 
		
		return s;
	}