Isis 3 Programmer Reference
ControlNetVersioner.h
1 #ifndef ControlNetVersioner_h
2 #define ControlNetVersioner_h
3 
10 /* SPDX-License-Identifier: CC0-1.0 */
11 
12 #include <QString>
13 
14 #include <QList>
15 #include <QSharedPointer>
16 #include <QVector>
17 
18 #include "ControlPoint.h"
19 #include "ControlPointV0001.h"
20 #include "ControlPointV0002.h"
21 #include "ControlPointV0003.h"
22 
23 class QString;
24 
25 namespace Isis {
26  class FileName;
27  class Progress;
28  class Pvl;
29  class PvlContainer;
30  class PvlObject;
31  class ControlPointV0001;
32  class ControlPointV0002;
33  class ControlPointV0003;
34 
413 
414  public:
416  ControlNetVersioner(const FileName netFile, Progress *progress=NULL);
418 
419  QString netId() const;
420  QString targetName() const;
421  QString creationDate() const;
422  QString lastModificationDate() const;
423  QString description() const;
424  QString userName() const;
425 
426  int numPoints() const;
428 
429  void write(FileName netFile);
430  Pvl toPvl();
431 
432  private:
433  // These three methods are private to ensure proper memory management
450 
451  // Private ControlNetHeader structs for versioning
464  QString networkID;
466  QString targetName;
468  QString created;
470  QString lastModified;
472  QString description;
474  QString userName;
475  };
476 
485 
490 
491  void read(const FileName netFile, Progress *progress=NULL);
492 
493  void readPvl(const Pvl &network, Progress *progress=NULL);
494  void readPvlV0001(const PvlObject &network, Progress *progress=NULL);
495  void readPvlV0002(const PvlObject &network, Progress *progress=NULL);
496  void readPvlV0003(const PvlObject &network, Progress *progress=NULL);
497  void readPvlV0004(const PvlObject &network, Progress *progress=NULL);
498  void readPvlV0005(const PvlObject &network, Progress *progress=NULL);
499 
500  void readProtobuf(const Pvl &header, const FileName netFile, Progress *progress=NULL);
501  void readProtobufV0001(const Pvl &header, const FileName netFile, Progress *progress=NULL);
502  void readProtobufV0002(const Pvl &header, const FileName netFile, Progress *progress=NULL);
503  void readProtobufV0005(const Pvl &header, const FileName netFile, Progress *progress=NULL);
504 
508 
509  ControlMeasure *createMeasure(const ControlPointFileEntryV0002_Measure&);
510 
511  void createHeader(const ControlNetHeaderV0001 header);
512 
513  void writeHeader(std::fstream *output);
514  int writeFirstPoint(std::fstream *output);
515 
525  };
526 }
527 #endif
Isis::ControlNetVersioner::creationDate
QString creationDate() const
Returns the date and time that the network was created.
Definition: ControlNetVersioner.cpp:134
Isis::ControlNetVersioner::m_header
ControlNetHeaderV0005 m_header
Header containing information about the whole network.
Definition: ControlNetVersioner.h:516
Isis::ControlNetVersioner::readProtobufV0002
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...
Definition: ControlNetVersioner.cpp:1035
Isis::PvlObject
Contains Pvl Groups and Pvl Objects.
Definition: PvlObject.h:61
Isis::ControlNetVersioner::createHeader
void createHeader(const ControlNetHeaderV0001 header)
Create the internal header from a V0001 header.
Definition: ControlNetVersioner.cpp:1644
Isis::ControlNetVersioner::readPvlV0001
void readPvlV0001(const PvlObject &network, Progress *progress=NULL)
read a version 1 Pvl control network and convert the data into control points.
Definition: ControlNetVersioner.cpp:621
Isis::ControlNetVersioner::readPvlV0005
void readPvlV0005(const PvlObject &network, Progress *progress=NULL)
read a version 5 Pvl control network and convert the data into control points.
Definition: ControlNetVersioner.cpp:824
QList
This is free and unencumbered software released into the public domain.
Definition: BoxcarCachingAlgorithm.h:13
Isis::ControlPointV0002
A container for the information stored in a version 2 ControlPoint.
Definition: ControlPointV0002.h:154
Isis::ControlNetVersioner::readPvl
void readPvl(const Pvl &network, Progress *progress=NULL)
Read a Pvl control network and prepare the data to be converted into a control network.
Definition: ControlNetVersioner.cpp:582
Isis::FileName
File name manipulation and expansion.
Definition: FileName.h:100
Isis::ControlNetVersioner::ControlNetHeaderV0001::description
QString description
The text description of the control network.
Definition: ControlNetVersioner.h:472
Isis::ControlNetVersioner::readProtobufV0001
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...
Definition: ControlNetVersioner.cpp:912
Isis::ControlNetVersioner::takeFirstPoint
ControlPoint * takeFirstPoint()
Returns the first point stored in the versioner's internal list.
Definition: ControlNetVersioner.cpp:187
Isis::Pvl
Container for cube-like labels.
Definition: Pvl.h:119
Isis::ControlNetVersioner::readProtobuf
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.
Definition: ControlNetVersioner.cpp:875
Isis::ControlNetVersioner::ControlNetHeaderV0004
ControlNetHeaderV0001 ControlNetHeaderV0004
Typedef for consistent naming of containers for version 4.
Definition: ControlNetVersioner.h:482
Isis::ControlNetVersioner::ControlNetVersioner
ControlNetVersioner()
Default constructor. Intentially un-implemented.
Isis::ControlNetVersioner::ControlNetHeaderV0001::userName
QString userName
The name of the user or program that last modified the control network.
Definition: ControlNetVersioner.h:474
Isis::ControlNetVersioner::~ControlNetVersioner
~ControlNetVersioner()
Destroy a ControlNetVersioner.
Definition: ControlNetVersioner.cpp:98
Isis::ControlPoint
A single control point.
Definition: ControlPoint.h:354
Isis::ControlNetVersioner::writeFirstPoint
int writeFirstPoint(std::fstream *output)
This will write the first control point to a file stream.
Definition: ControlNetVersioner.cpp:1774
Isis::ControlNetVersioner::description
QString description() const
Returns the network's description.
Definition: ControlNetVersioner.cpp:154
Isis::ControlNetVersioner::read
void read(const FileName netFile, Progress *progress=NULL)
Read a control network file and prepare the data to be converted into a control network.
Definition: ControlNetVersioner.cpp:551
Isis::ControlNetVersioner::ControlNetHeaderV0001::created
QString created
The date and time of the control network's creation.
Definition: ControlNetVersioner.h:468
Isis::ControlNetVersioner::readPvlV0004
void readPvlV0004(const PvlObject &network, Progress *progress=NULL)
read a version 4 Pvl control network and convert the data into control points.
Definition: ControlNetVersioner.cpp:775
Isis::ControlNetVersioner::userName
QString userName() const
Returns the name of the last person or program to modify the network.
Definition: ControlNetVersioner.cpp:164
Isis::ControlNetVersioner::netId
QString netId() const
Returns the ID for the network.
Definition: ControlNetVersioner.cpp:114
Isis::ControlNetVersioner::readPvlV0002
void readPvlV0002(const PvlObject &network, Progress *progress=NULL)
read a version 2 Pvl control network and convert the data into control points.
Definition: ControlNetVersioner.cpp:674
Isis::ControlNetVersioner::ControlPointV0005
ControlPointV0003 ControlPointV0005
Typedef for consistent naming of containers for version 5.
Definition: ControlNetVersioner.h:489
Isis::ControlNet
a control network
Definition: ControlNet.h:257
Isis::ControlNetVersioner::ControlNetHeaderV0001::lastModified
QString lastModified
The date and time of the control network's last modification.
Definition: ControlNetVersioner.h:470
Isis::ControlPointV0003
A container for the information stored in a version 3 and 4 ControlPoint.
Definition: ControlPointV0003.h:160
Isis::ControlNetVersioner::targetName
QString targetName() const
Returns the target for the network.
Definition: ControlNetVersioner.cpp:124
Isis::ControlNetVersioner::ControlNetHeaderV0001::networkID
QString networkID
The ID/Name of the control network.
Definition: ControlNetVersioner.h:464
Isis::ControlNetVersioner::ControlNetHeaderV0001::targetName
QString targetName
The NAIF name of the target body.
Definition: ControlNetVersioner.h:466
Isis::ControlNetVersioner::readPvlV0003
void readPvlV0003(const PvlObject &network, Progress *progress=NULL)
read a version 3 Pvl control network and convert the data into control points.
Definition: ControlNetVersioner.cpp:725
Isis::ControlNetVersioner::ControlNetHeaderV0001
Versioned container for general information about a control network.
Definition: ControlNetVersioner.h:462
Isis::Progress
Program progress reporter.
Definition: Progress.h:42
Isis::ControlNetVersioner::createMeasure
ControlMeasure * createMeasure(const ControlPointFileEntryV0002_Measure &)
Create a pointer to a ControlMeasure from a V0006 file.
Definition: ControlNetVersioner.cpp:1547
Isis::ControlNetVersioner::numPoints
int numPoints() const
Returns the number of points that have been read in or are ready to write out.
Definition: ControlNetVersioner.cpp:174
Isis::ControlNetVersioner::ControlNetVersioner
ControlNetVersioner(const ControlNetVersioner &other)
Copy constructor.
Isis::ControlNetVersioner::readProtobufV0005
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...
Definition: ControlNetVersioner.cpp:1154
Isis::ControlNetVersioner::ControlPointV0004
ControlPointV0003 ControlPointV0004
Typedef for consistent naming of containers for version 4.
Definition: ControlNetVersioner.h:487
Isis::ControlNetVersioner::write
void write(FileName netFile)
This will write a control net file object to disk.
Definition: ControlNetVersioner.cpp:1659
Isis::ControlNetVersioner::writeHeader
void writeHeader(std::fstream *output)
This will read the binary protobuffer control network header to an fstream.
Definition: ControlNetVersioner.cpp:1745
Isis::ControlNetVersioner::toPvl
Pvl toPvl()
Generates a Pvl file from the currently stored control points and header.
Definition: ControlNetVersioner.cpp:202
Isis::ControlNetVersioner::createPoint
ControlPoint * createPoint(ControlPointV0001 &point)
Create a pointer to a latest version ControlPoint from an object in a V0001 control net file.
Definition: ControlNetVersioner.cpp:1308
Isis::ControlNetVersioner::ControlNetHeaderV0003
ControlNetHeaderV0001 ControlNetHeaderV0003
Typedef for consistent naming of containers for version 3.
Definition: ControlNetVersioner.h:480
Isis::ControlNetVersioner::m_ownsPoints
bool m_ownsPoints
Flag if the versioner owns the control points stored in it.
Definition: ControlNetVersioner.h:520
Isis::ControlNetVersioner::lastModificationDate
QString lastModificationDate() const
Returns the date and time of the last modification to the network.
Definition: ControlNetVersioner.cpp:144
Isis::ControlNetVersioner::ControlNetHeaderV0005
ControlNetHeaderV0001 ControlNetHeaderV0005
Typedef for consistent naming of containers for version 5.
Definition: ControlNetVersioner.h:484
Isis::ControlPointV0001
A container for the information stored in a version 1 ControlPoint.
Definition: ControlPointV0001.h:62
Isis::ControlNetVersioner::operator=
ControlNetVersioner & operator=(const ControlNetVersioner &other)
Asssignment operator.
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::ControlNetVersioner
Handle various control network file format versions.
Definition: ControlNetVersioner.h:412
Isis::ControlNetVersioner::m_points
QList< ControlPoint * > m_points
ControlPoints that are read in from a file or ready to be written out to a file.
Definition: ControlNetVersioner.h:518
Isis::ControlNetVersioner::ControlNetHeaderV0002
ControlNetHeaderV0001 ControlNetHeaderV0002
Typedef for consistent naming of containers for version 2.
Definition: ControlNetVersioner.h:478
Isis::ControlMeasure
a control measurement
Definition: ControlMeasure.h:175