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>
22 #include <Standard_OutOfRange.hxx>
24 Plate_LinearScalarConstraint::Plate_LinearScalarConstraint() {}
26 Plate_LinearScalarConstraint::Plate_LinearScalarConstraint
27 (const Plate_PinpointConstraint& PPC1,const gp_XYZ& coeff)
30 myPPC = new Plate_HArray1OfPinpointConstraint(1,1);
31 myCoef = new TColgp_HArray2OfXYZ(1,1,1,1);
33 myPPC->ChangeValue(1) = PPC1;
34 myCoef->ChangeValue(1,1) = coeff;
37 Plate_LinearScalarConstraint::Plate_LinearScalarConstraint(const Plate_Array1OfPinpointConstraint& thePPC,const TColgp_Array1OfXYZ& theCoeff)
39 if(theCoeff.Length()!= thePPC.Length()) throw Standard_DimensionMismatch();
40 myPPC = new Plate_HArray1OfPinpointConstraint(1, thePPC.Length());
41 myCoef = new TColgp_HArray2OfXYZ(1,1,1, theCoeff.Length());
43 myPPC->ChangeArray1() = thePPC;
44 for(Standard_Integer i = 1; i<= theCoeff.Length(); i++) {
45 myCoef->ChangeValue(1,i) = theCoeff(i+ theCoeff.Lower()-1);
49 Plate_LinearScalarConstraint::Plate_LinearScalarConstraint
50 (const Plate_Array1OfPinpointConstraint& thePPC,const TColgp_Array2OfXYZ& theCoeff)
52 if(theCoeff.RowLength()!= thePPC.Length()) throw Standard_DimensionMismatch();
53 myPPC = new Plate_HArray1OfPinpointConstraint(1, thePPC.Length());
54 myCoef = new TColgp_HArray2OfXYZ(1, theCoeff.ColLength(),1, theCoeff.RowLength());
56 myPPC->ChangeArray1() = thePPC;
57 myCoef->ChangeArray2() = theCoeff;
61 Plate_LinearScalarConstraint::Plate_LinearScalarConstraint(const Standard_Integer ColLen,const Standard_Integer RowLen)
63 myPPC = new Plate_HArray1OfPinpointConstraint(1,RowLen);
64 myCoef = new TColgp_HArray2OfXYZ(1,ColLen,1,RowLen);
65 myCoef->Init(gp_XYZ(0.,0.,0.));
68 void Plate_LinearScalarConstraint::SetPPC(const Standard_Integer Index,const Plate_PinpointConstraint& Value)
70 myPPC->ChangeValue(Index) = Value;
73 void Plate_LinearScalarConstraint::SetCoeff(const Standard_Integer Row,const Standard_Integer Col,const gp_XYZ& Value)
75 myCoef->ChangeValue(Row,Col) = Value;