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-2024 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, // Inspecting element
36 REMOVE, // Mouse over element to remove
37 SELECT, // Mouse over element to select
38 MOVE, // Mouse over element to move
39 FRONT, // Element marked as "front element"
40 OVER, // Mouse over element (orange)
41 FROM, // Element marked as from (green)
42 TO, // Element marked as to (magenta)
43 RELATED, // Element marked as related (cyan)
44 WALKINGAREA, // Used if we're drawing walking areas in contour mode
46 };
47
50
51 public:
54
57
59 void changeColor();
60
62 void reset();
63
64 private:
67
70 };
71
73 struct Segment {
74
76 Segment();
77
79 Segment(PositionVector newShape);
80
83
85 std::vector<double> rotations;
86
88 std::vector<double> lengths;
89 };
90
93
96 PositionVector shape, const bool closeShape);
97
100 const PositionVector& laneShape);
101
104 PositionVector shape, const bool closeShape);
105
108 DottedGeometryColor& dottedGeometryColor, const double lineWidth, const bool addOffset) const;
109
111 void drawInnenGeometry(const double lineWidth) const;
112
114 void moveShapeToSide(const double value);
115
118
121
123 const PositionVector& getUnresampledShape() const;
124
126 void clearDottedGeometry();
127
128private:
131
134
136 std::vector<GUIDottedGeometry::Segment> myDottedGeometrySegments;
137};
class for pack all variables related with GUIDottedGeometry color
const RGBColor getColor(const GUIVisualizationSettings &settings, DottedContourType type)
get inspected color (and change flag)
void reset()
rest Dotted Geometry Color
DottedGeometryColor & operator=(const DottedGeometryColor &other)=delete
Invalidated assignment operator.
void drawDottedGeometry(const GUIVisualizationSettings &s, GUIDottedGeometry::DottedContourType type, DottedGeometryColor &dottedGeometryColor, const double lineWidth, const bool addOffset) const
draw dotted geometry
std::vector< GUIDottedGeometry::Segment > myDottedGeometrySegments
dotted element shape (note: It's centered in 0,0 due scaling)
Position getFrontPosition() const
get front position
const PositionVector & getUnresampledShape() const
get simple shape (the shape without resampling)
void drawInnenGeometry(const double lineWidth) const
draw innen geometry
PositionVector myUnresampledShape
shape without resampling
void moveShapeToSide(const double value)
move shape to side
void calculateShapeRotationsAndLengths()
calculate shape rotations and lengths
void clearDottedGeometry()
clear dotted geometry
void updateDottedGeometry(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const PositionVector &laneShape)
update GUIDottedGeometry (using lane shape)
GUIDottedGeometry()
constructor
Position getBackPosition() const
get back position
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