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