Trait LayoutBase

Source
pub trait LayoutBase: LayoutIds + HierarchyBase {
Show 16 methods // Required 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>; // Provided methods fn bounding_box(&self, cell: &Self::CellId) -> Option<Rect<Self::Coord>> { ... } fn shape_geometry(&self, shape_id: &Self::ShapeId) -> Geometry<Self::Coord> { ... } fn shape_layer(&self, shape_id: &Self::ShapeId) -> Self::LayerId { ... } 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( &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.

Required Methods§

Source

fn dbu(&self) -> Self::Coord

Get the distance unit used in this layout in ‘pixels per micron’.

Source

fn each_layer(&self) -> Box<dyn Iterator<Item = Self::LayerId> + '_>

Iterate over all defined layers.

Source

fn layer_info(&self, layer: &Self::LayerId) -> LayerInfo<Self::NameType>

Get the LayerInfo data structure for this layer.

Source

fn find_layer(&self, index: UInt, datatype: UInt) -> Option<Self::LayerId>

Find layer index by the (index, data type) tuple.

Source

fn layer_by_name(&self, name: &str) -> Option<Self::LayerId>

Find layer index by the name.

Source

fn bounding_box_per_layer( &self, cell: &Self::CellId, layer: &Self::LayerId, ) -> Option<Rect<Self::Coord>>

Compute the bounding box of the shapes on one layer. The bounding box also includes all child cell instances.

Source

fn each_shape_id( &self, cell: &Self::CellId, layer: &Self::LayerId, ) -> Box<dyn Iterator<Item = Self::ShapeId> + '_>

Iterate over the IDs of all shapes in the cell on a specific layer.

Source

fn for_each_shape<F>(&self, cell: &Self::CellId, layer: &Self::LayerId, f: F)
where F: FnMut(&Self::ShapeId, &Geometry<Self::Coord>),

Call a function for each shape on this layer.

Source

fn with_shape<F, R>(&self, shape_id: &Self::ShapeId, f: F) -> R
where F: FnMut(&Self::LayerId, &Geometry<Self::Coord>) -> R,

Access a shape by its ID.

Source

fn parent_of_shape( &self, shape_id: &Self::ShapeId, ) -> (Self::CellId, Self::LayerId)

Get the parent cell and the layer of a shape as a (cell, layer) tuple.

Source

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§

Source

fn bounding_box(&self, cell: &Self::CellId) -> Option<Rect<Self::Coord>>

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.

Source

fn shape_geometry(&self, shape_id: &Self::ShapeId) -> Geometry<Self::Coord>

Get a clone of the shape geometry.

Source

fn shape_layer(&self, shape_id: &Self::ShapeId) -> Self::LayerId

Get the layer of a shape.

Source

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.

Source

fn get_shape_property( &self, shape: &Self::ShapeId, key: &Self::NameType, ) -> Option<PropertyValue>

Get a property of a shape.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<T> LayoutBase for &T
where T: LayoutBase,

Source§

fn dbu(&self) -> Self::Coord

Source§

fn layer_by_name(&self, name: &str) -> Option<Self::LayerId>

Source§

fn bounding_box_per_layer( &self, cell: &Self::CellId, layer: &Self::LayerId, ) -> Option<Rect<Self::Coord>>

Source§

fn shape_geometry(&self, shape_id: &Self::ShapeId) -> Geometry<Self::Coord>

Source§

fn get_transform( &self, cell_inst: &Self::CellInstId, ) -> SimpleTransform<Self::Coord>

Source§

fn get_shape_property( &self, shape: &Self::ShapeId, key: &Self::NameType, ) -> Option<PropertyValue>

Source§

fn for_each_shape<F>(&self, cell: &Self::CellId, layer: &Self::LayerId, f: F)
where F: FnMut(&Self::ShapeId, &Geometry<Self::Coord>),

Source§

fn shape_layer(&self, shape_id: &Self::ShapeId) -> Self::LayerId

Source§

fn layer_info(&self, layer: &Self::LayerId) -> LayerInfo<Self::NameType>

Source§

fn with_shape<F, R>(&self, shape_id: &Self::ShapeId, f: F) -> R
where F: FnMut(&Self::LayerId, &Geometry<Self::Coord>) -> R,

Source§

fn each_layer(&self) -> Box<dyn Iterator<Item = Self::LayerId> + '_>

Source§

fn each_shape_id( &self, cell: &Self::CellId, layer: &Self::LayerId, ) -> Box<dyn Iterator<Item = Self::ShapeId> + '_>

Source§

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>),

