Isis 3 Programmer 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
464 
465  // Private ControlNetHeader structs for versioning
478  QString networkID;
480  QString targetName;
482  QString created;
484  QString lastModified;
486  QString description;
488  QString userName;
489  };
490 
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 
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 
539  };
540 }
541 #endif
ControlMeasure * createMeasure(const ControlPointFileEntryV0002_Measure &)
Create a pointer to a ControlMeasure from a V0006 file.
~ControlNetVersioner()
Destroy a ControlNetVersioner.
QString userName
The name of the user or program that last modified the control network.
QString creationDate() const
Returns the date and time that the network was created.
File name manipulation and expansion.
Definition: FileName.h:116
QString targetName
The NAIF name of the target body.
Pvl toPvl()
Generates a Pvl file from the currently stored control points and header.
QString lastModificationDate() const
Returns the date and time of the last modification to the network.
QString created
The date and time of the control network&#39;s creation.
void writeHeader(std::fstream *output)
This will read the binary protobuffer control network header to an fstream.
QList< ControlPoint * > m_points
ControlPoints that are read in from a file or ready to be written out to a file.
Handle various control network file format versions.
void readProtobufV0001(const Pvl &header, const FileName netFile, Progress *progress=NULL)
Read a protobuf version 1 control network and prepare the data to be converted into a control network...
void readPvlV0001(const PvlObject &network, Progress *progress=NULL)
read a version 1 Pvl control network and convert the data into control points.
void readPvlV0002(const PvlObject &network, Progress *progress=NULL)
read a version 2 Pvl control network and convert the data into control points.
void read(const FileName netFile, Progress *progress=NULL)
Read a control network file and prepare the data to be converted into a control network.
void readProtobuf(const Pvl &header, const FileName netFile, Progress *progress=NULL)
Read a protobuf control network and prepare the data to be converted into a control network...
Versioned container for general information about a control network.
A container for the information stored in a version 3 and 4 ControlPoint.
void readProtobufV0002(const Pvl &header, const FileName netFile, Progress *progress=NULL)
Read a protobuf version 2 control network and prepare the data to be converted into a control network...
void readPvlV0005(const PvlObject &network, Progress *progress=NULL)
read a version 5 Pvl control network and convert the data into control points.
Program progress reporter.
Definition: Progress.h:58
ControlNetVersioner & operator=(const ControlNetVersioner &other)
Asssignment operator.
int writeFirstPoint(std::fstream *output)
This will write the first control point to a file stream.
QString description() const
Returns the network&#39;s description.
a control network
Definition: ControlNet.h:271
void readProtobufV0005(const Pvl &header, const FileName netFile, Progress *progress=NULL)
Read a protobuf version 5 control network and prepare the data to be converted into a control network...
ControlNetHeaderV0001 ControlNetHeaderV0003
Typedef for consistent naming of containers for version 3.
QString description
The text description of the control network.
ControlPointV0003 ControlPointV0005
Typedef for consistent naming of containers for version 5.
A single control point.
Definition: ControlPoint.h:369
void readPvlV0003(const PvlObject &network, Progress *progress=NULL)
read a version 3 Pvl control network and convert the data into control points.
void readPvlV0004(const PvlObject &network, Progress *progress=NULL)
read a version 4 Pvl control network and convert the data into control points.
QString networkID
The ID/Name of the control network.
Container for cube-like labels.
Definition: Pvl.h:135
ControlNetHeaderV0001 ControlNetHeaderV0002
Typedef for consistent naming of containers for version 2.
QString targetName() const
Returns the target for the network.
ControlNetHeaderV0001 ControlNetHeaderV0004
Typedef for consistent naming of containers for version 4.
A container for the information stored in a version 1 ControlPoint.
void write(FileName netFile)
This will write a control net file object to disk.
ControlPoint * takeFirstPoint()
Returns the first point stored in the versioner&#39;s internal list.
ControlNetHeaderV0005 m_header
Header containing information about the whole network.
QString netId() const
Returns the ID for the network.
ControlNetVersioner()
Default constructor. Intentially un-implemented.
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
a control measurement
bool m_ownsPoints
Flag if the versioner owns the control points stored in it.
ControlNetHeaderV0001 ControlNetHeaderV0005
Typedef for consistent naming of containers for version 5.
QString lastModified
The date and time of the control network&#39;s last modification.
ControlPoint * createPoint(ControlPointV0001 &point)
Create a pointer to a latest version ControlPoint from an object in a V0001 control net file...
QString userName() const
Returns the name of the last person or program to modify the network.
Contains Pvl Groups and Pvl Objects.
Definition: PvlObject.h:74
ControlPointV0003 ControlPointV0004
Typedef for consistent naming of containers for version 4.
A container for the information stored in a version 2 ControlPoint.
void readPvl(const Pvl &network, Progress *progress=NULL)
Read a Pvl control network and prepare the data to be converted into a control network.
void createHeader(const ControlNetHeaderV0001 header)
Create the internal header from a V0001 header.
int numPoints() const
Returns the number of points that have been read in or are ready to write out.