1 // Copyright (c) 1999-2014 OPEN CASCADE SAS
3 // This file is part of Open CASCADE Technology software library.
5 // This library is free software; you can redistribute it and/or modify it under
6 // the terms of the GNU Lesser General Public License version 2.1 as published
7 // by the Free Software Foundation, with special exception defined in the file
8 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9 // distribution for complete text of the license and disclaimer of any warranty.
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
15 #include <Standard_OutOfRange.hxx>
16 #include <Standard_Type.hxx>
17 #include <Standard_TypeMismatch.hxx>
19 #include <TopoDS_Compound.hxx>
20 #include <TopoDS_CompSolid.hxx>
21 #include <TopoDS_Edge.hxx>
22 #include <TopoDS_Face.hxx>
23 #include <TopoDS_Shape.hxx>
24 #include <TopoDS_Shell.hxx>
25 #include <TopoDS_Solid.hxx>
26 #include <TopoDS_Vertex.hxx>
27 #include <TopoDS_Wire.hxx>
28 #include <TransferBRep_ShapeListBinder.hxx>
30 IMPLEMENT_STANDARD_RTTIEXT(TransferBRep_ShapeListBinder,Transfer_Binder)
32 TransferBRep_ShapeListBinder::TransferBRep_ShapeListBinder ()
33 { theres = new TopTools_HSequenceOfShape(); }
35 TransferBRep_ShapeListBinder::TransferBRep_ShapeListBinder
36 (const Handle(TopTools_HSequenceOfShape)& list)
39 Standard_Boolean TransferBRep_ShapeListBinder::IsMultiple () const
40 { return (NbShapes() > 1); }
42 Handle(Standard_Type) TransferBRep_ShapeListBinder::ResultType () const
43 { return STANDARD_TYPE(TransferBRep_ShapeListBinder); }
45 Standard_CString TransferBRep_ShapeListBinder::ResultTypeName () const
46 { return "list(TopoDS_Shape)"; }
49 void TransferBRep_ShapeListBinder::AddResult (const TopoDS_Shape& shape)
50 { theres->Append(shape); }
52 Handle(TopTools_HSequenceOfShape) TransferBRep_ShapeListBinder::Result
56 void TransferBRep_ShapeListBinder::SetResult
57 (const Standard_Integer num, const TopoDS_Shape& shape)
58 { theres->SetValue(num,shape); }
60 Standard_Integer TransferBRep_ShapeListBinder::NbShapes () const
61 { return theres->Length(); }
63 const TopoDS_Shape& TransferBRep_ShapeListBinder::Shape
64 (const Standard_Integer num) const
65 { return theres->Value(num); }
67 TopAbs_ShapeEnum TransferBRep_ShapeListBinder::ShapeType
68 (const Standard_Integer num) const
69 { return theres->Value(num).ShapeType(); }
71 TopoDS_Vertex TransferBRep_ShapeListBinder::Vertex
72 (const Standard_Integer num) const
73 { return TopoDS::Vertex(theres->Value(num)); }
75 TopoDS_Edge TransferBRep_ShapeListBinder::Edge
76 (const Standard_Integer num) const
77 { return TopoDS::Edge(theres->Value(num)); }
79 TopoDS_Wire TransferBRep_ShapeListBinder::Wire
80 (const Standard_Integer num) const
81 { return TopoDS::Wire(theres->Value(num)); }
83 TopoDS_Face TransferBRep_ShapeListBinder::Face
84 (const Standard_Integer num) const
85 { return TopoDS::Face(theres->Value(num)); }
87 TopoDS_Shell TransferBRep_ShapeListBinder::Shell
88 (const Standard_Integer num) const
89 { return TopoDS::Shell(theres->Value(num)); }
91 TopoDS_Solid TransferBRep_ShapeListBinder::Solid
92 (const Standard_Integer num) const
93 { return TopoDS::Solid(theres->Value(num)); }
95 TopoDS_CompSolid TransferBRep_ShapeListBinder::CompSolid
96 (const Standard_Integer num) const
97 { return TopoDS::CompSolid(theres->Value(num)); }
99 TopoDS_Compound TransferBRep_ShapeListBinder::Compound
100 (const Standard_Integer num) const
101 { return TopoDS::Compound(theres->Value(num)); }