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


C++ TLeafList类代码示例

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


在下文中一共展示了TLeafList类的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:

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

示例3: 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

示例4: GetChildren

void Leaf::GetChildren(const std::string &name, TLeafList &baseList, bool /*recursive*/)
{
    if (name.compare("..") == 0)
    {
        baseList.push_back(GetParent().lock());
    }

    if (name.compare(".") == 0)
    {
        baseList.push_back(static_pointer_cast<Leaf>(GetSelf().lock()));
    }
}
开发者ID:MadMaxPavlo,项目名称:SimSpark-SPL,代码行数:12,代码来源:leaf.cpp

示例5: 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

示例6: DescribeNode

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

示例7:

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

示例8: 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

示例9: GetLog

void
RestrictedVisionPerceptor::SetupLines(TLineList& visibleLines)
{
  TLeafList lineList;
  mActiveScene->GetChildrenOfClass("Line", lineList, true);

  // determine position relative to the local reference frame
  const Matrix& mat = mTransformParent->GetWorldTransform();

  // get the transformation matrix describing the current orientation
  Vector3f myPos = mat.Pos();
  if (mAddNoise)
  {
    myPos -= mError;
  }


  for (TLeafList::iterator i = lineList.begin(); i != lineList.end(); ++i)
  {
    LineData ld;

    ld.mLine = static_pointer_cast<Line > (*i);

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

    boost::shared_ptr<Transform> j = ld.mLine->GetTransformParent();

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

    const salt::Matrix& t = j->GetWorldTransform();
    ld.mBeginPoint.mRelPos =   mat.InverseRotate( t * ld.mLine->BeginPoint() - myPos );
    ld.mEndPoint.mRelPos = mat.InverseRotate( t * ld.mLine->EndPoint() - myPos );

    visibleLines.push_back(ld);
  }
}
开发者ID:MadMaxPavlo,项目名称:SimSpark-SPL,代码行数:46,代码来源:restrictedvisionperceptor.cpp

示例10: while

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

示例11: while

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

示例12: GetScene

void Space::DestroySpaceObjects()
{
    boost::shared_ptr<Scene> scene = GetScene(); 

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

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

    bool globalSpace = IsGlobalSpace();
    shared_ptr<Space> self = shared_static_cast<Space>(GetSelf().lock());

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

            // destroy objects registered to this space; the top level
            // space object also destroy any other ODE object
            const long parentSpace = object->GetParentSpaceID();
            if (
                (
                 (globalSpace) &&
                 (parentSpace == 0)
                 ) ||
                (parentSpace == mSpaceID)
                )
                {
                    object->DestroyPhysicsObject();
                }
        }
}
开发者ID:GiorgosMethe,项目名称:SimSpark-SPL,代码行数:43,代码来源:space.cpp

示例13:

void
AgentAspect::UpdateEffectorMap()
{
    // build list of effectors, searching recursively
    TLeafList effectors;
    ListChildrenSupportingClass<Effector>(effectors,true);

    // build the effector map
    mEffectorMap.clear();

    for (
         TLeafList::iterator iter = effectors.begin();
         iter != effectors.end();
         ++iter
         )
        {
            boost::shared_ptr<Effector> effector = static_pointer_cast<Effector>(*iter);
            mEffectorMap[effector->GetPredicate()] = effector;
        }
}
开发者ID:MadMaxPavlo,项目名称:SimSpark-SPL,代码行数:20,代码来源:agentaspect.cpp

示例14: GetLog

void
GeometryServer::RegisterMesh(boost::shared_ptr<TriMesh> mesh)
{
    if (mesh.get() == 0)
    {
        GetLog()->Debug()
            << "(GeometryServer) RegisterMesh called with NULL mesh\n";
        return;
    }

    std::string name = mesh->GetName();
    if (name.empty())
    {
        GetLog()->Error()
            << "(GeometryServer) Cannot register a mesh without a name\n";
        return;
    }

    TMeshMap::const_iterator iter = mMeshMap.find(name);
    if (iter != mMeshMap.end())
    {
        GetLog()->Debug() << "(GeometryServer) replacing mesh " << name << "\n";
    }

    mMeshMap[name] = mesh;
    GetLog()->Debug() << "(GeometryServer) mesh " << name << " registered\n";

    TLeafList exporters;
    ListChildrenSupportingClass<MeshExporter>(exporters);

    for (TLeafList::const_iterator bi = exporters.begin(); bi != exporters.end(); ++bi)
    {
        GetLog()->Debug() << "(GeometryServer) additionally registered mesh "
                           << name << " via MeshExporter '" << (*bi)->GetName() << "'\n";
        boost::shared_ptr<MeshExporter> mb = static_pointer_cast<MeshExporter>(*bi);
        mb->RegisterMesh(mesh);
    }
}
开发者ID:unfabio,项目名称:furosimspark,代码行数:38,代码来源:geometryserver.cpp

示例15: predList

shared_ptr<PredicateList>
AgentAspect::QueryPerceptors()
{
    mPerceptorCycle++;
    // build list of perceptors, searching recursively
    TLeafList perceptors;
    ListChildrenSupportingClass<Perceptor>(perceptors,true);

    shared_ptr<PredicateList> predList(new PredicateList());

    // query the perceptors for new data
    for (
         TLeafList::iterator iter = perceptors.begin();
         iter != perceptors.end();
         ++iter
         )
        {
            shared_ptr<Perceptor> pct = shared_static_cast<Perceptor>(*iter);
            if ( mPerceptorCycle % pct->GetInterval() == 0 )
                pct->Percept(predList);
        }

    return predList;
}
开发者ID:GiorgosMethe,项目名称:SimSpark-SPL,代码行数:24,代码来源:agentaspect.cpp


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