0026937: Eliminate NO_CXX_EXCEPTION macro support
[occt.git] / src / IGESDraw / IGESDraw_Planar.cxx
1 // Created by: CKY / Contract Toubro-Larsen
2 // Copyright (c) 1993-1999 Matra Datavision
3 // Copyright (c) 1999-2014 OPEN CASCADE SAS
4 //
5 // This file is part of Open CASCADE Technology software library.
6 //
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.
12 //
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
15
16 //--------------------------------------------------------------------
17 //--------------------------------------------------------------------
18
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>
25
26 IMPLEMENT_STANDARD_RTTIEXT(IGESDraw_Planar,IGESData_IGESEntity)
27
28 IGESDraw_Planar::IGESDraw_Planar ()    {  }
29
30
31     void IGESDraw_Planar::Init
32   (const Standard_Integer                        nbMats,
33    const Handle(IGESGeom_TransformationMatrix)&  aTransformationMatrix,
34    const Handle(IGESData_HArray1OfIGESEntity)&   allEntities)
35 {
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);
43 }
44
45
46     Standard_Integer IGESDraw_Planar::NbMatrices () const
47 {
48   return theNbMatrices;
49 }
50
51     Standard_Integer IGESDraw_Planar::NbEntities () const
52 {
53   return ( theEntities.IsNull()? 0 : theEntities->Length() );
54 }
55
56     Standard_Boolean IGESDraw_Planar::IsIdentityMatrix () const
57 {
58   return ( theTransformationMatrix.IsNull() );
59 }
60
61     Handle(IGESGeom_TransformationMatrix) IGESDraw_Planar::TransformMatrix () const
62 {
63   return theTransformationMatrix;
64 }
65
66     Handle(IGESData_IGESEntity) IGESDraw_Planar::Entity
67   (const Standard_Integer EntityIndex) const
68 {
69   return (theEntities->Value(EntityIndex));
70 }