CARLA
Toggle main menu visibility
Loading...
Searching...
No Matches
Unreal
CarlaUnreal
Plugins
Carla
Source
Carla
MapGen
GraphParser.h
Go to the documentation of this file.
1
// Copyright (c) 2026 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 "
CityAreaDescription.h
"
10
#include "
GraphTypes.h
"
11
#include "
RoadSegmentDescription.h
"
12
13
#include <vector>
14
15
namespace
MapGen
{
16
17
class
DoublyConnectedEdgeList
;
18
19
class
GraphParser
:
private
NonCopyable
20
{
21
public
:
22
23
explicit
GraphParser
(
DoublyConnectedEdgeList
&Dcel);
24
25
bool
HasRoadSegments
()
const
{
26
return
!
RoadSegments
.empty();
27
}
28
29
bool
HasCityAreas
()
const
{
30
return
!
CityAreas
.empty();
31
}
32
33
size_t
RoadSegmentCount
()
const
{
34
return
RoadSegments
.size();
35
}
36
37
size_t
CityAreaCount
()
const
{
38
return
CityAreas
.size();
39
}
40
41
const
RoadSegmentDescription
&
GetRoadSegmentAt
(
size_t
i)
const
{
42
return
*
RoadSegments
[i];
43
}
44
45
const
CityAreaDescription
&
GetCityAreaAt
(
size_t
i)
const
{
46
return
*
CityAreas
[i];
47
}
48
49
TUniquePtr<RoadSegmentDescription>
PopRoadSegment
() {
50
TUniquePtr<RoadSegmentDescription> ptr{
RoadSegments
.back().Release()};
51
RoadSegments
.pop_back();
52
return
ptr;
53
}
54
55
TUniquePtr<CityAreaDescription>
PopCityArea
() {
56
TUniquePtr<CityAreaDescription> ptr{
CityAreas
.back().Release()};
57
CityAreas
.pop_back();
58
return
ptr;
59
}
60
61
private
:
62
63
using
RoadSegmentList
= std::vector<TUniquePtr<RoadSegmentDescription>>;
64
65
using
CityAreaList
= std::vector<TUniquePtr<CityAreaDescription>>;
66
67
RoadSegmentList
RoadSegments
;
68
69
CityAreaList
CityAreas
;
70
};
71
72
}
// namespace MapGen
CityAreaDescription.h
GraphTypes.h
RoadSegmentDescription.h
MapGen::CityAreaDescription
Definition
CityAreaDescription.h:16
MapGen::DoublyConnectedEdgeList
Simple doubly-connected edge list structure.
Definition
DoublyConnectedEdgeList.h:21
MapGen::GraphParser::RoadSegmentList
std::vector< TUniquePtr< RoadSegmentDescription > > RoadSegmentList
Definition
GraphParser.h:63
MapGen::GraphParser::RoadSegments
RoadSegmentList RoadSegments
Definition
GraphParser.h:67
MapGen::GraphParser::GraphParser
GraphParser(DoublyConnectedEdgeList &Dcel)
Definition
GraphParser.cpp:141
MapGen::GraphParser::PopRoadSegment
TUniquePtr< RoadSegmentDescription > PopRoadSegment()
Definition
GraphParser.h:49
MapGen::GraphParser::GetRoadSegmentAt
const RoadSegmentDescription & GetRoadSegmentAt(size_t i) const
Definition
GraphParser.h:41
MapGen::GraphParser::HasCityAreas
bool HasCityAreas() const
Definition
GraphParser.h:29
MapGen::GraphParser::HasRoadSegments
bool HasRoadSegments() const
Definition
GraphParser.h:25
MapGen::GraphParser::CityAreaList
std::vector< TUniquePtr< CityAreaDescription > > CityAreaList
Definition
GraphParser.h:65
MapGen::GraphParser::CityAreas
CityAreaList CityAreas
Definition
GraphParser.h:69
MapGen::GraphParser::RoadSegmentCount
size_t RoadSegmentCount() const
Definition
GraphParser.h:33
MapGen::GraphParser::GetCityAreaAt
const CityAreaDescription & GetCityAreaAt(size_t i) const
Definition
GraphParser.h:45
MapGen::GraphParser::PopCityArea
TUniquePtr< CityAreaDescription > PopCityArea()
Definition
GraphParser.h:55
MapGen::GraphParser::CityAreaCount
size_t CityAreaCount() const
Definition
GraphParser.h:37
MapGen::RoadSegmentDescription
Definition
RoadSegmentDescription.h:17
NonCopyable::NonCopyable
NonCopyable()=default
MapGen
Definition
CityAreaDescription.h:13
Generated by
1.18.0