本文整理汇总了C++中readerwriter::ReadResult类的典型用法代码示例。如果您正苦于以下问题:C++ ReadResult类的具体用法?C++ ReadResult怎么用?C++ ReadResult使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ReadResult类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: readHeightFieldFile
HeightField* osgDB::readHeightFieldFile(const std::string& filename,const Options* options)
{
ReaderWriter::ReadResult rr = Registry::instance()->readHeightField(filename,options);
if (rr.validHeightField()) return rr.takeHeightField();
if (rr.error()) OSG_WARN << rr.message() << std::endl;
return NULL;
}
示例2:
osg::ref_ptr<osg::Node> osgDB::readRefNodeFile(const std::string& filename,const Options* options)
{
ReaderWriter::ReadResult rr = Registry::instance()->readNode(filename,options);
if (rr.validNode()) return osg::ref_ptr<osg::Node>(rr.getNode());
if (rr.error()) OSG_WARN << rr.message() << std::endl;
return NULL;
}
示例3: readNodeFile
Node* osgDB::readNodeFile(const std::string& filename,const ReaderWriter::Options* options)
{
ReaderWriter::ReadResult rr = Registry::instance()->readNode(filename,options);
if (rr.validNode()) return rr.takeNode();
if (rr.error()) notify(WARN) << rr.message() << std::endl;
return NULL;
}
示例4:
osg::ref_ptr<osg::HeightField> osgDB::readRefHeightFieldFile(const std::string& filename,const ReaderWriter::Options* options)
{
ReaderWriter::ReadResult rr = Registry::instance()->readHeightField(filename,options);
if (rr.validHeightField()) return osg::ref_ptr<osg::HeightField>(rr.getHeightField());
if (rr.error()) notify(WARN) << rr.message() << std::endl;
return NULL;
}
示例5: openArchive
osgDB::Archive* osgDB::openArchive(const std::string& filename, ReaderWriter::ArchiveStatus status, unsigned int indexBlockSizeHint,Options* options)
{
// ensure archive extension is in the registry list
std::string::size_type dot = filename.find_last_of('.');
if (dot != std::string::npos)
{
std::string ext = filename.substr(dot+1);
Registry::instance()->addArchiveExtension(ext);
}
ReaderWriter::ReadResult result = osgDB::Registry::instance()->openArchive(filename, status, indexBlockSizeHint, options);
return result.takeArchive();
}
示例6: readNodeFile
Node* osgDB::readNodeFile(const std::string& filename,const Options* options)
{
ReaderWriter::ReadResult rr = Registry::instance()->readNode(filename,options);
if (rr.validNode()) return rr.takeNode();
if (rr.error()) OSG_WARN << rr.message() << std::endl;
if (rr.notEnoughMemory()) OSG_INFO << "Not enought memory to load file "<<filename << std::endl;
return NULL;
}
示例7: preFrame
void TouchDesigner::preFrame() {
string data = "";
// cerr << "painting\t" << endl;
if (ComController::instance()->isMaster()) // head node
{
data = st->getSerializedScene();
dsize = data.size();
// cerr << "in master doing nothing" << endl;
ComController::instance()->sendSlaves(&dsize, sizeof(int));
ComController::instance()->sendSlaves(&data[0], dsize);
ComController::instance()->sendSlaves(&received, sizeof(bool));
} else // rendering nodes
{
// cerr<<"slave node"<<endl;
ComController::instance()->readMaster(&dsize, sizeof(int));
recvData.resize(dsize);
ComController::instance()->readMaster(&recvData[0], dsize);
data = recvData;
ComController::instance()->readMaster(&received, sizeof(bool));
}
//cerr << "data size\t" << dsize << endl;
std::stringstream ss(data);
osgDB::ReaderWriter * readerwriter =
Registry::instance()->getReaderWriterForExtension("ive");
ReaderWriter::ReadResult result = readerwriter->readNode(ss);
if (result.validNode()) {
//printf("Node valid\n");
//cerr<<"Valid Node"<<endl;
Node * node = result.getNode();
/*
osg::Geode * geode = dynamic_cast<osg::Geode* > (node);
if( geode )
{
for(int i = 0; i < geode->getNumDrawables(); i++)
{
osg::Geometry* geom = dynamic_cast<osg::Geometry*> (geode->getDrawable(i));
if( geom )
{
osg::Vec3Array* array = dynamic_cast<osg::Vec3Array *> (geom->getVertexArray());
for(int j =0; j < array->size(); j++)
{
cerr << array->at(0)[0] << " " << array->at(0)[1] << " " << array->at(0)[2] << endl;
}
}
}
}
*/
osg::Group * objectRoot = SceneManager::instance()->getObjectsRoot();
// remove all children and add new node
objectRoot->addChild(node);
if (prevNode)
objectRoot->removeChild(prevNode);
prevNode = node;
// lets see if directly reassigning the entire thing works?
// TODO err, is there a way to assign the root object as node?
//SceneManager::instance()->getObjectsRoot() = node->asGroup();
}
//cerr << "" << endl;
}