Hurricane VLSI Database


Contact.h
1 // -*- C++ -*-
2 //
3 // Copyright (c) BULL S.A. 2000-2020, All Rights Reserved
4 //
5 // This file is part of Hurricane.
6 //
7 // Hurricane is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU Lesser General Public License as
9 // 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
13 // WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-
14 // TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU
15 // General Public License for more details.
16 //
17 // You should have received a copy of the Lesser GNU General Public
18 // License along with Hurricane. If not, see
19 // <http://www.gnu.org/licenses/>.
20 //
21 // +-----------------------------------------------------------------+
22 // | H U R R I C A N E |
23 // | V L S I B a c k e n d D a t a - B a s e |
24 // | |
25 // | Author : Remy Escassut |
26 // | E-mail : Jean-Paul.Chaput@lip6.fr |
27 // | =============================================================== |
28 // | C++ Header : "./hurricane/Commons.h" |
29 // +-----------------------------------------------------------------+
30 
31 
32 #pragma once
33 #include "hurricane/Component.h"
34 #include "hurricane/Contacts.h"
35 
36 
37 namespace Hurricane {
38 
39 
40 // -------------------------------------------------------------------
41 // Class : "Hurricane::Contact".
42 
43  class Contact : public Component {
44  public:
45  typedef Component Inherit;
46  public:
47  class AnchorHook : public Hook {
48  friend class Contact;
49  public:
50  typedef Hook Inherit;
51  private:
52  AnchorHook ( Contact* );
53  public:
54  virtual Component* getComponent () const;
55  virtual bool isMaster () const { return false; };
56  virtual std::string _getTypeName () const { return "Contact::AnchorHook"; };
57  virtual std::string _getString () const;
58  static Hook* _compToHook ( Component* );
59  };
60 
61  protected:
62  Contact ( Net* net
63  , const Layer* layer
64  , DbU::Unit x
65  , DbU::Unit y
66  , DbU::Unit width
67  , DbU::Unit height
68  );
69  Contact ( Net* net
70  , Component* anchor
71  , const Layer* layer
72  , DbU::Unit dx
73  , DbU::Unit dy
74  , DbU::Unit width
75  , DbU::Unit height
76  );
77  public:
78  static inline void enableCheckMinSize ();
79  static inline void disableCheckMinSize ();
80  static Contact* create ( Net* net
81  , const Layer* layer
82  , DbU::Unit x
83  , DbU::Unit y
84  , DbU::Unit width =0
85  , DbU::Unit height=0
86  );
87  static Contact* create ( Component* anchor
88  , const Layer* layer
89  , DbU::Unit dx
90  , DbU::Unit dy
91  , DbU::Unit width =0
92  , DbU::Unit height=0
93  );
94  public:
95  virtual Hooks getHooks () const;
96  virtual DbU::Unit getX () const;
97  virtual DbU::Unit getY () const;
98  virtual Point getPosition () const;
99  virtual Box getBoundingBox () const;
100  virtual const Layer* getLayer () const {return _layer;};
101  virtual Box getBoundingBox ( const BasicLayer* ) const;
102  Hook* getAnchorHook () { return &_anchorHook; };
103  Component* getAnchor () const;
104  DbU::Unit getDx () const { return _dx; };
105  DbU::Unit getDy () const { return _dy; };
106  DbU::Unit getWidth () const { return _width; };
107  DbU::Unit getHalfWidth () const { return (_width / 2); };
108  DbU::Unit getHeight () const { return _height; };
109  DbU::Unit getHalfHeight () const { return (_height / 2); };
110  public:
111  virtual void translate ( const DbU::Unit& dx, const DbU::Unit& dy );
112  void setLayer ( const Layer* );
113  void setWidth ( DbU::Unit );
115  void setSizes ( DbU::Unit width, DbU::Unit height);
116  void setX ( DbU::Unit );
117  void setY ( DbU::Unit );
119  void setPosition ( const Point& );
120  void setDx ( DbU::Unit );
121  void setDy ( DbU::Unit );
122  void setOffset ( DbU::Unit dx, DbU::Unit dy);
123  private:
124  bool _postCheck ();
125  protected:
126  virtual void _preDestroy ();
127  public:
128  virtual void _toJson ( JsonWriter* ) const;
129  virtual std::string _getTypeName () const { return _TName("Contact"); };
130  virtual std::string _getString () const;
131  virtual Record* _getRecord () const;
132  private:
133  static bool _checkMinSize;
134  AnchorHook _anchorHook;
135  const Layer* _layer;
136  DbU::Unit _dx;
137  DbU::Unit _dy;
138  protected:
139  DbU::Unit _width;
140  DbU::Unit _height;
141  };
142 
143 
144  inline void Contact::enableCheckMinSize () { _checkMinSize=true; }
145  inline void Contact::disableCheckMinSize () { _checkMinSize=false; }
146 
147 
148 // -------------------------------------------------------------------
149 // Class : "Hurricane::JsonContact".
150 
151  class JsonContact : public JsonComponent {
152  public:
153  static void initialize ();
154  JsonContact ( unsigned long flags );
155  virtual std::string getTypeName () const;
156  virtual JsonContact* clone ( unsigned long ) const;
157  virtual void toData ( JsonStack& );
158  };
159 
160 
161 } // Hurricane namespace.
162 
163 
164 INSPECTOR_P_SUPPORT(Hurricane::Contact);
165 INSPECTOR_P_SUPPORT(Hurricane::Contact::AnchorHook);
BasicLayer description (API)
Definition: BasicLayer.h:44
Box description (API)
Definition: Box.h:31
Component description (API)
Definition: Component.h:42
Definition: Contact.h:47
Contact description (API)
Definition: Contact.h:43
DbU::Unit getHeight() const
Definition: Contact.h:108
void setWidth(DbU::Unit)
void setSizes(DbU::Unit width, DbU::Unit height)
void setY(DbU::Unit)
static Contact * create(Component *anchor, const Layer *layer, DbU::Unit dx, DbU::Unit dy, DbU::Unit width=0, DbU::Unit height=0)
Hook * getAnchorHook()
Definition: Contact.h:102
Component Inherit
Definition: Contact.h:45
DbU::Unit getHalfWidth() const
Definition: Contact.h:107
void setX(DbU::Unit)
void setOffset(DbU::Unit dx, DbU::Unit dy)
void setHeight(DbU::Unit)
DbU::Unit getWidth() const
Definition: Contact.h:106
void setDx(DbU::Unit)
DbU::Unit getDx() const
Definition: Contact.h:104
Component * getAnchor() const
static Contact * create(Net *net, const Layer *layer, DbU::Unit x, DbU::Unit y, DbU::Unit width=0, DbU::Unit height=0)
void setDy(DbU::Unit)
void setPosition(DbU::Unit x, DbU::Unit y)
DbU::Unit getHalfHeight() const
Definition: Contact.h:109
void setLayer(const Layer *)
void setPosition(const Point &)
DbU::Unit getDy() const
Definition: Contact.h:105
std::int64_t Unit
Definition: DbU.h:67
Generic Collection auto-pointer.
Definition: Collection.h:235
Hook description (API)
Definition: Hook.h:34
Layer description (API)
Definition: Layer.h:52
Net description (API)
Definition: Net.h:48
Point description (API)
Definition: Point.h:32
The namespace dedicated to Hurricane.
Definition: Generalities.dox:5


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