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 <IGESDimen_GeneralNote.hxx>
21 #include <IGESDimen_GeneralSymbol.hxx>
22 #include <IGESDimen_LeaderArrow.hxx>
23 #include <Standard_DimensionMismatch.hxx>
24 #include <Standard_OutOfRange.hxx>
25 #include <Standard_Type.hxx>
27 IMPLEMENT_STANDARD_RTTIEXT(IGESDimen_GeneralSymbol,IGESData_IGESEntity)
29 IGESDimen_GeneralSymbol::IGESDimen_GeneralSymbol () { }
31 void IGESDimen_GeneralSymbol::Init
32 (const Handle(IGESDimen_GeneralNote)& aNote,
33 const Handle(IGESData_HArray1OfIGESEntity)& allGeoms,
34 const Handle(IGESDimen_HArray1OfLeaderArrow)& allLeaders)
36 if (!allGeoms.IsNull() && allGeoms->Lower() != 1)
37 throw Standard_DimensionMismatch("IGESDimen_GeneralSymbol : Init");
38 if (!allLeaders.IsNull())
39 if (allLeaders->Lower() != 1) throw Standard_DimensionMismatch("$");
42 theLeaders = allLeaders;
43 InitTypeAndForm(228,FormNumber());
44 // FormNumber precises the Nature of the Symbol, cf G.14 (0-3 or > 5000)
47 void IGESDimen_GeneralSymbol::SetFormNumber (const Standard_Integer form)
49 if ((form < 0 || form > 3) && form < 5000) throw Standard_OutOfRange("IGESDimen_GeneralSymbol : SetFormNumber");
50 InitTypeAndForm(228,form);
54 Standard_Boolean IGESDimen_GeneralSymbol::HasNote () const
56 return (!theNote.IsNull());
59 Handle(IGESDimen_GeneralNote) IGESDimen_GeneralSymbol::Note () const
64 Standard_Integer IGESDimen_GeneralSymbol::NbGeomEntities () const
66 return theGeoms->Length();
69 Handle(IGESData_IGESEntity) IGESDimen_GeneralSymbol::GeomEntity
70 (const Standard_Integer Index) const
72 return theGeoms->Value(Index);
75 Standard_Integer IGESDimen_GeneralSymbol::NbLeaders () const
77 return (theLeaders.IsNull() ? 0 : theLeaders->Length());
80 Handle(IGESDimen_LeaderArrow) IGESDimen_GeneralSymbol::LeaderArrow
81 (const Standard_Integer Index) const
83 return theLeaders->Value(Index);