本文整理汇总了C++中ItemPtr::GetTransform方法的典型用法代码示例。如果您正苦于以下问题:C++ ItemPtr::GetTransform方法的具体用法?C++ ItemPtr::GetTransform怎么用?C++ ItemPtr::GetTransform使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ItemPtr
的用法示例。
在下文中一共展示了ItemPtr::GetTransform方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: IvDragger
IvObjectDragger::IvObjectDragger(QtCoinViewerPtr viewer, ItemPtr pItem, float draggerScale, bool bAllowRotation)
: IvDragger(viewer, pItem, draggerScale)
{
// create a root node for the dragger nodes
_draggerRoot = new SoSeparator;
ItemPtr selectedItem = GetSelectedItem();
selectedItem->GetIvRoot()->insertChild(_draggerRoot, 0);
// create and size a transform box dragger and then add it to the scene graph
_transformBox = new SoTransformBoxDragger;
_transformBox->scaleFactor.setValue(_ab.extents.x * _scale, _ab.extents.y * _scale, _ab.extents.z * _scale);
_transformBox->translation.setValue(_ab.pos.x, _ab.pos.y, _ab.pos.z);
_toffset = selectedItem->GetTransform();
_draggerRoot->addChild(_transformBox);
// disable the scaling part of the transform box
_transformBox->setPart("scaler", NULL);
// disable the rotation around the X and Z axes
if (!bAllowRotation) {
const char *rotators[2] = { "rotator1", "rotator3" };
for (int i = 0; i < 2; i++)
_transformBox->setPart(rotators[i], NULL);
}
// get the material node that governs the color of the dragger and
// note the dragger's normal color
if (bAllowRotation) {
SoRotateCylindricalDragger *rp = (SoRotateCylindricalDragger *)_transformBox->getPart("rotator1", false);
SoSeparator *s = (SoSeparator *) rp->getPart("rotator", false);
_draggerMaterial = (SoMaterial *) s->getChild(0);
}
else
_draggerMaterial = new SoMaterial();
_normalColor = _draggerMaterial->diffuseColor[0];
// add a motion callback handler for the dragger
_transformBox->addMotionCallback(_MotionHandler, this);
UpdateDragger();
}