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 
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
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
FileName.h
Isis::ControlNet::GetNetworkId
QString GetNetworkId() const
Definition: ControlNet.cpp:1338
Isis::ControlMeasure::RegisteredPixel
@ RegisteredPixel
Registered to whole pixel (e.g.,pointreg)
Definition: ControlMeasure.h:212
Isis::ControlNetVersioner::creationDate
QString creationDate() const
Returns the date and time that the network was created.
Definition: ControlNetVersioner.cpp:134
Isis::ControlMeasure::RegisteredSubPixel
@ RegisteredSubPixel
Registered to sub-pixel (e.g., pointreg)
Definition: ControlMeasure.h:214
Isis::IException::Io
@ Io
A type of error that occurred when performing an actual I/O operation.
Definition: IException.h:155
Isis::ControlMeasure::GetAprioriSample
double GetAprioriSample() const
Definition: ControlMeasure.cpp:531
Isis::SurfacePoint::GetX
Displacement GetX() const
Definition: SurfacePoint.cpp:1436
Isis::PvlObject
Contains Pvl Groups and Pvl Objects.
Definition: PvlObject.h:61
ControlNetVersioner.h
Isis::Displacement::Meters
@ Meters
The distance is being specified in meters.
Definition: Displacement.h:40
Isis::ControlPoint::SurfacePointSource::Basemap
@ Basemap
Definition: ControlPoint.h:445
Isis::PvlKeyword
A single keyword-value pair.
Definition: PvlKeyword.h:82
Isis::ControlPoint::GetMeasure
const ControlMeasure * GetMeasure(QString serialNumber) const
Get a control measure based on its cube's serial number.
Definition: ControlPoint.cpp:416
QList
This is free and unencumbered software released into the public domain.
Definition: BoxcarCachingAlgorithm.h:13
Isis::ControlPoint::SurfacePointSource::BundleSolution
@ BundleSolution
Definition: ControlPoint.h:446
Isis::ControlNet::GetUserName
QString GetUserName() const
Return the user name.
Definition: ControlNet.cpp:1513
Isis::ControlPoint::GetChooserName
QString GetChooserName() const
Definition: ControlPoint.cpp:1242
Isis::ControlPointV0002
A container for the information stored in a version 2 ControlPoint.
Definition: ControlPointV0002.h:154
Isis::FileName::name
QString name() const
Returns the name of the file excluding the path and the attributes in the file name.
Definition: FileName.cpp:162
Isis::SurfacePoint::GetLonSigmaDistance
Distance GetLonSigmaDistance() const
Return the longitude sigma in meters.
Definition: SurfacePoint.cpp:1763
Isis::ControlPoint::SurfacePointSource::Reference
@ Reference
Definition: ControlPoint.h:444
Isis::ControlMeasure::MeasureType
MeasureType
Control network measurement types.
Definition: ControlMeasure.h:206
Isis::PvlContainer::addKeyword
void addKeyword(const PvlKeyword &keyword, const InsertMode mode=Append)
Add a keyword to the container.
Definition: PvlContainer.cpp:202
SpecialPixel.h
Isis::FileName
File name manipulation and expansion.
Definition: FileName.h:100
Isis::IException::Unknown
@ Unknown
A type of error that cannot be classified as any of the other error types.
Definition: IException.h:118
Isis::ControlPoint::RadiusSource::BundleSolution
@ BundleSolution
Definition: ControlPoint.h:457
PvlGroup.h
Isis::ControlPoint::HasAprioriRadiusSourceFile
bool HasAprioriRadiusSourceFile() const
Checks to see if the radius source file has been set.
Definition: ControlPoint.cpp:1671
Isis::ControlNet::Description
QString Description() const
Return the description of the network.
Definition: ControlNet.cpp:1254
Isis::ControlPoint::GetAdjustedSurfacePoint
SurfacePoint GetAdjustedSurfacePoint() const
Definition: ControlPoint.cpp:1282
Target.h
Isis::SurfacePoint::GetLatSigmaDistance
Distance GetLatSigmaDistance() const
Return the latitude sigma as a Distance.
Definition: SurfacePoint.cpp:1747
Isis::ControlNetVersioner::takeFirstPoint
ControlPoint * takeFirstPoint()
Returns the first point stored in the versioner's internal list.
Definition: ControlNetVersioner.cpp:187
Isis::ControlMeasureLogData::NumericLogDataType
NumericLogDataType
Please do not change existing values in this list except the size - it will break backwards compadibi...
Definition: ControlMeasureLogData.h:49
Isis::ControlPoint::GetNumMeasures
int GetNumMeasures() const
Definition: ControlPoint.cpp:1702
Isis::ControlPoint::SurfacePointSource::AverageOfMeasures
@ AverageOfMeasures
Definition: ControlPoint.h:443
Longitude.h
NaifStatus.h
Isis::ControlPoint::GetAprioriSurfacePointSource
SurfacePointSource::Source GetAprioriSurfacePointSource() const
Definition: ControlPoint.cpp:1682
Isis::Pvl
Container for cube-like labels.
Definition: Pvl.h:119
Isis::ControlPoint::PointType
PointType
These are the valid 'types' of point.
Definition: ControlPoint.h:364
Isis::ControlPoint::GetAprioriSurfacePoint
SurfacePoint GetAprioriSurfacePoint() const
Definition: ControlPoint.cpp:1566
Isis::ControlMeasureLogData::ToKeyword
PvlKeyword ToKeyword() const
This converts the log data to a PvlKeyword.
Definition: ControlMeasureLogData.cpp:166
Isis::SurfacePoint::GetZ
Displacement GetZ() const
Definition: SurfacePoint.cpp:1450
Isis::PvlObject::addObject
void addObject(const PvlObject &object)
Add a PvlObject.
Definition: PvlObject.h:307
Isis::SurfacePoint::GetLatitude
Latitude GetLatitude() const
Return the body-fixed latitude for the surface point.
Definition: SurfacePoint.cpp:1665
Isis::ControlPoint::HasAprioriSurfacePointSourceFile
bool HasAprioriSurfacePointSourceFile() const
Checks to see if the surface point source file has been set.
Definition: ControlPoint.cpp:1692
Isis::ControlMeasure::GetAprioriLine
double GetAprioriLine() const
Definition: ControlMeasure.cpp:526
Isis::ControlPoint::IsEditLocked
bool IsEditLocked() const
Definition: ControlPoint.cpp:1272
Isis::ControlPoint::GetId
QString GetId() const
Return the Id of the control point.
Definition: ControlPoint.cpp:1306
Isis::ControlMeasure::GetSampleSigma
double GetSampleSigma() const
Definition: ControlMeasure.cpp:733
Isis::ControlNet::GetTarget
QString GetTarget() const
Return the target name.
Definition: ControlNet.cpp:1507
QSharedPointer< ControlNetFileProtoV0001_PBControlPoint >
Isis::ControlPoint::GetDateTime
QString GetDateTime() const
Definition: ControlPoint.cpp:1262
Isis::ControlMeasure::Candidate
@ Candidate
(e.g., autoseed, interest) AKA predicted, unmeasured, unverified
Definition: ControlMeasure.h:208
Isis::ControlMeasure::GetDateTime
QString GetDateTime() const
Return the date/time the coordinate was last changed.
Definition: ControlMeasure.cpp:563
Isis::SurfacePoint::GetRectangularMatrix
boost::numeric::ublas::symmetric_matrix< double, boost::numeric::ublas::upper > GetRectangularMatrix(SurfacePoint::CoordUnits units=SurfacePoint::Meters) const
Definition: SurfacePoint.cpp:1603
Isis::toString
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
Definition: IString.cpp:211
Isis::ControlPoint::RadiusSource::AverageOfMeasures
@ AverageOfMeasures
Definition: ControlPoint.h:454
Isis::ControlPoint::GetAprioriRadiusSourceFile
QString GetAprioriRadiusSourceFile() const
Definition: ControlPoint.cpp:1676
Isis::ControlMeasure::IsIgnored
bool IsIgnored() const
Definition: ControlMeasure.cpp:630
Isis::ControlNet::CreatedDate
QString CreatedDate() const
Return the Created Date.
Definition: ControlNet.cpp:1244
Isis::ControlMeasure::IsRejected
bool IsRejected() const
Definition: ControlMeasure.cpp:635
Isis::ControlMeasure::GetLineSigma
double GetLineSigma() const
Definition: ControlMeasure.cpp:700
Isis::ControlNetVersioner::~ControlNetVersioner
~ControlNetVersioner()
Destroy a ControlNetVersioner.
Definition: ControlNetVersioner.cpp:98
Isis::ControlPoint::RadiusSource::Ellipsoid
@ Ellipsoid
Definition: ControlPoint.h:455
Isis::ControlMeasure::GetCubeSerialNumber
QString GetCubeSerialNumber() const
Return the serial number of the cube containing the coordinate.
Definition: ControlMeasure.cpp:557
Isis::ControlPoint
A single control point.
Definition: ControlPoint.h:354
Isis::ControlPoint::Fixed
@ Fixed
A Fixed point is a Control Point whose lat/lon is well established and should not be changed.
Definition: ControlPoint.h:371
Isis::ControlPoint::IsCoord2Constrained
bool IsCoord2Constrained()
Return bool indicating if 2nd coordinate is Constrained or not.
Definition: ControlPoint.cpp:1641
Isis::FileName::expanded
QString expanded() const
Returns a QString of the full file name including the file path, excluding the attributes.
Definition: FileName.cpp:196
ControlNet.h
Latitude.h
Isis::Displacement::meters
double meters() const
Get the displacement in meters.
Definition: Displacement.cpp:73
Isis::PvlGroup
Contains multiple PvlContainers.
Definition: PvlGroup.h:41
Pvl.h
_FILEINFO_
#define _FILEINFO_
Macro for the filename and line number.
Definition: IException.h:24
Isis::ControlNetVersioner::description
QString description() const
Returns the network's description.
Definition: ControlNetVersioner.cpp:154
Isis::ControlPoint::SurfacePointSource::User
@ User
Definition: ControlPoint.h:442
Isis::ControlNet::GetPoints
QList< ControlPoint * > GetPoints()
Return QList of all the ControlPoints in the network.
Definition: ControlNet.cpp:1524
Isis::ControlMeasure::GetType
MeasureType GetType() const
Definition: ControlMeasure.cpp:738
Isis::ControlPoint::RadiusSource::DEM
@ DEM
Definition: ControlPoint.h:456
Isis::SurfacePoint::Valid
bool Valid() const
Definition: SurfacePoint.cpp:947
Isis::ControlPoint::RadiusSource::None
@ None
Definition: ControlPoint.h:452
Isis::toInt
int toInt(const QString &string)
Global function to convert from a string to an integer.
Definition: IString.cpp:93
EndianSwapper.h
Isis::ControlMeasure::Manual
@ Manual
Hand Measured (e.g., qnet)
Definition: ControlMeasure.h:210
Isis::ControlPoint::Constrained
@ Constrained
A Constrained point is a Control Point whose lat/lon/radius is somewhat established and should not be...
Definition: ControlPoint.h:376
Isis::ControlNetVersioner::userName
QString userName() const
Returns the name of the last person or program to modify the network.
Definition: ControlNetVersioner.cpp:164
SurfacePoint.h
Isis::ControlNetVersioner::netId
QString netId() const
Returns the ID for the network.
Definition: ControlNetVersioner.cpp:114
Isis::ControlPoint::SurfacePointSource::None
@ None
Definition: ControlPoint.h:441
Isis::PvlKeyword::addComment
void addComment(QString comment)
Add a comment to the PvlKeyword.
Definition: PvlKeyword.cpp:376
Isis::BigInt
long long int BigInt
Big int.
Definition: Constants.h:49
Isis::ControlPoint::HasRefMeasure
bool HasRefMeasure() const
Checks to see if a reference measure is set.
Definition: ControlPoint.cpp:447
Isis::ControlMeasure::IsEditLocked
bool IsEditLocked() const
Return value for p_editLock or implicit lock on reference measure.
Definition: ControlMeasure.cpp:601
Isis::PvlObject::findObject
PvlObjectIterator findObject(const QString &name, PvlObjectIterator beg, PvlObjectIterator end)
Find the index of object with a specified name, between two indexes.
Definition: PvlObject.h:274
Isis::ControlPoint::IndexOfRefMeasure
int IndexOfRefMeasure() const
Definition: ControlPoint.cpp:1817
Isis::ControlMeasure::GetDiameter
double GetDiameter() const
Return the diameter of the crater in pixels (0 implies no crater)
Definition: ControlMeasure.cpp:580
Isis::ControlMeasure::GetSample
double GetSample() const
Definition: ControlMeasure.cpp:723
ControlPoint.h
Isis::ControlMeasure::GetSampleResidual
double GetSampleResidual() const
Definition: ControlMeasure.cpp:728
Isis::ControlNet
a control network
Definition: ControlNet.h:257
Isis::ControlPointV0003
A container for the information stored in a version 3 and 4 ControlPoint.
Definition: ControlPointV0003.h:160
Isis::IException
Isis exception class.
Definition: IException.h:91
Isis::ControlPoint::GetAprioriSurfacePointSourceFile
QString GetAprioriSurfacePointSourceFile() const
Definition: ControlPoint.cpp:1697
Isis::ControlNetVersioner::targetName
QString targetName() const
Returns the target for the network.
Definition: ControlNetVersioner.cpp:124
Isis::ControlPoint::GetAprioriRadiusSource
RadiusSource::Source GetAprioriRadiusSource() const
Definition: ControlPoint.cpp:1571
Isis::Progress
Program progress reporter.
Definition: Progress.h:42
Isis::SurfacePoint::GetLongitude
Longitude GetLongitude() const
Return the body-fixed longitude for the surface point.
Definition: SurfacePoint.cpp:1685
Isis::PvlContainer::addComment
void addComment(const QString &comment)
Definition: PvlContainer.h:269
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::Null
const double Null
Value for an Isis Null pixel.
Definition: SpecialPixel.h:95
Isis::PvlObject::addGroup
void addGroup(const Isis::PvlGroup &group)
Add a group to the object.
Definition: PvlObject.h:186
Isis::ControlMeasure::GetLogDataEntries
QVector< ControlMeasureLogData > GetLogDataEntries() const
Return all of the log data for the measure.
Definition: ControlMeasure.cpp:796
ControlPointV0003.h
IException.h
Isis::ControlPoint::RadiusSource::User
@ User
Definition: ControlPoint.h:453
Isis::SurfacePoint::GetLocalRadius
Distance GetLocalRadius() const
Return the radius of the surface point.
Definition: SurfacePoint.cpp:1732
Isis::IException::Programmer
@ Programmer
This error is for when a programmer made an API call that was illegal.
Definition: IException.h:146
Isis::ControlPoint::IsCoord1Constrained
bool IsCoord1Constrained()
Return bool indicating if 1st coordinate is Constrained or not.
Definition: ControlPoint.cpp:1630
std
Namespace for the standard library.
LinearAlgebra.h
Isis::ControlNetVersioner::write
void write(FileName netFile)
This will write a control net file object to disk.
Definition: ControlNetVersioner.cpp:1659
PvlKeyword.h
Isis::ControlNetVersioner::toPvl
Pvl toPvl()
Generates a Pvl file from the currently stored control points and header.
Definition: ControlNetVersioner.cpp:202
Isis::ControlPoint::Free
@ Free
A Free point is a Control Point that identifies common measurements between two or more cubes.
Definition: ControlPoint.h:384
Isis::EndianSwapper
Byte swapper.
Definition: EndianSwapper.h:38
ControlPointV0002.h
Isis::Distance::meters
double meters() const
Get the distance in meters.
Definition: Distance.cpp:85
Isis::ControlMeasure::GetLine
double GetLine() const
Definition: ControlMeasure.cpp:690
Isis::ControlMeasure::GetLineResidual
double GetLineResidual() const
Definition: ControlMeasure.cpp:695
PvlObject.h
Isis::Angle::degrees
double degrees() const
Get the angle in units of Degrees.
Definition: Angle.h:232
Isis::ControlPoint::IsIgnored
bool IsIgnored() const
Definition: ControlPoint.cpp:1311
Isis::ControlPoint::GetType
PointType GetType() const
Definition: ControlPoint.cpp:1401
Distance.h
QVector
This is free and unencumbered software released into the public domain.
Definition: Calculator.h:18
ControlPointV0001.h
Isis::ControlMeasure::GetChooserName
QString GetChooserName() const
Return the chooser name.
Definition: ControlMeasure.cpp:542
ControlMeasureLogData.h
Isis::ControlPoint::IsReferenceExplicit
bool IsReferenceExplicit() const
Definition: ControlPoint.cpp:1755
Isis::ControlNetVersioner::lastModificationDate
QString lastModificationDate() const
Returns the date and time of the last modification to the network.
Definition: ControlNetVersioner.cpp:144
Isis::ControlMeasureLogData
Statistical and similar ControlMeasure associated information.
Definition: ControlMeasureLogData.h:37
Progress.h
Isis::ControlPointV0001
A container for the information stored in a version 1 ControlPoint.
Definition: ControlPointV0001.h:62
Isis::SurfacePoint
This class defines a body-fixed surface point.
Definition: SurfacePoint.h:132
Isis::SurfacePoint::GetY
Displacement GetY() const
Definition: SurfacePoint.cpp:1443
Isis::SurfacePoint::GetLocalRadiusSigma
Distance GetLocalRadiusSigma() const
Definition: SurfacePoint.cpp:1776
ControlMeasure.h
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::IException::User
@ User
A type of error that could only have occurred due to a mistake on the user's part (e....
Definition: IException.h:126
Isis::ControlNetVersioner
Handle various control network file format versions.
Definition: ControlNetVersioner.h:412
Isis::ControlNet::GetLastModified
QString GetLastModified() const
Return the last modified date.
Definition: ControlNet.cpp:1518
Isis::ControlMeasure
a control measurement
Definition: ControlMeasure.h:175