3 #include <boost/numeric/ublas/symmetric.hpp> 4 #include <boost/numeric/ublas/io.hpp> 9 #include "ControlNetFileHeaderV0002.pb.h" 10 #include "ControlNetFileHeaderV0005.pb.h" 11 #include "ControlNetLogDataProtoV0001.pb.h" 12 #include "ControlPointFileEntryV0002.pb.h" 35 #include <google/protobuf/io/zero_copy_stream_impl.h> 36 #include <google/protobuf/io/zero_copy_stream.h> 37 #include <google/protobuf/io/coded_stream.h> 39 using boost::numeric::ublas::symmetric_matrix;
40 using boost::numeric::ublas::upper;
53 ControlNetVersioner::ControlNetVersioner(
ControlNet *net)
54 : m_ownsPoints(false) {
81 : m_ownsPoints(true) {
82 read(netFile, progress);
217 pvlPoint +=
PvlKeyword(
"PointType",
"Constrained");
224 if ( controlPoint->
GetId().isEmpty() ) {
225 QString msg =
"Unable to write control net to PVL file. " 226 "Invalid control point has no point ID value.";
232 if ( QString::compare(controlPoint->GetChooserName(),
"Null", Qt::CaseInsensitive) != 0 ) {
233 pvlPoint +=
PvlKeyword(
"ChooserName", controlPoint->GetChooserName());
235 if ( QString::compare(controlPoint->GetDateTime(),
"Null", Qt::CaseInsensitive) != 0 ) {
236 pvlPoint +=
PvlKeyword(
"DateTime", controlPoint->GetDateTime());
238 if ( controlPoint->IsEditLocked() ) {
241 if ( controlPoint->IsIgnored() ) {
245 switch ( controlPoint->GetAprioriSurfacePointSource() ) {
246 case ControlPoint::SurfacePointSource::None:
248 case ControlPoint::SurfacePointSource::User:
249 pvlPoint +=
PvlKeyword(
"AprioriXYZSource",
"User");
251 case ControlPoint::SurfacePointSource::AverageOfMeasures:
252 pvlPoint +=
PvlKeyword(
"AprioriXYZSource",
"AverageOfMeasures");
254 case ControlPoint::SurfacePointSource::Reference:
255 pvlPoint +=
PvlKeyword(
"AprioriXYZSource",
"Reference");
257 case ControlPoint::SurfacePointSource::Basemap:
258 pvlPoint +=
PvlKeyword(
"AprioriXYZSource",
"Basemap");
260 case ControlPoint::SurfacePointSource::BundleSolution:
261 pvlPoint +=
PvlKeyword(
"AprioriXYZSource",
"BundleSolution");
266 pvlPoint +=
PvlKeyword(
"AprioriXYZSourceFile",
267 controlPoint->GetAprioriSurfacePointSourceFile());
270 switch ( controlPoint->GetAprioriRadiusSource() ) {
271 case ControlPoint::RadiusSource::None:
273 case ControlPoint::RadiusSource::User:
274 pvlPoint +=
PvlKeyword(
"AprioriRadiusSource",
"User");
276 case ControlPoint::RadiusSource::AverageOfMeasures:
277 pvlPoint +=
PvlKeyword(
"AprioriRadiusSource",
"AverageOfMeasures");
279 case ControlPoint::RadiusSource::BundleSolution:
280 pvlPoint +=
PvlKeyword(
"AprioriRadiusSource",
"BundleSolution");
282 case ControlPoint::RadiusSource::Ellipsoid:
283 pvlPoint +=
PvlKeyword(
"AprioriRadiusSource",
"Ellipsoid");
285 case ControlPoint::RadiusSource::DEM:
286 pvlPoint +=
PvlKeyword(
"AprioriRadiusSource",
"DEM");
291 pvlPoint +=
PvlKeyword(
"AprioriRadiusSourceFile",
292 controlPoint->GetAprioriRadiusSourceFile());
296 SurfacePoint aprioriSurfacePoint = controlPoint->GetAprioriSurfacePoint();
297 if ( aprioriSurfacePoint.Valid() ) {
313 pvlPoint += aprioriX;
314 pvlPoint += aprioriY;
315 pvlPoint += aprioriZ;
317 symmetric_matrix<double, upper> aprioriCovarianceMatrix =
318 aprioriSurfacePoint.GetRectangularMatrix();
320 if ( aprioriCovarianceMatrix.size1() > 0 ) {
324 matrix +=
toString(aprioriCovarianceMatrix(0, 0));
325 matrix +=
toString(aprioriCovarianceMatrix(0, 1));
326 matrix +=
toString(aprioriCovarianceMatrix(0, 2));
327 matrix +=
toString(aprioriCovarianceMatrix(1, 1));
328 matrix +=
toString(aprioriCovarianceMatrix(1, 2));
329 matrix +=
toString(aprioriCovarianceMatrix(2, 2));
337 QString sigmas =
"AprioriLatitudeSigma = " 339 +
" <meters> AprioriLongitudeSigma = " 341 +
" <meters> AprioriRadiusSigma = " 348 if ( aprioriCovarianceMatrix(0, 0) != 0.0
349 || aprioriCovarianceMatrix(0, 1) != 0.0
350 || aprioriCovarianceMatrix(0, 2) != 0.0
351 || aprioriCovarianceMatrix(1, 1) != 0.0
352 || aprioriCovarianceMatrix(1, 2) != 0.0
353 || aprioriCovarianceMatrix(2, 2) != 0.0 ) {
363 pvlPoint +=
PvlKeyword(
"LatitudeConstrained",
"True");
367 pvlPoint +=
PvlKeyword(
"LongitudeConstrained",
"True");
371 pvlPoint +=
PvlKeyword(
"RadiusConstrained",
"True");
375 SurfacePoint adjustedSurfacePoint = controlPoint->GetAdjustedSurfacePoint();
376 if ( adjustedSurfacePoint.Valid() ) {
394 pvlPoint += adjustedX;
395 pvlPoint += adjustedY;
396 pvlPoint += adjustedZ;
398 symmetric_matrix<double, upper> adjustedCovarianceMatrix =
399 adjustedSurfacePoint.GetRectangularMatrix();
401 if ( adjustedCovarianceMatrix.size1() > 0 ) {
403 PvlKeyword matrix(
"AdjustedCovarianceMatrix");
404 matrix +=
toString(adjustedCovarianceMatrix(0, 0));
405 matrix +=
toString(adjustedCovarianceMatrix(0, 1));
406 matrix +=
toString(adjustedCovarianceMatrix(0, 2));
407 matrix +=
toString(adjustedCovarianceMatrix(1, 1));
408 matrix +=
toString(adjustedCovarianceMatrix(1, 2));
409 matrix +=
toString(adjustedCovarianceMatrix(2, 2));
415 QString sigmas =
"AdjustedLatitudeSigma = " 417 +
" <meters> AdjustedLongitudeSigma = " 419 +
" <meters> AdjustedRadiusSigma = " 426 if ( adjustedCovarianceMatrix(0, 0) != 0.0
427 || adjustedCovarianceMatrix(0, 1) != 0.0
428 || adjustedCovarianceMatrix(0, 2) != 0.0
429 || adjustedCovarianceMatrix(1, 1) != 0.0
430 || adjustedCovarianceMatrix(1, 2) != 0.0
431 || adjustedCovarianceMatrix(2, 2) != 0.0 ) {
438 for (
int j = 0; j < controlPoint->GetNumMeasures(); j++) {
439 PvlGroup pvlMeasure(
"ControlMeasure");
443 switch ( controlMeasure.GetType() ) {
445 pvlMeasure +=
PvlKeyword(
"MeasureType",
"Candidate");
448 pvlMeasure +=
PvlKeyword(
"MeasureType",
"Manual");
451 pvlMeasure +=
PvlKeyword(
"MeasureType",
"RegisteredPixel");
454 pvlMeasure +=
PvlKeyword(
"MeasureType",
"RegisteredSubPixel");
458 if (QString::compare(controlMeasure.
GetChooserName(),
"Null", Qt::CaseInsensitive) != 0) {
461 if (QString::compare(controlMeasure.
GetDateTime(),
"Null", Qt::CaseInsensitive) != 0) {
468 if ( controlMeasure.IsIgnored() ) {
472 if ( controlMeasure.GetSample() !=
Isis::Null) {
477 if ( controlMeasure.GetLine() !=
Isis::Null ) {
486 if ( controlMeasure.GetAprioriSample() !=
Isis::Null ) {
487 pvlMeasure +=
PvlKeyword(
"AprioriSample",
toString(controlMeasure.GetAprioriSample()));
490 if ( controlMeasure.GetAprioriLine() !=
Isis::Null ) {
494 if ( controlMeasure.GetSampleSigma() !=
Isis::Null ) {
499 if ( controlMeasure.GetLineSigma() !=
Isis::Null ) {
504 if ( controlMeasure.GetSampleResidual() !=
Isis::Null ) {
506 toString(controlMeasure.GetSampleResidual()),
510 if ( controlMeasure.GetLineResidual() !=
Isis::Null ) {
515 if ( controlMeasure.IsRejected() ) {
526 pvlMeasure +=
PvlKeyword(
"Reference",
"True");
548 if ( network.hasObject(
"ProtoBuffer") ) {
551 else if ( network.hasObject(
"ControlNetwork") ) {
555 QString msg =
"Could not determine the control network file type";
560 QString msg =
"Reading the control network [" + netFile.
name()
580 version =
toInt(controlNetwork[
"Version"][0]);
600 QString msg =
"The Pvl file version [" +
toString(version)
601 +
"] is not supported";
627 QString msg =
"Missing required header information.";
632 progress->
SetText(
"Reading Control Points...");
638 for (
int objectIndex = 0; objectIndex < network.
objects(); objectIndex ++) {
652 QString msg =
"Failed to initialize control point at index [" 679 QString msg =
"Missing required header information.";
684 progress->
SetText(
"Reading Control Points...");
690 for (
int objectIndex = 0; objectIndex < network.
objects(); objectIndex ++) {
703 QString msg =
"Failed to initialize control point at index [" 730 QString msg =
"Missing required header information.";
735 progress->
SetText(
"Reading Control Points...");
741 for (
int objectIndex = 0; objectIndex < network.
objects(); objectIndex ++) {
753 QString msg =
"Failed to initialize control point at index [" 780 QString msg =
"Missing required header information.";
785 progress->
SetText(
"Reading Control Points...");
791 for (
int objectIndex = 0; objectIndex < network.
objects(); objectIndex ++) {
802 QString msg =
"Failed to initialize control point at index [" 829 QString msg =
"Missing required header information.";
834 progress->
SetText(
"Reading Control Points...");
840 for (
int objectIndex = 0; objectIndex < network.
objects(); objectIndex ++) {
851 QString msg =
"Failed to initialize control point at index [" 876 version =
toInt(netInfo[
"Version"][0]);
889 QString msg =
"The Protobuf file version [" +
toString(version)
890 +
"] is not supported";
910 BigInt coreStartPos = protoBufferCore[
"StartByte"];
911 BigInt coreLength = protoBufferCore[
"Bytes"];
913 fstream input(netFile.
expanded().toLatin1().data(), ios::in | ios::binary);
914 if ( !input.is_open() ) {
915 QString msg =
"Failed to open protobuf file [" + netFile.
name() +
"].";
919 input.seekg(coreStartPos, ios::beg);
920 IstreamInputStream inStream(&input);
921 CodedInputStream codedInStream(&inStream);
922 codedInStream.PushLimit(coreLength);
924 codedInStream.SetTotalBytesLimit(1024 * 1024 * 512, 1024 * 1024 * 400);
927 ControlNetFileProtoV0001 protoNet;
929 if ( !protoNet.ParseFromCodedStream(&codedInStream) ) {
930 QString msg =
"Failed to read input PB file [" + netFile.
name() +
"].";
935 QString msg =
"Cannot parse binary protobuf file";
939 QString msg =
"Cannot parse binary PB file";
944 BigInt logStartPos = logDataInfo[
"StartByte"];
945 BigInt logLength = logDataInfo[
"Bytes"];
948 input.seekg(logStartPos, ios::beg);
949 IstreamInputStream logInStream(&input);
950 CodedInputStream codedLogInStream(&logInStream);
951 codedLogInStream.PushLimit(logLength);
953 codedLogInStream.SetTotalBytesLimit(1024 * 1024 * 512, 1024 * 1024 * 400);
956 ControlNetLogDataProtoV0001 protoLogData;
958 if ( !protoLogData.ParseFromCodedStream(&codedLogInStream) ) {
959 QString msg =
"Failed to read log data in protobuf file [" + netFile.
name() +
"].";
964 QString msg =
"Cannot parse binary protobuf file's log data";
971 header.
networkID = protoNet.networkid().c_str();
972 if ( protoNet.has_targetname() ) {
973 header.
targetName = protoNet.targetname().c_str();
978 header.
created = protoNet.created().c_str();
980 header.
description = protoNet.description().c_str();
981 header.
userName = protoNet.username().c_str();
985 QString msg =
"Failed to parse the header from the protobuf control network file.";
990 progress->
SetText(
"Reading Control Points...");
996 for (
int i = 0; i < protoNet.points_size(); i++) {
999 protoPoint(
new ControlNetFileProtoV0001_PBControlPoint(protoNet.points(i)));
1001 protoPointLogData(
new ControlNetLogDataProtoV0001_Point(protoLogData.points(i)));
1011 QString msg =
"Failed to convert version 1 protobuf control point at index [" 1012 +
toString(i) +
"] into a ControlPoint.";
1034 BigInt headerStartPos = protoBufferCore[
"HeaderStartByte"];
1035 BigInt headerLength = protoBufferCore[
"HeaderBytes"];
1037 fstream input(netFile.
expanded().toLatin1().data(), ios::in | ios::binary);
1038 if ( !input.is_open() ) {
1039 QString msg =
"Failed to open control network file" + netFile.
name();
1043 input.seekg(headerStartPos, ios::beg);
1044 streampos filePos = input.tellg();
1046 ControlNetFileHeaderV0002 protoHeader;
1048 IstreamInputStream headerInStream(&input);
1049 CodedInputStream headerCodedInStream(&headerInStream);
1051 headerCodedInStream.SetTotalBytesLimit(1024 * 1024 * 512,
1053 CodedInputStream::Limit oldLimit = headerCodedInStream.PushLimit(headerLength);
1054 if ( !protoHeader.ParseFromCodedStream(&headerCodedInStream) ) {
1055 QString msg =
"Failed to parse protobuf header from input control net file [" 1056 + netFile.
name() +
"]";
1059 headerCodedInStream.PopLimit(oldLimit);
1060 filePos += headerLength;
1063 QString msg =
"An error occured while reading the protobuf control network header.";
1070 header.
networkID = protoHeader.networkid().c_str();
1071 if ( protoHeader.has_targetname() ) {
1072 header.
targetName = protoHeader.targetname().c_str();
1077 header.
created = protoHeader.created().c_str();
1078 header.
lastModified = protoHeader.lastmodified().c_str();
1079 header.
description = protoHeader.description().c_str();
1080 header.
userName = protoHeader.username().c_str();
1084 QString msg =
"Missing required header information.";
1091 input.open(netFile.
expanded().toLatin1().data(), ios::in | ios::binary);
1092 input.seekg(filePos, ios::beg);
1093 IstreamInputStream pointInStream(&input);
1094 int numPoints = protoHeader.pointmessagesizes_size();
1097 progress->
SetText(
"Reading Control Points...");
1102 for (
int pointIndex = 0; pointIndex <
numPoints; pointIndex ++) {
1106 CodedInputStream pointCodedInStream(&pointInStream);
1107 pointCodedInStream.SetTotalBytesLimit(1024 * 1024 * 512,
1109 int pointSize = protoHeader.pointmessagesizes(pointIndex);
1110 CodedInputStream::Limit oldPointLimit = pointCodedInStream.PushLimit(pointSize);
1111 newPoint->ParseFromCodedStream(&pointCodedInStream);
1112 pointCodedInStream.PopLimit(oldPointLimit);
1115 QString msg =
"Failed to read protobuf version 2 control point at index [" 1130 QString msg =
"Failed to convert protobuf version 2 control point at index [" 1131 +
toString(pointIndex) +
"] into a ControlPoint.";
1154 BigInt headerStartPos = protoBufferCore[
"HeaderStartByte"];
1155 BigInt headerLength = protoBufferCore[
"HeaderBytes"];
1156 BigInt pointsLength = protoBufferCore[
"PointsBytes"];
1158 fstream input(netFile.
expanded().toLatin1().data(), ios::in | ios::binary);
1159 if ( !input.is_open() ) {
1160 QString msg =
"Failed to open control network file" + netFile.
name();
1164 input.seekg(headerStartPos, ios::beg);
1166 streampos filePos = input.tellg();
1168 ControlNetFileHeaderV0005 protoHeader;
1171 IstreamInputStream headerInStream(&input);
1172 CodedInputStream headerCodedInStream(&headerInStream);
1175 headerCodedInStream.SetTotalBytesLimit(1024 * 1024 * 512,
1178 CodedInputStream::Limit oldLimit = headerCodedInStream.PushLimit(headerLength);
1180 if ( !protoHeader.ParseFromCodedStream(&headerCodedInStream) ) {
1181 QString msg =
"Failed to parse protobuf header from input control net file [" 1182 + netFile.
name() +
"]";
1186 headerCodedInStream.PopLimit(oldLimit);
1188 filePos += headerLength;
1191 QString msg =
"An error occured while reading the protobuf control network header.";
1197 header.
networkID = protoHeader.networkid().c_str();
1198 if ( protoHeader.has_targetname() ) {
1199 header.
targetName = protoHeader.targetname().c_str();
1204 header.
created = protoHeader.created().c_str();
1205 header.
lastModified = protoHeader.lastmodified().c_str();
1206 header.
description = protoHeader.description().c_str();
1207 header.
userName = protoHeader.username().c_str();
1211 QString msg =
"Missing required header information.";
1218 input.open(netFile.
expanded().toLatin1().data(), ios::in | ios::binary);
1219 input.seekg(filePos, ios::beg);
1221 IstreamInputStream pointInStream(&input);
1223 BigInt numberOfPoints = 0;
1225 if ( protoBufferInfo.
hasGroup(
"ControlNetworkInfo") ) {
1228 if ( networkInfo.
hasKeyword(
"NumberOfPoints") ) {
1230 numberOfPoints = networkInfo[
"NumberOfPoints"];
1238 if (progress && numberOfPoints != 0) {
1239 progress->
SetText(
"Reading Control Points...");
1245 int pointIndex = -1;
1246 while (pointInStream.ByteCount() < pointsLength) {
1252 CodedInputStream pointCodedInStream(&pointInStream);
1253 pointCodedInStream.SetTotalBytesLimit(1024 * 1024 * 512,
1257 pointCodedInStream.ReadRaw(reinterpret_cast<char *>(&size),
sizeof(size));
1261 CodedInputStream::Limit oldPointLimit = pointCodedInStream.PushLimit(size);
1262 newPoint->ParseFromCodedStream(&pointCodedInStream);
1263 pointCodedInStream.PopLimit(oldPointLimit);
1266 QString msg =
"Failed to read protobuf version 2 control point at index [" 1275 if (progress && numberOfPoints != 0) {
1281 QString msg =
"Failed to convert protobuf version 2 control point at index [" 1282 +
toString(pointIndex) +
"] into a ControlPoint.";
1338 ControlPointFileEntryV0002 protoPoint = point.
pointData();
1342 controlPoint->
SetId(QString(protoPoint.id().c_str()));
1344 if ( protoPoint.has_choosername() ) {
1350 switch ( protoPoint.type() ) {
1351 case ControlPointFileEntryV0002_PointType_obsolete_Tie:
1352 case ControlPointFileEntryV0002_PointType_Free:
1355 case ControlPointFileEntryV0002_PointType_Constrained:
1358 case ControlPointFileEntryV0002_PointType_obsolete_Ground:
1359 case ControlPointFileEntryV0002_PointType_Fixed:
1363 QString msg =
"Unable to create ControlPoint [" +
toString(protoPoint.id().c_str())
1364 +
"] from file. Type enumeration [" +
toString((
int)(protoPoint.type()))
1369 controlPoint->
SetType(pointType);
1371 if ( protoPoint.has_ignore() ) {
1372 controlPoint->
SetIgnored(protoPoint.ignore());
1374 if ( protoPoint.has_jigsawrejected() ) {
1375 controlPoint->
SetRejected(protoPoint.jigsawrejected());
1379 if ( protoPoint.has_aprioriradiussource() ) {
1381 switch ( protoPoint.aprioriradiussource() ) {
1382 case ControlPointFileEntryV0002_AprioriSource_None:
1385 case ControlPointFileEntryV0002_AprioriSource_User:
1388 case ControlPointFileEntryV0002_AprioriSource_AverageOfMeasures:
1391 case ControlPointFileEntryV0002_AprioriSource_Ellipsoid:
1394 case ControlPointFileEntryV0002_AprioriSource_DEM:
1397 case ControlPointFileEntryV0002_AprioriSource_BundleSolution:
1402 QString msg =
"Unknown control point apriori radius source.";
1408 if ( protoPoint.has_aprioriradiussourcefile() ) {
1413 if ( protoPoint.has_apriorisurfpointsource() ) {
1414 switch ( protoPoint.apriorisurfpointsource() ) {
1415 case ControlPointFileEntryV0002_AprioriSource_None:
1419 case ControlPointFileEntryV0002_AprioriSource_User:
1423 case ControlPointFileEntryV0002_AprioriSource_AverageOfMeasures:
1425 ControlPoint::SurfacePointSource::AverageOfMeasures);
1428 case ControlPointFileEntryV0002_AprioriSource_Reference:
1432 case ControlPointFileEntryV0002_AprioriSource_Basemap:
1436 case ControlPointFileEntryV0002_AprioriSource_BundleSolution:
1438 ControlPoint::SurfacePointSource::BundleSolution);
1442 QString msg =
"Unknown control point aprioir surface point source.";
1448 if ( protoPoint.has_apriorisurfpointsourcefile() ) {
1450 protoPoint.apriorisurfpointsourcefile().c_str());
1453 if ( protoPoint.has_apriorix()
1454 && protoPoint.has_aprioriy()
1455 && protoPoint.has_aprioriz() ) {
1461 if ( protoPoint.aprioricovar_size() > 0 ) {
1462 symmetric_matrix<double, upper> aprioriCovarianceMatrix;
1463 aprioriCovarianceMatrix.resize(3);
1464 aprioriCovarianceMatrix.clear();
1465 aprioriCovarianceMatrix(0, 0) = protoPoint.aprioricovar(0);
1466 aprioriCovarianceMatrix(0, 1) = protoPoint.aprioricovar(1);
1467 aprioriCovarianceMatrix(0, 2) = protoPoint.aprioricovar(2);
1468 aprioriCovarianceMatrix(1, 1) = protoPoint.aprioricovar(3);
1469 aprioriCovarianceMatrix(1, 2) = protoPoint.aprioricovar(4);
1470 aprioriCovarianceMatrix(2, 2) = protoPoint.aprioricovar(5);
1479 if ( protoPoint.has_adjustedx()
1480 && protoPoint.has_adjustedy()
1481 && protoPoint.has_adjustedz() ) {
1487 if ( protoPoint.adjustedcovar_size() > 0 ) {
1488 symmetric_matrix<double, upper> adjustedCovarianceMatrix;
1489 adjustedCovarianceMatrix.resize(3);
1490 adjustedCovarianceMatrix.clear();
1491 adjustedCovarianceMatrix(0, 0) = protoPoint.adjustedcovar(0);
1492 adjustedCovarianceMatrix(0, 1) = protoPoint.adjustedcovar(1);
1493 adjustedCovarianceMatrix(0, 2) = protoPoint.adjustedcovar(2);
1494 adjustedCovarianceMatrix(1, 1) = protoPoint.adjustedcovar(3);
1495 adjustedCovarianceMatrix(1, 2) = protoPoint.adjustedcovar(4);
1496 adjustedCovarianceMatrix(2, 2) = protoPoint.adjustedcovar(5);
1503 SurfacePoint aprioriSurfacePoint = controlPoint->GetAprioriSurfacePoint();
1504 SurfacePoint adjustedSurfacePoint = controlPoint->GetAdjustedSurfacePoint();
1509 for (
int m = 0 ; m < protoPoint.measures_size(); m++) {
1513 if ( protoPoint.has_referenceindex() ) {
1518 if ( protoPoint.has_datetime() ) {
1519 controlPoint->
SetDateTime(protoPoint.datetime().c_str());
1522 if ( protoPoint.has_editlock() ) {
1526 return controlPoint;
1540 const ControlPointFileEntryV0002_Measure &measure) {
1549 switch ( measure.type() ) {
1550 case ControlPointFileEntryV0002_Measure::Candidate:
1553 case ControlPointFileEntryV0002_Measure::Manual:
1556 case ControlPointFileEntryV0002_Measure::RegisteredPixel:
1559 case ControlPointFileEntryV0002_Measure::RegisteredSubPixel:
1563 QString msg =
"Unknown control measure type.";
1567 newMeasure->
SetType(measureType);
1569 if ( measure.has_jigsawrejected() ) {
1570 newMeasure->
SetRejected(measure.jigsawrejected());
1572 if ( measure.has_ignore() ) {
1573 newMeasure->SetIgnored(measure.ignore());
1575 if ( measure.has_line() ) {
1576 newMeasure->
SetCoordinate(measure.sample(), measure.line());
1578 if ( measure.has_diameter() ) {
1581 if ( measure.has_apriorisample() ) {
1582 newMeasure->SetAprioriSample(measure.apriorisample());
1584 if ( measure.has_aprioriline() ) {
1585 newMeasure->SetAprioriLine(measure.aprioriline());
1587 if ( measure.has_samplesigma() ) {
1588 newMeasure->SetSampleSigma(measure.samplesigma());
1590 if ( measure.has_linesigma() ) {
1591 newMeasure->SetLineSigma(measure.linesigma());
1593 if ( measure.has_sampleresidual()
1594 && measure.has_lineresidual() ) {
1595 newMeasure->
SetResidual(measure.sampleresidual(), measure.lineresidual());
1598 for (
int i = 0; i < measure.log_size(); i++) {
1600 const ControlPointFileEntryV0002_Measure_MeasureLogData &protoLog = measure.log(i);
1602 if ( protoLog.has_doubledatatype() ) {
1605 if ( protoLog.has_doubledatavalue() ) {
1611 if ( measure.has_choosername() ) {
1612 newMeasure->
SetChooserName(QString(measure.choosername().c_str()));
1615 if ( measure.has_datetime() ) {
1616 newMeasure->
SetDateTime(QString(measure.datetime().c_str()));
1621 if ( measure.has_editlock() ) {
1622 newMeasure->SetEditLock(measure.editlock());
1654 const int labelBytes = 65536;
1655 fstream output(netFile.
expanded().toLatin1().data(), ios::out | ios::trunc | ios::binary);
1656 char *blankLabel =
new char[labelBytes];
1657 memset(blankLabel, 0, labelBytes);
1658 output.write(blankLabel, labelBytes);
1659 delete [] blankLabel;
1661 int numMeasures = 0;
1664 numMeasures += point->GetNumMeasures();
1667 streampos startCoreHeaderPos = output.tellp();
1671 BigInt pointByteTotal = 0;
1677 ControlNetFileHeaderV0005 protobufHeader;
1686 streampos coreHeaderSize = protobufHeader.ByteSize();
1697 BigInt pointsStartByte = (
BigInt) (startCoreHeaderPos + coreHeaderSize);
1705 PvlGroup netInfo(
"ControlNetworkInfo");
1706 netInfo.addComment(
"This group is for informational purposes only");
1707 netInfo +=
PvlKeyword(
"NetworkId", protobufHeader.networkid().c_str());
1708 netInfo +=
PvlKeyword(
"TargetName", protobufHeader.targetname().c_str());
1709 netInfo +=
PvlKeyword(
"UserName", protobufHeader.username().c_str());
1710 netInfo +=
PvlKeyword(
"Created", protobufHeader.created().c_str());
1711 netInfo +=
PvlKeyword(
"LastModified", protobufHeader.lastmodified().c_str());
1712 netInfo +=
PvlKeyword(
"Description", protobufHeader.description().c_str());
1720 output.seekp(0, ios::beg);
1727 QString msg =
"Can't write control net file";
1740 ControlNetFileHeaderV0005 protobufHeader;
1750 if ( !protobufHeader.SerializeToOstream(output) ) {
1751 QString msg =
"Failed to write output control network file.";
1768 BigInt startPos = output->tellp();
1770 ControlPointFileEntryV0002 protoPoint;
1773 if ( controlPoint->
GetId().isEmpty() ) {
1774 QString msg =
"Unbable to write first point of control net. " 1775 "Invalid control point has no point ID value.";
1779 protoPoint.set_id(controlPoint->
GetId().toLatin1().data());
1782 if ( QString::compare(controlPoint->GetChooserName(),
"Null", Qt::CaseInsensitive) != 0 ) {
1783 protoPoint.set_choosername(controlPoint->GetChooserName().toLatin1().data());
1785 if ( QString::compare(controlPoint->GetDateTime(),
"Null", Qt::CaseInsensitive) != 0 ) {
1786 protoPoint.set_datetime(controlPoint->GetDateTime().toLatin1().data());
1788 if ( controlPoint->IsEditLocked() ) {
1789 protoPoint.set_editlock(
true);
1792 ControlPointFileEntryV0002_PointType pointType;
1793 switch ( controlPoint->
GetType() ) {
1795 pointType = ControlPointFileEntryV0002_PointType_Free;
1798 pointType = ControlPointFileEntryV0002_PointType_Constrained;
1801 pointType = ControlPointFileEntryV0002_PointType_Fixed;
1804 pointType = ControlPointFileEntryV0002_PointType_Free;
1807 protoPoint.set_type(pointType);
1809 if ( controlPoint->IsIgnored() ) {
1810 protoPoint.set_ignore(
true);
1813 if ( controlPoint->IsRejected() ) {
1814 protoPoint.set_jigsawrejected(
true);
1822 protoPoint.set_apriorisurfpointsourcefile(
1823 controlPoint->GetAprioriSurfacePointSourceFile().toLatin1().data());
1827 switch ( controlPoint->GetAprioriSurfacePointSource() ) {
1828 case ControlPoint::SurfacePointSource::None:
1829 protoPoint.set_apriorisurfpointsource(ControlPointFileEntryV0002_AprioriSource_None);
1831 case ControlPoint::SurfacePointSource::User:
1832 protoPoint.set_apriorisurfpointsource(ControlPointFileEntryV0002_AprioriSource_User);
1834 case ControlPoint::SurfacePointSource::AverageOfMeasures:
1835 protoPoint.set_apriorisurfpointsource(
1836 ControlPointFileEntryV0002_AprioriSource_AverageOfMeasures);
1838 case ControlPoint::SurfacePointSource::Reference:
1839 protoPoint.set_apriorisurfpointsource(
1840 ControlPointFileEntryV0002_AprioriSource_Reference);
1842 case ControlPoint::SurfacePointSource::Basemap:
1843 protoPoint.set_apriorisurfpointsource(ControlPointFileEntryV0002_AprioriSource_Basemap);
1845 case ControlPoint::SurfacePointSource::BundleSolution:
1846 protoPoint.set_apriorisurfpointsource(
1847 ControlPointFileEntryV0002_AprioriSource_BundleSolution);
1850 protoPoint.set_apriorisurfpointsource(ControlPointFileEntryV0002_AprioriSource_None);
1855 switch ( controlPoint->GetAprioriRadiusSource() ) {
1856 case ControlPoint::RadiusSource::None:
1857 protoPoint.set_aprioriradiussource(ControlPointFileEntryV0002_AprioriSource_None);
1859 case ControlPoint::RadiusSource::User:
1860 protoPoint.set_aprioriradiussource(ControlPointFileEntryV0002_AprioriSource_User);
1862 case ControlPoint::RadiusSource::AverageOfMeasures:
1863 protoPoint.set_aprioriradiussource(
1864 ControlPointFileEntryV0002_AprioriSource_AverageOfMeasures);
1866 case ControlPoint::RadiusSource::BundleSolution:
1867 protoPoint.set_aprioriradiussource(
1868 ControlPointFileEntryV0002_AprioriSource_BundleSolution);
1870 case ControlPoint::RadiusSource::Ellipsoid:
1871 protoPoint.set_aprioriradiussource(ControlPointFileEntryV0002_AprioriSource_Ellipsoid);
1873 case ControlPoint::RadiusSource::DEM:
1874 protoPoint.set_aprioriradiussource(ControlPointFileEntryV0002_AprioriSource_DEM);
1877 protoPoint.set_aprioriradiussource(ControlPointFileEntryV0002_AprioriSource_None);
1882 protoPoint.set_aprioriradiussourcefile(
1883 controlPoint->GetAprioriRadiusSourceFile().toLatin1().data());
1886 SurfacePoint aprioriSurfacePoint = controlPoint->GetAprioriSurfacePoint();
1887 if ( aprioriSurfacePoint.Valid() ) {
1888 protoPoint.set_apriorix(aprioriSurfacePoint.GetX().
meters());
1889 protoPoint.set_aprioriy(aprioriSurfacePoint.GetY().
meters());
1890 protoPoint.set_aprioriz(aprioriSurfacePoint.GetZ().
meters());
1892 symmetric_matrix<double, upper> aprioriCovarianceMatrix =
1893 aprioriSurfacePoint.GetRectangularMatrix();
1894 if ( aprioriCovarianceMatrix.size1() > 0 &&
1899 protoPoint.add_aprioricovar(aprioriCovarianceMatrix(0, 0));
1900 protoPoint.add_aprioricovar(aprioriCovarianceMatrix(0, 1));
1901 protoPoint.add_aprioricovar(aprioriCovarianceMatrix(0, 2));
1902 protoPoint.add_aprioricovar(aprioriCovarianceMatrix(1, 1));
1903 protoPoint.add_aprioricovar(aprioriCovarianceMatrix(1, 2));
1904 protoPoint.add_aprioricovar(aprioriCovarianceMatrix(2, 2));
1919 SurfacePoint adjustedSurfacePoint = controlPoint->GetAdjustedSurfacePoint();
1920 if ( adjustedSurfacePoint.Valid() ) {
1922 protoPoint.set_adjustedx(adjustedSurfacePoint.GetX().
meters());
1923 protoPoint.set_adjustedy(adjustedSurfacePoint.GetY().
meters());
1924 protoPoint.set_adjustedz(adjustedSurfacePoint.GetZ().
meters());
1926 symmetric_matrix<double, upper> adjustedCovarianceMatrix =
1927 adjustedSurfacePoint.GetRectangularMatrix();
1928 if ( adjustedCovarianceMatrix.size1() > 0 ) {
1929 protoPoint.add_adjustedcovar(adjustedCovarianceMatrix(0, 0));
1930 protoPoint.add_adjustedcovar(adjustedCovarianceMatrix(0, 1));
1931 protoPoint.add_adjustedcovar(adjustedCovarianceMatrix(0, 2));
1932 protoPoint.add_adjustedcovar(adjustedCovarianceMatrix(1, 1));
1933 protoPoint.add_adjustedcovar(adjustedCovarianceMatrix(1, 2));
1934 protoPoint.add_adjustedcovar(adjustedCovarianceMatrix(2, 2));
1939 for (
int j = 0; j < controlPoint->GetNumMeasures(); j++) {
1943 ControlPointFileEntryV0002_Measure protoMeasure;
1947 switch ( controlMeasure.GetType() ) {
1949 protoMeasure.set_type(ControlPointFileEntryV0002_Measure_MeasureType_Candidate);
1953 protoMeasure.set_type(ControlPointFileEntryV0002_Measure_MeasureType_Manual);
1957 protoMeasure.set_type(
1958 ControlPointFileEntryV0002_Measure_MeasureType_RegisteredPixel);
1962 protoMeasure.set_type(
1963 ControlPointFileEntryV0002_Measure_MeasureType_RegisteredSubPixel);
1967 if (QString::compare(controlMeasure.
GetChooserName(),
"Null", Qt::CaseInsensitive) != 0) {
1968 protoMeasure.set_choosername(controlMeasure.
GetChooserName().toLatin1().data());
1971 if (QString::compare(controlMeasure.
GetDateTime(),
"Null", Qt::CaseInsensitive) != 0) {
1972 protoMeasure.set_datetime(controlMeasure.
GetDateTime().toLatin1().data());
1976 protoMeasure.set_editlock(
true);
1979 if ( controlMeasure.IsIgnored() ) {
1980 protoMeasure.set_ignore(
true);
1983 if ( controlMeasure.IsRejected() ) {
1984 protoMeasure.set_jigsawrejected(
true);
1987 if ( controlMeasure.GetSample() !=
Isis::Null ) {
1988 protoMeasure.set_sample(controlMeasure.GetSample());
1991 if ( controlMeasure.GetLine() !=
Isis::Null ) {
1992 protoMeasure.set_line(controlMeasure.GetLine());
1996 protoMeasure.set_diameter(controlMeasure.
GetDiameter());
1999 if ( controlMeasure.GetAprioriSample() !=
Isis::Null ) {
2000 protoMeasure.set_apriorisample(controlMeasure.GetAprioriSample());
2003 if ( controlMeasure.GetAprioriLine() !=
Isis::Null ) {
2004 protoMeasure.set_aprioriline(controlMeasure.GetAprioriLine());
2007 if ( controlMeasure.GetSampleSigma() !=
Isis::Null ) {
2008 protoMeasure.set_samplesigma(controlMeasure.GetSampleSigma());
2011 if ( controlMeasure.GetLineSigma() !=
Isis::Null ) {
2012 protoMeasure.set_linesigma(controlMeasure.GetLineSigma());
2015 if ( controlMeasure.GetSampleResidual() !=
Isis::Null ) {
2016 protoMeasure.set_sampleresidual(controlMeasure.GetSampleResidual());
2019 if ( controlMeasure.GetLineResidual() !=
Isis::Null ) {
2020 protoMeasure.set_lineresidual(controlMeasure.GetLineResidual());
2023 if ( controlMeasure.IsRejected() ) {
2024 protoMeasure.set_jigsawrejected(
true);
2028 for (
int logEntry = 0; logEntry < measureLogs.size(); logEntry ++) {
2032 ControlPointFileEntryV0002_Measure_MeasureLogData logData;
2035 logData.set_doubledatatype( (
int) log.
GetDataType() );
2039 *protoMeasure.add_log() = logData;
2042 *protoPoint.add_measures() = protoMeasure;
2045 uint32_t byteSize = protoPoint.ByteSize();
2048 byteSize = lsb.
Uint32_t(&byteSize);
2050 output->write(reinterpret_cast<char *>(&byteSize),
sizeof(byteSize));
2052 if ( !protoPoint.SerializeToOstream(output) ) {
2053 QString err =
"Error writing to coded protobuf stream";
2059 delete controlPoint;
2060 controlPoint = NULL;
2062 BigInt currentPos = output->tellp();
2063 BigInt byteCount = currentPos - startPos;
This class defines a body-fixed surface point.
PvlObject & object(const int index)
Return the object at the specified index.
Status SetType(MeasureType type)
Set how the coordinate was obtained.
ControlMeasure * createMeasure(const ControlPointFileEntryV0002_Measure &)
Create a pointer to a ControlMeasure from a V0006 file.
long long int BigInt
Big int.
Status SetAprioriSurfacePointSource(SurfacePointSource::Source source)
This updates the source of the surface point.
~ControlNetVersioner()
Destroy a ControlNetVersioner.
double meters() const
Get the distance in meters.
PvlKeyword ToKeyword() const
This converts the log data to a PvlKeyword.
bool hasKeyword(const QString &name) const
Check to see if a keyword exists.
const double Null
Value for an Isis Null pixel.
bool IsReferenceExplicit() const
void SetMaximumSteps(const int steps)
This sets the maximum number of steps in the process.
void Add(ControlMeasure *measure)
Add a measurement to the control point, taking ownership of the measure in the process.
NumericLogDataType GetDataType() const
Get the data type associated with this log data.
PvlGroupIterator findGroup(const QString &name, PvlGroupIterator beg, PvlGroupIterator end)
Find a group with the specified name, within these indexes.
(e.g., autoseed, interest) AKA predicted, unmeasured, unverified
QString creationDate() const
Returns the date and time that the network was created.
void clear()
Remove everything from the current PvlObject.
A Constrained point is a Control Point whose lat/lon/radius is somewhat established and should not be...
A Fixed point is a Control Point whose lat/lon is well established and should not be changed...
File name manipulation and expansion.
Pvl toPvl()
Generates a Pvl file from the currently stored control points and header.
int objects() const
Returns the number of objects.
Status SetAprioriRadiusSourceFile(QString sourceFile)
This updates the filename of the DEM that the apriori radius came from.
QString lastModificationDate() const
Returns the date and time of the last modification to the network.
bool IsCoord3Constrained()
Return bool indicating if 3rd coordinate is Constrained or not.
const ControlMeasure * GetMeasure(QString serialNumber) const
Get a control measure based on its cube's serial number.
Status SetIgnored(bool newIgnoreStatus)
Set whether to ignore or use control point.
PvlObjectIterator findObject(const QString &name, PvlObjectIterator beg, PvlObjectIterator end)
Find the index of object with a specified name, between two indexes.
NumericLogDataType
Please do not change existing values in this list except the size - it will break backwards compadibi...
QString GetUserName() const
Return the user name.
void writeHeader(std::fstream *output)
This will read the binary protobuffer control network header to an fstream.
void addGroup(const Isis::PvlGroup &group)
Add a group to the object.
int toInt(const QString &string)
Global function to convert from a string to an integer.
PointType
These are the valid 'types' of point.
Statistical and similar ControlMeasure associated information.
QList< ControlPoint * > m_points
ControlPoints that are read in from a file or ready to be written out to a file.
double meters() const
Get the displacement in meters.
bool HasAprioriSurfacePointSourceFile() const
Checks to see if the surface point source file has been set.
Namespace for the standard library.
void SetNumericalValue(double value)
This updates the value associated with a NumericLogDataType.
QList< ControlPoint *> GetPoints()
Return QList of all the ControlPoints in the network.
QString name() const
Returns the name of the file excluding the path and the attributes in the file name.
Distance GetLatSigmaDistance() const
Return the latitude sigma as a Distance.
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...
bool hasGroup(const QString &name) const
Returns a boolean value based on whether the object has the specified group or not.
Status SetChooserName(QString name)
Set the point's chooser name.
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
void addKeyword(const PvlKeyword &keyword, const InsertMode mode=Append)
Add a keyword to the container.
Distance GetLonSigmaDistance() const
Return the longitude sigma in meters.
Registered to whole pixel (e.g.,pointreg)
Registered to sub-pixel (e.g., pointreg)
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
This error is for when a programmer made an API call that was illegal.
A type of error that occurred when performing an actual I/O operation.
Status SetEditLock(bool editLock)
Set the EditLock state.
void readPvlV0001(const PvlObject &network, Progress *progress=NULL)
read a version 1 Pvl control network and convert the data into control points.
The distance is being specified in meters.
Status SetRejected(bool rejected)
Set "jigsaw" rejected flag for a measure.
QString GetTarget() const
Return the target name.
Latitude GetLatitude() const
Return the body-fixed latitude for the surface point.
void readPvlV0002(const PvlObject &network, Progress *progress=NULL)
read a version 2 Pvl control network and convert the data into control points.
bool HasAprioriRadiusSourceFile() const
Checks to see if the radius source file has been set.
double degrees() const
Get the angle in units of Degrees.
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 CheckStatus()
Checks and updates the status.
Status SetAdjustedSurfacePoint(SurfacePoint newSurfacePoint)
Set or update the surface point relating to this control point.
bool hasKeyword(const QString &kname, FindOptions opts) const
See if a keyword is in the current PvlObject, or deeper inside other PvlObjects and Pvlgroups within ...
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 Free point is a Control Point that identifies common measurements between two or more cubes...
void addObject(const PvlObject &object)
Add a PvlObject.
Status SetDiameter(double diameter)
Set the crater diameter at the coordinate.
A container for the information stored in a version 3 and 4 ControlPoint.
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...
Status SetAprioriSurfacePointSourceFile(QString sourceFile)
This updates the filename of where the apriori surface point came from.
void readPvlV0005(const PvlObject &network, Progress *progress=NULL)
read a version 5 Pvl control network and convert the data into control points.
void addComment(QString comment)
Add a comment to the PvlKeyword.
void SetRectangularMatrix(const boost::numeric::ublas::symmetric_matrix< double, boost::numeric::ublas::upper > &covar, SurfacePoint::CoordUnits units=SurfacePoint::Meters)
Set rectangular covariance matrix and store in units of km**2.
bool IsValid() const
This tests if the log data is complete and valid.
Program progress reporter.
QString Description() const
Return the description of the network.
Status SetResidual(double sampResidual, double lineResidual)
Set the BundleAdjust Residual of the coordinate.
int writeFirstPoint(std::fstream *output)
This will write the first control point to a file stream.
QString description() const
Returns the network's description.
Hand Measured (e.g., qnet)
QString GetId() const
Return the Id of the control point.
void SetText(const QString &text)
Changes the value of the text string reported just before 0% processed.
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...
PvlKeyword & findKeyword(const QString &kname, FindOptions opts)
Finds a keyword in the current PvlObject, or deeper inside other PvlObjects and Pvlgroups within this...
Status SetDateTime(QString newDateTime)
Set the point's last modified time.
Contains multiple PvlContainers.
bool IsCoord2Constrained()
Return bool indicating if 2nd coordinate is Constrained or not.
#define _FILEINFO_
Macro for the filename and line number.
Status SetRefMeasure(ControlMeasure *cm)
Set the point's reference measure.
void SetLogData(ControlMeasureLogData)
This adds or updates the log data information associated with data's type.
A type of error that could only have occurred due to a mistake on the user's part (e...
Status SetAprioriSurfacePoint(SurfacePoint aprioriSP)
This updates the apriori surface point.
A single keyword-value pair.
A type of error that cannot be classified as any of the other error types.
bool IsCoord1Constrained()
Return bool indicating if 1st coordinate is Constrained or not.
QString expanded() const
Returns a QString of the full file name including the file path, excluding the attributes.
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.
Container for cube-like labels.
QString GetChooserName() const
Return the chooser name.
MeasureType
Control network measurement types.
Status SetRejected(bool rejected)
Set the jigsawRejected state.
Status SetType(PointType newType)
Updates the control point's type.
QString targetName() const
Returns the target for the network.
Status SetId(QString id)
Sets the Id of the control point.
void SetDataType(NumericLogDataType newDataType)
This changes the type of this log data.
A container for the information stored in a version 1 ControlPoint.
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
QString CreatedDate() const
Return the Created Date.
void write(FileName netFile)
This will write a control net file object to disk.
ControlPoint * takeFirstPoint()
Returns the first point stored in the versioner's internal list.
ControlNetHeaderV0005 m_header
Header containing information about the whole network.
Longitude GetLongitude() const
Return the body-fixed longitude for the surface point.
bool HasRefMeasure() const
Checks to see if a reference measure is set.
QString GetDateTime() const
Return the date/time the coordinate was last changed.
QVector< ControlMeasureLogData > GetLogDataEntries() const
Return all of the log data for the measure.
int IndexOfRefMeasure() const
Displacement is a signed length, usually in meters.
QString netId() const
Returns the ID for the network.
Status SetChooserName()
Set chooser name to a user who last changed the coordinate.
ControlNetVersioner()
Default constructor. Intentially un-implemented.
Namespace for ISIS/Bullet specific routines.
bool IsEditLocked() const
Return value for p_editLock or implicit lock on reference measure.
Status SetCubeSerialNumber(QString newSerialNumber)
Set cube serial number.
Status SetCoordinate(double sample, double line)
Set the coordinate of the measurement.
bool m_ownsPoints
Flag if the versioner owns the control points stored in it.
Status SetDateTime()
Date Time - Creation Time.
double GetNumericalValue() const
Get the value associated with this log data.
PointType GetType() const
Distance GetLocalRadius() const
Return the radius of the surface point.
ControlPoint * createPoint(ControlPointV0001 &point)
Create a pointer to a latest version ControlPoint from an object in a V0001 control net file...
QString userName() const
Returns the name of the last person or program to modify the network.
Contains Pvl Groups and Pvl Objects.
uint32_t Uint32_t(void *buf)
Swaps a 32bit unsigned integer.
A container for the information stored in a version 2 ControlPoint.
Status SetAprioriRadiusSource(RadiusSource::Source source)
This updates the source of the radius of the apriori surface point.
void readPvl(const Pvl &network, Progress *progress=NULL)
Read a Pvl control network and prepare the data to be converted into a control network.
double GetDiameter() const
Return the diameter of the crater in pixels (0 implies no crater)
void createHeader(const ControlNetHeaderV0001 header)
Create the internal header from a V0001 header.
const ControlPointFileEntryV0002 & pointData()
Access the protobuf control point data.
QString GetCubeSerialNumber() const
Return the serial number of the cube containing the coordinate.
QString GetLastModified() const
Return the last modified date.
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
int numPoints() const
Returns the number of points that have been read in or are ready to write out.