b311480e |
1 | -- Created on: 1994-03-30 |
2 | -- Created by: Laurent BUCHARD |
3 | -- Copyright (c) 1994-1999 Matra Datavision |
4 | -- Copyright (c) 1999-2012 OPEN CASCADE SAS |
5 | -- |
6 | -- The content of this file is subject to the Open CASCADE Technology Public |
7 | -- License Version 6.5 (the "License"). You may not use the content of this file |
8 | -- except in compliance with the License. Please obtain a copy of the License |
9 | -- at http://www.opencascade.org and read it completely before using this file. |
10 | -- |
11 | -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its |
12 | -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. |
13 | -- |
14 | -- The Original Code and all software distributed under the License is |
15 | -- distributed on an "AS IS" basis, without warranty of any kind, and the |
16 | -- Initial Developer hereby disclaims all such warranties, including without |
17 | -- limitation, any warranties of merchantability, fitness for a particular |
18 | -- purpose or non-infringement. Please see the License for the specific terms |
19 | -- and conditions governing the rights and limitations under the License. |
20 | |
7fd59977 |
21 | |
22 | |
23 | |
24 | |
25 | generic class SolidClassifier from TopClass |
26 | (TheSolidExplorer as any; |
27 | TheIntersection3d as any) |
28 | |
29 | ---Purpose: Provides an algorithm to classify a point in a solid. |
30 | |
31 | |
32 | |
33 | uses |
34 | Pnt from gp, |
35 | Face from TopoDS, |
36 | Shape from TopoDS, |
37 | State from TopAbs |
38 | |
39 | raises |
40 | DomainError from Standard |
41 | |
42 | |
43 | |
44 | is |
45 | |
46 | Create |
47 | ---Purpose: Empty constructor. |
48 | returns SolidClassifier from TopClass; |
49 | |
50 | |
51 | Create(S : in out TheSolidExplorer; |
52 | P : Pnt from gp; |
53 | Tol : Real from Standard) |
54 | ---Purpose: Constructor to classify the point P with the |
55 | -- tolerance Tol on the solid S. |
56 | returns SolidClassifier from TopClass; |
57 | |
58 | |
59 | Perform(me : in out; |
60 | S : in out TheSolidExplorer; |
61 | P : Pnt from gp; |
62 | Tol : Real from Standard); |
63 | ---Purpose: Classify the point P with the |
64 | -- tolerance Tol on the solid S. |
65 | |
66 | |
67 | Rejected(me) |
68 | ---Purpose: Returns True if the classification has been |
69 | -- computed by rejection. |
70 | -- The State is then OUT. |
71 | returns Boolean from Standard; |
72 | |
73 | |
74 | State(me) returns State from TopAbs; |
75 | ---Purpose: Returns the result of the classification. |
76 | |
77 | IsOnAFace(me) returns Boolean from Standard; |
78 | ---Purpose: Returns True when the point is a point of a face. |
79 | |
80 | Face(me) |
81 | ---Purpose: Returns the face used to determine the |
82 | -- classification. When the state is ON, this is the |
83 | -- face containing the point. |
84 | -- |
85 | -- When Rejected() returns True, Face() has no signification. |
86 | returns Face from TopoDS; |
87 | |
88 | fields |
89 | |
90 | myFace : Face from TopoDS; |
91 | myState : Integer from Standard; -- 1: Rejected 2: IsOnFace 3: In 4: Out |
92 | |
93 | end SolidClassifier; |