OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
PhotoBlock.h
Go to the documentation of this file.
1 //**************************************************************************************************
2 //
3 // OSSIM Open Source Geospatial Data Processing Library
4 // See top level LICENSE.txt file for license information
5 //
6 //**************************************************************************************************
7 #ifndef PhotoBlock_HEADER
8 #define PhotoBlock_HEADER 1
9 
10 #include <string>
11 #include <vector>
12 #include <memory>
15 #include <ossim/reg/Image.h>
16 #include <ossim/reg/TiePoint.h>
18 
19 namespace ossim
20 {
21 
25 class PhotoBlock : public JsonInterface,
26  public std::enable_shared_from_this<PhotoBlock>
27 {
28 public:
33  PhotoBlock();
34  PhotoBlock(const Json::Value& pb_json_node);
35  PhotoBlock(const PhotoBlock& copyThis);
36 
37  ~PhotoBlock();
38 
39  PhotoBlock& operator=(const PhotoBlock& copythis);
40 
41  std::shared_ptr<Image> getImage(const std::string& imageId);
42  std::shared_ptr<TiePoint> getTiePoint(unsigned int tpId);
43  std::shared_ptr<GroundControlPoint> getGroundPoint(const std::string& gpId);
44 
47  std::vector<std::shared_ptr<GroundControlPoint> >& getGroundPointList() { return m_gcpList; }
48 
49  // TODO: Add of individual components not valid until proper management of the JCM can be
50  // provided
51 
57  unsigned int addImage(std::shared_ptr<Image> image);
58 
64  unsigned int addGroundPoint(std::shared_ptr<GroundControlPoint> groundPoint);
65 
71  unsigned int addTiePoint(std::shared_ptr<TiePoint> tiepoint);
72 
77  void addTiePoints(TiePointList& tiepointList);
78 
79  /*
80  * Refer to <a href="https://docs.google.com/document/d/1DXekmYm7wyo-uveM7mEu80Q7hQv40fYbtwZq-g0uKBs/edit?usp=sharing">3DISA API document</a>
81  * for JSON format used.
82  */
83  virtual void loadJSON(const Json::Value& json);
84 
85  /*
86  * Refer to <a href="https://docs.google.com/document/d/1DXekmYm7wyo-uveM7mEu80Q7hQv40fYbtwZq-g0uKBs/edit?usp=sharing">3DISA API document</a>
87  * for JSON format used.
88  */
89  virtual void saveJSON(Json::Value& json) const;
90 
91 protected:
92  std::vector<std::shared_ptr<Image> > m_imageList;
93  std::vector<std::shared_ptr<TiePoint> > m_tiePointList;
94  std::vector<std::shared_ptr<GroundControlPoint> > m_gcpList;
95 };
96 
97 } // End namespace ISA
98 
99 #endif
std::vector< std::shared_ptr< TiePoint > > m_tiePointList
Definition: PhotoBlock.h:93
std::vector< std::shared_ptr< Image > > m_imageList
Definition: PhotoBlock.h:92
This code was derived from https://gist.github.com/mshockwave.
Definition: Barrier.h:8
PhotoBlock()
Initialize the photoblock from a prior saved session.
Definition: PhotoBlock.cpp:13
PhotoBlock & operator=(const PhotoBlock &copythis)
Definition: PhotoBlock.cpp:35
std::vector< std::shared_ptr< Image > > ImageList
Definition: Image.h:81
Class for representing MSP PhotoBlock.
Definition: PhotoBlock.h:25
ImageList & getImageList()
Definition: PhotoBlock.h:45
void addTiePoints(TiePointList &tiepointList)
Adds the list of tiepoints to the PB.
Definition: PhotoBlock.cpp:66
std::vector< std::shared_ptr< TiePoint > > TiePointList
Definition: TiePoint.h:21
unsigned int addTiePoint(std::shared_ptr< TiePoint > tiepoint)
Adds the tiepoint to the PB.
Definition: PhotoBlock.cpp:59
virtual void loadJSON(const Json::Value &json)
Definition: PhotoBlock.cpp:116
std::vector< std::shared_ptr< GroundControlPoint > > & getGroundPointList()
Definition: PhotoBlock.h:47
Pure virtual interface for classes implementing JSON-based load/save state.
Definition: JsonInterface.h:19
std::shared_ptr< TiePoint > getTiePoint(unsigned int tpId)
Definition: PhotoBlock.cpp:102
unsigned int addGroundPoint(std::shared_ptr< GroundControlPoint > groundPoint)
Adds the image to the photoblock at last position.
Definition: PhotoBlock.cpp:52
TiePointList & getTiePointList()
Definition: PhotoBlock.h:46
virtual void saveJSON(Json::Value &json) const
Definition: PhotoBlock.cpp:156
unsigned int addImage(std::shared_ptr< Image > image)
Adds the image to the photoblock at last position.
Definition: PhotoBlock.cpp:45
std::vector< std::shared_ptr< GroundControlPoint > > m_gcpList
Definition: PhotoBlock.h:94
std::shared_ptr< GroundControlPoint > getGroundPoint(const std::string &gpId)
Definition: PhotoBlock.cpp:88
std::shared_ptr< Image > getImage(const std::string &imageId)
Definition: PhotoBlock.cpp:74