Ophidian
 All Classes Namespaces Functions
cells.h
1 /*
2  * Copyright 2016 Ophidian
3 Licensed to the Apache Software Foundation (ASF) under one
4 or more contributor license agreements. See the NOTICE file
5 distributed with this work for additional information
6 regarding copyright ownership. The ASF licenses this file
7 to you under the Apache License, Version 2.0 (the
8 "License"); you may not use this file except in compliance
9 with the License. You may obtain a copy of the License at
10 
11  http://www.apache.org/licenses/LICENSE-2.0
12 
13 Unless required by applicable law or agreed to in writing,
14 software distributed under the License is distributed on an
15 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 KIND, either express or implied. See the License for the
17 specific language governing permissions and limitations
18 under the License.
19  */
20 
21 #ifndef SRC_PLACEMENT_CELLS_H_
22 #define SRC_PLACEMENT_CELLS_H_
23 
24 
25 #include "../netlist/netlist.h"
26 #include "../geometry/geometry.h"
27 #include "../entity_system/vector_property.h"
28 #include <boost/bimap.hpp>
29 
30 namespace ophidian {
31 namespace placement {
32 
33 class cells {
34  using point = geometry::point<double>;
35  using polygon = geometry::polygon<point>;
36  using multipolygon = geometry::multi_polygon<polygon>;
37 
38  const entity_system::entity_system & m_system;
39 
43 
44 public:
46  virtual ~cells();
47 
48  void position(entity_system::entity cell, point position);
49  point position(entity_system::entity cell) const {
50  return m_positions[m_system.lookup(cell)];
51  }
52  const entity_system::vector_property<point> positions() const {
53  return m_positions;
54  }
55 
56  void geometry(entity_system::entity cell, multipolygon geometry);
57  multipolygon geometry(entity_system::entity cell) const {
58  return m_geometries[m_system.lookup(cell)];
59  }
60  const entity_system::vector_property<multipolygon> geometries() const {
61  return m_geometries;
62  }
63 
64  void fixed(entity_system::entity cell, bool fixed);
65  bool fixed(entity_system::entity cell) const {
66  return m_fixed[m_system.lookup(cell)];
67  }
68 };
69 
70 } /* namespace placement */
71 } /* namespace ophidian */
72 
73 #endif /* SRC_PLACEMENT_CELLS_H_ */
Definition: cells.h:33
Netlist class.
Definition: netlist.h:41
entity_system class.
Definition: entity_system.h:40
Definition: vector_property.h:160
entity_index lookup(entity e) const
Gets the index of an entity.
Definition: entity_system.h:149