Cyclone 3DR Script
from Technodigit, part of Hexagon. Copyright 1997-2022.
 
Loading...
Searching...
No Matches
SLine.h
1
2
3
5
6#pragma once
7
8#include "RshPluginScript/RshPluginScriptDefines.h"
9#include "RshPluginScript/SClass/SFeature.h"
10
11#ifndef FCT_DOC
12namespace rsh::ScriptBinding
13{
14#endif // !FCT_DOC
15
24class SLine : public SFeature
25{
26 //======================================================================================================================
27 // INTERNAL FUNCTION
28 //======================================================================================================================
29
30 //======================================================================================================================
31 // DOCUMENTED FUNCTION
32 //======================================================================================================================
33
34public slots: // these functions (slots) will be available in QtScript
35
38 // TESTED
42 // TESTED
46 // TESTED
47 Number GetLength() ;
50 // TESTED
51 SetLength(Number iLength);
52
55 // TESTED
56 Number GetPerimeter() ;
57
67 // TESTED
69 Number deflection,
71 Number meanPointDistance
73 ) ;
74
79 // TESTED
80 Number Distance(SPoint iPoint
82 ) ;
83
86 // @retval Array.ErrorCode The error code.
87 // 0 OK, no error
88 // 1 An exception occurred
89 // 2 Invalid list of component or bad or incomplete initialization or impossible to initialize.
90 // 3 Objects are too far from each other: impossible to make bestfit.
91 // @retval Array.Line The computed line.
92 Array BestRevolutionAxis(SComp iSelComp);
93
102 );
103
106 String toString() ;
107};
108
109// @brief
110// This class allows to wrap static functions to SLine easily.
111// This allow to wrap constructor more easily : the constructor will be declared with the function New(...)
112class SLine
113#ifndef FCT_DOC
114 : public SObjectStatic
115#endif // FCT_DOC
116{
117 //======================================================================================================================
118 // INTERNAL FUNCTION
119 //======================================================================================================================
120
121 //======================================================================================================================
122 // DOCUMENTED FUNCTION
123 //======================================================================================================================
124public slots:
127 // TESTED
128 static SLine New();
129
132 // TESTED
133 static SLine New(SLine Other);
134
137 // TESTED
138 static SLine New(
139 SPoint Center,
141 SVector Normal,
143 Number Length
145 );
146
152 // TESTED
153 static SLine New(
154 SPoint Point1,
156 SPoint Point2
158 );
159
169 static Array FromClick() { return SComp::GetFromClick<SLine>(SV_LINE); }
170
174 // TESTED
175 static Array FromName( String Name) { return SComp::GetFromName<SLine>(Name); }
176
180 // TESTED
181 static Array FromSel() { return SFeature::GetFromSel<SLine>(); }
182
186 // TESTED
187 static Array All(
188 Number VisCrit
193 )
194 {
195 return SComp::GetAll<SLine>(VisCrit);
196 }
197
200 static String toString();
201};
202Q_DECLARE_METATYPE(SLine::_SLineDummy);
203Q_DECLARE_METATYPE(SLine);
204
205#ifndef FCT_DOC
206} // namespace rsh::ScriptBinding
207#endif // !FCT_DOC
The SComp class is an abstract class. Use derived classes SCircle, SCylinder, SCloud,...
Definition: SComp.h:32
The SFeature class is an abstract class.
Definition: SFeature.h:19
Line manipulation class. The SLine creation can be done by calling the static functions: .
Definition: SLine.h:25
Array BestRevolutionAxis(SComp iSelComp)
Compute the best revolution axis of a cloud or mesh (using an initial axis necessary to find the best...
SetLength(Number iLength)
Setter for the length.
static Array FromSel()
To get all the selected SComp.
Definition: SLine.h:181
Number GetPerimeter()
Returns the perimeter of the feature.
static SLine New(SPoint Point1, SPoint Point2)
Constructs a new SLine by 2 points.
static SLine New()
Default constructor to create an empty new SLine.
SPoint GetLastPoint()
Returns the second point of the feature.
static Array FromClick()
Launches a click interaction to select a SComp in the scene.
Definition: SLine.h:169
static SLine New(SPoint Center, SVector Normal, Number Length)
Constructs a new SLine by defining its data.
static String toString()
Get the type of the variable.
static Array All(Number VisCrit)
To get all the SComp in the document.
Definition: SLine.h:187
String toString()
Get the type of the variable.
SPoint GetFirstPoint()
Returns the first point of the feature.
Array Discretize(Number deflection, Number meanPointDistance)
To convert the continuous feature into a discretized SMultiline. Only one parameter must be specified...
Array IntersectionBetween2Lines(SLine iSecondLine)
Calculate intersection with another line.
static SLine New(SLine Other)
Constructs an SLine by copying Other.
Number Distance(SPoint iPoint)
Returns the distance between a point and the feature <0 if below/inside the feature >0 if above/outsi...
static Array FromName(String Name)
Search all the component with the given name.
Definition: SLine.h:175
Number GetLength()
Returns the length.
3D point manipulation class. The SPoint creation can be done by calling the static functions:
Definition: SPoint.h:23
The mathematical object vector.
Definition: SVector3.h:26