Hurricane VLSI Database


Component.h
1 // ****************************************************************************************************
2 // File: ./hurricane/Component.h
3 // Authors: R. Escassut
4 // Copyright (c) BULL S.A. 2000-2018, All Rights Reserved
5 //
6 // This file is part of Hurricane.
7 //
8 // Hurricane is free software: you can redistribute it and/or modify it under the terms of the GNU
9 // Lesser General Public License as published by the Free Software Foundation, either version 3 of the
10 // License, or (at your option) any later version.
11 //
12 // Hurricane is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
13 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU
14 // General Public License for more details.
15 //
16 // You should have received a copy of the Lesser GNU General Public License along with Hurricane. If
17 // not, see <http://www.gnu.org/licenses/>.
18 // ****************************************************************************************************
19 
20 
21 #ifndef HURRICANE_COMPONENT_H
22 #define HURRICANE_COMPONENT_H
23 
24 #include <set>
25 #include "hurricane/Points.h"
26 #include "hurricane/Go.h"
27 #include "hurricane/Components.h"
28 #include "hurricane/Hook.h"
29 #include "hurricane/Hooks.h"
30 #include "hurricane/Interval.h"
31 
32 
33 namespace Hurricane {
34 
35  class Net;
36  class Rubber;
37  class Layer;
38 
39 
40 // -------------------------------------------------------------------
41 // Class : "Component".
42 
43  class Component : public Go {
44  public:
45  typedef Go Inherit;
46 
47  public:
48  class Points_Contour : public PointHC {
49  public:
50  class Locator : public PointHL {
51  public:
52  Locator ( const Component* );
53  inline Locator ( const Locator& );
54  virtual Point getElement () const;
55  virtual PointHL* getClone () const;
56  virtual bool isValid () const;
57  virtual void progress ();
58  virtual string _getString () const;
59  protected:
60  const Component* _component;
61  size_t _iPoint;
62  };
63  public:
64  inline Points_Contour ( const Component* );
65  inline Points_Contour ( const Points_Contour& );
66  virtual PointHC* getClone () const;
67  virtual PointHL* getLocator () const;
68  virtual string _getString () const;
69  protected:
70  const Component* _component;
71  };
72 
73  public:
74  class BodyHook : public Hook {
75  friend class Component;
76  public:
77  typedef Hook Inherit;
78  public:
79  virtual Component* getComponent () const;
80  virtual bool isMaster () const {return true;};
81  virtual string _getTypeName () const { return "Component::BodyHook"; };
82  virtual string _getString () const;
83  static Hook* _compToHook ( Component* );
84  private:
85  BodyHook ( Component* );
86  };
87 
88  protected:
89  Component ( Net* , bool inPlugCreate = false );
90  public:
91  // Accessors.
92  virtual bool isConvex () const;
93  virtual bool isPolygon45 () const;
94  virtual bool isManhattanized () const;
95  virtual bool isNonRectangle () const;
96  virtual Cell* getCell () const;
97  Net* getNet () const { return _net; };
98  Rubber* getRubber () const { return _rubber; };
99  Hook* getBodyHook () { return &_bodyHook; };
100  virtual Hooks getHooks () const;
101  virtual DbU::Unit getX () const = 0;
102  virtual DbU::Unit getY () const = 0;
103  virtual Point getPosition () const { return Point( getX(), getY() ); };
104  virtual Point getCenter () const { return getPosition(); };
105  virtual const Layer* getLayer () const = 0;
106  virtual size_t getPointsSize () const;
107  virtual Point getPoint ( size_t ) const;
108  virtual Box getBoundingBox () const = 0;
109  virtual Box getBoundingBox ( const BasicLayer* ) const = 0;
110  inline Points getContour () const;
111  virtual Points getMContour () const;
114  // Mutators.
115  virtual void materialize ();
116  virtual void unmaterialize ();
117  virtual void invalidate ( bool propagateFlag = true );
118  virtual void forceId ( unsigned int id );
119  // Filters
120  static ComponentFilter getIsUnderFilter ( const Box& area );
121  // Others
122  protected:
123  virtual void _postCreate ();
124  virtual void _preDestroy ();
125  public:
126  virtual void _toJson ( JsonWriter* ) const;
127  virtual void _toJsonSignature ( JsonWriter* ) const;
128  virtual string _getString () const;
129  virtual Record* _getRecord () const;
130  Component* _getNextOfNetComponentSet () const {return _nextOfNetComponentSet;};
131  void _setNet ( Net* );
132  void _setRubber ( Rubber* );
133  void _setNextOfNetComponentSet ( Component* component ) { _nextOfNetComponentSet = component; };
134  private:
135  Net* _net;
136  Rubber* _rubber;
137  BodyHook _bodyHook;
138  Component* _nextOfNetComponentSet;
139  };
140 
141 
142  inline Points Component::getContour () const { return Points_Contour(this); }
143 
144 
145  inline Component::Points_Contour::Locator::Locator ( const Locator &locator )
146  : PointHL ()
147  , _component(locator._component)
148  , _iPoint (locator._iPoint)
149  { }
150 
151 
152  inline Component::Points_Contour::Points_Contour ( const Component* component )
153  : PointHC ()
154  , _component(component)
155  { }
156 
157 
158  inline Component::Points_Contour::Points_Contour ( const Points_Contour& other )
159  : PointHC ()
160  , _component(other._component)
161  { }
162 
163 
164  double getArea ( Component* component );
165 
166 
167 // -------------------------------------------------------------------
168 // Class : "JsonComponent".
169 
170  class JsonComponent : public JsonEntity {
171  public:
172  JsonComponent ( unsigned long flags );
173  };
174 
175 
176  typedef std::set<Component*,DBo::CompareById> ComponentSet;
177 
178 
179 } // Hurricane namespace.
180 
181 
182 INSPECTOR_P_SUPPORT(Hurricane::Component);
183 INSPECTOR_P_SUPPORT(Hurricane::Component::BodyHook);
184 
185 
186 #endif // HURRICANE_COMPONENT_H
187 
188 // ****************************************************************************************************
189 // Copyright (c) BULL S.A. 2000-2018, All Rights Reserved
190 // ****************************************************************************************************
BasicLayer description (API)
Definition: BasicLayer.h:42
Box description (API)
Definition: Box.h:29
The model (API).
Definition: Cell.h:64
Collection description (API)
Definition: Collection.h:39
Definition: Component.h:74
Component description (API)
Definition: Component.h:43
virtual DbU::Unit getX() const =0
Net * getNet() const
Definition: Component.h:97
Hook * getBodyHook()
Definition: Component.h:99
virtual Hooks getHooks() const
Go Inherit
Definition: Component.h:45
Components getConnexComponents() const
virtual DbU::Unit getY() const =0
static ComponentFilter getIsUnderFilter(const Box &area)
virtual Point getPosition() const
Definition: Component.h:103
virtual Box getBoundingBox(const BasicLayer *) const =0
virtual const Layer * getLayer() const =0
Rubber * getRubber() const
Definition: Component.h:98
Components getSlaveComponents() const
std::int64_t Unit
Definition: DbU.h:67
Generic Collection auto-pointer.
Definition: Collection.h:235
Generic Filter auto-pointer.
Definition: Filter.h:86
Go description (API)
Definition: Go.h:34
Hook description (API)
Definition: Hook.h:34
Layer description (API)
Definition: Layer.h:50
Locator description (API)
Definition: Locator.h:33
Net description (API)
Definition: Net.h:46
Point description (API)
Definition: Point.h:30
Rubber description (API)
Definition: Rubber.h:36
Contains Almost Everything.
Definition: BasicLayer.h:39


Generated by doxygen 1.9.1 on Wed Nov 20 2024 Return to top of page
Hurricane VLSI Database Copyright © 2000-2020 Bull S.A. All rights reserved