Skip to content

Commit

Permalink
Added function getContourBoundary() in GNEContour. Refs #13894
Browse files Browse the repository at this point in the history
  • Loading branch information
palvarezlopez committed Dec 19, 2023
1 parent 1237184 commit 3f8431d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
10 changes: 10 additions & 0 deletions src/netedit/elements/GNEContour.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,16 @@ GNEContour::~GNEContour() {
}


Boundary
GNEContour::getContourBoundary() const {
Boundary b;
for (const auto &dottedGeometry : *myDottedGeometries) {
b.add(dottedGeometry.getUnresampledShape().getBoxBoundary());
}
return b;
}


void
GNEContour::reset() const {
myCachedShapes->clear();
Expand Down
3 changes: 3 additions & 0 deletions src/netedit/elements/GNEContour.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ class GNEContour {
/// @brief destructor
~GNEContour();

/// @brief get contour boundary
Boundary getContourBoundary() const;

/// @brief reset dotted contour
void reset() const;

Expand Down
2 changes: 1 addition & 1 deletion src/utils/gui/div/GUIDottedGeometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ GUIDottedGeometry::getBackPosition() const {


const PositionVector&
GUIDottedGeometry::getUnresampledShape() {
GUIDottedGeometry::getUnresampledShape() const {
return myUnresampledShape;
}

Expand Down
2 changes: 1 addition & 1 deletion src/utils/gui/div/GUIDottedGeometry.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class GUIDottedGeometry {
Position getBackPosition() const;

/// @brief get simple shape (the shape without resampling)
const PositionVector &getUnresampledShape();
const PositionVector &getUnresampledShape() const;

private:
/// @brief calculate shape rotations and lengths
Expand Down

0 comments on commit 3f8431d

Please sign in to comment.