1 // Created on: 2000-10-31
2 // Created by: Sergey ZARITCHNY
3 // Copyright (c) 2000-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
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.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
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>
28 //=======================================================================
29 //function : QANewBRepNaming_Fuse
31 //=======================================================================
32 QANewBRepNaming_Fuse::QANewBRepNaming_Fuse() {}
34 //=======================================================================
35 //function : QANewBRepNaming_Fuse
37 //=======================================================================
39 QANewBRepNaming_Fuse::QANewBRepNaming_Fuse(const TDF_Label& ResultLabel)
40 :QANewBRepNaming_BooleanOperationFeat(ResultLabel) {}
43 //=======================================================================
46 //=======================================================================
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();
55 cout<<"QANewBRepNaming_Fuse::Load(): The result of the boolean operation is null"<<endl;
60 // Naming of the result:
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);
68 // Naming of deleted faces:
70 TNaming_Builder DelBuilder(DeletedFaces());
71 QANewBRepNaming_Loader::LoadDeletedShapes (MS, ObjSh, TopAbs_FACE, DelBuilder);
72 QANewBRepNaming_Loader::LoadDeletedShapes (MS, ToolSh, TopAbs_FACE, DelBuilder);
75 // Naming of the content of the result: