本文整理汇总了C++中osg::Parameters::size方法的典型用法代码示例。如果您正苦于以下问题:C++ Parameters::size方法的具体用法?C++ Parameters::size怎么用?C++ Parameters::size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类osg::Parameters
的用法示例。
在下文中一共展示了Parameters::size方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: run
virtual bool run(void* objectPtr, osg::Parameters& inputParameters, osg::Parameters&) const
{
osgUI::Widget* widget = reinterpret_cast<osgUI::Widget*>(objectPtr);
osgGA::EventVisitor* ev = (inputParameters.size()>=1) ? dynamic_cast<osgGA::EventVisitor*>(inputParameters[0].get()) : 0;
osgGA::Event* event = (inputParameters.size()>=2) ? dynamic_cast<osgGA::Event*>(inputParameters[1].get()) : 0;
if (!widget || !ev || !event) return false;
widget->handleImplementation(ev, event);
return true;
}
示例2: run
virtual bool run(void* objectPtr, osg::Parameters& inputParameters, osg::Parameters& outputParameters) const
{
if (inputParameters.size()<2) return false;
unsigned int index = 0;
osg::ValueObject* indexObject = inputParameters[0]->asValueObject();
if (indexObject) indexObject->getScalarValue(index);
osg::Drawable* child = dynamic_cast<osg::Drawable*>(inputParameters[1].get());
if (!child) return false;
osg::Geode* geode = reinterpret_cast<osg::Geode*>(objectPtr);
geode->setDrawable(index, child);
return true;
}
示例3: run
virtual bool run(void* objectPtr, osg::Parameters& inputParameters, osg::Parameters& outputParameters) const
{
if (inputParameters.size()<2) return false;
osg::Object* indexObject = inputParameters[0].get();
unsigned int index = 0;
osg::DoubleValueObject* dvo = dynamic_cast<osg::DoubleValueObject*>(indexObject);
if (dvo) index = static_cast<unsigned int>(dvo->getValue());
else
{
osg::UIntValueObject* uivo = dynamic_cast<osg::UIntValueObject*>(indexObject);
if (uivo) index = uivo->getValue();
}
bool enabled = false;
osg::Object* valueObject = inputParameters[1].get();
if (!valueObject) return false;
dvo = dynamic_cast<osg::DoubleValueObject*>(valueObject);
if (dvo)
{
enabled = dvo->getValue()!=0.0;
}
else
{
osg::UIntValueObject* uivo = dynamic_cast<osg::UIntValueObject*>(valueObject);
if (uivo)
{
enabled = uivo->getValue()!=0;
}
else
{
osg::BoolValueObject* bo = dynamic_cast<osg::BoolValueObject*>(valueObject);
if (bo)
{
enabled = bo->getValue();
}
}
}
osg::Switch* sw = reinterpret_cast<osg::Switch*>(objectPtr);
sw->setValue(index, enabled);
return true;
}
示例4: run
virtual bool run(void* objectPtr, osg::Parameters& inputParameters, osg::Parameters& outputParameters) const
{
if (inputParameters.size()<2) return false;
unsigned int index = 0;
osg::ValueObject* indexObject = inputParameters[0]->asValueObject();
if (indexObject) indexObject->getScalarValue(index);
bool enabled = false;
osg::ValueObject* valueObject = inputParameters[1]->asValueObject();
if (valueObject) valueObject->getScalarValue(enabled);
osg::Switch* sw = reinterpret_cast<osg::Switch*>(objectPtr);
sw->setValue(index, enabled);
return true;
}
示例5: run
virtual bool run(void* objectPtr, osg::Parameters& inputParameters, osg::Parameters& outputParameters) const
{
if (inputParameters.size()<2) return false;
osg::Object* indexObject = inputParameters[0].get();
OSG_NOTICE<<"GeodeSetChild "<<indexObject->className()<<std::endl;
unsigned int index = 0;
osg::DoubleValueObject* dvo = dynamic_cast<osg::DoubleValueObject*>(indexObject);
if (dvo) index = static_cast<unsigned int>(dvo->getValue());
else
{
osg::UIntValueObject* uivo = dynamic_cast<osg::UIntValueObject*>(indexObject);
if (uivo) index = uivo->getValue();
}
osg::Drawable* child = dynamic_cast<osg::Drawable*>(inputParameters[1].get());
if (!child) return false;
osg::Geode* geode = reinterpret_cast<osg::Geode*>(objectPtr);
geode->setDrawable(index, child);
return true;
}