本文整理汇总了C++中ItemPtr::GetIvLink方法的典型用法代码示例。如果您正苦于以下问题:C++ ItemPtr::GetIvLink方法的具体用法?C++ ItemPtr::GetIvLink怎么用?C++ ItemPtr::GetIvLink使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ItemPtr
的用法示例。
在下文中一共展示了ItemPtr::GetIvLink方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
IvDragger::IvDragger(QtCoinViewerPtr viewer, ItemPtr pItem, float draggerScale)
{
_selectedItem = pItem;
_viewer = viewer;
_scale = draggerScale;
_penv = viewer->GetEnv();
//_ptext = NULL;
// set some default behavioral options
_checkCollision = false;
_prevtransparency = pItem->GetIvTransparency()->value;
pItem->GetIvTransparency()->value = SoGLRenderAction::SCREEN_DOOR;
if( !!pItem &&(pItem->GetIvRoot() != NULL)) {
_GetBounds(pItem->GetIvRoot(), _ab);
// make the item transparent
SoSearchAction search;
search.setType(SoMaterial::getClassTypeId());
search.setInterest(SoSearchAction::ALL);
search.apply(pItem->GetIvRoot());
for(int i = 0; i < search.getPaths().getLength(); ++i) {
SoPath* path = search.getPaths()[i];
SoMaterial* pmtrl = (SoMaterial*)path->getTail();
vtransparency.push_back(pmtrl->transparency[0]);
pmtrl->transparency = 0.25f;
}
_vlinkaxes.resize(pItem->GetNumIvLinks());
for(size_t i = 0; i < _vlinkaxes.size(); ++i) {
_vlinkaxes[i] = _CreateAxes(i == 0 ? 1.0f : 0.25f,0.5f);
pItem->GetIvLink(i)->addChild(_vlinkaxes[i]);
}
}
}
示例2: GetSelectedItem
IvDragger::~IvDragger()
{
ItemPtr selectedItem = GetSelectedItem();
if( !!selectedItem &&(selectedItem->GetIvRoot() != NULL)) {
for(size_t i = 0; i < _vlinkaxes.size(); ++i) {
selectedItem->GetIvLink(i)->removeChild(_vlinkaxes[i]);
}
_vlinkaxes.clear();
// revert transparency
SoSearchAction search;
search.setType(SoMaterial::getClassTypeId());
search.setInterest(SoSearchAction::ALL);
search.apply(selectedItem->GetIvRoot());
for(int i = 0; i < search.getPaths().getLength(); ++i) {
SoPath* path = search.getPaths()[i];
SoMaterial* pmtrl = (SoMaterial*)path->getTail();
if( i < (int)vtransparency.size() )
pmtrl->transparency = vtransparency[i];
}
selectedItem->GetIvTransparency()->value = _prevtransparency;
}
}