degate  0.1.2
Wire.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 __WIRE_H__
00024 #define __WIRE_H__
00025 
00026 #include <memory>
00027 
00028 #include <globals.h>
00029 #include <LogicModelObjectBase.h>
00030 #include <ConnectedLogicModelObject.h>
00031 #include <Line.h>
00032 #include <RemoteObject.h>
00033 
00034 namespace degate {
00035 
00036   /**
00037    * Represents a wire.
00038    */
00039   class Wire : public Line, public ConnectedLogicModelObject, public RemoteObject {
00040 
00041   public:
00042 
00043     /**
00044      * The constructor for a wire object.
00045      */
00046     Wire(int _from_x, int _from_y, int _to_x, int _to_y, diameter_t _diameter);
00047 
00048     /**
00049      * Destructor for a wire object.
00050      */
00051     virtual ~Wire() {}
00052 
00053     //@{
00054     DeepCopyable_shptr cloneShallow() const;
00055     void cloneDeepInto(DeepCopyable_shptr destination, oldnew_t *oldnew) const;
00056     //@}
00057     
00058     /**
00059      * Get a human readable string that describes the whole
00060      * logic model object. The string should be unique in order
00061      * to let the user identify the concrete object. But that
00062      * is not a must.
00063      */
00064 
00065     virtual const std::string get_descriptive_identifier() const;
00066 
00067     /**
00068      * Get a human readable string that names the object type.
00069      * Here it is "Wire".
00070      */
00071 
00072     virtual const std::string get_object_type_name() const;
00073 
00074     /**
00075      * Print wire.
00076      */
00077     void print(std::ostream & os = std::cout, int n_tabs = 0) const;
00078 
00079 
00080 
00081 
00082 
00083     void shift_x(int delta_x) {
00084       Line::shift_x(delta_x);
00085       notify_shape_change();
00086     }
00087 
00088     void shift_y(int delta_y) {
00089       Line::shift_y(delta_y);
00090       notify_shape_change();
00091     }
00092 
00093     virtual bool in_bounding_box(BoundingBox const& bbox) const {
00094       return in_bounding_box(bbox);
00095     }
00096 
00097     virtual BoundingBox const& get_bounding_box() const {
00098       return Line::get_bounding_box();
00099     }
00100 
00101     virtual bool in_shape(int x, int y, int max_distance = 0) const {
00102       return Line::in_shape(x, y, max_distance);
00103     }
00104 
00105   protected:
00106 
00107     virtual object_id_t push_object_to_server(std::string const& server_url);
00108 
00109   };
00110 
00111 
00112 }
00113 
00114 #endif