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


C++ ItemPtr类代码示例

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


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

示例1: GetSelectedItem

// Update the skeleton transforms based on the dragger.
void IvObjectDragger::UpdateSkeleton()
{
    ItemPtr selectedItem = GetSelectedItem();
    if( !selectedItem ) {
        return;
    }
    RaveTransform<float> tbox;
    const float* q = _transformBox->rotation.getValue().getValue();
    tbox.rot = Vector(q[3], q[0], q[1], q[2]);
    SbVec3f v = _transformBox->translation.getValue();
    tbox.trans = Vector(v[0], v[1], v[2]);

    Transform told; told.trans = -_ab.pos;

    RaveTransform<float> tnew = tbox*told*_toffset;
    SetSoTransform(selectedItem->GetIvTransform(), tnew);

    KinBodyItemPtr pbody = boost::dynamic_pointer_cast<KinBodyItem>(selectedItem);
    if( !!pbody ) {
        pbody->UpdateFromIv();
        CheckCollision(_checkCollision);
    }
    // other motion handler calls
    _viewer.lock()->_UpdateCameraTransform(0);
}
开发者ID:AbuShaqra,项目名称:openrave,代码行数:26,代码来源:ivselector.cpp

示例2: insertMenuItem

void Menu::insertMenuItem( HMENU hmenu, int index, ItemPtr item )
{
    MENUITEMINFO info = { sizeof( info ), MIIM_STRING | MIIM_ID | MIIM_DATA, 0, 0,
                          item->commandID(), NULL, NULL, NULL, (DWORD)item.getObject(), "menu"
                        };
    InsertMenuItem( hmenu, index, MF_BYPOSITION, &info );
}
开发者ID:siredblood,项目名称:tree-bumpkin-project,代码行数:7,代码来源:gui_menu.cpp

示例3: updateAction

void Menu::updateAction( HMENU hmenu, int& index, ItemPtr item, const MENUITEMINFO& info )
{
    if( !info.dwTypeData || buildMenuText( item ) != (LPCTSTR)info.dwTypeData )
        ModifyMenu( hmenu, index, MF_BYPOSITION | MF_STRING, item->commandID(),
                    buildMenuText( item ).c_str() );
    EnableMenuItem( hmenu, index, MF_BYPOSITION | ( item->update() ? MF_ENABLED : MF_GRAYED ) );
}
开发者ID:siredblood,项目名称:tree-bumpkin-project,代码行数:7,代码来源:gui_menu.cpp

示例4: getGround

bool Tile::isFullGround()
{
    ItemPtr ground = getGround();
    if(ground && ground->isFullGround())
        return true;
    return false;
}
开发者ID:Cadyan,项目名称:otclient,代码行数:7,代码来源:tile.cpp

示例5: add

void Item::add( ItemPtr item )
{
	if( isAncestor( item.getObject() ) )
		throw 1;
	subitems_.push_back( item );
	item->addParent( this );
}
开发者ID:siredblood,项目名称:tree-bumpkin-project,代码行数:7,代码来源:gui_item.cpp

示例6: Intersects

void Space::Intersects( ItemPtr item )
{
    switch( item->Behavior() ) {
        case Nothing:
            L_("I'm a master of nothing!\n");
            break;
        case AddJunk:
            JunkAdded( 1 );
            break;
        case Hurts:
            satellite.ChangeLife( -TWEAKS->GetNum( "asteroid_damage" ) );
            hit_snd.Play();
            break;
        case Heal:
            satellite.ChangeLife( TWEAKS->GetNum( "asteroid_damage" ) );
            heal_snd.Play();
            break;
        case AddCovet:
            coveted_snd.Play();
            satellite.ChangeCoveted( 1 );
            break;
        default: break;
    }

    item->Kill();
}
开发者ID:treeman,项目名称:Sat-E,代码行数:26,代码来源:Space.cpp

示例7: getToolbarsItem

/*static*/
int Toolbar::getToolbarsCount( const std::string appTbsSection )
{
	ItemPtr appTbsItem = getToolbarsItem( appTbsSection );
	if ( !appTbsItem )
		return 0;

	return appTbsItem->num();
}
开发者ID:siredblood,项目名称:tree-bumpkin-project,代码行数:9,代码来源:gui_toolbar.cpp

