KLayout Manual: Main Index » Class Index » API reference - Class CellInstArray

API reference - Class CellInstArray

Notation used in Ruby API documentation

Description: A single or array cell instance

This object represents either single or array cell instances. A cell instance array is a regular array, described by two displacement vectors (a, b) and the instance count along that axes (na, nb).

In addition, this object represents either instances with simple transformations or instances with complex transformations. The latter includes magnified instances and instances rotated by an arbitrary angle.

Public constructors

new CellInstArraynewDefault constructor
new CellInstArraynew(unsigned int cell_index,
const Trans trans)
Create a single cell instance
new CellInstArraynew(unsigned int cell_index,
const CplxTrans trans)
Create a single cell instance with a complex transformation
new CellInstArraynew(unsigned int cell_index,
const Trans trans,
const Point a,
const Point b,
unsigned int na,
unsigned int nb)
Create a single cell instance
new CellInstArraynew(unsigned int cell_index,
const CplxTrans trans,
const Point arg3,
const Point arg4,
unsigned int arg5,
unsigned int arg6)
Create a single cell instance with a complex transformation

Public methods

[const]bool!=(const CellInstArray other)Compare operator for inequality
[const]bool<(const CellInstArray other)Less operator
[const]bool==(const CellInstArray other)Compare operator for equality
[const]PointaReturn the displacement vector for the 'a' axis
voida=(const Point vector)Sets the displacement vector for the 'a' axis
[const]voidassign(const CellInstArray other)Assign the contents of another object to self
[const]PointbReturn the displacement vector for the 'b' axis
voidb=(const Point vector)Sets the displacement vector for the 'b' axis
[const]Boxbbox(const Layout layout)The bounding box of the array
[const]Boxbbox_per_layer(const Layout layout,
unsigned int layer_index)
The bounding box of the array with respect to one layer
[const]unsigned intcell_indexGet the cell index of the cell instantiated
voidcell_index=(unsigned int index)Set the index of the cell this instance refers to
[const]CplxTranscplx_transGet the complex transformation of the first instance in the array
voidcplx_trans=(const CplxTrans trans)Sets the complex transformation of the instance or the first instance in the array
voidcreateEnsures the C++ object is created
voiddestroyExplicitly destroy the object
[const]booldestroyed?Returns a value indicating whether the object was already destroyed
[const]CellInstArraydupCreates a copy of self
voidinvertInvert an array reference
[const]boolis_complex?Test, if the array is a complex array
[const]boolis_const_object?Returns a value indicating whether the reference is a const reference
[const]boolis_regular_array?Test, if this instance is a regular array
[const]unsigned longnaReturn the number of instances in the 'a' axis
voidna=(unsigned long n)Sets the number of instances in the 'a' axis
[const]unsigned longnbReturn the number of instances in the 'b' axis
voidnb=(unsigned long n)Sets the number of instances in the 'b' axis
[const]unsigned intsizeThe number of single instances in the array
[const]stringto_sConverts the array to a string
[const]TranstransGet the transformation of the first instance in the array
voidtrans=(const Trans t)Sets the transformation of the instance or the first instance in the array
voidtransform(const Trans trans)Transform the cell instance with the given transformation
voidtransform(const CplxTrans trans)Transform the cell instance with the given complex transformation
voidtransform(const ICplxTrans trans)Transform the cell instance with the given complex transformation
[const]CellInstArraytransformed(const Trans trans)Returns the transformed cell instance
[const]CellInstArraytransformed(const CplxTrans trans)Returns the transformed cell instance (complex transformation)
[const]CellInstArraytransformed(const ICplxTrans trans)Returns the transformed cell instance (complex transformation)

Deprecated methods (protected, public, static, non-static and constructors)

