0028187: Add possibility to avoid creation of Internal parts in the result of Volume...
[occt.git] / src / BOPAlgo / BOPAlgo_BuilderArea.hxx
CommitLineData
42cf5bc1 1// Created by: Peter KURNEV
2// Copyright (c) 2010-2014 OPEN CASCADE SAS
3// Copyright (c) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
4// Copyright (c) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT,
5// EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6//
7// This file is part of Open CASCADE Technology software library.
8//
9// This library is free software; you can redistribute it and/or modify it under
10// the terms of the GNU Lesser General Public License version 2.1 as published
11// by the Free Software Foundation, with special exception defined in the file
12// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
13// distribution for complete text of the license and disclaimer of any warranty.
14//
15// Alternatively, this file may be used under the terms of Open CASCADE
16// commercial license or contractual agreement.
17
18#ifndef _BOPAlgo_BuilderArea_HeaderFile
19#define _BOPAlgo_BuilderArea_HeaderFile
20
21#include <Standard.hxx>
22#include <Standard_DefineAlloc.hxx>
23#include <Standard_Handle.hxx>
24
25#include <BOPCol_ListOfShape.hxx>
319da2e4 26#include <BOPCol_IndexedMapOfOrientedShape.hxx>
42cf5bc1 27#include <BOPAlgo_Algo.hxx>
28#include <BOPCol_BaseAllocator.hxx>
29class IntTools_Context;
30
31
32//! The root class for algorithms to build
33//! faces/solids from set of edges/faces
34class BOPAlgo_BuilderArea : public BOPAlgo_Algo
35{
36public:
37
38 DEFINE_STANDARD_ALLOC
39
291fced1 40 //! Sets the context for the algorithms
41 Standard_EXPORT void SetContext (const Handle(IntTools_Context)& theContext) {
42 myContext = theContext;
43 }
44
45 //! Returns the input shapes
46 Standard_EXPORT const BOPCol_ListOfShape& Shapes() const {
47 return myShapes;
48 }
49
50 //! Sets the shapes for building areas
51 Standard_EXPORT void SetShapes(const BOPCol_ListOfShape& theLS) {
52 myShapes = theLS;
53 }
54
55 //! Returns the found loops
56 Standard_EXPORT const BOPCol_ListOfShape& Loops() const {
57 return myLoops;
58 }
59
60 //! Returns the found areas
61 Standard_EXPORT const BOPCol_ListOfShape& Areas() const {
62 return myAreas;
63 }
64
65 //! Defines the preventing of addition of internal parts into result.
66 //! The default value is FALSE, i.e. the internal parts are added into result.
67 Standard_EXPORT void SetAvoidInternalShapes(const Standard_Boolean theAvoidInternal) {
68 myAvoidInternalShapes = theAvoidInternal;
69 }
70
71 //! Returns the AvoidInternalShapes flag
72 Standard_EXPORT Standard_Boolean IsAvoidInternalShapes() const {
73 return myAvoidInternalShapes;
74 }
42cf5bc1 75
76protected:
77
42cf5bc1 78 Standard_EXPORT BOPAlgo_BuilderArea();
291fced1 79 Standard_EXPORT virtual ~BOPAlgo_BuilderArea();
42cf5bc1 80
81 Standard_EXPORT BOPAlgo_BuilderArea(const BOPCol_BaseAllocator& theAllocator);
82
83 Standard_EXPORT virtual void PerformShapesToAvoid() = 0;
84
85 Standard_EXPORT virtual void PerformLoops() = 0;
86
87 Standard_EXPORT virtual void PerformAreas() = 0;
88
89 Standard_EXPORT virtual void PerformInternalShapes() = 0;
90
91
92 Handle(IntTools_Context) myContext;
93 BOPCol_ListOfShape myShapes;
94 BOPCol_ListOfShape myLoops;
95 BOPCol_ListOfShape myLoopsInternal;
96 BOPCol_ListOfShape myAreas;
319da2e4 97 BOPCol_IndexedMapOfOrientedShape myShapesToAvoid;
291fced1 98 Standard_Boolean myAvoidInternalShapes;
42cf5bc1 99
100private:
101
42cf5bc1 102};
103
42cf5bc1 104#endif // _BOPAlgo_BuilderArea_HeaderFile