9#include "ControlPointList.h"
13#include "IException.h"
28 int size = list.size();
29 for(
int i = 0; i < size; i++) {
38 catch(IException &e) {
39 QString msg =
"Can't open or invalid file list [" +
40 psListFile.expanded() +
"]";
41 throw IException(e, IException::User, msg, _FILEINFO_);
61 int index = mqCpList.indexOf(QString(psCpId));
63 if(index == -1 || index >=
Size())
77 return mqCpList.size();
90 if(piIndex >= 0 && piIndex < size) {
91 return (mqCpList.value(piIndex));
95 QString msg =
"Index [" + num +
"] is invalid";
96 throw IException(IException::Programmer, msg, _FILEINFO_);
109 return mqCpList.indexOf(QString(psCpId));
112 QString msg =
"Requested control point id [" + psCpId +
"] ";
113 msg +=
"does not exist in the list";
114 throw IException(IException::Programmer, msg, _FILEINFO_);
127 QString sPointsNotFound =
"";
129 for(
int i = 0; i < size; i++) {
132 sPointsNotFound +=
", ";
134 sPointsNotFound += mqCpList.value(i);
139 pcPvlLog += Isis::PvlKeyword(
"TotalPoints",
toString(size));
140 pcPvlLog += Isis::PvlKeyword(
"ValidPoints",
toString(size - iNotFound));
141 pcPvlLog += Isis::PvlKeyword(
"InvalidPoints",
toString(iNotFound));
142 pcPvlLog += Isis::PvlKeyword(
"InvalidPointIds", sPointsNotFound);
bool HasControlPoint(const QString &psCpId)
Determines whether or not the requested control point id exists in the list.
QVector< bool > mbFound
holds one to one correspondence with "mqCpList" on whether the point was valid
void RegisterStatistics(Pvl &pcPvlLog)
Register invalid control point and calculate the valid & invalid point count.
ControlPointList(const FileName &psFileName)
Creates a ControlPointList from a list of control point ids'.
int ControlPointIndex(const QString &psCpId)
return a list index given a control point id
QString ControlPointId(int piIndex)
Return a control point id given an index.
virtual ~ControlPointList()
Destructor.
int Size() const
How many control points in the list.
Internalizes a list of files.
This is free and unencumbered software released into the public domain.
This is free and unencumbered software released into the public domain.
QString toString(const LinearAlgebra::Vector &vector, int precision)
A global function to format LinearAlgebra::Vector as a QString with the given precision.