本文整理汇总了C++中ActorList::size方法的典型用法代码示例。如果您正苦于以下问题:C++ ActorList::size方法的具体用法?C++ ActorList::size怎么用?C++ ActorList::size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ActorList
的用法示例。
在下文中一共展示了ActorList::size方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setValue
// ----------------------------------------------------------------------------
//
bool ActorSelectField::setValue( LPCSTR value ) {
CString key( value );
ActorList actors;
int curPos = 0;
while ( true ) {
CString resToken = key.Tokenize( _T(" ,"), curPos );
if ( resToken.IsEmpty() )
break;
resToken.MakeUpper();
ActorSelectField::EntryMap::iterator it = m_entries.find( resToken );
if ( it == m_entries.end() )
throw FieldException( "Invalid fixture number %s", (LPCSTR)resToken );
actors.push_back( (*it).second.m_actor );
}
if ( actors.size() == 0 )
throw FieldException( "Select at least one fixture" );
if ( actors.size() > 1 && !m_allow_multiple )
throw FieldException( "Select a single fixture" );
m_selected_actors = actors;
return InputField::setValue( value );
}
示例2: loadInLayer
void LayersManager::loadInLayer(VirtualDataSceneBase::TransformableActor* layer, StringList loadExclusionList, StringList unLoadExclusionList)
{
if (_loadInLayer == layer)
return;
unLoadInLayer(unLoadExclusionList);
dynamic_cast<SingleLayerActor*>(layer)->mandatoryLoadNodeAsynchronous(loadExclusionList);
_loadInLayer = layer;
SystemViewContext* currentcontext = getSystemViewContext(this);
if (_loadInLayer->isInstanceOf(CLASS_EARTHLAYER))
{
currentcontext->_mainViewer->getCamera()->setClearColor(osg::Vec4(0.0f, 0.0f, 0.0f, 1.0f));
currentcontext->_mainViewer->getCamera()->setNearFarRatio(1e-9);
_root->removeChild(_sceneSky);
}
else
{
currentcontext->_mainViewer->getCamera()->setClearColor(osg::Vec4(0.004f, 0.0902f, 0.1804f, 1.0f));
currentcontext->_mainViewer->getCamera()->setNearFarRatio(1e-5);
if (!_root->containsNode(_sceneSky))
_root->addChild(_sceneSky);
//reset
dynamic_cast<SingleLayerActor*>(_loadInLayer.get())->resetZeroTransform();
ActorList childLayerList;
dynamic_cast<SingleLayerActor*>(_loadInLayer.get())->getAllChildren(childLayerList, CLASS_LAYER, true, false);
for (unsigned int i = 0; i < childLayerList.size(); ++i)
{
dynamic_cast<SingleLayerActor*>(childLayerList.at(i))->resetDefaultTransform();
}
}
osg::ref_ptr<UserEventData> userData = new UserEventData();
userData->_eventObject = _loadInLayer.get();
userData->_eventType = UserEventData::LAYERCHANGED;
currentcontext->_mainViewer->getEventQueue()->userEvent(userData.get());
}
示例3: deleteLayer
void LayersManager::deleteLayer(VirtualDataSceneBase::ActorBase* layerActor, bool deleteChild)
{
osg::Node* layerNode = dynamic_cast<osg::Node*>(layerActor);
if (layerActor->isInstanceOf(CLASS_ENTERPRISELAYER))
{
_root->removeChild(layerNode);
_enterpriseList.erase(std::find(_enterpriseList.begin(), _enterpriseList.end(), layerNode));
}
else
{
VirtualDataSceneKernel::SingleLayerActor* ppLayer = dynamic_cast<VirtualDataSceneKernel::SingleLayerActor*>(layerNode->getParent(0));
if (!deleteChild)
{
ActorList returnValue;
VirtualDataSceneKernel::DeviceGroup* parent = dynamic_cast<VirtualDataSceneKernel::DeviceGroup*>(layerActor);
parent->getAllChildren(returnValue, CLASS_DEVICE);
osg::ref_ptr<osg::Node> everyObj;
for (unsigned int i = 0; i < returnValue.size(); ++i)
{
everyObj = dynamic_cast<osg::Node*>(returnValue.at(i));
parent->removeChild(everyObj);
ppLayer->addChild(everyObj);
}
}
dynamic_cast<VirtualDataSceneKernel::SingleLayerActor*>(layerActor)->mandatoryUnLoadNode();
ppLayer->removeChild(dynamic_cast<osg::Node*>(layerActor));
}
}
示例4: Update
bool GCAddItem::Update(const float ticks)
{
ActorList partyList = ActorMgr::Instance().GetPartyList();
const std::string leaderName = ActorMgr::Instance().GetActivePlayer().GetStatBlock().GetName();
Item item = ItemDB::Instance().GetItem(m_itemName);
//@TODO - better than before, not hard coded to chests, but can I do better?
// for instance, still need a way to put the item back in the chest if there is no
// room for anyone in the party to hold the item
std::stringstream temp;
temp << leaderName << " " << m_searchText << "^";
temp << leaderName << " found\n" << item.GetName().c_str() << ".^";
for (unsigned int i = 0; i < partyList.size(); ++i)
{
if (partyList[i]->GetStatBlock().AddItem(m_itemName))
{
if (i == 0)
{
temp << leaderName << " recieved\n" << m_itemName.c_str() << ".";
}
else
{
temp << leaderName << " passed the\n" << m_itemName.c_str()
<< " to " << partyList[i]->GetStatBlock().GetName() << ".";
}
break;
}
if (i >= (partyList.size()-1))
{
temp << "But, everyone's hands are full.";
}
}
WindowMgr::Instance().AddDialogueGrp(temp.str());
/* Possible outcomes:
DialogueWindow "BOWIE opened the chest.^BOWIE found\nITEM.^BOWIE recieved\nITEM."
DialogueWindow "BOWIE opened the chest.^BOWIE found\nITEM.^BOWIE passed the\nITEM to OTHERMEMBER."
DialogueWindow "BOWIE opened the chest.^BOWIE found\nITEM.^But, everyone's hands are full."
*/
return true;
}
示例5: getViewPointList
void LayersManager::getViewPointList(const std::string& targetID, ActorRefPtrList& viewPointList, int viewPointType)
{
ActorList childLayerList;
dynamic_cast<SingleLayerActor*>(_loadInLayer.get())->getAllChildren(childLayerList, CLASS_VIEWPOINTDEFINE, false, false);
for (unsigned int i = 0; i < childLayerList.size(); ++i)
{
std::string type = childLayerList.at(i)->getProperty(ACTOR_PROPERTY_VIEWPOINTTYPE)->toString();
std::stringstream ss;
ss << viewPointType;
if (viewPointType < 0 || type == ss.str())
viewPointList.push_back(dynamic_cast<VirtualDataSceneBase::TransformableActor*>(childLayerList.at(i)));
}
}
示例6: InputField
// ----------------------------------------------------------------------------
//
ActorSelectField::ActorSelectField( LPCSTR field_label, Venue* venue, bool include_groups ) :
InputField( field_label, "" ),
m_venue( venue ),
m_allow_multiple( true )
{
FixturePtrArray fixtures = venue->getFixtures();
ActorList actors;
for ( FixturePtrArray::iterator it=fixtures.begin(); it != fixtures.end(); ++it )
actors.push_back( SceneActor( (*it) ) );
if ( include_groups ) {
FixtureGroupPtrArray fixture_groups = m_venue->getFixtureGroups();
for ( FixtureGroupPtrArray:: iterator it=fixture_groups.begin(); it != fixture_groups.end(); ++it )
actors.push_back( SceneActor( venue, (*it) ) );
}
ActorPtrArray actor_ptrs;
for ( size_t i=0; i < actors.size(); i++)
actor_ptrs.push_back( &actors[i] );
init( actor_ptrs, UIDArray() );
}