@@ -94,15 +94,40 @@ def test_section_by_plane():
9494 ctx .clearSession () # Clean the session after the previous test
9595 # Création d'une boite avec une topologie
9696 ctx .getTopoManager ().newBoxWithTopo (Mgx3D .Point (0 , 0 , 0 ), Mgx3D .Point (1 , 1 , 1 ), 10 , 10 , 10 , "box" )
97+ vol_info = ctx .getGeomManager ().getInfos ("Vol0000" ,3 )
98+ assert "box" in vol_info .groupsName ()
9799 # Section par un plan entre géométries avec topologies
98100 ctx .getGeomManager ( ).sectionByPlane (["Vol0000" ], Mgx3D .Plane (Mgx3D .Point (0 , 0 , .5 ), Mgx3D .Vector (0 , 0 , 1 )), "aaa" )
99101 # Les entités de dimension inférieure à 2 sont affectées au groupe aaa de manière explicite
102+ vol_info = ctx .getGeomManager ().getInfos ("Vol0001" ,3 )
103+ assert "box" in vol_info .groupsName ()
104+ surf_info = ctx .getGeomManager ().getInfos ("Surf0010" ,2 )
105+ assert "aaa" in surf_info .groupsName ()
106+ crb_info = ctx .getGeomManager ().getInfos ("Crb0014" ,1 )
107+ assert "aaa" in crb_info .groupsName ()
108+ pt_info = ctx .getGeomManager ().getInfos ("Pt0008" ,0 )
109+ assert "aaa" in pt_info .groupsName ()
110+ # Destruction de Pt0008
111+ ctx .getGeomManager ().destroy (["Pt0008" ], False )
112+ assert "DETRUIT" in ctx .getGroupManager ().getInfos ("aaa" , 2 )
113+ assert "DETRUIT" in ctx .getGroupManager ().getInfos ("box" , 3 )
114+ # Annulation de : Destruction de Pt0008
115+ ctx .undo ()
116+ # Les entités de dimension inférieure à 2 sont affectées au groupe aaa de manière explicite
117+ vol_info = ctx .getGeomManager ().getInfos ("Vol0001" ,3 )
118+ assert "box" in vol_info .groupsName ()
100119 surf_info = ctx .getGeomManager ().getInfos ("Surf0010" ,2 )
101120 assert "aaa" in surf_info .groupsName ()
102121 crb_info = ctx .getGeomManager ().getInfos ("Crb0014" ,1 )
103122 assert "aaa" in crb_info .groupsName ()
104123 pt_info = ctx .getGeomManager ().getInfos ("Pt0008" ,0 )
105124 assert "aaa" in pt_info .groupsName ()
125+ # Annulation de : Section par un plan entre géométries avec topologies
126+ ctx .undo ()
127+ vol_info = ctx .getGeomManager ().getInfos ("Vol0000" ,3 )
128+ assert "box" in vol_info .groupsName ()
129+ assert "DETRUIT" in ctx .getGroupManager ().getInfos ("aaa" , 1 )
130+ assert "DETRUIT" in ctx .getGroupManager ().getInfos ("aaa" , 2 )
106131
107132def test_new_vertices_curves_and_planar_surface ():
108133 ctx = Mgx3D .getStdContext ()
@@ -135,3 +160,16 @@ def test_new_planar_surface():
135160 assert "aaa" not in crb_info .groupsName ()
136161 pt_info = ctx .getGeomManager ().getInfos ("Pt0002" ,0 )
137162 assert "aaa" not in pt_info .groupsName ()
163+
164+ # Issue #215
165+ def test_undo_add_to_group ():
166+ ctx = Mgx3D .getStdContext ()
167+ ctx .clearSession () # Clean the session after the previous test
168+ # Création d'une boite avec une topologie
169+ ctx .getTopoManager ().newBoxWithTopo (Mgx3D .Point (0 , 0 , 0 ), Mgx3D .Point (1 , 1 , 1 ), 10 , 10 , 10 )
170+ # Modifie le groupe BOX
171+ ctx .getGeomManager ().addToGroup (["Vol0000" ], 3 , "BOX" )
172+ # Annulation de : Modifie le groupe BOX
173+ ctx .undo ()
174+ # Hors_Groupe_3D n'est plus détruit après fix de l'issue#215
175+ assert "DETRUIT" not in ctx .getGroupManager ().getInfos ("Hors_Groupe_3D" , 3 )
0 commit comments