![]() |
3DCoat Core API
The 3DCoat API documentation.
|
The scene element, like sculpt object or curve. More...
#include <CoreAPI.h>
Public Member Functions | |
| SceneElement (VolumeObject *vo) | |
| SceneElement (ItemsTree *c) | |
| SceneElement (const SceneElement &other) | |
| const bool | operator== (const SceneElement &other) const |
| const bool | operator!= (const SceneElement &other) const |
| SceneElement | parent () const |
| get the parent scene graph element | |
| int | childCount () const |
| returns the child elements count | |
| SceneElement | child (int index) const |
| returns child element by index | |
| bool | isSculptObject () const |
| Check if it is the sculpt object. | |
| bool | isCurve () const |
| Check if the element is curve. | |
| const SceneElement & | setTransform (const mat4 &Transform) const |
| Set the transform matrix. | |
| const SceneElement & | transform (const mat4 &Transform) const |
| Additional transform over the object. | |
| const SceneElement & | density (float density_value) const |
| this command useful if you use voxels, it sets the scale for the volume so that there will be density_value of voxels per mm | |
| const SceneElement & | transform_single (const mat4 &Transform) const |
| Additional transform over the object, not applied to child objects. | |
| mat4 | getTransform () const |
| get the scene element transform | |
| const SceneElement & | clear () const |
| Clear the element content. | |
| const char * | name () const |
| get the element name | |
| const char * | getLinkedPath (int id) const |
| get the linked file path | |
| int | linkedObjectCount () const |
| get the linked file path | |
| void | addLinkedPath (const char *path) const |
| set the linked file path | |
| const SceneElement & | rename (const char *name) const |
| rename the element | |
| SceneElement | addChild (const char *name) const |
| add the child element of the same nature | |
| SceneElement | findInSubtree (const char *name) const |
| find the element in subtree by name | |
| bool | iterateSubtree (const std::function< bool(SceneElement)> &fn) const |
| iterate over the subtree | |
| bool | iterateSubtree (const pybind11::object &fn) const |
| iterate over the subtree | |
| bool | iterateVisibleSubtree (const std::function< bool(SceneElement)> &fn) const |
| iterate over the visible subtree | |
| bool | iterateVisibleSubtree (const pybind11::object &fn) const |
| iterate over the visible subtree | |
| void | mergeSubtree (bool booleanMerge=false) const |
| merge all subtree volumes into this | |
| void | mergeTo (const SceneElement &dest, BoolOpType op) |
| merge the volume to another one, delete this volume | |
| void | copyMergeTo (SceneElement &dest, BoolOpType op) |
| copy and merge the volume to another one, delete this volume | |
| void | removeSubtree () const |
| remove the whole subtree | |
| void | removeSubtreeItem (int index) const |
| remove one child from the subtree | |
| void | remove () const |
| remove this item and all child objects from the scene | |
| SceneElement | duplicate () const |
| diplicate the item | |
| SceneElement | duplicateAsInstance () const |
| create the instance of the object if instancing supported | |
| void | changeParent (SceneElement newParent) const |
| change the parent element for the current one | |
| void | moveTo (SceneElement newParent, int indexInParent) const |
| move the element to another parent | |
| bool | isParentOf (SceneElement child) const |
| check if the element is parent of another one | |
| bool & | visible () const |
| returns own visibility state reference. It does not take into account that parent may be invisible. | |
| void | setVisibility (bool visible) const |
| set the visibility of the element | |
| bool | ghost () const |
| returs the state of ghosting (if available) | |
| void | setGhost (bool ghost) const |
| sets the ghosting state (if available) | |
| vec4 | getReferenceColor () |
| get the reference color for the element | |
| void | setReferenceColor (const vec4 &color) |
| set the reference color for the element | |
| Volume | Volume () const |
| returns the volume object to operate over voxels or surface | |
| void | select () const |
| add the object to selected | |
| void | selectOne () const |
| unselect all similar elements and select this one | |
| void | unselectAll () const |
| unselect all similar objects | |
| bool | selected () |
| Check if the scene element is selected. | |
| void | collectSelected (list< SceneElement > &elemList) |
| Collect the selected elements in the subtree (including this element if selected) | |
| std::vector< SceneElement > | collectSelected () |
| Collect the selected elements in the subtree (including this element if selected) | |
Protected Member Functions | |
| VoxTreeBranch * | tb () const |
| OneCurveObject * | cu () const |
Protected Attributes | |
| ItemsTree * | el |
Friends | |
| class | Scene |
| class | Curve |
| class | Volume |
The scene element, like sculpt object or curve.
| SceneElement coat::SceneElement::addChild | ( | const char * | name | ) | const |
add the child element of the same nature
| name | the name |
| void coat::SceneElement::addLinkedPath | ( | const char * | path | ) | const |
set the linked file path
| void coat::SceneElement::changeParent | ( | SceneElement | newParent | ) | const |
change the parent element for the current one
| newParent | the new parent reference. Pay attention, changing paren is not always possible! |
| SceneElement coat::SceneElement::child | ( | int | index | ) | const |
returns child element by index
| index | the index of the element in subtree |
| int coat::SceneElement::childCount | ( | ) | const |
returns the child elements count
| const SceneElement & coat::SceneElement::clear | ( | ) | const |
Clear the element content.
| void coat::SceneElement::copyMergeTo | ( | SceneElement & | dest, |
| BoolOpType | op ) |
copy and merge the volume to another one, delete this volume
| dest | the destination |
| op | the boolean operation type |
| const SceneElement & coat::SceneElement::density | ( | float | density_value | ) | const |
this command useful if you use voxels, it sets the scale for the volume so that there will be density_value of voxels per mm
| density_value | the voxels per mm |
| SceneElement coat::SceneElement::duplicate | ( | ) | const |
diplicate the item
| SceneElement coat::SceneElement::duplicateAsInstance | ( | ) | const |
create the instance of the object if instancing supported
| SceneElement coat::SceneElement::findInSubtree | ( | const char * | name | ) | const |
find the element in subtree by name
| name | the name t seek |
| const char * coat::SceneElement::getLinkedPath | ( | int | id | ) | const |
get the linked file path
| vec4 coat::SceneElement::getReferenceColor | ( | ) |
get the reference color for the element
| mat4 coat::SceneElement::getTransform | ( | ) | const |
get the scene element transform
| bool coat::SceneElement::ghost | ( | ) | const |
returs the state of ghosting (if available)
| bool coat::SceneElement::isCurve | ( | ) | const |
Check if the element is curve.
| bool coat::SceneElement::isParentOf | ( | SceneElement | child | ) | const |
check if the element is parent of another one
| child | the child element |
| bool coat::SceneElement::isSculptObject | ( | ) | const |
Check if it is the sculpt object.
| bool coat::SceneElement::iterateSubtree | ( | const pybind11::object & | fn | ) | const |
iterate over the subtree
| fn | the function to call, return true if need to stop the iterations, function looks like def fn(el):
...code...
return False or True
|
| bool coat::SceneElement::iterateSubtree | ( | const std::function< bool(SceneElement)> & | fn | ) | const |
iterate over the subtree
| fn | the function to call, return true if need to stop the iterations |
| bool coat::SceneElement::iterateVisibleSubtree | ( | const pybind11::object & | fn | ) | const |
iterate over the visible subtree
| fn | the function to call, return true if need to stop the iterations, function looks like def fn(el):
...code...
return False or True
|
| bool coat::SceneElement::iterateVisibleSubtree | ( | const std::function< bool(SceneElement)> & | fn | ) | const |
iterate over the visible subtree
| fn | the function to call, return true if need to stop the iterations |
| int coat::SceneElement::linkedObjectCount | ( | ) | const |
get the linked file path
| void coat::SceneElement::mergeSubtree | ( | bool | booleanMerge = false | ) | const |
merge all subtree volumes into this
| booleanMerge | use boolean summ to merge. Othervice merge meshes without booleans. This option works only for surfave, in voxels it will always do boolean summ |
| void coat::SceneElement::mergeTo | ( | const SceneElement & | dest, |
| BoolOpType | op ) |
merge the volume to another one, delete this volume
| dest | the destination |
| op | the boolean operation type |
| void coat::SceneElement::moveTo | ( | SceneElement | newParent, |
| int | indexInParent ) const |
move the element to another parent
| newParent | the new parent reference |
| indexInParent | the index in the parent |
| const char * coat::SceneElement::name | ( | ) | const |
| SceneElement coat::SceneElement::parent | ( | ) | const |
get the parent scene graph element
| void coat::SceneElement::removeSubtreeItem | ( | int | index | ) | const |
remove one child from the subtree
| index | index of the child |
| const SceneElement & coat::SceneElement::rename | ( | const char * | name | ) | const |
rename the element
| name | the new name |
| void coat::SceneElement::setGhost | ( | bool | ghost | ) | const |
sets the ghosting state (if available)
| ghost | set true to ghost |
| void coat::SceneElement::setReferenceColor | ( | const vec4 & | color | ) |
set the reference color for the element
| color | the (r, g, b, a) color, each channel is 0..1 |
| const SceneElement & coat::SceneElement::setTransform | ( | const mat4 & | Transform | ) | const |
Set the transform matrix.
| Transform | the transform matrix |
| void coat::SceneElement::setVisibility | ( | bool | visible | ) | const |
set the visibility of the element
| visible | true if need to be visible |
| const SceneElement & coat::SceneElement::transform | ( | const mat4 & | Transform | ) | const |
Additional transform over the object.
| Transform | the matrix |
| const SceneElement & coat::SceneElement::transform_single | ( | const mat4 & | Transform | ) | const |
Additional transform over the object, not applied to child objects.
| Transform | the matrix |
| bool & coat::SceneElement::visible | ( | ) | const |
returns own visibility state reference. It does not take into account that parent may be invisible.