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-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 /****************************************************************************/
18 // The base class for polygons
19 /****************************************************************************/
20 #ifndef AbstractPoly_h
21 #define AbstractPoly_h
22 
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #ifdef _MSC_VER
28 #include <windows_config.h>
29 #else
30 #include <config.h>
31 #endif
32 
33 #include "Position.h"
34 
35 
36 // ===========================================================================
37 // class definitions
38 // ===========================================================================
42 class AbstractPoly {
43 public:
46  virtual ~AbstractPoly() { }
47  virtual bool around(const Position& p, double offset = 0) const = 0;
48  virtual bool overlapsWith(const AbstractPoly& poly, double offset = 0) const = 0;
49  virtual bool partialWithin(const AbstractPoly& poly, double offset = 0) const = 0;
50  virtual bool crosses(const Position& p1,
51  const Position& p2) const = 0;
52 };
53 
54 
55 #endif
56 
57 /****************************************************************************/
58 
virtual bool partialWithin(const AbstractPoly &poly, double offset=0) const =0
virtual bool crosses(const Position &p1, const Position &p2) const =0
virtual ~AbstractPoly()
Definition: AbstractPoly.h:46
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:45
virtual bool overlapsWith(const AbstractPoly &poly, double offset=0) const =0
virtual bool around(const Position &p, double offset=0) const =0
AbstractPoly(const AbstractPoly &)
Definition: AbstractPoly.h:45