SUMO - Simulation of Urban MObility
AbstractPoly.h
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 /****************************************************************************/
16 // The base class for polygons
17 /****************************************************************************/
18 #ifndef AbstractPoly_h
19 #define AbstractPoly_h
20 
21 
22 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 #include <config.h>
26 
27 #include "Position.h"
28 
29 
30 // ===========================================================================
31 // class definitions
32 // ===========================================================================
36 class AbstractPoly {
37 public:
40 
43 
45  virtual ~AbstractPoly() { }
46 
48  virtual bool around(const Position& p, double offset = 0) const = 0;
49 
51  virtual bool overlapsWith(const AbstractPoly& poly, double offset = 0) const = 0;
52 
54  virtual bool partialWithin(const AbstractPoly& poly, double offset = 0) const = 0;
55 
57  virtual bool crosses(const Position& p1, const Position& p2) const = 0;
58 };
59 
60 
61 #endif
62 
63 /****************************************************************************/
64 
virtual bool partialWithin(const AbstractPoly &poly, double offset=0) const =0
Returns whether the AbstractPoly is partially within the given polygon.
virtual bool crosses(const Position &p1, const Position &p2) const =0
Returns whether the AbstractPoly crosses the given line.
AbstractPoly()
constructor
Definition: AbstractPoly.h:39
virtual ~AbstractPoly()
destructor
Definition: AbstractPoly.h:45
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:39
virtual bool overlapsWith(const AbstractPoly &poly, double offset=0) const =0
Returns whether the AbstractPoly overlaps with the given polygon.
virtual bool around(const Position &p, double offset=0) const =0
Returns whether the AbstractPoly the given coordinate.
AbstractPoly(const AbstractPoly &)
copy constructor
Definition: AbstractPoly.h:42