112 const Position& center,
const double radius,
const double layer) {
118 const double squaredRadius = (radius * radius);
153 const PositionVector& shape,
const int index,
const double layer,
const double radius) {
155 const auto geometryPointPos = shape[index];
157 const double squaredRadius = (radius * radius);
164 geometryPointBoundary.
add(geometryPointPos);
194 const PositionVector& shape,
const double layer,
const double distance) {
214 const double layer,
const GNESegment* segment) {
260 const double layer) {
263 for (
auto& element : elementLayer.second) {
264 if (element.object == GLObject) {
266 for (
auto& index : element.geometryPoints) {
267 if (index == newIndex) {
272 element.geometryPoints.push_back(newIndex);
280 layerContainer.back().geometryPoints.push_back(newIndex);
289 const double offset) {
292 for (
auto& element : elementLayer.second) {
293 if (element.object == GLObject) {
298 element.posOverShape = pos;
299 element.offset = offset;
308 layerContainer.back().posOverShape = pos;
342 return finder->second;
349const std::vector<int>&
353 for (
auto& element : elementLayer.second) {
354 if (element.object == GLObject) {
355 return element.geometryPoints;
367 for (
auto& element : elementLayer.second) {
368 if (element.object == GLObject) {
369 return element.posOverShape;
386 std::reverse(layerContainer.second.begin(), layerContainer.second.end());
391const std::set<const GNEPathElement*>&
413const std::vector<const GNEJunction*>&
423 if (mergingJunctions == junction) {
437 auto it = elementLayer.second.begin();
438 while (it != elementLayer.second.end()) {
439 if (it->object == GLObject) {
441 frontElement.
object = it->object;
444 it = elementLayer.second.erase(it);
451 if (frontElement.
object) {
463 for (
auto element : elementLayer.second) {
464 if ((element.object->getType() ==
GLO_EDGE) && (element.geometryPoints.size() > 0)) {
465 edgeWithGeometryPoints = element;
470 if (edgeWithGeometryPoints.
object !=
nullptr) {
481 if (capacity() == size()) {
483 reserve(size() + 10);
485 reserve(size() + 1000);
488 push_back(objectContainer);
@ GLO_FRONTELEMENT
front element (used in netedit)
@ GLO_NETWORK
The network - empty.
A class that stores a 2D geometrical boundary.
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
bool isInitialised() const
check if Boundary is Initialised
bool checkShapeObject(const GUIGlObject *GLObject, const PositionVector &shape, const Boundary &shapeBoundary, const double layer, const GNESegment *segment)
check (closed) shape element
Triangle mySelectionTriangle
selection triangle
void setSelectionPosition(const Position &pos)
set selection position
void addToRedrawPathElements(const GNEPathElement *pathElement)
add path element to redrawing set
std::unordered_map< const GUIGlObject *, const GNESegment * > mySelectedObjects
map with selected elements and if was selected with full boundary (used only to avoid double selectio...
bool checkBoundaryParentObject(const GUIGlObject *GLObject, const double layer, const GUIGlObject *parent)
const GNERoute * markedRoute
marked route (used in create vehicle mode)
bool selectGeometryPoint(const GUIGlObject *GLObject, const int newIndex, const double layer)
add geometryPoint into list of elements under cursor
int getNumberOfSelectedObjects() const
get number of selected objects
std::vector< const GNEJunction * > myMergingJunctions
merging junctions
const Position & getSelectionPosition() const
const Triangle & getSelectionTriangle() const
get selection triangle
void reverseSelectedObjects()
reverse selected objects
void isolateEdgeGeometryPoints()
isolate edge geometry points (used for moving)
void reset()
reset view objects handler
const GUIGlObject * markedTAZ
marked TAZ (used in create TAZRel mode)
const Position & getSelectedPositionOverShape(const GUIGlObject *GLObject) const
get position over shape
GUIViewObjectsHandler()
constructor
bool addMergingJunctions(const GNEJunction *junction)
add to merging junctions (used for marking junctions to merge)
std::map< double, ObjectContainerLayer > GLObjectsSortedContainer
typedef for pack elements sorted by layer
void setSelectionTriangle(const Triangle &triangle)
set selection triangle
GUIGlObjectType recomputeBoundaries
recompute boundaries
const GLObjectsSortedContainer & getSelectedObjects() const
get all elements under cursor sorted by layer
const GNEEdge * markedEdge
marked edge (used in create edge mode, for splitting)
int myNumberOfSelectedObjects
number of selected objects
const GNELane * markedLane
marked lane (used in create edge mode, for splitting)
Position mySelectionPosition
position
bool isPathElementMarkForRedraw(const GNEPathElement *pathElement) const
check if the given path element has to be redraw again
const GUIGlObject * markedSecondGeometryPoint
marked first geometry point (used for moving/delete geometry points)
bool isObjectSelected(const GUIGlObject *GLObject) const
check if element was already selected
const std::vector< int > & getSelectedGeometryPoints(const GUIGlObject *GLObject) const
get geometry points for the given glObject
void updateFrontObject(const GUIGlObject *GLObject)
move the given object to the front (currently used only in netedit)
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
std::set< const GNEPathElement * > myRedrawPathElements
set with path elements marked for redrawing
const GNESegment * getSelectedSegment(const GUIGlObject *GLObject) const
get segment associated with the given GLObject (if exist)
GLObjectsSortedContainer mySortedSelectedObjects
selected element sorted by layer
bool selectingUsingRectangle() const
return true if we're selecting using a triangle
std::vector< int > myEmptyGeometryPoints
empty geometry points
bool checkRectangleSelection(const GUIVisualizationSettings &s, const GUIGlObject *GLObject, const double layer, const GUIGlObject *parent)
check rectangle selection
const GUIGlObject * markedFirstGeometryPoint
marked first geometry point (used for moving/delete geometry points)
bool selectObject(const GUIGlObject *GLObject, const double layer, const bool checkDuplicated, const GNESegment *segment)
const std::set< const GNEPathElement * > & getRedrawPathElements() const
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)
const std::vector< const GNEJunction * > & getMergingJunctions() const
Stores the information about how to visualize structures.
bool drawForRectangleSelection
whether drawing is performed for the purpose of selecting objects using a rectangle
A point in 2D or 3D with translation and scaling methods.
double distanceSquaredTo2D(const Position &p2) const
returns the square of the distance to another position (Only using x and y positions)
static const Position INVALID
used to indicate that a position is valid
double nearest_offset_to_point2D(const Position &p, bool perpendicular=true) const
return the nearest offest to point 2D
Position positionAtOffset2D(double pos, double lateralOffset=0, bool extrapolateBeyond=false) const
Returns the position at the given length.
bool around(const Position &p, double offset=0) const
Returns the information whether the position vector describes a polygon lying around the given point.
A simple triangle defined in 3D.
bool isPositionWithin(const Position &pos) const
check if the given position is within this triangle
static const Triangle INVALID
invalid triangle
bool intersectWithShape(const PositionVector &shape) const
check if the given shape is within or intersect with this triangle
bool intersectWithCircle(const Position ¢er, const double radius) const
check if the given circle intersect with this triangle
std::vector< int > geometryPoints
vector with geometry points
const GUIGlObject * object
object
void append(const ObjectContainer &objectContainer)