本文整理汇总了C++中SoInput::setStringArray方法的典型用法代码示例。如果您正苦于以下问题:C++ SoInput::setStringArray方法的具体用法?C++ SoInput::setStringArray怎么用?C++ SoInput::setStringArray使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SoInput
的用法示例。
在下文中一共展示了SoInput::setStringArray方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char *argv[])
{
SoDB::init();
QApplication app(argc, argv);
qAddPostRoutine(cleanup);
// Moved here because of https://developer.oculusvr.com/forums/viewtopic.php?f=17&t=7915&p=108503#p108503
// Init libovr.
if (!ovr_Initialize()) {
qDebug() << "Could not initialize Oculus SDK.";
exit(1);
}
CoinRiftWidget window;
window.show();
// An example scene.
static const char * inlineSceneGraph[] = {
"#Inventor V2.1 ascii\n",
"\n",
"Separator {\n",
" Rotation { rotation 1 0 0 0.3 }\n",
" Cone { }\n",
" BaseColor { rgb 1 0 0 }\n",
" Scale { scaleFactor .7 .7 .7 }\n",
" Cube { }\n",
"\n",
" DrawStyle { style LINES }\n",
" ShapeHints { vertexOrdering COUNTERCLOCKWISE }\n",
" Coordinate3 {\n",
" point [\n",
" -2 -2 1.1, -2 -1 1.1, -2 1 1.1, -2 2 1.1,\n",
" -1 -2 1.1, -1 -1 1.1, -1 1 1.1, -1 2 1.1\n",
" 1 -2 1.1, 1 -1 1.1, 1 1 1.1, 1 2 1.1\n",
" 2 -2 1.1, 2 -1 1.1, 2 1 1.1, 2 2 1.1\n",
" ]\n",
" }\n",
"\n",
" Complexity { value 0.7 }\n",
" NurbsSurface {\n",
" numUControlPoints 4\n",
" numVControlPoints 4\n",
" uKnotVector [ 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0 ]\n",
" vKnotVector [ 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0 ]\n",
" }\n",
"}\n",
NULL
};
SoInput in;
in.setStringArray(inlineSceneGraph);
window.setSceneGraph(SoDB::readAll(&in));
return app.exec();
}
示例2: oculusSetTestScene
void oculusSetTestScene(View3DInventorRiftViewer *window)
{
assert(window);
// An example scene.
static const char * inlineSceneGraph[] = {
"#Inventor V2.1 ascii\n",
"\n",
"Separator {\n",
" Rotation { rotation 1 0 0 0.3 }\n",
" Cone { }\n",
" BaseColor { rgb 1 0 0 }\n",
" Scale { scaleFactor .7 .7 .7 }\n",
" Cube { }\n",
"\n",
" DrawStyle { style LINES }\n",
" ShapeHints { vertexOrdering COUNTERCLOCKWISE }\n",
" Coordinate3 {\n",
" point [\n",
" -2 -2 1.1, -2 -1 1.1, -2 1 1.1, -2 2 1.1,\n",
" -1 -2 1.1, -1 -1 1.1, -1 1 1.1, -1 2 1.1\n",
" 1 -2 1.1, 1 -1 1.1, 1 1 1.1, 1 2 1.1\n",
" 2 -2 1.1, 2 -1 1.1, 2 1 1.1, 2 2 1.1\n",
" ]\n",
" }\n",
"\n",
" Complexity { value 0.7 }\n",
" NurbsSurface {\n",
" numUControlPoints 4\n",
" numVControlPoints 4\n",
" uKnotVector [ 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0 ]\n",
" vKnotVector [ 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0 ]\n",
" }\n",
"}\n",
NULL
};
SoInput in;
in.setStringArray(inlineSceneGraph);
window->setSceneGraph(SoDB::readAll(&in));
}
示例3: SoScale
IVElement::IVElement(string ivfile, KthReal sc) {
for(int i=0;i<3;i++){
position[i]= 0.0f;
orientation[i]=0.0f;
}
orientation[2]=1.0f;
orientation[3]=0.0f;
scale=sc;
trans= new SoTranslation;
rot = new SoRotation;
sca = new SoScale();
color = new SoMaterial;
posVec = new SoSFVec3f;
trans->translation.connectFrom(posVec);
posVec->setValue((float)position[0],(float)position[1],(float)position[2]);
rotVec = new SoSFRotation;
rotVec->setValue(SbVec3f((float)orientation[0],(float)orientation[1],
(float)orientation[2]),(float)orientation[3]);
rot->rotation.connectFrom(rotVec);
scaVec= new SoSFVec3f;
scaVec->setValue((float)scale,(float)scale,(float)scale);
sca->scaleFactor.connectFrom(scaVec);
SoInput input;
ivmodel = new SoSeparator;
ivmodel->ref();
ivmodel->addChild(sca);
if(input.openFile(ivfile.c_str()))
ivmodel->addChild(SoDB::readAll(&input));
else
{
//ivmodel->addChild(new SoSphere());
static const char *str[] = {
"#VRML V1.0 ascii\n",
"DEF pointgoal Separator {\n",
" Separator {\n",
" MaterialBinding { value PER_PART }\n",
" Coordinate3 {\n",
" point [\n",
" 0.0 0.0 0.0\n",
" ]\n",
" }\n",
" DrawStyle { pointSize 5 }\n",
" PointSet { }\n",
" }\n",
"}\n",
NULL
};
input.setStringArray(str);
SoSeparator *sep = SoDB::readAll(&input);
sep->ref();
while (sep->getNumChildren() > 0)
{
ivmodel->addChild(sep->getChild(0));
sep->removeChild(0);
}
sep->unref();
}
ivmodel->ref();
}