Isis 3 Programmer Reference
|
Handle various control network file format versions. More...
#include <ControlNetVersioner.h>
Classes | |
struct | ControlNetHeaderV0001 |
Versioned container for general information about a control network. More... | |
Public Member Functions | |
ControlNetVersioner (ControlNet *net) | |
Construct a ControlNetVersioner from a control network. More... | |
ControlNetVersioner (const FileName netFile, Progress *progress=NULL) | |
Construct a ControlNetVersioner from a file. More... | |
~ControlNetVersioner () | |
Destroy a ControlNetVersioner. More... | |
QString | netId () const |
Returns the ID for the network. More... | |
QString | targetName () const |
Returns the target for the network. More... | |
QString | creationDate () const |
Returns the date and time that the network was created. More... | |
QString | lastModificationDate () const |
Returns the date and time of the last modification to the network. More... | |
QString | description () const |
Returns the network's description. More... | |
QString | userName () const |
Returns the name of the last person or program to modify the network. More... | |
int | numPoints () const |
Returns the number of points that have been read in or are ready to write out. More... | |
ControlPoint * | takeFirstPoint () |
Returns the first point stored in the versioner's internal list. More... | |
void | write (FileName netFile) |
This will write a control net file object to disk. More... | |
Pvl | toPvl () |
Generates a Pvl file from the currently stored control points and header. More... | |
Private Types | |
typedef ControlNetHeaderV0001 | ControlNetHeaderV0002 |
Typedef for consistent naming of containers for version 2. More... | |
typedef ControlNetHeaderV0001 | ControlNetHeaderV0003 |
Typedef for consistent naming of containers for version 3. More... | |
typedef ControlNetHeaderV0001 | ControlNetHeaderV0004 |
Typedef for consistent naming of containers for version 4. More... | |
typedef ControlNetHeaderV0001 | ControlNetHeaderV0005 |
Typedef for consistent naming of containers for version 5. More... | |
typedef ControlPointV0003 | ControlPointV0004 |
Typedef for consistent naming of containers for version 4. More... | |
typedef ControlPointV0003 | ControlPointV0005 |
Typedef for consistent naming of containers for version 5. More... | |
Private Member Functions | |
ControlNetVersioner () | |
Default constructor. Intentially un-implemented. More... | |
ControlNetVersioner (const ControlNetVersioner &other) | |
Copy constructor. More... | |
ControlNetVersioner & | operator= (const ControlNetVersioner &other) |
Asssignment operator. More... | |
void | read (const FileName netFile, Progress *progress=NULL) |
Read a control network file and prepare the data to be converted into a control network. More... | |
void | readPvl (const Pvl &network, Progress *progress=NULL) |
Read a Pvl control network and prepare the data to be converted into a control network. More... | |
void | readPvlV0001 (const PvlObject &network, Progress *progress=NULL) |
read a version 1 Pvl control network and convert the data into control points. More... | |
void | readPvlV0002 (const PvlObject &network, Progress *progress=NULL) |
read a version 2 Pvl control network and convert the data into control points. More... | |
void | readPvlV0003 (const PvlObject &network, Progress *progress=NULL) |
read a version 3 Pvl control network and convert the data into control points. More... | |
void | readPvlV0004 (const PvlObject &network, Progress *progress=NULL) |
read a version 4 Pvl control network and convert the data into control points. More... | |
void | readPvlV0005 (const PvlObject &network, Progress *progress=NULL) |
read a version 5 Pvl control network and convert the data into control points. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
ControlPoint * | createPoint (ControlPointV0001 &point) |
Create a pointer to a latest version ControlPoint from an object in a V0001 control net file. More... | |
ControlPoint * | createPoint (ControlPointV0002 &point) |
Create a pointer to a latest version ControlPoint from an object in a V0002 control net file. More... | |
ControlPoint * | createPoint (ControlPointV0003 &point) |
Create a pointer to a latest version ControlPoint from an object in a V0003 control net file. More... | |
ControlMeasure * | createMeasure (const ControlPointFileEntryV0002_Measure &) |
Create a pointer to a ControlMeasure from a V0006 file. More... | |
void | createHeader (const ControlNetHeaderV0001 header) |
Create the internal header from a V0001 header. More... | |
void | writeHeader (std::fstream *output) |
This will read the binary protobuffer control network header to an fstream. More... | |
int | writeFirstPoint (std::fstream *output) |
This will write the first control point to a file stream. More... | |
Private Attributes | |
ControlNetHeaderV0005 | m_header |
Header containing information about the whole network. More... | |
QList< ControlPoint * > | m_points |
ControlPoints that are read in from a file or ready to be written out to a file. More... | |
bool | m_ownsPoints |
Flag if the versioner owns the control points stored in it. More... | |
Handle various control network file format versions.
This class is used to read all versions of control networks and write out the most recent version in Pvl and protobuf format. When reading a control net file, the ControlNeVersioner is initialized with the filename. When writing a control net file or generating a Pvl network, the ControlNetVersioner is initialized from a ControlNet object.
This class exists to isolate the code dealing with control network file formats. ControlNet can then interface with this class and only has to work with the current ControlPoint object.
The read routine is as follows:
Once the ControlNet file is read into the ControlNetVersioner, the ControlPoints can be accessed through the takeFirstPoint method. This will remove the first ControlPoint stored in the ControlNetVersioner and give it to the caller. At this point, the caller is given ownership of the ControlPoint and is expected to delete it when finished. General information about the control network can be accessed directly from the ControlNetVersioner.
The protobuf file write routine is as follows:
Once the ControlNetVersioner is initialized from a file or a ControlNet, a Pvl formatted version of the control network can be created by the toPvl method. This will always output the control network in the latest Pvl format. From here, the Pvl network can be written to a file with Pvl::write(filename).
If the control network file format is changed the following changes need to be made to ControlNetVersioner and its supporting classes:
Prior to the creation of this versioning class, which was released with ISIS 3.2.2, all control network files were Pvl formatted text files. Reading and writing these files was handled by the ControlNet, ControlPoint, and ControlMeasure classes. As the file format was changed, those classes were modified to account for the new format. Because of this, the history of the control network file format prior to ISIS 3.2.2 is not well documented.
The following are descriptions of the different control network file format versions that are currently supported. Each description also describes how that version differs from the previous.
Version 1
This version maintains backwards compatibility with all files created prior to versioning. If a control network file does not have a version flag, then it is assumed to be a version 1 file. Because this version supports all files created prior to ISIS 3.2.2, there is no standardized Pvl format associated with it.
Originally, there was no version 1 binary format. When version 2 was added, version 1 was changed to use the version 2 binary format.
Version 2
This version was the first to have a standardized format. The following were standardized with this format:
Version 2 was the first version to support a binary protobuf format. Version 1 was retroactively changed to use the version 2 binary format. Version 2 binary control network files consist of three parts:
Version 3
This version was created to avoid file size limits imposed by the version 2 binary file format. Protobuf messages are limited to 2GB for security reasons. So, version 2 binary files can only contain 2GB of information in their Protobuf Core. In version 3, the Protobuf Core was changed from a single message to a header message and individual messages for each control point. This way, the Protobuf Core could contain an arbitrary amount of information as long as any single point does not exceed 2GB. At the same time, control measure log data was moved into the Protobuf Core so that each measure contains its own log data.
Version 3 binary control network files are formatted as follows:
Version 3 also further differentiated control point types. Control points that had their latitude, longitude, and/or radius constrained were changed from Tie points to Constrained points.
Version 4
This version was created when Ground and Tie control points were renamed to Fixed and Free respectively. Version 4 Pvl control network files are identical to version 3 Pvl control network files, except for the new control point type values. When version 4 was created, the .proto file that defined control point protobuf messages was modified to allow for the new control point type names and the old names were flagged as deprecated. So, version 3 and version 4 binary control network files are formatted exactly the same.
Version 5
This version was created to allow for progressive reading and writing of binary control network files. Previous versions required the entire contents of binary control network files to be read into memory before the ControlNet, ControlPoint, and ControlMeasure objects could be created. Version 5 was created to allow binary control network files to be read one control point at a time. Similarly, previous versions required all of the information in the control network to be copied into protobuf structures before any of it could be written to a file.
Version 5 Pvl control network files are identical to version 4 Pvl control network files.
Version 5 binary control network files are formatted the same as version 4 binary control network files except for how they store the sizes of the control point messages in the Protobuf Core. In a version 5 binary control network file, each control point message is prepended by an unsigned, 32 bit, LSB, integer (c++ uint32_t) that contains the size of the message. This design was modeled after the delimited read and write functionality in the Java protobuf library. Additionally, the Protobuf Header contains the number of control points in the network instead of a list of all the control point message sizes. The structure of the Protobuf Header is defined by ControlNetFileHeaderV0005.proto. The structure of the protobuf messages in the Protobuf Core is defined by ControlPointFileEntryV0002.proto, the same as in version 4.
Starting with version 5, the naming scheme for .proto files was changed to use the same version number as the control net file format. So, the new .proto file defining the Protobuf Header was named ControlNetFileHeaderV0005.proto instead of ControlNetFileHeaderV0003.proto.
2011-04-14 Steven Lambright - Improved handling of V1 networks
2011-05-02 Tracie Sucharski - If Held=True exists in input net, set PointType=Ground.
2011-05-02 Debbie A. Cook - Created pvl version 3 which added point type of constrained.
2012-08-14 Steven Lambright - Simplified error handling of invalid target names in V1 networks (V1->V2 code).
2012-11-22 Debbie A. Cook - Changed to use TProjection instead of Projection. References #775.
2013-03-13 Steven Lambright and Stuart Sides - Added support for more V1 Pvl networks (specifically, isis3.2.1 hijitreg output networks with measures that lack Sample/Line and are set to unmeasured). Fixes #1554.
2016-04-22 Jeannie Backer - Updated error message in ConvertVersion1ToVersion2() to make it specific to this class call. This was done to reduce redundancy since the original message for this error was very similar to the caught exception to which it is appended. References #3892
2017-12-11 Jeannie Backer & Jesse Mapel - Created class skeleton for refactor.
2017-12-11 Jesse Mapel - Added VersionedControlNetHeaders.
2017-12-12 Kristin Berry - Added initial toPvl for refactor.
2017-12-12 Jeannie Backer - Added VersionedControlPoints.
2017-12-12 Jeannie Backer - Implemented createPoint() methods.
2017-12-13 Jeannie Backer - Added target radii to createPoint(V0006).
2017-12-18 Adam Goins and Kristin Berry - Added new write() method.
2017-12-19 Kristin Berry - Corrected method names and general cleanup in toPvl and write for refactor.
2017-12-20 Jesse Mapel - Made read and createPoint methods match new ControlPointV#### classes.
2017-12-20 Jeannie Backer - Updated toPvl and write methods to get surface point information from the ControlPoint.
2018-01-03 Jesse Mapel - Updated class documentation.
2018-01-04 Adam Goins - Updated read/write methods to read/write protobuf messages correctly.
2018-01-12 Adam Goins - Added the ControlPoint radii to the header to avoid Target::GetRadii calls to speed up createPoint().
2018-01-12 Adam Goins - Added Progress during reads.
2018-01-24 Jesse Mapel - Fixed c++11 build warnings.
2018-01-30 Adam Goins - Ensured point sizes are written/read as lsb by using EndianSwapper.
2018-02-25 Debbie A. Cook - Generalized calls to ControlPoint::IsLatitudeConstrained to IsCoord1Constained and added or updated a few comments. *** TODO *** make sure the new methods are fully functional for either coordinate type once the new header keyword is added.
2018-03-28 Adam Goins - Added targetRadii groups to the header. Changed the versioner to write these values out in a targetRadii group for both binary V0005 and PvlV0005 networks. Fixes #5361.
2018-04-05 Adam Goins - Added hasTargetRadii() and targetRadii() to the versioner so that these values can be grabbed from a ControlNet on read. Also Fixes #5361.
2018-06-01 Debbie A. Cook - (added to BundleXYZ 2018-02-25) Generalized calls to ControlPoint::IsLatitudeConstrained to IsCoord1Constained and added or updated a few comments. *** TODO *** make sure the new methods are fully functional for either coordinate type once the new header keyword is added.
Definition at line 426 of file ControlNetVersioner.h.
Typedef for consistent naming of containers for version 2.
Definition at line 492 of file ControlNetVersioner.h.
Typedef for consistent naming of containers for version 3.
Definition at line 494 of file ControlNetVersioner.h.
Typedef for consistent naming of containers for version 4.
Definition at line 496 of file ControlNetVersioner.h.
Typedef for consistent naming of containers for version 5.
Definition at line 498 of file ControlNetVersioner.h.
|
private |
Typedef for consistent naming of containers for version 4.
Definition at line 501 of file ControlNetVersioner.h.
|
private |
Typedef for consistent naming of containers for version 5.
Definition at line 503 of file ControlNetVersioner.h.
Isis::ControlNetVersioner::ControlNetVersioner | ( | ControlNet * | net | ) |
Construct a ControlNetVersioner from a control network.
This versioner can only be used to write out the control points in the control network. It is expected that the control points in the control network will not be deleted while the control net versioner persists.
net | A pointer to the network that will be written out. |
Definition at line 53 of file ControlNetVersioner.cpp.
References Isis::ControlNetVersioner::ControlNetHeaderV0001::created, Isis::ControlNet::CreatedDate(), createHeader(), Isis::ControlNet::Description(), Isis::ControlNetVersioner::ControlNetHeaderV0001::description, Isis::ControlNet::GetLastModified(), Isis::ControlNet::GetPoints(), Isis::ControlNet::GetTarget(), Isis::ControlNet::GetUserName(), Isis::ControlNetVersioner::ControlNetHeaderV0001::lastModified, m_points, Isis::ControlNetVersioner::ControlNetHeaderV0001::networkID, Isis::ControlNetVersioner::ControlNetHeaderV0001::targetName, and Isis::ControlNetVersioner::ControlNetHeaderV0001::userName.
Isis::ControlNetVersioner::ControlNetVersioner | ( | const FileName | netFile, |
Progress * | progress = NULL |
||
) |
Construct a ControlNetVersioner from a file.
The file will be read in and converted into a header object that contains general information about the network and a list of ControlPoints.
netFile | The control network file to read in. |
progress | The progress object to track reading points. |
Definition at line 80 of file ControlNetVersioner.cpp.
References read().
Isis::ControlNetVersioner::~ControlNetVersioner | ( | ) |
Destroy a ControlNetVersioner.
If the versioner owns the control points stored in it, they will also be deleted.
Definition at line 90 of file ControlNetVersioner.cpp.
References m_ownsPoints, and m_points.
|
private |
Default constructor. Intentially un-implemented.
|
private |
Copy constructor.
Intentially un-implemented.
other | The other ControlNetVersioner to create a copy of. |
|
private |
Create the internal header from a V0001 header.
The latest version is V0001, so this will check for an old issue with Mars target names and then internalize the header.
header | The V0001 header |
Definition at line 1636 of file ControlNetVersioner.cpp.
References m_header, and Isis::ControlNetVersioner::ControlNetHeaderV0001::targetName.
Referenced by ControlNetVersioner(), readProtobufV0001(), readProtobufV0002(), readProtobufV0005(), readPvlV0001(), readPvlV0002(), readPvlV0003(), readPvlV0004(), and readPvlV0005().
|
private |
Create a pointer to a ControlMeasure from a V0006 file.
measure | The versioned control measure to be created. |
Definition at line 1539 of file ControlNetVersioner.cpp.
References _FILEINFO_, Isis::ControlMeasure::Candidate, Isis::ControlMeasure::Manual, Isis::ControlMeasure::RegisteredPixel, Isis::ControlMeasure::RegisteredSubPixel, Isis::ControlMeasure::SetChooserName(), Isis::ControlMeasure::SetCoordinate(), Isis::ControlMeasure::SetCubeSerialNumber(), Isis::ControlMeasureLogData::SetDataType(), Isis::ControlMeasure::SetDateTime(), Isis::ControlMeasure::SetDiameter(), Isis::ControlMeasure::SetLogData(), Isis::ControlMeasureLogData::SetNumericalValue(), Isis::ControlMeasure::SetRejected(), Isis::ControlMeasure::SetResidual(), Isis::ControlMeasure::SetType(), and Isis::IException::User.
Referenced by createPoint().
|
private |
Create a pointer to a latest version ControlPoint from an object in a V0001 control net file.
This method converts a ControlPointV0001 to the latest ControlPontV#### version and uses the latest versioned point to construct and fill an Isis::ControlPoint.
point | The versioned control point to be updated. |
Definition at line 1300 of file ControlNetVersioner.cpp.
Referenced by createPoint(), readProtobufV0001(), readProtobufV0002(), readProtobufV0005(), readPvlV0001(), readPvlV0002(), readPvlV0003(), readPvlV0004(), and readPvlV0005().
|
private |
Create a pointer to a latest version ControlPoint from an object in a V0002 control net file.
This method converts a ControlPointV0002 to the latest ControlPontV#### version and uses the latest versioned point to construct and fill an Isis::ControlPoint.
point | The versioned control point to be updated. |
Definition at line 1317 of file ControlNetVersioner.cpp.
References createPoint().
|
private |
Create a pointer to a latest version ControlPoint from an object in a V0003 control net file.
This method converts a ControlPointV0003 to the latest ControlPontV#### version and uses the latest versioned point to construct and fill an Isis::ControlPoint.
point | The versioned control point to be updated. |
Definition at line 1336 of file ControlNetVersioner.cpp.
References _FILEINFO_, Isis::ControlPoint::Add(), Isis::ControlPoint::Constrained, createMeasure(), Isis::ControlPoint::Fixed, Isis::ControlPoint::Free, Isis::Displacement::Meters, Isis::ControlPointV0003::pointData(), Isis::IException::Programmer, Isis::ControlPoint::SetAdjustedSurfacePoint(), Isis::ControlPoint::SetAprioriRadiusSource(), Isis::ControlPoint::SetAprioriRadiusSourceFile(), Isis::ControlPoint::SetAprioriSurfacePoint(), Isis::ControlPoint::SetAprioriSurfacePointSource(), Isis::ControlPoint::SetAprioriSurfacePointSourceFile(), Isis::ControlPoint::SetChooserName(), Isis::ControlPoint::SetDateTime(), Isis::ControlPoint::SetEditLock(), Isis::ControlPoint::SetId(), Isis::ControlPoint::SetIgnored(), Isis::SurfacePoint::SetRectangularMatrix(), Isis::ControlPoint::SetRefMeasure(), Isis::ControlPoint::SetRejected(), Isis::ControlPoint::SetType(), Isis::toString(), and Isis::IException::User.
QString Isis::ControlNetVersioner::creationDate | ( | ) | const |
Returns the date and time that the network was created.
Definition at line 126 of file ControlNetVersioner.cpp.
References Isis::ControlNetVersioner::ControlNetHeaderV0001::created, and m_header.
Referenced by Isis::ControlNet::ReadControl().
QString Isis::ControlNetVersioner::description | ( | ) | const |
Returns the network's description.
Definition at line 146 of file ControlNetVersioner.cpp.
References Isis::ControlNetVersioner::ControlNetHeaderV0001::description, and m_header.
Referenced by Isis::ControlNet::ReadControl().
QString Isis::ControlNetVersioner::lastModificationDate | ( | ) | const |
Returns the date and time of the last modification to the network.
Definition at line 136 of file ControlNetVersioner.cpp.
References Isis::ControlNetVersioner::ControlNetHeaderV0001::lastModified, and m_header.
Referenced by Isis::ControlNet::ReadControl().
QString Isis::ControlNetVersioner::netId | ( | ) | const |
Returns the ID for the network.
Definition at line 106 of file ControlNetVersioner.cpp.
References m_header, and Isis::ControlNetVersioner::ControlNetHeaderV0001::networkID.
Referenced by Isis::ControlNetDiff::compare(), and Isis::ControlNet::ReadControl().
int Isis::ControlNetVersioner::numPoints | ( | ) | const |
Returns the number of points that have been read in or are ready to write out.
Definition at line 166 of file ControlNetVersioner.cpp.
References m_points.
Referenced by Isis::ControlNetDiff::compare(), Isis::ControlNet::ReadControl(), readProtobufV0002(), and write().
|
private |
Asssignment operator.
Intentially un-implemented.
other | The other ControlNetVersione to assign from. |
Read a control network file and prepare the data to be converted into a control network.
netFile | The control network file to read. |
progress | The progress object to track reading points. |
Definition at line 543 of file ControlNetVersioner.cpp.
References _FILEINFO_, Isis::FileName::expanded(), Isis::IException::Io, Isis::FileName::name(), readProtobuf(), and readPvl().
Referenced by ControlNetVersioner().
|
private |
Read a protobuf control network and prepare the data to be converted into a control network.
header | The Pvl network header that contains the version number. |
netFile | The filename of the control network file. |
progress | The progress object to track reading points. |
Definition at line 867 of file ControlNetVersioner.cpp.
References _FILEINFO_, Isis::PvlObject::findGroup(), Isis::PvlObject::findObject(), Isis::PvlContainer::hasKeyword(), Isis::IException::Io, readProtobufV0001(), readProtobufV0002(), readProtobufV0005(), Isis::toInt(), and Isis::toString().
Referenced by read().
|
private |
Read a protobuf version 1 control network and prepare the data to be converted into a control network.
header | The Pvl file header that contains byte offsets for the protobuf messages |
netFile | The filename of the control network file. |
progress | The progress object to track reading points. |
Definition at line 904 of file ControlNetVersioner.cpp.
References _FILEINFO_, Isis::Progress::CheckStatus(), Isis::PvlObject::clear(), Isis::ControlNetVersioner::ControlNetHeaderV0001::created, createHeader(), createPoint(), Isis::ControlNetVersioner::ControlNetHeaderV0001::description, Isis::FileName::expanded(), Isis::PvlObject::findObject(), Isis::ControlNetVersioner::ControlNetHeaderV0001::lastModified, m_points, Isis::FileName::name(), Isis::ControlNetVersioner::ControlNetHeaderV0001::networkID, Isis::IException::Programmer, Isis::Progress::SetMaximumSteps(), Isis::Progress::SetText(), Isis::ControlNetVersioner::ControlNetHeaderV0001::targetName, Isis::toString(), Isis::IException::User, and Isis::ControlNetVersioner::ControlNetHeaderV0001::userName.
Referenced by readProtobuf().
|
private |
Read a protobuf version 2 control network and prepare the data to be converted into a control network.
header | The Pvl file header that contains byte offsets for the protobuf messages |
netFile | The filename of the control network file. |
progress | The progress object to track reading points. |
Definition at line 1027 of file ControlNetVersioner.cpp.
References _FILEINFO_, Isis::Progress::CheckStatus(), Isis::ControlNetVersioner::ControlNetHeaderV0001::created, createHeader(), createPoint(), Isis::ControlNetVersioner::ControlNetHeaderV0001::description, Isis::FileName::expanded(), Isis::PvlObject::findObject(), Isis::IException::Io, Isis::ControlNetVersioner::ControlNetHeaderV0001::lastModified, m_points, Isis::FileName::name(), Isis::ControlNetVersioner::ControlNetHeaderV0001::networkID, numPoints(), Isis::IException::Programmer, Isis::Progress::SetMaximumSteps(), Isis::Progress::SetText(), Isis::ControlNetVersioner::ControlNetHeaderV0001::targetName, Isis::toString(), and Isis::ControlNetVersioner::ControlNetHeaderV0001::userName.
Referenced by readProtobuf().
|
private |
Read a protobuf version 5 control network and prepare the data to be converted into a control network.
header | The Pvl file header that contains byte offsets for the protobuf messages |
netFile | The filename of the control network file. |
progress | The progress object to track reading points. |
Definition at line 1146 of file ControlNetVersioner.cpp.
References _FILEINFO_, Isis::Progress::CheckStatus(), Isis::ControlNetVersioner::ControlNetHeaderV0001::created, createHeader(), createPoint(), Isis::ControlNetVersioner::ControlNetHeaderV0001::description, Isis::FileName::expanded(), Isis::PvlObject::findGroup(), Isis::PvlObject::findObject(), Isis::PvlObject::hasGroup(), Isis::PvlContainer::hasKeyword(), Isis::IException::Io, Isis::ControlNetVersioner::ControlNetHeaderV0001::lastModified, m_points, Isis::FileName::name(), Isis::ControlNetVersioner::ControlNetHeaderV0001::networkID, Isis::IException::Programmer, Isis::Progress::SetMaximumSteps(), Isis::Progress::SetText(), Isis::ControlNetVersioner::ControlNetHeaderV0001::targetName, Isis::toString(), Isis::EndianSwapper::Uint32_t(), and Isis::ControlNetVersioner::ControlNetHeaderV0001::userName.
Referenced by readProtobuf().
Read a Pvl control network and prepare the data to be converted into a control network.
network | The Pvl network data |
progress | The progress object to track reading points. |
Definition at line 574 of file ControlNetVersioner.cpp.
References _FILEINFO_, Isis::PvlObject::findObject(), Isis::PvlObject::hasKeyword(), readPvlV0001(), readPvlV0002(), readPvlV0003(), readPvlV0004(), readPvlV0005(), Isis::toInt(), Isis::toString(), and Isis::IException::Unknown.
Referenced by read().
|
private |
read a version 1 Pvl control network and convert the data into control points.
network | The control network PvlObject. |
progress | The progress object to track reading points. |
Definition at line 613 of file ControlNetVersioner.cpp.
References _FILEINFO_, Isis::Progress::CheckStatus(), Isis::ControlNetVersioner::ControlNetHeaderV0001::created, createHeader(), createPoint(), Isis::ControlNetVersioner::ControlNetHeaderV0001::description, Isis::PvlObject::findKeyword(), Isis::IException::Io, Isis::ControlNetVersioner::ControlNetHeaderV0001::lastModified, m_header, m_points, Isis::ControlNetVersioner::ControlNetHeaderV0001::networkID, Isis::PvlObject::object(), Isis::PvlObject::objects(), Isis::Progress::SetMaximumSteps(), Isis::Progress::SetText(), Isis::ControlNetVersioner::ControlNetHeaderV0001::targetName, Isis::toString(), and Isis::ControlNetVersioner::ControlNetHeaderV0001::userName.
Referenced by readPvl().
|
private |
read a version 2 Pvl control network and convert the data into control points.
network | The control network PvlObject. |
progress | The progress object to track reading points. |
Definition at line 666 of file ControlNetVersioner.cpp.
References _FILEINFO_, Isis::Progress::CheckStatus(), Isis::ControlNetVersioner::ControlNetHeaderV0001::created, createHeader(), createPoint(), Isis::ControlNetVersioner::ControlNetHeaderV0001::description, Isis::PvlObject::findKeyword(), Isis::IException::Io, Isis::ControlNetVersioner::ControlNetHeaderV0001::lastModified, m_points, Isis::ControlNetVersioner::ControlNetHeaderV0001::networkID, Isis::PvlObject::object(), Isis::PvlObject::objects(), Isis::Progress::SetMaximumSteps(), Isis::Progress::SetText(), Isis::ControlNetVersioner::ControlNetHeaderV0001::targetName, Isis::toString(), and Isis::ControlNetVersioner::ControlNetHeaderV0001::userName.
Referenced by readPvl().
|
private |
read a version 3 Pvl control network and convert the data into control points.
network | The control network PvlObject. |
progress | The progress object to track reading points. |
Definition at line 717 of file ControlNetVersioner.cpp.
References _FILEINFO_, Isis::Progress::CheckStatus(), Isis::ControlNetVersioner::ControlNetHeaderV0001::created, createHeader(), createPoint(), Isis::ControlNetVersioner::ControlNetHeaderV0001::description, Isis::PvlObject::findKeyword(), Isis::IException::Io, Isis::ControlNetVersioner::ControlNetHeaderV0001::lastModified, m_points, Isis::ControlNetVersioner::ControlNetHeaderV0001::networkID, Isis::PvlObject::object(), Isis::PvlObject::objects(), Isis::Progress::SetMaximumSteps(), Isis::Progress::SetText(), Isis::ControlNetVersioner::ControlNetHeaderV0001::targetName, Isis::toString(), and Isis::ControlNetVersioner::ControlNetHeaderV0001::userName.
Referenced by readPvl().
|
private |
read a version 4 Pvl control network and convert the data into control points.
network | The control network PvlObject. |
progress | The progress object to track reading points. |
Definition at line 767 of file ControlNetVersioner.cpp.
References _FILEINFO_, Isis::Progress::CheckStatus(), Isis::ControlNetVersioner::ControlNetHeaderV0001::created, createHeader(), createPoint(), Isis::ControlNetVersioner::ControlNetHeaderV0001::description, Isis::PvlObject::findKeyword(), Isis::IException::Io, Isis::ControlNetVersioner::ControlNetHeaderV0001::lastModified, m_points, Isis::ControlNetVersioner::ControlNetHeaderV0001::networkID, Isis::PvlObject::object(), Isis::PvlObject::objects(), Isis::Progress::SetMaximumSteps(), Isis::Progress::SetText(), Isis::ControlNetVersioner::ControlNetHeaderV0001::targetName, Isis::toString(), and Isis::ControlNetVersioner::ControlNetHeaderV0001::userName.
Referenced by readPvl().
|
private |
read a version 5 Pvl control network and convert the data into control points.
network | The control network PvlObject. |
progress | The progress object to track reading points. |
Definition at line 816 of file ControlNetVersioner.cpp.
References _FILEINFO_, Isis::Progress::CheckStatus(), Isis::ControlNetVersioner::ControlNetHeaderV0001::created, createHeader(), createPoint(), Isis::ControlNetVersioner::ControlNetHeaderV0001::description, Isis::PvlObject::findKeyword(), Isis::IException::Io, Isis::ControlNetVersioner::ControlNetHeaderV0001::lastModified, m_points, Isis::ControlNetVersioner::ControlNetHeaderV0001::networkID, Isis::PvlObject::object(), Isis::PvlObject::objects(), Isis::Progress::SetMaximumSteps(), Isis::Progress::SetText(), Isis::ControlNetVersioner::ControlNetHeaderV0001::targetName, Isis::toString(), and Isis::ControlNetVersioner::ControlNetHeaderV0001::userName.
Referenced by readPvl().
ControlPoint * Isis::ControlNetVersioner::takeFirstPoint | ( | ) |
Returns the first point stored in the versioner's internal list.
This method passes ownership of the point to the caller who is expected to delete it when done with it.
Definition at line 179 of file ControlNetVersioner.cpp.
References m_points.
Referenced by Isis::ControlNet::ReadControl().
QString Isis::ControlNetVersioner::targetName | ( | ) | const |
Returns the target for the network.
Definition at line 116 of file ControlNetVersioner.cpp.
References m_header, and Isis::ControlNetVersioner::ControlNetHeaderV0001::targetName.
Referenced by Isis::ControlNetDiff::compare(), and Isis::ControlNet::ReadControl().
Pvl Isis::ControlNetVersioner::toPvl | ( | ) |
Generates a Pvl file from the currently stored control points and header.
Definition at line 194 of file ControlNetVersioner.cpp.
References _FILEINFO_, Isis::PvlKeyword::addComment(), Isis::PvlObject::addGroup(), Isis::PvlObject::addObject(), Isis::ControlMeasure::Candidate, Isis::ControlPoint::Constrained, Isis::ControlNetVersioner::ControlNetHeaderV0001::created, Isis::Angle::degrees(), Isis::ControlNetVersioner::ControlNetHeaderV0001::description, Isis::PvlObject::findObject(), Isis::ControlPoint::Fixed, Isis::ControlMeasure::GetChooserName(), Isis::ControlMeasure::GetCubeSerialNumber(), Isis::ControlMeasure::GetDateTime(), Isis::ControlMeasure::GetDiameter(), Isis::ControlPoint::GetId(), Isis::SurfacePoint::GetLatitude(), Isis::SurfacePoint::GetLatSigmaDistance(), Isis::SurfacePoint::GetLocalRadius(), Isis::ControlMeasure::GetLogDataEntries(), Isis::SurfacePoint::GetLongitude(), Isis::SurfacePoint::GetLonSigmaDistance(), Isis::ControlPoint::GetMeasure(), Isis::ControlPoint::GetType(), Isis::ControlPoint::HasAprioriRadiusSourceFile(), Isis::ControlPoint::HasAprioriSurfacePointSourceFile(), Isis::ControlPoint::HasRefMeasure(), Isis::ControlPoint::IndexOfRefMeasure(), Isis::ControlPoint::IsCoord1Constrained(), Isis::ControlPoint::IsCoord2Constrained(), Isis::ControlMeasure::IsEditLocked(), Isis::ControlPoint::IsReferenceExplicit(), Isis::ControlNetVersioner::ControlNetHeaderV0001::lastModified, m_header, m_points, Isis::ControlMeasure::Manual, Isis::Displacement::meters(), Isis::Distance::meters(), Isis::ControlNetVersioner::ControlNetHeaderV0001::networkID, Isis::Null, Isis::ControlMeasure::RegisteredPixel, Isis::ControlMeasure::RegisteredSubPixel, Isis::ControlNetVersioner::ControlNetHeaderV0001::targetName, Isis::ControlMeasureLogData::ToKeyword(), Isis::toString(), Isis::IException::Unknown, and Isis::ControlNetVersioner::ControlNetHeaderV0001::userName.
Referenced by Isis::ControlNetDiff::compare(), and Isis::ControlNet::Write().
QString Isis::ControlNetVersioner::userName | ( | ) | const |
Returns the name of the last person or program to modify the network.
Definition at line 156 of file ControlNetVersioner.cpp.
References m_header, and Isis::ControlNetVersioner::ControlNetHeaderV0001::userName.
Referenced by Isis::ControlNet::ReadControl().
void Isis::ControlNetVersioner::write | ( | FileName | netFile | ) |
This will write a control net file object to disk.
netFile | The output filename that will be written to |
Definition at line 1651 of file ControlNetVersioner.cpp.
References _FILEINFO_, Isis::PvlObject::addGroup(), Isis::PvlContainer::addKeyword(), Isis::PvlObject::addObject(), Isis::ControlNetVersioner::ControlNetHeaderV0001::created, Isis::ControlNetVersioner::ControlNetHeaderV0001::description, Isis::FileName::expanded(), Isis::IException::Io, Isis::ControlNetVersioner::ControlNetHeaderV0001::lastModified, m_header, m_points, Isis::ControlNetVersioner::ControlNetHeaderV0001::networkID, numPoints(), Isis::ControlNetVersioner::ControlNetHeaderV0001::targetName, Isis::toString(), Isis::ControlNetVersioner::ControlNetHeaderV0001::userName, writeFirstPoint(), and writeHeader().
Referenced by Isis::ControlNet::Write().
|
private |
This will write the first control point to a file stream.
The written point will be removed from the versioner and then deleted if the versioner has ownership of it.
output | A pointer to the fileStream that we are writing the point to. |
Definition at line 1766 of file ControlNetVersioner.cpp.
References _FILEINFO_, Isis::ControlMeasure::Candidate, Isis::ControlPoint::Constrained, Isis::ControlPoint::Fixed, Isis::ControlPoint::Free, Isis::ControlMeasure::GetChooserName(), Isis::ControlMeasure::GetCubeSerialNumber(), Isis::ControlMeasureLogData::GetDataType(), Isis::ControlMeasure::GetDateTime(), Isis::ControlMeasure::GetDiameter(), Isis::ControlPoint::GetId(), Isis::SurfacePoint::GetLatSigmaDistance(), Isis::ControlMeasure::GetLogDataEntries(), Isis::SurfacePoint::GetLonSigmaDistance(), Isis::ControlPoint::GetMeasure(), Isis::ControlMeasureLogData::GetNumericalValue(), Isis::ControlPoint::GetType(), Isis::ControlPoint::HasAprioriRadiusSourceFile(), Isis::ControlPoint::HasAprioriSurfacePointSourceFile(), Isis::ControlPoint::HasRefMeasure(), Isis::ControlPoint::IndexOfRefMeasure(), Isis::ControlPoint::IsCoord1Constrained(), Isis::ControlPoint::IsCoord2Constrained(), Isis::ControlPoint::IsCoord3Constrained(), Isis::ControlMeasure::IsEditLocked(), Isis::ControlPoint::IsReferenceExplicit(), Isis::ControlMeasureLogData::IsValid(), m_ownsPoints, m_points, Isis::ControlMeasure::Manual, Isis::Displacement::meters(), Isis::Distance::meters(), Isis::Null, Isis::IException::Programmer, Isis::ControlMeasure::RegisteredPixel, Isis::ControlMeasure::RegisteredSubPixel, Isis::EndianSwapper::Uint32_t(), and Isis::IException::Unknown.
Referenced by write().
|
private |
This will read the binary protobuffer control network header to an fstream.
output | The fstream we're writing out to. |
Definition at line 1737 of file ControlNetVersioner.cpp.
References _FILEINFO_, Isis::ControlNetVersioner::ControlNetHeaderV0001::created, Isis::ControlNetVersioner::ControlNetHeaderV0001::description, Isis::IException::Io, Isis::ControlNetVersioner::ControlNetHeaderV0001::lastModified, m_header, Isis::ControlNetVersioner::ControlNetHeaderV0001::networkID, Isis::ControlNetVersioner::ControlNetHeaderV0001::targetName, and Isis::ControlNetVersioner::ControlNetHeaderV0001::userName.
Referenced by write().
|
private |
Header containing information about the whole network.
Definition at line 530 of file ControlNetVersioner.h.
Referenced by createHeader(), creationDate(), description(), lastModificationDate(), netId(), readPvlV0001(), targetName(), toPvl(), userName(), write(), and writeHeader().
|
private |
Flag if the versioner owns the control points stored in it.
This will be true when the versioner created the points from a file. This will be false when the versioner copied the points from an esiting control network.
Definition at line 534 of file ControlNetVersioner.h.
Referenced by writeFirstPoint(), and ~ControlNetVersioner().
|
private |
ControlPoints that are read in from a file or ready to be written out to a file.
Definition at line 532 of file ControlNetVersioner.h.
Referenced by ControlNetVersioner(), numPoints(), readProtobufV0001(), readProtobufV0002(), readProtobufV0005(), readPvlV0001(), readPvlV0002(), readPvlV0003(), readPvlV0004(), readPvlV0005(), takeFirstPoint(), toPvl(), write(), writeFirstPoint(), and ~ControlNetVersioner().