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