Class Reference element3d

A element of the 3d drawing. More...

Member

void addPointArray(pointArray polygon, int level,bool side )
void addSlantSide(pointArray bottom,pointArray top, int levelBottom, int levelTop)
void addSide(pointArray polygon,int levelBottom, int levelTop)
void deselectAll()
int getLayer()
int getColorRed()
int getColorGreen()
int getColorBlue()
string getName()
bool isCellref()
bool isMesh()
bool isVisible()
bool select
void selectAll()
void setLayer(int layer)
void setName(string)
bool visible

Detailed Description

graph LR ce(cell3d)--firstElement-->el(elementList3d) el--thisElement-->e(element3d) el--nextElement-->el click ce "/layoutscript/api/cell3d" click el "/layoutscript/api/elementlist3d" click e "/layoutscript/api/element3d" classDef thisClas fill:#eaf5fc,stroke:#3c7faa,stroke-width:4px; classDef clas fill:#eaf5fc,stroke:#3c7faa,stroke-width:1px; class e thisClas class ce,el clas

An element3d is one object in a 3d cell: either a mesh or a 3d cell reference. You reach it from firstElement on a cell3d through an elementList3d node and thisElement. isMesh and isCellref tell you which members apply; addPointArray, addSide and addSlantSide add faces only to a mesh. getLayer and setLayer choose the display layer; a negative layer number uses a colour that is not taken from the layer setup. select and selectAll mark the element. isVisible is true only when the visible flag is set and the layer is shown.

Example:

elementList3d *el = layout3d->drawing->currentCell->firstElement;
while (el != NULL) {
 element3d *e = el->thisElement;
 if (e != NULL && e->isMesh()) {
 e->selectAll();
 }
 el = el->nextElement;
}

Member Function Documentation


void element3d::addPointArray(pointArray polygon, int level,bool side )

If this element is a mesh, adds a horizontal face from polygon at z level. If side is true, vertical walls are added as well.

Parameter:
polygon outline of the face
level z of the face
side true to add side walls

void element3d::addSlantSide(pointArray bottom,pointArray top, int levelBottom, int levelTop)

If this element is a mesh, adds a slanted ring between bottom at levelBottom and top at levelTop.

Parameter:
bottom bottom outline
top top outline
levelBottom z of the bottom outline
levelTop z of the top outline

void element3d::addSide(pointArray polygon,int levelBottom, int levelTop)

If this element is a mesh, adds a vertical wall along polygon from levelBottom to levelTop.

Parameter:
polygon outline
levelBottom lower z of the wall
levelTop upper z of the wall

void element3d::deselectAll()

Clears the selection of this element.


int element3d::getLayer()

Returns: the layer number of this element. See setLayer.


int element3d::getColorRed()

Returns: the red component of a mesh colour, 0–255. Not valid for a cell reference.


int element3d::getColorGreen()

Returns: the green component of a mesh colour, 0–255. Not valid for a cell reference.


int element3d::getColorBlue()

Returns: the blue component of a mesh colour, 0–255. Not valid for a cell reference.


string element3d::getName()

Returns: the informative name set with setName, or the name a generation tool stored.


bool element3d::isCellref()

Returns: true if this element is a cell reference.


bool element3d::isMesh()

Returns: true if this element is a mesh.


bool element3d::isVisible()

Returns: true if visible is set and the layer is shown.


bool element3d::select

true if this element is completely selected.


void element3d::selectAll()

Selects this element completely.


void element3d::setLayer(int layer)

Sets the layer of this mesh. A non-negative layer that exists in the layer setup uses that layer colour. A negative layer uses a colour that is not taken from the layer setup. Cell references ignore the layer.


void element3d::setName(string)

Sets the informative name. It is shown in the foot of the 3d window when the pointer highlights the element, and some 3d file formats store it.


bool element3d::visible

Per-element visibility. isVisible also requires the layer to be shown.