summaryrefslogtreecommitdiff
path: root/src/GeomFill/GeomFill_SectionGenerator.cxx
blob: c0a721037ecfa6f734728d2d2bef2b94e6bcca43 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
// File:	GeomFill_SectionGenerator.cxx
// Created:	Fri Feb 18 15:59:35 1994
// Author:	Bruno DUMORTIER
//		<dub@fuegox>

#include <GeomFill_SectionGenerator.ixx>

#include <Geom_BSplineCurve.hxx>



//=======================================================================
//function : GeomFill_SectionGenerator
//purpose  : 
//=======================================================================

GeomFill_SectionGenerator::GeomFill_SectionGenerator()
{
  if ( mySequence.Length() > 1 ) {
    Handle(TColStd_HArray1OfReal) HPar
      = new (TColStd_HArray1OfReal) (1,mySequence.Length());
    for (Standard_Integer i = 1; i<=mySequence.Length(); i++) {
      HPar->ChangeValue(i) = i-1;
    }
    SetParam(HPar);
  }
}


//=======================================================================
//function : GeomFill_SectionGenerator
//purpose  : 
//=======================================================================

void GeomFill_SectionGenerator::SetParam(const Handle_TColStd_HArray1OfReal & Params)
{
  Standard_Integer ii, L =  Params->Upper()-Params->Lower()+1;
  myParams = Params;
  for (ii=1; ii<=L; ii++) {
    myParams->SetValue(ii,Params->Value(Params->Lower()+ii-1));
  }
}


//=======================================================================
//function : GetShape
//purpose  : 
//=======================================================================

void GeomFill_SectionGenerator::GetShape(Standard_Integer& NbPoles,
					 Standard_Integer& NbKnots,
					 Standard_Integer& Degree,
					 Standard_Integer& NbPoles2d) const 
{
  Handle(Geom_BSplineCurve) C = 
    Handle(Geom_BSplineCurve)::DownCast(mySequence(1));
  NbPoles = C->NbPoles();
  NbKnots = C->NbKnots();
  Degree  = C->Degree();
  NbPoles2d = 0;
}


//=======================================================================
//function : Knots
//purpose  : 
//=======================================================================

void GeomFill_SectionGenerator::Knots(TColStd_Array1OfReal& TKnots) const 
{
  (Handle(Geom_BSplineCurve)::DownCast(mySequence(1)))->Knots(TKnots);
}


//=======================================================================
//function : Mults
//purpose  : 
//=======================================================================

void GeomFill_SectionGenerator::Mults(TColStd_Array1OfInteger& TMults) const 
{
  (Handle(Geom_BSplineCurve)::DownCast(mySequence(1)))->Multiplicities(TMults);
}


//=======================================================================
//function : Section
//purpose  : 
//=======================================================================

Standard_Boolean GeomFill_SectionGenerator::Section
  (const Standard_Integer      P,
         TColgp_Array1OfPnt&   Poles,
         TColgp_Array1OfVec&   , //DPoles,
         TColgp_Array1OfPnt2d& Poles2d,
         TColgp_Array1OfVec2d& , //DPoles2d,
         TColStd_Array1OfReal& Weigths,
         TColStd_Array1OfReal&   //DWeigths
   ) const 
{
  Section(P , Poles, Poles2d, Weigths);
  return Standard_False;
}


//=======================================================================
//function : Section
//purpose  : 
//=======================================================================

void GeomFill_SectionGenerator::Section
  (const Standard_Integer      P, 
         TColgp_Array1OfPnt&   Poles,
         TColgp_Array1OfPnt2d& , //Poles2d,
         TColStd_Array1OfReal& Weigths ) const 
{
  Handle(Geom_BSplineCurve) C = 
    Handle(Geom_BSplineCurve)::DownCast(mySequence(P));
  
  C->Poles(Poles);
  C->Weights(Weigths);
}


//=======================================================================
//function : Parameter
//purpose  : 
//=======================================================================

Standard_Real GeomFill_SectionGenerator::Parameter
  (const Standard_Integer P) const
{
  return myParams->Value(P);
}