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 <IGESData_IGESEntity.hxx>
20 #include <IGESDraw_Planar.hxx>
21 #include <IGESGeom_TransformationMatrix.hxx>
22 #include <Standard_DimensionMismatch.hxx>
23 #include <Standard_OutOfRange.hxx>
24 #include <Standard_Type.hxx>
26 IMPLEMENT_STANDARD_RTTIEXT(IGESDraw_Planar,IGESData_IGESEntity)
28 IGESDraw_Planar::IGESDraw_Planar () { }
31 void IGESDraw_Planar::Init
32 (const Standard_Integer nbMats,
33 const Handle(IGESGeom_TransformationMatrix)& aTransformationMatrix,
34 const Handle(IGESData_HArray1OfIGESEntity)& allEntities)
36 if (!allEntities.IsNull())
37 if (allEntities->Lower() != 1)
38 throw Standard_DimensionMismatch("IGESDraw_Planar : Init");
39 theNbMatrices = nbMats;
40 theTransformationMatrix = aTransformationMatrix;
41 theEntities = allEntities;
42 InitTypeAndForm(402,16);
46 Standard_Integer IGESDraw_Planar::NbMatrices () const
51 Standard_Integer IGESDraw_Planar::NbEntities () const
53 return ( theEntities.IsNull()? 0 : theEntities->Length() );
56 Standard_Boolean IGESDraw_Planar::IsIdentityMatrix () const
58 return ( theTransformationMatrix.IsNull() );
61 Handle(IGESGeom_TransformationMatrix) IGESDraw_Planar::TransformMatrix () const
63 return theTransformationMatrix;
66 Handle(IGESData_IGESEntity) IGESDraw_Planar::Entity
67 (const Standard_Integer EntityIndex) const
69 return (theEntities->Value(EntityIndex));