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


C++ Cone::setObjectID方法代码示例

本文整理汇总了C++中Cone::setObjectID方法的典型用法代码示例。如果您正苦于以下问题:C++ Cone::setObjectID方法的具体用法?C++ Cone::setObjectID怎么用?C++ Cone::setObjectID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Cone的用法示例。


在下文中一共展示了Cone::setObjectID方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: initAxisHandleObjects

void Handle::initAxisHandleObjects()
{
	// assumes none of them have been created yet

	Handle::pObjectXTranslateHandleLine = new Cylinder(1.0f, 0.03f, 6, 1);
	Handle::pObjectYTranslateHandleLine = new Cylinder(1.0f, 0.03f, 6, 1);
	Handle::pObjectZTranslateHandleLine = new Cylinder(1.0f, 0.03f, 6, 1);

	Handle::pObjectXTranslateHandleHead = new Cone(0.2f, 0.07f, 8);
	Handle::pObjectYTranslateHandleHead = new Cone(0.2f, 0.07f, 8);
	Handle::pObjectZTranslateHandleHead = new Cone(0.2f, 0.07f, 8);

	Cylinder *pX = Handle::pObjectXTranslateHandleLine;
	Cylinder *pY = Handle::pObjectYTranslateHandleLine;
	Cylinder *pZ = Handle::pObjectZTranslateHandleLine;

	pX->setObjectID(eXTranslate);
	pX->setPosition(Point(0.6f, 0.0f, 0.0f));
	pX->rotate(0.0f, 0.0f, 90.0f);
	pX->constructGeometry();

	pY->setObjectID(eYTranslate);
	pY->setPosition(Point(0.0f, 0.6f, 0.0f));
	pY->constructGeometry();

	pZ->setObjectID(eZTranslate);
	pZ->setPosition(Point(0.0f, 0.0f, 0.6f));
	pZ->rotate(-90.0f, 0.0f, 0.0f);
	pZ->constructGeometry();

	Cone *pXHead = Handle::pObjectXTranslateHandleHead;
	Cone *pYHead = Handle::pObjectYTranslateHandleHead;
	Cone *pZHead = Handle::pObjectZTranslateHandleHead;

	pXHead->setObjectID(eXTranslate);
	pXHead->setPosition(Point(1.1f, 0.0f, 0.0f));
	pXHead->rotate(0.0f, 0.0f, -90.0f);
	pXHead->constructGeometry();

	pYHead->setObjectID(eYTranslate);
	pYHead->setPosition(Point(0.0f, 1.1f, 0.0f));
	pYHead->constructGeometry();

	pZHead->setObjectID(eZTranslate);
	pZHead->setPosition(Point(0.0f, 0.0f, 1.1f));
	pZHead->rotate(90.0f, 0.0f, 0.0f);
	pZHead->constructGeometry();

	/// object rotate

	Torus* pXRotate = new Torus(kObjectRotateHandleThickness, kObjectRotateHandleRadius, kObjectRotateHandleSegments, kObjectRotateHandleSides);
	Torus* pYRotate = new Torus(kObjectRotateHandleThickness, kObjectRotateHandleRadius, kObjectRotateHandleSegments, kObjectRotateHandleSides);
	Torus* pZRotate = new Torus(kObjectRotateHandleThickness, kObjectRotateHandleRadius, kObjectRotateHandleSegments, kObjectRotateHandleSides);

	Handle::pObjectXRotateHandleLoop = pXRotate;
	Handle::pObjectYRotateHandleLoop = pYRotate;
	Handle::pObjectZRotateHandleLoop = pZRotate;

	pXRotate->setObjectID(eXRotate);
	pXRotate->rotate(0.0f, 0.0f, -90.0f);
	pXRotate->constructGeometry();

	pYRotate->setObjectID(eYRotate);
	pYRotate->rotate(0.0f, 0.0f, 0.0f);
	pYRotate->constructGeometry();

	pZRotate->setObjectID(eZRotate);
	pZRotate->rotate(90.0f, 0.0f, 0.0f);
	pZRotate->constructGeometry();

	/// face

	Handle::pFaceNormalTranslateHandleLine = new Cylinder(1.0f, 0.03f, 6, 1);
	Handle::pFaceNormalTranslateHandleHead = new Cone(0.2f, 0.07f, 8);
	Handle::pFaceExtrude = new Cube(0.05f);

	Cylinder* pFaceNormalLine = Handle::pFaceNormalTranslateHandleLine;
	pFaceNormalLine->setObjectID(eFaceNormalTranslate);
	pFaceNormalLine->setPosition(Point(0.0f, 0.6f, 0.0f));
	pFaceNormalLine->constructGeometry();

	Cone* pFaceNormalHead = Handle::pFaceNormalTranslateHandleHead;
	pFaceNormalHead->setObjectID(eFaceNormalTranslate);
	pFaceNormalHead->setPosition(Point(0.0f, 1.1f, 0.0f));
	pFaceNormalHead->constructGeometry();

	Cube* pFaceExtrude = Handle::pFaceExtrude;
	pFaceExtrude->setObjectID(eFaceExtrude);
	pFaceExtrude->setPosition(Point(0.0f, 1.4f, 0.0f));
	pFaceExtrude->constructGeometry();

	Handle::pFaceTranslateXLine = new Cylinder(1.0f, 0.03f, 6, 1);
	Handle::pFaceTranslateYLine = new Cylinder(1.0f, 0.03f, 6, 1);

	Cylinder* pFaceTranslateXLine = Handle::pFaceTranslateXLine;
	pFaceTranslateXLine->setObjectID(eFaceTranslateX);
	pFaceTranslateXLine->setRotation(Vector(0.0f, 0.0f, -90.0f));
	pFaceTranslateXLine->setPosition(Point(0.6f, 0.0f, 0.0f));
	pFaceTranslateXLine->constructGeometry();

//.........这里部分代码省略.........
开发者ID:ppearson,项目名称:ImaginePartial,代码行数:101,代码来源:handle.cpp


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