0024166: Unable to create file with "Save" menu of voxeldemo Qt sample
[occt.git] / src / IGESAppli / IGESAppli_PipingFlow.cxx
CommitLineData
b311480e 1// Created by: CKY / Contract Toubro-Larsen
2// Copyright (c) 1993-1999 Matra Datavision
3// Copyright (c) 1999-2012 OPEN CASCADE SAS
4//
5// The content of this file is subject to the Open CASCADE Technology Public
6// License Version 6.5 (the "License"). You may not use the content of this file
7// except in compliance with the License. Please obtain a copy of the License
8// at http://www.opencascade.org and read it completely before using this file.
7fd59977 9//
b311480e 10// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
11// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
7fd59977 12//
b311480e 13// The Original Code and all software distributed under the License is
14// distributed on an "AS IS" basis, without warranty of any kind, and the
15// Initial Developer hereby disclaims all such warranties, including without
16// limitation, any warranties of merchantability, fitness for a particular
17// purpose or non-infringement. Please see the License for the specific terms
18// and conditions governing the rights and limitations under the License.
19
20//--------------------------------------------------------------------
7fd59977 21//--------------------------------------------------------------------
22
23#include <IGESAppli_PipingFlow.ixx>
24#include <Standard_DimensionMismatch.hxx>
25
26
b311480e 27IGESAppli_PipingFlow::IGESAppli_PipingFlow () { }
7fd59977 28
29
30 void IGESAppli_PipingFlow::Init
31 (const Standard_Integer nbContextFlags,
32 const Standard_Integer aFlowType,
33 const Handle(IGESData_HArray1OfIGESEntity)& allFlowAssocs,
34 const Handle(IGESDraw_HArray1OfConnectPoint)& allConnectPoints,
35 const Handle(IGESData_HArray1OfIGESEntity)& allJoins,
36 const Handle(Interface_HArray1OfHAsciiString)& allFlowNames,
37 const Handle(IGESGraph_HArray1OfTextDisplayTemplate)& allTextDisps,
38 const Handle(IGESData_HArray1OfIGESEntity)& allContFlowAssocs)
39{
40 Standard_Integer num = allFlowAssocs->Length();
41 if (allFlowAssocs->Lower() != 1 ||
42 allConnectPoints->Lower() != 1 || allConnectPoints->Length() != num ||
43 allJoins->Lower() != 1 || allJoins->Length() != num ||
44 allFlowNames->Lower() != 1 || allFlowNames->Length() != num ||
45 allContFlowAssocs->Lower() != 1 || allContFlowAssocs->Length() != num )
46 Standard_DimensionMismatch::Raise("IGESAppli_PipingFlow : Init");
47 theNbContextFlags = nbContextFlags;
48 theTypeOfFlow = aFlowType;
49 theFlowAssociativities = allFlowAssocs;
50 theConnectPoints = allConnectPoints;
51 theJoins = allJoins;
52 theFlowNames = allFlowNames;
53 theTextDisplayTemplates = allTextDisps;
54 theContFlowAssociativities = allContFlowAssocs;
55 InitTypeAndForm(402,20);
56}
57
58 Standard_Boolean IGESAppli_PipingFlow::OwnCorrect ()
59{
60 if (theNbContextFlags == 1) return Standard_False;
61 theNbContextFlags = 1;
62 return Standard_True;
63}
64
65
66 Standard_Integer IGESAppli_PipingFlow::NbContextFlags () const
67{
68 return theNbContextFlags;
69}
70
71 Standard_Integer IGESAppli_PipingFlow::NbFlowAssociativities () const
72{
73 return theFlowAssociativities->Length();
74}
75
76 Standard_Integer IGESAppli_PipingFlow::NbConnectPoints () const
77{
78 return theConnectPoints->Length();
79}
80
81 Standard_Integer IGESAppli_PipingFlow::NbJoins () const
82{
83 return theJoins->Length();
84}
85
86 Standard_Integer IGESAppli_PipingFlow::NbFlowNames () const
87{
88 return theFlowNames->Length();
89}
90
91 Standard_Integer IGESAppli_PipingFlow::NbTextDisplayTemplates () const
92{
93 return theTextDisplayTemplates->Length();
94}
95
96 Standard_Integer IGESAppli_PipingFlow::NbContFlowAssociativities () const
97{
98 return theContFlowAssociativities->Length();
99}
100
101 Standard_Integer IGESAppli_PipingFlow::TypeOfFlow () const
102{
103 return theTypeOfFlow;
104}
105
106 Handle(IGESData_IGESEntity) IGESAppli_PipingFlow::FlowAssociativity
107 (const Standard_Integer Index) const
108{
109 return theFlowAssociativities->Value(Index);
110}
111
112 Handle(IGESDraw_ConnectPoint) IGESAppli_PipingFlow::ConnectPoint
113 (const Standard_Integer Index) const
114{
115 return theConnectPoints->Value(Index);
116}
117
118 Handle(IGESData_IGESEntity) IGESAppli_PipingFlow::Join
119 (const Standard_Integer Index) const
120{
121 return theJoins->Value(Index);
122}
123
124 Handle(TCollection_HAsciiString) IGESAppli_PipingFlow::FlowName
125 (const Standard_Integer Index) const
126{
127 return theFlowNames->Value(Index);
128}
129
130 Handle(IGESGraph_TextDisplayTemplate) IGESAppli_PipingFlow::TextDisplayTemplate
131 (const Standard_Integer Index) const
132{
133 return theTextDisplayTemplates->Value(Index);
134}
135
136 Handle(IGESData_IGESEntity) IGESAppli_PipingFlow::ContFlowAssociativity
137 (const Standard_Integer Index) const
138{
139 return theContFlowAssociativities->Value(Index);
140}