0023466: Move OSD_FontMgr class outside TKernel
[occt.git] / src / V3d / V3d_View_4.cxx
1 // Copyright (c) 1999-2012 OPEN CASCADE SAS
2 //
3 // The content of this file is subject to the Open CASCADE Technology Public
4 // License Version 6.5 (the "License"). You may not use the content of this file
5 // except in compliance with the License. Please obtain a copy of the License
6 // at http://www.opencascade.org and read it completely before using this file.
7 //
8 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
9 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
10 //
11 // The Original Code and all software distributed under the License is
12 // distributed on an "AS IS" basis, without warranty of any kind, and the
13 // Initial Developer hereby disclaims all such warranties, including without
14 // limitation, any warranties of merchantability, fitness for a particular
15 // purpose or non-infringement. Please see the License for the specific terms
16 // and conditions governing the rights and limitations under the License.
17
18 /***********************************************************************
19  
20      FONCTION :
21      ----------
22         Classe V3d_View :
23  
24      HISTORIQUE DES MODIFICATIONS   :
25      --------------------------------
26       16-08-98 : CAL ; S3892. Ajout grilles 3d.
27       16-09-98 : BGN ; Points d'entree du Triedre (S3819, Phase 1)
28       21-09-98 : CAL ; Activation de l'echo que si CSF_GraphicEcho est definie.
29       22-09-98 : BGN ; S3989 (anciennement S3819)
30                        TypeOfTriedron* from Aspect (pas V3d)
31       02.15.100 : JR : Clutter
32       28/05/02 :  VSV: ZBUFFER mode of Trihedron
33
34 ************************************************************************/
35
36 #define IMP240100       //GG
37 //                      -> In Compute() method call MyViewer->ShowGridEcho()
38
39
40 /*----------------------------------------------------------------------*/
41 /*
42  * Includes
43  */
44 #include <V3d_View.jxx>
45
46 #include <TColStd_Array2OfReal.hxx>
47
48 #include <gp_Dir2d.hxx>
49
50 #include <Aspect.hxx>
51
52 #include <V3d_RectangularGrid.hxx>
53 #include <V3d_CircularGrid.hxx>
54
55 // For the echo of the chosen point
56 #include <Visual3d_TransientManager.hxx>
57
58 /*----------------------------------------------------------------------*/
59 /*
60  * Constant
61  */
62
63 // in case NO_TRACE_ECHO and NO_TRACE_POINTS, in V3d_View_4.cxx and 
64 // V3d_View.cxx, suspend MyGridEchoStructure and MyGridEchoGroup in cdl
65 #define TRACE_ECHO
66 #define NO_TRACE_VALUES
67 #define NO_TRACE_POINTS
68
69 #define MYEPSILON1 0.0001               // Comparison with 0.0
70 #define MYEPSILON2 M_PI / 180.  // Delta between 2 angles
71
72 #ifdef TRACE_POINTS
73 #include <Graphic3d_AspectLine3d.hxx>
74 #include <Graphic3d_AspectText3d.hxx>
75 #endif
76
77 #ifdef TRACE_VALUES
78 #include <Visual3d_ViewOrientation.hxx>
79 #endif
80
81 #if defined TRACE_VALUES || defined TRACE_POINTS
82 static char *CAR [26] = {"a", "b", "c", "d", "e", "f", "g", "h",
83                         "i", "j", "k", "l", "m", "n", "o", "p",
84                         "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"};
85 #endif
86
87 /*----------------------------------------------------------------------*/
88
89 void V3d_View::SetGrid (const gp_Ax3& aPlane, const Handle(Aspect_Grid)& aGrid) {
90
91         MyPlane = aPlane;
92         MyGrid  = aGrid;
93
94 #ifdef TRACE_VALUES
95         if (MyGrid->IsKind (STANDARD_TYPE (Aspect_RectangularGrid))) {
96                 cout << "Aspect_RectangularGrid" << endl;
97 Handle(Aspect_RectangularGrid) theGrid = *(Handle(Aspect_RectangularGrid) *) &MyGrid;
98                 cout << "\tOrigine : " << theGrid->XOrigin () << ", "
99                      << theGrid->YOrigin () << endl;
100                 cout << "\tAngle : " << theGrid->RotationAngle () << endl;
101                 cout << "\tSteps : " << theGrid->XStep () << ", "
102                      << theGrid->YStep () << endl;
103         }
104         else {
105                 cout << "Aspect_CircularGrid" << endl;
106 Handle(Aspect_CircularGrid) theGrid = *(Handle(Aspect_CircularGrid) *) &MyGrid;
107                 cout << "\tOrigine : " << theGrid->XOrigin () << ", "
108                      << theGrid->YOrigin () << endl;
109                 cout << "\tAngle : " << theGrid->RotationAngle () << endl;
110                 cout << "\tRadiusStep, Division : " << theGrid->RadiusStep ()
111                      << ", " << theGrid->DivisionNumber () << endl;
112         }
113
114 #endif
115
116 Standard_Real xl, yl, zl;
117 Standard_Real xdx, xdy, xdz;
118 Standard_Real ydx, ydy, ydz;
119 Standard_Real dx, dy, dz;
120         aPlane.Location ().Coord (xl, yl, zl);
121         aPlane.XDirection ().Coord (xdx, xdy, xdz);
122         aPlane.YDirection ().Coord (ydx, ydy, ydz);
123         aPlane.Direction ().Coord (dx, dy, dz);
124
125 #ifdef TRACE_VALUES
126 cout << "Grid Plane " << xl << ", " << yl << ", " << zl << endl;
127 cout << "\tLocation " << xl << ", " << yl << ", " << zl << endl;
128 cout << "\tDirection " << dx << ", " << dy << ", " << dz << endl;
129 cout << "\tXDirection " << xdx << ", " << xdy << ", " << xdz << endl;
130 cout << "\tYDirection " << ydx << ", " << ydy << ", " << ydz << endl;
131 #endif
132
133 Standard_Real CosAlpha = Cos (MyGrid->RotationAngle ());
134 Standard_Real SinAlpha = Sin (MyGrid->RotationAngle ());
135
136 TColStd_Array2OfReal Trsf1 (1, 4, 1, 4);
137         Trsf1 (4, 4) = 1.0;
138         Trsf1 (4, 1) = Trsf1 (4, 2) = Trsf1 (4, 3) = 0.0;
139         // Translation
140         Trsf1 (1, 4) = xl,
141         Trsf1 (2, 4) = yl,
142         Trsf1 (3, 4) = zl;
143         // Transformation change of marker
144         Trsf1 (1, 1) = xdx,
145         Trsf1 (2, 1) = xdy,
146         Trsf1 (3, 1) = xdz,
147         Trsf1 (1, 2) = ydx,
148         Trsf1 (2, 2) = ydy,
149         Trsf1 (3, 2) = ydz,
150         Trsf1 (1, 3) = dx,
151         Trsf1 (2, 3) = dy,
152         Trsf1 (3, 3) = dz;
153
154 TColStd_Array2OfReal Trsf2 (1, 4, 1, 4);
155         Trsf2 (4, 4) = 1.0;
156         Trsf2 (4, 1) = Trsf2 (4, 2) = Trsf2 (4, 3) = 0.0;
157         // Translation of the origin
158         Trsf2 (1, 4) = -MyGrid->XOrigin (),
159         Trsf2 (2, 4) = -MyGrid->YOrigin (),
160         Trsf2 (3, 4) = 0.0;
161         // Rotation Alpha around axis -Z
162         Trsf2 (1, 1) = CosAlpha,
163         Trsf2 (2, 1) = -SinAlpha,
164         Trsf2 (3, 1) = 0.0,
165         Trsf2 (1, 2) = SinAlpha,
166         Trsf2 (2, 2) = CosAlpha,
167         Trsf2 (3, 2) = 0.0,
168         Trsf2 (1, 3) = 0.0,
169         Trsf2 (2, 3) = 0.0,
170         Trsf2 (3, 3) = 1.0;
171
172 Standard_Real valuetrsf;
173 Standard_Real valueoldtrsf;
174 Standard_Real valuenewtrsf;
175 Standard_Integer i, j, k;
176         // Calculation of the product of matrices
177         for (i=1; i<=4; i++)
178             for (j=1; j<=4; j++) {
179                 MyTrsf (i, j) = 0.0;
180                 for (k=1; k<=4; k++) {
181                     valueoldtrsf = Trsf1 (i, k);
182                     valuetrsf    = Trsf2 (k, j);
183                     valuenewtrsf = MyTrsf (i, j) + valueoldtrsf * valuetrsf;
184                     MyTrsf (i, j) = valuenewtrsf;
185                 }
186            }
187
188 }
189
190 void V3d_View::SetGridActivity (const Standard_Boolean AFlag) {
191
192         if (AFlag) MyGrid->Activate ();
193         else MyGrid->Deactivate ();
194
195 }
196
197 void V3d_View::SetGridGraphicValues (const Handle(Aspect_Grid)&
198 #ifdef TRACE_VALUES
199                                                                 aGrid
200 #endif
201                                     ) {
202
203 #ifdef TRACE_VALUES
204 Standard_Real XSize, YSize, Radius, OffSet;
205         if (aGrid->IsKind (STANDARD_TYPE (V3d_RectangularGrid))) {
206                 cout << "V3d_RectangularGrid" << endl;
207 Handle(V3d_RectangularGrid) theGrid = *(Handle(V3d_RectangularGrid) *) &aGrid;
208                 theGrid->GraphicValues (XSize, YSize, OffSet);
209                 cout << "\tSizes : " << XSize << ", " << YSize << endl;
210                 cout << "\tOffSet : " << OffSet << endl;
211         }
212         else {
213                 cout << "V3d_CircularGrid" << endl;
214 Handle(V3d_CircularGrid) theGrid = *(Handle(V3d_CircularGrid) *) &aGrid;
215                 theGrid->GraphicValues (Radius, OffSet);
216                 cout << "\tRadius : " << Radius << endl;
217                 cout << "\tOffSet : " << OffSet << endl;
218         }
219 #endif
220
221 }
222
223 Graphic3d_Vertex V3d_View::Compute (const Graphic3d_Vertex & AVertex) const {
224
225 Graphic3d_Vertex CurPoint, NewPoint;
226 Standard_Real X1, Y1, Z1, X2, Y2, Z2;
227 Standard_Real XPp, YPp;
228
229         MyView->ViewOrientation ().ViewReferencePlane ().Coord (X1, Y1, Z1);
230         MyPlane.Direction ().Coord (X2, Y2, Z2);
231
232 gp_Dir VPN (X1, Y1, Z1);
233 gp_Dir GPN (X2, Y2, Z2);
234
235 #ifdef TRACE_VALUES
236         cout << "View Plane : " << X1 << ", " << Y1 << ", " << Z1 << endl;
237         cout << "Grid Plane " << X2 << ", " << Y2 << ", " << Z2 << endl;
238         cout << "Angle VPN GPN : " << VPN.Angle (GPN) << endl;
239 #endif
240
241         AVertex.Coord (X1, Y1, Z1);
242         Project (X1, Y1, Z1, XPp, YPp);
243
244 #ifdef TRACE_VALUES
245         cout << "AVertex : " << X1 << ", " << Y1 << ", " << Z1 << endl;
246 #endif
247
248         // Casw when the plane of the grid and the plane of the view
249         // are perpendicular to MYEPSILON2 close radians
250         if (Abs (VPN.Angle (GPN) - M_PI / 2.) < MYEPSILON2) {
251                 NewPoint.SetCoord (X1, Y1, Z1);
252 #ifdef TRACE_POINTS
253                 TextAttrib->SetColor (Quantity_Color (Quantity_NOC_RED));
254                 MyGridEchoGroup->SetPrimitivesAspect (TextAttrib);
255                 MyGridEchoGroup->Text ("Q", NewPoint, 1./81.);
256                 MyGridEchoGroup->Polyline (AVertex, NewPoint);
257                 Update ();
258 #endif
259 #ifdef IMP240100
260                 MyViewer->ShowGridEcho(this,NewPoint);
261 #else
262 #ifdef TRACE_ECHO
263 char *trace_echo = NULL;
264                 trace_echo = (char *)(getenv ("CSF_GraphicEcho"));
265                 if (trace_echo) {
266                         MyGridEchoGroup->Clear ();
267                         MyGridEchoGroup->Marker (NewPoint);
268                         Visual3d_TransientManager::BeginDraw
269                                 (MyView, Standard_False, Standard_False);
270                         Visual3d_TransientManager::DrawStructure (MyGridEchoStructure);
271                         Visual3d_TransientManager::EndDraw (Standard_True);
272                 }
273 #endif
274 #endif  //IMP240100
275                 return NewPoint;
276         }
277
278 #ifdef TRACE_POINTS
279 Handle(Graphic3d_AspectLine3d) LineAttrib = new Graphic3d_AspectLine3d ();
280 Handle(Graphic3d_AspectText3d) TextAttrib = new Graphic3d_AspectText3d ();
281
282         MyGridEchoGroup->Clear ();
283
284         LineAttrib->SetColor (Quantity_Color (Quantity_NOC_RED));
285         MyGridEchoGroup->SetGroupPrimitivesAspect (LineAttrib);
286
287         TextAttrib->SetColor (Quantity_Color (Quantity_NOC_RED));
288         MyGridEchoGroup->SetGroupPrimitivesAspect (TextAttrib);
289
290         MyGridEchoGroup->Text ("P", AVertex, 1./81.);
291         CurPoint.SetCoord (AVertex.X (), AVertex.Y (), AVertex.Z ());
292
293         TextAttrib->SetColor (Quantity_Color (Quantity_NOC_GREEN));
294         MyGridEchoGroup->SetPrimitivesAspect (TextAttrib);
295 #endif
296
297 Standard_Boolean IsRectangular = 
298                 MyGrid->IsKind (STANDARD_TYPE (Aspect_RectangularGrid));
299
300 Graphic3d_Vertex P1;
301
302 Standard_Real XO = 0.0, YO = 0.0;
303 Standard_Real XOp, YOp;
304 Standard_Real XAp, YAp;
305 Standard_Real XBp, YBp;
306
307         X1 = XO, Y1 = YO, Z1 = 0.0;
308         // MyTrsf * Point to return to the plane of 3D grid
309         P1.SetCoord (X1, Y1, Z1);
310         CurPoint = V3d_View::TrsPoint (P1, MyTrsf);
311         CurPoint.Coord (X2, Y2, Z2);
312         Project (X2, Y2, Z2, XOp, YOp);
313         XPp = XPp - XOp, YPp = YPp - YOp;
314
315 #ifdef TRACE_POINTS
316         MyGridEchoGroup->Text ("O", CurPoint, 1./81.);
317 #endif
318
319 #ifdef TRACE_VALUES
320         cout << "Projection de P : " << XPp << ", " << YPp << endl;
321         cout << "Projection de O : " << XOp << ", " << YOp << endl;
322 #endif
323
324         if (IsRectangular) {
325 Standard_Real XS, YS;
326 Handle(Aspect_RectangularGrid) theGrid =
327                         *(Handle(Aspect_RectangularGrid) *) &MyGrid;
328                 XS = theGrid->XStep (), YS = theGrid->YStep ();
329
330                 X1 = XO + XS, Y1 = YO, Z1 = 0.0;
331                 // MyTrsf *  Point to return to the plane of 3D grid
332                 P1.SetCoord (X1, Y1, Z1);
333                 CurPoint = V3d_View::TrsPoint (P1, MyTrsf);
334                 CurPoint.Coord (X2, Y2, Z2);
335                 Project (X2, Y2, Z2, XAp, YAp);
336                 XAp = XAp - XOp, YAp = YAp - YOp;
337
338 #ifdef TRACE_POINTS
339                 MyGridEchoGroup->Text ("A", CurPoint, 1./81.);
340 #endif
341
342                 X1 = XO, Y1 = YO + YS, Z1 = 0.0;
343                 // MyTrsf *  Point to return to the plane of 3D grid
344                 P1.SetCoord (X1, Y1, Z1);
345                 CurPoint = V3d_View::TrsPoint (P1, MyTrsf);
346                 CurPoint.Coord (X2, Y2, Z2);
347                 Project (X2, Y2, Z2, XBp, YBp);
348                 XBp = XBp - XOp, YBp = YBp - YOp;
349
350 #ifdef TRACE_POINTS
351                 MyGridEchoGroup->Text ("B", CurPoint, 1./81.);
352 #endif
353
354 #ifdef TRACE_VALUES
355                 cout << "Projection de A : " << XAp << ", " << YAp << endl;
356                 cout << "Projection de B : " << XBp << ", " << YBp << endl;
357 #endif
358
359 Standard_Real Determin = XAp*YBp - XBp*YAp;
360
361                 Z1 = 0.0;
362                 if (Abs (Determin) > MYEPSILON1) {
363                         X1 = (YBp*XPp - XBp*YPp) / Determin;
364                         Y1 = (XAp*YPp - YAp*XPp) / Determin;
365                         X1 = (X1 > 0. ?
366                         Standard_Real (Standard_Integer (Abs (X1)+0.5)) * XS :
367                         - Standard_Real (Standard_Integer (Abs (X1)+0.5)) * XS);
368                         Y1 = (Y1 > 0. ?
369                         Standard_Real (Standard_Integer (Abs (Y1)+0.5)) * YS :
370                         - Standard_Real (Standard_Integer (Abs (Y1)+0.5)) * YS);
371 #ifdef TRACE_VALUES
372                         cout << "Chosen point : " << X1 << ", " << Y1 << endl;
373 #endif
374                         // MyTrsf *  Point to return to the plane of 3D grid
375                         P1.SetCoord (X1, Y1, Z1);
376                         CurPoint = V3d_View::TrsPoint (P1, MyTrsf);
377                         CurPoint.Coord (X2, Y2, Z2);
378                 }
379                 else {
380 cout << "*****************" << endl;
381 cout << "Zero Determinant!" << endl;
382 cout << "*****************" << endl;
383 #ifdef TRACE_VALUES
384                         cout << "Zero Determinant !" << endl;
385 #endif
386                         AVertex.Coord (X2, Y2, Z2);
387                         CurPoint.SetCoord (X2, Y2, Z2);
388                 }
389         } // IsRectangular
390         else {
391 Standard_Real RS;
392 Standard_Integer DN;
393 Standard_Real Alpha;
394 Handle(Aspect_CircularGrid) theGrid =
395                         *(Handle(Aspect_CircularGrid) *) &MyGrid;
396                 RS = theGrid->RadiusStep ();
397                 DN = theGrid->DivisionNumber ();
398                 Alpha = M_PI / Standard_Real (DN);
399
400 Standard_Real DistOP = Sqrt (XPp*XPp + YPp*YPp);
401
402 Standard_Integer i, ICur=0;
403 Standard_Real Angle, AngleCur;
404 Standard_Real XCurp=0, YCurp=0;
405 gp_Dir2d OP (XPp, YPp);
406                 AngleCur = 2 * M_PI;
407                 for (i=1; i<=DN*2; i++) {
408                         X1 = XO + Cos (Alpha * i) * RS,
409                         Y1 = YO + Sin (Alpha * i) * RS,
410                         Z1 = 0.0;
411                         // MyTrsf * Point to return to the plane of 3D grid
412                         P1.SetCoord (X1, Y1, Z1);
413                         CurPoint = V3d_View::TrsPoint (P1, MyTrsf);
414                         CurPoint.Coord (X2, Y2, Z2);
415                         Project (X2, Y2, Z2, XAp, YAp);
416                         XAp = XAp - XOp, YAp = YAp - YOp;
417                         gp_Dir2d OA (XAp, YAp);
418                         Angle = OP.Angle (OA);
419                         if (Abs (AngleCur) > Abs (Angle)) {
420                                 ICur = i;
421                                 AngleCur = Angle;
422                                 XCurp = XAp, YCurp = YAp;
423 #ifdef TRACE_VALUES
424                                 cout << "Angle between OP and O" << CAR [i-1]
425                                      << " : " << Angle << endl;
426 #endif
427                         }
428
429 #ifdef TRACE_POINTS
430                         MyGridEchoGroup->Text (CAR [i-1], CurPoint, 1./81.);
431 #endif
432                 } // for (i=1; i<=DN*2; i++)
433
434 Standard_Real DistOCur = Sqrt (XCurp*XCurp + YCurp*YCurp);
435
436                 // Determination of the circle of the grid closest to P
437 Standard_Integer N = Standard_Integer (DistOP / DistOCur + 0.5);
438 Standard_Real Radius = N * RS;
439 #ifdef TRACE_VALUES
440                 cout << "Circle : " << N << " Radius : " << Radius << endl;
441 #endif
442
443                 X1 = Cos (Alpha * ICur) * Radius,
444                 Y1 = Sin (Alpha * ICur) * Radius,
445                 Z1 = 0.0;
446
447 #ifdef TRACE_VALUES
448                 cout << "Chosen Point : " << X1 << ", " << Y1 << endl;
449 #endif
450                 // MyTrsf * Point to return to the plane of 3D grid
451                 P1.SetCoord (X1, Y1, Z1);
452                 CurPoint = V3d_View::TrsPoint (P1, MyTrsf);
453                 CurPoint.Coord (X2, Y2, Z2);
454         } // IsCircular
455
456         NewPoint.SetCoord (CurPoint.X (), CurPoint.Y (), CurPoint.Z ());
457
458 #ifdef TRACE_POINTS
459         TextAttrib->SetColor (Quantity_Color (Quantity_NOC_RED));
460         MyGridEchoGroup->SetPrimitivesAspect (TextAttrib);
461         MyGridEchoGroup->Text ("Q", NewPoint, 1./81.);
462         MyGridEchoGroup->Polyline (AVertex, NewPoint);
463         Update ();
464 #endif
465 #ifdef IMP240100
466         MyViewer->ShowGridEcho(this,NewPoint);
467 #else
468 #ifdef TRACE_ECHO
469 char *trace_echo = NULL;
470         trace_echo = (char *)(getenv ("CSF_GraphicEcho"));
471         if (trace_echo) {
472                 MyGridEchoGroup->Clear ();
473                 MyGridEchoGroup->Marker (NewPoint);
474                 Visual3d_TransientManager::BeginDraw
475                         (MyView, Standard_False, Standard_False);
476                 Visual3d_TransientManager::DrawStructure (MyGridEchoStructure);
477                 Visual3d_TransientManager::EndDraw (Standard_True);
478         }
479 #endif
480 #endif  //IMP240100
481         return NewPoint;
482 }
483
484 // Triedron methods : the Triedron is a non-zoomable object.
485
486 void V3d_View::ZBufferTriedronSetup(const Quantity_NameOfColor XColor,
487                                     const Quantity_NameOfColor YColor,
488                                     const Quantity_NameOfColor ZColor,
489                                     const Standard_Real        SizeRatio,
490                                     const Standard_Real        AxisDiametr,
491                                     const Standard_Integer     NbFacettes)
492 {
493   MyView->ZBufferTriedronSetup(XColor, YColor, ZColor, SizeRatio, AxisDiametr, NbFacettes);
494 }
495
496 void V3d_View::TriedronDisplay (const Aspect_TypeOfTriedronPosition APosition,
497  const Quantity_NameOfColor AColor, const Standard_Real AScale, const V3d_TypeOfVisualization AMode ) {
498
499         MyView->TriedronDisplay (APosition, AColor, AScale, (AMode == V3d_WIREFRAME));
500 }
501
502 void V3d_View::TriedronErase ( ) {
503
504         MyView->TriedronErase ( );
505 }
506
507 void V3d_View::TriedronEcho (const Aspect_TypeOfTriedronEcho AType ) {
508
509         MyView->TriedronEcho (AType);
510 }
511
512 void V3d_View::GetGraduatedTrihedron(/* Names of axes */
513                                      TCollection_ExtendedString &xname,
514                                      TCollection_ExtendedString &yname,
515                                      TCollection_ExtendedString &zname,
516                                      /* Draw names */
517                                      Standard_Boolean& xdrawname, 
518                                      Standard_Boolean& ydrawname, 
519                                      Standard_Boolean& zdrawname,
520                                      /* Draw values */
521                                      Standard_Boolean& xdrawvalues, 
522                                      Standard_Boolean& ydrawvalues, 
523                                      Standard_Boolean& zdrawvalues,
524                                      /* Draw grid */
525                                      Standard_Boolean& drawgrid,
526                                      /* Draw axes */
527                                      Standard_Boolean& drawaxes,
528                                      /* Number of splits along axes */
529                                      Standard_Integer& nbx, 
530                                      Standard_Integer& nby, 
531                                      Standard_Integer& nbz,
532                                      /* Offset for drawing values */
533                                      Standard_Integer& xoffset, 
534                                      Standard_Integer& yoffset, 
535                                      Standard_Integer& zoffset,
536                                      /* Offset for drawing names of axes */
537                                      Standard_Integer& xaxisoffset, 
538                                      Standard_Integer& yaxisoffset, 
539                                      Standard_Integer& zaxisoffset,
540                                      /* Draw tickmarks */
541                                      Standard_Boolean& xdrawtickmarks, 
542                                      Standard_Boolean& ydrawtickmarks, 
543                                      Standard_Boolean& zdrawtickmarks,
544                                      /* Length of tickmarks */
545                                      Standard_Integer& xtickmarklength, 
546                                      Standard_Integer& ytickmarklength, 
547                                      Standard_Integer& ztickmarklength,
548                                      /* Grid color */
549                                      Quantity_Color& gridcolor,
550                                      /* X name color */
551                                      Quantity_Color& xnamecolor,
552                                      /* Y name color */
553                                      Quantity_Color& ynamecolor,
554                                      /* Z name color */
555                                      Quantity_Color& znamecolor,
556                                      /* X color of axis and values */
557                                      Quantity_Color& xcolor,
558                                      /* Y color of axis and values */
559                                      Quantity_Color& ycolor,
560                                      /* Z color of axis and values */
561                                      Quantity_Color& zcolor,
562                                      /* Name of font for names of axes */
563                                      TCollection_AsciiString &fontOfNames,
564                                      /* Style of names of axes */
565                                      Font_FontAspect& styleOfNames,
566                                      /* Size of names of axes */
567                                      Standard_Integer& sizeOfNames,
568                                      /* Name of font for values */
569                                      TCollection_AsciiString &fontOfValues,
570                                      /* Style of values */
571                                      Font_FontAspect& styleOfValues,
572                                      /* Size of values */
573                                      Standard_Integer& sizeOfValues) const
574 {
575     MyView->GetGraduatedTrihedron(/* Names of axes */
576                                   xname, 
577                                   yname, 
578                                   zname,
579                                   /* Draw names */
580                                   xdrawname, 
581                                   ydrawname, 
582                                   zdrawname,
583                                   /* Draw values */
584                                   xdrawvalues, 
585                                   ydrawvalues, 
586                                   zdrawvalues,
587                                   /* Draw grid */
588                                   drawgrid,
589                                   /* Draw axes */
590                                   drawaxes,
591                                   /* Number of splits along axes */
592                                   nbx, 
593                                   nby, 
594                                   nbz,
595                                   /* Offset for drawing values */
596                                   xoffset, 
597                                   yoffset, 
598                                   zoffset,
599                                   /* Offset for drawing names of axes */
600                                   xaxisoffset, 
601                                   yaxisoffset, 
602                                   zaxisoffset,
603                                   /* Draw tickmarks */
604                                   xdrawtickmarks, 
605                                   ydrawtickmarks, 
606                                   zdrawtickmarks,
607                                   /* Length of tickmarks */
608                                   xtickmarklength, 
609                                   ytickmarklength, 
610                                   ztickmarklength,
611                                   /* Grid color */
612                                   gridcolor,
613                                   /* X name color */
614                                   xnamecolor,
615                                   /* Y name color */
616                                   ynamecolor,
617                                   /* Z name color */
618                                   znamecolor,
619                                   /* X color of axis and values */
620                                   xcolor,
621                                   /* Y color of axis and values */
622                                   ycolor,
623                                   /* Z color of axis and values */
624                                   zcolor,
625                                   /* Name of font for names of axes */
626                                   fontOfNames,
627                                   /* Style of names of axes */
628                                   styleOfNames,
629                                   /* Size of names of axes */
630                                   sizeOfNames,
631                                   /* Name of font for values */
632                                   fontOfValues,
633                                   /* Style of values */
634                                   styleOfValues,
635                                   /* Size of values */
636                                   sizeOfValues);
637 }
638
639 void V3d_View::GraduatedTrihedronDisplay(/* Names of axes */
640                                          const TCollection_ExtendedString &xname, 
641                                          const TCollection_ExtendedString &yname, 
642                                          const TCollection_ExtendedString &zname,
643                                          /* Draw names */
644                                          const Standard_Boolean xdrawname, 
645                                          const Standard_Boolean ydrawname, 
646                                          const Standard_Boolean zdrawname,
647                                          /* Draw values */
648                                          const Standard_Boolean xdrawvalues, 
649                                          const Standard_Boolean ydrawvalues, 
650                                          const Standard_Boolean zdrawvalues,
651                                          /* Draw grid */
652                                          const Standard_Boolean drawgrid,
653                                          /* Draw axes */
654                                          const Standard_Boolean drawaxes,
655                                          /* Number of splits along axes */
656                                          const Standard_Integer nbx, 
657                                          const Standard_Integer nby, 
658                                          const Standard_Integer nbz,
659                                          /* Offset for drawing values */
660                                          const Standard_Integer xoffset, 
661                                          const Standard_Integer yoffset, 
662                                          const Standard_Integer zoffset,
663                                          /* Offset for drawing names of axes */
664                                          const Standard_Integer xaxisoffset, 
665                                          const Standard_Integer yaxisoffset, 
666                                          const Standard_Integer zaxisoffset,
667                                          /* Draw tickmarks */
668                                          const Standard_Boolean xdrawtickmarks, 
669                                          const Standard_Boolean ydrawtickmarks, 
670                                          const Standard_Boolean zdrawtickmarks,
671                                          /* Length of tickmarks */
672                                          const Standard_Integer xtickmarklength, 
673                                          const Standard_Integer ytickmarklength, 
674                                          const Standard_Integer ztickmarklength,
675                                          /* Grid color */
676                                          const Quantity_Color& gridcolor,
677                                          /* X name color */
678                                          const Quantity_Color& xnamecolor,
679                                          /* Y name color */
680                                          const Quantity_Color& ynamecolor,
681                                          /* Z name color */
682                                          const Quantity_Color& znamecolor,
683                                          /* X color of axis and values */
684                                          const Quantity_Color& xcolor,
685                                          /* Y color of axis and values */
686                                          const Quantity_Color& ycolor,
687                                          /* Z color of axis and values */
688                                          const Quantity_Color& zcolor,
689                                          /* Name of font for names of axes */
690                                          const TCollection_AsciiString &fontOfNames,
691                                          /* Style of names of axes */
692                                          const Font_FontAspect styleOfNames,
693                                          /* Size of names of axes */
694                                          const Standard_Integer sizeOfNames,
695                                          /* Name of font for values */
696                                          const TCollection_AsciiString &fontOfValues,
697                                          /* Style of values */
698                                          const Font_FontAspect styleOfValues,
699                                          /* Size of values */
700                                          const Standard_Integer sizeOfValues)
701 {
702     MyView->GraduatedTrihedronDisplay(/* Names of axes */
703                                       xname, 
704                                       yname, 
705                                       zname,
706                                       /* Draw names */
707                                       xdrawname, 
708                                       ydrawname, 
709                                       zdrawname,
710                                       /* Draw values */
711                                       xdrawvalues, 
712                                       ydrawvalues, 
713                                       zdrawvalues,
714                                       /* Draw grid */
715                                       drawgrid,
716                                       /* Draw axes */
717                                       drawaxes,
718                                       /* Number of splits along axes */
719                                       nbx, 
720                                       nby, 
721                                       nbz,
722                                       /* Offset for drawing values */
723                                       xoffset, 
724                                       yoffset, 
725                                       zoffset,
726                                       /* Offset for drawing names of axes */
727                                       xaxisoffset, 
728                                       yaxisoffset, 
729                                       zaxisoffset,
730                                       /* Draw tickmarks */
731                                       xdrawtickmarks, 
732                                       ydrawtickmarks, 
733                                       zdrawtickmarks,
734                                       /* Length of tickmarks */
735                                       xtickmarklength, 
736                                       ytickmarklength, 
737                                       ztickmarklength,
738                                       /* Grid color */
739                                       gridcolor,
740                                       /* X name color */
741                                       xnamecolor,
742                                       /* Y name color */
743                                       ynamecolor,
744                                       /* Z name color */
745                                       znamecolor,
746                                       /* X color of axis and values */
747                                       xcolor,
748                                       /* Y color of axis and values */
749                                       ycolor,
750                                       /* Z color of axis and values */
751                                       zcolor,
752                                       /* Name of font for names of axes */
753                                       fontOfNames,
754                                       /* Style of names of axes */
755                                       styleOfNames,
756                                       /* Size of names of axes */
757                                       sizeOfNames,
758                                       /* Name of font for values */
759                                       fontOfValues,
760                                       /* Style of values */
761                                       styleOfValues,
762                                       /* Size of values */
763                                       sizeOfValues);
764 }
765
766 void V3d_View::GraduatedTrihedronErase()
767 {
768     MyView->GraduatedTrihedronErase();
769 }