Trait libreda_db::layout::traits::LayoutBase [−][src]
pub trait LayoutBase: HierarchyBase {
type Coord: CoordinateType;
type LayerId: Eq + Hash + Clone + Debug;
type ShapeId: Eq + Hash + Clone + Debug;
Show 14 methods
fn dbu(&self) -> Self::Coord;
fn each_layer(&self) -> Box<dyn Iterator<Item = Self::LayerId>>;
fn layer_info(&self, layer: &Self::LayerId) -> &LayerInfo<Self::NameType>;
fn find_layer(&self, index: UInt, datatype: UInt) -> Option<Self::LayerId>;
fn layer_by_name(&self, name: &str) -> Option<Self::LayerId>;
fn bounding_box_per_layer(
&self,
cell: &Self::CellId,
layer: &Self::LayerId
) -> Option<Rect<Self::Coord>>;
fn each_shape_id(
&self,
cell: &Self::CellId,
layer: &Self::LayerId
) -> Box<dyn Iterator<Item = Self::ShapeId>>;
fn for_each_shape<F>(
&self,
cell: &Self::CellId,
layer: &Self::LayerId,
f: F
)
where
F: FnMut(&Self::ShapeId, &Geometry<Self::Coord>);
fn with_shape<F, R>(&self, shape_id: &Self::ShapeId, f: F) -> R
where
F: FnMut(&Self::LayerId, &Geometry<Self::Coord>) -> R;
fn parent_of_shape(
&self,
shape_id: &Self::ShapeId
) -> (Self::CellId, Self::LayerId);
fn get_transform(
&self,
cell_inst: &Self::CellInstId
) -> SimpleTransform<Self::Coord>;
fn bounding_box(&self, cell: &Self::CellId) -> Option<Rect<Self::Coord>> { ... }
fn for_each_shape_recursive<F>(
&self,
cell: &Self::CellId,
layer: &Self::LayerId,
f: F
)
where
F: FnMut(SimpleTransform<Self::Coord>, &Self::ShapeId, &Geometry<Self::Coord>),
{ ... }
fn get_shape_property(
&mut self,
shape: &Self::ShapeId,
key: &Self::NameType
) -> Option<PropertyValue> { ... }
}
Expand description
Most basic trait of a layout.
This traits specifies methods for accessing the components of a layout.
Associated Types
type Coord: CoordinateType
type Coord: CoordinateType
Number type used for coordinates.
Required methods
fn each_layer(&self) -> Box<dyn Iterator<Item = Self::LayerId>>
fn each_layer(&self) -> Box<dyn Iterator<Item = Self::LayerId>>
Iterate over all defined layers.
fn layer_info(&self, layer: &Self::LayerId) -> &LayerInfo<Self::NameType>
fn layer_info(&self, layer: &Self::LayerId) -> &LayerInfo<Self::NameType>
Get the LayerInfo
data structure for this layer.
Find layer index by the (index, data type) tuple.
fn layer_by_name(&self, name: &str) -> Option<Self::LayerId>
fn layer_by_name(&self, name: &str) -> Option<Self::LayerId>
Find layer index by the name.
Compute the bounding box of the shapes on one layer. The bounding box also includes all child cell instances.
Iterate over the IDs of all shapes in the cell on a specific layer.
Call a function for each shape on this layer.
Access a shape by its ID.
Get the parent cell and the layer of a shape as a (cell, layer) tuple.
fn get_transform(
&self,
cell_inst: &Self::CellInstId
) -> SimpleTransform<Self::Coord>
fn get_transform(
&self,
cell_inst: &Self::CellInstId
) -> SimpleTransform<Self::Coord>
Get the geometric transform that describes the location of a cell instance relative to its parent.
Provided methods
Compute the bounding box of the cell over all layers.
The bounding box is not defined if the cell is empty. In this
case return None
.
fn for_each_shape_recursive<F>(
&self,
cell: &Self::CellId,
layer: &Self::LayerId,
f: F
) where
F: FnMut(SimpleTransform<Self::Coord>, &Self::ShapeId, &Geometry<Self::Coord>),
fn for_each_shape_recursive<F>(
&self,
cell: &Self::CellId,
layer: &Self::LayerId,
f: F
) where
F: FnMut(SimpleTransform<Self::Coord>, &Self::ShapeId, &Geometry<Self::Coord>),
Call a function f
for each shape of this cell and its sub cells.
Along to the geometric shape f
also gets a transformation as argument.
The transformation describes the actual position of the geometric shape relative to the cell
.
fn get_shape_property(
&mut self,
shape: &Self::ShapeId,
key: &Self::NameType
) -> Option<PropertyValue>
fn get_shape_property(
&mut self,
shape: &Self::ShapeId,
key: &Self::NameType
) -> Option<PropertyValue>
Get a property of a shape.