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 <gp_GTrsf.hxx>
22 #include <IGESData_IGESEntity.hxx>
23 #include <IGESDimen_SectionedArea.hxx>
24 #include <Standard_DimensionMismatch.hxx>
25 #include <Standard_OutOfRange.hxx>
26 #include <Standard_Type.hxx>
28 IMPLEMENT_STANDARD_RTTIEXT(IGESDimen_SectionedArea,IGESData_IGESEntity)
30 IGESDimen_SectionedArea::IGESDimen_SectionedArea () { }
33 void IGESDimen_SectionedArea::Init
34 (const Handle(IGESData_IGESEntity)& aCurve,
35 const Standard_Integer aPattern,
37 const Standard_Real aDistance,
38 const Standard_Real anAngle,
39 const Handle(IGESData_HArray1OfIGESEntity)& someIslands)
41 if (!someIslands.IsNull())
42 if (someIslands->Lower() != 1)
43 throw Standard_DimensionMismatch("IGESDimen_SectionedArea : Init");
44 theExteriorCurve = aCurve;
45 thePattern = aPattern;
46 thePassingPoint = aPoint;
47 theDistance = aDistance;
49 theIslandCurves = someIslands;
50 InitTypeAndForm(230,FormNumber());
53 void IGESDimen_SectionedArea::SetInverted (const Standard_Boolean mode)
55 InitTypeAndForm (230, (mode ? 1 : 0));
58 Standard_Boolean IGESDimen_SectionedArea::IsInverted () const
60 return (FormNumber() != 0);
64 Handle(IGESData_IGESEntity) IGESDimen_SectionedArea::ExteriorCurve () const
66 return theExteriorCurve;
69 Standard_Integer IGESDimen_SectionedArea::Pattern () const
74 gp_Pnt IGESDimen_SectionedArea::PassingPoint () const
76 return gp_Pnt(thePassingPoint);
79 gp_Pnt IGESDimen_SectionedArea::TransformedPassingPoint () const
81 gp_XYZ tmpXYZ(thePassingPoint);
82 if (HasTransf()) Location().Transforms(tmpXYZ);
83 return gp_Pnt(tmpXYZ);
86 Standard_Real IGESDimen_SectionedArea::ZDepth () const
88 return thePassingPoint.Z();
91 Standard_Real IGESDimen_SectionedArea::Distance () const
96 Standard_Real IGESDimen_SectionedArea::Angle () const
101 Standard_Integer IGESDimen_SectionedArea::NbIslands () const
103 return (theIslandCurves.IsNull() ? 0 : theIslandCurves->Length());
106 Handle(IGESData_IGESEntity) IGESDimen_SectionedArea::IslandCurve
107 (const Standard_Integer num) const
109 return theIslandCurves->Value(num);