本文整理汇总了C++中ControlPoint::HasSerialNumber方法的典型用法代码示例。如果您正苦于以下问题:C++ ControlPoint::HasSerialNumber方法的具体用法?C++ ControlPoint::HasSerialNumber怎么用?C++ ControlPoint::HasSerialNumber使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ControlPoint
的用法示例。
在下文中一共展示了ControlPoint::HasSerialNumber方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: IsisMain
void IsisMain() {
UserInterface &ui = Application::GetUserInterface();
FileList addList(ui.GetFileName("ADDLIST"));
bool log = false;
FileName logFile;
if (ui.WasEntered("LOG")) {
log = true;
logFile = ui.GetFileName("LOG");
}
Pvl results;
results.setName("cnetadd_Results");
PvlKeyword added("FilesAdded");
PvlKeyword omitted("FilesOmitted");
PvlKeyword pointsModified("PointsModified");
bool checkMeasureValidity = ui.WasEntered("DEFFILE");
ControlNetValidMeasure validator;
if (checkMeasureValidity) {
Pvl deffile(ui.GetFileName("DEFFILE"));
validator = ControlNetValidMeasure(deffile);
}
SerialNumberList *fromSerials = ui.WasEntered("FROMLIST") ?
new SerialNumberList(ui.GetFileName("FROMLIST")) : new SerialNumberList();
ControlNet inNet = ControlNet(ui.GetFileName("CNET"));
inNet.SetUserName(Application::UserName());
inNet.SetModifiedDate(iTime::CurrentLocalTime()); //This should be done in ControlNet's Write fn
QString retrievalOpt = ui.GetString("RETRIEVAL");
PvlKeyword duplicates("DupSerialNumbers");
if (retrievalOpt == "REFERENCE") {
FileList list1(ui.GetFileName("FROMLIST"));
SerialNumberList addSerials(ui.GetFileName("ADDLIST"));
//Check for duplicate files in the lists by serial number
for (int i = 0; i < addSerials.Size(); i++) {
// Check for duplicate SNs accross the lists
if (fromSerials->HasSerialNumber(addSerials.SerialNumber(i))) {
duplicates.addValue(addSerials.FileName(i));
}
// Check for duplicate SNs within the addlist
for (int j = i + 1; j < addSerials.Size(); j++) {
if (addSerials.SerialNumber(i) == addSerials.SerialNumber(j)) {
QString msg = "Add list files [" + addSerials.FileName(i) + "] and [";
msg += addSerials.FileName(j) + "] share the same serial number.";
throw IException(IException::User, msg, _FILEINFO_);
}
}
}
// Get the lat/long coords from the existing reference measure
setControlPointLatLon(*fromSerials, inNet);
}
else {
for (int cp = 0; cp < inNet.GetNumPoints(); cp++) {
// Get the surface point from the current control point
ControlPoint *point = inNet.GetPoint(cp);
SurfacePoint surfacePoint = point->GetBestSurfacePoint();
if (!surfacePoint.Valid()) {
QString msg = "Unable to retreive lat/lon from Control Point [";
msg += point->GetId() + "]. RETREIVAL=POINT cannot be used unless ";
msg += "all Control Points have Latitude/Longitude keywords.";
throw IException(IException::User, msg, _FILEINFO_);
}
g_surfacePoints[point->GetId()] = surfacePoint;
}
}
FileName outNetFile(ui.GetFileName("ONET"));
Progress progress;
progress.SetText("Adding Images");
progress.SetMaximumSteps(addList.size());
progress.CheckStatus();
STRtree coordTree;
QList<ControlPoint *> pointList;
bool usePolygon = ui.GetBoolean("POLYGON");
if (usePolygon) {
for (int cp = 0; cp < inNet.GetNumPoints(); cp++) {
ControlPoint *point = inNet.GetPoint(cp);
SurfacePoint surfacePoint = g_surfacePoints[point->GetId()];
Longitude lon = surfacePoint.GetLongitude();
Latitude lat = surfacePoint.GetLatitude();
Coordinate *coord = new Coordinate(lon.degrees(), lat.degrees());
Envelope *envelope = new Envelope(*coord);
coordTree.insert(envelope, point);
}
}
else {
//.........这里部分代码省略.........