66 for (
int i = 0; i < 3; i++) {
77 const double scale,
const GUIGlObject* boundaryParent,
const bool addToSelectedObjects)
const {
83 if (addToSelectedObjects) {
93 const double scale,
const bool closeFirstExtrem,
const bool closeLastExtrem,
const double offset,
94 const GNESegment* segment,
const GUIGlObject* boundaryParent,
const bool addToSelectedObjects)
const {
100 if (addToSelectedObjects) {
109 const GUIGlObject* glObject,
const Position& pos,
const double width,
const double height,
const double layer,
110 const double offsetX,
const double offsetY,
const double rot,
const double scale,
const GUIGlObject* boundaryParent)
const {
124 const double scale,
const GUIGlObject* boundaryParent)
const {
138 const bool closeFirstExtrem,
const bool closeLastExtrem)
const {
185 for (
int i = 1; i < (int)shape.size() - 1; i++) {
197 const bool calculatePosOverShape)
const {
201 for (
int i = 0; i < (int)shape.size(); i++) {
205 if (calculatePosOverShape) {
214 const GNEEdge* edge,
const double radius,
const bool calculatePosOverShape,
const bool firstExtrem,
const bool lastExtrem)
const {
220 const int lastGeometryPointIndex = (int)edgeGeometry.size() - 1;
224 const auto squaredRadius = (radius * radius);
227 const auto nearestPos = edgeGeometry.positionAtOffset2D(nearestOffset);
229 for (
int i = 1; i < lastGeometryPointIndex; i++) {
230 if (edgeGeometry[i].distanceSquaredTo2D(nearestPos) <= squaredRadius) {
236 if (edgeGeometry[0].distanceSquaredTo2D(nearestPos) <= squaredRadius) {
241 if (edgeGeometry[lastGeometryPointIndex].distanceSquaredTo2D(nearestPos) <= squaredRadius) {
251 for (
int i = 1; i < lastGeometryPointIndex; i++) {
357 const double scale,
const double lineWidth)
const {
367 if (geometryPoints.size() > 0) {
369 for (
const auto& geometryPoint : geometryPoints) {
407 const PositionVector& shape,
const double scale,
const double lineWidth)
const {
432 const double lineWidth,
const bool addOffset)
const {
472 const PositionVector& shape,
const double extrusionWidth,
const double scale,
473 const bool closeFirstExtrem,
const bool closeLastExtrem,
const double offset)
const {
477 if (shape.size() > 1 && (extrusionWidth > 0)) {
485 if (closeFirstExtrem) {
491 if (closeLastExtrem) {
513 const Position& pos,
const double width,
const double height,
const double offsetX,
514 const double offsetY,
const double rot,
const double scale)
const {
518 if (((width + height) > 0) && (scale > 0)) {
544 const Position& pos,
double radius,
const double scale)
const {
548 const double scaledRadius = radius * scale;
550 if (scaledRadius > POSITION_EPS) {
574 const GNEEdge* edge,
const bool closeFirstExtrem,
const bool closeLastExtrem)
const {
589 if (closeFirstExtrem) {
595 if (closeLastExtrem) {
@ 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 bool checkDrawSelectContour() const =0
check if draw select contour (blue)
bool checkDrawInspectContour() const
check if draw inspect contour (black/white)
virtual GUIGlObject * getGUIGlObject()=0
virtual bool checkDrawOverContour() const =0
check if draw over contour (orange)
virtual bool checkDrawDeleteContour() const =0
check if draw delete contour (pink/white)
void calculateContourLastGeometryPoint(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const GUIGlObject *glObject, const PositionVector &shape, const double layer, const double radius, const double scale) const
calculate contour for last geometry point
static GUIDottedGeometry::DottedGeometryColor myDottedGeometryColor
dotted geometry color
void buildContourCircle(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const Position &pos, double radius, const double scale) const
build contour aorund circle
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 calculateContourExtrudedShape(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const GUIGlObject *glObject, const PositionVector &shape, const double layer, const double extrusionWidth, const double scale, const bool closeFirstExtrem, const bool closeLastExtrem, const double offset, const GNESegment *segment, const GUIGlObject *boundaryParent, const bool addToSelectedObjects=true) const
calculate contour extruded (used in elements formed by a central shape)
std::vector< GUIDottedGeometry > * myDottedGeometries
dotted geometries
PositionVector * myCalculatedShape
calculated shape
void clearContour() const
void clear contour
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 calculateContourMiddleGeometryPoints(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const GUIGlObject *glObject, const PositionVector &shape, const double layer, const double radius, const double scale) const
calculate contour for middle geometry point
void calculateContourFirstGeometryPoint(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const GUIGlObject *glObject, const PositionVector &shape, const double layer, const double radius, const double scale) const
calculate contour for first geometry point
bool drawDottedContour(const GUIVisualizationSettings &s, GUIDottedGeometry::DottedContourType type, const double lineWidth, const bool addOffset) const
draw dotted contour (call out of this class only in special cases, for example in WalkingAreas)
void calculateContourCircleShape(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const GUIGlObject *glObject, const Position &pos, double radius, const double layer, const double scale, const GUIGlObject *boundaryParent) const
calculate contour (circle elements)
void calculateContourClosedShape(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const GUIGlObject *glObject, const PositionVector &shape, const double layer, const double scale, const GUIGlObject *boundaryParent, const bool addToSelectedObjects=true) const
calculate contours
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 calculateContourEdge(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const GNEEdge *edge, const GUIGlObject *elementToRegister, const double layer, const bool closeFirstExtrem, const bool closeLastExtrem) const
calculate contour edge
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)
Boundary getContourBoundary() const
get contour boundary
bool drawDottedContours(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const GNEAttributeCarrier *AC, const double lineWidth, const bool addOffset) const
draw dotted contours (basics, select, delete, inspect...)
void buildContourClosedShape(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const PositionVector &shape, const double scale) const
build contour around closed shape (ej. polygon)
void calculateContourAllGeometryPoints(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const GUIGlObject *glObject, const PositionVector &shape, const double layer, const double radius, const double scale, const bool calculatePosOverShape) const
calculate contour for all 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 layer, const double offsetX, const double offsetY, const double rot, const double scale, const GUIGlObject *boundaryParent) const
calculate contour (for rectangled elements)
bool checkDrawPathContour(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const GNEAttributeCarrier *AC) const
drawing contour functions
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.
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
bool checkShapeObject(const GUIGlObject *GLObject, const PositionVector &shape, const Boundary &shapeBoundary, const double layer, const GNESegment *segment)
check (closed) shape element
bool checkCircleObject(const GUIVisualizationSettings::Detail d, const GUIGlObject *GLObject, const Position ¢er, const double radius, const Boundary &circleBoundary, const double layer)
check if mouse is within elements geometry (for circles)
const Position & getSelectionPosition() const
const Position & getSelectedPositionOverShape(const GUIGlObject *GLObject) const
get position over shape
const std::vector< int > & getSelectedGeometryPoints(const GUIGlObject *GLObject) const
get geometry points for the given glObject
bool checkGeometryPoint(const GUIVisualizationSettings::Detail d, const GUIGlObject *GLObject, const PositionVector &shape, const int index, const double layer, const double radius)
check if mouse is within geometry point
bool checkPositionOverShape(const GUIVisualizationSettings::Detail d, const GUIGlObject *GLObject, const PositionVector &shape, const double layer, const double distance)
check if mouse is within geometry point
bool checkRectangleSelection(const GUIVisualizationSettings &s, const GUIGlObject *GLObject, const double layer, const GUIGlObject *parent)
check rectangle selection
bool selectPositionOverShape(const GUIGlObject *GLObject, const Position &pos, const double layer, const double offset)
select position over shape (for example, the position over a lane shape)
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.