Apollo  6.0
Open source self driving car software
scene.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Copyright 2018 The Apollo Authors. All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *****************************************************************************/
16 
17 #pragma once
18 
19 #include <memory>
20 #include <vector>
21 
24 
25 namespace apollo {
26 namespace perception {
27 namespace fusion {
28 
29 class Scene {
30  public:
31  Scene();
32  ~Scene();
33 
34  inline std::vector<TrackPtr>& GetForegroundTracks() {
35  return foreground_tracks_;
36  }
37 
38  inline const std::vector<TrackPtr>& GetForegroundTracks() const {
39  return foreground_tracks_;
40  }
41 
42  inline std::vector<TrackPtr>& GetBackgroundTracks() {
43  return background_tracks_;
44  }
45 
46  inline const std::vector<TrackPtr>& GetBackgroundTracks() const {
47  return background_tracks_;
48  }
49 
50  void AddForegroundTrack(TrackPtr track);
51  void AddBackgroundTrack(TrackPtr track);
52 
53  protected:
54  std::vector<TrackPtr> foreground_tracks_;
55  std::vector<TrackPtr> background_tracks_;
56 };
57 
58 typedef std::shared_ptr<Scene> ScenePtr;
59 typedef std::shared_ptr<const Scene> SceneConstPtr;
60 
61 } // namespace fusion
62 } // namespace perception
63 } // namespace apollo
std::shared_ptr< const Scene > SceneConstPtr
Definition: scene.h:59
std::vector< TrackPtr > & GetBackgroundTracks()
Definition: scene.h:42
Definition: scene.h:29
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
std::vector< TrackPtr > background_tracks_
Definition: scene.h:55
std::vector< TrackPtr > foreground_tracks_
Definition: scene.h:54
std::shared_ptr< Track > TrackPtr
Definition: track.h:160
std::vector< TrackPtr > & GetForegroundTracks()
Definition: scene.h:34
void AddBackgroundTrack(TrackPtr track)
const std::vector< TrackPtr > & GetBackgroundTracks() const
Definition: scene.h:46
void AddForegroundTrack(TrackPtr track)
const std::vector< TrackPtr > & GetForegroundTracks() const
Definition: scene.h:38
std::shared_ptr< Scene > ScenePtr
Definition: scene.h:58