The SComp class is an abstract class.
Use derived classes SCircle, SCylinder, SCloud, SLabel, SMultiline, SPlane, SPoint, SPoly, SClippingPlane.
.
More...
The SComp class is an abstract class.
Use derived classes SCircle, SCylinder, SCloud, SLabel, SMultiline, SPlane, SPoint, SPoly, SClippingPlane.
.
- This class allows to display 3D objects in the current document.
All derived classes can be added to the scene or removed from the scene
var myCircle = SCircle.New();
myCircle.AddToDoc(); // Display the circle in the current document
myCircle.RemoveFromDoc(); // The circle disappears from the document
- SComp provide functionality to manipulate the 3D Object: translation, rotation, scale.
var myCircle = SCircle.New(center, normal, radius);
var mat = SMatrix.New();
mat.InitScale(SPoint.New(), 5, 5, 5);
myCircle.ApplyTransformation(mat); // Apply a scale on the circle 'myCircle'
- And to manage aspect: SetVisibility(), SetColors(), SetTransparency().
- Note
- A useful function is GetBoundingBox() which returns the upper point and lower point of the bounding box.
◆ RepresentationTypeEnum
The different representation types for inherited classes.
Use (inherited class).SMOOTH. Example: for a cloud, use SCloud.SMOOTH.
Enumerator |
---|
SMOOTH | |
FLAT | |
WIRE | |
SMOOTH_WIRE | |
FLAT_WIRE | |
SMOOTH_ROTWIRE | |
FLAT_ROTWIRE | |
TEXTURE | |
INSPECTION | |
◆ AddToDoc
◆ All
static Array SComp::All |
( |
Number |
VisCrit | ) |
|
|
inlinestaticslot |
To get all the SComp in the document.
- Return values
-
Array | all the SComp contained in the document |
- Parameters
-
[in] | VisCrit | Visible selection criteria
- 0 Keep if not visible
- 1 Keep if visible
- 2 (Default) Indifferent
|
◆ ApplyTransformation
SComp::ApplyTransformation |
( |
SMatrix |
iMatrix | ) |
|
|
slot |
To apply a geometric transformation to the current object by making a product with the given matrix.
- See also
- Translate
- Parameters
-
[in] | iMatrix | The transformation matrix |
◆ Clear
To deallocate object memory.
◆ FromClick
static Array SComp::FromClick |
( |
| ) |
|
|
inlinestaticslot |
Displays a dialog box to select an SComp in the scene.
- Warning
- This function will break the script, and wait for user interaction
- Return values
-
Array.ErrorCode | The error code
- 0: Success, the SComp is selected.
- 1: Nothing is selected.
- 2: The ESCape key has been pressed
|
Array.Comp | the SComp selected |
◆ FromName
static Array SComp::FromName |
( |
String |
Name | ) |
|
|
inlinestaticslot |
Search all the component with the given name.
- Return values
-
Array | all the SComp with the given name |
◆ FromSel
static Array SComp::FromSel |
( |
| ) |
|
|
staticslot |
To get all the selected SComp.
- Return values
-
Array | all the SComp selected |
◆ GetBoundingBox
Array SComp::GetBoundingBox |
( |
| ) |
|
|
slot |
Calculates the bounding box of the component.
- Return values
-
Array.ErrorCode | The error code:
- 0 OK, the bounding box could be calculated
- 1 if the bounding box could NOT be calculated
|
Array.LowPoint | The lower SPoint |
Array.UpPoint | The upper SPoint |
◆ GetColors
Array SComp::GetColors |
( |
| ) |
|
|
slot |
To get the colors of the component.
- Return values
-
Array.Red | the red color (0 to 1) |
Array.Green | the green color (0 to 1) |
Array.Blue | the blue color (0 to 1) |
◆ GetFolderName
String SComp::GetFolderName |
( |
| ) |
|
|
slot |
- Returns
- The component containing folder's name
◆ GetName
String SComp::GetName |
( |
| ) |
|
|
slot |
- Returns
- The component's name
◆ Invert
Normal of the component is inverted.
◆ IsInDoc
Boolean SComp::IsInDoc |
( |
| ) |
|
|
slot |
Return if the component is in the document or not.
- Returns
- Return true if the component is in the document.
◆ IsVisible
Boolean SComp::IsVisible |
( |
| ) |
|
|
slot |
- Return values
-
true | The component is visible |
false | The component is not visible |
- See also
- SetVisibility()
◆ MoveToGroup
SComp::MoveToGroup |
( |
String |
GroupPath, |
|
|
Boolean |
MoveInsideTopParent |
|
) |
| |
|
slot |
Move the object to the document group represent by the given path. If some groups, in the path, don't exist, they will be created.
- Warning
- The object must be inside the document. Else this function won't do anything.
myPlane.MoveToGroup("Building/Wall");
myOtherPlane.MoveToGroup("/Building Group/Wall", false);
- See also
- AddToDoc
- Parameters
-
[in] | GroupPath | The path where the object will be moved. Each group must be separated by character '/'. |
[in] | MoveInsideTopParent | If true (default value), the object will be moved inside the top
- parent group there it is ("Geometric Group", "Cloud Group", "Mesh Group", etc.). Else, if false, the first group in the path will be the new top parent.
|
◆ RemoveFromDoc
To remove the object from the document.
◆ SetClippable
SComp::SetClippable |
( |
Boolean |
clipping | ) |
|
|
slot |
◆ SetColors
SComp::SetColors |
( |
Number |
Red, |
|
|
Number |
Green, |
|
|
Number |
Blue |
|
) |
| |
|
slot |
Sets the colors of the component.
- Parameters
-
[in] | Red | red 0 to 1 |
[in] | Green | green 0 to 1 |
[in] | Blue | blue 0 to 1 |
◆ SetName
SComp::SetName |
( |
String |
ComponentName | ) |
|
|
slot |
To set the component's name.
- Parameters
-
[in] | ComponentName | The new component name |
◆ SetRepresentationType
The shading type of the component is modified.
- Parameters
-
[in] | Representation | The representation type |
◆ SetTransparency
SComp::SetTransparency |
( |
Number |
Alpha | ) |
|
|
slot |
Sets the transparency of the component.
- Parameters
-
[in] | Alpha | Transparency 0 to 255 |
◆ SetVisibility
SComp::SetVisibility |
( |
Boolean |
Visible | ) |
|
|
slot |
Sets the component to be visible, or not visible.
- See also
- IsVisible()
- Parameters
-
[in] | Visible | True to set the component visible, else false |
◆ toString [1/2]
String SComp::toString |
( |
| ) |
|
|
slot |
Get the type of the variable.
◆ toString [2/2]
String SComp::toString |
( |
| ) |
|
|
slot |
Get the type of the variable.
◆ Translate
To make a translation of the current object with an SVector.
- See also
- ApplyTransformation
- Parameters
-
[in] | Vector | The translation vector |