MCPcopy Create free account
hub / github.com/DOI-USGS/ISIS3 / PointIDFilter

Method PointIDFilter

isis/src/control/objs/ControlNetFilter/ControlNetFilter.cpp:445–488  ·  view source on GitHub ↗

* Filter PointID based on regular expression * Group by Points * * @author Sharmila Prasad (8/11/2010) * * @param pvlGrp - Pvl Group containing the filter info * @param pbLastFilter - Flag to indicate whether this is the last filter to print the stats */

Source from the content-addressed store, hash-verified

443 * @param pbLastFilter - Flag to indicate whether this is the last filter to print the stats
444 */
445 void ControlNetFilter::PointIDFilter(const PvlGroup &pvlGrp, bool pbLastFilter) {
446 QString sPointIDExpr = pvlGrp["Expression"][0];
447 QString sSeparator("*");
448 QStringList strTokens = sPointIDExpr.split(sSeparator, Qt::SkipEmptyParts);
449
450 int iTokenSize = (int)strTokens.size();
451 int iNumPoints = mCNet->GetNumPoints();
452#ifdef _DEBUG_
453 odb << "Net Size=" << iNumPoints << endl;
454#endif
455
456 if (pbLastFilter) {
457 PointStatsHeader();
458 mOstm << endl;
459 }
460
461 for (int i = (iNumPoints - 1); i >= 0; i--) {
462 const ControlPoint *cPoint = mCNet->GetPoint(i);
463 QString sPointID = cPoint->GetId();
464 int iPosition = 0;
465 for (int j = (iTokenSize - 1); j >= 0; j--) {
466 int iLen = strTokens[j].length();
467 if (iLen > 0) {
468 int found = sPointID.indexOf(strTokens[j], iPosition);
469 if (found != -1) {
470 iPosition = found + iLen;
471 // End of the expression
472 if (pbLastFilter && j == (iTokenSize - 1)) {
473 // Log into the output file
474 PointStats(*cPoint);
475 mOstm << endl;
476 }
477 }
478 else {
479 FilterOutPoint(i);
480 break;
481 }
482 }
483 }
484 }
485
486 // update the image stats with the changes
487 GenerateImageStats();
488 }
489
490 /**
491 * Filters the Control Network based on the user specified number of

Callers 1

IsisMainFunction · 0.80

Calls 6

GetNumPointsMethod · 0.80
GetPointMethod · 0.80
GetIdMethod · 0.80
sizeMethod · 0.45
lengthMethod · 0.45
indexOfMethod · 0.45

Tested by 1

IsisMainFunction · 0.64