0033661: Data Exchange, Step Import - Tessellated GDTs are not imported
[occt.git] / src / IGESAppli / IGESAppli_NodalDisplAndRot.cxx
CommitLineData
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_NodalDisplAndRot.hxx>
20#include <IGESAppli_Node.hxx>
21#include <IGESBasic_HArray1OfHArray1OfXYZ.hxx>
22#include <IGESDimen_GeneralNote.hxx>
23#include <Standard_DimensionMismatch.hxx>
42cf5bc1 24#include <Standard_Type.hxx>
7fd59977 25#include <TColgp_HArray1OfXYZ.hxx>
26
92efcf78 27IMPLEMENT_STANDARD_RTTIEXT(IGESAppli_NodalDisplAndRot,IGESData_IGESEntity)
28
b311480e 29IGESAppli_NodalDisplAndRot::IGESAppli_NodalDisplAndRot () { }
7fd59977 30
31
32 void IGESAppli_NodalDisplAndRot::Init
33 (const Handle(IGESDimen_HArray1OfGeneralNote)& allNotes,
34 const Handle(TColStd_HArray1OfInteger)& allIdentifiers,
35 const Handle(IGESAppli_HArray1OfNode)& allNodes,
36 const Handle(IGESBasic_HArray1OfHArray1OfXYZ)& allRotParams,
37 const Handle(IGESBasic_HArray1OfHArray1OfXYZ)& allTransParams)
38{
39 if ( allNodes->Lower() != 1 ||
40 (allIdentifiers->Lower() != 1 ||
41 allIdentifiers->Length() != allNodes->Length()) ||
42 (allTransParams->Lower() != 1 ||
43 allTransParams->Length() != allNodes->Length()) ||
44 (allRotParams->Lower() != 1 ||
45 allRotParams->Length() != allNodes->Length()) )
9775fa61 46 throw Standard_DimensionMismatch("IGESAppli_NodalDisplAndRot : Init(Lengths of arrays inconsistent)");
7fd59977 47
48 for (Standard_Integer i= 1; i <= allNodes->Length(); i++)
49 {
50 Handle(TColgp_HArray1OfXYZ) temp1 = allTransParams->Value(i);
51 Handle(TColgp_HArray1OfXYZ) temp2 = allRotParams->Value(i);
52 if ((temp1->Lower() != 1 || temp1->Length() != allNotes->Length()) ||
53 (temp2->Lower() != 1 || temp2->Length() != allNotes->Length()) )
9775fa61 54 throw Standard_DimensionMismatch("IGESAppli_NodalDisplAndRot: Init(No. of Param per Node != Nbcases)");
7fd59977 55 }
56
57 theNotes = allNotes;
58 theNodes = allNodes;
59 theNodeIdentifiers = allIdentifiers;
60 theTransParam = allTransParams;
61 theRotParam = allRotParams;
62 InitTypeAndForm(138,0);
63}
64
65 Standard_Integer IGESAppli_NodalDisplAndRot::NbCases () const
66{
67 return theNotes->Length();
68}
69
70 Standard_Integer IGESAppli_NodalDisplAndRot::NbNodes () const
71{
72 return theNodes->Length();
73}
74
75 Handle(IGESDimen_GeneralNote) IGESAppli_NodalDisplAndRot::Note
76 (const Standard_Integer Index) const
77{
78 return theNotes->Value(Index);
79}
80
81 Standard_Integer IGESAppli_NodalDisplAndRot::NodeIdentifier
82 (const Standard_Integer Index) const
83{
84 return theNodeIdentifiers->Value(Index);
85}
86
87 Handle(IGESAppli_Node) IGESAppli_NodalDisplAndRot::Node
88 (const Standard_Integer Index) const
89{
90 return theNodes->Value(Index);
91}
92
93 gp_XYZ IGESAppli_NodalDisplAndRot::TranslationParameter
94 (const Standard_Integer NodeNum, const Standard_Integer CaseNum) const
95{
96 return theTransParam->Value(NodeNum)->Value(CaseNum);
97}
98
99 gp_XYZ IGESAppli_NodalDisplAndRot::RotationalParameter
100 (const Standard_Integer NodeNum, const Standard_Integer CaseNum) const
101{
102 return theRotParam->Value(NodeNum)->Value(CaseNum);
103}
104