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


C++ TLeafList::begin方法代码示例

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


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

示例1: PreviousCamera

void RenderServer::PreviousCamera()
{
    TLeafList cameras;
    mActiveScene->GetChildrenOfClass("Camera", cameras, true);
    for (TLeafList::iterator iter = cameras.begin(); iter != cameras.end(); ++iter)
        if (*iter == mCamera)
        {
            mCamera = iter != cameras.begin() ? static_pointer_cast<Camera>(*(--iter)) : static_pointer_cast<Camera>(cameras.back());
            break;
        }
}
开发者ID:MadMaxPavlo,项目名称:SimSpark-SPL,代码行数:11,代码来源:renderserver.cpp

示例2: OnCollision

void Collider::OnCollision (boost::shared_ptr<Collider> collidee,
                            GenericContact& contact, ECollisionType type)
{    
    TLeafList handlers;
    ListChildrenSupportingClass<CollisionHandler>(handlers);

    for (
         TLeafList::iterator iter = handlers.begin();
         iter != handlers.end();
         ++iter
         )
        {
            boost::shared_ptr<CollisionHandler> handler =
                static_pointer_cast<CollisionHandler>(*iter);

            if (
                (type == CT_SYMMETRIC) &&
                (! handler->IsSymmetricHandler())
                )
                {
                    continue;
                }

            handler->HandleCollision(collidee, contact);
        }
}
开发者ID:MadMaxPavlo,项目名称:SimSpark-SPL,代码行数:26,代码来源:collider.cpp

示例3: DestroyWorldObjects

void World::DestroyWorldObjects()
{
  boost::shared_ptr<Scene> scene = GetScene();

  if (scene.get() == 0)
  {
    return;
  }

  TLeafList objects;
  const bool recursive = true;
  scene->ListChildrenSupportingClass<PhysicsObject>(objects, recursive);

  boost::shared_ptr<World> self = static_pointer_cast<World>(GetSelf().lock());

  for (TLeafList::iterator iter = objects.begin(); iter != objects.end(); ++iter)
  {
    boost::shared_ptr<PhysicsObject> object = static_pointer_cast<PhysicsObject>(*iter);
    if (object == self)
    {
      continue;
    }

    // destroy everthing in the world
    // assume there is only ONE world
    object->DestroyPhysicsObject();
  }
}
开发者ID:MadMaxPavlo,项目名称:SimSpark-SPL,代码行数:28,代码来源:world.cpp

示例4:

void
SexpMonitor::AddFlags(shared_ptr<Scene> activeScene, std::ostringstream& ss)
{
    // the flags don't change, so we need to send them only once
    if (mSentFlags)
    {
        return;
    }
    mSentFlags = true;

    TLeafList nodes;
    activeScene->ListChildrenSupportingClass<FieldFlag>(nodes, true);

    for (TLeafList::iterator i = nodes.begin(); i != nodes.end(); ++i)
    {
        shared_ptr<FieldFlag> flag = shared_static_cast<FieldFlag>(*i);
        const salt::Vector3f& pos = flag->GetWorldTransform().Pos();
        shared_ptr<ObjectState> state = shared_dynamic_cast<ObjectState>
            (flag->GetChildOfClass("ObjectState"));

        if (state.get() == 0) continue;

        ss << "(" << state->GetPerceptName()[0] << " ";
        // id
        ss << "(id " << state->GetID() << ")";
        // pos
        ss << "(pos " << pos[0] << " " << pos[1] << " " << pos[2] << ")";

        ss << ")";
    }
}
开发者ID:GiorgosMethe,项目名称:SimSpark-SPL,代码行数:31,代码来源:sexpmonitor.cpp

示例5: AgentDisappear

void
GameControlServer::Update(float deltaTime)
{
    // remove disappeared agent
    for(
        vector<int>::iterator iter = mDisappearedAgent.begin();
        iter != mDisappearedAgent.end();
        ++iter
        )
    {
        AgentDisappear(*iter);
    }

    mDisappearedAgent.clear();

    // build list of ControlAspects, NOT searching recursively
    TLeafList control;
    ListChildrenSupportingClass<ControlAspect>(control,false);

    // update all ControlAspects found
    for (
        TLeafList::iterator iter = control.begin();
        iter != control.end();
        ++iter
        )
    {
        boost::shared_ptr<ControlAspect> aspect =
            shared_static_cast<ControlAspect>(*iter);

        aspect->Update(deltaTime);
    }
}
开发者ID:GiorgosMethe,项目名称:SimSpark-SPL,代码行数:32,代码来源:gamecontrolserver.cpp

示例6: GetLog

