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 <IGESAppli_PipingFlow.hxx> |
20 | #include <IGESData_IGESEntity.hxx> |
21 | #include <IGESDraw_ConnectPoint.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(IGESAppli_PipingFlow,IGESData_IGESEntity) |
29 | |
b311480e |
30 | IGESAppli_PipingFlow::IGESAppli_PipingFlow () { } |
7fd59977 |
31 | |
32 | |
33 | void IGESAppli_PipingFlow::Init |
34 | (const Standard_Integer nbContextFlags, |
35 | const Standard_Integer aFlowType, |
36 | const Handle(IGESData_HArray1OfIGESEntity)& allFlowAssocs, |
37 | const Handle(IGESDraw_HArray1OfConnectPoint)& allConnectPoints, |
38 | const Handle(IGESData_HArray1OfIGESEntity)& allJoins, |
39 | const Handle(Interface_HArray1OfHAsciiString)& allFlowNames, |
40 | const Handle(IGESGraph_HArray1OfTextDisplayTemplate)& allTextDisps, |
41 | const Handle(IGESData_HArray1OfIGESEntity)& allContFlowAssocs) |
42 | { |
43 | Standard_Integer num = allFlowAssocs->Length(); |
44 | if (allFlowAssocs->Lower() != 1 || |
45 | allConnectPoints->Lower() != 1 || allConnectPoints->Length() != num || |
46 | allJoins->Lower() != 1 || allJoins->Length() != num || |
47 | allFlowNames->Lower() != 1 || allFlowNames->Length() != num || |
48 | allContFlowAssocs->Lower() != 1 || allContFlowAssocs->Length() != num ) |
9775fa61 |
49 | throw Standard_DimensionMismatch("IGESAppli_PipingFlow : Init"); |
7fd59977 |
50 | theNbContextFlags = nbContextFlags; |
51 | theTypeOfFlow = aFlowType; |
52 | theFlowAssociativities = allFlowAssocs; |
53 | theConnectPoints = allConnectPoints; |
54 | theJoins = allJoins; |
55 | theFlowNames = allFlowNames; |
56 | theTextDisplayTemplates = allTextDisps; |
57 | theContFlowAssociativities = allContFlowAssocs; |
58 | InitTypeAndForm(402,20); |
59 | } |
60 | |
61 | Standard_Boolean IGESAppli_PipingFlow::OwnCorrect () |
62 | { |
63 | if (theNbContextFlags == 1) return Standard_False; |
64 | theNbContextFlags = 1; |
65 | return Standard_True; |
66 | } |
67 | |
68 | |
69 | Standard_Integer IGESAppli_PipingFlow::NbContextFlags () const |
70 | { |
71 | return theNbContextFlags; |
72 | } |
73 | |
74 | Standard_Integer IGESAppli_PipingFlow::NbFlowAssociativities () const |
75 | { |
76 | return theFlowAssociativities->Length(); |
77 | } |
78 | |
79 | Standard_Integer IGESAppli_PipingFlow::NbConnectPoints () const |
80 | { |
81 | return theConnectPoints->Length(); |
82 | } |
83 | |
84 | Standard_Integer IGESAppli_PipingFlow::NbJoins () const |
85 | { |
86 | return theJoins->Length(); |
87 | } |
88 | |
89 | Standard_Integer IGESAppli_PipingFlow::NbFlowNames () const |
90 | { |
91 | return theFlowNames->Length(); |
92 | } |
93 | |
94 | Standard_Integer IGESAppli_PipingFlow::NbTextDisplayTemplates () const |
95 | { |
96 | return theTextDisplayTemplates->Length(); |
97 | } |
98 | |
99 | Standard_Integer IGESAppli_PipingFlow::NbContFlowAssociativities () const |
100 | { |
101 | return theContFlowAssociativities->Length(); |
102 | } |
103 | |
104 | Standard_Integer IGESAppli_PipingFlow::TypeOfFlow () const |
105 | { |
106 | return theTypeOfFlow; |
107 | } |
108 | |
109 | Handle(IGESData_IGESEntity) IGESAppli_PipingFlow::FlowAssociativity |
110 | (const Standard_Integer Index) const |
111 | { |
112 | return theFlowAssociativities->Value(Index); |
113 | } |
114 | |
115 | Handle(IGESDraw_ConnectPoint) IGESAppli_PipingFlow::ConnectPoint |
116 | (const Standard_Integer Index) const |
117 | { |
118 | return theConnectPoints->Value(Index); |
119 | } |
120 | |
121 | Handle(IGESData_IGESEntity) IGESAppli_PipingFlow::Join |
122 | (const Standard_Integer Index) const |
123 | { |
124 | return theJoins->Value(Index); |
125 | } |
126 | |
127 | Handle(TCollection_HAsciiString) IGESAppli_PipingFlow::FlowName |
128 | (const Standard_Integer Index) const |
129 | { |
130 | return theFlowNames->Value(Index); |
131 | } |
132 | |
133 | Handle(IGESGraph_TextDisplayTemplate) IGESAppli_PipingFlow::TextDisplayTemplate |
134 | (const Standard_Integer Index) const |
135 | { |
136 | return theTextDisplayTemplates->Value(Index); |
137 | } |
138 | |
139 | Handle(IGESData_IGESEntity) IGESAppli_PipingFlow::ContFlowAssociativity |
140 | (const Standard_Integer Index) const |
141 | { |
142 | return theContFlowAssociativities->Value(Index); |
143 | } |