1 // This file is part of OpenMVG, an Open Multiple View Geometry C++ library.
2 
3 // Copyright (c) 2015 Pierre MOULON.
4 
5 // This Source Code Form is subject to the terms of the Mozilla Public
6 // License, v. 2.0. If a copy of the MPL was not distributed with this
7 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 
9 
10 #ifndef OPENMVG_SFM_SFM_DATA_IO_HPP
11 #define OPENMVG_SFM_SFM_DATA_IO_HPP
12 
13 #include <string>
14 
15 #include "openMVG/types.hpp"
16 
17 namespace openMVG {
18 namespace sfm {
19 
20 struct SfM_Data;
21 
22 enum ESfM_Data
23 {
24   // Note: Use power of two values in order to use bitwise operators.
25   VIEWS           =  1,
26   EXTRINSICS      =  2,
27   INTRINSICS      =  4,
28   STRUCTURE       =  8,
29   CONTROL_POINTS  = 16,
30   ALL = VIEWS | EXTRINSICS | INTRINSICS | STRUCTURE | CONTROL_POINTS
31 };
32 
33 ///Check that each pose have a valid intrinsic and pose id in the existing View ids
34 bool ValidIds(const SfM_Data & sfm_data, ESfM_Data flags_part);
35 
36 /// Load SfM_Data SfM scene from a file
37 bool Load(SfM_Data & sfm_data, const std::string & filename, ESfM_Data flags_part);
38 
39 /// Save SfM_Data SfM scene to a file
40 bool Save(const SfM_Data & sfm_data, const std::string & filename, ESfM_Data flags_part);
41 
42 } // namespace sfm
43 } // namespace openMVG
44 
45 #endif // OPENMVG_SFM_SFM_DATA_IO_HPP
46