2 // File Graphic3d_Group_12.cxx (Curve)
6 //-Copyright MatraDatavision 1994
10 //-Design Declaration des variables specifiques aux groupes
13 //-Warning Un groupe est defini dans une structure
14 // Il s'agit de la plus petite entite editable
23 #include <Graphic3d_Group.jxx>
24 #include <Graphic3d_Group.pxx>
28 void Graphic3d_Group::Bezier (const Graphic3d_Array1OfVertex& ListVertex, const Standard_Boolean EvalMinMax) {
30 if (IsDeleted ()) return;
32 MyIsEmpty = Standard_False;
34 Standard_Integer i, j;
36 i = ListVertex.Length ();
39 Graphic3d_GroupDefinitionError::Raise ("Bad number of vertices");
43 Standard_Real X, Y, Z;
44 Standard_Integer Lower = ListVertex.Lower ();
45 Standard_Integer Upper = ListVertex.Upper ();
46 // Parcours des sommets
47 for (j=0, i=Lower; i<=Upper; i++, j++) {
48 ListVertex (i).Coord (X, Y, Z);
49 if (X < MyBounds.XMin) MyBounds.XMin = Standard_ShortReal (X);
50 if (Y < MyBounds.YMin) MyBounds.YMin = Standard_ShortReal (Y);
51 if (Z < MyBounds.ZMin) MyBounds.ZMin = Standard_ShortReal (Z);
52 if (X > MyBounds.XMax) MyBounds.XMax = Standard_ShortReal (X);
53 if (Y > MyBounds.YMax) MyBounds.YMax = Standard_ShortReal (Y);
54 if (Z > MyBounds.ZMax) MyBounds.ZMax = Standard_ShortReal (Z);
58 MyGraphicDriver->Bezier (MyCGroup, ListVertex, EvalMinMax);
64 void Graphic3d_Group::Bezier (const Graphic3d_Array1OfVertex& ListVertex, const TColStd_Array1OfReal& ListWeight, const Standard_Boolean EvalMinMax) {
66 if (IsDeleted ()) return;
68 MyIsEmpty = Standard_False;
70 Standard_Integer i, j;
72 i = ListVertex.Length ();
73 j = ListWeight.Length ();
75 if ((i <= 2) || (i != j))
76 Graphic3d_GroupDefinitionError::Raise ("Bad number of vertices");
80 Standard_Real X, Y, Z;
81 Standard_Integer Lower = ListVertex.Lower ();
82 Standard_Integer Upper = ListVertex.Upper ();
83 // Parcours des sommets
84 for (j=0, i=Lower; i<=Upper; i++, j++) {
85 ListVertex (i).Coord (X, Y, Z);
86 if (X < MyBounds.XMin) MyBounds.XMin = Standard_ShortReal (X);
87 if (Y < MyBounds.YMin) MyBounds.YMin = Standard_ShortReal (Y);
88 if (Z < MyBounds.ZMin) MyBounds.ZMin = Standard_ShortReal (Z);
89 if (X > MyBounds.XMax) MyBounds.XMax = Standard_ShortReal (X);
90 if (Y > MyBounds.YMax) MyBounds.YMax = Standard_ShortReal (Y);
91 if (Z > MyBounds.ZMax) MyBounds.ZMax = Standard_ShortReal (Z);
95 MyGraphicDriver->Bezier
96 (MyCGroup, ListVertex, ListWeight, EvalMinMax);