66 for (
int i = 0; i < 3; i++) {
90 const double scale,
const bool closeFirstExtrem,
const bool closeLastExtrem,
91 const double offset)
const {
105 const double offsetX,
const double offsetY,
const double rot,
const double scale)
const {
118 const GUIGlObject* glObject,
const Position& pos,
double radius,
const double scale)
const {
131 const GNEEdge* edge,
const GUIGlObject* elementToRegister,
const bool closeFirstExtrem,
132 const bool closeLastExtrem)
const {
154 const double scale)
const {
166 const double scale)
const {
178 const double scale)
const {
182 for (
int i = 1; i < (int)shape.size() - 1; i++) {
194 const double scale,
const bool calculatePosOverShape)
const {
198 for (
int i = 0; i < (int)shape.size(); i++) {
202 if (calculatePosOverShape) {
211 const GNEEdge* edge,
const double radius,
const bool calculatePosOverShape,
212 const bool firstExtrem,
const bool lastExtrem)
const {
218 const int lastGeometryPointIndex = (int)edgeGeometry.size() - 1;
222 const auto squaredRadius = (radius * radius);
225 const auto nearestPos = edgeGeometry.positionAtOffset2D(nearestOffset);
227 for (
int i = 1; i < lastGeometryPointIndex; i++) {
228 if (edgeGeometry[i].distanceSquaredTo(nearestPos) <= squaredRadius) {
234 if (edgeGeometry[0].distanceSquaredTo(nearestPos) <= squaredRadius) {
239 if (edgeGeometry[lastGeometryPointIndex].distanceSquaredTo(nearestPos) <= squaredRadius) {
249 for (
int i = 1; i < lastGeometryPointIndex; i++) {
309 const double scale,
const double lineWidth)
const {
319 if (geometryPoints.size() > 0) {
321 for (
const auto& geometryPoint : geometryPoints) {
359 const PositionVector& shape,
const double scale,
const double lineWidth)
const {
405 const PositionVector& shape,
const double extrusionWidth,
const double scale,
406 const bool closeFirstExtrem,
const bool closeLastExtrem,
const double offset)
const {
410 if (shape.size() > 1 && (extrusionWidth > 0)) {
418 if (closeFirstExtrem) {
424 if (closeLastExtrem) {
446 const Position& pos,
const double width,
const double height,
const double offsetX,
447 const double offsetY,
const double rot,
const double scale)
const {
451 if (((width + height) > 0) && (scale > 0)) {
477 const Position& pos,
double radius,
const double scale)
const {
481 const double scaledRadius = radius * scale;
483 if (scaledRadius > POSITION_EPS) {
507 const GNEEdge* edge,
const bool closeFirstExtrem,
const bool closeLastExtrem)
const {
522 if (closeFirstExtrem) {
528 if (closeLastExtrem) {
556 const double lineWidth,
const bool addOffset)
const {
@ GLO_DOTTEDCONTOUR
dotted contour (used in netedit)
GUIViewObjectsHandler gViewObjectsHandler
A class that stores a 2D geometrical boundary.
void reset()
Resets the boundary.
static void popMatrix()
pop matrix
static void pushMatrix()
push matrix
virtual bool checkDrawMoveContour() const =0
check if draw move contour (red)
virtual bool checkDrawRelatedContour() const =0
check if draw related contour (cyan)
virtual bool checkDrawToContour() const =0
check if draw from contour (magenta)
bool checkDrawFrontContour() const
check if draw front contour (green/blue)
virtual bool checkDrawFromContour() const =0
check if draw from contour (green)
virtual GUIGlObject * getGUIGlObject()=0
virtual bool checkDrawSelectContour() const =0
check if draw select contour (blue)
bool checkDrawInspectContour() const
check if draw inspect contour (black/white)
virtual bool checkDrawOverContour() const =0
check if draw over contour (orange)
virtual bool checkDrawDeleteContour() const =0
check if draw delete contour (pink/white)
void calculateContourExtrudedShape(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const GUIGlObject *glObject, const PositionVector &shape, const double extrusionWidth, const double scale, const bool closeFirstExtrem, const bool closeLastExtrem, const double offset) const
calculate contour extruded (used in elements formed by a central shape)
static GUIDottedGeometry::DottedGeometryColor myDottedGeometryColor
dotted geometry color
void calculateContourLastGeometryPoint(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const GUIGlObject *glObject, const PositionVector &shape, const double radius, const double scale) const
calculate contour for last geometry point
void buildContourCircle(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const Position &pos, double radius, const double scale) const
build contour aorund circle
void calculateContourEdge(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const GNEEdge *edge, const GUIGlObject *elementToRegister, const bool closeFirstExtrem, const bool closeLastExtrem) const
calculate contour edge
void calculateContourEdges(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const GNEEdge *fromEdge, const GNEEdge *toEdge) const
calculate contour between two consecutive edges
void buildContourEdge(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const GNEEdge *edge, const bool closeFirstExtrem, const bool closeLastExtrem) const
build contour around edge
void buildContourExtrudedShape(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const PositionVector &shape, const double extrusionWidth, const double scale, const bool closeFirstExtrem, const bool closeLastExtrem, const double offset) const
build contour around extruded shape (ej. lane)
void buildContourRectangle(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const Position &pos, const double width, const double height, const double offsetX, const double offsetY, const double rot, const double scale) const
build contour around rectangle
void clearContour()
void clear contour
std::vector< GUIDottedGeometry > * myDottedGeometries
dotted geometries
void calculateContourCircleShape(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const GUIGlObject *glObject, const Position &pos, double radius, const double scale) const
calculate contour (circle elements)
void calculateContourAllGeometryPoints(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const GUIGlObject *glObject, const PositionVector &shape, const double radius, const double scale, const bool calculatePosOverShape) const
calculate contour for all geometry points
PositionVector * myCalculatedShape
calculated shape
void drawDottedContourGeometryPoints(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const GNEAttributeCarrier *AC, const PositionVector &shape, const double radius, const double scale, const double lineWidth) const
draw dotted contour for geometry points
void calculateContourRectangleShape(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const GUIGlObject *glObject, const Position &pos, const double width, const double height, const double offsetX, const double offsetY, const double rot, const double scale) const
calculate contour (for rectangled elements)
void buildContourEdges(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const GNEEdge *fromEdge, const GNEEdge *toEdge) const
build contour between two from-to edgeds
Boundary * myContourBoundary
contourboundary
void calculateContourEdgeGeometryPoints(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const GNEEdge *edge, const double radius, const bool calculatePosOverShape, const bool firstExtrem, const bool lastExtrem) const
calculate contour for edge geometry points
void drawInnenContourClosed(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const PositionVector &shape, const double scale, const double lineWidth) const
draw innen contour (currently used only in walkingAreas)
void calculateContourMiddleGeometryPoints(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const GUIGlObject *glObject, const PositionVector &shape, const double radius, const double scale) const
calculate contour for middle geometry point
void drawDottedContours(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const GNEAttributeCarrier *AC, const double lineWidth, const bool addOffset) const
drawing contour functions
Boundary getContourBoundary() const
get contour boundary
void calculateContourClosedShape(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const GUIGlObject *glObject, const PositionVector &shape, const double scale) const
calculate contours
void buildContourClosedShape(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const PositionVector &shape, const double scale) const
build contour around closed shape (ej. polygon)
void calculateContourFirstGeometryPoint(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const GUIGlObject *glObject, const PositionVector &shape, const double radius, const double scale) const
calculate contour for first geometry point
void drawDottedContour(const GUIVisualizationSettings &s, GUIDottedGeometry::DottedContourType type, const double lineWidth, const bool addOffset) const
draw dotted contour
A road/street connecting two junctions (netedit-version)
NBEdge * getNBEdge() const
returns the internal NBEdge
const std::vector< GNELane * > & getLanes() const
returns a reference to the lane vector
double getDrawingWidth() const
get lane drawing width
double getOffset() const
get lane offset
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
const DrawingConstants * getDrawingConstants() const
get lane drawing constants (previously calculated in drawGL())
const GUIGeometry & getLaneGeometry() const
get lane geometry
class for pack all variables related with GUIDottedGeometry color
void reset()
rest Dotted Geometry Color
static PositionVector getVertexCircleAroundPosition(const Position &pos, const double width, const int steps=8)
get a circle around the given position
const PositionVector & getShape() const
The shape of the additional element.
bool addPositionOverShape(const GUIGlObject *GLObject, const Position &pos, const double offset)
add position over shape
const Position & getSelectionPosition() const
get selection position (usually the mouse position)
bool checkShapeElement(const GUIGlObject *GLObject, const PositionVector &shape, const Boundary &shapeBoundary)
check (closed) shape element
const std::vector< int > & getGeometryPoints(const GUIGlObject *GLObject) const
get geometry points for the given glObject
const Position & getPositionOverShape(const GUIGlObject *GLObject) const
get position over shape
bool checkCircleElement(const GUIVisualizationSettings::Detail d, const GUIGlObject *GLObject, const Position ¢er, const double radius, const Boundary &circleBoundary)
check if mouse is within elements geometry (for circles)
bool checkGeometryPoint(const GUIVisualizationSettings::Detail d, const GUIGlObject *GLObject, const PositionVector &shape, const int index, const double radius)
check if mouse is within geometry point
bool checkPositionOverShape(const GUIVisualizationSettings::Detail d, const GUIGlObject *GLObject, const PositionVector &shape, const double distance)
check if mouse is within geometry point
Stores the information about how to visualize structures.
bool disableDottedContours
flag for disable dotted contours in netedit
bool drawForViewObjectsHandler
whether drawing is performed for the purpose of selecting objects in view using ViewObjectsHandler
const PositionVector & getGeometry() const
Returns the geometry of the edge.
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
static OptionsCont & getOptions()
Retrieves the options.
A point in 2D or 3D with translation and scaling methods.
static const Position INVALID
used to indicate that a position is valid
double x() const
Returns the x-position.
double y() const
Returns the y-position.
void rotate2D(double angle)
void add(double xoff, double yoff, double zoff)
void closePolygon()
ensures that the last position equals the first
double nearest_offset_to_point2D(const Position &p, bool perpendicular=true) const
return the nearest offest to point 2D
Boundary getBoxBoundary() const
Returns a boundary enclosing this list of lines.
void scaleRelative(double factor)
enlarges/shrinks the polygon by a factor based at the centroid
PositionVector reverse() const
reverse position vector
bool around(const Position &p, double offset=0) const
Returns the information whether the position vector describes a polygon lying around the given point.