Source§

fn bounding_box(&self, cell: &Self::CellId) -> Option<Rect<Self::Coord>>

Source§

fn find_layer(&self, index: UInt, datatype: UInt) -> Option<Self::LayerId>

Source§

fn parent_of_shape( &self, shape_id: &Self::ShapeId, ) -> (Self::CellId, Self::LayerId)

Source§

impl<T> LayoutBase for &mut T
where T: LayoutBase,

Source§

fn for_each_shape<F>(&self, cell: &Self::CellId, layer: &Self::LayerId, f: F)
where F: FnMut(&Self::ShapeId, &Geometry<Self::Coord>),

Source§

fn bounding_box(&self, cell: &Self::CellId) -> Option<Rect<Self::Coord>>

Source§

fn bounding_box_per_layer( &self, cell: &Self::CellId, layer: &Self::LayerId, ) -> Option<Rect<Self::Coord>>

Source§

fn get_shape_property( &self, shape: &Self::ShapeId, key: &Self::NameType, ) -> Option<PropertyValue>

Source§

fn layer_by_name(&self, name: &str) -> Option<Self::LayerId>

Source§

fn each_shape_id( &self, cell: &Self::CellId, layer: &Self::LayerId, ) -> Box<dyn Iterator<Item = Self::ShapeId> + '_>

Source§

fn shape_geometry(&self, shape_id: &Self::ShapeId) -> Geometry<Self::Coord>

Source§

fn with_shape<F, R>(&self, shape_id: &Self::ShapeId, f: F) -> R
where F: FnMut(&Self::LayerId, &Geometry<Self::Coord>) -> R,

Source§

fn get_transform( &self, cell_inst: &Self::CellInstId, ) -> SimpleTransform<Self::Coord>

Source§

fn each_layer(&self) -> Box<dyn Iterator<Item = Self::LayerId> + '_>

Source§

fn layer_info(&self, layer: &Self::LayerId) -> LayerInfo<Self::NameType>

Source§

fn shape_layer(&self, shape_id: &Self::ShapeId) -> Self::LayerId

Source§

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>),

Source§

fn parent_of_shape( &self, shape_id: &Self::ShapeId, ) -> (Self::CellId, Self::LayerId)

Source§

fn dbu(&self) -> Self::Coord

Source§

fn find_layer(&self, index: UInt, datatype: UInt) -> Option<Self::LayerId>

Source§

impl<T> LayoutBase for Box<T>
where T: LayoutBase,

Source§

fn layer_by_name(&self, name: &str) -> Option<Self::LayerId>

Source§

fn bounding_box(&self, cell: &Self::CellId) -> Option<Rect<Self::Coord>>

Source§

fn shape_layer(&self, shape_id: &Self::ShapeId) -> Self::LayerId

Source§

fn layer_info(&self, layer: &Self::LayerId) -> LayerInfo<Self::NameType>

Source§

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>),

Source§

fn get_shape_property( &self, shape: &Self::ShapeId, key: &Self::NameType, ) -> Option<PropertyValue>

Source§

fn each_shape_id( &self, cell: &Self::CellId, layer: &Self::LayerId, ) -> Box<dyn Iterator<Item = Self::ShapeId> + '_>

Source§

fn for_each_shape<F>(&self, cell: &Self::CellId, layer: &Self::LayerId, f: F)
where F: FnMut(&Self::ShapeId, &Geometry<Self::Coord>),

Source§

fn with_shape<F, R>(&self, shape_id: &Self::ShapeId, f: F) -> R
where F: FnMut(&Self::LayerId, &Geometry<Self::Coord>) -> R,

Source§

fn shape_geometry(&self, shape_id: &Self::ShapeId) -> Geometry<Self::Coord>

Source§

fn parent_of_shape( &self, shape_id: &Self::ShapeId, ) -> (Self::CellId, Self::LayerId)

Source§

fn get_transform( &self, cell_inst: &Self::CellInstId, ) -> SimpleTransform<Self::Coord>

Source§

fn each_layer(&self) -> Box<dyn Iterator<Item = Self::LayerId> + '_>

Source§

fn bounding_box_per_layer( &self, cell: &Self::CellId, layer: &Self::LayerId, ) -> Option<Rect<Self::Coord>>

Source§

fn find_layer(&self, index: UInt, datatype: UInt) -> Option<Self::LayerId>

Source§

fn dbu(&self) -> Self::Coord

