#pragma once
#include <config.h>
#ifdef HAVE_OSG
#include "GUIOSGView.h"
#include <map>
namespace osg {
class Node;
class Group;
class PositionAttitudeTransform;
}
namespace osgUtil {
class Tessellator;
}
class MSVehicleType;
class MSEdge;
class GUIJunctionWrapper;
class SUMOPolygon;
class PointOfInterest;
class GUIOSGBuilder {
public:
static osg::Group* buildOSGScene(osg::Node* const tlg, osg::Node* const tly, osg::Node* const tlr, osg::Node* const tlu, osg::Node* const pole);
static void buildDecal(const GUISUMOAbstractView::Decal& d, osg::Group& addTo);
static void buildLight(const GUISUMOAbstractView::Decal& d, osg::Group& addTo);
static void buildTrafficLightDetails(MSTLLogicControl::TLSLogicVariants& vars, osg::Node* const tlg, osg::Node* const tly, osg::Node* const tlr, osg::Node* const tlu, osg::Node* poleBase, osg::Group& addTo);
static osg::PositionAttitudeTransform* getTrafficLight(const GUISUMOAbstractView::Decal& d, MSTLLogicControl::TLSLogicVariants& vars, const MSLink* link, osg::Node* const tlg,
osg::Node* const tly, osg::Node* const tlr, osg::Node* const tlu, osg::Node* const pole, const bool withPole = false, const double size = -1, double poleHeight = 1.8, double transparency = .3);
static GUIOSGView::OSGMovable buildMovable(const MSVehicleType& type);
static osg::Node* buildPlane(const float length = 1000.f);
private:
static osg::PositionAttitudeTransform* createTrafficLightState(const GUISUMOAbstractView::Decal& d, osg::Node* tl, const double withPole, const double size, osg::Vec4d color);
static void buildOSGEdgeGeometry(const MSEdge& edge,
osg::Group& addTo, osgUtil::Tessellator& tessellator);
static void buildOSGJunctionGeometry(GUIJunctionWrapper& junction,
osg::Group& addTo, osgUtil::Tessellator& tessellator);
static void buildPolygonGeometry(const SUMOPolygon& poly, osg::Group& addTo, osgUtil::Tessellator& tessellator);
static void buildPoIGeometry(const PointOfInterest& poi, osg::Group& addTo, osgUtil::Tessellator& tessellator);
static void setShapeState(osg::ref_ptr<osg::ShapeDrawable> shape);
static std::map<std::string, osg::ref_ptr<osg::Node> > myCars;
};
#endif