ADORe
ADORe is a modular open source software library and toolkit for decision making, planning, control and simulation of automated vehicles
border.h
Go to the documentation of this file.
1 /********************************************************************************
2  * Copyright (C) 2017-2020 German Aerospace Center (DLR).
3  * Eclipse ADORe, Automated Driving Open Research https://eclipse.org/adore
4  *
5  * This program and the accompanying materials are made available under the
6  * terms of the Eclipse Public License 2.0 which is available at
7  * http://www.eclipse.org/legal/epl-2.0.
8  *
9  * SPDX-License-Identifier: EPL-2.0
10  *
11  * Contributors:
12  * Daniel Heß - initial API and implementation
13  * Stephan Lapoehn - initial API and implementation
14  * Thomas Lobig - refactoring
15  ********************************************************************************/
16 
17 #pragma once
20 #include <boost/geometry.hpp>
21 #include <boost/geometry/geometries/box.hpp>
23 
24 namespace adore
25 {
26  namespace env
27  {
28  namespace BorderBased
29  {
30  namespace BorderType
31  {
36  enum TYPE
37  {
43  };
44  //std::string toString(TYPE t)
45  //{
46  // switch(t)
47  // {
48  // case DRIVING:
49  // return "DRIVING";
50  // case EMERGENCY:
51  // return "EMERGENCY";
52  // case OTHER:
53  // return "OTHER";
54  // }
55  //}
56  }
61  struct Border
62  {
66  typedef boost::geometry::model::box<Coordinate::boost_point> boost_box;
67 
77  {
78  m_path = 0;
79  m_left = 0;
81  }
86  virtual ~Border()
87  {
88  if (m_path != 0)delete m_path;
89  if (m_left != 0)delete m_left;
90  }
96  void operator=(const Border& clone)
97  {
98  this->m_id = clone.m_id;
99  if(clone.m_left!=0)
100  {
101  this->m_left = new BorderID(*(clone.m_left));
102  }
103  else
104  {
105  this->m_left = 0;
106  }
107  if(clone.m_path!=0)
108  {
109  m_path = new Tborderpath(clone.m_path->getData());
110  }
111  else
112  {
113  m_path = 0;
114  }
115  this->m_type = clone.m_type;
116  }
122  Border(const Border& clone)
123  {
124  *this = clone;
125  }
132  Border(const BorderID& id, Tborderpath* path)
133  {
134  m_id = BorderID(id);
135  m_path = path;
136  m_left = nullptr;
138  }
146  {
147  m_path = path;
148  m_id.m_first = Coordinate(path->f(path->limitLo()));
149  m_id.m_last = Coordinate(path->f(path->limitHi()));
150  m_left = nullptr;
152  }
160  {
161  m_path = path;
162  m_id.m_first = Coordinate(path->f(path->limitLo()));
163  m_id.m_last = Coordinate(path->f(path->limitHi()));
164  m_left = 0;
165  m_type = type;
166  }
174  Border(const BorderID& myid, const BorderID& leftid, Tborderpath* path)
175  {
176  m_id = BorderID(myid);
177  m_left = new BorderID(leftid);
178  m_path = path;
180  }
189  Border(const BorderID& myid, const BorderID& leftid, Tborderpath* path, const BorderType::TYPE type)
190  {
191  m_id = BorderID(myid);
192  m_left = new BorderID(leftid);
193  m_path = path;
194  m_type = type;
195  }
199  Border(double rx0,double ry0,double rx1,double ry1,double lx0,double ly0,double lx1,double ly1)
200  {
201  m_id = BorderID(Coordinate(rx0,ry0,0.0),Coordinate(rx1,ry1,0.0));
202  m_left = new BorderID(Coordinate(lx0,ly0,0.0),Coordinate(lx1,ly1,0.0));
203  m_path = nullptr;
205  }
209  Border(double rx0,double ry0,double rx1,double ry1)
210  {
211  m_id = BorderID(Coordinate(rx0,ry0,0.0),Coordinate(rx1,ry1,0.0));
212  m_left = nullptr;
213  m_path = nullptr;
215  }
220  void deleteType()
221  {
222 
223  switch(m_type)
224  {
225  case BorderType::OTHER: // silence -Wswitch warning
226  break;
227  case BorderType::DRIVING:
229  break;
230  case BorderType::DRIVING_DELETED: // silence -Wswitch warning
231  break;
234  break;
235  case BorderType::EMERGENCY_DELETED: // silence -Wswitch warning
236  break;
237  }
238  }
244  {
245  switch (m_type)
246  {
247  case BorderType::OTHER: // silence -Wswitch warning
248  break;
249  case BorderType::DRIVING: // silence -Wswitch warning
250  break;
253  break;
254  case BorderType::EMERGENCY: // silence -Wswitch warning
255  break;
258  break;
259  }
260  }
267  bool isDeleted()
268  {
270  }
279  {
280  return m_type != BorderType::OTHER;
281  }
289  void translate(double dx,double dy,double dz)
290  {
291  m_id.translate(dx,dy,dz);
292  if(m_left!=0)m_left->translate(dx,dy,dz);
293  if(m_path!=0)
294  {
295  adoreMatrix<double,3,1> shift;
296  shift = dx,dy,dz;
297  m_path->shiftCodomain(shift);
298  }
299  }
304  void rotateXY(double angle, double x0=0.0, double y0=0.0)
305  {
306  m_path->rotateXY(angle, x0, y0);
307  m_id.rotate(angle, x0, y0);
308  if(m_left!=0) m_left->rotate(angle, x0, y0);
309  }
319  bool isSuccessorOf(const BorderID& predecessorID)
320  {
321  //return predecessorID.m_last == m_id.m_first;
322  return predecessorID.m_last.isNear(m_id.m_first);
323  }
333  bool isPredecessorOf(const BorderID& successorID)
334  {
335  //return successorID.m_first == m_id.m_last;
336  return successorID.m_first.isNear(m_id.m_last);
337  }
338 
349  {
350  return parent!=0 && parent->m_left != 0 && this->m_left != 0
351  && isSuccessorOf(parent->m_id)
352  && (parent->m_left->m_last.isNear(this->m_left->m_first) || parent->m_left->m_first.isNear(this->m_left->m_last) || parent->m_left->m_first.isNear(this->m_left->m_first) || parent->m_left->m_last.isNear(this->m_left->m_last));
353  }
364  {
365  return other!=0 && other->m_left != 0 && this->m_left != 0
366  && isPredecessorOf(other->m_id)
367  && other->m_left->m_first.isNear(this->m_left->m_last);//HeD, 24.03.2020: checking this/last against other first should be sufficient with double-linked centerline
368  }
369 
380  bool isContinuousPredecessorOf(Border* other,double maxDistMeter,double maxDistRel)
381  {
382  if(other==0 || other->m_left==0 || this->m_left==0) return false;
383  maxDistMeter = (std::min)(maxDistMeter,(std::min)(this->getLength(),other->getLength())*maxDistRel);
384  double dxr = other->m_id.m_first.m_X - this->m_id.m_last.m_X;
385  double dyr = other->m_id.m_first.m_Y - this->m_id.m_last.m_Y;
386  double dzr = other->m_id.m_first.m_Z - this->m_id.m_last.m_Z;
387  double dxl = other->m_left->m_first.m_X - this->m_left->m_last.m_X;
388  double dyl = other->m_left->m_first.m_Y - this->m_left->m_last.m_Y;
389  double dzl = other->m_left->m_first.m_Z - this->m_left->m_last.m_Z;
390  return (std::max)(dxr*dxr+dyr*dyr+dzr*dzr,dxl*dxl+dyl*dyl+dzl*dzl)<=maxDistMeter*maxDistMeter;
391  }
392 
402  {
403  return other!=0 && other->m_left!=0 && this->m_left!=0
404  && this->m_id.m_first.isNear(other->m_id.m_first)
405  && this->m_left->m_first.isNear(other->m_left->m_first);
406  }
416  {
417  return other!=0 && other->m_left!=0 && this->m_left!=0
418  && this->m_id.m_last.isNear(other->m_id.m_last)
419  && this->m_left->m_last.isNear(other->m_left->m_last);
420  }
428  bool isRightOf(Border* other)
429  {
430  if(other==0 || this->m_left==0 || other->m_left==0)return false;
431  // TODO investigate if this is a bug
432  // Coordinate* tp0; // commented out to silence -Wunused-but-set-variable
433  Coordinate* tp1;
434  // Coordinate* tp2;
435  Coordinate* tp3;
436  Coordinate* op0;
437  Coordinate* op1;
438  Coordinate* op2;
439  Coordinate* op3;
440  // tp0 = &(this->m_id.m_first);
441  // tp2 = &(this->m_id.m_last);
443  {
444  tp1 = &(this->m_left->m_last);
445  tp3 = &(this->m_left->m_first);
446  }
447  else
448  {
449  tp1 = &(this->m_left->m_first);
450  tp3 = &(this->m_left->m_last);
451  }
452  op0 = &(other->m_id.m_first);
453  op2 = &(other->m_id.m_last);
455  {
456  op1 = &(other->m_left->m_last);
457  op3 = &(other->m_left->m_first);
458  }
459  else
460  {
461  op1 = &(other->m_left->m_first);
462  op3 = &(other->m_left->m_last);
463  }
464  if(tp1->isNear(*op0) && tp3->isNear(*op2))return true;//other is same direction to the left
465  if(tp1->isNear(*op3) && tp3->isNear(*op1))return true;//other is opposite direction to the left
466  return false;
467  }
475  bool isNeighborOf(Border* other)
476  {
477  return this->isRightOf(other) || (other!=0 && other->isRightOf(this));
478  }
487  {
488  if(other==nullptr)return false;
489  if(this->m_left==nullptr)return false;
490  if(other->m_left==nullptr)return false;
491  if(other->m_id==*(this->m_left))
492  {
494  }
495  else if(this->m_id==*(other->m_left))
496  {
497  return other->getNeighborDirection()==SAME_DIRECTION;
498  }
499  return false;
500  }
506  {
508  };
509 
518  {
519  if (m_left == 0)
520  {
521  return UNDEFINED_DIRECTION;
522  }
523  else
524  {
525  double dx0 = m_id.m_first.m_X - m_left->m_first.m_X;
526  double dy0 = m_id.m_first.m_Y - m_left->m_first.m_Y;
527  double dx1 = m_id.m_first.m_X - m_left->m_last.m_X;
528  double dy1 = m_id.m_first.m_Y - m_left->m_last.m_Y;
529  if (dx0*dx0 + dy0 * dy0 < dx1*dx1 + dy1 * dy1)
530  {
531  return SAME_DIRECTION;
532  }
533  else
534  {
535  return OPPOSITE_DIRECTION;
536  }
537  }
538  }
539 
551  bool intersectsRegion(double x0, double x1, double y0, double y1)
552  {
553  adoreMatrix<double, 3, 1> xyzmin;
554  adoreMatrix<double, 3, 1> xyzmax;
556  return (
557  (xyzmin(0) >= x0 && xyzmin(0) <= x1)
558  || (xyzmax(0) >= x0 && xyzmax(0) < x1)
559  || (xyzmin(0) <= x0 && xyzmax(0) >= x1)
560  )
561  && (
562  (xyzmin(1) >= y0 && xyzmin(1) <= y1)
563  || (xyzmax(1) >= y0 && xyzmax(1) < y1 )
564  || (xyzmin(1) <= y0 && xyzmax(1) >= y1)
565  );
566  }
579  bool intersectsRegionCombined(Border* neighbor, double x0, double x1, double y0, double y1)
580  {
581  if (neighbor == 0)return false;
582 
583  adoreMatrix<double, 3, 1> xyzmin;
584  adoreMatrix<double, 3, 1> xyzmax;
585  adoreMatrix<double, 3, 1> xyzmin0;
586  adoreMatrix<double, 3, 1> xyzmax0;
587  adoreMatrix<double, 3, 1> xyzmin1;
588  adoreMatrix<double, 3, 1> xyzmax1;
590  ((adore::mad::ALFunction<double, adoreMatrix<double, 3, 1>>*)neighbor->m_path)->bound(xyzmin1, xyzmax1);
591  xyzmin = (adore::mad::min<double, 3, 1>)(xyzmin0, xyzmin1);
592  xyzmax = (adore::mad::max<double, 3, 1>)(xyzmax0, xyzmax1);
593  return ((x0 <= xyzmax(0) && xyzmax(0) <= x1) || (xyzmin(0) <= x1 && x1 <= xyzmax(0)))
594  && ((y0 <= xyzmax(1) && xyzmax(1) <= y1) || (xyzmin(1) <= y1 && y1 <= xyzmax(1)));
595  }
603  boost_box getBoostBox(Border* leftNeighbor)
604  {
605  static const double free_road_height = 2.0;//@TODO load a parameter, which defines, how big the "free-space tunnel" of a road has to be. this has implications for objects passing over bridges and low hanging infrastructure.
606  adoreMatrix<double, 3, 1> xyzmin {0.0,0.0,0.0};
607  adoreMatrix<double, 3, 1> xyzmax {0.0,0.0,0.0};
608  if(m_path==nullptr)
609  {
610  xyzmin(0) = (std::min)(m_id.m_first.m_X,m_id.m_last.m_X);
611  xyzmin(1) = (std::min)(m_id.m_first.m_Y,m_id.m_last.m_Y);
612  xyzmin(2) = (std::min)(m_id.m_first.m_Z,m_id.m_last.m_Z);
613  xyzmax(0) = (std::max)(m_id.m_first.m_X,m_id.m_last.m_X);
614  xyzmax(1) = (std::max)(m_id.m_first.m_Y,m_id.m_last.m_Y);
615  xyzmax(2) = (std::max)(m_id.m_first.m_Z+ free_road_height,m_id.m_last.m_Z+ free_road_height);
616  if(m_left!=nullptr)
617  {
618  xyzmin(0) = (std::min)(xyzmin(0),m_left->m_last.m_X);
619  xyzmin(1) = (std::min)(xyzmin(1),m_left->m_last.m_Y);
620  xyzmin(2) = (std::min)(xyzmin(2),m_left->m_last.m_Z);
621  xyzmax(0) = (std::max)(xyzmax(0),m_left->m_last.m_X);
622  xyzmax(1) = (std::max)(xyzmax(1),m_left->m_last.m_Y);
623  xyzmax(2) = (std::max)(xyzmax(2),m_left->m_last.m_Z+ free_road_height);
624  xyzmin(0) = (std::min)(m_left->m_first.m_X,xyzmin(0));
625  xyzmin(1) = (std::min)(m_left->m_first.m_Y,xyzmin(1));
626  xyzmin(2) = (std::min)(m_left->m_first.m_Z,xyzmin(2));
627  xyzmax(0) = (std::max)(m_left->m_first.m_X,xyzmax(0));
628  xyzmax(1) = (std::max)(m_left->m_first.m_Y,xyzmax(1));
629  xyzmax(2) = (std::max)(m_left->m_first.m_Z+ free_road_height,xyzmax(2));
630  }
631  }
632  else
633  {
635  if (leftNeighbor != 0)
636  {
637  adoreMatrix<double, 3, 1> xyzmin1;
638  adoreMatrix<double, 3, 1> xyzmax1;
639  ((adore::mad::ALFunction<double, adoreMatrix<double, 3, 1>>*)leftNeighbor->m_path)->bound(xyzmin1, xyzmax1);
640  xyzmin = (adore::mad::min<double, 3, 1>)(xyzmin, xyzmin1);
641  xyzmax = (adore::mad::max<double, 3, 1>)(xyzmax, xyzmax1);
642  }
643  }
644  return boost_box(Coordinate::boost_point(xyzmin(0), xyzmin(1), xyzmin(2)),
645  Coordinate::boost_point(xyzmax(0), xyzmax(1), xyzmax(2) + free_road_height));
646  }
656  bool hasBBOverlap(Border* myLeftNeighbor, Border* testBorder, Border* testBorderLeft)
657  {
658  boost_box bb1 = getBoostBox(myLeftNeighbor);
659  boost_box bb2 = testBorder->getBoostBox(testBorderLeft);
660  return adore::mad::overlaps(bb1.min_corner().get<0>(),bb1.max_corner().get<0>(),
661  bb2.min_corner().get<0>(),bb2.max_corner().get<0>())
662  && adore::mad::overlaps(bb1.min_corner().get<1>(),bb1.max_corner().get<1>(),
663  bb2.min_corner().get<1>(),bb2.max_corner().get<1>());
664  }
676  bool intersectionWithOtherBorder(Border* myLeftNeighbor, Border* otherBorder, Border* otherBorderLeft, double& mysmin,double& othersmin)
677  {
678  if(otherBorderLeft==myLeftNeighbor)return false;
679  if(otherBorder==myLeftNeighbor)return false;
680  if(otherBorderLeft==this)return false;
681  if(otherBorderLeft->isSuccessorOf(myLeftNeighbor->m_id) || myLeftNeighbor->isSuccessorOf(otherBorderLeft->m_id))return false;
682  if(otherBorderLeft->isSuccessorOf(this->m_id) || this->isSuccessorOf(otherBorderLeft->m_id))return false;
683 
684  std::pair<double,double> sLL(1e99,1e99),sLR(1e99,1e99),sRL(1e99,1e99),sRR(1e99,1e99);
685  //bool bLL = myLeftNeighbor->m_path->getFirstIntersection2d(otherBorderLeft->m_path,sLL);
686  //bool bLR = myLeftNeighbor->m_path->getFirstIntersection2d(otherBorder->m_path,sLR);
687  bool bRL = this->m_path->getFirstIntersection2d(otherBorderLeft->m_path,sRL);
688  //bool bRR = this->m_path->getFirstIntersection2d(otherBorder->m_path,sRR);
689  if(/*bLL||bLR||*/bRL/*||bRR*/)
690  {
691  mysmin = sRL.first; //adore::mad::min(sLL.first,sLR.first,sRL.first,sRR.first);
692  othersmin = sRL.second; //adore::mad::min(sLL.second,sLR.second,sRL.second,sRR.second);
693  return true;
694  }
695  return false;
696  }
703  double getLength()
704  {
705  if(m_path==nullptr)
706  {
707  return m_id.getLength();
708  }
709  else
710  {
711  return m_path->limitHi() - m_path->limitLo();
712  }
713  }
714 
723  {
724  if(m_path==nullptr)return 1.0;
725  auto d = m_path->f(m_path->limitHi()) - m_path->f(m_path->limitLo());
726  return std::sqrt(d(0)*d(0) + d(1)*d(1) + d(2)*d(2)) / (m_path->limitHi() - m_path->limitLo());
727  }
728 
729 
739  bool isPointInsideLane(Border* left, double x, double y)
740  {
741  if (left == 0)return false;
742  return m_path->isPointEnclosed(left->m_path, x, y, 1, 2, false, getNeighborDirection() == SAME_DIRECTION);
743  }
752  {
753  double dx = next->m_id.m_first.m_X - this->m_id.m_last.m_X;
754  double dy = next->m_id.m_first.m_Y - this->m_id.m_last.m_Y;
755  double dz = next->m_id.m_first.m_Z - this->m_id.m_last.m_Z;
756  return std::sqrt(dx*dx + dy * dy + dz * dz);
757  }
765  {
766  double dx0,dy0,dx1,dy1;
767  if(this->m_path==nullptr)
768  {
769  const double l = getLength();
770  dx0 = (m_id.m_last.m_X - m_id.m_first.m_X)/l;
771  dy0 = (m_id.m_last.m_Y - m_id.m_first.m_Y)/l;
772  }
773  else
774  {
775  dx0 = this->m_path->dfidx(this->m_path->limitHi(), 0);
776  dy0 = this->m_path->dfidx(this->m_path->limitHi(), 1);
777  }
778  if(next->m_path==nullptr)
779  {
780  const double l = next->getLength();
781  dx1 = (next->m_id.m_last.m_X - next->m_id.m_first.m_X)/l;
782  dy1 = (next->m_id.m_last.m_Y - next->m_id.m_first.m_Y)/l;
783  }
784  else
785  {
786  dx1 = next->m_path->dfidx(next->m_path->limitLo(), 0);
787  dy1 = next->m_path->dfidx(next->m_path->limitLo(), 1);
788  }
789 
790 
791  //project next start to this end
792  double rx = dx0 * dx1 + dy0 * dy1; // c s
793  double ry = -dy0 * dx1 + dx0 * dy1; //-s c
794  //return angle in this end coordinates
795  return std::atan2(ry, rx);
796  }
804  {
805  static const double s_distance = 1.0 / 0.5;
806  static const double s_angle = 1.0 / 20.0;
807  double distance = getDistanceToSuccessor(next) * s_distance;
808  double angle = getHeadingChangeAtTransition(next)*180.0 / 3.141592653 * s_angle;
809  return std::sqrt(distance*distance + angle * angle);
810  }
815  {
816  return m_left!=nullptr && m_id.inverse()==*m_left;
817  }
818  };
819  }
820  }
821 }
Definition: alfunction.h:74
virtual CT f(DT x) const override
Definition: llinearpiecewisefunction.h:251
bool getFirstIntersection2d(LLinearPiecewiseFunctionM< T, n > *other, int dim1, int dim2, std::pair< T, T > &result)
Definition: llinearpiecewisefunction.h:664
virtual DT limitLo() const override
Definition: llinearpiecewisefunction.h:264
void rotateXY(double angle, double x0=0.0, double y0=0.0)
Definition: llinearpiecewisefunction.h:376
bool isPointEnclosed(LLinearPiecewiseFunctionM< T, n > *other, T px, T py, int d1, int d2, bool invert_this=false, bool invert_other=true)
Definition: llinearpiecewisefunction.h:1075
virtual T dfidx(DT x, int row)
Definition: llinearpiecewisefunction.h:400
void shiftCodomain(CT dy)
Definition: llinearpiecewisefunction.h:357
adoreMatrix< T, n+1, 0 > & getData()
Definition: llinearpiecewisefunction.h:147
virtual DT limitHi() const override
Definition: llinearpiecewisefunction.h:259
TYPE
This enum holds the different types of borders.
Definition: border.h:37
@ OTHER
Definition: border.h:38
@ EMERGENCY
Definition: border.h:41
@ DRIVING
Definition: border.h:39
@ DRIVING_DELETED
Definition: border.h:40
@ EMERGENCY_DELETED
Definition: border.h:42
@ left
Definition: indicator_hint.h:35
interval< T > atan2(interval< T > y, interval< T > x)
Definition: intervalarithmetic.h:234
adore::mad::LLinearPiecewiseFunctionM< double, 3 > function_type_xyz
Definition: linearfunctiontypedefs.h:22
T min(T a, T b, T c, T d)
Definition: adoremath.h:663
bool overlaps(const T &a0, const T &a1, const T &b0, const T &b1)
Definition: adoremath.h:655
adoreMatrix< T, N, M > max(adoreMatrix< T, N, M > a, const adoreMatrix< T, N, M > &b)
Definition: adoremath.h:686
x0
Definition: adore_set_goal.py:25
x
Definition: adore_set_goal.py:30
y0
Definition: adore_set_goal.py:26
y
Definition: adore_set_goal.py:31
y1
Definition: adore_set_pose.py:29
x1
Definition: adore_set_pose.py:28
Definition: areaofeffectconverter.h:20
This struct identifies a Border by the coordinates of the starting and the end point.
Definition: borderid.h:31
Coordinate m_last
Definition: borderid.h:32
BorderID inverse() const
returns the inverse of this
Definition: borderid.h:97
double getLength()
Definition: borderid.h:66
Coordinate m_first
Definition: borderid.h:32
void translate(double dx, double dy, double dz)
Translate a border.
Definition: borderid.h:42
void rotate(double angle, double x0=0.0, double y0=0.0)
Definition: borderid.h:78
The border struct contains data of the smallest.
Definition: border.h:62
bool intersectsRegionCombined(Border *neighbor, double x0, double x1, double y0, double y1)
Check whether the border and a neighbor, e.g. the line-segment representation, is in the given range.
Definition: border.h:579
Border(const BorderID &myid, const BorderID &leftid, Tborderpath *path)
Construct a new Border object.
Definition: border.h:174
double getStraightness()
Get the straightness of the border.
Definition: border.h:722
Border(const BorderID &myid, const BorderID &leftid, Tborderpath *path, const BorderType::TYPE type)
Construct a new Border object.
Definition: border.h:189
Direction
This enum holds the possible directions of a border.
Definition: border.h:506
@ OPPOSITE_DIRECTION
Definition: border.h:507
@ SAME_DIRECTION
Definition: border.h:507
@ UNDEFINED_DIRECTION
Definition: border.h:507
Tborderpath * m_path
Definition: border.h:70
virtual ~Border()
Destroy the Border object.
Definition: border.h:86
bool isPredecessorOf(const BorderID &successorID)
Check whether border is a direct predecessor of another border.
Definition: border.h:333
bool isDeleted()
Check whether the border is of a "deleted" type.
Definition: border.h:267
double getHeadingChangeAtTransition(Border *next)
Get the heading change at transition of two borders.
Definition: border.h:764
bool isSplitNeighborOf(Border *other)
Check whether the border and its left neighbor start at the same point as the potential split neighbo...
Definition: border.h:401
bool isContinuousPredecessorOf(Border *other)
Check whether the border is a continuous predecessor of another border.
Definition: border.h:363
Direction getNeighborDirection()
Get the direction of the left neighbor.
Definition: border.h:517
bool isLaneChangeNeighborOf(Border *other)
Check whether the border is a lane-change-neighbor of another border.
Definition: border.h:486
boost_box getBoostBox(Border *leftNeighbor)
Get a bounding box for the implicit lane object.
Definition: border.h:603
double getLength()
Get the length of the border.
Definition: border.h:703
BorderType::TYPE m_type
Definition: border.h:71
BorderID m_id
Definition: border.h:68
void translate(double dx, double dy, double dz)
Translate the border.
Definition: border.h:289
bool typeIsChangeable()
Check whether type is Changeable.
Definition: border.h:278
void deleteType()
Change the type of the border to a "deleted"-type.
Definition: border.h:220
bool isContinuousPredecessorOf(Border *other, double maxDistMeter, double maxDistRel)
Check whether the border is a continuous predecessor of another border.
Definition: border.h:380
bool intersectionWithOtherBorder(Border *myLeftNeighbor, Border *otherBorder, Border *otherBorderLeft, double &mysmin, double &othersmin)
Check whether two borders intersect.
Definition: border.h:676
Border()
Construct a new Border object.
Definition: border.h:76
bool hasBBOverlap(Border *myLeftNeighbor, Border *testBorder, Border *testBorderLeft)
Check whether the bounding boxes of two lane objects overlap.
Definition: border.h:656
bool isSuccessorOf(const BorderID &predecessorID)
Check whether border is a direct successors of another border.
Definition: border.h:319
bool isRightOf(Border *other)
Check whether the border is right of another border.
Definition: border.h:428
Border(Tborderpath *path, BorderType::TYPE type)
Construct a new Border object.
Definition: border.h:159
void undeleteType()
Change the type of the border.
Definition: border.h:243
adore::mad::function_type_xyz Tborderpath
L -> X,Y,Z.
Definition: border.h:64
bool intersectsRegion(double x0, double x1, double y0, double y1)
Check whether the border, e.g. the line-segment representation, is in the given range.
Definition: border.h:551
Border(double rx0, double ry0, double rx1, double ry1, double lx0, double ly0, double lx1, double ly1)
Construct a new Border object for unit testing.
Definition: border.h:199
Border(double rx0, double ry0, double rx1, double ry1)
Construct a new Border object for unit testing.
Definition: border.h:209
Border(const Border &clone)
Construct a new Border object.
Definition: border.h:122
bool isMergeNeighborOf(Border *other)
Check whether the border and its left neighbor end at the same point as the potential merge neighbor.
Definition: border.h:415
bool isPointInsideLane(Border *left, double x, double y)
Check whether point is in lane.
Definition: border.h:739
bool isCenterLine()
returns true if border has its own inverse as left neighbor
Definition: border.h:814
bool isContinuousSuccessorOf(Border *parent)
Check whether the border is a continuous successor of another border.
Definition: border.h:348
Border(const BorderID &id, Tborderpath *path)
Construct a new Border object.
Definition: border.h:132
double getDistanceToSuccessor(Border *next)
Get the distance to successor.
Definition: border.h:751
void rotateXY(double angle, double x0=0.0, double y0=0.0)
Definition: border.h:304
void operator=(const Border &clone)
Clone a border.
Definition: border.h:96
boost::geometry::model::box< Coordinate::boost_point > boost_box
bounding box
Definition: border.h:66
double getContinuityRating(Border *next)
Get the continuity rating.
Definition: border.h:803
BorderID * m_left
Definition: border.h:69
bool isNeighborOf(Border *other)
Check whether the border is a neighbor of another border.
Definition: border.h:475
Border(Tborderpath *path)
Construct a new Border object.
Definition: border.h:145
This struct represents 3-dimensional coordines.
Definition: coordinate.h:34
bool isNear(const Coordinate &other) const
Check whether the Coordinate is near to another Coordinate.
Definition: coordinate.h:147
double m_Y
Definition: coordinate.h:35
double m_Z
Definition: coordinate.h:35
double m_X
Definition: coordinate.h:35
boost::geometry::model::point< double, 3, boost::geometry::cs::cartesian > boost_point
Definition: coordinate.h:36