1 #ifndef bwm_io_structs_h_
2 #define bwm_io_structs_h_
3 
4 #include <iostream>
5 #include <string>
6 #ifdef _MSC_VER
7 #  include <vcl_msvc_warnings.h>
8 #endif
9 
10 // XML Tags
11 #define SITE_TAG "BWM_SITE"
12 #define SITE_HOME_TAG "home"
13 #define PYRAMID_EXE_TAG "PyramidExePath"
14 #define TABLEAUS_TAG "Tableaus"
15 #define CAMERA_TABLEAU_TAG "CameraTableau"
16 #define IMAGE_TABLEAU_TAG "ImageTableau"
17 #define COIN3D_TABLEAU_TAG "Coin3DTableau"
18 #define PROJ2D_TABLEAU_TAG "Proj2DTableau"
19 #define VIDEO_TABLEAU_TAG "Proj2DTableau"
20 #define FIDUCIAL_TABLEAU_TAG "FiducialTableau"
21 #define FID_CORR_PATH_TAG "fiducialPath"
22 #define IMAGE_PATH_TAG "imagePath"
23 #define CAMERA_PATH_TAG "cameraPath"
24 #define OBJECTS_TAG "Objects"
25 #define OBJECT_TAG "Object"
26 #define LVCS_TAG "lvcs"
27 // Tags for KML
28 #define PHOTO_OVL_TAG "PhotoOverlay"
29 #define KML_CAMERA_TAG "Camera"
30 #define KML_LON_TAG "longitude"
31 #define KML_LAT_TAG "latitude"
32 #define KML_ALT_TAG "altitude"
33 #define KML_HEAD_TAG "heading"
34 #define KML_TILT_TAG "tilt"
35 #define KML_ROLL_TAG "roll"
36 #define KML_RFOV_TAG "rightFov"
37 #define KML_TFOV_TAG "topFov"
38 #define KML_NEAR_TAG "near"
39 // Correspondence Tags
40 #define CORRESPONDENCES_TAG "Correspondences"
41 #define CORRESP_TAG "Correspondence"
42 #define CORRESP_ELM_TAG "corr_elm"
43 #define CORRESP_PT_TAG "corr_point"
44 #define FID_LOC_TAG "img_loc"
45 #define CORRESP_WORLD_PT_TAG "corr_world_point"
46 #define CORR_CAMERA_TAG "corr_camera_tab"
47 
48 
49 class bwm_io_tab_config
50 {
51  public:
bwm_io_tab_config(std::string type,std::string tab_name,bool active_or_not)52   bwm_io_tab_config(std::string type, std::string tab_name, bool active_or_not)
53     : name(tab_name), type_name(type), status(active_or_not) {}
54 
bwm_io_tab_config(bwm_io_tab_config const & t)55   bwm_io_tab_config(bwm_io_tab_config const& t)
56     : name(t.name), type_name(t.type_name), status(t.status) {}
57 
58   virtual bwm_io_tab_config* clone()=0; // {return new bwm_io_tab_config(type_name, name, status); }
~bwm_io_tab_config()59   virtual ~bwm_io_tab_config() {}
60   std::string name;
61   std::string type_name;
62   bool status;
63 };
64 
65 struct bwm_io_tab_config_img : public bwm_io_tab_config {
bwm_io_tab_config_imgbwm_io_tab_config_img66   bwm_io_tab_config_img(std::string name, bool status, std::string path)
67     : bwm_io_tab_config(IMAGE_TABLEAU_TAG, name, status), img_path(path) {}
bwm_io_tab_config_imgbwm_io_tab_config_img68   bwm_io_tab_config_img(bwm_io_tab_config_img const& t)
69     : bwm_io_tab_config(t), img_path(t.img_path) {}
70 
clonebwm_io_tab_config_img71   bwm_io_tab_config_img* clone() {return new bwm_io_tab_config_img(name, status, img_path); }
72   std::string img_path;
73 };
74 
75 
76 struct bwm_io_tab_config_cam : public bwm_io_tab_config {
77   bwm_io_tab_config_cam(std::string name, bool status,
78                         std::string i_path, std::string c_path, std::string c_type,
79                         bool /*adj*/=false)
bwm_io_tab_configbwm_io_tab_config_cam80     : bwm_io_tab_config(CAMERA_TABLEAU_TAG, name, status), img_path(i_path),
81     cam_path(c_path), cam_type(c_type) {}
82 
bwm_io_tab_config_cambwm_io_tab_config_cam83   bwm_io_tab_config_cam(bwm_io_tab_config_cam const& t)
84     : bwm_io_tab_config(t), img_path(t.img_path), cam_path(t.cam_path), cam_type(t.cam_type) {}
85 
clonebwm_io_tab_config_cam86   bwm_io_tab_config_cam* clone() {return new bwm_io_tab_config_cam(name, status, img_path, cam_path, cam_type); }
87   std::string img_path;
88   std::string cam_path;
89   std::string cam_type;
90 };
91 
92 struct bwm_io_tab_config_fiducial : public bwm_io_tab_config {
93   bwm_io_tab_config_fiducial(std::string name, bool status,
94                         std::string i_path, std::string f_path,
95                         bool /*adj*/=false)
bwm_io_tab_configbwm_io_tab_config_fiducial96     : bwm_io_tab_config(FIDUCIAL_TABLEAU_TAG, name, status), image_path(i_path),
97     fid_path(f_path) {}
98 
bwm_io_tab_config_fiducialbwm_io_tab_config_fiducial99   bwm_io_tab_config_fiducial(bwm_io_tab_config_fiducial const& t)
100     : bwm_io_tab_config(t), image_path(t.image_path), fid_path(t.fid_path) {}
101 
clonebwm_io_tab_config_fiducial102   bwm_io_tab_config_fiducial* clone() {return new bwm_io_tab_config_fiducial(name, status, image_path, fid_path); }
103   std::string image_path;
104   std::string fid_path;
105 };
106 
107 struct bwm_io_tab_config_coin3d: public bwm_io_tab_config {
bwm_io_tab_config_coin3dbwm_io_tab_config_coin3d108   bwm_io_tab_config_coin3d(std::string name, bool status,
109                            std::string c_path, std::string c_type)
110     : bwm_io_tab_config(COIN3D_TABLEAU_TAG, name, status), cam_path(c_path), cam_type(c_type) {}
111 
clonebwm_io_tab_config_coin3d112   bwm_io_tab_config_coin3d* clone() {return new bwm_io_tab_config_coin3d(name, status, cam_path, cam_type); }
113   std::string cam_path;
114   std::string cam_type;
115 };
116 
117 struct bwm_io_tab_config_proj2d: public bwm_io_tab_config {
bwm_io_tab_config_proj2dbwm_io_tab_config_proj2d118   bwm_io_tab_config_proj2d(std::string name, bool status,
119                            std::string p_type, std::string c_path,
120                            std::string c_type, std::string coin3d)
121     : bwm_io_tab_config(PROJ2D_TABLEAU_TAG, name, status), cam_path(c_path),
122       cam_type(c_type), proj2d_type(p_type), coin3d_tab_name(coin3d) {}
123 
clonebwm_io_tab_config_proj2d124   bwm_io_tab_config_proj2d* clone() { return new bwm_io_tab_config_proj2d(name, status, proj2d_type, cam_path, cam_type, coin3d_tab_name); }
125   std::string cam_path;
126   std::string cam_type;
127   std::string proj2d_type;
128   std::string coin3d_tab_name;
129 };
130 
131 struct bwm_io_tab_config_video: public bwm_io_tab_config {
bwm_io_tab_config_videobwm_io_tab_config_video132   bwm_io_tab_config_video(std::string name, bool status,
133                           std::string frames,  std::string cameras)
134     : bwm_io_tab_config(VIDEO_TABLEAU_TAG, name, status), video_path(frames), camera_glob(cameras) {}
135 
clonebwm_io_tab_config_video136   bwm_io_tab_config_video* clone() { return new bwm_io_tab_config_video(name, status, video_path, camera_glob); }
137   std::string video_path;
138   std::string camera_glob;
139 };
140 
141 #endif
142