0031668: Visualization - WebGL sample doesn't work on Emscripten 1.39
[occt.git] / src / BRepTools / BRepTools_Substitution.hxx
CommitLineData
42cf5bc1 1// Created on: 1995-03-28
2// Created by: Yves FRICAUD
3// Copyright (c) 1995-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 _BRepTools_Substitution_HeaderFile
18#define _BRepTools_Substitution_HeaderFile
19
20#include <Standard.hxx>
21#include <Standard_DefineAlloc.hxx>
22#include <Standard_Handle.hxx>
23
24#include <TopTools_DataMapOfShapeListOfShape.hxx>
25#include <TopTools_ListOfShape.hxx>
26#include <Standard_Boolean.hxx>
27class Standard_NoSuchObject;
28class TopoDS_Shape;
29
30
31//! A tool to substitute subshapes by other shapes.
32//!
33//! The user use the method Substitute to define the
34//! modifications.
35//! A set of shapes is designated to replace a initial
36//! shape.
37//!
38//! The method Build reconstructs a new Shape with the
39//! modifications.The Shape and the new shape are
40//! registered.
41class BRepTools_Substitution
42{
43public:
44
45 DEFINE_STANDARD_ALLOC
46
47
48 Standard_EXPORT BRepTools_Substitution();
49
50 //! Reset all the fields.
51 Standard_EXPORT void Clear();
52
53 //! <Oldshape> will be replaced by <NewShapes>.
54 //!
55 //! <NewShapes> can be empty , in this case <OldShape>
56 //! will disparate from its ancestors.
57 //!
58 //! if an item of <NewShapes> is oriented FORWARD.
59 //! it will be oriented as <OldShape> in its ancestors.
60 //! else it will be reversed.
61 Standard_EXPORT void Substitute (const TopoDS_Shape& OldShape, const TopTools_ListOfShape& NewShapes);
62
63 //! Build NewShape from <S> if its subshapes has modified.
64 //!
65 //! The methods <IsCopied> and <Copy> allows you to keep
66 //! the resul of <Build>
67 Standard_EXPORT void Build (const TopoDS_Shape& S);
68
69 //! Returns True if <S> has been replaced .
70 Standard_EXPORT Standard_Boolean IsCopied (const TopoDS_Shape& S) const;
71
72 //! Returns the set of shapes substitued to <S> .
73 Standard_EXPORT const TopTools_ListOfShape& Copy (const TopoDS_Shape& S) const;
74
75
76
77
78protected:
79
80
81
82
83
84private:
85
86
87
88 TopTools_DataMapOfShapeListOfShape myMap;
89
90
91};
92
93
94
95
96
97
98
99#endif // _BRepTools_Substitution_HeaderFile