0031035: Coding - uninitialized class fields reported by Visual Studio Code Analysis
[occt.git] / src / ShapeUpgrade / ShapeUpgrade_FaceDivide.hxx
1 // Created on: 1998-02-18
2 // Created by: Pierre BARRAS
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 _ShapeUpgrade_FaceDivide_HeaderFile
18 #define _ShapeUpgrade_FaceDivide_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
22
23 #include <TopoDS_Face.hxx>
24 #include <Standard_Boolean.hxx>
25 #include <Standard_Integer.hxx>
26 #include <ShapeUpgrade_Tool.hxx>
27 #include <ShapeExtend_Status.hxx>
28 class ShapeUpgrade_SplitSurface;
29 class ShapeUpgrade_WireDivide;
30
31 // resolve name collisions with X11 headers
32 #ifdef Status
33   #undef Status
34 #endif
35
36 class ShapeUpgrade_FaceDivide;
37 DEFINE_STANDARD_HANDLE(ShapeUpgrade_FaceDivide, ShapeUpgrade_Tool)
38
39 //! Divides a Face (both edges in the wires, by splitting
40 //! curves and pcurves, and the face itself, by splitting
41 //! supporting surface) according to splitting criteria.
42 //! * The domain of the face to divide is defined by the PCurves
43 //! of the wires on the Face.
44 //!
45 //! * all the PCurves are supposed to be defined (in the parametric
46 //! space of the supporting surface).
47 //!
48 //! The result is available after the call to the Build method.
49 //! It is a Shell containing all the resulting Faces.
50 //!
51 //! All the modifications made during splitting are recorded in the
52 //! external context (ShapeBuild_ReShape).
53 class ShapeUpgrade_FaceDivide : public ShapeUpgrade_Tool
54 {
55
56 public:
57
58   
59   //! Creates empty  constructor.
60   Standard_EXPORT ShapeUpgrade_FaceDivide();
61   
62   //! Initialize by a Face.
63   Standard_EXPORT ShapeUpgrade_FaceDivide(const TopoDS_Face& F);
64   
65   //! Initialize by a Face.
66   Standard_EXPORT void Init (const TopoDS_Face& F);
67   
68   //! Purpose sets mode for trimming (segment) surface by
69   //! wire UV bounds.
70   Standard_EXPORT void SetSurfaceSegmentMode (const Standard_Boolean Segment);
71   
72   //! Performs splitting and computes the resulting shell
73   //! The context is used to keep track of former splittings
74   //! in order to keep sharings. It is updated according to
75   //! modifications made.
76   Standard_EXPORT virtual Standard_Boolean Perform();
77   
78   //! Performs splitting of surface and computes the shell
79   //! from source face.
80   Standard_EXPORT virtual Standard_Boolean SplitSurface();
81   
82   //! Performs splitting of curves of all the edges in the
83   //! shape and divides these edges.
84   Standard_EXPORT virtual Standard_Boolean SplitCurves();
85   
86   //! Gives the resulting Shell, or Face, or Null shape if not done.
87   Standard_EXPORT TopoDS_Shape Result() const;
88   
89   //! Queries the status of last call to Perform
90   //! OK   : no splitting was done (or no call to Perform)
91   //! DONE1: some edges were splitted
92   //! DONE2: surface was splitted
93   //! DONE3: surface was modified without splitting
94   //! FAIL1: some fails encountered during splitting wires
95   //! FAIL2: face cannot be splitted
96   Standard_EXPORT Standard_Boolean Status (const ShapeExtend_Status status) const;
97   
98   //! Sets the tool for splitting surfaces.
99   Standard_EXPORT void SetSplitSurfaceTool (const Handle(ShapeUpgrade_SplitSurface)& splitSurfaceTool);
100   
101   //! Sets the tool for dividing edges on Face.
102   Standard_EXPORT void SetWireDivideTool (const Handle(ShapeUpgrade_WireDivide)& wireDivideTool);
103   
104   //! Returns the tool for splitting surfaces.
105   //! This tool must be already initialized.
106   Standard_EXPORT virtual Handle(ShapeUpgrade_SplitSurface) GetSplitSurfaceTool() const;
107   
108   //! Returns the tool for dividing edges on Face.
109   //! This tool must be already initialized.
110   Standard_EXPORT virtual Handle(ShapeUpgrade_WireDivide) GetWireDivideTool() const;
111
112
113
114
115   DEFINE_STANDARD_RTTIEXT(ShapeUpgrade_FaceDivide,ShapeUpgrade_Tool)
116
117 protected:
118
119
120   TopoDS_Face myFace;
121   TopoDS_Shape myResult;
122   Standard_Boolean mySegmentMode;
123   Standard_Integer myStatus;
124
125
126 private:
127
128
129   Handle(ShapeUpgrade_SplitSurface) mySplitSurfaceTool;
130   Handle(ShapeUpgrade_WireDivide) myWireDivideTool;
131
132
133 };
134
135
136
137
138
139
140
141 #endif // _ShapeUpgrade_FaceDivide_HeaderFile