22
33import os
44import sys
5- from OCC .Core .BRepPrimAPI import (
6- BRepPrimAPI_MakeBox ,
7- BRepPrimAPI_MakeSphere )
5+ from OCC .Core .BRepPrimAPI import BRepPrimAPI_MakeBox , BRepPrimAPI_MakeSphere
86from OCC .Core .gp import gp_Pnt
97from OCC .Core .AIS import AIS_Manipulator
108from OCC .Extend .LayerManager import Layer
119
1210from OCC .Display .backend import load_backend
11+
1312load_backend ("qt-pyqt5" )
1413import OCC .Display .qtDisplay as qtDisplay
1514
2322 QVBoxLayout ,
2423)
2524
25+
2626class App (QDialog ):
2727 def __init__ (self ):
2828 super ().__init__ ()
@@ -86,7 +86,10 @@ def activate_manipulator(self):
8686 selected = self .display .GetSelectedShape ()
8787 if selected is not None :
8888 # retrieve the AIS_Shape from the selected TopoDS_Shape
89- self .ais_element_manip , self .index_element_manip = self .layer .get_aisshape_from_topodsshape (selected )
89+ (
90+ self .ais_element_manip ,
91+ self .index_element_manip ,
92+ ) = self .layer .get_aisshape_from_topodsshape (selected )
9093 self .shape_element_manip = selected
9194 # Create and attach a Manipulator to AIS_Shape
9295 self .manip = AIS_Manipulator ()
@@ -100,8 +103,10 @@ def activate_manipulator(self):
100103 # Get the transformations done with the manipulator
101104 trsf = self .canvas .get_trsf_from_manip ()
102105 # Apply the transformation to the TopoDS_Shape and replace it in the layer
103- self .layer .update_trsf_shape (self .shape_element_manip , self .index_element_manip , trsf )
104- self .manip .Detach ()
106+ self .layer .update_trsf_shape (
107+ self .shape_element_manip , self .index_element_manip , trsf
108+ )
109+ self .manip .Detach ()
105110
106111
107112if __name__ == "__main__" :
0 commit comments