Exemplo n.º 1
0
    def __init__(self, main, parent=None):
        BaseViewer.__init__(self, main, parent)
        self.title = "Skeleton"
        self.shortTitle = "SKE"
        self.app.themes.addDefaultRGB("Skeleton:Model:0", 180, 0, 0, 255)
        self.app.themes.addDefaultRGB("Skeleton:Model:1", 200, 150, 0, 255)
        self.app.themes.addDefaultRGB("Skeleton:Model:2", 0, 0, 0, 255)
        self.app.themes.addDefaultRGB("Skeleton:BoundingBox", 255, 255, 255,
                                      255)
        self.isClosedMesh = False
        self.twoWayLighting = True
        self.lineThickness = 3
        self.renderer = MeshRenderer()
        self.renderer.setLineThickness(self.lineThickness)
        self.createUI()
        self.app.viewers["skeleton"] = self
        self.volumeViewer = self.app.viewers["volume"]
        self.initVisualizationOptions(ModelVisualizationForm(self.app, self))
        self.visualizationOptions.ui.spinBoxThickness.setValue(
            self.lineThickness)
        self.visualizationOptions.ui.spinBoxThickness.setVisible(True)
        self.visualizationOptions.ui.labelThickness.setVisible(True)

        self.model2Visible = True
        self.model3Visible = True
        self.visualizationOptions.ui.checkBoxModelVisible.setText(
            "Show curves colored:")
        self.visualizationOptions.ui.checkBoxModel2Visible.setText(
            "Show surfaces colored:")
        self.visualizationOptions.ui.checkBoxModel2Visible.setVisible(True)
        self.visualizationOptions.ui.pushButtonModel2Color.setVisible(True)
        self.visualizationOptions.ui.checkBoxModel3Visible.setText(
            "Show surface borders:")
        self.visualizationOptions.ui.checkBoxModel3Visible.setVisible(True)
        self.visualizationOptions.ui.pushButtonModel3Color.setVisible(True)
Exemplo n.º 2
0
    def __init__(self, main, parent=None):
        BaseViewer.__init__(self, main, parent)
        self.title = "Secondary Structure Element"
        self.shortTitle = "SSE"
        self.app.themes.addDefaultRGB("Secondary Structure Element:Model:0", 0,
                                      180, 0, 255)
        self.app.themes.addDefaultRGB("Secondary Structure Element:Model:1",
                                      120, 185, 255, 255)
        self.app.themes.addDefaultRGB("Secondary Structure Element:Model:2",
                                      120, 185, 255, 255)
        self.app.themes.addDefaultRGB(
            "Secondary Structure Element:BoundingBox", 255, 255, 255, 255)
        self.isClosedMesh = False
        self.helixFileName = ""
        self.sheetFileName = ""
        self.currentMatch = None
        self.showBox = False
        self.helixLoaded = False
        self.sheetLoaded = False
        self.renderer = SSERenderer()
        self.correspondenceEngine = SSECorrespondenceEngine()
        self.createUI()
        self.selectEnabled = True
        self.app.viewers["sse"] = self
        self.model2Visible = True
        self.model3Visible = False
        self.initVisualizationOptions(ModelVisualizationForm(self.app, self))
        self.visualizationOptions.ui.checkBoxModelVisible.setText(
            "Show helices colored:")
        self.visualizationOptions.ui.checkBoxModel2Visible.setText(
            "Show sheets colored:")
        self.visualizationOptions.ui.checkBoxModel2Visible.setVisible(True)
        self.visualizationOptions.ui.pushButtonModel2Color.setVisible(True)
        self.visualizationOptions.ui.checkBoxModel3Visible.setText(
            "Show skeleton sheets colored:")
        self.visualizationOptions.ui.checkBoxModel3Visible.setVisible(False)
        self.visualizationOptions.ui.pushButtonModel3Color.setVisible(False)

        self.connect(
            self,
            QtCore.SIGNAL(
                'elementSelected (int, int, int, int, int, int, QMouseEvent)'),
            self.updateCurrentMatch)

        self.connect(self.app.viewers["volume"],
                     QtCore.SIGNAL('modelLoaded()'),
                     self.updateActionsAndMenus)
        self.connect(self.app.viewers["volume"],
                     QtCore.SIGNAL('modelUnloaded()'),
                     self.updateActionsAndMenus)
        self.connect(self, QtCore.SIGNAL('modelLoaded()'),
                     self.updateActionsAndMenus)
        self.connect(self, QtCore.SIGNAL('modelUnloaded()'),
                     self.updateActionsAndMenus)

        self.selectedObjects = []
        self.correspondences = []
