0024624: Lost word in license statement in source files
[occt.git] / src / BRepBuilderAPI / BRepBuilderAPI_ModifyShape.cxx
CommitLineData
b311480e 1// Created on: 1994-12-02
2// Created by: Jacques GOUSSARD
3// Copyright (c) 1994-1999 Matra Datavision
973c2be1 4// Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 5//
973c2be1 6// This file is part of Open CASCADE Technology software library.
b311480e 7//
d5f74e42 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
973c2be1 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.
b311480e 13//
973c2be1 14// Alternatively, this file may be used under the terms of Open CASCADE
15// commercial license or contractual agreement.
7fd59977 16
17#include <BRepBuilderAPI_ModifyShape.ixx>
18
19
20#include <Standard_NullObject.hxx>
21
22//=======================================================================
23//function : BRepBuilderAPI_ModifyShape
24//purpose :
25//=======================================================================
26
27BRepBuilderAPI_ModifyShape::BRepBuilderAPI_ModifyShape () {}
28
29
30//=======================================================================
31//function : BRepBuilderAPI_ModifyShape
32//purpose :
33//=======================================================================
34
35BRepBuilderAPI_ModifyShape::BRepBuilderAPI_ModifyShape (const TopoDS_Shape& S):
36 myModifier(S), myInitialShape(S)
37{}
38
39
40//=======================================================================
41//function : BRepBuilderAPI_ModifyShape
42//purpose :
43//=======================================================================
44
45BRepBuilderAPI_ModifyShape::BRepBuilderAPI_ModifyShape
46 (const Handle(BRepTools_Modification)& M)
47{
48 myModification = M;
49}
50
51
52//=======================================================================
53//function : BRepBuilderAPI_ModifyShape
54//purpose :
55//=======================================================================
56
57BRepBuilderAPI_ModifyShape::BRepBuilderAPI_ModifyShape
58 (const TopoDS_Shape& S,
59 const Handle(BRepTools_Modification)& M): myModifier(S),myInitialShape(S)
60{
61 myModification = M;
62 DoModif();
63}
64
65
66//=======================================================================
67//function : DoModif
68//purpose :
69//=======================================================================
70
71void BRepBuilderAPI_ModifyShape::DoModif ()
72{
73 if (myInitialShape.IsNull() || myModification.IsNull()) {
74 Standard_NullObject::Raise();
75 }
76 myModifier.Perform(myModification);
77 if (myModifier.IsDone()) {
78 Done();
79 myShape = myModifier.ModifiedShape(myInitialShape);
80 }
81 else {
82 NotDone();
83 }
84}
85
86
87//=======================================================================
88//function : DoModif
89//purpose :
90//=======================================================================
91
92void BRepBuilderAPI_ModifyShape::DoModif (const TopoDS_Shape& S)
93{
94 if (!S.IsEqual(myInitialShape) || !IsDone()) {
95 myInitialShape = S;
96 myModifier.Init(S);
97 DoModif();
98 }
99}
100
101
102//=======================================================================
103//function : DoModif
104//purpose :
105//=======================================================================
106
107void BRepBuilderAPI_ModifyShape::DoModif (const Handle(BRepTools_Modification)& M)
108{
109 myModification = M;
110 DoModif();
111}
112
113
114//=======================================================================
115//function : DoModif
116//purpose :
117//=======================================================================
118
119void BRepBuilderAPI_ModifyShape::DoModif (const TopoDS_Shape& S,
120 const Handle(BRepTools_Modification)& M)
121{
122 myInitialShape = S;
123 myModifier.Init(S);
124 myModification = M;
125 DoModif();
126}
127
128
129//=======================================================================
130//function : ModifiedShape
131//purpose :
132//=======================================================================
133
134const TopoDS_Shape& BRepBuilderAPI_ModifyShape::ModifiedShape
135 (const TopoDS_Shape& S) const
136{
137 return myModifier.ModifiedShape(S);
138}
139
140//=======================================================================
141//function : Modified
142//purpose :
143//=======================================================================
144
145const TopTools_ListOfShape& BRepBuilderAPI_ModifyShape::Modified
146 (const TopoDS_Shape& F)
147{
148 myGenerated.Clear();
149 myGenerated.Append(myModifier.ModifiedShape(F));
150 return myGenerated;
151}