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
33namespace Hurricane {
34
35 class Net;
36 class Rubber;
37 class Layer;
38
39
40// -------------------------------------------------------------------
41// Class : "Component".
42
43 class Component : public Go {
44 private:
45 static FastRTTI _fastRTTI;
46 public:
47 static inline const FastRTTI& fastRTTI ();
48 virtual const FastRTTI& vfastRTTI () const;
49 public:
50 typedef Go Inherit;
51
52 public:
53 class Points_Contour : public PointHC {
54 public:
55 class Locator : public PointHL {
56 public:
57 Locator ( const Component* );
58 inline Locator ( const Locator& );
59 virtual Point getElement () const;
60 virtual PointHL* getClone () const;
61 virtual bool isValid () const;
62 virtual void progress ();
63 virtual string _getString () const;
64 protected:
65 const Component* _component;
66 size_t _iPoint;
67 };
68 public:
69 inline Points_Contour ( const Component* );
70 inline Points_Contour ( const Points_Contour& );
71 virtual PointHC* getClone () const;
72 virtual PointHL* getLocator () const;
73 virtual string _getString () const;
74 protected:
75 const Component* _component;
76 };
77
78 public:
79 class BodyHook : public Hook {
80 friend class Component;
81 public:
82 typedef Hook Inherit;
83 public:
84 virtual Component* getComponent () const;
85 virtual bool isMaster () const {return true;};
86 virtual string _getTypeName () const { return "Component::BodyHook"; };
87 virtual string _getString () const;
88 static Hook* _compToHook ( Component* );
89 private:
90 BodyHook ( Component* );
91 };
92
93 protected:
94 Component ( Net* , bool inPlugCreate = false );
95 public:
96 // Accessors.
97 virtual bool isConvex () const;
98 virtual bool isPolygon45 () const;
99 virtual bool isManhattanized () const;
100 virtual bool isNonRectangle () const;
101 virtual Cell* getCell () const;
102 Net* getNet () const { return _net; };
103 Rubber* getRubber () const { return _rubber; };
104 Hook* getBodyHook () { return &_bodyHook; };
105 virtual Hooks getHooks () const;
106 virtual DbU::Unit getX () const = 0;
107 virtual DbU::Unit getY () const = 0;
108 virtual Point getPosition () const { return Point( getX(), getY() ); };
109 virtual Point getCenter () const { return getPosition(); };
110 virtual const Layer* getLayer () const = 0;
111 virtual size_t getPointsSize () const;
112 virtual Point getPoint ( size_t ) const;
113 virtual Box getBoundingBox () const = 0;
114 virtual Box getBoundingBox ( const BasicLayer* ) const = 0;
115 inline Points getContour () const;
116 virtual Points getMContour () const;
119 // Mutators.
120 virtual void materialize ();
121 virtual void unmaterialize ();
122 virtual void invalidate ( bool propagateFlag = true );
123 virtual void forceId ( unsigned int id );
124 // Filters
125 static ComponentFilter getIsUnderFilter ( const Box& area );
126 // Others
127 protected:
128 virtual void _postCreate ();
129 virtual void _preDestroy ();
130 public:
131 virtual void _toJson ( JsonWriter* ) const;
132 virtual void _toJsonSignature ( JsonWriter* ) const;
133 virtual string _getString () const;
134 virtual Record* _getRecord () const;
135 Component* _getNextOfNetComponentSet () const {return _nextOfNetComponentSet;};
136 void _setNet ( Net* );
137 void _setRubber ( Rubber* );
138 void _setNextOfNetComponentSet ( Component* component ) { _nextOfNetComponentSet = component; };
139 private:
140 Net* _net;
141 Rubber* _rubber;
142 BodyHook _bodyHook;
143 Component* _nextOfNetComponentSet;
144 };
145
146
147 inline const FastRTTI& Component::fastRTTI () { return _fastRTTI; }
148
149
150 inline Points Component::getContour () const { return Points_Contour(this); }
151
152
153 inline Component::Points_Contour::Locator::Locator ( const Locator &locator )
154 : PointHL ()
155 , _component(locator._component)
156 , _iPoint (locator._iPoint)
157 { }
158
159
160 inline Component::Points_Contour::Points_Contour ( const Component* component )
161 : PointHC ()
162 , _component(component)
163 { }
164
165
166 inline Component::Points_Contour::Points_Contour ( const Points_Contour& other )
167 : PointHC ()
168 , _component(other._component)
169 { }
170
171
172 double getArea ( Component* component );
173
174
175// -------------------------------------------------------------------
176// Class : "JsonComponent".
177
178 class JsonComponent : public JsonEntity {
179 public:
180 JsonComponent ( unsigned long flags );
181 };
182
183
184 typedef std::set<Component*,DBo::CompareById> ComponentSet;
185
186
187} // Hurricane namespace.
188
189
190INSPECTOR_P_SUPPORT(Hurricane::Component);
191INSPECTOR_P_SUPPORT(Hurricane::Component::BodyHook);
192
193
194#endif // HURRICANE_COMPONENT_H
195
196// ****************************************************************************************************
197// Copyright (c) BULL S.A. 2000-2018, All Rights Reserved
198// ****************************************************************************************************
BasicLayer description (API).
Definition BasicLayer.h:42
Box description (API).
Definition Box.h:30
The model (API).
Definition Cell.h:64
virtual Collection< Point > * getClone() const=0
virtual Locator< Point > * getLocator() const=0
Definition Component.h:79
Component description (API).
Definition Component.h:43
Net * getNet() const
Definition Component.h:102
Hook * getBodyHook()
Definition Component.h:104
virtual DbU::Unit getX() const =0
Components getConnexComponents() const
virtual DbU::Unit getY() const =0
Go Inherit
Definition Component.h:50
virtual Hooks getHooks() const
virtual Point getPosition() const
Definition Component.h:108
virtual const Layer * getLayer() const =0
virtual Box getBoundingBox(const BasicLayer *) const =0
Rubber * getRubber() const
Definition Component.h:103
static ComponentFilter getIsUnderFilter(const Box &area)
Components getSlaveComponents() const
std::int64_t Unit
Definition DbU.h:67
virtual Box getBoundingBox() const =0
virtual Cell * getCell() const =0
virtual void materialize()=0
virtual void unmaterialize()=0
Hook description (API).
Definition Hook.h:34
virtual Component * getComponent() const =0
virtual bool isMaster() const =0
Layer description (API).
Definition Layer.h:120
Locator description (API).
Definition Locator.h:33
virtual Point getElement() const=0
virtual bool isValid() const=0
virtual void progress()=0
virtual Locator< Point > * getClone() const=0
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
GenericFilter< Component * > ComponentFilter
Definition Components.h:51
GenericCollection< Hook * > Hooks
Definition Hooks.h:35
GenericCollection< Component * > Components
Definition Components.h:35


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