示例8: getParent

void
Item::extractVariables( VariableSet &vs ) const
{
	ItemPtr i = getParent();
	if ( i )
		i->extractVariables( vs );
	for ( auto x = myVariables.begin(); x != myVariables.end(); ++x )
		vs.emplace( std::make_pair( x->first, x->second ) );
}
开发者ID:iangodin,项目名称:constructor,代码行数:9,代码来源:Item.cpp

示例9: updateToggle

void Menu::updateToggle( HMENU hmenu, int& index, ItemPtr item, const MENUITEMINFO& info )
{
    if( !info.dwTypeData || buildMenuText( item ) != (LPCTSTR)info.dwTypeData )
        ModifyMenu( hmenu, index, MF_BYPOSITION | MF_STRING, item->commandID(),
                    buildMenuText( item ).c_str() );
    if( item->num() != 2 )// exactly 2
        throw 1;
    EnableMenuItem( hmenu, index, MF_BYPOSITION | ( item->update() ? MF_ENABLED : MF_GRAYED ) );
    CheckMenuItem( hmenu, index, MF_BYPOSITION | ( ( *item )[ 0 ]->update() ? MF_UNCHECKED : MF_CHECKED ) );
}
开发者ID:siredblood,项目名称:tree-bumpkin-project,代码行数:10,代码来源:gui_menu.cpp

示例10:

bool operator<(const ItemPtr& itemptr1, const ItemPtr& itemptr2)
{
	if (itemptr1.getPtr()->getTitle() < itemptr2.getPtr()->getTitle()) 
	{
		return true;
	} else 
	{
		return false;
	}
}
开发者ID:zackmcginnis,项目名称:Media-Database-Project,代码行数:10,代码来源:Item.cpp

示例11: internalGetItem

ItemPtr ProtocolGame::internalGetItem(InputMessage& msg, int id)
{
    if(id == 0)
        id = msg.getU16();

    ItemPtr item = Item::create(id);
    if(item->isStackable() || item->isFluidContainer() || item->isFluid())
        item->setData(msg.getU8());

    return item;
}
开发者ID:AndreFaramir,项目名称:otclient,代码行数:11,代码来源:protocolgameparse.cpp

示例12: useWith

void Game::useWith(const ItemPtr& item, const ThingPtr& toThing)
{
    if(!canPerformGameAction() || !item || !toThing)
        return;

    Position pos = item->getPosition();
    if(!pos.isValid()) // virtual item
        pos = Position(0xFFFF, 0, 0); // means that is a item in inventory

    m_protocolGame->sendUseItemWith(pos, item->getId(), item->getStackPos(), toThing->getPosition(), toThing->getId(), toThing->getStackPos());
}
开发者ID:ReyAleman,项目名称:otclient,代码行数:11,代码来源:game.cpp

示例13: shortcutPressed

		virtual void shortcutPressed( ItemPtr item )
		{
			if( item->update() )
			{
				for( unsigned int i = 0; i < item->num(); ++i )
					if( ( *item )[ i ]->update() )
					{
						( *item )[ ( i + 1 ) % item->num() ]->act();
						break;
					}
			}
		}
开发者ID:siredblood,项目名称:tree-bumpkin-project,代码行数:12,代码来源:gui_item.cpp

示例14: act

		virtual bool act( ItemPtr item )
		{
			bool enabled = false;
			for( unsigned int i = 0; i < item->parentNum(); ++i )
			{
				Item* parent = item->parent( i );
				enabled = enabled || parent->update();
			}
			if( enabled && !item->action().empty() )
				return Manager::instance().functors().act( item->action(), item );
			return false;
		}
开发者ID:siredblood,项目名称:tree-bumpkin-project,代码行数:12,代码来源:gui_item.cpp

示例15: _SetColor

IvObjectDragger::~IvObjectDragger()
{
    _SetColor(_normalColor);

    _transformBox->removeMotionCallback(_MotionHandler, this);
    if( _draggerRoot != NULL ) {
        ItemPtr selectedItem = GetSelectedItem();
        if( !!selectedItem ) {
            selectedItem->GetIvRoot()->removeChild(_draggerRoot);
        }
    }
}
开发者ID:AbuShaqra,项目名称:openrave,代码行数:12,代码来源:ivselector.cpp


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