0029915: Porting to VC 2017 : Regressions in Modeling Algorithms on VC 2017
[occt.git] / src / BOPAlgo / BOPAlgo_BOP.hxx
CommitLineData
42cf5bc1 1// Created by: Peter KURNEV
2// Copyright (c) 1999-2014 OPEN CASCADE SAS
3//
4// This file is part of Open CASCADE Technology software library.
5//
6// This library is free software; you can redistribute it and/or modify it under
7// the terms of the GNU Lesser General Public License version 2.1 as published
8// by the Free Software Foundation, with special exception defined in the file
9// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
10// distribution for complete text of the license and disclaimer of any warranty.
11//
12// Alternatively, this file may be used under the terms of Open CASCADE
13// commercial license or contractual agreement.
14
15#ifndef _BOPAlgo_BOP_HeaderFile
16#define _BOPAlgo_BOP_HeaderFile
17
18#include <Standard.hxx>
19#include <Standard_DefineAlloc.hxx>
20#include <Standard_Handle.hxx>
21
22#include <BOPAlgo_Operation.hxx>
23#include <Standard_Integer.hxx>
24#include <TopoDS_Shape.hxx>
5fbe3d01 25#include <BOPAlgo_ToolsProvider.hxx>
1155d05a 26#include <NCollection_BaseAllocator.hxx>
42cf5bc1 27#include <TopAbs_ShapeEnum.hxx>
28#include <Standard_Boolean.hxx>
1155d05a 29#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
42cf5bc1 30class TopoDS_Shape;
31class BOPAlgo_PaveFiller;
32
33ba8565 33//!
34//! The class represents the Building part of the Boolean Operations
35//! algorithm.<br>
36//! The arguments of the algorithms are divided in two groups - *Objects*
37//! and *Tools*.<br>
38//! The algorithm builds the splits of the given arguments using the intersection
39//! results and combines the result of Boolean Operation of given type:<br>
40//! - *FUSE* - union of two groups of objects;<br>
41//! - *COMMON* - intersection of two groups of objects;<br>
42//! - *CUT* - subtraction of one group from the other.<br>
43//!
44//! The rules for the arguments and type of the operation are the following:<br>
45//! - For Boolean operation *FUSE* all arguments should have equal dimensions;<br>
46//! - For Boolean operation *CUT* the minimal dimension of *Tools* should not be
47//! less than the maximal dimension of *Objects*;<br>
48//! - For Boolean operation *COMMON* the arguments can have any dimension.<br>
49//!
50//! The class is a General Fuse based algorithm. Thus, all options
51//! of the General Fuse algorithm such as Fuzzy mode, safe processing mode,
52//! parallel processing mode, gluing mode and history support are also
53//! available in this algorithm.<br>
54//!
55//! Additionally to the Warnings of the parent class the algorithm returns
56//! the following warnings:
57//! - *BOPAlgo_AlertEmptyShape* - in case some of the input shapes are empty shapes.
58//!
59//! Additionally to Errors of the parent class the algorithm returns
60//! the following Error statuses:
61//! - *BOPAlgo_AlertBOPIsNotSet* - in case the type of Boolean operation is not set;
62//! - *BOPAlgo_AlertBOPNotAllowed* - in case the operation of given type is not allowed on
63//! given inputs;
64//! - *BOPAlgo_AlertSolidBuilderFailed* - in case the BuilderSolid algorithm failed to
65//! produce the Fused solid.
66//!
5fbe3d01 67class BOPAlgo_BOP : public BOPAlgo_ToolsProvider
42cf5bc1 68{
69public:
70
71 DEFINE_STANDARD_ALLOC
72
73
74 //! Empty constructor
75 Standard_EXPORT BOPAlgo_BOP();
5fbe3d01 76 Standard_EXPORT virtual ~BOPAlgo_BOP();
42cf5bc1 77
1155d05a 78 Standard_EXPORT BOPAlgo_BOP(const Handle(NCollection_BaseAllocator)& theAllocator);
42cf5bc1 79
80 //! Clears internal fields and arguments
81 Standard_EXPORT virtual void Clear() Standard_OVERRIDE;
82
42cf5bc1 83 Standard_EXPORT void SetOperation (const BOPAlgo_Operation theOperation);
84
85 Standard_EXPORT BOPAlgo_Operation Operation() const;
86
87 Standard_EXPORT virtual void Perform() Standard_OVERRIDE;
88
42cf5bc1 89protected:
42cf5bc1 90
91 Standard_EXPORT virtual void CheckData() Standard_OVERRIDE;
92
42cf5bc1 93 //! Performs calculations using prepared Filler
94 //! object <thePF>
95 Standard_EXPORT virtual void PerformInternal1 (const BOPAlgo_PaveFiller& thePF) Standard_OVERRIDE;
96
97 Standard_EXPORT virtual void BuildResult (const TopAbs_ShapeEnum theType) Standard_OVERRIDE;
98
99 Standard_EXPORT void BuildShape();
100
101 Standard_EXPORT void BuildRC();
102
103 Standard_EXPORT void BuildSolid();
104
33ba8565 105 //! Treatment of the cases with empty shapes.<br>
106 //! It returns TRUE if there is nothing to do, i.e.
107 //! all shapes in one of the groups are empty shapes.
108 Standard_EXPORT Standard_Boolean TreatEmptyShape();
109
5fbe3d01 110protected:
42cf5bc1 111
112 BOPAlgo_Operation myOperation;
5fbe3d01 113 Standard_Integer myDims[2];
114 TopoDS_Shape myRC;
42cf5bc1 115};
116
42cf5bc1 117#endif // _BOPAlgo_BOP_HeaderFile