CARLA
 
载入中...
搜索中...
未找到
CityAreaDescription.h
浏览该文件的文档.
1// Copyright (c) 2017 Computer Vision Center (CVC) at the Universitat Autonoma
2// de Barcelona (UAB).
3//
4// This work is licensed under the terms of the MIT license.
5// For a copy, see <https://opensource.org/licenses/MIT>.
6
7#pragma once
8
9#include "GraphTypes.h"
10
11#include <vector>
12
13// 命名空间 MapGen
14namespace MapGen {
15
16// 类 CityAreaDescription,不可复制
17 class CARLA_API CityAreaDescription : private NonCopyable
18 {
19 public:
20
21// 显式构造函数,接受一个 GraphFace 类型的参数
22 explicit CityAreaDescription(const GraphFace &Face) : _face(&Face) {}
23
24 // 添加节点到节点容器
25 void Add(const GraphNode &Node) {
26 _nodes.emplace_back(&Node);
27 }
28
29// 获取面(GraphFace)
30 const GraphFace &GetFace() const {
31 return *_face;
32 }
33
34 // 获取指定索引的节点
35 const GraphNode &GetNodeAt(size_t i) const {
36 return *_nodes[i];
37 }
38
39// 获取节点数量
40 size_t NodeCount() const {
41 return _nodes.size();
42 }
43
44 private:
45
46 // 面(GraphFace)
48
49// 节点容器
50 std::vector<const GraphNode *> _nodes;
51 };
52
53} // namespace MapGen
const GraphNode & GetNodeAt(size_t i) const
std::vector< const GraphNode * > _nodes
CityAreaDescription(const GraphFace &Face)
void Add(const GraphNode &Node)
const GraphFace & GetFace() const