1 // Created on: 1997-09-22
2 // Created by: VAUTHIER Jean-Claude
3 // Copyright (c) 1997-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
18 #include <BRepFilletAPI_MakeChamfer.hxx>
19 #include <QANewBRepNaming_Chamfer.hxx>
20 #include <QANewBRepNaming_Loader.hxx>
21 #include <Standard_NullObject.hxx>
22 #include <TDF_Label.hxx>
23 #include <TNaming_Builder.hxx>
24 #include <TopoDS_Shape.hxx>
26 //=======================================================================
27 //function : QANewBRepNaming_Chamfer
29 //=======================================================================
30 QANewBRepNaming_Chamfer::QANewBRepNaming_Chamfer()
33 //=======================================================================
34 //function : QANewBRepNaming_Chamfer
36 //=======================================================================
38 QANewBRepNaming_Chamfer::QANewBRepNaming_Chamfer(const TDF_Label& ResultLabel):
39 QANewBRepNaming_TopNaming(ResultLabel)
42 //=======================================================================
45 //=======================================================================
47 void QANewBRepNaming_Chamfer::Init(const TDF_Label& ResultLabel)
49 if(ResultLabel.IsNull())
50 throw Standard_NullObject("QANewBRepNaming_Chamfer::Init The Result label is Null ...");
51 myResultLabel = ResultLabel;
54 //=======================================================================
57 //=======================================================================
59 void QANewBRepNaming_Chamfer::Load (const TopoDS_Shape& part,
60 BRepFilletAPI_MakeChamfer& mkChamfer) const
62 TNaming_Builder Ins(ResultLabel());
63 Ins.Modify (part, mkChamfer.Shape());
65 //New Faces generated from edges
66 TNaming_Builder Builder1(FacesFromEdges());
67 QANewBRepNaming_Loader::LoadGeneratedShapes (mkChamfer, part, TopAbs_EDGE, Builder1);
69 //Faces of the initial shape modified by MakeChamfer
70 TNaming_Builder Builder2(ModifiedFaces());
71 QANewBRepNaming_Loader::LoadModifiedShapes (mkChamfer, part, TopAbs_FACE, Builder2, Standard_False);
73 //Deleted Faces of the initial shape
74 TNaming_Builder Builder3(DeletedFaces());
75 QANewBRepNaming_Loader::LoadDeletedShapes(mkChamfer, part, TopAbs_FACE, Builder3);
78 //=======================================================================
79 //function : FacesFromEdges
81 //=======================================================================
83 TDF_Label QANewBRepNaming_Chamfer::FacesFromEdges() const
85 return ResultLabel().FindChild(1, Standard_True);
88 //=======================================================================
89 //function : ModifiedFaces
91 //=======================================================================
93 TDF_Label QANewBRepNaming_Chamfer::ModifiedFaces() const
95 return ResultLabel().FindChild(2, Standard_True);
98 //=======================================================================
99 //function : DeletedFaces
101 //=======================================================================
103 TDF_Label QANewBRepNaming_Chamfer::DeletedFaces() const
105 return ResultLabel().FindChild(3, Standard_True);