7fd59977 |
1 | |
2 | // File OpenGl_GraphicDriver_9.cxx |
3 | // Created 1/08/97 |
4 | // Author PCT |
5 | // Modified |
6 | // 16-09-98 ; BGN : Points d'entree du Triedre (S3819, Phase 1) |
7 | // 22-09-98 ; BGN : S3989 (anciennement S3819) |
8 | // TypeOfTriedron* from Aspect (pas Graphic3d) |
9 | |
10 | //-Copyright MatraDatavision 1997 |
11 | |
12 | //-Version |
13 | |
14 | //-Design Declaration des variables specifiques aux Drivers |
15 | |
16 | //-Warning Un driver encapsule les Pex et OpenGl drivers |
17 | |
18 | //-References |
19 | |
20 | //-Language C++ 2.0 |
21 | |
22 | //-Declarations |
23 | |
24 | // for the class |
25 | |
26 | #define IMP131100 //GG_Enable to creates more than one texture |
27 | // with the same name. |
28 | |
29 | #define OCC1188 //SAV added methods to set background image |
30 | |
31 | #include <OpenGl_GraphicDriver.jxx> |
32 | |
33 | #include <Aspect_DriverDefinitionError.hxx> |
34 | #include <Quantity_NameOfColor.hxx> |
35 | #include <AlienImage.hxx> |
36 | #include <Standard_Integer.hxx> |
37 | |
38 | #include <OpenGl_tgl_funcs.hxx> |
39 | |
40 | #include <stdlib.h> |
41 | #include <stdio.h> |
42 | |
43 | |
44 | #include <Image_Image.hxx> |
45 | |
46 | |
47 | //-Aliases |
48 | |
49 | //-Global data definitions |
50 | |
51 | //-Methods, in order |
52 | |
53 | // Helper function, returns the nearest power of two greater than the argument value |
54 | inline Standard_Integer GetNearestPow2(Standard_Integer theValue) |
55 | { |
56 | // Precaution against overflow |
57 | Standard_Integer aHalfMax = IntegerLast() >> 1, aRes = 1; |
58 | if ( theValue > aHalfMax ) theValue = aHalfMax; |
59 | while ( aRes < theValue ) aRes <<= 1; |
60 | return aRes; |
61 | } |
62 | |
63 | Standard_Integer OpenGl_GraphicDriver::CreateTexture(const Graphic3d_TypeOfTexture Type,const Handle_AlienImage_AlienImage &Image,const Standard_CString FileName,const Handle(TColStd_HArray1OfReal)& TexUpperBounds) const |
64 | { |
65 | // transmutation de l'image en un bon tableau RGBA pour la toolkit des textures |
66 | // lamentable d'un point de vue vitesse... |
67 | Handle(Image_Image) MyPic = Image->ToImage(); |
68 | |
69 | //TODO: The temporary fix in order to make AIS_TexturedShape work. To be improved in next release. |
70 | Standard_Integer aGlWidth = (Type == Graphic3d_TOT_2D_MIPMAP) ? MyPic->Width() : GetNearestPow2(MyPic->Width()); |
71 | Standard_Integer aGlHeight = (Type == Graphic3d_TOT_2D_MIPMAP) ? MyPic->Height() : GetNearestPow2(MyPic->Height()); |
72 | |
73 | TexUpperBounds->SetValue(1, ((Standard_Real) (MyPic->Width())/((Standard_Real) aGlWidth))); |
74 | TexUpperBounds->SetValue(2, ((Standard_Real) (MyPic->Height())/((Standard_Real) aGlHeight))); |
75 | |
76 | unsigned char *MyImageData = (unsigned char *)malloc(aGlWidth*aGlHeight*4); |
77 | unsigned char *MyData = MyImageData; |
78 | int TexId; |
79 | int i,j; |
80 | Quantity_Color MyColor; |
81 | |
82 | if (MyImageData == NULL) |
83 | return -1; |
84 | |
85 | #ifdef IMP131100 |
86 | |
87 | static Standard_Integer textureRank=0; |
88 | char textureName[16]; |
89 | Standard_PCharacter fileName = textureName; |
90 | sprintf(fileName,"Tex%d",++textureRank); |
91 | #else |
92 | Standard_CString fileName = FileName |
93 | #endif |
94 | |
95 | for (j = MyPic->Height() - 1; j >= 0; j--) |
96 | for (i = 0; i < aGlWidth; i++){ |
97 | if (i < MyPic->Width()){ |
98 | MyColor = MyPic->PixelColor(i, j); |
99 | *MyData++ = (int)(255 * MyColor.Red()); |
100 | *MyData++ = (int)(255 * MyColor.Green()); |
101 | *MyData++ = (int)(255 * MyColor.Blue()); |
102 | } |
103 | else { |
104 | *MyData++ = (int)(0); |
105 | *MyData++ = (int)(0); |
106 | *MyData++ = (int)(0); |
107 | } |
108 | *MyData++ = 0xFF; |
109 | } |
110 | |
111 | // Padding the lower part of the texture with black |
112 | for (j = aGlHeight - 1; j >= MyPic->Height(); j--) |
113 | for (i = 0; i < aGlWidth; i++){ |
114 | *MyData++ = (int)(0); |
115 | *MyData++ = (int)(0); |
116 | *MyData++ = (int)(0); |
117 | *MyData++ = 0xFF; |
118 | } |
119 | |
120 | |
121 | switch (Type) |
122 | { |
123 | case Graphic3d_TOT_1D: |
124 | TexId = call_togl_create_texture(0, aGlWidth, aGlHeight, MyImageData, (Standard_PCharacter)fileName); |
125 | break; |
126 | |
127 | case Graphic3d_TOT_2D: |
128 | TexId = call_togl_create_texture(1, aGlWidth, aGlHeight, MyImageData, (Standard_PCharacter)fileName); |
129 | break; |
130 | |
131 | case Graphic3d_TOT_2D_MIPMAP: |
132 | TexId = call_togl_create_texture(2, aGlWidth, aGlHeight, MyImageData, (Standard_PCharacter)fileName); |
133 | break; |
134 | |
135 | default: |
136 | TexId = -1; |
137 | } |
138 | |
139 | free(MyImageData); |
140 | return TexId; |
141 | |
142 | } |
143 | |
144 | void OpenGl_GraphicDriver::DestroyTexture(const Standard_Integer TexId) const |
145 | { |
146 | call_togl_destroy_texture(TexId); |
147 | } |
148 | |
149 | |
150 | void OpenGl_GraphicDriver::ModifyTexture(const Standard_Integer TexId,const Graphic3d_CInitTexture& AValue) const |
151 | { |
152 | call_togl_modify_texture(TexId, (CALL_DEF_INIT_TEXTURE *)&AValue); |
153 | } |
154 | |
155 | |
156 | |
157 | |
158 | void OpenGl_GraphicDriver::Environment(const Graphic3d_CView& ACView) |
159 | { |
160 | call_togl_environment((CALL_DEF_VIEW *)&ACView); |
161 | } |
162 | |
163 | |
164 | // |
165 | // Triedron methods : the Triedron is a non-zoomable object. |
166 | // |
167 | |
168 | void OpenGl_GraphicDriver::ZBufferTriedronSetup ( |
169 | const Quantity_NameOfColor XColor, |
170 | const Quantity_NameOfColor YColor, |
171 | const Quantity_NameOfColor ZColor, |
172 | const Standard_Real SizeRatio, |
173 | const Standard_Real AxisDiametr, |
174 | const Standard_Integer NbFacettes) |
175 | { |
176 | float Xrgb[3]; |
177 | float Yrgb[3]; |
178 | float Zrgb[3]; |
179 | Standard_Real R,G,B; |
180 | Quantity_Color(XColor).Values(R, G, B, Quantity_TOC_RGB); |
181 | Xrgb[0] = float (R); |
182 | Xrgb[1] = float (G); |
183 | Xrgb[2] = float (B); |
184 | Quantity_Color(YColor).Values(R, G, B, Quantity_TOC_RGB); |
185 | Yrgb[0] = float (R); |
186 | Yrgb[1] = float (G); |
187 | Yrgb[2] = float (B); |
188 | Quantity_Color(ZColor).Values(R, G, B, Quantity_TOC_RGB); |
189 | Zrgb[0] = float (R); |
190 | Zrgb[1] = float (G); |
191 | Zrgb[2] = float (B); |
192 | |
193 | call_togl_ztriedron_setup(Xrgb, Yrgb, Zrgb, |
194 | (Standard_ShortReal)(SizeRatio), (Standard_ShortReal)(AxisDiametr), NbFacettes); |
195 | } |
196 | |
197 | void OpenGl_GraphicDriver::TriedronDisplay ( |
198 | const Graphic3d_CView& ACView, |
199 | const Aspect_TypeOfTriedronPosition APosition, |
200 | const Quantity_NameOfColor AColor, |
201 | const Standard_Real AScale, |
202 | const Standard_Boolean AsWireframe ) |
203 | { |
204 | Standard_Real R,G,B; |
205 | float r,g,b; |
206 | Quantity_Color Color(AColor); |
207 | Color.Values(R,G,B,Quantity_TOC_RGB); |
208 | r = float (R); |
209 | g = float (G); |
210 | b = float (B); |
211 | |
212 | call_togl_triedron_display((CALL_DEF_VIEW *)&ACView,(int)APosition, r,g,b, (float)AScale, AsWireframe); |
213 | } |
214 | |
215 | void OpenGl_GraphicDriver::TriedronErase (const Graphic3d_CView& ACView) |
216 | { |
217 | call_togl_triedron_erase((CALL_DEF_VIEW *)&ACView); |
218 | } |
219 | |
220 | void OpenGl_GraphicDriver::TriedronEcho (const Graphic3d_CView& ACView,const Aspect_TypeOfTriedronEcho AType ) |
221 | { |
222 | call_togl_triedron_echo( (CALL_DEF_VIEW *)&ACView,AType ); |
223 | } |
224 | |
225 | void OpenGl_GraphicDriver::BackgroundImage( const Standard_CString FileName, |
226 | const Graphic3d_CView& ACView, |
227 | const Aspect_FillMethod FillStyle ) |
228 | { |
229 | #ifdef OCC1188 |
230 | Graphic3d_CView MyCView = ACView; |
231 | Standard_Integer width, height; |
232 | Handle(Image_Image) image; |
233 | |
234 | Standard_Boolean result = AlienImage::LoadImageFile( FileName, image, width, height ); |
235 | |
236 | if ( result ) { |
237 | unsigned char *data = (unsigned char*)malloc( width * height * 3 ); |
238 | unsigned char *pdata = data; |
239 | Standard_Integer i,j; |
240 | Quantity_Color color; |
241 | |
242 | if ( data != NULL ) { |
243 | for ( j = height - 1; j >= 0; j-- ) |
244 | for ( i = 0; i < width; i++ ) { |
245 | color = image->PixelColor( i, j ); |
246 | *pdata++ = (int)( 255 * color.Red() ); |
247 | *pdata++ = (int)( 255 * color.Green() ); |
248 | *pdata++ = (int)( 255 * color.Blue() ); |
249 | } |
250 | call_togl_create_bg_texture( (CALL_DEF_VIEW*)&MyCView, width, height, data, (int)FillStyle ); |
251 | // delete data here |
252 | free( data ); |
253 | } |
254 | } |
255 | #endif // OCC1188 |
256 | } |
257 | |
258 | void OpenGl_GraphicDriver::SetBgImageStyle( const Graphic3d_CView& ACView, |
259 | const Aspect_FillMethod FillStyle ) |
260 | { |
261 | #ifdef OCC1188 |
262 | Graphic3d_CView MyCView = ACView; |
263 | call_togl_set_bg_texture_style( (CALL_DEF_VIEW*)&MyCView, (int)FillStyle ); |
264 | #endif //OCC1188 |
265 | } |
266 | |
267 | void OpenGl_GraphicDriver::SetBgGradientStyle(const Graphic3d_CView& ACView,const Aspect_GradientFillMethod FillType) |
268 | { |
269 | call_togl_set_gradient_type( ACView.WsId, FillType); |
270 | } |
271 | |
272 | void OpenGl_GraphicDriver::GetGraduatedTrihedron(const Graphic3d_CView& view, |
273 | /* Names of axes */ |
274 | Standard_CString& xname, |
275 | Standard_CString& yname, |
276 | Standard_CString& zname, |
277 | /* Draw names */ |
278 | Standard_Boolean& xdrawname, |
279 | Standard_Boolean& ydrawname, |
280 | Standard_Boolean& zdrawname, |
281 | /* Draw values */ |
282 | Standard_Boolean& xdrawvalues, |
283 | Standard_Boolean& ydrawvalues, |
284 | Standard_Boolean& zdrawvalues, |
285 | /* Draw grid */ |
286 | Standard_Boolean& drawgrid, |
287 | /* Draw axes */ |
288 | Standard_Boolean& drawaxes, |
289 | /* Number of splits along axes */ |
290 | Standard_Integer& nbx, |
291 | Standard_Integer& nby, |
292 | Standard_Integer& nbz, |
293 | /* Offset for drawing values */ |
294 | Standard_Integer& xoffset, |
295 | Standard_Integer& yoffset, |
296 | Standard_Integer& zoffset, |
297 | /* Offset for drawing names of axes */ |
298 | Standard_Integer& xaxisoffset, |
299 | Standard_Integer& yaxisoffset, |
300 | Standard_Integer& zaxisoffset, |
301 | /* Draw tickmarks */ |
302 | Standard_Boolean& xdrawtickmarks, |
303 | Standard_Boolean& ydrawtickmarks, |
304 | Standard_Boolean& zdrawtickmarks, |
305 | /* Length of tickmarks */ |
306 | Standard_Integer& xtickmarklength, |
307 | Standard_Integer& ytickmarklength, |
308 | Standard_Integer& ztickmarklength, |
309 | /* Grid color */ |
310 | Quantity_Color& gridcolor, |
311 | /* X name color */ |
312 | Quantity_Color& xnamecolor, |
313 | /* Y name color */ |
314 | Quantity_Color& ynamecolor, |
315 | /* Z name color */ |
316 | Quantity_Color& znamecolor, |
317 | /* X color of axis and values */ |
318 | Quantity_Color& xcolor, |
319 | /* Y color of axis and values */ |
320 | Quantity_Color& ycolor, |
321 | /* Z color of axis and values */ |
322 | Quantity_Color& zcolor, |
323 | /* Name of font for names of axes */ |
324 | Standard_CString& fontOfNames, |
325 | /* Style of names of axes */ |
326 | OSD_FontAspect& styleOfNames, |
327 | /* Size of names of axes */ |
328 | Standard_Integer& sizeOfNames, |
329 | /* Name of font for values */ |
330 | Standard_CString& fontOfValues, |
331 | /* Style of values */ |
332 | OSD_FontAspect& styleOfValues, |
333 | /* Size of values */ |
334 | Standard_Integer& sizeOfValues) const |
335 | { |
336 | Graphic3d_CGraduatedTrihedron cubic; |
337 | call_togl_graduatedtrihedron_get((CALL_DEF_VIEW*)&view, &cubic); |
338 | |
339 | /* Names of axes */ |
340 | xname = cubic.xname; |
341 | yname = cubic.yname; |
342 | zname = cubic.zname; |
343 | /* Draw names */ |
344 | xdrawname = cubic.xdrawname; |
345 | ydrawname = cubic.ydrawname; |
346 | zdrawname = cubic.zdrawname; |
347 | /* Draw values */ |
348 | xdrawvalues = cubic.xdrawvalues; |
349 | ydrawvalues = cubic.ydrawvalues; |
350 | zdrawvalues = cubic.zdrawvalues; |
351 | /* Draw grid */ |
352 | drawgrid = cubic.drawgrid; |
353 | /* Draw axes */ |
354 | drawaxes = cubic.drawaxes; |
355 | /* Number of splits along axes */ |
356 | nbx = cubic.nbx; |
357 | nby = cubic.nby; |
358 | nbz = cubic.nbz; |
359 | /* Offset for drawing values */ |
360 | xoffset = cubic.xoffset; |
361 | yoffset = cubic.yoffset; |
362 | zoffset = cubic.zoffset; |
363 | /* Offset for drawing names of axes */ |
364 | xaxisoffset = cubic.xaxisoffset; |
365 | yaxisoffset = cubic.yaxisoffset; |
366 | zaxisoffset = cubic.zaxisoffset; |
367 | /* Draw tickmarks */ |
368 | xdrawtickmarks = cubic.xdrawtickmarks; |
369 | ydrawtickmarks = cubic.ydrawtickmarks; |
370 | zdrawtickmarks = cubic.zdrawtickmarks; |
371 | /* Length of tickmarks */ |
372 | xtickmarklength = cubic.xtickmarklength; |
373 | ytickmarklength = cubic.ytickmarklength; |
374 | ztickmarklength = cubic.ztickmarklength; |
375 | /* Grid color */ |
376 | gridcolor.SetValues(cubic.gridcolor[0], cubic.gridcolor[1], cubic.gridcolor[2], Quantity_TOC_RGB); |
377 | /* X name color */ |
378 | xnamecolor.SetValues(cubic.xnamecolor[0], cubic.xnamecolor[1], cubic.xnamecolor[2], Quantity_TOC_RGB); |
379 | /* Y name color */ |
380 | ynamecolor.SetValues(cubic.ynamecolor[0], cubic.ynamecolor[1], cubic.ynamecolor[2], Quantity_TOC_RGB); |
381 | /* Z name color */ |
382 | znamecolor.SetValues(cubic.znamecolor[0], cubic.znamecolor[1], cubic.znamecolor[2], Quantity_TOC_RGB); |
383 | /* X color of axis and values */ |
384 | xcolor.SetValues(cubic.xcolor[0], cubic.xcolor[1], cubic.xcolor[2], Quantity_TOC_RGB); |
385 | /* Y color of axis and values */ |
386 | ycolor.SetValues(cubic.ycolor[0], cubic.ycolor[1], cubic.ycolor[2], Quantity_TOC_RGB); |
387 | /* Z color of axis and values */ |
388 | zcolor.SetValues(cubic.zcolor[0], cubic.zcolor[1], cubic.zcolor[2], Quantity_TOC_RGB); |
389 | /* Name of font for names of axes */ |
390 | fontOfNames = cubic.fontOfNames; |
391 | /* Style of names of axes */ |
392 | styleOfNames = cubic.styleOfNames; |
393 | /* Size of names of axes */ |
394 | sizeOfNames = cubic.sizeOfNames; |
395 | /* Name of font for values */ |
396 | fontOfValues = cubic.fontOfValues; |
397 | /* Style of values */ |
398 | styleOfValues = cubic.styleOfValues; |
399 | /* Size of values */ |
400 | sizeOfValues = cubic.sizeOfValues; |
401 | /* Name of font for names of axes */ |
402 | fontOfNames = cubic.fontOfNames; |
403 | /* Style of names of axes */ |
404 | styleOfNames = cubic.styleOfNames; |
405 | /* Size of names of axes */ |
406 | sizeOfNames = cubic.sizeOfNames; |
407 | /* Name of font for values */ |
408 | fontOfValues = cubic.fontOfValues; |
409 | /* Style of values */ |
410 | styleOfValues = cubic.styleOfValues; |
411 | /* Size of values */ |
412 | sizeOfValues = cubic.sizeOfValues; |
413 | } |
414 | |
415 | void OpenGl_GraphicDriver::GraduatedTrihedronDisplay(const Graphic3d_CView& view, |
416 | Graphic3d_CGraduatedTrihedron& cubic, |
417 | /* Names of axes */ |
418 | const Standard_CString xname, |
419 | const Standard_CString yname, |
420 | const Standard_CString zname, |
421 | /* Draw names */ |
422 | const Standard_Boolean xdrawname, |
423 | const Standard_Boolean ydrawname, |
424 | const Standard_Boolean zdrawname, |
425 | /* Draw values */ |
426 | const Standard_Boolean xdrawvalues, |
427 | const Standard_Boolean ydrawvalues, |
428 | const Standard_Boolean zdrawvalues, |
429 | /* Draw grid */ |
430 | const Standard_Boolean drawgrid, |
431 | /* Draw axes */ |
432 | const Standard_Boolean drawaxes, |
433 | /* Number of splits along axes */ |
434 | const Standard_Integer nbx, |
435 | const Standard_Integer nby, |
436 | const Standard_Integer nbz, |
437 | /* Offset for drawing values */ |
438 | const Standard_Integer xoffset, |
439 | const Standard_Integer yoffset, |
440 | const Standard_Integer zoffset, |
441 | /* Offset for drawing names of axes */ |
442 | const Standard_Integer xaxisoffset, |
443 | const Standard_Integer yaxisoffset, |
444 | const Standard_Integer zaxisoffset, |
445 | /* Draw tickmarks */ |
446 | const Standard_Boolean xdrawtickmarks, |
447 | const Standard_Boolean ydrawtickmarks, |
448 | const Standard_Boolean zdrawtickmarks, |
449 | /* Length of tickmarks */ |
450 | const Standard_Integer xtickmarklength, |
451 | const Standard_Integer ytickmarklength, |
452 | const Standard_Integer ztickmarklength, |
453 | /* Grid color */ |
454 | const Quantity_Color& gridcolor, |
455 | /* X name color */ |
456 | const Quantity_Color& xnamecolor, |
457 | /* Y name color */ |
458 | const Quantity_Color& ynamecolor, |
459 | /* Z name color */ |
460 | const Quantity_Color& znamecolor, |
461 | /* X color of axis and values */ |
462 | const Quantity_Color& xcolor, |
463 | /* Y color of axis and values */ |
464 | const Quantity_Color& ycolor, |
465 | /* Z color of axis and values */ |
466 | const Quantity_Color& zcolor, |
467 | /* Name of font for names of axes */ |
468 | const Standard_CString fontOfNames, |
469 | /* Style of names of axes */ |
470 | const OSD_FontAspect styleOfNames, |
471 | /* Size of names of axes */ |
472 | const Standard_Integer sizeOfNames, |
473 | /* Name of font for values */ |
474 | const Standard_CString fontOfValues, |
475 | /* Style of values */ |
476 | const OSD_FontAspect styleOfValues, |
477 | /* Size of values */ |
478 | const Standard_Integer sizeOfValues) |
479 | { |
480 | /* Names of axes */ |
481 | cubic.xname = (char*) xname; |
482 | cubic.yname = (char*) yname; |
483 | cubic.zname = (char*) zname; |
484 | /* Draw names */ |
485 | cubic.xdrawname = xdrawname; |
486 | cubic.ydrawname = ydrawname; |
487 | cubic.zdrawname = zdrawname; |
488 | /* Draw values */ |
489 | cubic.xdrawvalues = xdrawvalues; |
490 | cubic.ydrawvalues = ydrawvalues; |
491 | cubic.zdrawvalues = zdrawvalues; |
492 | /* Draw grid */ |
493 | cubic.drawgrid = drawgrid; |
494 | /* Draw axes */ |
495 | cubic.drawaxes = drawaxes; |
496 | /* Number of splits along axes */ |
497 | cubic.nbx = nbx; |
498 | cubic.nby = nby; |
499 | cubic.nbz = nbz; |
500 | /* Offset for drawing values */ |
501 | cubic.xoffset = xoffset; |
502 | cubic.yoffset = yoffset; |
503 | cubic.zoffset = zoffset; |
504 | /* Offset for drawing names of axes */ |
505 | cubic.xaxisoffset = xaxisoffset; |
506 | cubic.yaxisoffset = yaxisoffset; |
507 | cubic.zaxisoffset = zaxisoffset; |
508 | /* Draw tickmarks */ |
509 | cubic.xdrawtickmarks = xdrawtickmarks; |
510 | cubic.ydrawtickmarks = ydrawtickmarks; |
511 | cubic.zdrawtickmarks = zdrawtickmarks; |
512 | /* Length of tickmarks */ |
513 | cubic.xtickmarklength = xtickmarklength; |
514 | cubic.ytickmarklength = ytickmarklength; |
515 | cubic.ztickmarklength = ztickmarklength; |
516 | /* Grid color */ |
517 | cubic.gridcolor[0] = (Standard_ShortReal) gridcolor.Red(); |
518 | cubic.gridcolor[1] = (Standard_ShortReal) gridcolor.Green(); |
519 | cubic.gridcolor[2] = (Standard_ShortReal) gridcolor.Blue(); |
520 | /* X name color */ |
521 | cubic.xnamecolor[0] = (Standard_ShortReal) xnamecolor.Red(); |
522 | cubic.xnamecolor[1] = (Standard_ShortReal) xnamecolor.Green(); |
523 | cubic.xnamecolor[2] = (Standard_ShortReal) xnamecolor.Blue(); |
524 | /* Y name color */ |
525 | cubic.ynamecolor[0] = (Standard_ShortReal) ynamecolor.Red(); |
526 | cubic.ynamecolor[1] = (Standard_ShortReal) ynamecolor.Green(); |
527 | cubic.ynamecolor[2] = (Standard_ShortReal) ynamecolor.Blue(); |
528 | /* Z name color */ |
529 | cubic.znamecolor[0] = (Standard_ShortReal) znamecolor.Red(); |
530 | cubic.znamecolor[1] = (Standard_ShortReal) znamecolor.Green(); |
531 | cubic.znamecolor[2] = (Standard_ShortReal) znamecolor.Blue(); |
532 | /* X color of axis and values */ |
533 | cubic.xcolor[0] = (Standard_ShortReal) xcolor.Red(); |
534 | cubic.xcolor[1] = (Standard_ShortReal) xcolor.Green(); |
535 | cubic.xcolor[2] = (Standard_ShortReal) xcolor.Blue(); |
536 | /* Y color of axis and values */ |
537 | cubic.ycolor[0] = (Standard_ShortReal) ycolor.Red(); |
538 | cubic.ycolor[1] = (Standard_ShortReal) ycolor.Green(); |
539 | cubic.ycolor[2] = (Standard_ShortReal) ycolor.Blue(); |
540 | /* Z color of axis and values */ |
541 | cubic.zcolor[0] = (Standard_ShortReal) zcolor.Red(); |
542 | cubic.zcolor[1] = (Standard_ShortReal) zcolor.Green(); |
543 | cubic.zcolor[2] = (Standard_ShortReal) zcolor.Blue(); |
544 | /* Name of font for names of axes */ |
545 | cubic.fontOfNames = (char*) fontOfNames; |
546 | /* Style of names of axes */ |
547 | cubic.styleOfNames = styleOfNames; |
548 | /* Size of names of axes */ |
549 | cubic.sizeOfNames = sizeOfNames; |
550 | /* Name of font for values */ |
551 | cubic.fontOfValues = (char*) fontOfValues; |
552 | /* Style of values */ |
553 | cubic.styleOfValues = styleOfValues; |
554 | /* Size of values */ |
555 | cubic.sizeOfValues = sizeOfValues; |
556 | /* Name of font for names of axes */ |
557 | cubic.fontOfNames = (char*) fontOfNames; |
558 | /* Style of names of axes */ |
559 | cubic.styleOfNames = styleOfNames; |
560 | /* Size of names of axes */ |
561 | cubic.sizeOfNames = sizeOfNames; |
562 | /* Name of font for values */ |
563 | cubic.fontOfValues = (char*) fontOfValues; |
564 | /* Style of values */ |
565 | cubic.styleOfValues = styleOfValues; |
566 | /* Size of values */ |
567 | cubic.sizeOfValues = sizeOfValues; |
568 | |
569 | call_togl_graduatedtrihedron_display((CALL_DEF_VIEW*)&view, &cubic); |
570 | } |
571 | |
572 | void OpenGl_GraphicDriver::GraduatedTrihedronErase(const Graphic3d_CView& view) |
573 | { |
574 | call_togl_graduatedtrihedron_erase((CALL_DEF_VIEW*)&view); |
575 | } |
576 | |
577 | void OpenGl_GraphicDriver::GraduatedTrihedronMinMaxValues(const Standard_ShortReal xmin, |
578 | const Standard_ShortReal ymin, |
579 | const Standard_ShortReal zmin, |
580 | const Standard_ShortReal xmax, |
581 | const Standard_ShortReal ymax, |
582 | const Standard_ShortReal zmax) |
583 | { |
584 | call_togl_graduatedtrihedron_minmaxvalues(xmin, ymin, zmin, xmax, ymax, zmax); |
585 | } |