Search
»»»Home «««
Framework
Screenshots
FAQ
»»»TELL «««
Types
Operators
Functions
Example
»»»Toped «««
Database
Cells
Add
Select
Edit
Properties
Rendering
GUI
Miscellaneous
»»»Ifaces «««
GDSII
OASIS
CIF
DRC

Select layout objects

In order to edit already existing shapes in the database, the user will have to select them first. The functions described in this chapter do not alter directly the database. Instead Toped marks internally the selected objects. All select functions work in the active cell only. Objects belonging to currently hidden and locked layers are not selected. The subsequent edit operations will modify marked objects only, thus altering the database.

There are several interactive functions targeted especially to the editor. As all other TELL interactive functions they will stop the script execution and will expect user input form the mouse or keyboard. It has to be noted, that interactive functions still can be included in the TELL scripts, however without active editor they hardly make sense (most likely will be indicated as a run-time error).

The other purpose of the functions in this category is to ensure the feedback connection between the language and the editor (respectively database), while the adding and editing operations ensure the forward connection. As a rule, select functions return a list of references to all currently selected Toped objects. This list can be saved in a TELL variable for future use. It is important to understand the difference between currently selected objects, and the TELL variable containing the list of layout references. The latter might be used as an input parameter for future select or modify operations. In the example below after unselect_all operation there is no selected objects in the Toped database. The variable shapesel1 though, keeps the references to the layout objects and is used to select them once again.

    unselect_all();
    layout list shapes1 = select( {{ -43 , 162 } , { -26 , 150 }} );
    select_all();
    move( { -9 , 177 } , { -39 , 177 } );
    unselect_all();
    select(shapes1);
    copy( { -66 , 148 } , { -87 , 148 } );

The choice of the select operations for the moment is poor and they are able to ensure just the needs of the editor. This group of functions however should grow including basic DRC and LVS type operations. Point select functions are waiting for TELL type able to accommodate partially selected shapes.

getpoint

Pick up a point - Purely interactive function. It stops the script execution and waits for a point to be selected using the mouse or keyboard. No changes in the database, no side effects during execution. Returns the selected point.

[Tip]point getpoint()
-

Example 1. getpoint

   //Wait for the user to select the origin of the referenced cell
   cellref("cell_1",getpoint(),0,false,1);

top

getpointlist

Pick up a list of points - Purely interactive function. It stops the script execution and waits for a list of points to be selected using the mouse or keyboard. No changes in the database, no side effects during execution. Returns the list of points.

[Tip]point list getpointlist()
-

Example 2. getpointlist

   addpoly(getpointlist(),2);

top

select

Select Toped objects - There are three overloaded functions defined of this type. All of them as a result of the execution return the list of references to all currently selected TOPED layout objects. The first overloaded member selects layout objects entirely covered by the selection area. The second one will select single shape that overlaps the input point. The third function selects the shapes referred by the input layout list.

[Tip]layout list select …

layout list select(area)

layout list select(pickup)

layout list select(object_list)

layout list select()

___________________________________________
box area
box defining the selection area.
point pickup
The internal algorithm will select the shape with the smallest overlapping area, for which the pickup point is internal
layout list object_list
TELL layout list containing references to the Toped objects to be selected.

The last function is interactive and is used for editor purposes. When executed, Toped expects two points to be selected using the mouse (or keyboard). After first point is selected Toped draws a temporary rubber band rectangle between that point and the cursor position. When second point is selected, rectangle disappears and the resulting box is used as a selection area. Virtually the same result can be achieved using the construct below,

select(getpoint(),getpoint());

but there will not be a temporary box shown.

Example 3. select

   select({{-43,164},{-22,141}});

top

pselect

Select shape edges overlapped by input box - The functions of this type select the shape edges overlapped by the select box. In result there might be objects fully selected as well as objects partially selected (means not all edges are selected). Toped does not distinguish between the shapes selected using select and fully selected shapes using pselect.

[Tip]void pselect …

void pselect(area)

void pselect()

___________________________________________
box area
box defining selection area.

The second function is interactive and acts quite similarly to the way described above in select function

[Note]Note

The reason these functions return void is that TELL don’t have (yet) a construct to handle partially selected shapes, or selected edges. Once this is done functions will return a reference to the selected edges.

Example 4. pselect

   pselect({{-43,164},{-22,141}});

top

select_all

Select all shapes - This function selects all shapes in the current cell. Shapes on the hidden and locked layers are not selected. Returns a list of references to the selected shapes.

[Tip]layout list select_all()
-

Example 5. select_all

   select_all();

top

unselect

Unselect Toped objects - There are three overloaded function defined of this type. All of them as a result of the execution return the list of references to all currently selected TOPED layout objects. The first overloaded member unselects layout objects entirely covered by the box. The second one will unselect single shape that overlaps the input point. The third function unselects the shapes refereed by the input layout list.

[Tip]layout list unselect …

layout list unselect(area)

layout list unselect(pickup)

layout list unselect(object_list)

layout list unselect()

___________________________________________
box area
box defining the deselection area.
point pickup
The internal algorithm will deselect the shape with the smallest overlapping area, for which the pickup point is internal
layout list object_list
TELL layout list containing references to the Toped objects to be deselected.

The last function is interactive and is used for editor purposes. When executed, Toped expects two points to be selected using the mouse (or keyboard). After first point is selected Toped draws a temporary rubber band rectangle between that point and the cursor position. When second point is selected, rectangle disappears and the resulting box is used as deselection area. Virtually the same result can be achieved using the construct below,

unselect(getpoint(),getpoint());

but there will not be a temporary box shown.

Example 6. unselect

   unselect({{-43,164},{-22,141}});

top

punselect

Unselect shape edges overlapped by input box - The functions of this type unselect the shape edges overlapped by the input box. In result there might be objects fully unselected as well as objects partially unselected (means not all edges are selected)

[Tip]void punselect…

void punselect(area)

void punselect()

___________________________________________
box area
box defining deselection area.

The second function is interactive and acts quite similarly to the way described above in unselect function

[Note]Note

The reason these functions return void is that TELL don’t have (yet) a construct to handle partially selected shapes, or selected edges. Once this is done functions will return a reference to the selected edges.

Example 7. punselect

   punselect({{-43,164},{-22,141}});

top

unselect_all

Unselect all objects - This function unselects all shapes in the current cell. Returns obviously nothing.

[Tip]void unselect_all()
-

Example 8. unselect_all

   unselect_all();

top

selectmask

Change current selection filter mask - All subsequent select operations will use the selection filter set by this function. Toped defines a list of constant masks (see constants) for use with this function which can be logically combined. The function returns the old select mask.

[Tip]int selectmask(smask)
int smask
New selection filter mask

Example 9. selectmask

   selectmask(_lmref);

top

report_selected

Prints the list of currently selected objects.

[Tip]void report_selected()
-

Example 10. report_selected

   report_selected()

top

pointdump

Returns the points of a layout object - the point list can be used for generation of further layout objects.

[Tip]point list pointdump(lobject)
layout lobject
An existing layout object

Example 11. pointdump

   layout polyg = addpoly();
   foreach(point cp; pointdump(polyg))
   {
      echo(cp);
   }

The code above will report all points of the created polygon.

top