本文整理汇总了C++中Plugin::GetPlugin方法的典型用法代码示例。如果您正苦于以下问题:C++ Plugin::GetPlugin方法的具体用法?C++ Plugin::GetPlugin怎么用?C++ Plugin::GetPlugin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Plugin
的用法示例。
在下文中一共展示了Plugin::GetPlugin方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
/**
* Create an AtmosModel object using a PVL specification.
* An example of the PVL required for this is:
*
* @code
* Object = AtmosphericModel
* Group = Algorithm
* # Use 'AtmName' instead of 'Name' if using the Gui combo box
* # for unique Pvl keyword in DefFile
* AtmName/Name = Isotropic1
* Tau = 0.7
* Tauref = 0.0
* Wha = 0.5
* Hnorm = 0.003
* Nulneg = NO
* EndGroup
* EndObject
* @endcode
*
* There are many other options that can be set via the pvl and are
* described in other documentation (see below).
*
* @param pvl The pvl object containing the specification
* @param pmodel The PhotoModel objects contining the data
*
* @return A pointer to the new AtmosModel
*
* @see atmosphericModels.doc
**/
AtmosModel *AtmosModelFactory::Create(Pvl &pvl, PhotoModel &pmodel) {
// Get the algorithm name to create
PvlGroup &algo = pvl.findObject("AtmosphericModel")
.findGroup("Algorithm", Pvl::Traverse);
QString algorithm = "";
if(algo.hasKeyword("AtmName")) {
algorithm = QString(algo["AtmName"]);
}
else if(algo.hasKeyword("Name")) {
algorithm = QString(algo["Name"]);
}
else {
QString msg = "Keyword [Name] or keyword [AtmName] must ";
msg += "exist in [Group = Algorithm]";
throw IException(IException::User, msg, _FILEINFO_);
}
// Open the factory plugin file
Plugin *p = new Plugin;
FileName f("AtmosModel.plugin");
if(f.fileExists()) {
p->read("AtmosModel.plugin");
}
else {
p->read("$ISISROOT/lib/AtmosModel.plugin");
}
// Get the algorithm specific plugin and return it
AtmosModel * (*plugin)(Pvl & pvl, PhotoModel & pmodel);
plugin = (AtmosModel * ( *)(Pvl & pvl, PhotoModel & pmodel))
p->GetPlugin(algorithm);
return (*plugin)(pvl, pmodel);
}
示例2: f
/**
* Create an InterestOperator object using a PVL specification.
* An example of the PVL required for this is:
*
* @code
* Object = InterestOperator
* Group = Operator
* Name = StandardDeviation
* Samples = 21
* Lines = 21
* Delta = 50
* EndGroup
* EndObject
* @endcode
*
* There are many other options that can be set via the pvl and are
* described in other documentation (see below).
*
* @param pvl The pvl object containing the specification
*
* @see automaticRegistration.doc
**/
InterestOperator *InterestOperatorFactory::Create(Pvl &pvl) {
// Get the algorithm name to create
PvlGroup &op = pvl.FindGroup("Operator",Pvl::Traverse);
std::string operatorName = op["Name"];
// Open the factory plugin file
Plugin p;
Filename f("InterestOperator.plugin");
if (f.Exists()) {
p.Read("InterestOperator.plugin");
}
else {
p.Read("$ISISROOT/lib/InterestOperator.plugin");
}
// Get the algorithm specific plugin and return it
InterestOperator * (*plugin) (Pvl &pvl);
plugin = (InterestOperator * (*)(Pvl &pvl)) p.GetPlugin(operatorName);
return (*plugin)(pvl);
}