Class Reference element

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

Member

void clearMirrorx()
int datatype
void deleteSelect()
cell* depend()
void deselectAll()
rect getBoundingBox()
int getCap()
int getDatatype()
string getName()
int getNx()
int getNy()
pointArray getPoints()
pointArray getSelectedPoints()
string getPropertyString(int num)
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 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 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

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.


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.


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.


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.


int element::getNy()

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


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.


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.


strans element::getTrans()

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


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:

 # for python
 p2=point()
 radius=pointerInt()
 # set value with
 radius.assign(45);
 # read with
 print (radius.value())
 if e.thisElement.isCircle(p2,radius):
    # ....
 #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::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.


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.


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.


void element::setNy(int)

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


void element::setPoints(pointArray array)

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


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

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.


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.