# Hurricane VLSI Database

Contact.h
1 // ****************************************************************************************************
2 // File: ./hurricane/Contact.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 #ifndef HURRICANE_CONTACT
21 #define HURRICANE_CONTACT
22
23 #include "hurricane/Component.h"
24 #include "hurricane/Contacts.h"
25
26 namespace Hurricane {
27
28
29 // ****************************************************************************************************
30 // Contact declaration
31 // ****************************************************************************************************
32
33 class Contact : public Component {
34 // *****************************
35
36 // Types
37 // *****
38
39 public: typedef Component Inherit;
40
41 public: class AnchorHook : public Hook {
42 // ***********************************
43
44 friend class Contact;
45
46 public: typedef Hook Inherit;
47
48 private: AnchorHook(Contact* contact);
49
50 public: virtual Component* getComponent() const;
51
52 public: virtual bool isMaster() const {return false;};
53
54 public: virtual string _getTypeName() const { return "Contact::AnchorHook"; };
55 public: virtual string _getString() const;
56 public: static Hook* _compToHook(Component*);
57 };
58
59 // Attributes
60 // **********
61
62 private: AnchorHook _anchorHook;
63 private: const Layer* _layer;
64 private: DbU::Unit _dx;
65 private: DbU::Unit _dy;
66 protected: DbU::Unit _width;
67 protected: DbU::Unit _height;
68
69 // Constructors
70 // ************
71
72 protected: Contact( Net* net
73 , const Layer* layer
74 , const DbU::Unit& x
75 , const DbU::Unit& y
76 , const DbU::Unit& width = 0
77 , const DbU::Unit& height = 0
78 );
79 protected: Contact( Net* net
80 , Component* anchor
81 , const Layer* layer
82 , const DbU::Unit& dx
83 , const DbU::Unit& dy
84 , const DbU::Unit& width = 0
85 , const DbU::Unit& height = 0
86 );
87
88 public: static Contact* create( Net* net
89 , const Layer* layer
90 , const DbU::Unit& x
91 , const DbU::Unit& y
92 , const DbU::Unit& width = 0
93 , const DbU::Unit& height = 0
94 );
95 public: static Contact* create( Component* anchor
96 , const Layer* layer
97 , const DbU::Unit& dx
98 , const DbU::Unit& dy
99 , const DbU::Unit& width = 0
100 , const DbU::Unit& height = 0
101 );
102
103 // Accessors
104 // *********
105
106 public: virtual Hooks getHooks() const;
107 public: virtual DbU::Unit getX() const;
108 public: virtual DbU::Unit getY() const;
109 public: virtual Point getPosition() const;
110 public: virtual Box getBoundingBox() const;
111 public: virtual const Layer* getLayer() const {return _layer;};
112 public: virtual Box getBoundingBox(const BasicLayer* basicLayer) const;
113 public: Hook* getAnchorHook() {return &_anchorHook;};
114 public: Component* getAnchor() const;
115 public: const DbU::Unit& getDx() const {return _dx;};
116 public: const DbU::Unit& getDy() const {return _dy;};
117 public: const DbU::Unit& getWidth() const {return _width;};
118 public: DbU::Unit getHalfWidth() const {return (_width / 2);};
119 public: const DbU::Unit& getHeight() const {return _height;};
120 public: DbU::Unit getHalfHeight() const {return (_height / 2);};
121
122 // Updators
123 // ********
124
125 public: virtual void translate(const DbU::Unit& dx, const DbU::Unit& dy);
126
127 public: void setLayer(const Layer* layer);
128 public: void setWidth(const DbU::Unit& width);
129 public: void setHeight(const DbU::Unit& height);
130 public: void setSizes(const DbU::Unit& width, const DbU::Unit& height);
131 public: void setX(const DbU::Unit& x);
132 public: void setY(const DbU::Unit& y);
133 public: void setPosition(const DbU::Unit& x, const DbU::Unit& y);
134 public: void setPosition(const Point& position);
135 public: void setDx(const DbU::Unit& dx);
136 public: void setDy(const DbU::Unit& dy);
137 public: void setOffset(const DbU::Unit& dx, const DbU::Unit& dy);
138
139 // Others
140 // ******
141
142 protected: virtual void _preDestroy();
143
144 public: virtual void _toJson(JsonWriter*) const;
145 public: virtual string _getTypeName() const {return _TName("Contact");};
146 public: virtual string _getString() const;
147 public: virtual Record* _getRecord() const;
148
149 };
150
151
152 class JsonContact : public JsonComponent {
153 // ***************************************
154
155 public: static void initialize();
156 public: JsonContact(unsigned long flags);
157 public: virtual string getTypeName() const;
158 public: virtual JsonContact* clone(unsigned long) const;
159 public: virtual void toData(JsonStack&);
160 };
161
162 } // End of Hurricane namespace.
163
164
165 INSPECTOR_P_SUPPORT(Hurricane::Contact);
166 INSPECTOR_P_SUPPORT(Hurricane::Contact::AnchorHook);
167
168
169 #endif // HURRICANE_CONTACT
170
171
172 // ****************************************************************************************************
173 // Copyright (c) BULL S.A. 2000-2018, All Rights Reserved
174 // ****************************************************************************************************
Hurricane::Contact::getHalfWidth
DbU::Unit getHalfWidth() const
Definition: Contact.h:118
Hurricane::Contact::setX
void setX(const DbU::Unit &x)
Hurricane::BasicLayer
BasicLayer description (API)
Definition: BasicLayer.h:44
Hurricane::Component
Component description (API)
Definition: Component.h:42
Hurricane::Contact::setDx
void setDx(const DbU::Unit &dx)
Hurricane::Contact
Contact description (API)
Definition: Contact.h:33
Hurricane::DbU::Unit
std::int64_t Unit
Definition: DbU.h:70
Hurricane::Contact::setWidth
void setWidth(const DbU::Unit &width)
Hurricane::Contact::setOffset
void setOffset(const DbU::Unit &dx, const DbU::Unit &dy)
Hurricane::Contact::AnchorHook
Definition: Contact.h:41
Hurricane::Point
Point description (API)
Definition: Point.h:32
Hurricane::Contact::setY
void setY(const DbU::Unit &y)
Hurricane::Contact::getHalfHeight
DbU::Unit getHalfHeight() const
Definition: Contact.h:120
Hurricane::Contact::setSizes
void setSizes(const DbU::Unit &width, const DbU::Unit &height)
Hurricane::Contact::getAnchor
Component * getAnchor() const
Hurricane::GenericCollection
Generic Collection auto-pointer.
Definition: Collection.h:28
Hurricane::Hook
Hook description (API)
Definition: Hook.h:36
Hurricane::Contact::getWidth
const DbU::Unit & getWidth() const
Definition: Contact.h:117
Hurricane::Contact::getAnchorHook
Hook * getAnchorHook()
Definition: Contact.h:113
Hurricane::Box
Box description (API)
Definition: Box.h:31
Hurricane::Contact::create
static Contact * create(Net *net, const Layer *layer, const DbU::Unit &x, const DbU::Unit &y, const DbU::Unit &width=0, const DbU::Unit &height=0)
Hurricane::Layer
Layer description (API)
Definition: Layer.h:52
Hurricane::Contact::setDy
void setDy(const DbU::Unit &dy)
Hurricane::Contact::getDy
const DbU::Unit & getDy() const
Definition: Contact.h:116
Hurricane
The namespace dedicated to Hurricane.
Definition: Generalities.dox:5
Hurricane::Contact::getHeight
const DbU::Unit & getHeight() const
Definition: Contact.h:119
Hurricane::Contact::setLayer
void setLayer(const Layer *layer)
Hurricane::Net
Net description (API)
Definition: Net.h:48
Hurricane::Contact::getDx
const DbU::Unit & getDx() const
Definition: Contact.h:115
Hurricane::Contact::setPosition
void setPosition(const DbU::Unit &x, const DbU::Unit &y)
Hurricane::Contact::Inherit
Component Inherit
Definition: Contact.h:39
Hurricane::Contact::setHeight
void setHeight(const DbU::Unit &height)

Generated by doxygen 1.8.14 on Tue Jul 21 2020 | Return to top of page

Hurricane VLSI Database | Copyright © 2000-2016 Bull S.A. All rights reserved