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
6 // This file is part of Open CASCADE Technology software library.
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
19 #include <Plate_LinearScalarConstraint.hxx>
20 #include <Plate_PinpointConstraint.hxx>
21 #include <Standard_DimensionMismatch.hxx>
23 Plate_LinearScalarConstraint::Plate_LinearScalarConstraint() {}
25 Plate_LinearScalarConstraint::Plate_LinearScalarConstraint
26 (const Plate_PinpointConstraint& PPC1,const gp_XYZ& coeff)
29 myPPC = new Plate_HArray1OfPinpointConstraint(1,1);
30 myCoef = new TColgp_HArray2OfXYZ(1,1,1,1);
32 myPPC->ChangeValue(1) = PPC1;
33 myCoef->ChangeValue(1,1) = coeff;
36 Plate_LinearScalarConstraint::Plate_LinearScalarConstraint(const Plate_Array1OfPinpointConstraint& thePPC,const TColgp_Array1OfXYZ& theCoeff)
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());
42 myPPC->ChangeArray1() = thePPC;
43 for(Standard_Integer i = 1; i<= theCoeff.Length(); i++) {
44 myCoef->ChangeValue(1,i) = theCoeff(i+ theCoeff.Lower()-1);
48 Plate_LinearScalarConstraint::Plate_LinearScalarConstraint
49 (const Plate_Array1OfPinpointConstraint& thePPC,const TColgp_Array2OfXYZ& theCoeff)
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());
55 myPPC->ChangeArray1() = thePPC;
56 myCoef->ChangeArray2() = theCoeff;
60 Plate_LinearScalarConstraint::Plate_LinearScalarConstraint(const Standard_Integer ColLen,const Standard_Integer RowLen)
62 myPPC = new Plate_HArray1OfPinpointConstraint(1,RowLen);
63 myCoef = new TColgp_HArray2OfXYZ(1,ColLen,1,RowLen);
64 myCoef->Init(gp_XYZ(0.,0.,0.));
67 void Plate_LinearScalarConstraint::SetPPC(const Standard_Integer Index,const Plate_PinpointConstraint& Value)
69 myPPC->ChangeValue(Index) = Value;
72 void Plate_LinearScalarConstraint::SetCoeff(const Standard_Integer Row,const Standard_Integer Col,const gp_XYZ& Value)
74 myCoef->ChangeValue(Row,Col) = Value;