本文整理汇总了C++中Any::getData方法的典型用法代码示例。如果您正苦于以下问题:C++ Any::getData方法的具体用法?C++ Any::getData怎么用?C++ Any::getData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Any
的用法示例。
在下文中一共展示了Any::getData方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: execute
bool VideoImporter::execute(PlugInArgList *pInArgList, PlugInArgList *pOutArgList)
{
if(pInArgList == NULL)
{
return false;
}
// Create a message log step
mProgress = ProgressTracker(pInArgList->getPlugInArgValue<Progress>(ProgressArg()),
"Execute video importer", "coan", "{6385aa93-ff7f-4ee7-9308-b3476aca544b}");
DataElement* pElmnt = pInArgList->getPlugInArgValue<DataElement>(ImportElementArg());
mpRasterElement = dynamic_cast<RasterElement*>(pElmnt);
mpStreamElement = dynamic_cast<Any*>(pElmnt);
if (mpRasterElement == NULL && mpStreamElement == NULL)
{
mProgress.report("The data element input value is invalid.", 0, ERRORS, true);
return false;
}
if (mpRasterElement != NULL)
{
mProgress.report("Initialize display.", 1, NORMAL);
if (!mpRasterElement->createDefaultPager())
{
//return checkAbortOrError("Could not allocate resources for new RasterElement", pStep.get());
return false;
}
// schedule load of first frame
Any* pParent = dynamic_cast<Any*>(mpRasterElement->getParent());
VERIFY(pParent != NULL);
VideoStream* pStream = dynamic_cast<VideoStream*>(pParent->getData());
VERIFY(pStream != NULL);
if (!pStream->setDisplay(mpRasterElement))
{
mProgress.report("Unable to display the stream.", 0, ERRORS, true);
return false;
}
// Create the view
if(!isBatch() && !Service<SessionManager>()->isSessionLoading())
{
SpatialDataView *pView = createView();
if(pView == NULL)
{
mProgress.report("The view could not be created.", 0, ERRORS, true);
return false;
}
// Add the view to the output arg list
if(pOutArgList != NULL)
{
pOutArgList->setPlugInArgValue("View", pView);
}
}
mProgress.report("Display initialization complete.", 100, NORMAL);
}
else if (mpStreamElement != NULL)
{
mProgress.report("Initialize video stream.", 1, NORMAL);
// initialize the stream data
VideoStream* pStream = NULL;
std::vector<PlugIn*> instances = Service<PlugInManagerServices>()->getPlugInInstances("Video Stream Manager");
StreamManager* pStreamManager = instances.empty() ? NULL : dynamic_cast<StreamManager*>(instances.front());
if (pStreamManager != NULL)
{
if (pStreamManager->initializeStream(mpStreamElement))
{
pStream = dynamic_cast<VideoStream*>(mpStreamElement->getData());
}
}
if (pStream == NULL)
{
mProgress.report("Unable to initialize the video stream.", 0, ERRORS, true);
return false;
}
// create animation
AnimationController* pController = Service<AnimationServices>()->getAnimationController(mpStreamElement->getName());
if (pController == NULL)
{
pController = Service<AnimationServices>()->createAnimationController(mpStreamElement->getName(), FRAME_TIME);
}
if (pController == NULL)
{
mProgress.report("Unable to create animation.", 0, ERRORS, true);
return false;
}
if (!isBatch())
{
AnimationToolBar* pToolBar = static_cast<AnimationToolBar*>(Service<DesktopServices>()->getWindow("Animation", TOOLBAR));
VERIFY(pToolBar);
pToolBar->setAnimationController(pController);
}
Animation* pAnim = pController->createAnimation(mpStreamElement->getName());
VERIFY(pAnim != NULL);
if (!pStream->setAnimation(pAnim, pController))
{
mProgress.report("Unable to create animation.", 0, ERRORS, true);
return false;
}
//.........这里部分代码省略.........