SUMO - Simulation of Urban MObility
NIVissimBoundedClusterObject.cpp
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2018 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
15 // -------------------
16 /****************************************************************************/
17 
18 
19 // ===========================================================================
20 // included modules
21 // ===========================================================================
22 #include <config.h>
23 
24 
25 #include <cassert>
26 #include <utils/geom/Boundary.h>
28 
30 
32  : myBoundary(nullptr), myClusterID(-1) {
33  myDict.insert(this);
34 }
35 
36 
38  delete myBoundary;
39 }
40 
41 
42 bool
44  double offset) const {
45  assert(myBoundary != 0 && myBoundary->xmax() >= myBoundary->xmin());
46  return myBoundary->overlapsWith(poly, offset);
47 }
48 
49 
50 void
52  myClusterID = id;
53 }
54 
55 
56 bool
58  return myClusterID > 0;
59 }
60 
61 
62 void
64  for (ContType::iterator i = myDict.begin(); i != myDict.end(); i++) {
65  (*i)->computeBounding();
66  }
67 }
68 
69 
70 const Boundary&
72  return *myBoundary;
73 }
74 
75 
76 
77 /****************************************************************************/
78 
double xmax() const
Returns maximum x-coordinate.
Definition: Boundary.cpp:125
bool crosses(const AbstractPoly &poly, double offset=0) const
bool overlapsWith(const AbstractPoly &poly, double offset=0) const
Returns whether the boundary overlaps with the given polygon.
Definition: Boundary.cpp:182
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:42
double xmin() const
Returns minimum x-coordinate.
Definition: Boundary.cpp:119
std::set< NIVissimBoundedClusterObject * > ContType