void
VisionPerceptor::SetupVisibleObjects(TObjectList& visibleObjects)
{
    TLeafList objectList;
    mActiveScene->ListChildrenSupportingClass<ObjectState>(objectList, true);

    salt::Vector3f myPos = mTransformParent->GetWorldTransform().Pos();

    for (TLeafList::iterator i = objectList.begin();
         i != objectList.end(); ++i)
        {
            ObjectData od;
            od.mObj = static_pointer_cast<ObjectState>(*i);

            if (od.mObj.get() == 0)
                {
                    GetLog()->Error() << "Error: (VisionPerceptor) skipped: "
                                      << (*i)->GetName() << "\n";
                    continue; // this should never happen
                }

            boost::shared_ptr<Transform> j = od.mObj->GetTransformParent();

            if (j.get() == 0)
                {
                    continue; // this should never happen
                }

            od.mRelPos = j->GetWorldTransform().Pos() - myPos;
            od.mDist   = od.mRelPos.Length();

            visibleObjects.push_back(od);
        }
}
开发者ID:MadMaxPavlo,项目名称:SimSpark-SPL,代码行数:34,代码来源:visionperceptor.cpp

示例7: GetLog

void
RestrictedVisionPerceptor::SetupVisibleNodes(TNodeObjectsMap& visibleNodes)
{
    TLeafList objectList;
    //mActiveScene->ListChildrenSupportingClass<ObjectState>(objectList, true);
    mActiveScene->GetChildrenOfClass("ObjectState", objectList, true);

    salt::Vector3f myPos = mTransformParent->GetWorldTransform().Pos();

    for (TLeafList::iterator i = objectList.begin();
        i != objectList.end(); ++i)
    {
        ObjectData od;

        od.mObj = static_pointer_cast<ObjectState>(*i);

        boost::shared_ptr<BaseNode> node = dynamic_pointer_cast<BaseNode>(mActiveScene);
        boost::shared_ptr<AgentAspect> agent_aspect =
                od.mObj->FindParentSupportingClass<AgentAspect>().lock();
        if (agent_aspect != 0)
        {
            boost::shared_ptr<AgentAspect> aspect =
                agent_aspect->FindParentSupportingClass<AgentAspect>().lock();
            if (aspect != 0)
            {
                agent_aspect = aspect;
            }

            // if (agent_aspect == mAgentAspect) // exclude node of self
            // {
            //     continue;
            // }

            // GetLog()->Normal()
            //    << "skipping agentAspect " << agent_aspect->GetFullPath() << std::endl;
            node = dynamic_pointer_cast<BaseNode>(agent_aspect);
        }

        if (od.mObj.get() == 0)
        {
            GetLog()->Error() << "Error: (RestrictedVisionPerceptor) skipped: "
                << (*i)->GetName() << "\n";
            continue; // this should never happen
        }

        boost::shared_ptr<Transform> j = od.mObj->GetTransformParent();

        if (j.get() == 0)
        {
            continue; // this should never happen
        }

        od.mRelPos = j->GetWorldTransform().Pos() - myPos;
        od.mDist   = od.mRelPos.Length();

        visibleNodes[node].push_back(od);
	}
}
开发者ID:MadMaxPavlo,项目名称:SimSpark-SPL,代码行数:58,代码来源:restrictedvisionperceptor.cpp

示例8: NextCamera

void RenderServer::NextCamera()
{
    TLeafList cameras;
    mActiveScene->GetChildrenOfClass("Camera", cameras, true);
    for (TLeafList::iterator iter = cameras.begin(); iter != cameras.end(); ++iter)
        if (*iter == mCamera)
        {
            ++iter;
            mCamera = iter != cameras.end() ? shared_static_cast<Camera>(*iter) : shared_static_cast<Camera>(cameras.front());
            break;
        }
}
开发者ID:GiorgosMethe,项目名称:SimSpark-SPL,代码行数:12,代码来源:renderserver.cpp

示例9:

void
MaterialServer::ExportMaterial(boost::shared_ptr<Material> material)
{
    TLeafList exporters;
    ListChildrenSupportingClass<MaterialExporter>(exporters);

    for (TLeafList::const_iterator bi = exporters.begin(); bi != exporters.end(); ++bi)
    {
        boost::shared_ptr<MaterialExporter> mb = static_pointer_cast<MaterialExporter>(*bi);
        mb->RegisterMaterial(material);
    }
}
开发者ID:MadMaxPavlo,项目名称:SimSpark-SPL,代码行数:12,代码来源:materialserver.cpp

示例10: GetLog

