1 // Created by: CKY / Contract Toubro-Larsen
2 // Copyright (c) 1993-1999 Matra Datavision
3 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
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
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.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 //--------------------------------------------------------------------
17 //--------------------------------------------------------------------
19 #include <IGESBasic_HArray1OfHArray1OfIGESEntity.hxx>
20 #include <IGESData_IGESEntity.hxx>
21 #include <IGESGeom_Boundary.hxx>
22 #include <Standard_DimensionMismatch.hxx>
23 #include <Standard_OutOfRange.hxx>
24 #include <Standard_Type.hxx>
26 IMPLEMENT_STANDARD_RTTIEXT(IGESGeom_Boundary,IGESData_IGESEntity)
28 IGESGeom_Boundary::IGESGeom_Boundary () { }
31 void IGESGeom_Boundary::Init
32 (const Standard_Integer aType,
33 const Standard_Integer aPreference,
34 const Handle(IGESData_IGESEntity)& aSurface,
35 const Handle(IGESData_HArray1OfIGESEntity)& allModelCurves,
36 const Handle(TColStd_HArray1OfInteger)& allSenses,
37 const Handle(IGESBasic_HArray1OfHArray1OfIGESEntity)& allParameterCurves)
39 Standard_Integer num1 = allSenses->Length();
40 if ( allSenses->Lower() != 1 ||
41 (allModelCurves->Lower() != 1 || allModelCurves->Length() != num1) ||
42 (allParameterCurves->Lower() != 1 || allParameterCurves->Length() != num1))
43 throw Standard_DimensionMismatch("IGESGeom_Boundary: Init");
46 thePreference = aPreference;
47 theSurface = aSurface;
48 theModelCurves = allModelCurves;
49 theSenses = allSenses;
50 theParameterCurves = allParameterCurves;
51 InitTypeAndForm(141,0);
55 Standard_Integer IGESGeom_Boundary::BoundaryType () const
60 Standard_Integer IGESGeom_Boundary::PreferenceType () const
65 Handle(IGESData_IGESEntity) IGESGeom_Boundary::Surface () const
70 Standard_Integer IGESGeom_Boundary::NbModelSpaceCurves () const
72 return theModelCurves->Length();
75 Standard_Integer IGESGeom_Boundary::Sense (const Standard_Integer Index) const
77 return theSenses->Value(Index);
80 Handle(IGESData_IGESEntity) IGESGeom_Boundary::ModelSpaceCurve
81 (const Standard_Integer Index) const
83 return theModelCurves->Value(Index);
86 Standard_Integer IGESGeom_Boundary::NbParameterCurves
87 (const Standard_Integer Index) const
89 if (theParameterCurves->Value(Index).IsNull()) return 0;
90 return theParameterCurves->Value(Index)->Length();
93 Handle(IGESData_HArray1OfIGESEntity) IGESGeom_Boundary::ParameterCurves
94 (const Standard_Integer Index) const
96 return theParameterCurves->Value(Index);
99 Handle(IGESData_IGESEntity) IGESGeom_Boundary::ParameterCurve
100 (const Standard_Integer Index, const Standard_Integer Num) const
102 return theParameterCurves->Value(Index)->Value(Num);