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-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
17 // -------------------
18 /****************************************************************************/
19 
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 #ifdef _MSC_VER
25 #include <windows_config.h>
26 #else
27 #include <config.h>
28 #endif
29 
30 
31 #include <cassert>
32 #include <utils/geom/Boundary.h>
34 
36 
38  : myBoundary(0), myClusterID(-1) {
39  myDict.insert(this);
40 }
41 
42 
44  delete myBoundary;
45 }
46 
47 
48 bool
50  double offset) const {
51  assert(myBoundary != 0 && myBoundary->xmax() >= myBoundary->xmin());
52  return myBoundary->overlapsWith(poly, offset);
53 }
54 
55 
56 void
58  myClusterID = id;
59 }
60 
61 
62 bool
64  return myClusterID > 0;
65 }
66 
67 
68 void
70  for (ContType::iterator i = myDict.begin(); i != myDict.end(); i++) {
71  (*i)->computeBounding();
72  }
73 }
74 
75 
76 const Boundary&
78  return *myBoundary;
79 }
80 
81 
82 
83 /****************************************************************************/
84 
double xmax() const
Returns maximum x-coordinate.
Definition: Boundary.cpp:131
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:188
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:47
double xmin() const
Returns minimum x-coordinate.
Definition: Boundary.cpp:125
std::set< NIVissimBoundedClusterObject * > ContType