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
23class QString;
24
25namespace 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;
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
518 QList<ControlPoint *> m_points;
525 };
526}
527#endif
a control measurement
a control network
Definition ControlNet.h:258
Handle various control network file format versions.
ControlNetHeaderV0005 m_header
Header containing information about the whole network.
int numPoints() const
Returns the number of points that have been read in or are ready to write out.
QString netId() const
Returns the ID for the network.
Pvl toPvl()
Generates a Pvl file from the currently stored control points and header.
void readPvlV0002(const PvlObject &network, Progress *progress=NULL)
read a version 2 Pvl control network and convert the data into control points.
ControlPoint * createPoint(ControlPointV0001 &point)
Create a pointer to a latest version ControlPoint from an object in a V0001 control net file.
QString creationDate() const
Returns the date and time that the network was created.
void readPvl(const Pvl &network, Progress *progress=NULL)
Read a Pvl control network and prepare the data to be converted into a control network.
QString targetName() const
Returns the target for the network.
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...
ControlNetVersioner & operator=(const ControlNetVersioner &other)
Asssignment operator.
ControlMeasure * createMeasure(const ControlPointFileEntryV0002_Measure &)
Create a pointer to a ControlMeasure from a V0006 file.
bool m_ownsPoints
Flag if the versioner owns the control points stored in it.
void writeHeader(std::fstream *output)
This will read the binary protobuffer control network header to an fstream.
void createHeader(const ControlNetHeaderV0001 header)
Create the internal header from a V0001 header.
void readPvlV0001(const PvlObject &network, Progress *progress=NULL)
read a version 1 Pvl control network and convert the data into control points.
ControlPointV0003 ControlPointV0004
Typedef for consistent naming of containers for version 4.
ControlPoint * takeFirstPoint()
Returns the first point stored in the versioner's internal list.
~ControlNetVersioner()
Destroy a ControlNetVersioner.
ControlNetHeaderV0001 ControlNetHeaderV0004
Typedef for consistent naming of containers for version 4.
ControlNetHeaderV0001 ControlNetHeaderV0002
Typedef for consistent naming of containers for version 2.
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 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...
ControlPointV0003 ControlPointV0005
Typedef for consistent naming of containers for version 5.
int writeFirstPoint(std::fstream *output)
This will write the first control point to a file stream.
ControlNetVersioner(const ControlNetVersioner &other)
Copy constructor.
ControlNetHeaderV0001 ControlNetHeaderV0003
Typedef for consistent naming of containers for version 3.
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...
QString userName() const
Returns the name of the last person or program to modify the network.
ControlNetVersioner()
Default constructor. Intentially un-implemented.
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.
void readPvlV0005(const PvlObject &network, Progress *progress=NULL)
read a version 5 Pvl control network and convert the data into control points.
QString lastModificationDate() const
Returns the date and time of the last modification to the network.
void write(FileName netFile)
This will write a control net file object to disk.
QList< ControlPoint * > m_points
ControlPoints that are read in from a file or ready to be written out to a file.
QString description() const
Returns the network's description.
ControlNetHeaderV0001 ControlNetHeaderV0005
Typedef for consistent naming of containers for version 5.
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.
A single control point.
A container for the information stored in a version 1 ControlPoint.
A container for the information stored in a version 2 ControlPoint.
A container for the information stored in a version 3 and 4 ControlPoint.
File name manipulation and expansion.
Definition FileName.h:100
Program progress reporter.
Definition Progress.h:42
Container for cube-like labels.
Definition Pvl.h:119
Contains Pvl Groups and Pvl Objects.
Definition PvlObject.h:61
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16
Versioned container for general information about a control network.
QString userName
The name of the user or program that last modified the control network.
QString description
The text description of the control network.
QString lastModified
The date and time of the control network's last modification.
QString created
The date and time of the control network's creation.
QString networkID
The ID/Name of the control network.
QString targetName
The NAIF name of the target body.