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
|
// File OpenGl_GraphicDriver_712.cxx
// Created Mardi 28 janvier 1997
// Author CAL
//-Copyright MatraDatavision 1997
//-Version
//-Design Declaration des variables specifiques aux Drivers
//-Warning Un driver encapsule les Pex et OpenGl drivers
//-References
//-Language C++ 2.0
//-Declarations
// for the class
#include <OpenGl_GraphicDriver.jxx>
#include <Aspect_DriverDefinitionError.hxx>
#include <OpenGl_tgl_funcs.hxx>
//-Aliases
//-Global data definitions
//-Methods, in order
void OpenGl_GraphicDriver::Bezier (const Graphic3d_CGroup& ACGroup,
const Graphic3d_Array1OfVertex& ListVertex,
const Standard_Boolean )
{
Graphic3d_CGroup MyCGroup = ACGroup;
Standard_Integer Lower = ListVertex.Lower ();
CALL_DEF_LISTPOINTS alpoints;
alpoints.NbPoints = int (ListVertex.Length ());
alpoints.TypePoints = 1;
alpoints.UPoints.Points = (CALL_DEF_POINT *) &ListVertex (Lower);
if (MyTraceLevel) {
PrintFunction ("call_togl_bezier");
PrintCGroup (MyCGroup, 1);
}
call_togl_bezier (&MyCGroup, &alpoints);
}
void OpenGl_GraphicDriver::Bezier (const Graphic3d_CGroup& ACGroup,
const Graphic3d_Array1OfVertex& ListVertex,
const TColStd_Array1OfReal& ListWeight,
const Standard_Boolean )
{
Graphic3d_CGroup MyCGroup = ACGroup;
Standard_Integer i, j;
Standard_Integer Lower = ListVertex.Lower ();
Standard_Integer Upper = ListVertex.Upper ();
CALL_DEF_LISTREALS alweights;
float *weights;
CALL_DEF_LISTPOINTS alpoints;
j = ListWeight.Length ();
alpoints.NbPoints = int (ListVertex.Length ());
alpoints.TypePoints = 1;
alpoints.UPoints.Points = (CALL_DEF_POINT *) &ListVertex (Lower);
weights = new float [j];
alweights.NbReals = j;
alweights.Reals = weights;
Lower = ListWeight.Lower ();
Upper = ListWeight.Upper ();
// Parcours des poids
for (j=0, i=Lower; i<=Upper; i++, j++)
weights[j] = float (ListWeight (i));
if (MyTraceLevel) {
PrintFunction ("call_togl_bezier_weight");
PrintCGroup (MyCGroup, 1);
}
call_togl_bezier_weight (&MyCGroup, &alpoints, &alweights);
// Desallocation dynamique
delete [] weights;
}
|