Signals | |
void | shapeClicked (QString shapeName, int x, int y, int z, int transparency) |
void | unselect () |
Public Member Functions | |
void | addShape (string shapeType, string shapeName, dyn_string geometry) |
void | addGroup (string groupName, string groupParentName) |
void | addShapeInGroup (string groupName, string shapeType, string ShapeName, dyn_string property) |
void | delShape (string shapeOrGroupName) |
dyn_string | getShapeInfo (string shapeName, dyn_string geometry) |
void | setGeometry (string shapeOrGroupName, dyn_string geometry) |
void | setColor (string shapeOrGroupName, string color) |
void | setColorRGB (string shapeOrGroupName, string color) |
void | setTransparency (string shapeOrGroupName, string transparency) |
void | addTexture (string shape, string texturePath) |
void | setViewing (bool enable) |
void | setDecoration (bool enable) |
void | seekToShape (string name) |
void | setSeek (bool enable) |
void | setBackgroundColor (string color) |
void | setBackgroundColorRGB (string color) |
void | setCamera (dyn_string cameraSettings) |
dyn_string | getCamera () |
dyn_string | getGroupShapes (string groupName) |
void | viewAll () |
void | setHeadlight (bool on) |
void fw3DViewer::addGroup | ( | string | groupName, | |
string | groupParentName | |||
) |
Add a group
Adds a group atached to the group GroupParentName
.
groupName | Name of the group to create. | |
groupParentName | Name of the parent group; note that the toplevel group is called "root". |
void fw3DViewer::addShape | ( | string | shapeType, | |
string | shapeName, | |||
dyn_string | geometry | |||
) |
Add a shape to the scene.
Add a shape of type ShapeType
, with name ShapeName
and specified geometry properties to the scene.
The new shape is attached to the toplevel "root" group.
shapeType | type of the created shape; see Available Shape Types and Their Parameters | |
shapeName | name (unique identifier) given to the new shape. | |
geometry | the list of geometry properties for the new shape |
void fw3DViewer::addShapeInGroup | ( | string | groupName, | |
string | shapeType, | |||
string | ShapeName, | |||
dyn_string | property | |||
) |
Add a shape in a specified group
Add a shape of type shapeType
, with name shapeName
and specified geometry. The new shape is put in the group specified by groupName
. If the group groupName
does not exist, it is firstly created as a child of the "root" group.
groupName | name of the group in which the shape is created | |
shapeType | type of the created shape; see Available Shape Types and Their Parameters | |
ShapeName | name (unique identifier) given to the new shape. | |
property | the list of geometry properties for the new shape |
void fw3DViewer::addTexture | ( | string | shape, | |
string | texturePath | |||
) |
Add a texture to the indicated shape.
Note! You need the "simage" libary (extension to COIN3D) to use this function. More information (including the supported image formats, etc) see http://www.coin3d.org/lib/simage
shape | the name of the shape to put the texture on | |
texturePath | path and filename of the texture bitmap. |
void fw3DViewer::delShape | ( | string | shapeOrGroupName | ) |
Delete a shape or group of shapes.
Deleting the "root" group clears the scene.
shapeOrGroupName | name of the shape or group of shapes to delete. |
dyn_string fw3DViewer::getCamera | ( | ) |
Gets the actual position and rotation of the camera.
dyn_string fw3DViewer::getGroupShapes | ( | string | groupName | ) |
Gets the shapes inside a group.
dyn_string fw3DViewer::getShapeInfo | ( | string | shapeName, | |
dyn_string | geometry | |||
) |
Gets the list of shape properties
shapeName | Name of the shape for which properties are queried | |
geometry | dyn_string with the list of property names which are queried; see the list of properties for every shape type in Available Shape Types and Their Parameters |
geometry
parameter, in the same order void fw3DViewer::seekToShape | ( | string | name | ) |
Navigate (seek) to specified shape
name | name of the shape to navigate to |
void fw3DViewer::setBackgroundColor | ( | string | color | ) |
Change the background color of the scene with a WinCC OA color.
color | WinCC OA color name. |
void fw3DViewer::setBackgroundColorRGB | ( | string | color | ) |
Change the background color of the scene with any RGB color.
color | Color specified as a string in the "r,g,b" format, where r,g,b are the values for red, green and blue component, in a range from 0.00 to 1.00. Alternatively, one can also use the standard HTML color coding ("#RRGGBB"). |
void fw3DViewer::setCamera | ( | dyn_string | cameraSettings | ) |
Move the position and the rotation of the camera dyn_string with the format (x,y,z,VrotX, VrotY, VrotZ, Rot), for the new rotation of the camera. Values VrotX, VrotY, VrotZ specify the view direction as a vector (range from -1.00 to 1.00) and Rot specifies the rotation angle along the view direction (in radians).
void fw3DViewer::setColor | ( | string | shapeOrGroupName, | |
string | color | |||
) |
Modify the color of the shape or group of shapes.
shapeOrGroupName | Name of a group or a shape. | |
color | WinCC OA color name. |
void fw3DViewer::setColorRGB | ( | string | shapeOrGroupName, | |
string | color | |||
) |
Modify the color of the shape or group of shapes, using RGB color
shapeOrGroupName | Name of a group or a shape. | |
color | Color of the shape or group, specified as a string in the "r,g,b" format, where r,g,b are the values for red,green and blue component, in a range from 0.00 to 1.00. Alternatively, one can also use the standard HTML color coding ("#RRGGBB") . |
void fw3DViewer::setDecoration | ( | bool | enable | ) |
Show/hide "decorations" in the widget.
enable | true for show, false for hide. |
void fw3DViewer::setGeometry | ( | string | shapeOrGroupName, | |
dyn_string | geometry | |||
) |
Modify the geometrical properties of a shape or group
If you modify the properties of a group, the changes are applied to all its members; note that the function "cascades" to all subgroups, ie. it will also affect all shapes in all subgroups of the specified group.
shapeOrGroupName | Name of a group or a shape. | |
geometry | dyn_string with the new properties. |
void fw3DViewer::setHeadlight | ( | bool | on | ) |
Turn the camera headlight on or off
void fw3DViewer::setSeek | ( | bool | enable | ) |
Activate the seek mode.
After the seek mode is activated, the camera navigates ("seeks") to the shape that was clicked in the mouse. Note that the seek mode is deactivated after the first click.
enable | true for enable the mode, false for disable. |
void fw3DViewer::setTransparency | ( | string | shapeOrGroupName, | |
string | transparency | |||
) |
Modify the transparency of the shape or group of shapes.
shapeOrGroupName,: | Name of a group or a shape. | |
transparency,: | transparency of the shape or group. Transparency needs to be expressed as a number ranging from 0.00 (completly opaque) to 1.00 (completly trasparent). |
void fw3DViewer::setViewing | ( | bool | enable | ) |
Switch between the "Viewing" and "Picking" mode of the widget
enable | true for Viewing mode, false for Picking mode. |
void fw3DViewer::shapeClicked | ( | QString | shapeName, | |
int | x, | |||
int | y, | |||
int | z, | |||
int | transparency | |||
) | [signal] |
Event emited when a shape is clicked in the "Picking" mode.
The function related to the shapeClicked event is called when a shape is clicked while the "Picking" mode is active.
The following parameters, describing the clicked object, are passed to it:
shapeName | name of the clicked shape. | |
x | current x-position of the shape. | |
y | current y-position of the shape. | |
z | current z-position of the shape. | |
transparency | current transparency of the shape. |
void fw3DViewer::unselect | ( | ) | [signal] |
Event emited when a user click outside any shape in select mode.
void fw3DViewer::viewAll | ( | ) |
Reposition the camera so we can see the complete scene.