0024057: Eliminate compiler warning C4100 in MSVC++ with warning level 4
[occt.git] / src / IGESAppli / IGESAppli_ElementResults.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// UNFINISHED & UNSTARTED
24#include <IGESAppli_ElementResults.ixx>
25#include <Standard_OutOfRange.hxx>
26
27
b311480e 28IGESAppli_ElementResults::IGESAppli_ElementResults () { }
7fd59977 29
30 void IGESAppli_ElementResults::Init
31 (const Handle(IGESDimen_GeneralNote)& aNote,
32 const Standard_Integer aSubCase, const Standard_Real aTime,
33 const Standard_Integer nbResults, const Standard_Integer aResRepFlag,
34 const Handle(TColStd_HArray1OfInteger)& allElementIdents,
35 const Handle(IGESAppli_HArray1OfFiniteElement)& allFiniteElems,
36 const Handle(TColStd_HArray1OfInteger)& allTopTypes,
37 const Handle(TColStd_HArray1OfInteger)& nbLayers,
38 const Handle(TColStd_HArray1OfInteger)& allDataLayerFlags,
39 const Handle(TColStd_HArray1OfInteger)& allnbResDataLocs,
40 const Handle(IGESBasic_HArray1OfHArray1OfInteger)& allResDataLocs,
41 const Handle(IGESBasic_HArray1OfHArray1OfReal)& allResults) // UNFINISHED
42{
43 // raises exception if sizes are not consistent, (lower = 1 too)
44 // but how to check is not clear ??
45 Standard_Integer num = allElementIdents->Length();
46 if (allElementIdents->Lower() != 1 ||
47 allFiniteElems->Lower() != 1 || allFiniteElems->Upper() != num ||
48 allTopTypes->Lower() != 1 || allTopTypes->Upper() != num ||
49 nbLayers->Lower() != 1 || nbLayers->Upper() != num ||
50 allDataLayerFlags->Lower() != 1 || allDataLayerFlags->Upper() != num ||
51 allnbResDataLocs->Lower() != 1 || allnbResDataLocs->Upper() != num ||
52 allResDataLocs->Lower() != 1 || allResDataLocs->Upper() != num ||
53 allResults->Lower() != 1 || allResults->Upper() != num )
54 Standard_DimensionMismatch::Raise("IGESAppli_ElementsResults : Init");
55 for (Standard_Integer i = 1; i <= num; i ++) {
56 Standard_Integer nl = nbLayers->Value(i);
57 Standard_Integer nrl = allnbResDataLocs->Value(i);
58 if (allResDataLocs->Value(i)->Lower() != 1 ||
59 allResDataLocs->Value(i)->Upper() != nrl)
60 Standard_DimensionMismatch::Raise("IGESAppli_ElementsResults : DataLoc");
61 if (allResults->Value(i)->Lower() != 1 ||
62 allResults->Value(i)->Upper() != nl*nrl*nbResults)
63 Standard_DimensionMismatch::Raise("IGESAppli_ElementsResults : Results");
64 }
65
66 theNote = aNote;
67 theSubcaseNumber = aSubCase;
68 theTime = aTime;
69 theNbResultValues = nbResults;
70 theResultReportFlag = aResRepFlag;
71 theElementIdentifiers = allElementIdents;
72 theElements = allFiniteElems;
73 theElementTopologyTypes = allTopTypes;
74 theNbLayers = nbLayers;
75 theDataLayerFlags = allDataLayerFlags;
76 theNbResultDataLocs = allnbResDataLocs;
77 theResultDataLocs = allResDataLocs;
78 theResultData = allResults;
79 InitTypeAndForm(148,FormNumber());
80// FormNumber -> Type of the Results
81}
82
83 void IGESAppli_ElementResults::SetFormNumber (const Standard_Integer form)
84{
85 if (form < 0 || form > 34) Standard_OutOfRange::Raise
86 ("IGESAppli_ElementResults : SetFormNumber");
87 InitTypeAndForm(148,form);
88}
89
90
91 Handle(IGESDimen_GeneralNote) IGESAppli_ElementResults::Note () const
92{
93 return theNote;
94}
95
96 Standard_Integer IGESAppli_ElementResults::SubCaseNumber () const
97{
98 return theSubcaseNumber;
99}
100
101 Standard_Real IGESAppli_ElementResults::Time () const
102{
103 return theTime;
104}
105
106 Standard_Integer IGESAppli_ElementResults::NbResultValues () const
107{
108 return theNbResultValues;
109}
110
111 Standard_Integer IGESAppli_ElementResults::ResultReportFlag () const
112{
113 return theResultReportFlag;
114}
115
116 Standard_Integer IGESAppli_ElementResults::NbElements () const
117{
118 return theElements->Length();
119}
120
121 Standard_Integer IGESAppli_ElementResults::ElementIdentifier
122 (const Standard_Integer Index) const
123{
124 return theElementIdentifiers->Value(Index);
125}
126
127 Handle(IGESAppli_FiniteElement) IGESAppli_ElementResults::Element
128 (const Standard_Integer Index) const
129{
130 return theElements->Value(Index);
131}
132
133 Standard_Integer IGESAppli_ElementResults::ElementTopologyType
134 (const Standard_Integer Index) const
135{
136 return theElementTopologyTypes->Value(Index);
137}
138
139 Standard_Integer IGESAppli_ElementResults::NbLayers
140 (const Standard_Integer Index) const
141{
142 return theNbLayers->Value(Index);
143}
144
145 Standard_Integer IGESAppli_ElementResults::DataLayerFlag
146 (const Standard_Integer Index) const
147{
148 return theDataLayerFlags->Value(Index);
149}
150
151 Standard_Integer IGESAppli_ElementResults::NbResultDataLocs
152 (const Standard_Integer Index) const
153{
154 return theNbResultDataLocs->Value(Index);
155}
156
157// ?? VERIFIER
158
159 Standard_Integer IGESAppli_ElementResults::ResultDataLoc
160 (const Standard_Integer NElem, const Standard_Integer NLoc) const
161{
162 return theResultDataLocs->Value(NElem)->Value(NLoc);
163}
164
165 Standard_Integer IGESAppli_ElementResults::NbResults
166 (const Standard_Integer Index) const
167{
168 return theResultData->Value(Index)->Length();
169}
170
171 Standard_Real IGESAppli_ElementResults::ResultData
172 (const Standard_Integer NElem, const Standard_Integer num) const
173{
174 return theResultData->Value(NElem)->Value(num);
175}
176
177 Standard_Integer IGESAppli_ElementResults::ResultRank
178 (const Standard_Integer NElem, const Standard_Integer NVal,
179 const Standard_Integer NLay, const Standard_Integer NLoc) const
180{
181 Standard_Integer num = NVal + theNbResultValues *
182 (NLay + theNbLayers->Value(NElem) * NLoc);
183 return num;
184}
185
186 Standard_Real IGESAppli_ElementResults::ResultData
187 (const Standard_Integer NElem, const Standard_Integer NVal,
188 const Standard_Integer NLay, const Standard_Integer NLoc) const
189{
190 return theResultData->Value(NElem)->Value(ResultRank(NElem,NVal,NLay,NLoc));
191}
192
193 Handle(TColStd_HArray1OfReal) IGESAppli_ElementResults::ResultList
194 (const Standard_Integer NElem) const
195{
196 return theResultData->Value(NElem);
197}