9#include "ControlNetFilter.h"
15#include "CameraFactory.h"
16#include "ControlMeasure.h"
17#include "ControlMeasureLogData.h"
18#include "ControlNet.h"
19#include "ControlPoint.h"
25#include "SerialNumberList.h"
26#include "Statistics.h"
30typedef std::numeric_limits< double > dbl;
34#define UNDEFINED_STATUS 2
68 QString outName(outFile.expanded());
69 mOstm.open(outName.toLatin1().data(), std::ios::out);
70 mOstm.precision(dbl::digits10);
92 if (
mCNet->GetPoint(pindex)->IsEditLocked() ) {
93 mCNet->GetPoint(pindex)->SetEditLock(
false);
112 bool pointEditFlag =
false;
113 QString ptId(measure->Parent()->GetId());
115 if (point->IsEditLocked()) {
117 pointEditFlag =
true;
120 msr->SetEditLock(
false);
134 mOstm <<
"PointID, PointType, PointIgnored, PointEditLocked, TotalMeasures, MeasuresIgnored, MeasuresEditLocked, ";
146 <<
", " <<
sBoolean[(int)pcPoint.IsIgnored()] <<
", "
147 <<
sBoolean[(int)pcPoint.IsEditLocked()] <<
", "
148 << pcPoint.GetNumMeasures() <<
", "
149 << pcPoint.GetNumMeasures() - pcPoint.GetNumValidMeasures() <<
", "
150 << pcPoint.GetNumLockedMeasures() <<
", ";
162 mOstm << pcMeasure.GetCubeSerialNumber();
171 mOstm <<
"FileName, SerialNumber, ImageTotalPoints, ImagePointsIgnored, ImagePointsEditLocked, ImagePointsFixed, ImagePointsConstrained, ImagePointsFree, ImageConvexHullRatio";
186 if (pvlGrp.hasKeyword(
"LessThan")) {
187 dLesser = fabs((
double)pvlGrp[
"LessThan"]);
190 if (pvlGrp.hasKeyword(
"GreaterThan")) {
191 dGreater = fabs((
double)pvlGrp[
"GreaterThan"]);
194 if (dLesser < 0 || dGreater < 0 || dLesser <= dGreater) {
195 string sErrMsg =
"Invalid Deffile - Check Point_PixelShift Group\n";
201 mOstm <<
"PointID, PointType, PointIgnored, PointEditLocked, FileName, SerialNumber, PixelShift, MeasureType, MeasureIgnored, MeasureEditLocked, Reference";
206 for (
int i = (iNumPoints - 1); i >= 0; i--) {
208 int iNumMeasures = cPoint->GetNumMeasures();
210 for (
int j = 0; j < iNumMeasures; j++){
212 double dPixelShift = measure->GetPixelShift();
213 if (dPixelShift <= dLesser && dPixelShift >= dGreater) {
225 for (
int j = 0; j < iNumMeasures; j++) {
226 mOstm << cPoint->GetId() <<
", " <<
sPointType[cPoint->GetType()] <<
", "
227 <<
sBoolean[cPoint->IsIgnored()] <<
", "
228 <<
sBoolean[cPoint->IsEditLocked()] <<
", ";
232 double dPixelShift = measure->GetPixelShift();
234 << measure->GetMeasureTypeString() <<
", "
235 <<
sBoolean[measure->IsIgnored()] <<
", "
236 <<
sBoolean[measure->IsEditLocked()] <<
", "
237 <<
sBoolean[cPoint->GetRefMeasure() == measure]
258 int iLesser = VALID_MAX2;
261 if (pvlGrp.hasKeyword(
"LessThan")) {
262 iLesser =
toInt(pvlGrp[
"LessThan"][0]);
265 if (pvlGrp.hasKeyword(
"GreaterThan")) {
266 iGreater =
toInt(pvlGrp[
"GreaterThan"][0]);
269 if (iLesser < 0 || iGreater < 0 || iLesser < iGreater) {
270 string sErrMsg =
"Invalid Deffile - Check Point_MeasureEditLock Group\n";
277 mOstm <<
"FileName, SerialNumber, MeasureType, MeasureIgnored, MeasureEditLocked, Reference" << endl;
281 for (
int i = (iNumPoints - 1); i >= 0; i--) {
283 int iNumLockedMsr = cPoint->GetNumLockedMeasures();
285 if (iNumLockedMsr > iLesser || iNumLockedMsr < iGreater) {
290 int iNumMeasures = cPoint->GetNumMeasures();
292 for (
int j = 0; j < iNumMeasures; j++) {
296 mOstm <<
", " << cm->GetMeasureTypeString() <<
", "
297 <<
sBoolean[cm->IsIgnored()] <<
", "
298 <<
sBoolean[cm->IsEditLocked()] <<
", "
299 <<
sBoolean[cm == cPoint->GetRefMeasure()]
320 bool editLock =
false;
322 if (pvlGrp.hasKeyword(
"EditLock")) {
323 if(pvlGrp[
"EditLock"][0] ==
"1" ||
IString(pvlGrp[
"EditLock"][0]).DownCase() ==
"true")
333 for (
int i = (iNumPoints - 1); i >= 0; i--) {
335 if (cPoint->IsEditLocked() != editLock) {
341 int iNumMeasures = cPoint->GetNumMeasures();
342 mOstm << cPoint->GetId() <<
", " <<
sPointType[cPoint->GetType()] <<
", "
343 <<
sBoolean[cPoint->IsIgnored()] <<
", "
344 <<
sBoolean[cPoint->IsEditLocked()] <<
", "
345 << iNumMeasures <<
", "
346 << (iNumMeasures - cPoint->GetNumValidMeasures()) <<
", "
347 << cPoint->GetNumLockedMeasures() << endl;
370 if (pvlGrp.hasKeyword(
"LessThan")) {
371 if (pvlGrp[
"LessThan"][0] !=
"") {
372 dLesser = fabs((
double)pvlGrp[
"LessThan"]);
376 if (pvlGrp.hasKeyword(
"GreaterThan")) {
377 if (pvlGrp[
"GreaterThan"][0] !=
"") {
378 dGreater = fabs((
double)pvlGrp[
"GreaterThan"]);
382 if (dLesser < 0 || dGreater < 0 || dLesser < dGreater) {
383 string sErrMsg =
"Invalid Deffile - Check Point_ResidualMagnitude Group\n";
389 mOstm <<
"PointID, PointType, PointIgnored, PointEditLocked, FileName, SerialNumber, ResidualMagnitude, MeasureType, MeasureIgnored, MeasureEditLocked, Reference";
394 for (
int i = (iNumPoints - 1); i >= 0; i--) {
397 int iNumMeasures = cPoint->GetNumMeasures();
398 for (
int j = 0; j < iNumMeasures; j++) {
401 if (dResMag <= dLesser && dResMag >= dGreater) {
412 else if (pbLastFilter) {
414 for (
int j = 0; j < iNumMeasures; j++) {
415 mOstm << cPoint->GetId() <<
", " <<
sPointType[cPoint->GetType()] <<
", "
416 <<
sBoolean[cPoint->IsIgnored()] <<
", "
417 <<
sBoolean[cPoint->IsEditLocked()] <<
", ";
421 double dResMag = measure->GetResidualMagnitude();
423 << measure->GetMeasureTypeString() <<
", "
424 <<
sBoolean[measure->IsIgnored()] <<
", "
425 <<
sBoolean[measure->IsEditLocked()] <<
", "
426 <<
sBoolean[cPoint->GetRefMeasure() == measure]
446 QString sPointIDExpr = pvlGrp[
"Expression"][0];
447 QString sSeparator(
"*");
448 QStringList strTokens = sPointIDExpr.split(sSeparator, QString::SkipEmptyParts);
450 int iTokenSize = (int)strTokens.size();
453 odb <<
"Net Size=" << iNumPoints << endl;
461 for (
int i = (iNumPoints - 1); i >= 0; i--) {
463 QString sPointID = cPoint->GetId();
465 for (
int j = (iTokenSize - 1); j >= 0; j--) {
466 int iLen = strTokens[j].length();
468 int found = sPointID.indexOf(strTokens[j], iPosition);
470 iPosition = found + iLen;
472 if (pbLastFilter && j == (iTokenSize - 1)) {
500 int iLesser = VALID_MAX2, iGreater = 0;
502 if (pvlGrp.hasKeyword(
"LessThan")) {
503 if (pvlGrp[
"LessThan"][0] !=
"") {
504 iLesser =
toInt(pvlGrp[
"LessThan"][0]);
508 if (pvlGrp.hasKeyword(
"GreaterThan")) {
509 if (pvlGrp[
"GreaterThan"][0] !=
"") {
510 iGreater =
toInt(pvlGrp[
"GreaterThan"][0]);
514 if (iLesser < 0 || iGreater < 0 || iLesser < iGreater) {
515 string sErrMsg =
"Invalid Deffile - Check Point_NumMeasures Group\n";
522 mOstm <<
"FileName, SerialNum, MeasureType, MeasureIgnore, MeasureEditLock, Reference" << endl;
527 for (
int i = (iNumPoints - 1); i >= 0; i--) {
529 int iNumMeasures = cPoint->GetNumMeasures();
530 if (iNumMeasures > iLesser || iNumMeasures < iGreater) {
535 for (
int j = 0; j < iNumMeasures; j++) {
539 mOstm <<
", " << cm->GetMeasureTypeString() <<
", "
540 <<
sBoolean[cm->IsIgnored()] <<
", "
541 <<
sBoolean[cm->IsEditLocked()] <<
", "
542 <<
sBoolean[cm == cPoint->GetRefMeasure()]
562 bool bIgnoredFlag =
false;
563 int iSetIgnoreFlag = 0;
567 if (pvlGrp.hasKeyword(
"PointType")) {
568 if (pvlGrp[
"PointType"][0] !=
"") {
569 sType = pvlGrp[
"PointType"][0];
574 if (pvlGrp.hasKeyword(
"Ignore")) {
576 sTemp = pvlGrp[
"Ignore"][0];
577 if (sTemp ==
"1" || sTemp.DownCase() ==
"true") {
589 for (
int i = (iNumPoints - 1); i >= 0; i--) {
591 bool bPointFound =
false;
592 bool bIgnored = cPoint->IsIgnored();
597 if (!iSetIgnoreFlag || bIgnoredFlag == bIgnored) {
598 if (sType ==
"all" || sType==
"") {
601 else if (sType ==
"fixed" && bFixed) {
604 else if (sType ==
"constrained" && bConstrained) {
607 else if (sType ==
"free" && bFree) {
641 if (pvlGrp.hasKeyword(
"MinLat")) {
642 if (pvlGrp[
"MinLat"][0] !=
"") {
643 dMinLat = pvlGrp[
"MinLat"];
647 if (pvlGrp.hasKeyword(
"MaxLat")) {
648 if (pvlGrp[
"MaxLat"][0] !=
"") {
649 dMaxLat = pvlGrp[
"MaxLat"];
653 if (pvlGrp.hasKeyword(
"MinLon")) {
654 if (pvlGrp[
"MinLon"][0] !=
"") {
655 dMinLon = pvlGrp[
"MinLon"];
659 if (pvlGrp.hasKeyword(
"MaxLon")) {
660 if (pvlGrp[
"MaxLon"][0] !=
"") {
661 dMaxLon = pvlGrp[
"MaxLon"];
665 if (dMinLat > dMaxLat || dMinLon > dMaxLon) {
666 string sErrMsg =
"Invalid Deffile - Check Point_LatLon Group\n";
673 mOstm <<
"Latitude, Longitude, Radius" << endl;
678 for (
int i = (iNumPoints - 1); i >= 0; i--) {
680 SurfacePoint cPointSurfPt = cPoint->GetAdjustedSurfacePoint();
682 if (!cPointSurfPt.Valid()) {
687 Cube cube(filename,
"r");
690 if (camera->
SetImage(cm->GetSample(), cm->GetLine())) {
691 cPointSurfPt.SetSpherical(
700 double longitude = cPointSurfPt.GetLongitude().degrees();
702 if ((latitude < dMinLat || latitude > dMaxLat) ||
703 (longitude < dMinLon ||longitude > dMaxLon)) {
710 mOstm << latitude <<
", " << longitude <<
", " <<
711 cPointSurfPt.GetLocalRadius().meters() << endl;
729 double dMaxDistance = 0;
730 QString sUnits =
"pixels";
732 if (pvlGrp.hasKeyword(
"MaxDistance")) {
733 if (pvlGrp[
"MaxDistance"][0] !=
"") {
734 dMaxDistance = pvlGrp[
"MaxDistance"];
738 if (pvlGrp.hasKeyword(
"Units")) {
739 sUnits = pvlGrp[
"Units"][0];
744 mOstm <<
"Point#Distance >>, " << endl;
747 bool bMinDistance =
false;
749 for (
int i = (iNumPoints - 1); i >= 0; i--) {
757 if (sUnits ==
"meters") {
758 surfacePt1 = cp1->GetAdjustedSurfacePoint();
760 if (!surfacePt1.Valid()) {
761 QString sn1 = cp1RefMeasure->GetCubeSerialNumber();
763 Cube cube1(filename1,
"r");
765 if (cam1->SetImage(cp1RefMeasure->GetSample(),
766 cp1RefMeasure->GetLine())) {
767 surfacePt1.SetSpherical(
780 dSample1 = cp1RefMeasure->GetSample();
781 dLine1 = cp1RefMeasure->GetLine();
797 if (sUnits ==
"meters") {
798 surfacePt2 = cp2->GetAdjustedSurfacePoint();
800 if (!surfacePt2.Valid()) {
801 QString sn2 = cp2RefMeasure->GetCubeSerialNumber();
803 Cube cube2(filename2,
"r");
806 if (cam2->SetImage(cp2RefMeasure->GetSample(),
807 cp2RefMeasure->GetLine())) {
808 surfacePt2.SetSpherical(
818 dDist = surfacePt1.GetDistanceToPoint(surfacePt2,
819 surfacePt1.GetLocalRadius()).meters();
824 dSample2 = cp2RefMeasure->GetSample();
825 dLine2 = cp2RefMeasure->GetLine();
827 double dDeltaSamp = dSample1 - dSample2;
828 double dDeltaLine = dLine1 - dLine2;
830 dDist = sqrt((dDeltaSamp * dDeltaSamp) + (dDeltaLine * dDeltaLine));
833 if (dDist <= dMaxDistance) {
838 mOstm << cp2->GetId() <<
"#" << dDist <<
", ";
848 if (pbLastFilter && bMinDistance) {
851 bMinDistance =
false;
874 if (pvlGrp.hasKeyword(
"LessThan")){
875 if (pvlGrp[
"LessThan"][0] !=
"") {
876 dLesser = fabs((
double)(pvlGrp[
"LessThan"]));
880 if (pvlGrp.hasKeyword(
"GreaterThan")){
881 if (pvlGrp[
"GreaterThan"][0] !=
"") {
882 dGreater = fabs((
double)pvlGrp[
"GreaterThan"]);
888 mOstm <<
"FileName, SerialNumber, GoodnessOfFit, MeasureType, MeasureIgnored, MeasureEditLocked, Reference" << endl;
892 for (
int i=(iNumPoints-1); i>=0; i--) {
894 int iNumMeasures = cPoint->GetNumMeasures();
895 bool bMatchFlag=
false;
897 for (
int j=0; j<iNumMeasures; j++) {
900 if (dMsrGFit >= dGreater && dMsrGFit <= dLesser) {
912 int iNumMeasures = cPoint->GetNumMeasures();
913 int iNumMsIgnored = iNumMeasures - cPoint->GetNumValidMeasures();
914 for (
int j = 0; j < iNumMeasures; j++) {
918 mOstm << cPoint->GetId() <<
", " <<
sPointType[cPoint->GetType()] <<
", "
919 <<
sBoolean[cPoint->IsIgnored()] <<
", " <<
sBoolean[cPoint->IsEditLocked()] <<
", "
920 << iNumMeasures <<
", " << iNumMsIgnored <<
", " << cPoint->GetNumLockedMeasures() <<
", ";
923 << measure->GetMeasureTypeString() <<
", "
924 <<
sBoolean[measure->IsIgnored()] <<
", "
925 <<
sBoolean[measure->IsEditLocked()] <<
", "
926 <<
sBoolean[cPoint->GetRefMeasure() == measure]
946 int iIgnoredFlag = -1;
950 if (pvlGrp.hasKeyword(
"Ignore")) {
952 if (
IString(pvlGrp[
"Ignore"][0]).DownCase() ==
"true")
956 if (pvlGrp.hasKeyword(
"MeasureType")) {
962 mOstm <<
"FileName, SerialNumber, MeasureIgnored, MeasureType, MeasureEditLocked, Reference," << endl;
966 for (
int i = (iNumPoints - 1); i >= 0; i--) {
969 int iNumMeasures = cPoint->GetNumMeasures();
970 int iNotMeasureType = 0;
971 for (
int j = 0; j < iNumMeasures; j++) {
973 bool bMeasureIgnored = cMeasure->IsIgnored();
974 bool bMeasureFound =
false;
976 if (iIgnoredFlag == -1 || bMeasureIgnored == iIgnoredFlag) {
977 if (sType ==
"all" || sType ==
"") {
978 bMeasureFound =
true;
981 bMeasureFound =
true;
984 bMeasureFound =
true;
987 bMeasureFound =
true;
990 bMeasureFound =
true;
996 QString sn = cMeasure->GetCubeSerialNumber();
998 <<
sBoolean[(int) cMeasure->IsIgnored()] <<
", "
999 << cMeasure->GetMeasureTypeString() <<
", "
1000 <<
sBoolean[cMeasure->IsEditLocked()] <<
", "
1001 <<
sBoolean[cPoint->GetRefMeasure() == cMeasure]
1009 if (iNotMeasureType == iNumMeasures) {
1028 QVector<QString> sCubeNames;
1031 for (
int i = 0; i < pvlGrp.keywords(); i++) {
1032 sCubeNames.push_back(pvlGrp[i][0]);
1035 int size = sCubeNames.size();
1040 mOstm <<
", ImageMeasureIgnored, ImageMeasureEditLocked";
1045 for (
int i = (iNumPoints - 1); i >= 0; i--) {
1047 int iNumMeasures = cPoint->GetNumMeasures();
1048 int iNumNoMatch = 0;
1049 bool bMatch =
false;
1050 for (
int j = 0; j < iNumMeasures; j++) {
1052 for (
int k = 0; k < size; k++) {
1053 if (cMeasure->GetCubeSerialNumber() == sCubeNames[k]) {
1062 if (iNumNoMatch == iNumMeasures) {
1073 for (
int i = 0; i < iNumPoints; i++) {
1075 int iNumMeasures = cPoint->GetNumMeasures();
1076 for (
int j = 0; j < iNumMeasures; j++) {
1080 mOstm << cPoint->GetId() <<
", " <<
sPointType[cPoint->GetType()] <<
", "
1081 <<
sBoolean[cPoint->IsIgnored()] <<
", "
1082 <<
sBoolean[cPoint->IsEditLocked()] <<
", "
1083 << iNumMeasures <<
", "
1084 << iNumMeasures - cPoint->GetNumValidMeasures() <<
", "
1085 << cPoint->GetNumLockedMeasures() <<
", ";
1088 QString sn = cMeasure->GetCubeSerialNumber();
1091 << imgStats[imgTotalPoints] <<
", " << imgStats[imgIgnoredPoints] <<
", "
1092 << imgStats[imgLockedPoints] <<
", " << imgStats[imgFixedPoints] <<
", "
1093 << imgStats[imgConstrainedPoints] <<
", " << imgStats[imgFreePoints] <<
", "
1094 << imgStats[imgConvexHullRatio] <<
", "
1095 <<
sBoolean[cMeasure->IsIgnored()] <<
", " <<
sBoolean[cMeasure->IsEditLocked()] << endl;
1117 double dGreater = 0;
1119 if (pvlGrp.hasKeyword(
"LessThan")) {
1120 if (pvlGrp[
"LessThan"][0] !=
"") {
1121 dLesser = fabs((
double)pvlGrp[
"LessThan"]);
1125 if (pvlGrp.hasKeyword(
"GreaterThan")) {
1126 if (pvlGrp[
"GreaterThan"][0] !=
"") {
1127 dGreater = fabs((
double)pvlGrp[
"GreaterThan"]);
1131 if (dLesser < 0 || dGreater < 0 || dLesser <= dGreater) {
1132 string sErrMsg =
"Invalid Deffile - Check Cube_ConvexHullRatio Group\n";
1144 for (
int sn = (iNumCubes - 1); sn >= 0; sn--) {
1147 double convexHullRatio = imgStats[imgConvexHullRatio];
1148 if (convexHullRatio < dGreater || convexHullRatio > dLesser){
1152 else if (pbLastFilter) {
1154 << imgStats[imgTotalPoints] <<
", " << imgStats[imgIgnoredPoints] <<
", " << imgStats[imgLockedPoints] <<
", "
1155 << imgStats[imgFixedPoints] <<
", " << imgStats[imgConstrainedPoints] <<
", " << imgStats[imgFreePoints] <<
", "
1156 << imgStats[imgConvexHullRatio]<< endl;
1174 QString sCubeExpr(
"");
1175 if (pvlGrp.hasKeyword(
"Expression")) {
1176 sCubeExpr = QString(pvlGrp[
"Expression"][0]);
1179 QString sSeparator(
"*");
1180 QStringList strTokens = sCubeExpr.split(sSeparator, QString::SkipEmptyParts);
1182 int iTokenSize = (int)strTokens.size();
1190 for (
int i = (iNumCubes - 1); i >= 0; i--) {
1194 for (
int j = (iTokenSize - 1); j >= 0; j--) {
1195 int iLen = strTokens[j].length();
1197 int found = sSerialNum.indexOf(strTokens[j], iPosition);
1199 iPosition = found + iLen;
1201 if (j == (iTokenSize - 1)) {
1219 for (
int i = 0; i < iNumCubes; i++) {
1225 << imgStats[imgTotalPoints] <<
", " << imgStats[imgIgnoredPoints] <<
", " << imgStats[imgLockedPoints] <<
", "
1226 << imgStats[imgFixedPoints] <<
", " << imgStats[imgConstrainedPoints] <<
", " << imgStats[imgFreePoints] <<
", "
1227 << imgStats[imgConvexHullRatio]<< endl;
1242 int iLessPoints = VALID_MAX2, iGreaterPoints = 0;
1243 if (pvlGrp.hasKeyword(
"LessThan")) {
1244 if (pvlGrp[
"LessThan"][0] !=
"") {
1245 iLessPoints =
toInt(pvlGrp[
"LessThan"][0]);
1248 if (pvlGrp.hasKeyword(
"GreaterThan")) {
1249 if (pvlGrp[
"GreaterThan"][0] !=
"") {
1250 iGreaterPoints =
toInt(pvlGrp[
"GreaterThan"][0]);
1254 if (iLessPoints < 0 || iGreaterPoints < 0 || iLessPoints < iGreaterPoints) {
1255 QString sErrMsg =
"Invalid Deffile - Check Cube_NumPoints Group\n";
1266 for (
int sn = (iNumCubes - 1); sn >= 0; sn--) {
1269 double numPoints = imgStats[imgTotalPoints];
1270 if (numPoints < iGreaterPoints || numPoints > iLessPoints){
1274 else if (pbLastFilter) {
1276 << imgStats[imgTotalPoints] <<
", " << imgStats[imgIgnoredPoints] <<
", " << imgStats[imgLockedPoints] <<
", "
1277 << imgStats[imgFixedPoints] <<
", " << imgStats[imgConstrainedPoints] <<
", " << imgStats[imgFreePoints] <<
", "
1278 << imgStats[imgConvexHullRatio] << endl;
1296 double dDistance = 0;
1297 QString sUnits =
"pixels";
1299 if (pvlGrp.hasKeyword(
"MaxDistance")) {
1300 if (pvlGrp[
"MaxDistance"][0] !=
"") {
1301 dDistance = pvlGrp[
"MaxDistance"];
1305 if (pvlGrp.hasKeyword(
"Units")) {
1306 sUnits = pvlGrp[
"Units"][0];
1309 if (dDistance <= 0) {
1310 string sErrMsg =
"Invalid Deffile - Check Cube_Distance Group\n";
1317 mOstm <<
", Distance_PointIDs >>, " << endl;
1321 for (
int sn = (iNumCubes - 1); sn >= 0; sn--) {
1326 bool bMatchDistance =
false;
1328 QVector<int> sPointIndex1;
1329 QVector<int> sPointIndex2;
1330 QVector<double> dPointDistance;
1333 int iPointsTotal = 0;
1334 int iPointsIgnored = 0;
1335 int iPointsFixed = 0;
1336 int iPointsConstrained = 0;
1337 int iPointsFree = 0;
1338 int iPointsLocked = 0;
1341 sPointIndex1.clear();
1342 sPointIndex2.clear();
1343 dPointDistance.clear();
1346 for (
int i = 0; i < iNumPoints; i++) {
1349 bool bImageFound =
false;
1350 int iNumMeasures1 = cPoint1->GetNumMeasures();
1351 for (
int j = 0; j < iNumMeasures1; j++) {
1352 cMeasure1 = cPoint1->GetMeasure(j);
1353 if (cMeasure1->GetCubeSerialNumber() == sSerialNum) {
1355 if (cPoint1->IsIgnored()) {
1362 iPointsConstrained++;
1367 if (cPoint1->IsEditLocked()) {
1381 double dRadius = 0, dLat1 = 0, dLon1 = 0;
1382 if (sUnits ==
"meters") {
1384 if (cam->SetImage(cMeasure1->GetSample(), cMeasure1->GetLine())) {
1385 dRadius = cam->LocalRadius().meters();
1386 dLat1 = cam->UniversalLatitude();
1387 dLon1 = cam->UniversalLongitude();
1393 for (
int k = (i + 1); k < iNumPoints; k++) {
1395 int iNumMeasures2 = cPoint2->GetNumMeasures();
1397 bool bImageFound2 =
false;
1399 for (
int j = 0; j < iNumMeasures2; j++) {
1400 if (cPoint2->GetMeasure(j)->GetCubeSerialNumber() == sSerialNum) {
1401 cMeasure2 = cPoint2->GetMeasure(j);
1402 bImageFound2 =
true;
1406 if (!bImageFound2 ||
1407 (cMeasure2->GetSample() == 0 && cMeasure2->GetLine() == 0))
1410 if (sUnits ==
"pixels") {
1411 double dDeltaSamp = cMeasure1->GetSample() - cMeasure2->GetSample();
1412 double dDeltaLine = cMeasure1->GetLine() - cMeasure2->GetLine();
1414 dDist = sqrt((dDeltaSamp * dDeltaSamp) + (dDeltaLine * dDeltaLine));
1419 double dLat2 = 0, dLon2 = 0;
1420 if (cam->SetImage(cMeasure2->GetSample(), cMeasure2->GetLine())) {
1421 dLat2 = cam->UniversalLatitude();
1422 dLon2 = cam->UniversalLongitude();
1437 dDist = point1.GetDistanceToPoint(point1, radius).meters();
1439 if (!dDist || dDist >= dDistance) {
1443 bMatchDistance =
true;
1444 sPointIndex1.push_back(i);
1445 sPointIndex2.push_back(k);
1446 dPointDistance.push_back(dDist);
1454 if (!bMatchDistance) {
1458 else if (pbLastFilter) {
1461 << iPointsTotal <<
", " << iPointsIgnored <<
", " << iPointsLocked <<
", "
1462 << iPointsFixed <<
", " << iPointsConstrained <<
", " << iPointsFree <<
", "
1463 << imgStats[ imgConvexHullRatio] <<
", ";
1464 for (
int j = 0; j < (int)sPointIndex1.size(); j++) {
1465 QString sPointIDDist =
toString(dPointDistance[j]);
1466 sPointIDDist +=
"#";
1467 sPointIDDist += (*mCNet)[sPointIndex1[j]]->GetId();
1468 sPointIDDist +=
"#";
1469 sPointIDDist += (*mCNet)[sPointIndex2[j]]->GetId();
1471 mOstm << sPointIDDist <<
",";
double degrees() const
Get the angle in units of Degrees.
@ Degrees
Degrees are generally considered more human readable, 0-360 is one circle, however most math does not...
static Camera * Create(Cube &cube)
Creates a Camera object using Pvl Specifications.
virtual bool SetImage(const double sample, const double line)
Sets the sample/line values of the image to get the lat/lon values.
QString GetCubeSerialNumber() const
Return the serial number of the cube containing the coordinate.
@ Manual
Hand Measured (e.g., qnet)
@ Candidate
(e.g., autoseed, interest) AKA predicted, unmeasured, unverified
@ RegisteredSubPixel
Registered to sub-pixel (e.g., pointreg)
@ RegisteredPixel
Registered to whole pixel (e.g.,pointreg)
double GetResidualMagnitude() const
Return Residual magnitude.
@ GoodnessOfFit
GoodnessOfFit is pointreg information for reference measures.
double GetNumericalValue() const
Get the value associated with this log data.
~ControlNetFilter()
Destructor.
void CubeDistanceFilter(const PvlGroup &pvlGrp, bool pbLastFilter)
Filter Cubes by Distance between points in a Cube.
void PointGoodnessOfFitFilter(const PvlGroup &pvlGrp, bool pbLastFilter)
Filter Points by GoodnessOfFit.
void PointLatLonFilter(const PvlGroup &pvlGrp, bool pbLastFilter)
Filter Points by Lat Lon Range.
void SetOutputFile(QString psPrintFile)
Set the output print file.
void PointPropertiesFilter(const PvlGroup &pvlGrp, bool pbLastFilter)
Filter Points by properties.
SerialNumberList mSerialNumFilter
Serial Number List file.
void PointPixelShiftFilter(const PvlGroup &pvlGrp, bool pbLastFilter)
Filter Points by Pixel Shift.
ControlNetFilter(ControlNet *pCNet, QString &psSerialNumFile, Progress *pProgress=0)
Constructor.
void PointDistanceFilter(const PvlGroup &pvlGrp, bool pbLastFilter)
Filter Points by distance between points.
void PointMeasurePropertiesFilter(const PvlGroup &pvlGrp, bool pbLastFilter)
Filter Points by Measure properties.
void CubeNumPointsFilter(const PvlGroup &pvlGrp, bool pbLastFilter)
Filter Cubes by number of points in the cube.
void PointNumMeasuresEditLockFilter(const PvlGroup &pvlGrp, bool pbLastFilter)
Filter Points by Measure Edit Lock number.
void CubeConvexHullFilter(const PvlGroup &pvlGrp, bool pbLastFilter)
Filter Cubes by its ConvexHull Ratio.
void CubeNameExpressionFilter(const PvlGroup &pvlGrp, bool pbLastFilter)
Filter Cubes by Cube name expression.
void PointCubeNamesFilter(const PvlGroup &pvlGrp, bool pbLastFilter)
Filter Points by Cube names.
void PointStatsHeader(void)
Standard Point stats Header.
void CubeStatsHeader(void)
Print the standard cube stats Header.
void FilterOutPoint(int pindex)
Check the filtered point to be editlocked before removing from the current control network.
void PointMeasuresFilter(const PvlGroup &pvlGrp, bool pbLastFilter)
Filter Points by Number of measures.
void PointStats(const ControlPoint &pcPoint)
Standard Point Stats.
void PrintCubeFileSerialNum(const ControlMeasure &pcMeasure)
Print Cube's File and Serial Number into the Output File.
std::ofstream mOstm
output stream for printing to output file
void PointEditLockFilter(const PvlGroup &pvlGrp, bool pbLastFilter)
Filter Points by Edit Lock.
void PointIDFilter(const PvlGroup &pvlGrp, bool pbLastFilter)
Filter Points by Point ID Expression.
void FilterOutMeasuresBySerialNum(QString serialNum)
Delete the network for an Image given Serial Number for all the Points in the network....
void PointResMagnitudeFilter(const PvlGroup &pvlGrp, bool pbLastFilter)
Filter Points by Residual Magnitude.
int GetNumPoints() const
Return the number of control points in the network.
QList< ControlMeasure * > GetMeasuresInCube(QString serialNumber)
Get all the measures pertaining to a given cube serial number.
int DeletePoint(ControlPoint *point)
Delete a ControlPoint from the network by the point's address.
ControlNet * mCNet
Control Network.
QVector< double > GetImageStatsBySerialNum(QString psSerialNum) const
Returns the Image Stats by Serial Number.
void GenerateImageStats()
Generate stats like Total, Ignored, Fixed Points in an Image.
SerialNumberList mSerialNumList
Serial Number List.
Status SetEditLock(bool editLock)
Set the EditLock state.
int Delete(ControlMeasure *measure)
Remove a measurement from the control point, deleting reference measure is allowed.
@ Constrained
A Constrained point is a Control Point whose lat/lon/radius is somewhat established and should not be...
@ Free
A Free point is a Control Point that identifies common measurements between two or more cubes.
@ Fixed
A Fixed point is a Control Point whose lat/lon is well established and should not be changed.
const ControlMeasure * GetMeasure(QString serialNumber) const
Get a control measure based on its cube's serial number.
IO Handler for Isis Cubes.
Distance measurement, usually in meters.
@ Meters
The distance is being specified in meters.
File name manipulation and expansion.
@ User
A type of error that could only have occurred due to a mistake on the user's part (e....
Adds specific functionality to C++ strings.
IString DownCase()
Converts all upper case letters in the object IString into lower case characters.
This class is designed to encapsulate the concept of a Latitude.
This class is designed to encapsulate the concept of a Longitude.
Program progress reporter.
Contains multiple PvlContainers.
virtual double UniversalLatitude() const
Returns the planetocentric latitude, in degrees, at the surface intersection point in the body fixed ...
Latitude GetLatitude() const
Returns a planetocentric latitude object at the surface intersection point in body fixed.
virtual double UniversalLongitude() const
Returns the positive east, 0-360 domain longitude, in degrees, at the surface intersection point in t...
Distance LocalRadius() const
Returns the local radius at the intersection point.
Serial Number list generator.
void remove(const QString &sn)
Remove the specified serial number from the list.
QString serialNumber(const QString &filename)
Return a serial number given a filename.
int size() const
How many serial number / filename combos are in the list.
QString fileName(const QString &sn)
Return a filename given a serial number.
This class defines a body-fixed surface point.
This is free and unencumbered software released into the public domain.
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
int toInt(const QString &string)
Global function to convert from a string to an integer.
const double ValidMaximum
The maximum valid double value for Isis pixels.
QString sPointType[]
String names for Point Type.
const double Null
Value for an Isis Null pixel.
const double ValidMinimum
The minimum valid double value for Isis pixels.
QString sBoolean[]
String values for Boolean.
Namespace for the standard library.