Class Reference drawingField3d

the head class of the 3d design More...

Member

cellList3d* addCell()
cell3d *currentCell
double databaseunits
void deleteAllCell()
void deselectAll()
cellList3d* firstCell
void invertSelect()
bool isEmpty()
bool modified()
void meshDeselect()
void meshSelect()
void openFile(string filename)
void saveFile(string filename)
bool booleanSelected(int op)
void scaleFull()
void selectAll()
void selectVisible()
void setModifyChanged()
void setModifyAdded()
void setModifySaved()
bool showOrigin
void showOriginToggle()
double userunits
double zScale

Detailed Description

graph LR la(layout3d)--drawing-->dr(drawingField3d) dr==firstCell==>cl(cellList3d) dr==currentCell==>ce cl--thisCell-->ce(cell3d) cl--nextCell-->cl ce--firstElement-->el(elementList3d) click la "/layoutscript/api/layout3d" click dr "/layoutscript/api/drawingfield3d" click cl "/layoutscript/api/celllist3d" click ce "/layoutscript/api/cell3d" click el "/layoutscript/api/elementlist3d" classDef thisClas fill:#eaf5fc,stroke:#3c7faa,stroke-width:4px; classDef clas fill:#eaf5fc,stroke:#3c7faa,stroke-width:1px; class dr thisClas class la,cl,ce,el clas

A drawingField3d is the 3d design inside a layout3d window, reached as layout3d->drawing. Hierarchy matches 2d: firstCell lists all 3d cells, currentCell is the cell on screen. Coordinates are integers times databaseunits; userunits is what the widgets show. zScale stretches height so thin stacks are easier to see. Selection, Boolean on meshes, and load or save of the 3d file all go through this object. After you change geometry, setModifyChanged or setModifyAdded marks the design dirty so save will ask.

Example:

drawingField3d *d = layout3d->drawing;
d->openFile("/tmp/part.step");
d->scaleFull();

Member Function Documentation


cellList3d* drawingField3d::addCell()

Adds a cell to the 3d drawing.

Returns: a pointer to the new cellList3d node.


cell3d *drawingField3d::currentCell

The 3d view is hierarchical like the 2d layout. currentCell points to the displayed cell3d.


double drawingField3d::databaseunits

All coordinates are integers. Multiply by this factor to get metres.


void drawingField3d::deleteAllCell()

Deletes every cell in the current design.


void drawingField3d::deselectAll()

Clears the selection.


cellList3d* drawingField3d::firstCell

Head of the linked list of 3d cells.


void drawingField3d::invertSelect()

Inverts the selection in the current cell: selected elements become unselected and the others become selected.


bool drawingField3d::isEmpty()

Returns: true if the design has no elements, otherwise false.


bool drawingField3d::modified()

Returns: true if the design changed after the last save, otherwise false.


void drawingField3d::meshDeselect()

Deselects every mesh element.


void drawingField3d::meshSelect()

Selects every mesh element.


void drawingField3d::openFile(string filename)

Loads the 3d design from filename into the 3d editor.


void drawingField3d::saveFile(string filename)

Saves the 3d design to filename. The format is taken from the file extension.


bool drawingField3d::booleanSelected(int op)

Boolean operation on two selected meshes. op is 0 union, 1 difference, 2 intersection, 3 xor. The result replaces the first selected mesh.

Returns: true if the operation succeeded, otherwise false.


void drawingField3d::scaleFull()

Fits the display scale to the size of the drawing so the whole design is visible.


void drawingField3d::selectAll()

Selects every element.


void drawingField3d::selectVisible()

Selects every visible element.


void drawingField3d::setModifyChanged()

Marks the design as modified.


void drawingField3d::setModifyAdded()

Marks the design as modified by adding a shape.


void drawingField3d::setModifySaved()

Marks the design as saved (unmodified).


bool drawingField3d::showOrigin

If true, the origin (0, 0, 0) is drawn as an arrow on each axis.


void drawingField3d::showOriginToggle()

Toggles the origin arrows on or off.


double drawingField3d::userunits

Scale used to show sizes in the main widget (user units).


double drawingField3d::zScale

Extra scale of the z axis. Use it when the stack is thin compared with x and y, so height is easier to see.