[static]new CellInstArraynew_inst(unsigned int cell_index,
const Trans trans)
Use of this method is deprecated. Use new instead
[static]new CellInstArraynew_inst_array(unsigned int cell_index,
const Trans trans,
const Point a,
const Point b,
unsigned int na,
unsigned int nb)
Use of this method is deprecated. Use new instead
[static]new CellInstArraynew_inst_array_cplx(unsigned int cell_index,
const CplxTrans trans,
const Point arg3,
const Point arg4,
unsigned int arg5,
unsigned int arg6)
Use of this method is deprecated. Use new instead
[static]new CellInstArraynew_inst_cplx(unsigned int cell_index,
const CplxTrans trans)
Use of this method is deprecated. Use new instead

Detailed description

[const] bool !=(const CellInstArray other)

Description: Compare operator for inequality

[const] bool <(const CellInstArray other)

Description: Less operator

[const] bool ==(const CellInstArray other)

Description: Compare operator for equality

[const] Point a

Description: Return the displacement vector for the 'a' axis

void a=(const Point vector)

Description: Sets the displacement vector for the 'a' axis

If the instance was not regular before this property is set, it will be initialized to a regular instance. This method was introduced in version 0.22.

[const] void assign(const CellInstArray other)

Description: Assign the contents of another object to self

This method assigns the contents of another object to self. This is a deep copy that does not only copy the reference but the actual content.

[const] Point b

Description: Return the displacement vector for the 'b' axis

void b=(const Point vector)

Description: Sets the displacement vector for the 'b' axis

If the instance was not regular before this property is set, it will be initialized to a regular instance. This method was introduced in version 0.22.

[const] Box bbox(const Layout layout)

Description: The bounding box of the array

The bounding box incorporates all instances that the array represents. It needs the layout object to access the actual cell from the cell index.

[const] Box bbox_per_layer(const Layout layout,unsigned int layer_index)

Description: The bounding box of the array with respect to one layer

The bounding box incorporates all instances that the array represents. It needs the layout object to access the actual cell from the cell index.

[const] unsigned int cell_index

Description: Get the cell index of the cell instantiated

void cell_index=(unsigned int index)

Description: Set the index of the cell this instance refers to

[const] CplxTrans cplx_trans

Description: Get the complex transformation of the first instance in the array

This method is always valid compared to trans, since simple transformations can be expressed as complex transformations as well.

void cplx_trans=(const CplxTrans trans)

Description: Sets the complex transformation of the instance or the first instance in the array

This method was introduced in version 0.22.

void create

Description: Ensures the C++ object is created

Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created.

void destroy

Description: Explicitly destroy the object

Explicitly destroy the object on C++ side if it was owned by the Ruby interpreter. Subsequent access to this object will throw an exception. If the object is not owned by Ruby, this method will do nothing.

[const] bool destroyed?

Description: Returns a value indicating whether the object was already destroyed

This method returns true, if the object was destroyed, either explicitly or by the C++ side. The latter may happen, if the object is owned by a C++ object which got destroyed itself.

[const] CellInstArray dup

Description: Creates a copy of self

void invert

Description: Invert an array reference

The inverted array reference describes in which transformations the parent cell is seen from the current cell.

[const] bool is_complex?

Description: Test, if the array is a complex array

Returns true if the array represents complex instances (that is, with magnification and arbitrary rotation angles).

[const] bool is_const_object?

Description: Returns a value indicating whether the reference is a const reference

This method returns true, if self is a const reference. In that case, only const methods may be called on self.

[const] bool is_regular_array?

Description: Test, if this instance is a regular array

[const] unsigned long na

Description: Return the number of instances in the 'a' axis

void na=(unsigned long n)

Description: Sets the number of instances in the 'a' axis

If the instance was not regular before this property is set to a value larger than zero, it will be initialized to a regular instance. To make an instance a single instance, set na or nb to 0. This method was introduced in version 0.22.

[const] unsigned long nb

Description: Return the number of instances in the 'b' axis

void nb=(unsigned long n)

Description: Sets the number of instances in the 'b' axis

If the instance was not regular before this property is set to a value larger than zero, it will be initialized to a regular instance. To make an instance a single instance, set na or nb to 0. This method was introduced in version 0.22.

[static] new CellInstArray new

Description: Default constructor

[static] new CellInstArray new(unsigned int cell_index,const Trans trans)

Description: Create a single cell instance

