7fd59977 |
1 | |
2 | // File OpenGl_GraphicDriver_712.cxx |
3 | // Created Mardi 28 janvier 1997 |
4 | // Author CAL |
5 | |
6 | //-Copyright MatraDatavision 1997 |
7 | |
8 | //-Version |
9 | |
10 | //-Design Declaration des variables specifiques aux Drivers |
11 | |
12 | //-Warning Un driver encapsule les Pex et OpenGl drivers |
13 | |
14 | //-References |
15 | |
16 | //-Language C++ 2.0 |
17 | |
18 | //-Declarations |
19 | |
20 | // for the class |
21 | #include <OpenGl_GraphicDriver.jxx> |
22 | |
23 | #include <Aspect_DriverDefinitionError.hxx> |
24 | |
25 | #include <OpenGl_tgl_funcs.hxx> |
26 | |
27 | //-Aliases |
28 | |
29 | //-Global data definitions |
30 | |
31 | //-Methods, in order |
32 | |
33 | void OpenGl_GraphicDriver::Bezier (const Graphic3d_CGroup& ACGroup, |
34 | const Graphic3d_Array1OfVertex& ListVertex, |
35 | const Standard_Boolean ) |
36 | { |
37 | |
38 | Graphic3d_CGroup MyCGroup = ACGroup; |
39 | |
40 | Standard_Integer Lower = ListVertex.Lower (); |
41 | |
42 | CALL_DEF_LISTPOINTS alpoints; |
43 | |
44 | alpoints.NbPoints = int (ListVertex.Length ()); |
45 | alpoints.TypePoints = 1; |
46 | alpoints.UPoints.Points = (CALL_DEF_POINT *) &ListVertex (Lower); |
47 | |
48 | if (MyTraceLevel) { |
49 | PrintFunction ("call_togl_bezier"); |
50 | PrintCGroup (MyCGroup, 1); |
51 | } |
52 | call_togl_bezier (&MyCGroup, &alpoints); |
53 | |
54 | } |
55 | |
56 | void OpenGl_GraphicDriver::Bezier (const Graphic3d_CGroup& ACGroup, |
57 | const Graphic3d_Array1OfVertex& ListVertex, |
58 | const TColStd_Array1OfReal& ListWeight, |
59 | const Standard_Boolean ) |
60 | { |
61 | |
62 | Graphic3d_CGroup MyCGroup = ACGroup; |
63 | |
64 | Standard_Integer i, j; |
65 | Standard_Integer Lower = ListVertex.Lower (); |
66 | Standard_Integer Upper = ListVertex.Upper (); |
67 | |
68 | CALL_DEF_LISTREALS alweights; |
69 | float *weights; |
70 | CALL_DEF_LISTPOINTS alpoints; |
71 | |
72 | j = ListWeight.Length (); |
73 | |
74 | alpoints.NbPoints = int (ListVertex.Length ()); |
75 | alpoints.TypePoints = 1; |
76 | alpoints.UPoints.Points = (CALL_DEF_POINT *) &ListVertex (Lower); |
77 | |
78 | weights = new float [j]; |
79 | alweights.NbReals = j; |
80 | alweights.Reals = weights; |
81 | |
82 | Lower = ListWeight.Lower (); |
83 | Upper = ListWeight.Upper (); |
84 | |
85 | // Parcours des poids |
86 | for (j=0, i=Lower; i<=Upper; i++, j++) |
87 | weights[j] = float (ListWeight (i)); |
88 | |
89 | if (MyTraceLevel) { |
90 | PrintFunction ("call_togl_bezier_weight"); |
91 | PrintCGroup (MyCGroup, 1); |
92 | } |
93 | call_togl_bezier_weight (&MyCGroup, &alpoints, &alweights); |
94 | |
95 | // Desallocation dynamique |
96 | delete [] weights; |
97 | |
98 | } |