1 #ifndef bwm_observable_textured_mesh_h_
2 #define bwm_observable_textured_mesh_h_
3 //:
4 // \file
5 
6 #include <iostream>
7 #include <iosfwd>
8 #include "bwm_observable_mesh.h"
9 
10 #include <bmsh3d/bmsh3d_textured_mesh_mc.h>
11 #include <bmsh3d/bmsh3d_textured_face_mc.h>
12 
13 #ifdef _MSC_VER
14 #  include <vcl_msvc_warnings.h>
15 #endif
16 
17 class bwm_observable_textured_mesh : public bwm_observable_mesh
18 {
19  public:
20 
type_name()21   std::string type_name() const {return "bwm_observable_textured_mesh"; }
22 
23   //: constructors
bwm_observable_textured_mesh()24   bwm_observable_textured_mesh()
25     : object_(nullptr)/*, base_(0)*/ {}
26 
bwm_observable_textured_mesh(bmsh3d_textured_mesh_mc * object)27   bwm_observable_textured_mesh(bmsh3d_textured_mesh_mc* object)
28     : object_(object) {}
29 
30   virtual ~bwm_observable_textured_mesh();
31 
tex_map_uri()32   std::string tex_map_uri() { bmsh3d_textured_face_mc* face = static_cast<bmsh3d_textured_face_mc*>(object_->facemap(0));return face->tex_map_uri(); }
33 
34   void save_gml(std::ostream &os, int obj_count, vpgl_lvcs* lvcs);
35 
36   void save_kml(std::ostream &os, int obj_count, vpgl_lvcs* lvcs,
37                 double ground_height, double x_offset, double y_offset );
38 
39   void save_kml_collada(std::ostream &os, vpgl_lvcs* lvcs,
40                         std::string geometry_id,
41                         std::string geometry_position_id,
42                         std::string geometry_position_array_id,
43                         std::string geometry_uv_id,
44                         std::string geometry_uv_array_id,
45                         std::string geometry_vertex_id,
46                         std::string material_name);
47 
48   void save_x3d(std::ostream &os, vpgl_lvcs* lvcs);
49 
50  private:
51 
52   bmsh3d_textured_mesh_mc* object_;
53 };
54 
55 #endif
56