b311480e |
1 | // Copyright (c) 1999-2012 OPEN CASCADE SAS |
2 | // |
3 | // The content of this file is subject to the Open CASCADE Technology Public |
4 | // License Version 6.5 (the "License"). You may not use the content of this file |
5 | // except in compliance with the License. Please obtain a copy of the License |
6 | // at http://www.opencascade.org and read it completely before using this file. |
7 | // |
8 | // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its |
9 | // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. |
10 | // |
11 | // The Original Code and all software distributed under the License is |
12 | // distributed on an "AS IS" basis, without warranty of any kind, and the |
13 | // Initial Developer hereby disclaims all such warranties, including without |
14 | // limitation, any warranties of merchantability, fitness for a particular |
15 | // purpose or non-infringement. Please see the License for the specific terms |
16 | // and conditions governing the rights and limitations under the License. |
17 | |
7fd59977 |
18 | #include <StepGeom_BezierCurveAndRationalBSplineCurve.ixx> |
19 | |
20 | #include <StepGeom_BezierCurve.hxx> |
21 | |
22 | #include <StepGeom_RationalBSplineCurve.hxx> |
23 | |
24 | |
25 | StepGeom_BezierCurveAndRationalBSplineCurve::StepGeom_BezierCurveAndRationalBSplineCurve () {} |
26 | |
27 | void StepGeom_BezierCurveAndRationalBSplineCurve::Init( |
28 | const Handle(TCollection_HAsciiString)& aName, |
29 | const Standard_Integer aDegree, |
30 | const Handle(StepGeom_HArray1OfCartesianPoint)& aControlPointsList, |
31 | const StepGeom_BSplineCurveForm aCurveForm, |
32 | const StepData_Logical aClosedCurve, |
33 | const StepData_Logical aSelfIntersect) |
34 | { |
35 | |
36 | StepGeom_BSplineCurve::Init(aName, aDegree, aControlPointsList, aCurveForm, aClosedCurve, aSelfIntersect); |
37 | } |
38 | |
39 | void StepGeom_BezierCurveAndRationalBSplineCurve::Init( |
40 | const Handle(TCollection_HAsciiString)& aName, |
41 | const Standard_Integer aDegree, |
42 | const Handle(StepGeom_HArray1OfCartesianPoint)& aControlPointsList, |
43 | const StepGeom_BSplineCurveForm aCurveForm, |
44 | const StepData_Logical aClosedCurve, |
45 | const StepData_Logical aSelfIntersect, |
46 | const Handle(StepGeom_BezierCurve)& aBezierCurve, |
47 | const Handle(StepGeom_RationalBSplineCurve)& aRationalBSplineCurve) |
48 | { |
49 | // --- classe own fields --- |
50 | bezierCurve = aBezierCurve; |
51 | rationalBSplineCurve = aRationalBSplineCurve; |
52 | // --- classe inherited fields --- |
53 | StepGeom_BSplineCurve::Init(aName, aDegree, aControlPointsList, aCurveForm, aClosedCurve, aSelfIntersect); |
54 | } |
55 | |
56 | |
57 | void StepGeom_BezierCurveAndRationalBSplineCurve::Init( |
58 | const Handle(TCollection_HAsciiString)& aName, |
59 | const Standard_Integer aDegree, |
60 | const Handle(StepGeom_HArray1OfCartesianPoint)& aControlPointsList, |
61 | const StepGeom_BSplineCurveForm aCurveForm, |
62 | const StepData_Logical aClosedCurve, |
63 | const StepData_Logical aSelfIntersect, |
64 | const Handle(TColStd_HArray1OfReal)& aWeightsData) |
65 | { |
66 | // --- classe inherited fields --- |
67 | |
68 | StepGeom_BSplineCurve::Init(aName, aDegree, aControlPointsList, aCurveForm, aClosedCurve, aSelfIntersect); |
69 | |
70 | // --- ANDOR componant fields --- |
71 | |
72 | bezierCurve = new StepGeom_BezierCurve(); |
73 | bezierCurve->Init(aName, aDegree, aControlPointsList, aCurveForm, aClosedCurve, aSelfIntersect); |
74 | |
75 | // --- ANDOR componant fields --- |
76 | |
77 | rationalBSplineCurve = new StepGeom_RationalBSplineCurve(); |
78 | rationalBSplineCurve->Init(aName, aDegree, aControlPointsList, aCurveForm, aClosedCurve, aSelfIntersect, aWeightsData); |
79 | } |
80 | |
81 | |
82 | void StepGeom_BezierCurveAndRationalBSplineCurve::SetBezierCurve(const Handle(StepGeom_BezierCurve)& aBezierCurve) |
83 | { |
84 | bezierCurve = aBezierCurve; |
85 | } |
86 | |
87 | Handle(StepGeom_BezierCurve) StepGeom_BezierCurveAndRationalBSplineCurve::BezierCurve() const |
88 | { |
89 | return bezierCurve; |
90 | } |
91 | |
92 | void StepGeom_BezierCurveAndRationalBSplineCurve::SetRationalBSplineCurve(const Handle(StepGeom_RationalBSplineCurve)& aRationalBSplineCurve) |
93 | { |
94 | rationalBSplineCurve = aRationalBSplineCurve; |
95 | } |
96 | |
97 | Handle(StepGeom_RationalBSplineCurve) StepGeom_BezierCurveAndRationalBSplineCurve::RationalBSplineCurve() const |
98 | { |
99 | return rationalBSplineCurve; |
100 | } |
101 | |
102 | //--- Specific Methods for AND classe field access --- |
103 | |
104 | |
105 | //--- Specific Methods for AND classe field access --- |
106 | |
107 | |
108 | void StepGeom_BezierCurveAndRationalBSplineCurve::SetWeightsData(const Handle(TColStd_HArray1OfReal)& aWeightsData) |
109 | { |
110 | rationalBSplineCurve->SetWeightsData(aWeightsData); |
111 | } |
112 | |
113 | Handle(TColStd_HArray1OfReal) StepGeom_BezierCurveAndRationalBSplineCurve::WeightsData() const |
114 | { |
115 | return rationalBSplineCurve->WeightsData(); |
116 | } |
117 | |
118 | Standard_Real StepGeom_BezierCurveAndRationalBSplineCurve::WeightsDataValue(const Standard_Integer num) const |
119 | { |
120 | return rationalBSplineCurve->WeightsDataValue(num); |
121 | } |
122 | |
123 | Standard_Integer StepGeom_BezierCurveAndRationalBSplineCurve::NbWeightsData () const |
124 | { |
125 | return rationalBSplineCurve->NbWeightsData(); |
126 | } |