Class Reference element

A single element of the drawing like box or polygon. More...

Member

void clearMirrorx()
void clearProperties()
int datatype
bool decodeRaithPxxData(int *,double *,double *,double *,int *,int *,int *)
void deleteSelect()
cell* depend()
void deselectAll()
void encodeRaithPxxData(int ,double ,double ,double,int ,int,int)
rect getBoundingBox()
int getCap()
int getDatatype()
string getName()
int getNx()
int getNy()
pointArray getPoints()
int getPresentation()
double getRaithDosis()
pointArray getSelectedPoints()
string getPropertyString(int num)
string getPropertyString(string name)
strans getTrans()
int getWidth()
void invertSelect()
bool isBox()
bool isCellref()
bool isCellrefArray()
bool isCircle()
bool isCircle(point *centre, int *radius)
bool isPath()
bool isPolygon()
bool isRaithMBMSPath()
bool isRectangle()
bool isShape()
bool isSquare()
bool isText()
int layerNum
void maximum(point *pos)
void maximumSelect(point *pos)
point maximum()
point maximumSelect()
void minimum(point *pos)
void minimumSelect(point *pos)
point minimum()
point minimumSelect()
bool replaceText(string old, string new)
void rotate(double ang)
void scale(double scale)
bool select
void selectAll()
void selectDatatype(int t)
void selectVisible()
void setCap(int cap)
void setCellRef(cell* c)
void setDatatypeSelect(int t)
void setDatatype(int t)
void setMirrorx()
void setName(string name)
void setNx(int)
void setNy(int)
void setPoints(pointArray array)
void setPresentation(int pes)
void setPropertyString(int num,string s)
void setPropertyString(string name,string value)
void setRaithDosis(double)
void setTrans(strans transfomation)
void setWidth(int width)
void toggleMirrorx()
double angle(point p1, point p2, point p3)
double angle(point p1, point p2)
double distance(point p1, point p2)
double distance(point p1, point p2, point p3)
int round(double d)

Detailed Description

graph LR ce(cell)--firstElement-->el(elementList) el--thisElement-->e(element) el--nextElement-->el click ce "/layoutscript/api/cell" click el "/layoutscript/api/elementlist" click e "/layoutscript/api/element" classDef thisClas fill:#eaf5fc,stroke:#3c7faa,stroke-width:4px; classDef clas fill:#eaf5fc,stroke:#3c7faa,stroke-width:1px; class e thisClas class ce,la,dr,el clas

A single element of the drawing. It can ether be a shape (path, box, polygon or text) or a cell reference (cell reference or cell reference array).


//...
element \*e=layout->drawing->currentCell->firstElement->thisElement;
if (e!=NULL) {
  e->layerNum=23;
  if (e->isPath()) e->setWidth(34);
  if (e->isBox()) e->selectAll();
}

//...

Also some some general geometric operations are part of this class as static member.

point p1(34,87);
point p2(267,142);
double distance=element::distance(p1,p2);

Member Function Documentation


void element::clearMirrorx()

Clears the mirror attribute for cellrefs, cellrefarrays and text elements. Has no effect for other elements.

See also: setMirrorx(), toggleMirrorx()


void element::clearProperties()

All properties in this element are removed. (introduced with release 20230828)


int element::datatype

Stores the datatype for each element. The datatype is a additional integer property of each element. This property is often used to store the energy level for electron beam writers. Also it is often used to store the purpose of this element.

See also: getDatatype(), setDatatype()


bool element:: decodeRaithPxxData(int *,double *,double *,double *,int *,int *,int *)

