mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-07-20 12:45:50 +03:00
135 lines
4.3 KiB
C++
Executable File
135 lines
4.3 KiB
C++
Executable File
// Created by: CKY / Contract Toubro-Larsen
|
|
// Copyright (c) 1993-1999 Matra Datavision
|
|
// Copyright (c) 1999-2012 OPEN CASCADE SAS
|
|
//
|
|
// The content of this file is subject to the Open CASCADE Technology Public
|
|
// License Version 6.5 (the "License"). You may not use the content of this file
|
|
// except in compliance with the License. Please obtain a copy of the License
|
|
// at http://www.opencascade.org and read it completely before using this file.
|
|
//
|
|
// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
|
|
// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
|
|
//
|
|
// The Original Code and all software distributed under the License is
|
|
// distributed on an "AS IS" basis, without warranty of any kind, and the
|
|
// Initial Developer hereby disclaims all such warranties, including without
|
|
// limitation, any warranties of merchantability, fitness for a particular
|
|
// purpose or non-infringement. Please see the License for the specific terms
|
|
// and conditions governing the rights and limitations under the License.
|
|
|
|
//--------------------------------------------------------------------
|
|
//--------------------------------------------------------------------
|
|
|
|
// UNFINISHED
|
|
// The last field (theDependentValues) not resolved. Queried to mdtv
|
|
|
|
#include <IGESDefs_TabularData.ixx>
|
|
#include <Standard_DimensionMismatch.hxx>
|
|
#include <TColStd_HArray1OfReal.hxx>
|
|
|
|
|
|
IGESDefs_TabularData::IGESDefs_TabularData () { }
|
|
|
|
|
|
void IGESDefs_TabularData::Init
|
|
(const Standard_Integer nbProps,
|
|
const Standard_Integer propType,
|
|
/* const Standard_Integer nbDeps, */
|
|
/* const Standard_Integer nbIndeps, */
|
|
const Handle(TColStd_HArray1OfInteger)& typesInd,
|
|
const Handle(TColStd_HArray1OfInteger)& nbValuesInd,
|
|
const Handle(IGESBasic_HArray1OfHArray1OfReal)& valuesInd,
|
|
const Handle(IGESBasic_HArray1OfHArray1OfReal)& valuesDep)
|
|
{
|
|
Standard_Integer num = typesInd->Length();
|
|
if (typesInd->Lower() != 1 ||
|
|
nbValuesInd->Lower() != 1 || nbValuesInd->Length() != num ||
|
|
valuesInd->Lower() != 1 || valuesInd->Length() != num ||
|
|
valuesDep->Lower() != 1 )
|
|
Standard_DimensionMismatch::Raise("IGESDefs_TabularData : Init");
|
|
theNbPropertyValues = nbProps;
|
|
thePropertyType = propType;
|
|
/* theNbDependents = nbDeps; */
|
|
/* theNbIndependents = nbIndeps; */
|
|
theTypeOfIndependentVariables = typesInd;
|
|
theNbValues = nbValuesInd;
|
|
theIndependentValues = valuesInd;
|
|
theDependentValues = valuesDep;
|
|
InitTypeAndForm(406,11);
|
|
}
|
|
|
|
Standard_Integer IGESDefs_TabularData::NbPropertyValues () const
|
|
{
|
|
return theNbPropertyValues;
|
|
}
|
|
|
|
Standard_Integer IGESDefs_TabularData::ComputedNbPropertyValues () const
|
|
{
|
|
return theNbPropertyValues; // pas malin ... a ameliorer
|
|
}
|
|
|
|
Standard_Boolean IGESDefs_TabularData::OwnCorrect ()
|
|
{
|
|
Standard_Integer newnb = ComputedNbPropertyValues();
|
|
if (newnb == theNbPropertyValues) return Standard_False;
|
|
theNbPropertyValues = newnb;
|
|
return Standard_True;
|
|
}
|
|
|
|
|
|
Standard_Integer IGESDefs_TabularData::PropertyType () const
|
|
{
|
|
return thePropertyType;
|
|
}
|
|
|
|
Standard_Integer IGESDefs_TabularData::NbDependents () const
|
|
{
|
|
return theDependentValues->Length();
|
|
}
|
|
|
|
Standard_Integer IGESDefs_TabularData::NbIndependents () const
|
|
{
|
|
return theTypeOfIndependentVariables->Length();
|
|
}
|
|
|
|
Standard_Integer IGESDefs_TabularData::TypeOfIndependents
|
|
(const Standard_Integer num) const
|
|
{
|
|
return theTypeOfIndependentVariables->Value(num);
|
|
}
|
|
|
|
Standard_Integer IGESDefs_TabularData::NbValues (const Standard_Integer num) const
|
|
{
|
|
return theNbValues->Value(num);
|
|
}
|
|
|
|
Standard_Real IGESDefs_TabularData::IndependentValue
|
|
(const Standard_Integer variablenum, const Standard_Integer valuenum) const
|
|
{
|
|
return (theIndependentValues->Value(variablenum))->Value(valuenum);
|
|
}
|
|
|
|
Handle(TColStd_HArray1OfReal) IGESDefs_TabularData::DependentValues
|
|
(const Standard_Integer num) const
|
|
{
|
|
return theDependentValues->Value(num);
|
|
}
|
|
|
|
// UNFINISHED
|
|
// Array limits not sure.
|
|
Standard_Real IGESDefs_TabularData::DependentValue
|
|
(const Standard_Integer variablenum, const Standard_Integer valuenum) const
|
|
{
|
|
Standard_Real val = 0.;
|
|
#if 0
|
|
Standard_Integer sum = 0;
|
|
for (Standard_Integer i = 1; i < variablenum; i++)
|
|
{
|
|
sum += theNbValues->Value(i);
|
|
}
|
|
sum += valuenum;
|
|
val = theDependentValues->Value(sum);
|
|
#endif
|
|
return val;
|
|
}
|