29 #define MAXIMUM_DOTTEDGEOMETRYLENGTH 500.0
49 return mySettings.dottedContourSettings.firstInspectedColor;
52 return mySettings.dottedContourSettings.secondInspectedColor;
57 return mySettings.dottedContourSettings.firstFrontColor;
60 return mySettings.dottedContourSettings.secondFrontColor;
123 myWidth(s.dottedContourSettings.segmentWidth) {
125 if (closeShape && (shape.size() > 2)) {
128 if (shape.size() > 1) {
130 for (
int i = 1; i < (int)shape.size(); i++) {
140 segment.shape = segment.shape.resample(segmentLength,
true);
151 myWidth(s.dottedContourSettings.segmentWidth) {
156 if (drawFirstExtrem &&
164 if (drawLastExtrem &&
191 for (
int i = 1; i < (int)laneShape.size(); i++) {
210 if (closeShape && (shape.size() > 2)) {
213 if (shape.size() > 1) {
215 for (
int i = 1; i < (int)shape.size(); i++) {
232 const double width = (customWidth > 0) ? customWidth :
myWidth;
236 for (
int i = 0; i < ((int)segment.shape.size() - 1); i++) {
250 segment.shape.move2side(value);
271 segment.offset *= -1;
278 const PositionVector& shape,
const double exaggeration,
const double lineWidth) {
308 const PositionVector& shape,
const double width,
const double exaggeration,
const bool drawFirstExtrem,
309 const bool drawLastExtrem,
const double lineWidth) {
324 GUIDottedGeometry extremes(s, topDottedGeometry, drawFirstExtrem, botDottedGeometry, drawLastExtrem);
338 dottedGeometryColor.
reset();
353 const Position& pos,
const double radius,
const double exaggeration) {
355 if ((radius * exaggeration) < 2) {
365 const double width,
const double height,
const double offsetX,
const double offsetY,
const double rot,
const double exaggeration) {
370 shape.push_back(
Position(0 + width, 0 + height));
371 shape.push_back(
Position(0 + width, 0 - height));
372 shape.push_back(
Position(0 - width, 0 - height));
373 shape.push_back(
Position(0 - width, 0 + height));
375 shape.
add(offsetX, offsetY, 0);
391 int numberOfSegments = (int)segment.shape.size() - 1;
393 if (numberOfSegments >= 0) {
395 segment.rotations.reserve(numberOfSegments);
396 segment.lengths.reserve(numberOfSegments);
398 for (
int i = 0; i < numberOfSegments; i++) {
#define MAXIMUM_DOTTEDGEOMETRYLENGTH
@ GLO_DOTTEDCONTOUR_INSPECTED
dotted contour inspected element (used in NETEDIT)
@ GLO_DOTTEDCONTOUR_FRONT
dotted contour front element (used in NETEDIT)
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
static void popMatrix()
pop matrix
static void drawBoxLine(const Position &beg, double rot, double visLength, double width, double offset=0)
Draws a thick line.
static void pushMatrix()
push matrix
class for pack all variables related with GUIDottedGeometry color
void changeColor()
change color
const RGBColor getColor(DottedContourType type)
get inspected color (and change flag)
void reset()
rest Dotted Geometry Color
DottedGeometryColor(const GUIVisualizationSettings &settings)
constructor
std::vector< GUIDottedGeometry::Segment > myDottedGeometrySegments
dotted element shape (note: It's centered in 0,0 due scaling)
double myWidth
geometry width
void drawDottedGeometry(DottedGeometryColor &dottedGeometryColor, GUIDottedGeometry::DottedContourType type, const double customWidth=-1) const
draw inspected dottedShape
static void drawDottedSquaredShape(const DottedContourType type, const GUIVisualizationSettings &s, 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 DottedContourType type, const GUIVisualizationSettings &s, const Position &pos, const double radius, const double exaggeration)
draw dotted contour for the given Position and radius (used by Juctions and POIs)
void moveShapeToSide(const double value)
move shape to side
void calculateShapeRotationsAndLengths()
calculate shape rotations and lengths
double getWidth() const
get width
static void drawDottedContourShape(const DottedContourType type, const GUIVisualizationSettings &s, const PositionVector &shape, const double width, const double exaggeration, const bool drawFirstExtrem, const bool drawLastExtrem, const double lineWidth=-1)
draw dotted contour for the given shape (used by additionals)
void updateDottedGeometry(const GUIVisualizationSettings &s, const PositionVector &laneShape)
update GUIDottedGeometry (using lane shape)
void invertOffset()
invert offset of all segments
void setWidth(const double width)
change default width
static void drawDottedContourClosedShape(const DottedContourType type, const GUIVisualizationSettings &s, const PositionVector &shape, const double exaggeration, const double lineWidth=-1)
draw dotted contour for the given closed shape (used by Juctions, shapes and TAZs)
GUIDottedGeometry()
constructor
static PositionVector getVertexCircleAroundPosition(const Position &pos, const double width, const int steps=8)
get a circle around the given position
static double calculateRotation(const Position &first, const Position &second)
return angle between two points (used in geometric calculations)
static double calculateLength(const Position &first, const Position &second)
return length between two points (used in geometric calculations)
Stores the information about how to visualize structures.
bool drawDottedContour(const double exaggeration) const
check if dotted contour can be drawn
GUIVisualizationDottedContourSettings dottedContourSettings
dotted contour settings
A point in 2D or 3D with translation and scaling methods.
double length2D() const
Returns the length.
void rotate2D(double angle)
void add(double xoff, double yoff, double zoff)
void closePolygon()
ensures that the last position equals the first
void scaleRelative(double factor)
enlarges/shrinks the polygon by a factor based at the centroid
static const RGBColor GREEN
static const RGBColor BLACK
RGBColor changedBrightness(int change, int toChange=3) const
Returns a new color with altered brightness.
static const RGBColor MAGENTA
Segment()
default constructor
static const double segmentWidth
width of dotted contour segments
static const double segmentLength
length of dotted contour segments