@@ -62,32 +62,30 @@ def onSimulationInitDoneEvent(self, _):
6262 # Add object to the factory
6363 if self .factory is not None :
6464 # Window 1: Liver only (id=0)
65- self .factory .add_mesh (position_object = '@liver.visual.LiverOgl' ,
66- cell_type = 'triangles' , animated = True ,
67- at = 0 , c = 'red5' )
65+ self .factory .add_mesh_callback (position_object = '@liver.visual.LiverOgl' , cell_type = 'triangles' ,
66+ animated = True , at = 0 , c = 'red5' )
6867
6968 # Window 2: Liver (id=1) + Force (id=2)
70- self .factory .add_mesh (position_object = '@liver.visual.LiverOgl' ,
71- cell_type = 'triangles' , animated = True ,
72- at = 1 , c = 'green8' , wireframe = True , line_width = 1 )
73- self .factory .add_arrows (position_object = '@liver.surface.SurfaceMO' , vector_object = '@liver.surface.CFF' ,
74- animated = True , start_indices = array ([33 ]),
75- at = 1 , scale = 0.5e-3 , c = 'green3' , res = 20 )
69+ self .factory .add_mesh_callback (position_object = '@liver.visual.LiverOgl' , cell_type = 'triangles' ,
70+ animated = True , at = 1 , c = 'green8' , wireframe = True , line_width = 1 )
71+ self .factory .add_arrows_callback (position_object = '@liver.surface.SurfaceMO' ,
72+ vector_object = '@liver.surface.CFF' , start_indices = array ([33 ]),
73+ animated = True , at = 1 , scale = 0.5e-3 , c = 'green3' , res = 20 )
7674
7775 # Window 3: Grid (id=3 & id=4) + Constraint (id=5)
78- self .factory .add_points (position_object = '@liver.GridMO' , animated = True ,
79- at = 2 , c = 'grey3' , point_size = 8 )
80- self .factory .add_mesh (position_object = '@liver.GridMO' , topology_object = '@liver.Grid' ,
81- cell_type = 'tetrahedra' , animated = True ,
82- at = 2 , c = 'grey3' , wireframe = True , line_width = 1 )
76+ self .factory .add_points_callback (position_object = '@liver.GridMO' , animated = True ,
77+ at = 2 , c = 'grey3' , point_size = 8 )
78+ self .factory .add_mesh_callback (position_object = '@liver.GridMO' , topology_object = '@liver.Grid' ,
79+ cell_type = 'tetrahedra' , animated = True ,
80+ at = 2 , c = 'grey3' , wireframe = True , line_width = 1 )
8381 self .factory .add_markers (normal_to = 4 , indices = array ([3 , 39 , 64 ]),
8482 at = 2 , c = 'red3' , size = 0.5 , symbol = '0' , filled = False )
8583
8684 # Window 4: Liver Displacement (id=6)
8785 nb_points = len (self .root .liver .visual .getObject ('LiverOgl' ).position .value )
88- self .factory .add_mesh (position_object = '@liver.visual.LiverOgl' ,
89- cell_type = 'triangles' , animated = True ,
90- at = 3 , alpha = 0.6 , colormap = 'coolwarm' , scalar_field = zeros ((nb_points ,)))
86+ self .factory .add_mesh_callback (position_object = '@liver.visual.LiverOgl' , cell_type = 'triangles ' ,
87+ animated = True , at = 3 , alpha = 0.6 , colormap = 'coolwarm' ,
88+ scalar_field = zeros ((nb_points ,)))
9189
9290 def onAnimateBeginEvent (self , _ ):
9391
0 commit comments