29#define MAXIMUM_DOTTEDGEOMETRYLENGTH 500.0
51 return mySettings.dottedContourSettings.firstInspectedColor;
54 return mySettings.dottedContourSettings.secondInspectedColor;
60 return mySettings.dottedContourSettings.firstFrontColor;
63 return mySettings.dottedContourSettings.secondFrontColor;
159 if (closeShape && (shape.size() > 2)) {
162 if (shape.size() > 1) {
164 for (
int i = 1; i < (int)shape.size(); i++) {
174 segment.shape = segment.shape.resample(segmentLength,
true);
189 if (drawFirstExtrem &&
197 if (drawLastExtrem &&
222 for (
int i = 1; i < (int)laneShape.size(); i++) {
239 if (closeShape && (shape.size() > 2)) {
242 if (shape.size() > 1) {
244 for (
int i = 1; i < (int)shape.size(); i++) {
282 for (
int i = 0; i < ((int)segment.shape.size() - 1); i++) {
296 segment.shape.move2side(value);
305 segment.offset *= -1;
312 const PositionVector& shape,
const double exaggeration,
const double customWidth) {
336 const PositionVector& shape,
const double width,
const double exaggeration,
const bool drawFirstExtrem,
337 const bool drawLastExtrem) {
352 GUIDottedGeometry extremes(s, topDottedGeometry, drawFirstExtrem, botDottedGeometry, drawLastExtrem);
360 dottedGeometryColor.
reset();
375 const double radius,
const double exaggeration) {
377 if ((radius * exaggeration) < 2) {
387 const double width,
const double height,
const double offsetX,
const double offsetY,
const double rot,
const double exaggeration) {
392 shape.push_back(
Position(0 + width, 0 + height));
393 shape.push_back(
Position(0 + width, 0 - height));
394 shape.push_back(
Position(0 - width, 0 - height));
395 shape.push_back(
Position(0 - width, 0 + height));
397 shape.
add(offsetX, offsetY, 0);
413 int numberOfSegments = (int)segment.shape.size() - 1;
415 if (numberOfSegments >= 0) {
417 segment.rotations.reserve(numberOfSegments);
418 segment.lengths.reserve(numberOfSegments);
420 for (
int i = 0; i < numberOfSegments; i++) {
#define MAXIMUM_DOTTEDGEOMETRYLENGTH
@ GLO_DOTTEDCONTOUR_INSPECTED
dotted contour inspected 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)
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)
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 BLUE
static const RGBColor YELLOW
static const RGBColor ORANGE
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 segmentWidthSmall
width of dotted contour segments
static const double segmentLength
length of dotted contour segments
static const double segmentWidthLarge
width of dotted contour segments