Source§

impl<T> LayoutBase for Rc<T>
where T: LayoutBase,

Source§

fn get_shape_property( &self, shape: &Self::ShapeId, key: &Self::NameType, ) -> Option<PropertyValue>

Source§

fn bounding_box(&self, cell: &Self::CellId) -> Option<Rect<Self::Coord>>

Source§

fn layer_info(&self, layer: &Self::LayerId) -> LayerInfo<Self::NameType>

Source§

fn parent_of_shape( &self, shape_id: &Self::ShapeId, ) -> (Self::CellId, Self::LayerId)

Source§

fn each_layer(&self) -> Box<dyn Iterator<Item = Self::LayerId> + '_>

Source§

fn bounding_box_per_layer( &self, cell: &Self::CellId, layer: &Self::LayerId, ) -> Option<Rect<Self::Coord>>

Source§

fn for_each_shape<F>(&self, cell: &Self::CellId, layer: &Self::LayerId, f: F)
where F: FnMut(&Self::ShapeId, &Geometry<Self::Coord>),

Source§

fn get_transform( &self, cell_inst: &Self::CellInstId, ) -> SimpleTransform<Self::Coord>

Source§

fn shape_layer(&self, shape_id: &Self::ShapeId) -> Self::LayerId

Source§

fn with_shape<F, R>(&self, shape_id: &Self::ShapeId, f: F) -> R
where F: FnMut(&Self::LayerId, &Geometry<Self::Coord>) -> R,

Source§

fn shape_geometry(&self, shape_id: &Self::ShapeId) -> Geometry<Self::Coord>

Source§

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>),

Source§

fn find_layer(&self, index: UInt, datatype: UInt) -> Option<Self::LayerId>

Source§

fn each_shape_id( &self, cell: &Self::CellId, layer: &Self::LayerId, ) -> Box<dyn Iterator<Item = Self::ShapeId> + '_>

Source§

fn layer_by_name(&self, name: &str) -> Option<Self::LayerId>

Source§

fn dbu(&self) -> Self::Coord

Source§

impl<T> LayoutBase for Arc<T>
where T: LayoutBase,

Source§

fn for_each_shape<F>(&self, cell: &Self::CellId, layer: &Self::LayerId, f: F)
where F: FnMut(&Self::ShapeId, &Geometry<Self::Coord>),

Source§

fn find_layer(&self, index: UInt, datatype: UInt) -> Option<Self::LayerId>

Source§

fn parent_of_shape( &self, shape_id: &Self::ShapeId, ) -> (Self::CellId, Self::LayerId)

Source§

fn shape_layer(&self, shape_id: &Self::ShapeId) -> Self::LayerId

Source§

fn layer_by_name(&self, name: &str) -> Option<Self::LayerId>

Source§

fn dbu(&self) -> Self::Coord

Source§

fn get_shape_property( &self, shape: &Self::ShapeId, key: &Self::NameType, ) -> Option<PropertyValue>

Source§

fn shape_geometry(&self, shape_id: &Self::ShapeId) -> Geometry<Self::Coord>

Source§

fn with_shape<F, R>(&self, shape_id: &Self::ShapeId, f: F) -> R
where F: FnMut(&Self::LayerId, &Geometry<Self::Coord>) -> R,

Source§

fn each_layer(&self) -> Box<dyn Iterator<Item = Self::LayerId> + '_>

Source§

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>),

Source§

fn layer_info(&self, layer: &Self::LayerId) -> LayerInfo<Self::NameType>

Source§

fn bounding_box_per_layer( &self, cell: &Self::CellId, layer: &Self::LayerId, ) -> Option<Rect<Self::Coord>>

Source§

fn each_shape_id( &self, cell: &Self::CellId, layer: &Self::LayerId, ) -> Box<dyn Iterator<Item = Self::ShapeId> + '_>

Source§

fn get_transform( &self, cell_inst: &Self::CellInstId, ) -> SimpleTransform<Self::Coord>

Source§

fn bounding_box(&self, cell: &Self::CellId) -> Option<Rect<Self::Coord>>

Implementors§

Source§

impl LayoutBase for Chip<Coord>

Source§

impl<'b, N, U> LayoutBase for Undo<'b, N, U>
where N: LayoutBase,

Source§

impl<L> LayoutBase for RegionSearchAdapter<L>
where L: LayoutBase, L::Coord: PrimInt + Signed + Debug,

Source§

impl<L: LayoutBase> LayoutBase for DBPerf<L>