1 // Created by: CKY / Contract Toubro-Larsen
2 // Copyright (c) 1993-1999 Matra Datavision
3 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
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
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.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 //--------------------------------------------------------------------
17 //--------------------------------------------------------------------
20 #include <IGESAppli_NodalDisplAndRot.hxx>
21 #include <IGESAppli_Node.hxx>
22 #include <IGESBasic_HArray1OfHArray1OfXYZ.hxx>
23 #include <IGESDimen_GeneralNote.hxx>
24 #include <Standard_DimensionMismatch.hxx>
25 #include <Standard_OutOfRange.hxx>
26 #include <Standard_Type.hxx>
27 #include <TColgp_HArray1OfXYZ.hxx>
29 IMPLEMENT_STANDARD_RTTIEXT(IGESAppli_NodalDisplAndRot,IGESData_IGESEntity)
31 IGESAppli_NodalDisplAndRot::IGESAppli_NodalDisplAndRot () { }
34 void IGESAppli_NodalDisplAndRot::Init
35 (const Handle(IGESDimen_HArray1OfGeneralNote)& allNotes,
36 const Handle(TColStd_HArray1OfInteger)& allIdentifiers,
37 const Handle(IGESAppli_HArray1OfNode)& allNodes,
38 const Handle(IGESBasic_HArray1OfHArray1OfXYZ)& allRotParams,
39 const Handle(IGESBasic_HArray1OfHArray1OfXYZ)& allTransParams)
41 if ( allNodes->Lower() != 1 ||
42 (allIdentifiers->Lower() != 1 ||
43 allIdentifiers->Length() != allNodes->Length()) ||
44 (allTransParams->Lower() != 1 ||
45 allTransParams->Length() != allNodes->Length()) ||
46 (allRotParams->Lower() != 1 ||
47 allRotParams->Length() != allNodes->Length()) )
48 throw Standard_DimensionMismatch("IGESAppli_NodalDisplAndRot : Init(Lengths of arrays inconsistent)");
50 for (Standard_Integer i= 1; i <= allNodes->Length(); i++)
52 Handle(TColgp_HArray1OfXYZ) temp1 = allTransParams->Value(i);
53 Handle(TColgp_HArray1OfXYZ) temp2 = allRotParams->Value(i);
54 if ((temp1->Lower() != 1 || temp1->Length() != allNotes->Length()) ||
55 (temp2->Lower() != 1 || temp2->Length() != allNotes->Length()) )
56 throw Standard_DimensionMismatch("IGESAppli_NodalDisplAndRot: Init(No. of Param per Node != Nbcases)");
61 theNodeIdentifiers = allIdentifiers;
62 theTransParam = allTransParams;
63 theRotParam = allRotParams;
64 InitTypeAndForm(138,0);
67 Standard_Integer IGESAppli_NodalDisplAndRot::NbCases () const
69 return theNotes->Length();
72 Standard_Integer IGESAppli_NodalDisplAndRot::NbNodes () const
74 return theNodes->Length();
77 Handle(IGESDimen_GeneralNote) IGESAppli_NodalDisplAndRot::Note
78 (const Standard_Integer Index) const
80 return theNotes->Value(Index);
83 Standard_Integer IGESAppli_NodalDisplAndRot::NodeIdentifier
84 (const Standard_Integer Index) const
86 return theNodeIdentifiers->Value(Index);
89 Handle(IGESAppli_Node) IGESAppli_NodalDisplAndRot::Node
90 (const Standard_Integer Index) const
92 return theNodes->Value(Index);
95 gp_XYZ IGESAppli_NodalDisplAndRot::TranslationParameter
96 (const Standard_Integer NodeNum, const Standard_Integer CaseNum) const
98 return theTransParam->Value(NodeNum)->Value(CaseNum);
101 gp_XYZ IGESAppli_NodalDisplAndRot::RotationalParameter
102 (const Standard_Integer NodeNum, const Standard_Integer CaseNum) const
104 return theRotParam->Value(NodeNum)->Value(CaseNum);