973c2be1 |
1 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
2 | // |
973c2be1 |
3 | // This file is part of Open CASCADE Technology software library. |
b311480e |
4 | // |
d5f74e42 |
5 | // This library is free software; you can redistribute it and/or modify it under |
6 | // the terms of the GNU Lesser General Public License version 2.1 as published |
973c2be1 |
7 | // by the Free Software Foundation, with special exception defined in the file |
8 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
9 | // distribution for complete text of the license and disclaimer of any warranty. |
b311480e |
10 | // |
973c2be1 |
11 | // Alternatively, this file may be used under the terms of Open CASCADE |
12 | // commercial license or contractual agreement. |
b311480e |
13 | |
7fd59977 |
14 | |
42cf5bc1 |
15 | #include <Standard_Type.hxx> |
7fd59977 |
16 | #include <StepGeom_BezierCurve.hxx> |
42cf5bc1 |
17 | #include <StepGeom_BezierCurveAndRationalBSplineCurve.hxx> |
7fd59977 |
18 | #include <StepGeom_RationalBSplineCurve.hxx> |
42cf5bc1 |
19 | #include <TCollection_HAsciiString.hxx> |
7fd59977 |
20 | |
92efcf78 |
21 | IMPLEMENT_STANDARD_RTTIEXT(StepGeom_BezierCurveAndRationalBSplineCurve,StepGeom_BSplineCurve) |
22 | |
7fd59977 |
23 | StepGeom_BezierCurveAndRationalBSplineCurve::StepGeom_BezierCurveAndRationalBSplineCurve () {} |
24 | |
25 | void StepGeom_BezierCurveAndRationalBSplineCurve::Init( |
26 | const Handle(TCollection_HAsciiString)& aName, |
27 | const Standard_Integer aDegree, |
28 | const Handle(StepGeom_HArray1OfCartesianPoint)& aControlPointsList, |
29 | const StepGeom_BSplineCurveForm aCurveForm, |
30 | const StepData_Logical aClosedCurve, |
31 | const StepData_Logical aSelfIntersect) |
32 | { |
33 | |
34 | StepGeom_BSplineCurve::Init(aName, aDegree, aControlPointsList, aCurveForm, aClosedCurve, aSelfIntersect); |
35 | } |
36 | |
37 | void StepGeom_BezierCurveAndRationalBSplineCurve::Init( |
38 | const Handle(TCollection_HAsciiString)& aName, |
39 | const Standard_Integer aDegree, |
40 | const Handle(StepGeom_HArray1OfCartesianPoint)& aControlPointsList, |
41 | const StepGeom_BSplineCurveForm aCurveForm, |
42 | const StepData_Logical aClosedCurve, |
43 | const StepData_Logical aSelfIntersect, |
44 | const Handle(StepGeom_BezierCurve)& aBezierCurve, |
45 | const Handle(StepGeom_RationalBSplineCurve)& aRationalBSplineCurve) |
46 | { |
47 | // --- classe own fields --- |
48 | bezierCurve = aBezierCurve; |
49 | rationalBSplineCurve = aRationalBSplineCurve; |
50 | // --- classe inherited fields --- |
51 | StepGeom_BSplineCurve::Init(aName, aDegree, aControlPointsList, aCurveForm, aClosedCurve, aSelfIntersect); |
52 | } |
53 | |
54 | |
55 | void StepGeom_BezierCurveAndRationalBSplineCurve::Init( |
56 | const Handle(TCollection_HAsciiString)& aName, |
57 | const Standard_Integer aDegree, |
58 | const Handle(StepGeom_HArray1OfCartesianPoint)& aControlPointsList, |
59 | const StepGeom_BSplineCurveForm aCurveForm, |
60 | const StepData_Logical aClosedCurve, |
61 | const StepData_Logical aSelfIntersect, |
62 | const Handle(TColStd_HArray1OfReal)& aWeightsData) |
63 | { |
64 | // --- classe inherited fields --- |
65 | |
66 | StepGeom_BSplineCurve::Init(aName, aDegree, aControlPointsList, aCurveForm, aClosedCurve, aSelfIntersect); |
67 | |
68 | // --- ANDOR componant fields --- |
69 | |
70 | bezierCurve = new StepGeom_BezierCurve(); |
71 | bezierCurve->Init(aName, aDegree, aControlPointsList, aCurveForm, aClosedCurve, aSelfIntersect); |
72 | |
73 | // --- ANDOR componant fields --- |
74 | |
75 | rationalBSplineCurve = new StepGeom_RationalBSplineCurve(); |
76 | rationalBSplineCurve->Init(aName, aDegree, aControlPointsList, aCurveForm, aClosedCurve, aSelfIntersect, aWeightsData); |
77 | } |
78 | |
79 | |
80 | void StepGeom_BezierCurveAndRationalBSplineCurve::SetBezierCurve(const Handle(StepGeom_BezierCurve)& aBezierCurve) |
81 | { |
82 | bezierCurve = aBezierCurve; |
83 | } |
84 | |
85 | Handle(StepGeom_BezierCurve) StepGeom_BezierCurveAndRationalBSplineCurve::BezierCurve() const |
86 | { |
87 | return bezierCurve; |
88 | } |
89 | |
90 | void StepGeom_BezierCurveAndRationalBSplineCurve::SetRationalBSplineCurve(const Handle(StepGeom_RationalBSplineCurve)& aRationalBSplineCurve) |
91 | { |
92 | rationalBSplineCurve = aRationalBSplineCurve; |
93 | } |
94 | |
95 | Handle(StepGeom_RationalBSplineCurve) StepGeom_BezierCurveAndRationalBSplineCurve::RationalBSplineCurve() const |
96 | { |
97 | return rationalBSplineCurve; |
98 | } |
99 | |
100 | //--- Specific Methods for AND classe field access --- |
101 | |
102 | |
103 | //--- Specific Methods for AND classe field access --- |
104 | |
105 | |
106 | void StepGeom_BezierCurveAndRationalBSplineCurve::SetWeightsData(const Handle(TColStd_HArray1OfReal)& aWeightsData) |
107 | { |
108 | rationalBSplineCurve->SetWeightsData(aWeightsData); |
109 | } |
110 | |
111 | Handle(TColStd_HArray1OfReal) StepGeom_BezierCurveAndRationalBSplineCurve::WeightsData() const |
112 | { |
113 | return rationalBSplineCurve->WeightsData(); |
114 | } |
115 | |
116 | Standard_Real StepGeom_BezierCurveAndRationalBSplineCurve::WeightsDataValue(const Standard_Integer num) const |
117 | { |
118 | return rationalBSplineCurve->WeightsDataValue(num); |
119 | } |
120 | |
121 | Standard_Integer StepGeom_BezierCurveAndRationalBSplineCurve::NbWeightsData () const |
122 | { |
123 | return rationalBSplineCurve->NbWeightsData(); |
124 | } |