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 | |
7fd59977 |
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 | const Handle(StepGeom_BezierCurve)& aBezierCurve, |
33 | const Handle(StepGeom_RationalBSplineCurve)& aRationalBSplineCurve) |
34 | { |
35 | // --- classe own fields --- |
36 | bezierCurve = aBezierCurve; |
37 | rationalBSplineCurve = aRationalBSplineCurve; |
38 | // --- classe inherited fields --- |
39 | StepGeom_BSplineCurve::Init(aName, aDegree, aControlPointsList, aCurveForm, aClosedCurve, aSelfIntersect); |
40 | } |
41 | |
42 | |
43 | void StepGeom_BezierCurveAndRationalBSplineCurve::Init( |
44 | const Handle(TCollection_HAsciiString)& aName, |
45 | const Standard_Integer aDegree, |
46 | const Handle(StepGeom_HArray1OfCartesianPoint)& aControlPointsList, |
47 | const StepGeom_BSplineCurveForm aCurveForm, |
48 | const StepData_Logical aClosedCurve, |
49 | const StepData_Logical aSelfIntersect, |
50 | const Handle(TColStd_HArray1OfReal)& aWeightsData) |
51 | { |
52 | // --- classe inherited fields --- |
53 | |
54 | StepGeom_BSplineCurve::Init(aName, aDegree, aControlPointsList, aCurveForm, aClosedCurve, aSelfIntersect); |
55 | |
316ea293 |
56 | // --- ANDOR component fields --- |
7fd59977 |
57 | |
58 | bezierCurve = new StepGeom_BezierCurve(); |
59 | bezierCurve->Init(aName, aDegree, aControlPointsList, aCurveForm, aClosedCurve, aSelfIntersect); |
60 | |
316ea293 |
61 | // --- ANDOR component fields --- |
7fd59977 |
62 | |
63 | rationalBSplineCurve = new StepGeom_RationalBSplineCurve(); |
64 | rationalBSplineCurve->Init(aName, aDegree, aControlPointsList, aCurveForm, aClosedCurve, aSelfIntersect, aWeightsData); |
65 | } |
66 | |
67 | |
68 | void StepGeom_BezierCurveAndRationalBSplineCurve::SetBezierCurve(const Handle(StepGeom_BezierCurve)& aBezierCurve) |
69 | { |
70 | bezierCurve = aBezierCurve; |
71 | } |
72 | |
73 | Handle(StepGeom_BezierCurve) StepGeom_BezierCurveAndRationalBSplineCurve::BezierCurve() const |
74 | { |
75 | return bezierCurve; |
76 | } |
77 | |
78 | void StepGeom_BezierCurveAndRationalBSplineCurve::SetRationalBSplineCurve(const Handle(StepGeom_RationalBSplineCurve)& aRationalBSplineCurve) |
79 | { |
80 | rationalBSplineCurve = aRationalBSplineCurve; |
81 | } |
82 | |
83 | Handle(StepGeom_RationalBSplineCurve) StepGeom_BezierCurveAndRationalBSplineCurve::RationalBSplineCurve() const |
84 | { |
85 | return rationalBSplineCurve; |
86 | } |
87 | |
88 | //--- Specific Methods for AND classe field access --- |
89 | |
90 | |
91 | //--- Specific Methods for AND classe field access --- |
92 | |
93 | |
94 | void StepGeom_BezierCurveAndRationalBSplineCurve::SetWeightsData(const Handle(TColStd_HArray1OfReal)& aWeightsData) |
95 | { |
96 | rationalBSplineCurve->SetWeightsData(aWeightsData); |
97 | } |
98 | |
99 | Handle(TColStd_HArray1OfReal) StepGeom_BezierCurveAndRationalBSplineCurve::WeightsData() const |
100 | { |
101 | return rationalBSplineCurve->WeightsData(); |
102 | } |
103 | |
104 | Standard_Real StepGeom_BezierCurveAndRationalBSplineCurve::WeightsDataValue(const Standard_Integer num) const |
105 | { |
106 | return rationalBSplineCurve->WeightsDataValue(num); |
107 | } |
108 | |
109 | Standard_Integer StepGeom_BezierCurveAndRationalBSplineCurve::NbWeightsData () const |
110 | { |
111 | return rationalBSplineCurve->NbWeightsData(); |
112 | } |