0033661: Data Exchange, Step Import - Tessellated GDTs are not imported
[occt.git] / src / Plate / Plate_LinearScalarConstraint.cxx
1 // Created on: 1998-03-26
2 // Created by: # Andre LIEUTIER
3 // Copyright (c) 1998-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17
18 #include <gp_XYZ.hxx>
19 #include <Plate_LinearScalarConstraint.hxx>
20 #include <Plate_PinpointConstraint.hxx>
21 #include <Standard_DimensionMismatch.hxx>
22
23 Plate_LinearScalarConstraint::Plate_LinearScalarConstraint() {}
24
25 Plate_LinearScalarConstraint::Plate_LinearScalarConstraint
26    (const Plate_PinpointConstraint& PPC1,const gp_XYZ& coeff)
27
28 {
29   myPPC = new Plate_HArray1OfPinpointConstraint(1,1);
30   myCoef = new TColgp_HArray2OfXYZ(1,1,1,1);
31
32   myPPC->ChangeValue(1) = PPC1;
33   myCoef->ChangeValue(1,1) = coeff;
34 }
35
36 Plate_LinearScalarConstraint::Plate_LinearScalarConstraint(const Plate_Array1OfPinpointConstraint& thePPC,const TColgp_Array1OfXYZ& theCoeff)
37 {
38   if(theCoeff.Length()!= thePPC.Length()) throw Standard_DimensionMismatch();
39   myPPC = new Plate_HArray1OfPinpointConstraint(1, thePPC.Length());
40   myCoef = new TColgp_HArray2OfXYZ(1,1,1, theCoeff.Length());
41
42   myPPC->ChangeArray1() = thePPC;
43   for(Standard_Integer i = 1; i<= theCoeff.Length(); i++) {
44     myCoef->ChangeValue(1,i) = theCoeff(i+ theCoeff.Lower()-1);
45   }
46 }
47
48 Plate_LinearScalarConstraint::Plate_LinearScalarConstraint
49    (const Plate_Array1OfPinpointConstraint& thePPC,const TColgp_Array2OfXYZ& theCoeff)
50 {
51   if(theCoeff.RowLength()!= thePPC.Length()) throw Standard_DimensionMismatch();
52   myPPC = new Plate_HArray1OfPinpointConstraint(1, thePPC.Length());
53   myCoef = new TColgp_HArray2OfXYZ(1, theCoeff.ColLength(),1, theCoeff.RowLength());
54   
55   myPPC->ChangeArray1() = thePPC;
56   myCoef->ChangeArray2() = theCoeff;
57 }
58
59
60 Plate_LinearScalarConstraint::Plate_LinearScalarConstraint(const Standard_Integer ColLen,const Standard_Integer RowLen)
61 {
62   myPPC = new Plate_HArray1OfPinpointConstraint(1,RowLen);
63   myCoef = new TColgp_HArray2OfXYZ(1,ColLen,1,RowLen);
64   myCoef->Init(gp_XYZ(0.,0.,0.));
65 }
66
67  void Plate_LinearScalarConstraint::SetPPC(const Standard_Integer Index,const Plate_PinpointConstraint& Value) 
68 {
69   myPPC->ChangeValue(Index) = Value;
70 }
71
72  void Plate_LinearScalarConstraint::SetCoeff(const Standard_Integer Row,const Standard_Integer Col,const gp_XYZ& Value) 
73 {
74   myCoef->ChangeValue(Row,Col) = Value;
75 }
76