SUMO - Simulation of Urban MObility
NIVissimBoundedClusterObject.cpp
Go to the documentation of this file.
1 /****************************************************************************/
7 // -------------------
8 /****************************************************************************/
9 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
10 // Copyright (C) 2001-2017 DLR (http://www.dlr.de/) and contributors
11 /****************************************************************************/
12 //
13 // This file is part of SUMO.
14 // SUMO is free software: you can redistribute it and/or modify
15 // it under the terms of the GNU General Public License as published by
16 // the Free Software Foundation, either version 3 of the License, or
17 // (at your option) any later version.
18 //
19 /****************************************************************************/
20 
21 
22 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 #ifdef _MSC_VER
26 #include <windows_config.h>
27 #else
28 #include <config.h>
29 #endif
30 
31 
32 #include <cassert>
33 #include <utils/geom/Boundary.h>
35 
37 
39  : myBoundary(0), myClusterID(-1) {
40  myDict.insert(this);
41 }
42 
43 
45  delete myBoundary;
46 }
47 
48 
49 bool
51  double offset) const {
52  assert(myBoundary != 0 && myBoundary->xmax() >= myBoundary->xmin());
53  return myBoundary->overlapsWith(poly, offset);
54 }
55 
56 
57 void
59  myClusterID = id;
60 }
61 
62 
63 bool
65  return myClusterID > 0;
66 }
67 
68 
69 void
71  for (ContType::iterator i = myDict.begin(); i != myDict.end(); i++) {
72  (*i)->computeBounding();
73  }
74 }
75 
76 
77 const Boundary&
79  return *myBoundary;
80 }
81 
82 
83 
84 /****************************************************************************/
85 
double xmax() const
Returns maximum x-coordinate.
Definition: Boundary.cpp:132
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:189
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:48
double xmin() const
Returns minimum x-coordinate.
Definition: Boundary.cpp:126
std::set< NIVissimBoundedClusterObject * > ContType