Eclipse SUMO - Simulation of Urban MObility
GNEContourElement.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 // A abstract class contour elements
19 /****************************************************************************/
20 #pragma once
21 #include <config.h>
22 
24 
25 // ===========================================================================
26 // class declaration
27 // ===========================================================================
28 
29 class GNENet;
30 class GNEEdge;
32 
33 // ===========================================================================
34 // class definitions
35 // ===========================================================================
36 
38 
39 protected:
42 
45 
48  const double scale, const double lineWidth) const;
49 
52  const double extrusionWidth, const double scale, const bool drawFirstExtrem,
53  const bool drawLastExtrem, const double lineWidth) const;
54 
56  void drawDottedContourRectangle(const GUIVisualizationSettings& s, const Position &pos, const double width,
57  const double height, const double offsetX, const double offsetY, const double rot,
58  const double scale, const double lineWidth) const;
59 
61  void drawDottedContourCircle(const GUIVisualizationSettings& s, const Position &pos, double radius,
62  const double scale, const double lineWidth) const;
63 
65  void drawDottedContourEdge(const GUIVisualizationSettings& s, const GNEEdge* edge, const bool drawFirstExtrem,
66  const bool drawLastExtrem, const double lineWidth) const;
67 
68 private:
71 
74 
77 
79  double *myCachedWidth;
80 
82  double *myCachedHeight;
83 
85  double *myCachedRot;
86 
88  double *myCachedScale;
89 
92 
95 
98 
101 
104  const PositionVector &shape, const double scale, const double lineWidth) const;
105 
108  const PositionVector &shape, const double extrusionWidth, const double scale,
109  const bool drawFirstExtrem, const bool drawLastExtrem, const double lineWidth) const;
110 
113  const Position &pos, const double width, const double height, const double offsetX,
114  const double offsetY, const double rot, const double scale, const double lineWidth) const;
115 
118  const Position &pos, double radius, const double scale, const double lineWidth) const;
119 
122  const GNEEdge* edge, const bool drawFirstExtrem, const bool drawLastExtrem, const double lineWidth) const;
123 };
double * myCachedScale
pointer to cached scale
void buildAndDrawDottedContourExtruded(const GUIVisualizationSettings &s, GUIDottedGeometry::DottedContourType type, const PositionVector &shape, const double extrusionWidth, const double scale, const bool drawFirstExtrem, const bool drawLastExtrem, const double lineWidth) const
build and draw dotted contour extruded
GNEAttributeCarrier * myAC
pointer to AC
void drawDottedContourEdge(const GUIVisualizationSettings &s, const GNEEdge *edge, const bool drawFirstExtrem, const bool drawLastExtrem, const double lineWidth) const
draw dotted contour edge
PositionVector * myCachedShape
pointer to cached shape
void buildAndDrawDottedContourCircle(const GUIVisualizationSettings &s, GUIDottedGeometry::DottedContourType type, const Position &pos, double radius, const double scale, const double lineWidth) const
draw dotted contour circle
void drawDottedContourExtruded(const GUIVisualizationSettings &s, const PositionVector &shape, const double extrusionWidth, const double scale, const bool drawFirstExtrem, const bool drawLastExtrem, const double lineWidth) const
draw dotted contour extruded (used in elements formed by a central shape)
GUIDottedGeometry::DottedGeometryColor * myDottedGeometryColor
dotted geometry color
GUIDottedGeometry * myDottedGeometryB
pointer to dotted geometry B
void buildAndDrawDottedContourEdge(const GUIVisualizationSettings &s, GUIDottedGeometry::DottedContourType type, const GNEEdge *edge, const bool drawFirstExtrem, const bool drawLastExtrem, const double lineWidth) const
draw dotted contour edge
void buildAndDrawDottedContourClosed(const GUIVisualizationSettings &s, const GUIDottedGeometry::DottedContourType type, const PositionVector &shape, const double scale, const double lineWidth) const
draw dotted contour shape
void drawDottedContourRectangle(const GUIVisualizationSettings &s, const Position &pos, const double width, const double height, const double offsetX, const double offsetY, const double rot, const double scale, const double lineWidth) const
draw dotted contour (for rectangled elements)
double * myCachedRot
pointer to cached rotation
void drawDottedContourCircle(const GUIVisualizationSettings &s, const Position &pos, double radius, const double scale, const double lineWidth) const
draw dotted contour (circle)
void drawDottedContourClosed(const GUIVisualizationSettings &s, const PositionVector &shape, const double scale, const double lineWidth) const
draw dotted contour (for closed shapes)
~GNEContourElement()
destructor
GNEContourElement(GNEAttributeCarrier *AC)
Constructor.
Position * myCachedPosition
pointer to cached position
GUIDottedGeometry * myDottedGeometryC
pointer to dotted geometry C
double * myCachedWidth
pointer to cached width
void buildAndDrawDottedContourRectangle(const GUIVisualizationSettings &s, GUIDottedGeometry::DottedContourType type, const Position &pos, const double width, const double height, const double offsetX, const double offsetY, const double rot, const double scale, const double lineWidth) const
draw dotted contour rectangle
double * myCachedHeight
pointer to cached height
GUIDottedGeometry * myDottedGeometryA
pointer to dotted geometry A
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:53
A NBNetBuilder extended by visualisation and editing capabilities.
Definition: GNENet.h:42
class for pack all variables related with GUIDottedGeometry color
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.