0025418: Debug output to be limited to OCC development environment
[occt.git] / src / QANewBRepNaming / QANewBRepNaming_Fuse.cxx
CommitLineData
b311480e 1// Created on: 2000-10-31
2// Created by: Sergey ZARITCHNY
973c2be1 3// Copyright (c) 2000-2014 OPEN CASCADE SAS
b311480e 4//
973c2be1 5// This file is part of Open CASCADE Technology software library.
b311480e 6//
d5f74e42 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
973c2be1 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.
b311480e 12//
973c2be1 13// Alternatively, this file may be used under the terms of Open CASCADE
14// commercial license or contractual agreement.
7fd59977 15
16#include <QANewBRepNaming_Fuse.ixx>
17#include <TNaming_Builder.hxx>
18#include <QANewBRepNaming_Loader.hxx>
19#include <TopExp_Explorer.hxx>
20#include <TopTools_ListIteratorOfListOfShape.hxx>
21#include <TNaming_NamedShape.hxx>
22#include <TopoDS_Iterator.hxx>
23#include <TNaming_Tool.hxx>
24
25//=======================================================================
26//function : QANewBRepNaming_Fuse
27//purpose :
28//=======================================================================
29
30QANewBRepNaming_Fuse::QANewBRepNaming_Fuse() {}
31
32//=======================================================================
33//function : QANewBRepNaming_Fuse
34//purpose :
35//=======================================================================
36
37QANewBRepNaming_Fuse::QANewBRepNaming_Fuse(const TDF_Label& ResultLabel)
38 :QANewBRepNaming_BooleanOperationFeat(ResultLabel) {}
39
40
41//=======================================================================
42//function : Load
43//purpose :
44//=======================================================================
45
46void QANewBRepNaming_Fuse::Load(BRepAlgoAPI_BooleanOperation& MS) const {
47 const TopoDS_Shape& ResSh = MS.Shape();
48 const TopoDS_Shape& ObjSh = MS.Shape1();
49 const TopoDS_Shape& ToolSh = MS.Shape2();
50
51 if (ResSh.IsNull()) {
0797d9d3 52#ifdef OCCT_DEBUG
7fd59977 53 cout<<"QANewBRepNaming_Fuse::Load(): The result of the boolean operation is null"<<endl;
54#endif
55 return;
56 }
57
58 // Naming of the result:
59 LoadResult(MS);
60
61 // Naming of modified faces:
62 TNaming_Builder ModBuilder(ModifiedFaces());
63 QANewBRepNaming_Loader::LoadModifiedShapes (MS, ObjSh, TopAbs_FACE, ModBuilder, Standard_True);
64 QANewBRepNaming_Loader::LoadModifiedShapes (MS, ToolSh, TopAbs_FACE, ModBuilder, Standard_True);
65
66 // Naming of deleted faces:
67 if(MS.HasDeleted()){
68 TNaming_Builder DelBuilder(DeletedFaces());
69 QANewBRepNaming_Loader::LoadDeletedShapes (MS, ObjSh, TopAbs_FACE, DelBuilder);
70 QANewBRepNaming_Loader::LoadDeletedShapes (MS, ToolSh, TopAbs_FACE, DelBuilder);
71 }
72
73 // Naming of the content of the result:
74 LoadContent(MS);
75}