- inline const point_list& get_wgs84_nodes() const { return wgs84_nodes; }
- inline void set_wgs84_nodes( const point_list& n ) { wgs84_nodes = n; }
-
- inline const point_list& get_colors() const { return colors; }
- inline void set_colors( const point_list& c ) { colors = c; }
-
- inline const point_list& get_normals() const { return normals; }
- inline void set_normals( const point_list& n ) { normals = n; }
-
- inline const point_list& get_texcoords() const { return texcoords; }
- inline void set_texcoords( const point_list& t ) { texcoords = t; }
+ inline const std::vector<SGVec3d>& get_wgs84_nodes() const
+ { return wgs84_nodes; }
+ inline void set_wgs84_nodes( const std::vector<SGVec3d>& n )
+ { wgs84_nodes = n; }
+ inline void set_wgs84_nodes( const point_list& n )
+ {
+ wgs84_nodes.resize(n.size());
+ for (unsigned i = 0; i < wgs84_nodes.size(); ++i)
+ wgs84_nodes[i] = n[i].toSGVec3d();
+ }
+
+ inline const std::vector<SGVec4f>& get_colors() const { return colors; }
+ inline void set_colors( const std::vector<SGVec4f>& c ) { colors = c; }
+ inline void set_colors( const point_list& c )
+ {
+ colors.resize(c.size());
+ for (unsigned i = 0; i < colors.size(); ++i)
+ colors[i] = SGVec4f(c[i].toSGVec3f(), 1);
+ }
+
+ inline const std::vector<SGVec3f>& get_normals() const { return normals; }
+ inline void set_normals( const std::vector<SGVec3f>& n ) { normals = n; }
+ inline void set_normals( const point_list& n )
+ {
+ normals.resize(n.size());
+ for (unsigned i = 0; i < normals.size(); ++i)
+ normals[i] = n[i].toSGVec3f();
+ }
+
+ inline const std::vector<SGVec2f>& get_texcoords() const { return texcoords; }
+ inline void set_texcoords( const std::vector<SGVec2f>& t ) { texcoords = t; }
+ inline void set_texcoords( const point_list& t )
+ {
+ texcoords.resize(t.size());
+ for (unsigned i = 0; i < texcoords.size(); ++i)
+ texcoords[i] = t[i].toSGVec2f();
+ }