the fair gds editor MacroClassElement

Element Class Reference

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

See also: List of Classes


Detailed Description

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

   1 //...
   2 element *e=layout->drawing->currentCell->firstElement->thisElement;
   3 if (e!=NULL) {
   4   e->layerNum=23;
   5   if (e->isPath()) e->setWidth(34);
   6   if (e->isBox()) e->selectAll();
   7 }
   8 
   9 //...
  10 

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

   1 point p1(34,87);
   2 point p2(267,142);
   3 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.

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.

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.

void element::deselectAll()

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

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

caps of a GDS path

For all other elements 0 is returned.

(introduced with version 20130312)

int element::getDatatype()

The value of datatype property is returned.

See also: datatype

string element::getName()

The text contents for text element is returned. Has no effect for other elements. To set the text contents use 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.

(introduced with version 20130301)

int element::getNy()

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

(introduced with version 20130301)

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.

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.

strans element::getTrans()

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

(introduced with version 20130301)

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.

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:

   1  # for python
   2  p2=point()
   3  radius=pointerInt()
   4  # set value with
   5  radius.assign(45);
   6  # read with
   7  print (radius.value())
   8  if e.thisElement.isCircle(p2,radius):
   9     # ....

   1  #for ruby
   2  p2=Point.new()
   3  radius=PointerInt.new()
   4  # to assign radius use
   5  radius.assign(34)
   6  # to output radius use
   7  puts radius.value()
   8  if e.thisElement.is_circle(p2,radius)
   9     #...
  10  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::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.

(introduced with version 20130308)

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.

(introduced with version 20130308)

point element::maximum()

The maximum coordinates is returned.

(introduced with version 20130308)

point element::maximumSelect()

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

(introduced with version 20130308)

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.

(introduced with version 20130308)

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.

(introduced with version 20130308)

point element::minimum()

The minimum coordinates is returned.

(introduced with version 20130120)

point element::minimumSelect()

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

(introduced with version 20130308)

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. (introduced with verion 20120824)

void element::scale(double scale)

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

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.

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.

(introduced with version 20130301)

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.

void element::setMirrorx()

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

void element::setName(string name)

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

void element::setNx(int)

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

(introduced with version 20130301)

void element::setNy(int)

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

(introduced with version 20130301)

void element::setPoints(pointArray array)

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

(introduced with version 20130301)

void element::setPresentation(int pes)

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

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

set the property num to s

void element::setTrans(strans transfomation)

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

(introduced with version 20130301)

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.

void element::toggleMirrorx()

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

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.

See also


CategoryMacroClass


MacroClassElement (last edited 2017-05-07 09:15:59 by JurgenThies)