1 #ifndef R2C2_3D_CATALOGUE_H_
2 #define R2C2_3D_CATALOGUE_H_
4 #include <msp/datafile/collection.h>
5 #include <msp/datafile/directorysource.h>
6 #include <msp/gl/mesh.h>
7 #include <msp/gl/resources.h>
8 #include "libr2c2/catalogue.h"
15 class Catalogue3D: public Msp::GL::Resources
18 typedef std::map<const ObjectType *, ObjectType3D *> ObjectMap;
19 typedef std::map<const TrackAppearance *, Msp::GL::Mesh *> EndpointMap;
23 EndpointMap endpoint_meshes;
26 Catalogue3D(Catalogue &);
29 const Catalogue &get_catalogue() const { return catalogue; }
31 const ObjectType3D &get_3d(const ObjectType &);
32 const ObjectType3D &get_3d(const ObjectType &) const;
35 const typename TypeMap3D<T>::Type3D &get_3d(const T &ot) const
36 { return dynamic_cast<const typename TypeMap3D<T>::Type3D &>(get_3d(static_cast<const ObjectType &>(ot))); }
39 const typename TypeMap3D<T>::Type3D &get_3d(const T &ot)
40 { return dynamic_cast<const typename TypeMap3D<T>::Type3D &>(get_3d(static_cast<const ObjectType &>(ot))); }
43 void build_endpoint_mesh(const TrackAppearance &);
45 const Msp::GL::Mesh &get_endpoint_mesh(const TrackAppearance &);
46 const Msp::GL::Mesh &get_endpoint_mesh(const TrackAppearance &) const;