b311480e |
1 | // Created by: CKY / Contract Toubro-Larsen |
2 | // Copyright (c) 1993-1999 Matra Datavision |
973c2be1 |
3 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
4 | // |
973c2be1 |
5 | // This file is part of Open CASCADE Technology software library. |
7fd59977 |
6 | // |
d5f74e42 |
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 |
973c2be1 |
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. |
7fd59977 |
12 | // |
973c2be1 |
13 | // Alternatively, this file may be used under the terms of Open CASCADE |
14 | // commercial license or contractual agreement. |
b311480e |
15 | |
16 | //-------------------------------------------------------------------- |
7fd59977 |
17 | //-------------------------------------------------------------------- |
18 | |
42cf5bc1 |
19 | #include <IGESData_IGESEntity.hxx> |
20 | #include <IGESDraw_ConnectPoint.hxx> |
21 | #include <IGESDraw_NetworkSubfigureDef.hxx> |
22 | #include <IGESGraph_TextDisplayTemplate.hxx> |
7fd59977 |
23 | #include <Standard_DimensionMismatch.hxx> |
42cf5bc1 |
24 | #include <Standard_OutOfRange.hxx> |
25 | #include <Standard_Type.hxx> |
26 | #include <TCollection_HAsciiString.hxx> |
7fd59977 |
27 | |
92efcf78 |
28 | IMPLEMENT_STANDARD_RTTIEXT(IGESDraw_NetworkSubfigureDef,IGESData_IGESEntity) |
29 | |
b311480e |
30 | IGESDraw_NetworkSubfigureDef::IGESDraw_NetworkSubfigureDef () { } |
7fd59977 |
31 | |
32 | |
33 | void IGESDraw_NetworkSubfigureDef::Init |
34 | (const Standard_Integer aDepth, |
35 | const Handle(TCollection_HAsciiString)& aName, |
36 | const Handle(IGESData_HArray1OfIGESEntity)& allEntities, |
37 | const Standard_Integer aTypeFlag, |
38 | const Handle(TCollection_HAsciiString)& aDesignator, |
39 | const Handle(IGESGraph_TextDisplayTemplate)& aTemplate, |
40 | const Handle(IGESDraw_HArray1OfConnectPoint)& allPointEntities) |
41 | { |
42 | if (!allPointEntities.IsNull()) |
43 | if (allPointEntities->Lower() != 1 || allEntities->Lower() != 1) |
44 | Standard_DimensionMismatch::Raise("IGESDraw_NetworkSubfigureDef : Init"); |
45 | theDepth = aDepth; |
46 | theName = aName; |
47 | theEntities = allEntities; |
48 | theTypeFlag = aTypeFlag; |
49 | theDesignator = aDesignator; |
50 | theDesignatorTemplate = aTemplate; |
51 | thePointEntities = allPointEntities; |
52 | InitTypeAndForm(320,0); |
53 | } |
54 | |
55 | Standard_Integer IGESDraw_NetworkSubfigureDef::Depth () const |
56 | { |
57 | return theDepth; |
58 | } |
59 | |
60 | Handle(TCollection_HAsciiString) IGESDraw_NetworkSubfigureDef::Name () const |
61 | { |
62 | return theName; |
63 | } |
64 | |
65 | Standard_Integer IGESDraw_NetworkSubfigureDef::NbEntities () const |
66 | { |
67 | return theEntities->Length(); |
68 | } |
69 | |
70 | Handle(IGESData_IGESEntity) IGESDraw_NetworkSubfigureDef::Entity |
71 | (const Standard_Integer Index) const |
72 | { |
73 | return theEntities->Value(Index); |
74 | // if Index is out of bound HArray1 will raise OutOfRange exception |
75 | } |
76 | |
77 | Standard_Integer IGESDraw_NetworkSubfigureDef::TypeFlag () const |
78 | { |
79 | return theTypeFlag; |
80 | } |
81 | |
82 | Handle(TCollection_HAsciiString) IGESDraw_NetworkSubfigureDef::Designator |
83 | () const |
84 | { |
85 | return theDesignator; |
86 | } |
87 | |
88 | Standard_Boolean IGESDraw_NetworkSubfigureDef::HasDesignatorTemplate () const |
89 | { |
90 | return (! theDesignatorTemplate.IsNull()); |
91 | } |
92 | |
93 | Handle(IGESGraph_TextDisplayTemplate) |
94 | IGESDraw_NetworkSubfigureDef::DesignatorTemplate () const |
95 | { |
96 | return theDesignatorTemplate; |
97 | } |
98 | |
99 | Standard_Integer IGESDraw_NetworkSubfigureDef::NbPointEntities () const |
100 | { |
101 | return (thePointEntities.IsNull() ? 0 : thePointEntities->Length()); |
102 | } |
103 | |
104 | Standard_Boolean IGESDraw_NetworkSubfigureDef::HasPointEntity |
105 | (const Standard_Integer Index) const |
106 | { |
107 | if (thePointEntities.IsNull()) return Standard_False; |
108 | return (! thePointEntities->Value(Index).IsNull()); |
109 | // if Index is out of bound HArray1 will raise OutOfRange exception |
110 | } |
111 | |
112 | Handle(IGESDraw_ConnectPoint) IGESDraw_NetworkSubfigureDef::PointEntity |
113 | (const Standard_Integer Index) const |
114 | { |
115 | return thePointEntities->Value(Index); |
116 | // if Index is out of bound HArray1 will raise OutOfRange exception |
117 | } |