本文整理汇总了C++中ossimKeywordlist::find方法的典型用法代码示例。如果您正苦于以下问题:C++ ossimKeywordlist::find方法的具体用法?C++ ossimKeywordlist::find怎么用?C++ ossimKeywordlist::find使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ossimKeywordlist
的用法示例。
在下文中一共展示了ossimKeywordlist::find方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: loadState
bool ossimNitfRpcModel::loadState(const ossimKeywordlist& kwl,
const char* prefix)
{
// Lookup decimation.
const char* value = kwl.find(prefix, "decimation");
if (value)
{
theDecimation = ossimString(value).toFloat64();
if (theDecimation <= 0.0)
{
// Do not allow negative or "0.0"(divide by zero).
theDecimation = 1.0;
}
}
// Call base.
return ossimRpcModel::loadState(kwl, prefix);
}
示例2: while
bool ossimKeywordlist::operator ==(ossimKeywordlist& kwl)const
{
if(this==&kwl) return true;
std::map<std::string, std::string>::const_iterator iter = m_map.begin();
while(iter != m_map.end())
{
const char* value = kwl.find((*iter).first.c_str());
if(ossimString(value) != (*iter).second)
{
return false;
}
++iter;
}
return true;
}
示例3: loadState
bool ossimVanDerGrintenProjection::loadState(const ossimKeywordlist& kwl,
const char* prefix)
{
bool flag = ossimMapProjection::loadState(kwl, prefix);
const char* type = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
setDefaults();
if(ossimString(type) == STATIC_TYPE_NAME(ossimVanDerGrintenProjection))
{
Grin_False_Easting = theFalseEastingNorthing.x;
Grin_False_Northing = theFalseEastingNorthing.y;
}
update();
return flag;
}
示例4: initUnits
void ossimLasReader::initUnits(const ossimKeywordlist& geomKwl)
{
ossimMapProjection* proj = dynamic_cast<ossimMapProjection*>( m_proj.get() );
if ( proj )
{
if ( proj->isGeographic() )
{
m_units = OSSIM_DEGREES;
}
else
{
const char* lookup = geomKwl.find("image0.linear_units");
if ( lookup )
{
std::string units = lookup;
if ( units == "meters" )
{
m_units = OSSIM_METERS;
}
else if ( units == "feet" )
{
m_units = OSSIM_FEET;
}
else if ( units == "us_survey_feet" )
{
m_units = OSSIM_US_SURVEY_FEET;
}
else
{
ossimNotify(ossimNotifyLevel_DEBUG)
<< "ossimLibLasReader::initUnits WARN:\n"
<< "Unhandled linear units code: " << units << std::endl;
}
}
}
}
// Don't make a unit converter for decimal degrees...
if ( (m_units != OSSIM_DEGREES) && (m_units != OSSIM_METERS) && !m_unitConverter )
{
m_unitConverter = new ossimUnitConversionTool();
}
}
示例5: loadState
bool ossimAdjustableParameterInfo::loadState(const ossimKeywordlist& kwl,
const ossimString& prefix)
{
const char* param = kwl.find(prefix, PARAM_KW);
const char* sigma = kwl.find(prefix, PARAM_SIGMA_KW);
const char* center = kwl.find(prefix, PARAM_CENTER_KW);
const char* unit = kwl.find(prefix, ossimKeywordNames::UNITS_KW);
const char* locked = kwl.find(prefix, PARAM_LOCK_FLAG_KW);
theDescription = kwl.find(prefix, ossimKeywordNames::DESCRIPTION_KW);
if(param)
{
theParameter = ossimString(param).toDouble();
}
else
{
theParameter = 0.0;
}
if(unit)
{
theUnit = (ossimUnitType)(ossimUnitTypeLut::instance()->getEntryNumber(unit));
}
else
{
theUnit = OSSIM_UNIT_UNKNOWN;
}
if(sigma)
{
theSigma = ossimString(sigma).toDouble();
}
else
{
theSigma = 0.0;
}
if(center)
{
theCenter = ossimString(center).toDouble();
}
else
{
theCenter = 0.0;
}
if(locked)
{
theLockFlag = ossimString(locked).toBool();
}
return true;
}
示例6: ossimNotify
bool ossimplugins::ossimRadarSat2TiffReader::loadState(
const ossimKeywordlist& kwl, const char* prefix)
{
static const char MODULE[] = "ossimplugins::ossimRadarSat2TiffReader::loadState";
if (traceDebug())
{
ossimNotify(ossimNotifyLevel_DEBUG)
<< MODULE << " entered...\n";
}
bool result = false;
// Get the product.xml file name.
const char* lookup = kwl.find(prefix, PRODUCT_XML_FILE_KW);
if (lookup)
{
theProductXmlFile = lookup;
if ( isRadarSat2ProductFile(theProductXmlFile) )
{
//---
// Although we can open any tiff here we only do if we have matching
// RS2 product.xml.
//---
result = ossimTiffTileSource::loadState(kwl, prefix);
}
}
if (!result)
{
theProductXmlFile.clear();
}
if (traceDebug())
{
ossimNotify(ossimNotifyLevel_DEBUG)
<< MODULE << " exit status = " << (result?"true":"false\n")
<< std::endl;
}
return result;
}
示例7: loadState
bool ossimCassiniProjection::loadState(const ossimKeywordlist& kwl,
const char* prefix)
{
// Must do this first.
bool flag = ossimMapProjection::loadState(kwl, prefix);
const char* type = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
setDefaults();
if(ossimString(type) == STATIC_TYPE_NAME(ossimCassiniProjection))
{
Cass_False_Easting = theFalseEastingNorthing.x;
Cass_False_Northing = theFalseEastingNorthing.y;
}
update();
return flag;
}
示例8: loadState
bool ossimImageCacheBase::loadState(const ossimKeywordlist& kwl,
const char* prefix)
{
const char* MODULE = "ossimImageCacheBase::loadState";
if(traceDebug())
{
CLOG << "Entering..." << endl;
}
bool result = ossimImageHandler::loadState(kwl, prefix);
if(!result)
{
if(traceDebug())
{
CLOG << "Leaving..." << endl;
}
return false;
}
const char* lookup = 0;
lookup = kwl.find(ossimString(prefix), "entry");
ossim_int32 entry = ossimString(lookup).toInt32();
// if an entry is specified then
// call the open with an entry number
if(lookup)
{
if(traceDebug())
{
CLOG << "Leaving..." << endl;
}
result = ossimImageHandler::open(theImageFile);
setCurrentEntry(entry);
return result;
}
result = ossimImageHandler::open(theImageFile);
return result;
}
示例9: loadState
bool ossimHistogramEqualization::loadState(const ossimKeywordlist& kwl,
const char* prefix)
{
static const char MODULE[] = "ossimHistogramEqualization::loadState";
if (traceDebug())
{
ossimNotify(ossimNotifyLevel_DEBUG)
<< " Entered..."
<< "\nprefix: " << prefix << endl;
}
const char* lookup = kwl.find(prefix,
HISTOGRAM_INVERSE_FLAG_KW);
if(lookup)
{
theInverseFlag = ossimString(lookup).toBool();
}
if(ossimImageSourceHistogramFilter::loadState(kwl, prefix))
{
// computeAccumulationHistogram();
// initializeLuts();
}
else
{
return false;
}
if (traceDebug())
{
ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG:" << MODULE;
this->print(ossimNotify(ossimNotifyLevel_DEBUG));
ossimNotify(ossimNotifyLevel_DEBUG) << "\nExited..." << endl;
}
return true;
}
示例10: addAllDataManagerObjects
void ossimQtVceCanvasWidget::addAllDataManagerObjects(const ossimKeywordlist& kwl,
const QPoint& location,
const char* prefix)
{
QPoint locationPoint = location;
if((locationPoint.x() == -1)&&
(locationPoint.y() == -1))
{
locationPoint.setX(0);
locationPoint.setY(0);
}
ossimQtGetDataManagerEvent tempEvt;
ossimQtApplicationUtility::sendEventToRoot(this, &tempEvt);
if(tempEvt.getDataManager())
{
ossimString regExpression = ossimString("^(") + ossimString(prefix)+ "object[0-9]+.)";
std::vector<ossimString> keys =
kwl.getSubstringKeyList( regExpression );
int numberOfObjects = keys.size();
int idx = 0;
for(idx = 0; idx < numberOfObjects; ++idx)
{
const char* id = kwl.find(keys[idx]+"id");
if(id)
{
ossimConnectableObject* obj = PTR_CAST(ossimConnectableObject,
tempEvt.getDataManager()->getObject(ossimId(ossimString(id).toInt())));
if(addDataManagerObject(obj,
locationPoint))
{
locationPoint.setY(locationPoint.y() + 74);
}
}
}
}
}
示例11: loadState
bool ossimLandsatTileSource::loadState(const ossimKeywordlist& kwl,
const char* prefix)
{
const char* lookup = kwl.find(prefix, ossimKeywordNames::FILENAME_KW);
if (lookup)
{
ossimFilename fileName = lookup;
ossimString ext = fileName.ext();
if((ext.upcase() == "FST") || (ext.upcase() == "DAT"))
{
//---
// This will call:
// ossimImageHandler::loadState() the open()
//---
if (ossimGeneralRasterTileSource::loadState(kwl, prefix))
{
return true;
}
}
}
return false;
}
示例12: loadState
bool ossimSpectraboticsRedEdgeModel::loadState(const ossimKeywordlist& kwl,
const char* prefix)
{
if(traceDebug())
{
std::cout << "ossimSpectraboticsRedEdgeModel::loadState: ......... entered" << std::endl;
}
//ossimSensorModel::loadState(kwl,prefix);
ossimSensorModel::loadState(kwl, prefix);
if(getNumberOfAdjustableParameters() < 1)
{
initAdjustableParameters();
}
m_ecefPlatformPosition = ossimGpt(0.0,0.0,1000.0);
m_adjEcefPlatformPosition = ossimGpt(0.0,0.0,1000.0);
m_roll = 0.0;
m_pitch = 0.0;
m_heading = 0.0;
// bool computeGsdFlag = false;
const char* roll = kwl.find(prefix, "Roll");
const char* pitch = kwl.find(prefix, "Pitch");
const char* heading = kwl.find(prefix, "Yaw");
const char* focalLength = kwl.find(prefix, "Focal Length");
const char* imageWidth = kwl.find(prefix, "Image Width");
const char* imageHeight = kwl.find(prefix, "Image Height");
const char* fov = kwl.find(prefix, "Field Of View");
const char* gpsPos = kwl.find(prefix, "GPS Position");
const char* gpsAlt = kwl.find(prefix, "GPS Altitude");
const char* imageCenter = kwl.find(prefix, "Image Center");
const char* fx = kwl.find(prefix, "fx");
const char* fy = kwl.find(prefix, "fy");
const char* cx = kwl.find(prefix, "cx");
const char* cy = kwl.find(prefix, "cy");
const char* k = kwl.find(prefix, "k");
const char* p = kwl.find(prefix, "p");
bool result = true;
#if 0
std::cout << "roll: " << roll << "\n";
std::cout << "pitch: " << pitch << "\n";
std::cout << "heading: " << heading << "\n";
std::cout << "focalLength: " << focalLength << "\n";
std::cout << "imageWidth: " << imageWidth << "\n";
std::cout << "imageHeight: " << imageHeight << "\n";
// std::cout << "fov: " << fov << "\n";
std::cout << "gpsPos: " << gpsPos << "\n";
std::cout << "gpsAlt: " << gpsAlt << "\n";
#endif
//
if(k&&p)
{
m_lensDistortion = new ossimTangentialRadialLensDistortion();
m_lensDistortion->loadState(kwl, prefix);
}
if(roll&&
pitch&&
heading&&
focalLength&&
imageWidth&&
imageHeight&&
gpsPos&&
gpsAlt)
{
theSensorID = "MicaSense RedEdge";
m_roll = ossimString(roll).toDouble();
m_pitch = ossimString(pitch).toDouble();
m_heading = ossimString(heading).toDouble();
m_focalLength = ossimString(focalLength).toDouble();
m_fov = fov?ossimString(fov).toDouble():48.8;
theImageSize.x = ossimString(imageWidth).toDouble();
theImageSize.y = ossimString(imageHeight).toDouble();
theImageClipRect = ossimDrect(0,0,theImageSize.x-1,theImageSize.y-1);
theRefImgPt = ossimDpt(theImageSize.x/2.0, theImageSize.y/2.0);
m_calibratedCenter = theImageClipRect.midPoint();
// now lets use the field of view and the focal length to
// calculate the pixel size on the ccd in millimeters
double d = tan((m_fov*0.5)*M_PI/180.0)*m_focalLength;
d*=2.0;
double tempRadiusPixel = theImageSize.length();
m_pixelSize.x = (d)/tempRadiusPixel;
m_pixelSize.y = m_pixelSize.x;
if(imageCenter)
{
std::vector<ossimString> splitString;
ossimString tempString(imageCenter);
tempString.split(splitString, ossimString(" "));
if(splitString.size() == 2)
{
theRefImgPt = ossimDpt(splitString[0].toDouble(), splitString[1].toDouble());
}
}
//.........这里部分代码省略.........
示例13: loadState
//*****************************************************************************
// METHOD: ossimRpcModel::loadState()
//
// Restores the model's state from the KWL. This KWL also serves as a
// geometry file.
//
//*****************************************************************************
bool ossimRpcModel::loadState(const ossimKeywordlist& kwl,
const char* prefix)
{
if (traceExec())
{
ossimNotify(ossimNotifyLevel_DEBUG)
<< "DEBUG ossimRpcModel::loadState(): entering..." << std::endl;
}
const char* value;
const char* keyword;
//***
// Pass on to the base-class for parsing first:
//***
bool success = ossimSensorModel::loadState(kwl, prefix);
if (!success)
{
theErrorStatus++;
if (traceExec())
{
ossimNotify(ossimNotifyLevel_DEBUG)
<< "DEBUG ossimRpcModel::loadState(): returning with error..."
<< std::endl;
}
return false;
}
//---
// Continue parsing for local members:
//---
value = kwl.find(prefix, BIAS_ERROR_KW);
if (value)
{
theBiasError = ossimString(value).toDouble();
}
value = kwl.find(prefix, RAND_ERROR_KW);
if (value)
{
theRandError = ossimString(value).toDouble();
}
keyword = POLY_TYPE_KW;
value = kwl.find(prefix, keyword);
if (!value)
{
ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcModel::loadState(): Error encountered parsing the following required keyword: "
<< "<" << keyword << ">. Check the keywordlist for proper syntax."
<< std::endl;
return false;
}
thePolyType = (PolynomialType) value[0];
keyword = LINE_SCALE_KW;
value = kwl.find(prefix, keyword);
if (!value)
{
ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcModel::loadState(): Error encountered parsing the following required keyword: "
<< "<" << keyword << ">. Check the keywordlist for proper syntax."
<< std::endl;
return false;
}
theLineScale = atof(value);
keyword = SAMP_SCALE_KW;
value = kwl.find(prefix, keyword);
if (!value)
{
ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcModel::loadState(): Error encountered parsing the following required keyword: "
<< "<" << keyword << ">. Check the keywordlist for proper syntax."
<< std::endl;
return false;
}
theSampScale = atof(value);
keyword = LAT_SCALE_KW;
value = kwl.find(prefix, keyword);
if (!value)
{
ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcModel::loadState(): Error encountered parsing the following required keyword: "
<< "<" << keyword << ">. Check the keywordlist for proper syntax."
<< std::endl;
return false;
}
theLatScale = atof(value);
keyword = LON_SCALE_KW;
value = kwl.find(prefix, keyword);
if (!value)
{
ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcModel::loadState(): Error encountered parsing the following required keyword: "
//.........这里部分代码省略.........
示例14: addAllObjects
void ossimQtVceCanvasWidget::addAllObjects(const ossimKeywordlist& kwl,
const QPoint& location,
const char* prefix)
{
unselectItems();
QPoint locationPoint = location;
ossimString copyPrefix = prefix;
std::vector<QCanvasItem*> newItemList;
ossimString regExpression = ossimString("^(") + copyPrefix + "object[0-9]+.)";
vector<ossimString> keys =
kwl.getSubstringKeyList( regExpression );
long numberOfObjets = keys.size();//kwl.getNumberOfSubstringKeys(regExpression);
int offset = (copyPrefix+"object").size();
int idx = 0;
std::vector<int> theNumberList(numberOfObjets);
for(idx = 0; idx < (int)theNumberList.size();++idx)
{
ossimString numberStr(keys[idx].begin() + offset,
keys[idx].end());
theNumberList[idx] = numberStr.toInt();
}
std::sort(theNumberList.begin(), theNumberList.end());
for(idx=0;idx < (int)theNumberList.size();++idx)
{
ossimString newPrefix = copyPrefix;
newPrefix += ossimString("object");
newPrefix += ossimString::toString(theNumberList[idx]);
newPrefix += ossimString(".");
ossimString objType = kwl.find(newPrefix,
ossimKeywordNames::TYPE_KW);
QCanvasItem* item = NULL;
if(objType == "ossimQtImageWindow")
{
item = new ossimQtVceImageDisplayObject(canvas(),
this);
item->setX(locationPoint.x());
item->setY(locationPoint.y());
item->show();
emit itemAdded(item);
}
else if(objType == "ossimImageHandler")
{
QStringList filenames = QFileDialog::getOpenFileNames("Images (*.adf *.ccf *.dem *.DEM *.dt1 *.dt0 *.dt2 *.hdr *.hgt *.jpg *.jpeg *.img *.doqq *.fst *.FST *.nitf *.NTF *.ntf *.ras *.sid *.tif *.tiff *.toc *.TOC);;Vectors(*.shp dht *.tab);;All Files(*)",
QString::null,
this,
"open file dialog",
"Choose a file to open");
QStringList::Iterator it;
for(it = filenames.begin(); it != filenames.end(); ++it)
{
std::vector<QCanvasItem*> newItems;
openImageFile((*it).ascii(),
locationPoint,
newItems);
if(newItems.size())
{
// QRect bounds = newItems[newItems.size()-1]->boundingRect();
// locationPoint.setY(locationPoint.y() + bounds.height() + 10);
newItemList.insert(newItemList.end(),
newItems.begin(),
newItems.end());
}
}
// we will make sure that we don't adjust the location point any further
//
item = NULL;
}
else
{
ossimObject* object = ossimObjectFactoryRegistry::instance()->createObject(objType);
if(object)
{
item = addObject(object, locationPoint);
}
}
if(item)
{
newItemList.push_back(item);
QRect bounds = item->boundingRect();
locationPoint.setY(locationPoint.y() + bounds.height() + 10);
emit itemAdded(item);
}
}
if(newItemList.size() > 0)
{
for(idx = 0; idx < (int)newItemList.size(); ++idx)
{
newItemList[idx]->setSelected(true);
theSelectedItems.push_back(newItemList[idx]);
emit itemSelected(newItemList[idx]);
}
//.........这里部分代码省略.........
示例15: loadState
/**
* Method to the load (recreate) the state of an object from a keyword
* list. Return true if ok or false on error.
*/
bool ossimElevManager::loadState(const ossimKeywordlist& kwl, const char* prefix)
{
if (traceDebug())
{
ossimNotify(ossimNotifyLevel_DEBUG)
<< "DEBUG ossimElevManager::loadState: Entered..."
<< std::endl;
}
if(!ossimElevSource::loadState(kwl, prefix))
{
return false;
}
ossimString copyPrefix(prefix);
ossimString elevationOffset = kwl.find(copyPrefix, "elevation_offset");
ossimString defaultHeightAboveEllipsoid = kwl.find(copyPrefix, "default_height_above_ellipsoid");
ossimString useGeoidIfNull = kwl.find(copyPrefix, "use_geoid_if_null");
ossimString elevRndRbnSize = kwl.find(copyPrefix, "threads");
if(!elevationOffset.empty())
{
m_elevationOffset = elevationOffset.toDouble();
}
if(!defaultHeightAboveEllipsoid.empty())
{
m_defaultHeightAboveEllipsoid = defaultHeightAboveEllipsoid.toDouble();
}
if(!useGeoidIfNull.empty())
{
m_useGeoidIfNullFlag = useGeoidIfNull.toBool();
}
ossim_uint32 numThreads = 1;
if(!elevRndRbnSize.empty())
{
if (elevRndRbnSize.contains("yes") || elevRndRbnSize.contains("true"))
numThreads = ossim::getNumberOfThreads();
else if (elevRndRbnSize.contains("no") || elevRndRbnSize.contains("false"))
numThreads = 1;
else
{
numThreads = elevRndRbnSize.toUInt32();
numThreads = numThreads > 0 ? numThreads : 1;
}
}
setRoundRobinMaxSize(numThreads);
ossimString regExpression = ossimString("^(") + copyPrefix + "elevation_source[0-9]+.)";
vector<ossimString> keys = kwl.getSubstringKeyList( regExpression );
long numberOfSources = (long)keys.size();
ossim_uint32 offset = (ossim_uint32)(copyPrefix+"elevation_source").size();
ossim_uint32 idx = 0;
std::vector<int> theNumberList(numberOfSources);
for(idx = 0; idx < theNumberList.size();++idx)
{
ossimString numberStr(keys[idx].begin() + offset,
keys[idx].end());
theNumberList[idx] = numberStr.toInt();
}
std::sort(theNumberList.begin(), theNumberList.end());
for(idx=0;idx < theNumberList.size();++idx)
{
ossimString newPrefix = copyPrefix;
newPrefix += ossimString("elevation_source");
newPrefix += ossimString::toString(theNumberList[idx]);
if (traceDebug())
{
ossimNotify(ossimNotifyLevel_DEBUG)
<< "DEBUG ossimElevManager::loadState:"
<< "\nLooking for key: " << newPrefix
<< std::endl;
}
//---
// Check for enabled key first. Default, if not found is true for
// legacy compatibility.
//---
bool enabled = true;
std::string key = newPrefix.string();
key += ".";
key += ossimKeywordNames::ENABLED_KW;
std::string value = kwl.findKey( key );
if ( value.size() )
{
enabled = ossimString(value).toBool();
}
if ( enabled )
{
// first check if new way is supported
ossimRefPtr<ossimElevationDatabase> database =
ossimElevationDatabaseRegistry::instance()->createDatabase(kwl, newPrefix+".");
if(database.valid())
{
if (traceDebug())
{
//.........这里部分代码省略.........