void
MaterialServer::ExportAllMaterial()
{
    GetLog()->Debug() << "(MaterialServer) ExportAllMaterial\n";
    TLeafList materials;
    ListChildrenSupportingClass<Material>(materials);

    for (TLeafList::const_iterator mi = materials.begin(); mi != materials.end(); ++mi)
    {
        boost::shared_ptr<Material> m = static_pointer_cast<Material>(*mi);
        ExportMaterial(m);
    }
    GetLog()->Debug() << "(MaterialServer) ExportAllMaterial done\n";
}
开发者ID:MadMaxPavlo,项目名称:SimSpark-SPL,代码行数:14,代码来源:materialserver.cpp

示例11: ParseMonitorMessage

void SparkMonitor::ParseMonitorMessage(const std::string& data)
{
    // pass the received string on to all installed CommandParsers
    TLeafList items;
    ListChildrenSupportingClass<MonitorCmdParser>(items);

    for (
         TLeafList::iterator iter = items.begin();
         iter != items.end();
         ++iter
         )
        {
            static_pointer_cast<MonitorCmdParser>(*iter)
                ->ParseMonitorMessage(data);
        }
}
开发者ID:MadMaxPavlo,项目名称:SimSpark-SPL,代码行数:16,代码来源:sparkmonitor.cpp

示例12: DescribeScene

void SparkMonitor::DescribeScene(stringstream& ss, boost::shared_ptr<BaseNode> node)
{
    bool closeParen = DescribeNode(ss, node);

    TLeafList baseNodes = node->GetBaseNodeChildren();
    for (TLeafList::iterator i = baseNodes.begin(); i!= baseNodes.end(); ++i)
        {
            boost::shared_ptr<BaseNode> baseNode = dynamic_pointer_cast<BaseNode>(*i);
            DescribeScene(ss,baseNode);
        }
        
    if (closeParen)
        {
            ss << ")";
        }
}
开发者ID:MadMaxPavlo,项目名称:SimSpark-SPL,代码行数:16,代码来源:sparkmonitor.cpp

示例13:

void
RenderControl::RenderCustom()
{
    // get list of registered CustomMonitor objects
    TLeafList customList;
    ListChildrenSupportingClass<CustomRender>(customList);

    for (
         TLeafList::iterator iter = customList.begin();
         iter != customList.end();
         ++iter
         )
    {
        shared_static_cast<CustomRender>((*iter))->Render();
    }
}
开发者ID:GiorgosMethe,项目名称:SimSpark-SPL,代码行数:16,代码来源:rendercontrol.cpp

示例14: ParseCustomPredicates

void SparkMonitorLogFileServer::ParseCustomPredicates(sexp_t* sexp)
{
    // ( (name param1 param2 ...) (name param1 param2 ...) ... )
    if (sexp == 0)
        {
            return;
        }

    // get list of registered CustomMonitor objects
    TLeafList customList;
    ListChildrenSupportingClass<CustomMonitor>(customList);
    customList.push_back(GetCore()->Get("/sys/server/simulation/SparkMonitorClient/SoccerMonitor"));

    if (customList.empty())
        {
            return;
        }

    // parse predicates
    PredicateList pList;

    sexp = sexp->list;
    while (sexp != 0)
        {
            if (sexp->ty == SEXP_LIST)
                {
                    sexp_t* sPred = sexp->list;
                    ParseCustomPredicates(sPred,pList);
                }

            sexp = sexp->next;
        }

    // pass predicates to all registered CustomMonitor objects
    for (
         TLeafList::iterator iter = customList.begin();
         iter != customList.end();
         ++iter
         )
        {
            static_pointer_cast<CustomMonitor>((*iter))
                ->ParseCustomPredicates(pList);
        }
}
开发者ID:MadMaxPavlo,项目名称:SimSpark-SPL,代码行数:44,代码来源:sparkmonitorlogfileserver.cpp

示例15: ParseCustomPredicates

void SparkMonitorClient::ParseCustomPredicates(sexp_t* sexp)
{
    // ( (name param1 param2 ...) (name param1 param2 ...) ... )
    if (sexp == 0)
        {
            return;
        }

    // get list of registered CustomMonitor objects
    TLeafList customList;
    ListChildrenSupportingClass<CustomMonitor>(customList);

    if (customList.empty())
        {
            return;
        }

    // parse predicates
    PredicateList pList;

    sexp = sexp->list;
    while (sexp != 0)
        {
            if (sexp->ty == SEXP_LIST)
                {
                    sexp_t* sPred = sexp->list;
                    ParseCustomPredicates(sPred,pList);
                }

            sexp = sexp->next;
        }

    // pass predicates to all registered CustomMonitor objects
    for (
         TLeafList::iterator iter = customList.begin();
         iter != customList.end();
         ++iter
         )
        {
            shared_static_cast<CustomMonitor>((*iter))
                ->ParseCustomPredicates(pList);
        }
}
开发者ID:GiorgosMethe,项目名称:SimSpark-SPL,代码行数:43,代码来源:sparkmonitorclient.cpp


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