tmxparser  2.1.0
 All Classes Functions Variables Pages
TmxEllipse.h
1 //-----------------------------------------------------------------------------
2 // TmxPolygon.h
3 //
4 // Copyright (c) 2010-2014, Tamir Atias
5 // All rights reserved.
6 //
7 // Redistribution and use in source and binary forms, with or without
8 // modification, are permitted provided that the following conditions are met:
9 // * Redistributions of source code must retain the above copyright
10 // notice, this list of conditions and the following disclaimer.
11 // * Redistributions in binary form must reproduce the above copyright
12 // notice, this list of conditions and the following disclaimer in the
13 // documentation and/or other materials provided with the distribution.
14 //
15 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
16 // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17 // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18 // DISCLAIMED. IN NO EVENT SHALL TAMIR ATIAS BE LIABLE FOR ANY
19 // DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20 // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21 // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22 // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 //
26 // Author: Tamir Atias
27 //-----------------------------------------------------------------------------
28 #pragma once
29 
30 #include <vector>
31 
32 #include "TmxPoint.h"
33 
34 namespace Tmx
35 {
36  //-------------------------------------------------------------------------
38  //-------------------------------------------------------------------------
39  class Ellipse
40  {
41  public:
43  Ellipse( int x, int y, int width, int height );
44 
46  int GetCenterX() const { return x; }
47 
49  int GetCenterY() const { return y; }
50 
52  int GetRadiusX() const { return radiusX; }
53 
55  int GetRadiusY() const { return radiusY; }
56 
57  private:
58  int x;
59  int y;
60  int radiusX;
61  int radiusY;
62  };
63 }
int GetCenterY() const
Get the center of the object, in pixels.
Definition: TmxEllipse.h:49
Class to store an Ellipse of an Object.
Definition: TmxEllipse.h:39
int GetRadiusY() const
Get the RadiusY of the object, in pixels.
Definition: TmxEllipse.h:55
Ellipse(int x, int y, int width, int height)
Construct an ellipse at the given top left position with the given size.
Definition: TmxEllipse.cpp:32
int GetCenterX() const
Get the center of the object, in pixels.
Definition: TmxEllipse.h:46
int GetRadiusX() const
Get the RadiusX of the object, in pixels.
Definition: TmxEllipse.h:52