cell_index:The cell to instantiate
trans:The transformation by which to instantiate the cell

[static] new CellInstArray new(unsigned int cell_index,const CplxTrans trans)

Description: Create a single cell instance with a complex transformation

cell_index:The cell to instantiate
trans:The complex transformation by which to instantiate the cell

[static] new CellInstArray new(unsigned int cell_index,const Trans trans,const Point a,const Point b,unsigned int na,unsigned int nb)

Description: Create a single cell instance

cell_index:The cell to instantiate
trans:The transformation by which to instantiate the cell
a:The displacement vector of the array in the 'a' axis
b:The displacement vector of the array in the 'b' axis
na:The number of placements in the 'a' axis
nb:The number of placements in the 'b' axis

[static] new CellInstArray new(unsigned int cell_index,const CplxTrans trans,const Point arg3,const Point arg4,unsigned int arg5,unsigned int arg6)

Description: Create a single cell instance with a complex transformation

cell_index:The cell to instantiate
trans:The complex transformation by which to instantiate the cell
a:The displacement vector of the array in the 'a' axis
b:The displacement vector of the array in the 'b' axis
na:The number of placements in the 'a' axis
nb:The number of placements in the 'b' axis

[static] new CellInstArray new_inst(unsigned int cell_index,const Trans trans)

Description: Create a single cell instance

cell_index:The cell to instantiate
trans:The transformation by which to instantiate the cell

This method is deprecated. Use method 'new' instead

[static] new CellInstArray new_inst_array(unsigned int cell_index,const Trans trans,const Point a,const Point b,unsigned int na,unsigned int nb)

Description: Create a single cell instance

cell_index:The cell to instantiate
trans:The transformation by which to instantiate the cell
a:The displacement vector of the array in the 'a' axis
b:The displacement vector of the array in the 'b' axis
na:The number of placements in the 'a' axis
nb:The number of placements in the 'b' axis

This method is deprecated. Use method 'new' instead

[static] new CellInstArray new_inst_array_cplx(unsigned int cell_index,const CplxTrans trans,const Point arg3,const Point arg4,unsigned int arg5,unsigned int arg6)

Description: Create a single cell instance with a complex transformation

cell_index:The cell to instantiate
trans:The complex transformation by which to instantiate the cell
a:The displacement vector of the array in the 'a' axis
b:The displacement vector of the array in the 'b' axis
na:The number of placements in the 'a' axis
nb:The number of placements in the 'b' axis

This method is deprecated. Use method 'new' instead

[static] new CellInstArray new_inst_cplx(unsigned int cell_index,const CplxTrans trans)

Description: Create a single cell instance with a complex transformation

cell_index:The cell to instantiate
trans:The complex transformation by which to instantiate the cell

This method is deprecated. Use method 'new' instead

[const] unsigned int size

Description: The number of single instances in the array

If the instance represents a single instance, the count is 1. Otherwise it is na*nb.

[const] string to_s

Description: Converts the array to a string

This method was introduced in version 0.22.

[const] Trans trans

Description: Get the transformation of the first instance in the array

The transformation returned is only valid if the array does not represent a complex transformation array

void trans=(const Trans t)

Description: Sets the transformation of the instance or the first instance in the array

This method was introduced in version 0.22.

void transform(const Trans trans)

Description: Transform the cell instance with the given transformation

This method has been introduced in version 0.20.

void transform(const CplxTrans trans)

Description: Transform the cell instance with the given complex transformation

This method has been introduced in version 0.20.

void transform(const ICplxTrans trans)

Description: Transform the cell instance with the given complex transformation

This method has been introduced in version 0.20.

[const] CellInstArray transformed(const Trans trans)

Description: Returns the transformed cell instance

This method has been introduced in version 0.20.

[const] CellInstArray transformed(const CplxTrans trans)

Description: Returns the transformed cell instance (complex transformation)

This method has been introduced in version 0.20.

[const] CellInstArray transformed(const ICplxTrans trans)

Description: Returns the transformed cell instance (complex transformation)

This method has been introduced in version 0.20.