Isis Developer Reference
ControlNetVersioner.h
Go to the documentation of this file.
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
449 ControlNetVersioner &operator=(const ControlNetVersioner &other);
450
451 // Private ControlNetHeader structs for versioning
462 struct ControlNetHeaderV0001 {
464 QString networkID;
466 QString targetName;
468 QString created;
470 QString lastModified;
472 QString description;
474 QString userName;
475 };
476
478 typedef ControlNetHeaderV0001 ControlNetHeaderV0002;
480 typedef ControlNetHeaderV0001 ControlNetHeaderV0003;
482 typedef ControlNetHeaderV0001 ControlNetHeaderV0004;
484 typedef ControlNetHeaderV0001 ControlNetHeaderV0005;
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
505 ControlPoint *createPoint(ControlPointV0001 &point);
506 ControlPoint *createPoint(ControlPointV0002 &point);
507 ControlPoint *createPoint(ControlPointV0003 &point);
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
516 ControlNetHeaderV0005 m_header;
518 QList<ControlPoint *> m_points;
520 bool m_ownsPoints;
525 };
526}
527#endif
a control measurement
Definition ControlMeasure.h:175
a control network
Definition ControlNet.h:258
Handle various control network file format versions.
Definition ControlNetVersioner.h:412
int numPoints() const
Returns the number of points that have been read in or are ready to write out.
Definition ControlNetVersioner.cpp:176
QString netId() const
Returns the ID for the network.
Definition ControlNetVersioner.cpp:116
Pvl toPvl()
Generates a Pvl file from the currently stored control points and header.
Definition ControlNetVersioner.cpp:204
QString creationDate() const
Returns the date and time that the network was created.
Definition ControlNetVersioner.cpp:136
QString targetName() const
Returns the target for the network.
Definition ControlNetVersioner.cpp:126
ControlPoint * takeFirstPoint()
Returns the first point stored in the versioner's internal list.
Definition ControlNetVersioner.cpp:189
~ControlNetVersioner()
Destroy a ControlNetVersioner.
Definition ControlNetVersioner.cpp:100
QString userName() const
Returns the name of the last person or program to modify the network.
Definition ControlNetVersioner.cpp:166
QString lastModificationDate() const
Returns the date and time of the last modification to the network.
Definition ControlNetVersioner.cpp:146
void write(FileName netFile)
This will write a control net file object to disk.
Definition ControlNetVersioner.cpp:1657
QString description() const
Returns the network's description.
Definition ControlNetVersioner.cpp:156
A single control point.
Definition ControlPoint.h:356
A container for the information stored in a version 1 ControlPoint.
Definition ControlPointV0001.h:62
A container for the information stored in a version 2 ControlPoint.
Definition ControlPointV0002.h:154
A container for the information stored in a version 3 and 4 ControlPoint.
Definition ControlPointV0003.h:160
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