@@ -430,7 +430,11 @@ def DisplayVector(self, vec, pnt, update=False):
430
430
pnt_start = gp_Pnt (start .X (), start .Y (), start .Z ())
431
431
432
432
Prs3d_Arrow .Draw (
433
- aStructure , pnt_start , gp_Dir (vec ), math .radians (20 ), vec .Magnitude ()
433
+ aStructure .CurrentGroup (),
434
+ pnt_start ,
435
+ gp_Dir (vec ),
436
+ math .radians (20 ),
437
+ vec .Magnitude (),
434
438
)
435
439
aStructure .Display ()
436
440
# it would be more coherent if a AIS_InteractiveObject
@@ -440,23 +444,30 @@ def DisplayVector(self, vec, pnt, update=False):
440
444
return aStructure
441
445
442
446
def DisplayMessage (
443
- self , point , text_to_write , height = None , message_color = None , update = False
447
+ self ,
448
+ point ,
449
+ text_to_write ,
450
+ height = 14.0 ,
451
+ message_color = (0.0 , 0.0 , 0.0 ),
452
+ update = False ,
444
453
):
445
454
"""
446
455
:point: a gp_Pnt or gp_Pnt2d instance
447
456
:text_to_write: a string
448
- :message_color: triple with the range 0-1
457
+ :height: font height, 12 by defaults
458
+ :message_color: triple with the range 0-1, default to black
449
459
"""
450
460
aStructure = Graphic3d_Structure (self ._struc_mgr )
451
- text_aspect = Prs3d_TextAspect ()
452
461
453
- if message_color is not None :
454
- text_aspect .SetColor (rgb_color (* message_color ))
455
- if height is not None :
456
- text_aspect .SetHeight (height )
462
+ text_aspect = Prs3d_TextAspect ()
463
+ text_aspect .SetColor (rgb_color (* message_color ))
464
+ text_aspect .SetHeight (height )
457
465
if isinstance (point , gp_Pnt2d ):
458
466
point = gp_Pnt (point .X (), point .Y (), 0 )
459
- Prs3d_Text .Draw (aStructure , text_aspect , to_string (text_to_write ), point )
467
+
468
+ Prs3d_Text .Draw (
469
+ aStructure .CurrentGroup (), text_aspect , to_string (text_to_write ), point
470
+ )
460
471
aStructure .Display ()
461
472
# @TODO: it would be more coherent if a AIS_InteractiveObject
462
473
# is be returned
0 commit comments