b311480e |
1 | // Created on: 1998-03-26 |
2 | // Created by: # Andre LIEUTIER |
3 | // Copyright (c) 1998-1999 Matra Datavision |
973c2be1 |
4 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
5 | // |
973c2be1 |
6 | // This file is part of Open CASCADE Technology software library. |
b311480e |
7 | // |
d5f74e42 |
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 |
973c2be1 |
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. |
b311480e |
13 | // |
973c2be1 |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
7fd59977 |
16 | |
7fd59977 |
17 | |
42cf5bc1 |
18 | #include <Plate_LinearXYZConstraint.hxx> |
19 | #include <Plate_PinpointConstraint.hxx> |
20 | #include <Standard_DimensionMismatch.hxx> |
21 | #include <Standard_OutOfRange.hxx> |
7fd59977 |
22 | |
23 | Plate_LinearXYZConstraint::Plate_LinearXYZConstraint() {} |
24 | |
76363522 |
25 | Plate_LinearXYZConstraint::Plate_LinearXYZConstraint(const Plate_Array1OfPinpointConstraint& thePPC,const TColStd_Array1OfReal& theCoeff) |
7fd59977 |
26 | { |
76363522 |
27 | if(theCoeff.Length()!= thePPC.Length()) Standard_DimensionMismatch::Raise(); |
28 | myPPC = new Plate_HArray1OfPinpointConstraint(1, thePPC.Length()); |
29 | myCoef = new TColStd_HArray2OfReal(1,1,1, theCoeff.Length()); |
7fd59977 |
30 | |
76363522 |
31 | myPPC->ChangeArray1() = thePPC; |
32 | for(Standard_Integer i = 1; i<= theCoeff.Length(); i++) |
33 | myCoef->ChangeValue(1,i) = theCoeff(i+ theCoeff.Lower()-1); |
7fd59977 |
34 | } |
35 | |
76363522 |
36 | Plate_LinearXYZConstraint::Plate_LinearXYZConstraint(const Plate_Array1OfPinpointConstraint& thePPC,const TColStd_Array2OfReal& theCoeff) |
7fd59977 |
37 | { |
76363522 |
38 | if(theCoeff.RowLength()!= thePPC.Length()) Standard_DimensionMismatch::Raise(); |
39 | myPPC = new Plate_HArray1OfPinpointConstraint(1, thePPC.Length()); |
40 | myCoef = new TColStd_HArray2OfReal(1, theCoeff.ColLength(),1, theCoeff.RowLength()); |
7fd59977 |
41 | |
76363522 |
42 | myPPC->ChangeArray1() = thePPC; |
43 | myCoef->ChangeArray2() = theCoeff; |
7fd59977 |
44 | } |
45 | |
46 | |
47 | Plate_LinearXYZConstraint::Plate_LinearXYZConstraint(const Standard_Integer ColLen,const Standard_Integer RowLen) |
48 | { |
49 | myPPC = new Plate_HArray1OfPinpointConstraint(1,RowLen); |
50 | myCoef = new TColStd_HArray2OfReal(1,ColLen,1,RowLen); |
51 | myCoef->Init(0.0); |
52 | } |
53 | |
54 | void Plate_LinearXYZConstraint::SetPPC(const Standard_Integer Index,const Plate_PinpointConstraint& Value) |
55 | { |
56 | myPPC->ChangeValue(Index) = Value; |
57 | } |
58 | |
59 | void Plate_LinearXYZConstraint::SetCoeff(const Standard_Integer Row,const Standard_Integer Col,const Standard_Real Value) |
60 | { |
61 | myCoef->ChangeValue(Row,Col) = Value; |
62 | } |
63 | |