|
degate 0.1.1
|
00001 /* -*-c++-*- 00002 00003 This file is part of the IC reverse engineering tool degate. 00004 00005 Copyright 2008, 2009, 2010 by Martin Schobert 00006 00007 Degate is free software: you can redistribute it and/or modify 00008 it under the terms of the GNU General Public License as published by 00009 the Free Software Foundation, either version 3 of the License, or 00010 any later version. 00011 00012 Degate is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 GNU General Public License for more details. 00016 00017 You should have received a copy of the GNU General Public License 00018 along with degate. If not, see <http://www.gnu.org/licenses/>. 00019 00020 */ 00021 00022 #ifndef __CIRCLE_H__ 00023 #define __CIRCLE_H__ 00024 00025 #include "Shape.h" 00026 #include "BoundingBox.h" 00027 00028 namespace degate { 00029 00030 class Circle : public AbstractShape { 00031 00032 private: 00033 int x, y; 00034 unsigned int diameter; 00035 00036 BoundingBox bounding_box; 00037 00038 void calculate_bounding_box(); 00039 00040 public: 00041 00042 Circle(); 00043 Circle(int x, int y, unsigned int diameter); 00044 00045 virtual ~Circle() {} 00046 00047 virtual bool in_shape(int x, int y, int max_distance = 0) const; 00048 00049 virtual bool in_bounding_box(BoundingBox const& bbox) const; 00050 virtual BoundingBox const& get_bounding_box() const; 00051 00052 virtual bool operator==(const Circle& other) const; 00053 virtual bool operator!=(const Circle& other) const; 00054 00055 virtual int get_x() const; 00056 virtual int get_y() const; 00057 virtual unsigned int get_diameter() const; 00058 00059 virtual void set_x(int x); 00060 virtual void set_y(int y); 00061 virtual void set_diameter(unsigned int diameter); 00062 00063 virtual void shift_x(int delta_x); 00064 virtual void shift_y(int delta_y); 00065 00066 }; 00067 00068 } 00069 00070 #endif
1.7.4