42cf5bc1 |
1 | // Created on: 1998-08-12 |
2 | // Created by: Galina KULIKOVA |
3 | // Copyright (c) 1998-1999 Matra Datavision |
4 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
5 | // |
6 | // This file is part of Open CASCADE Technology software library. |
7 | // |
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 |
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. |
13 | // |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
16 | |
17 | #ifndef _ShapeFix_Shell_HeaderFile |
18 | #define _ShapeFix_Shell_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
42cf5bc1 |
21 | |
d1a67b9d |
22 | #include <Message_ProgressIndicator.hxx> |
42cf5bc1 |
23 | #include <TopoDS_Shell.hxx> |
24 | #include <TopoDS_Compound.hxx> |
42cf5bc1 |
25 | #include <ShapeFix_Root.hxx> |
42cf5bc1 |
26 | #include <ShapeExtend_Status.hxx> |
d1a67b9d |
27 | |
42cf5bc1 |
28 | class ShapeFix_Face; |
29 | class TopoDS_Shell; |
42cf5bc1 |
30 | class TopoDS_Shape; |
31 | class TopoDS_Compound; |
32 | class ShapeExtend_BasicMsgRegistrator; |
33 | |
42cf5bc1 |
34 | class ShapeFix_Shell; |
35 | DEFINE_STANDARD_HANDLE(ShapeFix_Shell, ShapeFix_Root) |
36 | |
37 | //! Fixing orientation of faces in shell |
38 | class ShapeFix_Shell : public ShapeFix_Root |
39 | { |
40 | |
41 | public: |
42 | |
43 | |
44 | //! Empty constructor |
45 | Standard_EXPORT ShapeFix_Shell(); |
46 | |
47 | //! Initializes by shell. |
48 | Standard_EXPORT ShapeFix_Shell(const TopoDS_Shell& shape); |
49 | |
50 | //! Initializes by shell. |
51 | Standard_EXPORT void Init (const TopoDS_Shell& shell); |
52 | |
53 | //! Iterates on subshapes and performs fixes |
54 | //! (for each face calls ShapeFix_Face::Perform and |
55 | //! then calls FixFaceOrientation). The passed progress |
56 | //! indicator allows user to consult the current progress |
57 | //! stage and abort algorithm if needed. |
58 | Standard_EXPORT Standard_Boolean Perform (const Handle(Message_ProgressIndicator)& theProgress = 0); |
59 | |
60 | //! Fixes orientation of faces in shell. |
61 | //! Changes orientation of face in the shell, if it is oriented opposite |
62 | //! to neigbouring faces. If it is not possible to orient all faces in the |
63 | //! shell (like in case of mebious band), this method orients only subset |
64 | //! of faces. Other faces are stored in Error compound. |
65 | //! Modes : |
66 | //! isAccountMultiConex - mode for account cases of multiconnexity. |
67 | //! If this mode is equal to Standard_True, separate shells will be created |
68 | //! in the cases of multiconnexity. If this mode is equal to Standard_False, |
69 | //! one shell will be created without account of multiconnexity.By defautt - Standard_True; |
70 | //! NonManifold - mode for creation of non-manifold shells. |
71 | //! If this mode is equal to Standard_True one non-manifold will be created from shell |
72 | //! contains multishared edges. Else if this mode is equal to Standard_False only |
73 | //! manifold shells will be created. By default - Standard_False. |
74 | Standard_EXPORT Standard_Boolean FixFaceOrientation (const TopoDS_Shell& shell, const Standard_Boolean isAccountMultiConex = Standard_True, const Standard_Boolean NonManifold = Standard_False); |
75 | |
76 | //! Returns fixed shell (or subset of oriented faces). |
77 | Standard_EXPORT TopoDS_Shell Shell(); |
78 | |
79 | //! In case of multiconnexity returns compound of fixed shells |
80 | //! else returns one shell.. |
81 | Standard_EXPORT TopoDS_Shape Shape(); |
82 | |
83 | //! Returns Number of obtainrd shells; |
84 | Standard_EXPORT Standard_Integer NbShells() const; |
85 | |
86 | //! Returns not oriented subset of faces. |
87 | Standard_EXPORT TopoDS_Compound ErrorFaces() const; |
88 | |
89 | //! Returns the status of the last Fix. |
90 | Standard_EXPORT Standard_Boolean Status (const ShapeExtend_Status status) const; |
91 | |
92 | //! Returns tool for fixing faces. |
93 | Handle(ShapeFix_Face) FixFaceTool(); |
94 | |
95 | //! Sets message registrator |
96 | Standard_EXPORT virtual void SetMsgRegistrator (const Handle(ShapeExtend_BasicMsgRegistrator)& msgreg) Standard_OVERRIDE; |
97 | |
98 | //! Sets basic precision value (also to FixWireTool) |
99 | Standard_EXPORT virtual void SetPrecision (const Standard_Real preci) Standard_OVERRIDE; |
100 | |
101 | //! Sets minimal allowed tolerance (also to FixWireTool) |
102 | Standard_EXPORT virtual void SetMinTolerance (const Standard_Real mintol) Standard_OVERRIDE; |
103 | |
104 | //! Sets maximal allowed tolerance (also to FixWireTool) |
105 | Standard_EXPORT virtual void SetMaxTolerance (const Standard_Real maxtol) Standard_OVERRIDE; |
106 | |
107 | //! Returns (modifiable) the mode for applying fixes of |
108 | //! ShapeFix_Face, by default True. |
109 | Standard_Integer& FixFaceMode(); |
110 | |
111 | //! Returns (modifiable) the mode for applying |
112 | //! FixFaceOrientation, by default True. |
113 | Standard_Integer& FixOrientationMode(); |
114 | |
115 | |
116 | |
117 | |
92efcf78 |
118 | DEFINE_STANDARD_RTTIEXT(ShapeFix_Shell,ShapeFix_Root) |
42cf5bc1 |
119 | |
120 | protected: |
121 | |
122 | |
123 | TopoDS_Shell myShell; |
124 | TopoDS_Compound myErrFaces; |
125 | Standard_Integer myStatus; |
126 | Handle(ShapeFix_Face) myFixFace; |
127 | Standard_Integer myFixFaceMode; |
128 | Standard_Integer myFixOrientationMode; |
129 | Standard_Integer myNbShells; |
130 | |
131 | |
132 | private: |
133 | |
134 | |
135 | |
136 | |
137 | }; |
138 | |
139 | |
140 | #include <ShapeFix_Shell.lxx> |
141 | |
142 | |
143 | |
144 | |
145 | |
146 | #endif // _ShapeFix_Shell_HeaderFile |