def __init__(self, parent): # OpenGL Widget setup f = QGLFormat() f.setSampleBuffers(True) f.setVersion(3,3) f.setProfile(QGLFormat.CoreProfile) QGLFormat.setDefaultFormat(f) if not QGLFormat.hasOpenGL(): QMessageBox.information(None, "OpenGL samplebuffers", "This system does not support OpenGL.") sys.exit(0) super(GLWidget, self).__init__(f, parent) self.setFocusPolicy(Qt.StrongFocus) self.list_ = [] self.width = 640.0 self.height = 480.0 self.startTimer(40) self.setWindowTitle("Sample Buffers") self.fov = 60.0 self.deltaTime = 0.0 self.lastFrame = None self.sketching = False self.sketchType = 0 self.sketchPoints = []
from machine_actor import MachineActor from tool_actor import ToolActor from path_cache_actor import PathCacheActor from program_bounds_actor import ProgramBoundsActor from vtk_canon import VTKCanon from linuxcnc_datasource import LinuxCncDataSource LOG = logger.getLogger(__name__) IN_DESIGNER = os.getenv('DESIGNER', False) NUMBER_OF_WCS = 9 # turn on antialiasing from PyQt5.QtOpenGL import QGLFormat f = QGLFormat() f.setSampleBuffers(True) QGLFormat.setDefaultFormat(f) class VTKBackPlot(QVTKRenderWindowInteractor, VCPWidget, BaseBackPlot): def __init__(self, parent=None): super(VTKBackPlot, self).__init__(parent) LOG.debug("---------using refactored vtk code") self._datasource = LinuxCncDataSource() self.parent = parent self.ploter_enabled = True self.touch_enabled = False self.pan_mode = False self.line = None self._last_filename = str()