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> |
16 | #include <StepGeom_BSplineSurface.hxx> |
17 | #include <StepGeom_CartesianPoint.hxx> |
18 | #include <TCollection_HAsciiString.hxx> |
7fd59977 |
19 | |
92efcf78 |
20 | IMPLEMENT_STANDARD_RTTIEXT(StepGeom_BSplineSurface,StepGeom_BoundedSurface) |
21 | |
7fd59977 |
22 | StepGeom_BSplineSurface::StepGeom_BSplineSurface () {} |
23 | |
7fd59977 |
24 | void StepGeom_BSplineSurface::Init( |
25 | const Handle(TCollection_HAsciiString)& aName, |
26 | const Standard_Integer aUDegree, |
27 | const Standard_Integer aVDegree, |
28 | const Handle(StepGeom_HArray2OfCartesianPoint)& aControlPointsList, |
29 | const StepGeom_BSplineSurfaceForm aSurfaceForm, |
30 | const StepData_Logical aUClosed, |
31 | const StepData_Logical aVClosed, |
32 | const StepData_Logical aSelfIntersect) |
33 | { |
34 | // --- classe own fields --- |
35 | uDegree = aUDegree; |
36 | vDegree = aVDegree; |
37 | controlPointsList = aControlPointsList; |
38 | surfaceForm = aSurfaceForm; |
39 | uClosed = aUClosed; |
40 | vClosed = aVClosed; |
41 | selfIntersect = aSelfIntersect; |
42 | // --- classe inherited fields --- |
43 | StepRepr_RepresentationItem::Init(aName); |
44 | } |
45 | |
46 | |
47 | void StepGeom_BSplineSurface::SetUDegree(const Standard_Integer aUDegree) |
48 | { |
49 | uDegree = aUDegree; |
50 | } |
51 | |
52 | Standard_Integer StepGeom_BSplineSurface::UDegree() const |
53 | { |
54 | return uDegree; |
55 | } |
56 | |
57 | void StepGeom_BSplineSurface::SetVDegree(const Standard_Integer aVDegree) |
58 | { |
59 | vDegree = aVDegree; |
60 | } |
61 | |
62 | Standard_Integer StepGeom_BSplineSurface::VDegree() const |
63 | { |
64 | return vDegree; |
65 | } |
66 | |
67 | void StepGeom_BSplineSurface::SetControlPointsList(const Handle(StepGeom_HArray2OfCartesianPoint)& aControlPointsList) |
68 | { |
69 | controlPointsList = aControlPointsList; |
70 | } |
71 | |
72 | Handle(StepGeom_HArray2OfCartesianPoint) StepGeom_BSplineSurface::ControlPointsList() const |
73 | { |
74 | return controlPointsList; |
75 | } |
76 | |
77 | Handle(StepGeom_CartesianPoint) StepGeom_BSplineSurface::ControlPointsListValue(const Standard_Integer num1,const Standard_Integer num2) const |
78 | { |
79 | return controlPointsList->Value(num1,num2); |
80 | } |
81 | |
82 | Standard_Integer StepGeom_BSplineSurface::NbControlPointsListI () const |
83 | { |
84 | if (controlPointsList.IsNull()) return 0; |
85 | return controlPointsList->UpperRow() - controlPointsList->LowerRow() + 1; |
86 | } |
87 | |
88 | Standard_Integer StepGeom_BSplineSurface::NbControlPointsListJ () const |
89 | { |
90 | if (controlPointsList.IsNull()) return 0; |
91 | return controlPointsList->UpperCol() - controlPointsList->LowerCol() + 1; |
92 | } |
93 | |
94 | void StepGeom_BSplineSurface::SetSurfaceForm(const StepGeom_BSplineSurfaceForm aSurfaceForm) |
95 | { |
96 | surfaceForm = aSurfaceForm; |
97 | } |
98 | |
99 | StepGeom_BSplineSurfaceForm StepGeom_BSplineSurface::SurfaceForm() const |
100 | { |
101 | return surfaceForm; |
102 | } |
103 | |
104 | void StepGeom_BSplineSurface::SetUClosed(const StepData_Logical aUClosed) |
105 | { |
106 | uClosed = aUClosed; |
107 | } |
108 | |
109 | StepData_Logical StepGeom_BSplineSurface::UClosed() const |
110 | { |
111 | return uClosed; |
112 | } |
113 | |
114 | void StepGeom_BSplineSurface::SetVClosed(const StepData_Logical aVClosed) |
115 | { |
116 | vClosed = aVClosed; |
117 | } |
118 | |
119 | StepData_Logical StepGeom_BSplineSurface::VClosed() const |
120 | { |
121 | return vClosed; |
122 | } |
123 | |
124 | void StepGeom_BSplineSurface::SetSelfIntersect(const StepData_Logical aSelfIntersect) |
125 | { |
126 | selfIntersect = aSelfIntersect; |
127 | } |
128 | |
129 | StepData_Logical StepGeom_BSplineSurface::SelfIntersect() const |
130 | { |
131 | return selfIntersect; |
132 | } |