1 // Created on: 1994-08-04
2 // Created by: Christophe MARION
3 // Copyright (c) 1994-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.
17 #define No_Standard_OutOfRange
19 #include <HLRBRep_Algo.ixx>
20 #include <HLRBRep_ShapeBounds.hxx>
21 #include <HLRTopoBRep_OutLiner.hxx>
23 //=======================================================================
24 //function : HLRBRep_Algo
26 //=======================================================================
28 HLRBRep_Algo::HLRBRep_Algo ()
31 //=======================================================================
32 //function : HLRBRep_Algo
34 //=======================================================================
36 HLRBRep_Algo::HLRBRep_Algo (const Handle(HLRBRep_Algo)& A) :
37 HLRBRep_InternalAlgo(A)
40 //=======================================================================
43 //=======================================================================
45 void HLRBRep_Algo::Add (const TopoDS_Shape& S,
46 const Handle(MMgt_TShared)& SData,
47 const Standard_Integer nbIso)
49 Load(new HLRTopoBRep_OutLiner(S),SData,nbIso);
52 //=======================================================================
55 //=======================================================================
57 void HLRBRep_Algo::Add (const TopoDS_Shape& S,
58 const Standard_Integer nbIso)
60 Load(new HLRTopoBRep_OutLiner(S),nbIso);
63 //=======================================================================
66 //=======================================================================
68 Standard_Integer HLRBRep_Algo::Index (const TopoDS_Shape& S)
70 Standard_Integer n = NbShapes();
72 for (Standard_Integer i = 1; i <= n; i++) {
73 if (ShapeBounds(i).Shape()->OriginalShape() == S) return i;
74 if (ShapeBounds(i).Shape()->OutLinedShape() == S) return i;
80 //=======================================================================
81 //function : OutLinedShapeNullify
83 //=======================================================================
85 void HLRBRep_Algo::OutLinedShapeNullify ()
87 Standard_Integer n = NbShapes();
89 for (Standard_Integer i = 1; i <= n; i++) {
90 ShapeBounds(i).Shape()->OutLinedShape(TopoDS_Shape());
91 ShapeBounds(i).Shape()->DataStructure().Clear();