Isis 3 Developer Reference
ControlNetVersioner.h
Go to the documentation of this file.
1 #ifndef ControlNetVersioner_h
2 #define ControlNetVersioner_h
3 
26 #include <QString>
27 
28 #include <QList>
29 #include <QSharedPointer>
30 #include <QVector>
31 
32 #include "ControlPoint.h"
33 #include "ControlPointV0001.h"
34 #include "ControlPointV0002.h"
35 #include "ControlPointV0003.h"
36 
37 class QString;
38 
39 namespace Isis {
40  class FileName;
41  class Progress;
42  class Pvl;
43  class PvlContainer;
44  class PvlObject;
45  class ControlPointV0001;
46  class ControlPointV0002;
47  class ControlPointV0003;
48 
427 
428  public:
430  ControlNetVersioner(const FileName netFile, Progress *progress=NULL);
432 
433  QString netId() const;
434  QString targetName() const;
435  QString creationDate() const;
436  QString lastModificationDate() const;
437  QString description() const;
438  QString userName() const;
439 
440  int numPoints() const;
442 
443  void write(FileName netFile);
444  Pvl toPvl();
445 
446  private:
447  // These three methods are private to ensure proper memory management
463  ControlNetVersioner &operator=(const ControlNetVersioner &other);
464 
465  // Private ControlNetHeader structs for versioning
476  struct ControlNetHeaderV0001 {
478  QString networkID;
480  QString targetName;
482  QString created;
484  QString lastModified;
486  QString description;
488  QString userName;
489  };
490 
492  typedef ControlNetHeaderV0001 ControlNetHeaderV0002;
494  typedef ControlNetHeaderV0001 ControlNetHeaderV0003;
496  typedef ControlNetHeaderV0001 ControlNetHeaderV0004;
498  typedef ControlNetHeaderV0001 ControlNetHeaderV0005;
499 
504 
505  void read(const FileName netFile, Progress *progress=NULL);
506 
507  void readPvl(const Pvl &network, Progress *progress=NULL);
508  void readPvlV0001(const PvlObject &network, Progress *progress=NULL);
509  void readPvlV0002(const PvlObject &network, Progress *progress=NULL);
510  void readPvlV0003(const PvlObject &network, Progress *progress=NULL);
511  void readPvlV0004(const PvlObject &network, Progress *progress=NULL);
512  void readPvlV0005(const PvlObject &network, Progress *progress=NULL);
513 
514  void readProtobuf(const Pvl &header, const FileName netFile, Progress *progress=NULL);
515  void readProtobufV0001(const Pvl &header, const FileName netFile, Progress *progress=NULL);
516  void readProtobufV0002(const Pvl &header, const FileName netFile, Progress *progress=NULL);
517  void readProtobufV0005(const Pvl &header, const FileName netFile, Progress *progress=NULL);
518 
519  ControlPoint *createPoint(ControlPointV0001 &point);
520  ControlPoint *createPoint(ControlPointV0002 &point);
521  ControlPoint *createPoint(ControlPointV0003 &point);
522 
523  ControlMeasure *createMeasure(const ControlPointFileEntryV0002_Measure&);
524 
525  void createHeader(const ControlNetHeaderV0001 header);
526 
527  void writeHeader(std::fstream *output);
528  int writeFirstPoint(std::fstream *output);
529 
530  ControlNetHeaderV0005 m_header;
532  QList<ControlPoint *> m_points;
534  bool m_ownsPoints;
539  };
540 }
541 #endif
~ControlNetVersioner()
Destroy a ControlNetVersioner.
Definition: ControlNetVersioner.cpp:90
QString creationDate() const
Returns the date and time that the network was created.
Definition: ControlNetVersioner.cpp:126
File name manipulation and expansion.
Definition: FileName.h:116
Pvl toPvl()
Generates a Pvl file from the currently stored control points and header.
Definition: ControlNetVersioner.cpp:194
QString lastModificationDate() const
Returns the date and time of the last modification to the network.
Definition: ControlNetVersioner.cpp:136
Handle various control network file format versions.
Definition: ControlNetVersioner.h:426
A container for the information stored in a version 3 and 4 ControlPoint.
Definition: ControlPointV0003.h:174
Program progress reporter.
Definition: Progress.h:58
QString description() const
Returns the network&#39;s description.
Definition: ControlNetVersioner.cpp:146
a control network
Definition: ControlNet.h:271
A single control point.
Definition: ControlPoint.h:369
Container for cube-like labels.
Definition: Pvl.h:135
QString targetName() const
Returns the target for the network.
Definition: ControlNetVersioner.cpp:116
A container for the information stored in a version 1 ControlPoint.
Definition: ControlPointV0001.h:76
void write(FileName netFile)
This will write a control net file object to disk.
Definition: ControlNetVersioner.cpp:1651
ControlPoint * takeFirstPoint()
Returns the first point stored in the versioner&#39;s internal list.
Definition: ControlNetVersioner.cpp:179
QString netId() const
Returns the ID for the network.
Definition: ControlNetVersioner.cpp:106
Definition: BoxcarCachingAlgorithm.h:29
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
a control measurement
Definition: ControlMeasure.h:189
QString userName() const
Returns the name of the last person or program to modify the network.
Definition: ControlNetVersioner.cpp:156
Contains Pvl Groups and Pvl Objects.
Definition: PvlObject.h:74
A container for the information stored in a version 2 ControlPoint.
Definition: ControlPointV0002.h:168
int numPoints() const
Returns the number of points that have been read in or are ready to write out.
Definition: ControlNetVersioner.cpp:166