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>
21 #include <IGESData_IGESEntity.hxx>
22 #include <IGESData_TransfEntity.hxx>
23 #include <IGESDimen_NewDimensionedGeometry.hxx>
24 #include <Standard_DimensionMismatch.hxx>
25 #include <Standard_OutOfRange.hxx>
26 #include <Standard_Type.hxx>
28 IMPLEMENT_STANDARD_RTTIEXT(IGESDimen_NewDimensionedGeometry,IGESData_IGESEntity)
30 IGESDimen_NewDimensionedGeometry::IGESDimen_NewDimensionedGeometry () { }
33 void IGESDimen_NewDimensionedGeometry::Init
34 (const Standard_Integer nbDimens,
35 const Handle(IGESData_IGESEntity)& aDimen,
36 const Standard_Integer anOrientation, const Standard_Real anAngle,
37 const Handle(IGESData_HArray1OfIGESEntity)& allEntities,
38 const Handle(TColStd_HArray1OfInteger)& allLocations,
39 const Handle(TColgp_HArray1OfXYZ)& allPoints)
41 Standard_Integer num = allEntities->Length();
42 if (allEntities->Lower() != 1 ||
43 allLocations->Lower() != 1 || allLocations->Length() != num ||
44 allPoints->Lower() != 1 || allPoints->Length() != num )
45 Standard_DimensionMismatch::Raise
46 ("IGESDimen_NewDimensionedGeometry: Init");
47 theNbDimensions = nbDimens;
48 theDimensionEntity = aDimen;
49 theDimensionOrientationFlag = anOrientation;
50 theAngleValue = anAngle;
51 theGeometryEntities = allEntities;
52 theDimensionLocationFlags = allLocations;
53 thePoints = allPoints;
54 InitTypeAndForm(402,21);
58 Standard_Integer IGESDimen_NewDimensionedGeometry::NbDimensions () const
60 return theNbDimensions;
63 Standard_Integer IGESDimen_NewDimensionedGeometry::NbGeometries () const
65 return theGeometryEntities->Length();
68 Handle(IGESData_IGESEntity) IGESDimen_NewDimensionedGeometry::DimensionEntity
71 return theDimensionEntity;
74 Standard_Integer IGESDimen_NewDimensionedGeometry::DimensionOrientationFlag
77 return theDimensionOrientationFlag;
80 Standard_Real IGESDimen_NewDimensionedGeometry::AngleValue () const
85 Handle(IGESData_IGESEntity) IGESDimen_NewDimensionedGeometry::GeometryEntity
86 (const Standard_Integer Index) const
88 return theGeometryEntities->Value(Index);
91 Standard_Integer IGESDimen_NewDimensionedGeometry::DimensionLocationFlag
92 (const Standard_Integer Index) const
94 return theDimensionLocationFlags->Value(Index);
97 gp_Pnt IGESDimen_NewDimensionedGeometry::Point
98 (const Standard_Integer Index) const
100 return gp_Pnt(thePoints->Value(Index));
103 gp_Pnt IGESDimen_NewDimensionedGeometry::TransformedPoint
104 (const Standard_Integer Index) const
106 gp_XYZ point = thePoints->Value(Index);
107 if (HasTransf()) Location().Transforms(point);
108 return gp_Pnt(point);