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