OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 #ifndef WEBRTC_TOOLS_EVENT_LOG_VISUALIZER_PLOT_BASE_H_ | 10 #ifndef WEBRTC_TOOLS_EVENT_LOG_VISUALIZER_PLOT_BASE_H_ |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 std::string label, | 102 std::string label, |
103 float bottom_margin = 0, | 103 float bottom_margin = 0, |
104 float top_margin = 0); | 104 float top_margin = 0); |
105 | 105 |
106 // Sets the title of the plot. | 106 // Sets the title of the plot. |
107 void SetTitle(std::string title); | 107 void SetTitle(std::string title); |
108 | 108 |
109 // Add a new TimeSeries to the plot. | 109 // Add a new TimeSeries to the plot. |
110 void AppendTimeSeries(TimeSeries&& time_series); | 110 void AppendTimeSeries(TimeSeries&& time_series); |
111 | 111 |
| 112 // Add a new TimeSeries to the plot if the series contains contains data. |
| 113 // Otherwise, the call has no effect and the timeseries is destroyed. |
| 114 void AppendTimeSeriesIfNotEmpty(TimeSeries&& time_series); |
| 115 |
112 protected: | 116 protected: |
113 float xaxis_min_; | 117 float xaxis_min_; |
114 float xaxis_max_; | 118 float xaxis_max_; |
115 std::string xaxis_label_; | 119 std::string xaxis_label_; |
116 float yaxis_min_; | 120 float yaxis_min_; |
117 float yaxis_max_; | 121 float yaxis_max_; |
118 std::string yaxis_label_; | 122 std::string yaxis_label_; |
119 std::string title_; | 123 std::string title_; |
120 std::vector<TimeSeries> series_list_; | 124 std::vector<TimeSeries> series_list_; |
121 }; | 125 }; |
122 | 126 |
123 class PlotCollection { | 127 class PlotCollection { |
124 public: | 128 public: |
125 virtual ~PlotCollection() {} | 129 virtual ~PlotCollection() {} |
126 virtual void Draw() = 0; | 130 virtual void Draw() = 0; |
127 virtual Plot* AppendNewPlot() = 0; | 131 virtual Plot* AppendNewPlot() = 0; |
128 | 132 |
129 protected: | 133 protected: |
130 std::vector<std::unique_ptr<Plot> > plots_; | 134 std::vector<std::unique_ptr<Plot> > plots_; |
131 }; | 135 }; |
132 | 136 |
133 } // namespace plotting | 137 } // namespace plotting |
134 } // namespace webrtc | 138 } // namespace webrtc |
135 | 139 |
136 #endif // WEBRTC_TOOLS_EVENT_LOG_VISUALIZER_PLOT_BASE_H_ | 140 #endif // WEBRTC_TOOLS_EVENT_LOG_VISUALIZER_PLOT_BASE_H_ |
OLD | NEW |