degate 0.1.1
PlacedLogicModelObject.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 
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 __PLACEDLOGICMODELOBJECT_H__
00023 #define __PLACEDLOGICMODELOBJECT_H__
00024 
00025 #include <globals.h>
00026 #include <LogicModelObjectBase.h>
00027 #include <Layer.h>
00028 #include <Shape.h>
00029 
00030 namespace degate {
00031 
00032   /**
00033    * Represents a placeable object.
00034    *
00035    * Any class that represents a somewhere placeable objects should inherit
00036    * from that base class. The term "placed objects" is related to real
00037    * existent physical structures on the chip surface
00038    * (e.g. wire, vias, ...) as well as logical objects (e.g. annotations).
00039    */
00040 
00041   class PlacedLogicModelObject : public AbstractShape,
00042                                  public LogicModelObjectBase,
00043                                  public ColoredObject {
00044 
00045   public:
00046 
00047     enum HIGHLIGHTING_STATE {
00048       HLIGHTSTATE_NOT = 0,
00049       HLIGHTSTATE_DIRECT = 1,
00050       HLIGHTSTATE_ADJACENT = 2
00051     };
00052 
00053   private:
00054 
00055     HIGHLIGHTING_STATE highlight_state;
00056     std::tr1::shared_ptr<Layer> layer;
00057 
00058   protected:
00059 
00060     /**
00061      * Ajust the position in the quadtree.
00062      */
00063 
00064     void notify_shape_change();
00065 
00066   public:
00067 
00068     /**
00069      * The constructor.
00070      */
00071 
00072     PlacedLogicModelObject();
00073 
00074     /**
00075      * The destructor.
00076      */
00077 
00078     virtual ~PlacedLogicModelObject();
00079 
00080     /**
00081      * A placed object is highlightable. You can ask for its
00082      * state with this method.
00083      */
00084 
00085     virtual HIGHLIGHTING_STATE get_highlighted() const;
00086 
00087     /**
00088      * Check if an object is highlighted at all.
00089      */
00090     virtual bool is_highlighted() const;
00091 
00092     /**
00093      * Set the selection state.
00094      */
00095 
00096     virtual void set_highlighted(HIGHLIGHTING_STATE state);
00097 
00098     /**
00099      * Set the layer on which the object is placed.
00100      */
00101 
00102     virtual void set_layer(std::tr1::shared_ptr<Layer> layer);
00103 
00104     /**
00105      * Get the layer on which the object is placed.
00106      */
00107 
00108     virtual std::tr1::shared_ptr<Layer> get_layer();
00109 
00110 
00111     /**
00112      * Print the object.
00113      */
00114 
00115     virtual void print(std::ostream & os = std::cout, int n_tabs = 0) const = 0;
00116 
00117   };
00118 
00119 }
00120 
00121 #endif