Warnings on vc14 were eliminated
[occt.git] / src / QANewBRepNaming / QANewBRepNaming_Fuse.cxx
1 // Created on: 2000-10-31
2 // Created by: Sergey ZARITCHNY
3 // Copyright (c) 2000-2014 OPEN CASCADE SAS
4 //
5 // This file is part of Open CASCADE Technology software library.
6 //
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
12 //
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
15
16
17 #include <BRepAlgoAPI_BooleanOperation.hxx>
18 #include <QANewBRepNaming_Fuse.hxx>
19 #include <QANewBRepNaming_Loader.hxx>
20 #include <TDF_Label.hxx>
21 #include <TNaming_Builder.hxx>
22 #include <TNaming_NamedShape.hxx>
23 #include <TNaming_Tool.hxx>
24 #include <TopExp_Explorer.hxx>
25 #include <TopoDS_Iterator.hxx>
26 #include <TopTools_ListIteratorOfListOfShape.hxx>
27
28 //=======================================================================
29 //function : QANewBRepNaming_Fuse
30 //purpose  : 
31 //=======================================================================
32 QANewBRepNaming_Fuse::QANewBRepNaming_Fuse() {}
33
34 //=======================================================================
35 //function : QANewBRepNaming_Fuse
36 //purpose  : 
37 //=======================================================================
38
39 QANewBRepNaming_Fuse::QANewBRepNaming_Fuse(const TDF_Label& ResultLabel)
40      :QANewBRepNaming_BooleanOperationFeat(ResultLabel) {}
41
42
43 //=======================================================================
44 //function : Load
45 //purpose  : 
46 //=======================================================================
47
48 void QANewBRepNaming_Fuse::Load(BRepAlgoAPI_BooleanOperation& MS) const {
49   const TopoDS_Shape& ResSh = MS.Shape();
50   const TopoDS_Shape& ObjSh = MS.Shape1();
51   const TopoDS_Shape& ToolSh = MS.Shape2();
52
53   if (ResSh.IsNull()) {
54 #ifdef OCCT_DEBUG
55     cout<<"QANewBRepNaming_Fuse::Load(): The result of the boolean operation is null"<<endl;
56 #endif
57     return;
58   }
59
60   // Naming of the result:
61   LoadResult(MS);
62
63   // Naming of modified faces: 
64   TNaming_Builder ModBuilder(ModifiedFaces());    
65   QANewBRepNaming_Loader::LoadModifiedShapes (MS, ObjSh,  TopAbs_FACE, ModBuilder, Standard_True);  
66   QANewBRepNaming_Loader::LoadModifiedShapes (MS, ToolSh, TopAbs_FACE, ModBuilder, Standard_True);    
67
68   // Naming of deleted faces:
69   if(MS.HasDeleted()){
70     TNaming_Builder DelBuilder(DeletedFaces());
71     QANewBRepNaming_Loader::LoadDeletedShapes  (MS, ObjSh,  TopAbs_FACE, DelBuilder);
72     QANewBRepNaming_Loader::LoadDeletedShapes  (MS, ToolSh, TopAbs_FACE, DelBuilder);
73   }
74
75   // Naming of the content of the result:
76   LoadContent(MS);
77 }