Commit | Line | Data |
---|---|---|

b311480e | 1 | -- Created on: 1993-06-16 |

2 | -- Created by: Isabelle GRIGNON | |

3 | -- Copyright (c) 1993-1999 Matra Datavision | |

973c2be1 | 4 | -- Copyright (c) 1999-2014 OPEN CASCADE SAS |

b311480e | 5 | -- |

973c2be1 | 6 | -- This file is part of Open CASCADE Technology software library. |

b311480e | 7 | -- |

d5f74e42 | 8 | -- This library is free software; you can redistribute it and/or modify it under |

9 | -- the terms of the GNU Lesser General Public License version 2.1 as published | |

973c2be1 | 10 | -- by the Free Software Foundation, with special exception defined in the file |

11 | -- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT | |

12 | -- distribution for complete text of the license and disclaimer of any warranty. | |

b311480e | 13 | -- |

973c2be1 | 14 | -- Alternatively, this file may be used under the terms of Open CASCADE |

15 | -- commercial license or contractual agreement. | |

7fd59977 | 16 | |

17 | class PEquation from GProp | |

18 | ||

19 | ---Purpose: A framework to analyze a collection - or cloud | |

20 | -- - of points and to verify if they are coincident, | |

21 | -- collinear or coplanar within a given precision. If | |

22 | -- so, it also computes the mean point, the mean | |

23 | -- line or the mean plane of the points. If not, it | |

24 | -- computes the minimal box which includes all the points. | |

25 | ||

26 | ||

27 | uses Pnt from gp, | |

28 | Pln from gp, | |

29 | Lin from gp, | |

30 | Vec from gp, | |

31 | EquaType from GProp, | |

32 | Array1OfPnt from TColgp | |

33 | ||

34 | ||

35 | raises NoSuchObject from Standard | |

36 | ||

37 | is | |

38 | ||

39 | Create(Pnts: Array1OfPnt;Tol : Real from Standard) | |

40 | returns PEquation from GProp; | |

41 | ---Purpose: Constructs a framework to analyze the | |

42 | -- collection of points Pnts and computes: | |

43 | -- - the mean point if the points in question are | |

44 | -- considered to be coincident within the precision Tol, or | |

45 | -- - the mean line if they are considered to be | |

46 | -- collinear within the precision Tol, or | |

47 | -- - the mean plane if they are considered to be | |

48 | -- coplanar within the precision Tol, or | |

49 | -- - the minimal box which contains all the points. Use : | |

50 | -- - the functions IsPoint, IsLinear, IsPlanar | |

51 | -- and IsSpace to find the result of the analysis, and | |

52 | -- - the function Point, Line, Plane or Box to | |

53 | -- access the computed result. | |

54 | ||

55 | IsPlanar(me) returns Boolean | |

56 | ---Purpose: Returns true if, according to the given | |

57 | -- tolerance, the points analyzed by this framework are coplanar. | |

58 | -- Use the function Plane to access the computed result. | |

59 | is static; | |

60 | ||

61 | IsLinear(me) returns Boolean | |

62 | ---Purpose: Returns true if, according to the given | |

63 | -- tolerance, the points analyzed by this framework are colinear. | |

64 | -- Use the function Line to access the computed result. | |

65 | is static; | |

66 | ||

67 | IsPoint(me) returns Boolean | |

68 | ---Purpose: Returns true if, according to the given | |

69 | -- tolerance, the points analyzed by this framework are coincident. | |

70 | -- Use the function Point to access the computed result. | |

71 | is static; | |

72 | ||

73 | IsSpace(me) returns Boolean | |

74 | ---Purpose: Returns true if, according to the given | |

75 | -- tolerance value, the points analyzed by this | |

76 | -- framework are neither coincident, nor collinear, nor coplanar. | |

77 | -- Use the function Box to query the smallest box | |

78 | -- that includes the collection of points. | |

79 | is static; | |

80 | ||

81 | Plane(me) returns Pln from gp | |

82 | raises NoSuchObject | |

83 | ---Purpose: Returns the mean plane passing near all the | |

84 | -- points analyzed by this framework if, according | |

85 | -- to the given precision, the points are considered to be coplanar. | |

86 | -- Exceptions | |

87 | -- Standard_NoSuchObject if, according to the | |

88 | -- given precision value, the points analyzed by | |

89 | -- this framework are considered to be: | |

90 | -- - coincident, or | |

91 | -- - collinear, or | |

92 | -- - not coplanar. | |

93 | is static; | |

94 | ||

95 | Line(me) returns Lin from gp | |

96 | raises NoSuchObject | |

97 | ---Purpose: Returns the mean line passing near all the | |

98 | -- points analyzed by this framework if, according | |

99 | -- to the given precision value, the points are considered to be collinear. | |

100 | -- Exceptions | |

101 | -- Standard_NoSuchObject if, according to the | |

102 | -- given precision, the points analyzed by this | |

103 | -- framework are considered to be: | |

104 | -- - coincident, or | |

105 | -- - not collinear. | |

106 | is static; | |

107 | ||

108 | Point(me) returns Pnt from gp | |

109 | raises NoSuchObject | |

110 | ---Purpose: Returns the mean point of all the points | |

111 | -- analyzed by this framework if, according to the | |

112 | -- given precision, the points are considered to be coincident. | |

113 | -- Exceptions | |

114 | -- Standard_NoSuchObject if, according to the | |

115 | -- given precision, the points analyzed by this | |

116 | -- framework are not considered to be coincident. | |

117 | is static; | |

118 | ||

119 | Box(me; P : out Pnt from gp; V1,V2,V3 : out Vec from gp) | |

120 | ---Purpose: Returns the definition of the smallest box which | |

121 | -- contains all the points analyzed by this | |

122 | -- framework if, according to the given precision | |

123 | -- value, the points are considered to be neither | |

124 | -- coincident, nor collinear and nor coplanar. | |

125 | -- This box is centered on the barycenter P of the | |

126 | -- collection of points. Its sides are parallel to the | |

127 | -- three vectors V1, V2 and V3, the length of | |

128 | -- which is the length of the box in the corresponding direction. | |

129 | -- Note: Vectors V1, V2 and V3 are parallel to | |

130 | -- the three axes of principal inertia of the system | |

131 | -- composed of the collection of points where each point is of equal mass. | |

132 | -- Exceptions | |

133 | -- Standard_NoSuchObject if, according to the given precision, | |

134 | -- the points analyzed by this framework are considered to be coincident, collinear or coplanar. | |

135 | is static; | |

136 | ||

137 | fields | |

138 | ||

139 | type : EquaType from GProp; | |

140 | g : Pnt from gp; | |

141 | v1 : Vec from gp; | |

142 | v2 : Vec from gp; | |

143 | v3 : Vec from gp; | |

144 | end PEquation; | |

145 |