Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GUIDottedGeometry.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-2023 German Aerospace Center (DLR) and others.
4// This program and the accompanying materials are made available under the
5// terms of the Eclipse Public License 2.0 which is available at
6// https://www.eclipse.org/legal/epl-2.0/
7// This Source Code may also be made available under the following Secondary
8// Licenses when the conditions for such availability set forth in the Eclipse
9// Public License 2.0 are satisfied: GNU General Public License, version 2
10// or later which is available at
11// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13/****************************************************************************/
18// File for dotted geometry classes and functions
19/****************************************************************************/
20#pragma once
21#include <config.h>
22
25
26// ===========================================================================
27// class definitions
28// ===========================================================================
29
31
32public:
34 enum class DottedContourType {
35 INSPECT,
37 REMOVE,
38 SELECT,
39 FRONT,
41 MOVE,
42 GREEN,
43 MAGENTA,
44 ORANGE,
45 YELLOW,
46 FROMTAZ,
47 TOTAZ,
49 };
50
53
54 public:
57
60
62 void changeColor();
63
65 void reset();
66
67 private:
70
73
76 };
77
79 struct Segment {
81 Segment();
82
84 Segment(PositionVector newShape);
85
88
90 std::vector<double> rotations;
91
93 std::vector<double> lengths;
94
96 double offset;
97 };
98
101
103 GUIDottedGeometry(const GUIVisualizationSettings& s, PositionVector shape, const bool closeShape);
104
107 const GUIDottedGeometry& topDottedGeometry, const bool drawFirstExtrem,
108 const GUIDottedGeometry& botDottedGeometry, const bool drawLastExtrem);
109
111 void updateDottedGeometry(const GUIVisualizationSettings& s, const PositionVector& laneShape);
112
114 void updateDottedGeometry(const GUIVisualizationSettings& s, PositionVector shape, const bool closeShape);
115
118 DottedGeometryColor& dottedGeometryColor, const double customWidth = 1) const;
119
121 void moveShapeToSide(const double value);
122
124 void invertOffset();
125
128
130 static void drawDottedContourClosedShape(const GUIVisualizationSettings& s, const DottedContourType type, const PositionVector& shape,
131 const double exaggeration, const double customWidth = 1);
132
134 static void drawDottedContourShape(const GUIVisualizationSettings& s, const DottedContourType type, const PositionVector& shape,
135 const double width, const double exaggeration, const bool drawFirstExtrem, const bool drawLastExtrem);
136
138 static void drawDottedContourCircle(const GUIVisualizationSettings& s, const DottedContourType type, const Position& pos,
139 const double radius, const double exaggeration);
140
142 static void drawDottedSquaredShape(const GUIVisualizationSettings& s, const DottedContourType type, const Position& pos,
143 const double width, const double height, const double offsetX, const double offsetY,
144 const double rot, const double exaggeration);
146
147private:
150
152 std::vector<GUIDottedGeometry::Segment> myDottedGeometrySegments;
153};
class for pack all variables related with GUIDottedGeometry color
const RGBColor getColor(DottedContourType type)
get inspected color (and change flag)
const GUIVisualizationSettings & mySettings
pointer to GUIVisualizationSettings
void reset()
rest Dotted Geometry Color
DottedGeometryColor & operator=(const DottedGeometryColor &other)=delete
Invalidated assignment operator.
std::vector< GUIDottedGeometry::Segment > myDottedGeometrySegments
dotted element shape (note: It's centered in 0,0 due scaling)
void drawDottedGeometry(const GUIVisualizationSettings &s, GUIDottedGeometry::DottedContourType type, DottedGeometryColor &dottedGeometryColor, const double customWidth=1) const
draw inspected dottedShape
void moveShapeToSide(const double value)
move shape to side
void calculateShapeRotationsAndLengths()
calculate shape rotations and lengths
static void drawDottedContourClosedShape(const GUIVisualizationSettings &s, const DottedContourType type, const PositionVector &shape, const double exaggeration, const double customWidth=1)
draw dotted contour for the given closed shape (used by Juctions, shapes and TAZs)
void updateDottedGeometry(const GUIVisualizationSettings &s, const PositionVector &laneShape)
update GUIDottedGeometry (using lane shape)
void invertOffset()
invert offset of all segments
static void drawDottedSquaredShape(const GUIVisualizationSettings &s, const DottedContourType type, const Position &pos, const double width, const double height, const double offsetX, const double offsetY, const double rot, const double exaggeration)
draw dotted squared contour (used by additionals and demand elements)
static void drawDottedContourCircle(const GUIVisualizationSettings &s, const DottedContourType type, const Position &pos, const double radius, const double exaggeration)
draw dotted contour for the given Position and radius (used by Juctions and POIs)
GUIDottedGeometry()
constructor
static void drawDottedContourShape(const GUIVisualizationSettings &s, const DottedContourType type, const PositionVector &shape, const double width, const double exaggeration, const bool drawFirstExtrem, const bool drawLastExtrem)
draw dotted contour for the given shape (used by additionals)
Stores the information about how to visualize structures.
A point in 2D or 3D with translation and scaling methods.
Definition Position.h:37
A list of positions.
dotted geometry segment
std::vector< double > lengths
lengths
std::vector< double > rotations
rotations
double offset
drawing offset (-1 or 1 only)