// OiSurfPolygon.cpp #include "OiSurfPolygon.h" #include #include "trfzp/SurfPolygon.h" #include "Inventor/nodes/SoSeparator.h" #include "Inventor/nodes/SoTranslation.h" #include "oiext/SoPolygon.hpp" //********************************************************************** // Class initialization. void OiSurfPolygon::init_class() const { SoPolygon::initClass(); } //********************************************************************** // Generate OI representation. SoNode* OiSurfPolygon:: generate_representation(const Surface& srf, const OiSurfaceTraits traits) const { assert( srf.get_type() == SurfPolygon::get_static_type() ); const SurfPolygon& rsrf = dynamic_cast(srf); double zpos = rsrf.get_parameter(SurfZPlane::ZPOS); SurfPolygon::Points points = rsrf.get_vertices(); int ispace = traits.ispace; SoSeparator* psep = new SoSeparator; SoTranslation* ptrans = new SoTranslation; ptrans->translation.setValue(0.0,0.0,zpos); psep->addChild(ptrans); SoPolygon* psobj = new SoPolygon(points,ispace); psep->addChild(psobj); return psep; } //**********************************************************************