b311480e |
1 | // Created by: CKY / Contract Toubro-Larsen |
2 | // Copyright (c) 1993-1999 Matra Datavision |
973c2be1 |
3 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
4 | // |
973c2be1 |
5 | // This file is part of Open CASCADE Technology software library. |
7fd59977 |
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. |
7fd59977 |
12 | // |
973c2be1 |
13 | // Alternatively, this file may be used under the terms of Open CASCADE |
14 | // commercial license or contractual agreement. |
b311480e |
15 | |
16 | //-------------------------------------------------------------------- |
7fd59977 |
17 | //-------------------------------------------------------------------- |
18 | |
42cf5bc1 |
19 | #include <IGESData_IGESEntity.hxx> |
20 | #include <IGESSolid_EdgeList.hxx> |
21 | #include <IGESSolid_VertexList.hxx> |
22 | #include <Standard_DimensionMismatch.hxx> |
23 | #include <Standard_OutOfRange.hxx> |
24 | #include <Standard_Type.hxx> |
7fd59977 |
25 | |
92efcf78 |
26 | IMPLEMENT_STANDARD_RTTIEXT(IGESSolid_EdgeList,IGESData_IGESEntity) |
27 | |
b311480e |
28 | IGESSolid_EdgeList::IGESSolid_EdgeList () { } |
7fd59977 |
29 | |
30 | |
31 | void IGESSolid_EdgeList::Init |
32 | (const Handle(IGESData_HArray1OfIGESEntity)& Curves, |
33 | const Handle(IGESSolid_HArray1OfVertexList)& startVertexList, |
34 | const Handle(TColStd_HArray1OfInteger)& startVertexIndex, |
35 | const Handle(IGESSolid_HArray1OfVertexList)& endVertexList, |
36 | const Handle(TColStd_HArray1OfInteger)& endVertexIndex) |
37 | { |
38 | Standard_Integer nb = (Curves.IsNull() ? 0 : Curves->Length()); |
39 | |
40 | if (nb == 0 || Curves->Lower() != 1 || |
41 | startVertexList->Lower() != 1 || startVertexList->Length() != nb || |
42 | startVertexIndex->Lower() != 1 || startVertexIndex->Length() != nb || |
43 | endVertexList->Lower() != 1 || endVertexList->Length() != nb || |
44 | endVertexIndex->Lower() != 1 || endVertexIndex->Length() != nb ) |
9775fa61 |
45 | throw Standard_DimensionError("IGESSolid_EdgeList : Init"); |
7fd59977 |
46 | |
47 | theCurves = Curves; |
48 | theStartVertexList = startVertexList; |
49 | theStartVertexIndex = startVertexIndex; |
50 | theEndVertexList = endVertexList; |
51 | theEndVertexIndex = endVertexIndex; |
52 | |
53 | InitTypeAndForm(504,1); |
54 | } |
55 | |
56 | Standard_Integer IGESSolid_EdgeList::NbEdges () const |
57 | { |
58 | return (theCurves.IsNull() ? 0 : theCurves->Length()); |
59 | } |
60 | |
61 | Handle(IGESData_IGESEntity) IGESSolid_EdgeList::Curve |
62 | (const Standard_Integer num) const |
63 | { |
64 | return theCurves->Value(num); |
65 | } |
66 | |
67 | Handle(IGESSolid_VertexList) IGESSolid_EdgeList::StartVertexList |
68 | (const Standard_Integer num) const |
69 | { |
70 | return theStartVertexList->Value(num); |
71 | } |
72 | |
73 | Standard_Integer IGESSolid_EdgeList::StartVertexIndex |
74 | (const Standard_Integer num) const |
75 | { |
76 | return theStartVertexIndex->Value(num); |
77 | } |
78 | |
79 | Handle(IGESSolid_VertexList) IGESSolid_EdgeList::EndVertexList |
80 | (const Standard_Integer num) const |
81 | { |
82 | return theEndVertexList->Value(num); |
83 | } |
84 | |
85 | Standard_Integer IGESSolid_EdgeList::EndVertexIndex |
86 | (const Standard_Integer num) const |
87 | { |
88 | return theEndVertexIndex->Value(num); |
89 | } |