65 for (
int i = 0; i < 3; i++) {
76 const double scale,
const GUIGlObject* boundaryParent,
const bool addToSelectedObjects)
const {
82 if (addToSelectedObjects) {
92 const double scale,
const bool closeFirstExtrem,
const bool closeLastExtrem,
const double offset,
93 const GNESegment* segment,
const GUIGlObject* boundaryParent,
const bool addToSelectedObjects)
const {
99 if (addToSelectedObjects) {
108 const GUIGlObject* glObject,
const Position& pos,
const double width,
const double height,
const double layer,
109 const double offsetX,
const double offsetY,
const double rot,
const double scale,
const GUIGlObject* boundaryParent)
const {
123 const double scale,
const GUIGlObject* boundaryParent)
const {
137 const bool closeFirstExtrem,
const bool closeLastExtrem)
const {
159 const bool forceCalculation)
const {
171 const bool forceCalculation)
const {
186 for (
int i = 1; i < (int)shape.size() - 1; i++) {
198 const bool calculatePosOverShape)
const {
202 for (
int i = 0; i < (int)shape.size(); i++) {
206 if (calculatePosOverShape) {
215 const GNEEdge* edge,
const double radius,
const bool calculatePosOverShape,
const bool firstExtrem,
const bool lastExtrem)
const {
221 const int lastGeometryPointIndex = (int)edgeGeometry.size() - 1;
225 const auto squaredRadius = (radius * radius);
228 const auto nearestPos = edgeGeometry.positionAtOffset2D(nearestOffset);
230 for (
int i = 1; i < lastGeometryPointIndex; i++) {
231 if (edgeGeometry[i].distanceSquaredTo2D(nearestPos) <= squaredRadius) {
237 if (edgeGeometry[0].distanceSquaredTo2D(nearestPos) <= squaredRadius) {
242 if (edgeGeometry[lastGeometryPointIndex].distanceSquaredTo2D(nearestPos) <= squaredRadius) {
252 for (
int i = 1; i < lastGeometryPointIndex; i++) {
364 const double scale,
const double lineWidth)
const {
374 if (geometryPoints.size() > 0) {
376 for (
const auto& geometryPoint : geometryPoints) {
414 const PositionVector& shape,
const double scale,
const double lineWidth)
const {
439 const double lineWidth,
const bool addOffset)
const {
479 const PositionVector& shape,
const double extrusionWidth,
const double scale,
480 const bool closeFirstExtrem,
const bool closeLastExtrem,
const double offset)
const {
484 if (shape.size() > 1 && (extrusionWidth > 0)) {
492 if (closeFirstExtrem) {
498 if (closeLastExtrem) {
520 const Position& pos,
const double width,
const double height,
const double offsetX,
521 const double offsetY,
const double rot,
const double scale)
const {
525 if (((width + height) > 0) && (scale > 0)) {
551 const Position& pos,
double radius,
const double scale)
const {
555 const double scaledRadius = radius * scale;
557 if (scaledRadius > POSITION_EPS) {
581 const GNEEdge* edge,
const bool closeFirstExtrem,
const bool closeLastExtrem)
const {
596 if (closeFirstExtrem) {
602 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 checkDrawDeleteContourSmall() const =0
check if draw delete contour small (pink/white)
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
get GUIGlObject associated with this AttributeCarrier
virtual bool checkDrawOverContour() const =0
check if draw over contour (orange)
virtual bool checkDrawDeleteContour() const =0
check if draw delete contour (pink/white)
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 calculateContourLastGeometryPoint(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const GUIGlObject *glObject, const PositionVector &shape, const double layer, const double radius, const double scale, const bool forceCalculation=false) const
calculate contour for last geometry point
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
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)
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 bool forceCalculation=false) const
calculate contour for first geometry point
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
NBEdge * getNBEdge() const
returns the internal NBEdge
const GNEHierarchicalContainerChildren< GNELane * > & getChildLanes() const
get child lanes
double getDrawingWidth() const
get lane drawing width
double getOffset() const
get lane offset
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
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 checkCircleObject(const GUIVisualizationSettings::Detail d, const GUIGlObject *GLObject, const Position ¢er, const double radius, const double layer)
check if mouse is within elements geometry (for circles)
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
GUIVisualizationDottedContourSettings dottedContourSettings
dotted contour settings
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.
static const double segmentWidthSmall
width of small dotted contour segments