Exemplo n.º 3
0
 def __init__(self, main, parent=None):
     BaseViewer.__init__(self, main, parent)
     self.title = "Volume"    
     self.shortTitle = "VOL"
     self.app.themes.addDefaultRGB("Volume:Model:0", 180, 180, 180, 150) #rgba color: default alpha used to be 255 for opaque
     self.app.themes.addDefaultRGB("Volume:Model:1", 180, 180, 180, 150)
     self.app.themes.addDefaultRGB("Volume:Model:2", 180, 180, 180, 150)
     self.app.themes.addDefaultRGB("Volume:BoundingBox", 255, 255, 255, 255)                         
     self.renderer = VolumeRenderer()          
     self.loaded = False
     self.createUI()
     self.app.viewers["volume"] = self
     self.initVisualizationOptions(ModelVisualizationForm(self.app, self))    
Exemplo n.º 4
0
    def __init__(self, main, parent=None):
        BaseViewer.__init__(self, main, parent)
        self.title = "C-Alpha"
        self.shortTitle = "CAL"
        self.app.themes.addDefaultRGB("C-Alpha:Atom", 170, 170, 0, 255)
        self.app.themes.addDefaultRGB("C-Alpha:Bond", 120, 120, 170, 255)
        self.app.themes.addDefaultRGB("C-Alpha:Helix", 0, 255, 0, 255)
        self.app.themes.addDefaultRGB("C-Alpha:Strand", 128, 255, 255, 255)
        self.app.themes.addDefaultRGB("C-Alpha:Loop", 255, 128, 0, 255)
        self.app.themes.addDefaultRGB("C-Alpha:Carbon", 200, 200, 200, 255)
        self.app.themes.addDefaultRGB("C-Alpha:Nitrogen", 0, 0, 255, 255)
        self.app.themes.addDefaultRGB("C-Alpha:Oxygen", 255, 0, 0, 255)
        self.app.themes.addDefaultRGB("C-Alpha:Sulphur", 255, 255, 0, 255)
        self.app.themes.addDefaultRGB("C-Alpha:BoundingBox", 255, 255, 255,
                                      255)
        self.isClosedMesh = False
        self.centerOnRMB = True
        self.selectEnabled = True
        self.renderer = CAlphaRenderer()
        self.displayStyle = self.DisplayStyleBackbone
        self.renderer.setDisplayStyle(self.displayStyle)
        self.main_chain = Chain('', self.app)
        self.structPred = None
        self.createUI()
        self.app.viewers["calpha"] = self
        self.atomsVisible = True
        self.bondsVisible = True
        self.helicesVisible = True
        self.strandsVisible = True
        self.loopsVisible = True
        #self.interpSegments = 10 # the number of segments interpolated per calpha atom when rendering ribbon diagrams
        #self.ribbonSlices = 10 # the number of slices used to render each segment of a ribbon diagram
        self.initVisualizationOptions(AtomVisualizationForm(self.app, self))
        self.loadedChains = []
        self.ribbonMouseMapping = {}
        self.ribbonMouseMapping[0] = {}
        self.ribbonMouseMapping[1] = {}
        self.ribbonMouseMapping[2] = {}

        #self.connect(self, QtCore.SIGNAL("elementSelected (int, int, int, int, int, int, QMouseEvent)"), self.centerOnSelectedAtoms)
        self.connect(
            self,
            QtCore.SIGNAL(
                "elementClicked (int, int, int, int, int, int, QMouseEvent)"),
            self.processElementClick)