summaryrefslogtreecommitdiff
path: root/src/IGESSolid/IGESSolid_EdgeList.cxx
blob: e55fdc0510f13d0c2187557352cbc40926d73621 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
//--------------------------------------------------------------------
//
//  File Name : IGESSolid_EdgeList.cxx
//  Date      :
//  Author    : CKY / Contract Toubro-Larsen
//  Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------

#include <IGESSolid_EdgeList.ixx>


    IGESSolid_EdgeList::IGESSolid_EdgeList ()    {  }


    void  IGESSolid_EdgeList::Init
  (const Handle(IGESData_HArray1OfIGESEntity)& Curves,
   const Handle(IGESSolid_HArray1OfVertexList)& startVertexList,
   const Handle(TColStd_HArray1OfInteger)& startVertexIndex,
   const Handle(IGESSolid_HArray1OfVertexList)& endVertexList,
   const Handle(TColStd_HArray1OfInteger)& endVertexIndex)
{
  Standard_Integer nb = (Curves.IsNull() ? 0 : Curves->Length());

  if (nb == 0 || Curves->Lower() != 1 || 
      startVertexList->Lower()  != 1 || startVertexList->Length()  != nb ||
      startVertexIndex->Lower() != 1 || startVertexIndex->Length() != nb ||
      endVertexList->Lower()    != 1 || endVertexList->Length()    != nb ||
      endVertexIndex->Lower()   != 1 || endVertexIndex->Length()   != nb  )
    Standard_DimensionError::Raise("IGESSolid_EdgeList : Init");

  theCurves = Curves;
  theStartVertexList  = startVertexList;
  theStartVertexIndex = startVertexIndex;
  theEndVertexList    = endVertexList;
  theEndVertexIndex   = endVertexIndex;

  InitTypeAndForm(504,1);
}

    Standard_Integer  IGESSolid_EdgeList::NbEdges () const
{
  return (theCurves.IsNull() ? 0 : theCurves->Length());
}

    Handle(IGESData_IGESEntity)  IGESSolid_EdgeList::Curve
  (const Standard_Integer num) const
{
  return theCurves->Value(num);
}

    Handle(IGESSolid_VertexList)  IGESSolid_EdgeList::StartVertexList
  (const Standard_Integer num) const
{
  return theStartVertexList->Value(num);
}

    Standard_Integer  IGESSolid_EdgeList::StartVertexIndex
  (const Standard_Integer num) const
{
  return theStartVertexIndex->Value(num);
}

    Handle(IGESSolid_VertexList)  IGESSolid_EdgeList::EndVertexList
  (const Standard_Integer num) const
{
  return theEndVertexList->Value(num);
}

    Standard_Integer  IGESSolid_EdgeList::EndVertexIndex
  (const Standard_Integer num) const
{
  return theEndVertexIndex->Value(num);
}