本文整理汇总了C++中PlugInArg类的典型用法代码示例。如果您正苦于以下问题:C++ PlugInArg类的具体用法?C++ PlugInArg怎么用?C++ PlugInArg使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PlugInArg类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getInputSpecification
bool GenericConvolution::getInputSpecification(PlugInArgList*& pInArgList)
{
if (!ConvolutionFilterShell::getInputSpecification(pInArgList))
{
return false;
}
PlugInArg* pArg = Service<PlugInManagerServices>()->getPlugInArg();
VERIFY(pArg != NULL);
pArg->setName("Kernel");
pArg->setDescription("The convolution kernel as an ossim NEWMAT::Matrix.");
pArg->setType("NEWMAT::Matrix");
pInArgList->addArg(*pArg);
return true;
}
示例2: VERIFY
bool BandMath::getOutputSpecification(PlugInArgList*& pArgList)
{
// Set up list
pArgList = mpPluginManager->getPlugInArgList();
VERIFY(pArgList != NULL);
PlugInArg* pArg = mpPluginManager->getPlugInArg();
VERIFY(pArg != NULL);
pArg->setName("Band Math Result");
pArg->setType("RasterElement");
pArg->setDefaultValue(NULL);
pArg->setDescription("Output element for the result of the band math operation.");
pArgList->addArg(*pArg);
return true;
}
示例3: getInputSpecification
bool PlugInTester::getInputSpecification(PlugInArgList *&pArgList)
{
bool bSuccess = false;
pArgList = mpPlugMgr->getPlugInArgList();
if (pArgList != NULL)
{
PlugInArg* pArg = mpPlugMgr->getPlugInArg();
if (pArg != NULL)
{
pArg->setName(Executable::ProgressArg());
pArg->setType("Progress");
pArg->setDefaultValue(NULL);
pArg->setDescription(Executable::ProgressArgDescription());
bSuccess = pArgList->addArg(*pArg);
}
}
return bSuccess;
}
示例4: pStep
bool RasterElementImporterShell::parseInputArgList(PlugInArgList* pInArgList)
{
if (pInArgList == NULL)
{
return false;
}
StepResource pStep("Validate Inputs", "app", "4CDCFA20-2A40-452D-9956-264A35F8B883");
// Extract the input args
PlugInArg* pArg = NULL;
bool bSuccess = false;
// Progress
bSuccess = pInArgList->getArg(Executable::ProgressArg(), pArg);
if ((bSuccess == true) && (pArg != NULL))
{
if (pArg->isActualSet() == true)
{
mpProgress = reinterpret_cast<Progress*>(pArg->getActualValue());
}
}
// Sensor data
mpRasterElement = pInArgList->getPlugInArgValue<RasterElement>(Importer::ImportElementArg());
if (mpRasterElement == NULL)
{
string msg = "The raster element input value is invalid!";
if (mpProgress != NULL)
{
mpProgress->updateProgress(msg, 0, ERRORS);
}
pStep->finalize(Message::Failure, msg);
return false;
}
pStep->finalize(Message::Success);
return true;
}
示例5: VERIFY
bool CgmImporter::getInputSpecification(PlugInArgList*& pInArgList)
{
pInArgList = mpPlugInManager->getPlugInArgList();
VERIFY(pInArgList != NULL);
PlugInArg* pArg = NULL;
VERIFY((pArg = mpPlugInManager->getPlugInArg()) != NULL);
pArg->setName(Executable::ProgressArg());
pArg->setType("Progress");
pArg->setDefaultValue(NULL);
pArg->setDescription(Executable::ProgressArgDescription());
pInArgList->addArg(*pArg);
VERIFY((pArg = mpPlugInManager->getPlugInArg()) != NULL);
pArg->setName(Importer::ImportElementArg());
pArg->setType("DataElement");
pArg->setDefaultValue(NULL);
pArg->setDescription("Data element to be imported.");
pInArgList->addArg(*pArg);
return true;
}
示例6: pStep
bool BandMath::execute(PlugInArgList* pInputArgList, PlugInArgList* pOutputArgList)
{
StepResource pStep("Start BandMath", "app", "02E18066-1355-4a5f-ABC5-0366D9890C1C");
mpStep = pStep.get();
// Initilize variables
initialize();
// Get pointers
// parse arg in list
if (!parse(pInputArgList, pOutputArgList))
{
meGabbiness = ERRORS;
displayErrorMessage();
return false;
}
// Get important stuff
pStep->addProperty("Dataset", mpCube->getFilename());
const RasterDataDescriptor* pDescriptor = dynamic_cast<const RasterDataDescriptor*>(mpCube->getDataDescriptor());
if (pDescriptor != NULL)
{
mCubeRows = pDescriptor->getRowCount();
mCubeColumns = pDescriptor->getColumnCount();
mCubeBands = pDescriptor->getBandCount();
}
std::string tmpResultName;
vector<DataElement*> elements = mpDataModel->getElements("RasterElement");
vector<DataElement*>::iterator iter;
for (iter = elements.begin(); iter != elements.end(); ++iter)
{
RasterElement* pRaster = static_cast<RasterElement*>(*iter);
if (pRaster != NULL)
{
const RasterDataDescriptor* pCurrentDescriptor =
dynamic_cast<const RasterDataDescriptor*>(pRaster->getDataDescriptor());
if (pCurrentDescriptor != NULL)
{
if ((mCubeRows == static_cast<int>(pCurrentDescriptor->getRowCount())) &&
(mCubeColumns == static_cast<int>(pCurrentDescriptor->getColumnCount())) &&
(mCubeBands == static_cast<int>(pCurrentDescriptor->getBandCount())))
{
mCubesList.push_back(pRaster);
}
}
}
}
char errorVal[80];
int errorCode = -1;
if (mbInteractive)
{
QWidget* pParent = mpDesktop->getMainWidget();
FrmBM frmASIT(pDescriptor, mCubesList, pParent);
if (frmASIT.exec() == QDialog::Rejected)
{
pStep->finalize(Message::Abort);
return false;
}
mExpression = frmASIT.getExpression(true).toStdString();
mbDegrees = frmASIT.isDegrees();
mbCubeMath = frmASIT.isMultiCube();
mbAsLayerOnExistingView = frmASIT.isResultsMatrix();
}
else
{
mbCubeMath = false;
//check for cube math
unsigned int pos = mExpression.find_first_of(string("cC"));
if ((pos >= 0) && (pos < (mExpression.length() - 1)) && ((mExpression[pos + 1] > '0') &&
(mExpression[pos + 1] < '9')))
{
mbCubeMath = true;
}
}
if (!createReturnValue(mExpression))
{
mstrProgressString = "Could not allocate space for results.";
meGabbiness = ERRORS;
displayErrorMessage();
return false;
}
{
StepResource pResultStep("Compute result", "app", "CDCC12AC-32DD-4831-BC6B-225538C92053");
mpStep = pResultStep.get();
pResultStep->addProperty("Expression", mExpression);
FactoryResource<DataRequest> pReturnRequest;
pReturnRequest->setInterleaveFormat(BIP);
pReturnRequest->setWritable(true);
DataAccessor returnDa = mpResultData->getDataAccessor(pReturnRequest.release());
//.........这里部分代码省略.........
示例7: VERIFY
bool PlugInTester::execute(PlugInArgList* pInArgs, PlugInArgList* pOutArgs)
{
VERIFY(pInArgs != NULL);
Progress* pProgress = NULL;
PlugInArg* pArg = NULL;
if (pInArgs != NULL && pInArgs->getArg(Executable::ProgressArg(), pArg) && pArg != NULL)
{
pProgress = reinterpret_cast<Progress*>(pArg->getActualValue());
}
vector<PlugInDescriptor*> allPlugins = mpPlugMgr->getPlugInDescriptors();
vector<string> testablePlugins;
for (vector<PlugInDescriptor*>::const_iterator it = allPlugins.begin(); it != allPlugins.end(); ++it)
{
PlugInDescriptor* pDescriptor = *it;
if (pDescriptor == NULL)
{
continue;
}
if (pDescriptor->isTestable())
{
testablePlugins.push_back(pDescriptor->getName());
}
}
string msg;
bool bSuccess = false;
PlugInSelectorDlg dlg(mpDesktop->getMainWidget(), testablePlugins);
int stat = dlg.exec();
if (stat == QDialog::Accepted)
{
const vector<string>& pluginsToTest = dlg.getSelectedPlugins();
// TODO: Set up a ProgressTracker for each plug-in to test
vector<string>::const_iterator it;
for (it = pluginsToTest.begin(); it != pluginsToTest.end(); ++it)
{
PlugInResource pPlugIn(*it);
Testable* pTestable = dynamic_cast<Testable*>(pPlugIn.get());
if (pTestable == NULL)
{
msg += "The Plug-In " + *it + " cannot be created!";
if (pProgress != NULL)
{
pProgress->updateProgress(msg, 0, ERRORS);
}
return false;
}
msg += "Testing " + *it + "...";
if (pProgress != NULL)
{
pProgress->updateProgress(msg, 0, NORMAL);
}
stringstream ostr;
bSuccess = pTestable->runAllTests(pProgress, ostr);
msg += "Testing of Plug-In " + *it + " has been completed";
ReportingLevel lvl = NORMAL;
if (!bSuccess)
{
lvl = ERRORS;
msg += " with errors!";
}
else
{
msg += "!";
}
if (ostr.str().size() > 0)
{
msg += "\n" + ostr.str() + "\n";
}
else
{
msg += "\n";
}
if (pProgress != NULL)
{
pProgress->updateProgress(msg, 100, lvl);
}
}
}
return bSuccess;
}
示例8: VERIFY
bool AutoImporter::getInputSpecification(PlugInArgList*& pArgList)
{
pArgList = NULL;
pArgList = mpPlugInManager->getPlugInArgList();
if (pArgList == NULL)
{
return false;
}
// Menu command
PlugInArg* pArg = mpPlugInManager->getPlugInArg();
VERIFY(pArg != NULL);
pArg->setName(Executable::MenuCommandArg());
pArg->setType("string");
pArg->setDescription("String name for the menu command.");
pArg->setDefaultValue(NULL);
pArgList->addArg(*pArg);
// Progress
pArg = mpPlugInManager->getPlugInArg();
VERIFY(pArg != NULL);
pArg->setName(Executable::ProgressArg());
pArg->setType("Progress");
pArg->setDescription(Executable::ProgressArgDescription());
pArg->setDefaultValue(NULL);
pArgList->addArg(*pArg);
// Data element
pArg = mpPlugInManager->getPlugInArg();
VERIFY(pArg != NULL);
pArg->setName(Importer::ImportElementArg());
pArg->setType("DataElement");
pArg->setDescription("Data element to be imported.");
pArg->setDefaultValue(NULL);
pArgList->addArg(*pArg);
return true;
}
示例9: VERIFY
bool ModelExporter::getInputSpecification(PlugInArgList*& pInArgList)
{
pInArgList = mpPlugInManager->getPlugInArgList();
VERIFY(pInArgList != NULL);
PlugInArg* pArg = NULL;
VERIFY((pArg = mpPlugInManager->getPlugInArg()) != NULL);
pArg->setName(Executable::ProgressArg());
pArg->setType("Progress");
pArg->setDefaultValue(NULL);
pArg->setDescription(Executable::ProgressArgDescription());
pInArgList->addArg(*pArg);
VERIFY((pArg = mpPlugInManager->getPlugInArg()) != NULL);
pArg->setName(Exporter::ExportDescriptorArg());
pArg->setType("FileDescriptor");
pArg->setDefaultValue(NULL);
pArg->setDescription("File descriptor for the output file.");
pInArgList->addArg(*pArg);
VERIFY((pArg = mpPlugInManager->getPlugInArg()) != NULL);
pArg->setName(Exporter::ExportItemArg());
pArg->setType(mDataElementSubclass);
pArg->setDefaultValue(NULL);
pArg->setDescription("Model item to export.");
pInArgList->addArg(*pArg);
return true;
}
示例10: isInputValid
bool BandMath::isInputValid(PlugInArgList& pArgList)
{
PlugInArg* pArg = NULL;
// The following must always have values set for them
// Sensor data
if (!pArgList.getArg(Executable::DataElementArg(), pArg) || (pArg == NULL) || !pArg->isActualSet())
{
mpStep->finalize(Message::Failure, "Sensor data input argument not present.");
meGabbiness = ERRORS;
return false;
}
if (!mbInteractive)
{
// Sensor data
if (!pArgList.getArg("Cube 2", pArg) || (pArg == NULL) || !pArg->isActualSet())
{
mpStep->finalize(Message::Failure, "Sensor data input argument not present.");
meGabbiness = ERRORS;
return false;
}
// Sensor data
if (!pArgList.getArg("Cube 3", pArg) || (pArg == NULL) || !pArg->isActualSet())
{
mpStep->finalize(Message::Failure, "Sensor data input argument not present.");
meGabbiness = ERRORS;
return false;
}
// Sensor data
if (!pArgList.getArg("Cube 4", pArg) || (pArg == NULL))
{
mpStep->finalize(Message::Failure, "Sensor data input argument not present.");
meGabbiness = ERRORS;
return false;
}
// Sensor data
if (!pArgList.getArg("Cube 5", pArg) || (pArg == NULL))
{
mpStep->finalize(Message::Failure, "Sensor data input argument not present.");
meGabbiness = ERRORS;
return false;
}
// Test
if (pArgList.getArg("Input Expression", pArg) || (pArg == NULL) || !pArg->isActualSet())
{
mpStep->finalize(Message::Failure, "Expression input argument not present.");
meGabbiness = ERRORS;
return false;
}
// Test Display Results
if (pArgList.getArg("Display Results", pArg) || (pArg == NULL) || !pArg->isActualSet())
{
mpStep->finalize(Message::Failure, "Display Results input argument not present.");
meGabbiness = ERRORS;
return false;
}
// Test Degrees
if (pArgList.getArg("Degrees", pArg) || (pArg == NULL) || !pArg->isActualSet())
{
mpStep->finalize(Message::Failure, "Degrees input argument not present.");
meGabbiness = ERRORS;
return false;
}
}
return true;
}
示例11: setBatch
bool SioImporter::ensureStatisticsReadProperly(Progress *pProgress, std::ostream& failure)
{
bool success = true;
success &= setBatch();
PlugInArgList* pInList = NULL;
PlugInArgList* pOutList = NULL;
isseas(getInputSpecification(pInList) != false, failure);
isseas(getOutputSpecification(pOutList) != false, failure);
PlugInArg* pRasterElementArg = NULL;
isseas(pInList->getArg(Importer::ImportElementArg(), pRasterElementArg) != false, failure);
string testFilePath = TestUtilities::getTestDataPath() + "tipjul5bands.sio";
RasterElement* pRasterElement = NULL;
if (success)
{
vector<ImportDescriptor*> descriptors = getImportDescriptors(testFilePath);
if (descriptors.empty() == false)
{
ImportDescriptor* pImportDescriptor = descriptors.front();
if (pImportDescriptor != NULL)
{
DataDescriptor* pDescriptor = pImportDescriptor->getDataDescriptor();
if (pDescriptor != NULL)
{
Service<ModelServices> pModel;
pRasterElement = dynamic_cast<RasterElement*>(pModel->createElement(pDescriptor));
if (pRasterElement != NULL)
{
pRasterElementArg->setActualValue(pRasterElement);
}
}
}
}
}
isseas(execute(pInList, pOutList) != false, failure);
isseas(pRasterElement != NULL, failure);
if (success)
{
RasterDataDescriptor* pDescriptor = dynamic_cast<RasterDataDescriptor*>(pRasterElement->getDataDescriptor());
isseas(pDescriptor != NULL, failure);
const vector<DimensionDescriptor>& loadedBands = pDescriptor->getBands();
isseas(loadedBands.size() == 5, failure);
int iNumBandsWithStats = 0;
for (int i = 0; i < 5; ++i)
{
// we don't want to do an assert yet... only when we know 4 bands have computed statistics
Statistics* pStatistics = pRasterElement->getStatistics(loadedBands[i]);
if (pStatistics != NULL)
{
if (pStatistics->areStatisticsCalculated() == true)
{
if (success)
{
iNumBandsWithStats++;
}
}
}
}
// success of the band computation is dependent on 4 bands with statistics
isseas(iNumBandsWithStats == 3, failure);
}
if (pRasterElement != NULL)
{
Service<ModelServices> pModel;
pModel->destroyElement(pRasterElement);
pRasterElement = NULL;
}
Service<PlugInManagerServices> pPim;
if (pInList)
{
pPim->destroyPlugInArgList(pInList);
}
if (pOutList)
{
pPim->destroyPlugInArgList(pOutList);
}
return success;
}