Isis 3.0 Programmer Reference
Back | Home
ControlNetVersioner.h
Go to the documentation of this file.
1 #ifndef ControlNetVersioner_h
2 #define ControlNetVersioner_h
3 
26 #include <string>
27 
28 #include "ControlNetFile.h"
29 #include "ControlNetFileV0002.pb.h"
30 
31 class QString;
32 
33 namespace Isis {
34  class ControlNetFileV0001;
35  class ControlNetFileV0002;
36  class FileName;
37  class Progress;
38  class Pvl;
39  class PvlContainer;
40  class PvlObject;
41 
133  public:
134  static LatestControlNetFile *Read(const FileName &file);
135  static void Write(const FileName &file, const LatestControlNetFile &,
136  bool pvl = false);
137 
138  private:
139  // read Pvl and bring it up to the latest version, then convert to binary
142 
143  // read Binary, convert to Pvl, call ReadPvlNetwork
144  static LatestControlNetFile *ReadBinaryNetwork(const Pvl &header,
145  const FileName &file);
146 
147  static void ConvertVersion1ToVersion2(PvlObject &network);
148  static void ConvertVersion2ToVersion3(PvlObject &network);
149  static void ConvertVersion3ToVersion4(PvlObject &network);
150 
151  // We only need the latest Pvl version because it has our update cycle
153  static const int LATEST_PVL_VERSION = 4;
155  static const int LATEST_BINARY_VERSION = 2;
156 
157  private:
158  // helper methods for LatestPvlToBinary
159  static void Copy(PvlContainer &container, QString keyName,
161  void (ControlPointFileEntryV0002::*setter)(bool));
162  static void Copy(PvlContainer &container,
163  QString keyName, ControlPointFileEntryV0002 &point,
164  void (ControlPointFileEntryV0002::*setter)(double));
165  static void Copy(PvlContainer &container,
166  QString keyName, ControlPointFileEntryV0002 &point,
167  void (ControlPointFileEntryV0002::*setter)(const std::string&));
168 
169  static void Copy(PvlContainer &container, QString keyName,
171  void (ControlPointFileEntryV0002::Measure::*setter)(bool));
172  static void Copy(PvlContainer &container, QString keyName,
174  void (ControlPointFileEntryV0002::Measure::*setter)(double));
175  static void Copy(PvlContainer &container, QString keyName,
178  (const std::string &));
179 
180  // This class is static, no instantiation allowed
198  };
199 }
200 
201 #endif
202 
Contains more than one keyword-value pair.
Definition: PvlContainer.h:64
File name manipulation and expansion.
Definition: FileName.h:111
static void ConvertVersion3ToVersion4(PvlObject &network)
This converts pvl networks from their version 3 to version 4.
Handle Various Control Network Versions.
static LatestControlNetFile * Read(const FileName &file)
Read the control network from disk.
static void Copy(PvlContainer &container, QString keyName, ControlPointFileEntryV0002 &point, void(ControlPointFileEntryV0002::*setter)(bool))
This is a convenience method for copying keywords out of the container and into the ControlPointFileE...
static void Write(const FileName &file, const LatestControlNetFile &, bool pvl=false)
This will write a control net file object to disk.
static LatestControlNetFile * ReadBinaryNetwork(const Pvl &header, const FileName &file)
This method is designed to read any and all binary networks.
ControlNetVersioner & operator=(const ControlNetVersioner &other)
The constructor is not implemented so assignment is impossible.
Container for cube-like labels.
Definition: Pvl.h:135
static const int LATEST_BINARY_VERSION
The latest version of the Binary formatted control networks.
static LatestControlNetFile * ReadPvlNetwork(Pvl pvl)
This interprets a Pvl network of any version.
static void ConvertVersion2ToVersion3(PvlObject &network)
This converts pvl networks from their version 2 to version 3.
static LatestControlNetFile * LatestPvlToBinary(PvlObject &network)
Convert a pvl (in the latest version) back to binary (LatestControlNetFile)
ControlNetVersioner()
The constructor is not implemented.
Handle Binary Control Network Files version 2.
Contains Pvl Groups and Pvl Objects.
Definition: PvlObject.h:74
static void ConvertVersion1ToVersion2(PvlObject &network)
This converts pvl networks from their implied version 1 to version 2.
static const int LATEST_PVL_VERSION
The latest version of the Pvl formatted control networks.

U.S. Department of the Interior | U.S. Geological Survey
ISIS | Privacy & Disclaimers | Astrogeology Research Program
To contact us, please post comments and questions on the ISIS Support Center
File Modified: 07/12/2023 23:16:39