0028832: MMgt_TShared can be replaced by Standard_Transient
[occt.git] / src / StepGeom / StepGeom_BezierSurfaceAndRationalBSplineSurface.cxx
1 // Copyright (c) 1999-2014 OPEN CASCADE SAS
2 //
3 // This file is part of Open CASCADE Technology software library.
4 //
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
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.
10 //
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
13
14
15 #include <Standard_Type.hxx>
16 #include <StepGeom_BezierSurface.hxx>
17 #include <StepGeom_BezierSurfaceAndRationalBSplineSurface.hxx>
18 #include <StepGeom_RationalBSplineSurface.hxx>
19 #include <TCollection_HAsciiString.hxx>
20
21 IMPLEMENT_STANDARD_RTTIEXT(StepGeom_BezierSurfaceAndRationalBSplineSurface,StepGeom_BSplineSurface)
22
23 StepGeom_BezierSurfaceAndRationalBSplineSurface::StepGeom_BezierSurfaceAndRationalBSplineSurface ()  {}
24
25 void StepGeom_BezierSurfaceAndRationalBSplineSurface::Init(
26         const Handle(TCollection_HAsciiString)& aName,
27         const Standard_Integer aUDegree,
28         const Standard_Integer aVDegree,
29         const Handle(StepGeom_HArray2OfCartesianPoint)& aControlPointsList,
30         const StepGeom_BSplineSurfaceForm aSurfaceForm,
31         const StepData_Logical aUClosed,
32         const StepData_Logical aVClosed,
33         const StepData_Logical aSelfIntersect,
34         const Handle(StepGeom_BezierSurface)& aBezierSurface,
35         const Handle(StepGeom_RationalBSplineSurface)& aRationalBSplineSurface)
36 {
37         // --- classe own fields ---
38         bezierSurface = aBezierSurface;
39         rationalBSplineSurface = aRationalBSplineSurface;
40         // --- classe inherited fields ---
41         StepGeom_BSplineSurface::Init(aName, aUDegree, aVDegree, aControlPointsList, aSurfaceForm, aUClosed, aVClosed, aSelfIntersect);
42 }
43
44
45 void StepGeom_BezierSurfaceAndRationalBSplineSurface::Init(
46         const Handle(TCollection_HAsciiString)& aName,
47         const Standard_Integer aUDegree,
48         const Standard_Integer aVDegree,
49         const Handle(StepGeom_HArray2OfCartesianPoint)& aControlPointsList,
50         const StepGeom_BSplineSurfaceForm aSurfaceForm,
51         const StepData_Logical aUClosed,
52         const StepData_Logical aVClosed,
53         const StepData_Logical aSelfIntersect,
54         const Handle(TColStd_HArray2OfReal)& aWeightsData)
55 {
56         // --- classe inherited fields ---
57
58         StepGeom_BSplineSurface::Init(aName, aUDegree, aVDegree, aControlPointsList, aSurfaceForm, aUClosed, aVClosed, aSelfIntersect);
59
60         // --- ANDOR componant fields ---
61
62         bezierSurface = new StepGeom_BezierSurface();
63         bezierSurface->Init(aName, aUDegree, aVDegree, aControlPointsList, aSurfaceForm, aUClosed, aVClosed, aSelfIntersect);
64
65         // --- ANDOR componant fields ---
66
67         rationalBSplineSurface = new StepGeom_RationalBSplineSurface();
68         rationalBSplineSurface->Init(aName, aUDegree, aVDegree, aControlPointsList, aSurfaceForm, aUClosed, aVClosed, aSelfIntersect, aWeightsData);
69 }
70
71
72 void StepGeom_BezierSurfaceAndRationalBSplineSurface::SetBezierSurface(const Handle(StepGeom_BezierSurface)& aBezierSurface)
73 {
74         bezierSurface = aBezierSurface;
75 }
76
77 Handle(StepGeom_BezierSurface) StepGeom_BezierSurfaceAndRationalBSplineSurface::BezierSurface() const
78 {
79         return bezierSurface;
80 }
81
82 void StepGeom_BezierSurfaceAndRationalBSplineSurface::SetRationalBSplineSurface(const Handle(StepGeom_RationalBSplineSurface)& aRationalBSplineSurface)
83 {
84         rationalBSplineSurface = aRationalBSplineSurface;
85 }
86
87 Handle(StepGeom_RationalBSplineSurface) StepGeom_BezierSurfaceAndRationalBSplineSurface::RationalBSplineSurface() const
88 {
89         return rationalBSplineSurface;
90 }
91
92         //--- Specific Methods for AND classe field access ---
93
94
95         //--- Specific Methods for AND classe field access ---
96
97
98 void StepGeom_BezierSurfaceAndRationalBSplineSurface::SetWeightsData(const Handle(TColStd_HArray2OfReal)& aWeightsData)
99 {
100         rationalBSplineSurface->SetWeightsData(aWeightsData);
101 }
102
103 Handle(TColStd_HArray2OfReal) StepGeom_BezierSurfaceAndRationalBSplineSurface::WeightsData() const
104 {
105         return rationalBSplineSurface->WeightsData();
106 }
107
108 Standard_Real StepGeom_BezierSurfaceAndRationalBSplineSurface::WeightsDataValue(const Standard_Integer num1,const Standard_Integer num2) const
109 {
110         return rationalBSplineSurface->WeightsDataValue(num1,num2);
111 }
112
113 Standard_Integer StepGeom_BezierSurfaceAndRationalBSplineSurface::NbWeightsDataI () const
114 {
115         return rationalBSplineSurface->NbWeightsDataI ();
116 }
117
118 Standard_Integer StepGeom_BezierSurfaceAndRationalBSplineSurface::NbWeightsDataJ () const
119 {
120         return rationalBSplineSurface->NbWeightsDataJ ();
121 }