0022048: Visualization, AIS_InteractiveContext - single object selection should alway...
[occt.git] / src / BRepAlgoAPI / BRepAlgoAPI_BuilderAlgo.hxx
CommitLineData
42cf5bc1 1// Created by: Peter KURNEV
2// Copyright (c) 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 _BRepAlgoAPI_BuilderAlgo_HeaderFile
16#define _BRepAlgoAPI_BuilderAlgo_HeaderFile
17
18#include <Standard.hxx>
19#include <Standard_DefineAlloc.hxx>
20#include <Standard_Handle.hxx>
21
22#include <Standard_Integer.hxx>
23#include <BOPAlgo_PPaveFiller.hxx>
24#include <BOPAlgo_PBuilder.hxx>
483ce1bd 25#include <BOPAlgo_GlueEnum.hxx>
42cf5bc1 26#include <Standard_Real.hxx>
27#include <TopTools_ListOfShape.hxx>
28#include <BRepAlgoAPI_Algo.hxx>
29#include <Standard_Boolean.hxx>
30class BOPAlgo_PaveFiller;
31class TopoDS_Shape;
32
33
34
33ba8565 35//! The class contains API level of the General Fuse algorithm.<br>
36//!
37//! It returns the following Error statuses:<br>
38//! - 0 - in case of success;<br>
39//! - *BOPAlgo_AlertTooFewArguments* - in case there are no enough arguments to perform the operation;<br>
40//! - *BOPAlgo_AlertIntersectionFailed* - in case the intersection of the arguments has failed;<br>
41//! - *BOPAlgo_AlertBuilderFailed* - in case building of the result shape has failed.<br>
42//!
43//! Warnings statuses from underlying DS Filler and Builder algorithms
44//! are collected in the report.
42cf5bc1 45class BRepAlgoAPI_BuilderAlgo : public BRepAlgoAPI_Algo
46{
47public:
48
49 DEFINE_STANDARD_ALLOC
50
51
52 //! Empty constructor
53 Standard_EXPORT BRepAlgoAPI_BuilderAlgo();
54Standard_EXPORT virtual ~BRepAlgoAPI_BuilderAlgo();
55
56 //! Empty constructor
57 Standard_EXPORT BRepAlgoAPI_BuilderAlgo(const BOPAlgo_PaveFiller& thePF);
58
3510db62 59 //! Sets the flag that defines the mode of treatment.
60 //! In non-destructive mode the argument shapes are not modified. Instead
61 //! a copy of a sub-shape is created in the result if it is needed to be updated.
62 Standard_EXPORT void SetNonDestructive(const Standard_Boolean theFlag);
63
64 //! Returns the flag that defines the mode of treatment.
65 //! In non-destructive mode the argument shapes are not modified. Instead
66 //! a copy of a sub-shape is created in the result if it is needed to be updated.
67 Standard_EXPORT Standard_Boolean NonDestructive() const;
68
483ce1bd 69 //! Sets the glue option for the algorithm
70 Standard_EXPORT void SetGlue(const BOPAlgo_GlueEnum theGlue);
71
72 //! Returns the glue option of the algorithm
73 Standard_EXPORT BOPAlgo_GlueEnum Glue() const;
74
42cf5bc1 75 //! Sets the arguments
76 Standard_EXPORT void SetArguments (const TopTools_ListOfShape& theLS);
77
78 //! Gets the arguments
79 Standard_EXPORT const TopTools_ListOfShape& Arguments() const;
80
81 //! Performs the algorithm
82 //!
83 //! H I S T O R Y
84 Standard_EXPORT virtual void Build() Standard_OVERRIDE;
85
86 //! Returns the list of shapes modified from the shape <S>.
87 Standard_EXPORT virtual const TopTools_ListOfShape& Modified (const TopoDS_Shape& aS) Standard_OVERRIDE;
88
89 //! Returns true if the shape S has been deleted. The
90 //! result shape of the operation does not contain the shape S.
91 Standard_EXPORT virtual Standard_Boolean IsDeleted (const TopoDS_Shape& aS) Standard_OVERRIDE;
92
93 //! Returns the list of shapes generated from the shape <S>.
94 //! For use in BRepNaming.
95 Standard_EXPORT virtual const TopTools_ListOfShape& Generated (const TopoDS_Shape& S) Standard_OVERRIDE;
96
97 //! Returns true if there is at least one modified shape.
98 //! For use in BRepNaming.
99 Standard_EXPORT virtual Standard_Boolean HasModified() const;
100
101 //! Returns true if there is at least one generated shape.
102 //! For use in BRepNaming.
103 Standard_EXPORT virtual Standard_Boolean HasGenerated() const;
104
105 //! Returns true if there is at least one deleted shape.
106 //! For use in BRepNaming.
107 //!
108 //! protected methods
109 Standard_EXPORT virtual Standard_Boolean HasDeleted() const;
110
33ba8565 111 //! Returns the Intersection tool
112 const BOPAlgo_PPaveFiller& DSFiller() const
113 {
114 return myDSFiller;
115 }
42cf5bc1 116
33ba8565 117 //! Returns the Building tool
118 const BOPAlgo_PBuilder& Builder() const
119 {
120 return myBuilder;
121 }
42cf5bc1 122
123protected:
124
42cf5bc1 125 Standard_EXPORT virtual void Clear() Standard_OVERRIDE;
126
42cf5bc1 127 Standard_Integer myEntryType;
128 BOPAlgo_PPaveFiller myDSFiller;
129 BOPAlgo_PBuilder myBuilder;
3510db62 130 Standard_Boolean myNonDestructive;
42cf5bc1 131 TopTools_ListOfShape myArguments;
483ce1bd 132 BOPAlgo_GlueEnum myGlue;
42cf5bc1 133
134
135private:
136
137
138
139
140
141};
142
143
144
145
146
147
148
149#endif // _BRepAlgoAPI_BuilderAlgo_HeaderFile