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 <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>
26
IMPLEMENT_STANDARD_RTTIEXT(IGESDimen_GeneralSymbol,IGESData_IGESEntity)27 IMPLEMENT_STANDARD_RTTIEXT(IGESDimen_GeneralSymbol,IGESData_IGESEntity)
28
29 IGESDimen_GeneralSymbol::IGESDimen_GeneralSymbol () { }
30
Init(const Handle (IGESDimen_GeneralNote)& aNote,const Handle (IGESData_HArray1OfIGESEntity)& allGeoms,const Handle (IGESDimen_HArray1OfLeaderArrow)& allLeaders)31 void IGESDimen_GeneralSymbol::Init
32 (const Handle(IGESDimen_GeneralNote)& aNote,
33 const Handle(IGESData_HArray1OfIGESEntity)& allGeoms,
34 const Handle(IGESDimen_HArray1OfLeaderArrow)& allLeaders)
35 {
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("$");
40 theNote = aNote;
41 theGeoms = allGeoms;
42 theLeaders = allLeaders;
43 InitTypeAndForm(228,FormNumber());
44 // FormNumber precises the Nature of the Symbol, cf G.14 (0-3 or > 5000)
45 }
46
SetFormNumber(const Standard_Integer form)47 void IGESDimen_GeneralSymbol::SetFormNumber (const Standard_Integer form)
48 {
49 if ((form < 0 || form > 3) && form < 5000) throw Standard_OutOfRange("IGESDimen_GeneralSymbol : SetFormNumber");
50 InitTypeAndForm(228,form);
51 }
52
53
HasNote() const54 Standard_Boolean IGESDimen_GeneralSymbol::HasNote () const
55 {
56 return (!theNote.IsNull());
57 }
58
Handle(IGESDimen_GeneralNote)59 Handle(IGESDimen_GeneralNote) IGESDimen_GeneralSymbol::Note () const
60 {
61 return theNote;
62 }
63
NbGeomEntities() const64 Standard_Integer IGESDimen_GeneralSymbol::NbGeomEntities () const
65 {
66 return theGeoms->Length();
67 }
68
Handle(IGESData_IGESEntity)69 Handle(IGESData_IGESEntity) IGESDimen_GeneralSymbol::GeomEntity
70 (const Standard_Integer Index) const
71 {
72 return theGeoms->Value(Index);
73 }
74
NbLeaders() const75 Standard_Integer IGESDimen_GeneralSymbol::NbLeaders () const
76 {
77 return (theLeaders.IsNull() ? 0 : theLeaders->Length());
78 }
79
Handle(IGESDimen_LeaderArrow)80 Handle(IGESDimen_LeaderArrow) IGESDimen_GeneralSymbol::LeaderArrow
81 (const Standard_Integer Index) const
82 {
83 return theLeaders->Value(Index);
84 }
85