当前位置: 首页>>代码示例>>C++>>正文


C++ SoInput::setStringArray方法代码示例

本文整理汇总了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();
}
开发者ID:3DPrinterGuy,项目名称:FreeCAD,代码行数:57,代码来源:CoinRiftWidget.cpp

示例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));
}
开发者ID:3DPrinterGuy,项目名称:FreeCAD,代码行数:41,代码来源:View3DInventorRiftViewer.cpp

示例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();

	}
开发者ID:joseparnau,项目名称:rosjac,代码行数:68,代码来源:ivelement.cpp


注:本文中的SoInput::setStringArray方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。