Mask writer from the company Raith uses some GDS extensions. This method will read the PxxData from an path element. For more information, please see the example macro within the LayoutEditor package under macros/examples/raith_GDS_extension.layout.(introduced with release 20220323)

        int dwelltimeSelection;
        double pitchInPathDir;
        double pitchCrossPathDir;
        double pitchScalingFactor;
        int periods;
        int gratingType;
        int dotsPerCycle;
        if (my_element->decodeRaithPxxData(&dwelltimeSelection, &pitchInPathDir,
                &pitchCrossPathDir, &pitchScalingFactor,  &periods,&gratingType,&dotsPerCycle)){
            string sname=my_element->getPropertyString("RaithMBMSPath");

In LayoutScript for Python there are two ways to receive the values:

     # there is one addition 'list' function returning a Python list will all values:
     data= my_element.decodeRaithPxxDataList()
     print (data)  
     # will print: [True, 16, 100000.0, 0.0, 1000, 1, 0, 0]

     # the explicit way by creating a pointer variable for each value:
     dwelltimeSelection=LayoutScript.pointerInt()
     pitchInPathDir=LayoutScript.pointerDouble()
     pitchCrossPathDir=LayoutScript.pointerDouble()
     pitchScalingFactor=LayoutScript.pointerDouble()
     periods=LayoutScript.pointerInt()
     gratingType=LayoutScript.pointerInt()
     dotsPerCycle=LayoutScript.pointerInt()
     result= my_element.decodeRaithPxxData(dwelltimeSelection, pitchInPathDir, pitchCrossPathDir, pitchScalingFactor,  periods,gratingType,dotsPerCycle)
     print (dwelltimeSelection.value())  # will print 16
     print (pitchInPathDir.value()) # will print 100000.0

void element::deleteSelect()

In the case an element is partial selected, any selected point is removed from the element. For example if you have a path with three points and the middle point is selected, the middle point will be removed and you will get a simple line. The method will have no effect an complete selected shapes.


cell* element::depend()

For cell references and cell array references the referred cell is returned as a pointer to this cell. This method will return NULL for any other shapes.

See also: setCellRef()


void element::deselectAll()

DeselectAll will complete deselect this shapes independent whether it is selected complete or partial.


void element::encodeRaithPxxData(int ,double ,double ,double,int ,int,int)

Mask writer from the company Raith uses some GDS extensions. This method will set the PxxData to an path element. For more information, please see the example macro within the LayoutEditor package under macros/examples/raith_GDS_extension.layout.(introduced with release 20220323)


rect element::getBoundingBox()

Returns: the bounding box of the element. If a text element has a negative width a rect with zero size is retunr at the origin. The same for cellreferences to emtpy cells.


int element::getCap()

Returns: for path element the setting for the path cap is returned. The same value as for setCap are used (0 no caps, 1 round caps, 2 square caps):

For all other elements 0 is returned.

See also: setCap()


int element::getDatatype()

The value of datatype property is returned.

See also: datatype, setDatatype()


string element::getName()

The text contents for text element is returned. Has no effect for other elements. To set the text contents use setName.

See also: setName()


int element::getNx()

For a cell reference arrays the number of repetitions in x direction is return. For all other elements 0 is returned.

See also: setNx()


int element::getNy()

For a cell reference arrays the number of repetitions in y direction is return. For all other elements 0 is returned.

See also: setNy()


pointArray element::getPoints()

Returns:

  • If it is a box: Returns an array of two points: first the top left corner, second the lower right corner.
  • If it is a polygon or path: Returns a array of all point of the element.
  • If it is a cellref: Returns an array of one point: the base point of the reference.
  • If it is a cellrefarray: Returns an array of tree points: first the base point of the reference, second base point plus space in x and third base point plus space in y.
  • If it is a text: Returns an array of one point: the base point of the text.

See also: setPoints()


int element::getPresentation()

Returns: the presentation value of a text element. The returned value are identical with the value of setPresentation(). (introduced with release 20190411)


double element::getRaithDosis()

Mask writer from the company Raith uses the datatype to store the exposure dosis. The valule in encoded in a special kind. The method will decode it and returns the dosis value. (introduced with release 20220323)


pointArray element::getSelectedPoints()

Similar to getPoints, but only returns a point, if it is selected.


string element::getPropertyString(int num)

Returns: the value string of the property num. If the property with this number not exists, an empty string is returned.

See also: setPropertyString()


string element::getPropertyString(string name)

Properties of an elment can inside the LayoutEditor addressed by a name or by a number. With this method a name address is used. Properties wih names are supported by OASIS but only partly by GDSII. Other file formats will ignore it. Returns: the property of an element with named name. (introduced with release 20220323)


strans element::getTrans()

Returns: the transformation for text eleemnts and cell references. A identical transformation is returned for any other shape.

See also: setTrans()


int element::getWidth()

Get the width for path and text-elements.

Returns: The height of a text-element/ width of a path. Positive value for a width in drawing-units. Negative value for size in pixel.

See also: setWidth()


void element::invertSelect()

The selection of this element is inverted.


bool element::isBox()

Returns: true if element is a box otherwise false


bool element::isCellref()

Returns: true if element is a cellRef otherwise false


bool element::isCellrefArray()

Returns: true if element is a cellRefArray otherwise false


bool element::isCircle()

Returns: true if element is a regular polygon with more than 8 points


bool element::isCircle(point *centre, int *radius)

Returns: true if element is a regular polygon with more than 8 points. The point is set to the centre point and the integer is set to the radius.

For LayoutScript: Pointers to non-classes had be be created with the pointInt() command:

 # for python
 p2=point()
 radius=pointerInt()
 # set value with
 radius.assign(45);
 # read with
 print (radius.value())
 if el.thisElement.isCircle(p2,radius):
    # ....

 #alternative way (introduced with release 20220923 with a 'List' function:
 p=LayoutScript.point()
 data= el.thisElement.isCircleList(p)
 print (data)  # will print [true,1000]
 #for ruby
 p2=Point.new()
 radius=PointerInt.new()
 # to assign radius use
 radius.assign(34)
 # to output radius use
 puts radius.value()
 if e.thisElement.is_circle(p2,radius)
    #...
 end

bool element::isPath()

Returns: true if element is a path otherwise false


bool element::isPolygon()

Returns: true if element is a polygon otherwise false


bool element::isRaithMBMSPath()

Returns: true, if the element has all information of a Raith MBMS path and the option Setup::gdsStoreRaithExtension is enabled. (introduced with release 20220323)


bool element::isRectangle()

Returns: true if element has a rectangle shape. So for all box elements true will be return. Also polygons and path can have a rectangle shape. For cell references always false will returned. (introduced 20190409)


bool element::isShape()

Returns: true if element has a path, a polygon or a box element. For all other elements false will returned. (introduced 20210105)


bool element::isSquare()

Returns: true if element has a square shape. So for box elements with identical width and height true will be return. For cell references always false will returned. (introduced 20190409)


bool element::isText()

Returns: true if element is a text otherwise false


int element::layerNum

The layer number of a element. It has no function for cellRefs and cellRefArrays.


void element::maximum(point *pos)

The maximum coordinates is returned, if bigger than pos. pos will keep unchanged.


void element::maximumSelect(point *pos)

The maximum coordinates of all selected vertexes is returned, if less than pos. pos will keep unchanged, if nothing is selected.


point element::maximum()

The maximum coordinates is returned.


point element::maximumSelect()

The maximum coordinates of all selected vertexes is returned. The maximum possible coordinate is returned, if the element is not selected.


void element::minimum(point *pos)

The minimum coordinates is returned, if less than pos. pos will keep unchanged, if the design does not contain any element.


void element::minimumSelect(point *pos)

The minimum coordinates of all selected vertexes is returned, if bigger than pos. pos will keep unchanged, if no vertex is selected.


point element::minimum()

The minimum coordinates is returned.


point element::minimumSelect()

The minimum coordinates of all selected elements is returned. The minimum possible coordinate is returned, if the element is not selected.


bool element::replaceText(string old, string new)

If the text is identical with the first argument, it is replaced with the second arugment.

Returns: true, if the text is replaced.


void element::rotate(double ang)

Elements having a transfomation (text, cellref, cellrefArray) will be rotated in deg. This method has no effect on other elements.


void element::scale(double scale)

Elements having a transfomation (text, cellref, cellrefArray) will be scaled. This method has no effect on other elements.


bool element::select

If set to true the whole element is selected. To select a single point use pSelect.


void element::selectAll()

Selects this element completely. To select single points use pselect.


void element::selectDatatype(int t)

If the datatype is t, the element is selected.


void element::selectVisible()

Selects this element if it is visible.


void element::setCap(int cap)

Set the caps for path elements.

Parameters: cap 0 for no caps, 1 for round caps, 2 for square caps.

See also: getCap()


void element::setCellRef(cell* c)

For cell references and cell array references the refered cell is set. It has no effect on other elements. Reading the refered cell is possible with depend.

See also: depend()


void element::setDatatypeSelect(int t)

The datatype is set to t, if the element is selected.


void element::setDatatype(int t)

The datatype is set to t.

See also: getDatatype()


void element::setMirrorx()

sets the mirror attribute for cellrefs, cellrefarrays and text element. Has no effect for other elements.

See also: clearMirrorx(), toggleMirrorx()


void element::setName(string name)

set the text for text element. Has no effect for other elements.

See also: getName()


void element::setNx(int)

For a cell reference arrays the number of repetitions in x direction is set.

See also: getNx()


void element::setNy(int)

For a cell reference arrays the number of repetitions in y direction is set.

See also: getNy()


void element::setPoints(pointArray array)

Sets the cooridinates in the same way as getPoints() read it out.

See also: getPoints()


void element::setPresentation(int pes)

set the presentation for text element. Has no effect for other elements.

Values: Alignment:
0 top/left
1 top/horizontal center
2 top/right
4 vertical centered/left
5 centered
6 vertical centered/right
8 bottom/left
9 bottom/horizontal center
10 bottom/right

See also: getPresentation().


void element::setPropertyString(int num,string s)

set the property num to s

See also: getPropertyString()


void element::setPropertyString(string name,string value)

Set the property with name to value. (introduced with release 20220323)

See also: getPropertyString()


void element::setRaithDosis(double)

Mask writer from the company Raith uses the datatype to store the exposure dosis. The valule in encoded in a special kind. The method will encode the value into the designated form and sets the datatype accordingly. (introduced with release 20220323)


void element::setTrans(strans transfomation)

Sets the transformation for text elements and any cell reference. Will have no effect for any other shape.

See also: getTrans()


void element::setWidth(int width)

Set the width for path and text-elements.

Parameters:

width The height of a text-element/ width of a path is set to this value. Positive value result in a width in drawing-units. Negative value for size in pixel. Set the width for path and text-elements.

See also: getWidth()


void element::toggleMirrorx()

toggles the mirror attribute for cellrefs, cellrefarrays and text element. Has no effect for other elements.

See also: clearMirrorx(), setMirrorx()

Obsolete Members

These methods have been moved to the class point. It may be removed in this class in a coming update.


static double element::angle(point p1, point p2, point p3)

This function return the angle of line p1-p2 and p2-p3.


static double element::angle(point p1, point p2)

This function return the angle of line p1-p2 to the xaxis.


static double element::distance(point p1, point p2)

This function return the distance between p1 and p2 in databaseunits.


static double element::distance(point p1, point p2, point p3)

This function return the shortest distance of p3 to the line p1-p2 in databaseunits.


static int element::round(double d)

This function rounds the double d.