示例#1
0
 def unloadData(self):
     self.loaded = False
     self.helixLoaded = False
     self.sheetLoaded = False
     self.helixFileName = ""
     self.sheetFileName = ""
     BaseViewer.unloadData(self)
示例#2
0
 def loadSessionInfo(self, sessionManager, sessionProperties):
     BaseViewer.loadSessionInfo(self, sessionManager, sessionProperties)
            
     isoLevel = sessionManager.getProperty(sessionProperties, self.shortTitle, "ISO_LEVEL")
     self.surfaceEditor.ui.histogram.setLowerValue(isoLevel)
     
     maxIsoLevel = sessionManager.getProperty(sessionProperties, self.shortTitle, "MAX_ISO_LEVEL")
     self.surfaceEditor.ui.histogram.setHigherValue(maxIsoLevel)
     
     samplingInterval = sessionManager.getProperty(sessionProperties, self.shortTitle, "SAMPLING_INTERVAL")
     #self.surfaceEditor.ui.horizontalSliderSampling.setValue(samplingInterval)
             
     useDisplayRadius = sessionManager.getProperty(sessionProperties, self.shortTitle, "USE_DISPLAY_RADIUS")
     self.surfaceEditor.ui.checkBoxUseRadius.setCheckState(useDisplayRadius)
             
     displayRadius = sessionManager.getProperty(sessionProperties, self.shortTitle, "DISPLAY_RADIUS")
     self.surfaceEditor.ui.spinBoxDisplayRadius.setValue(displayRadius)
     
     surfaceViewing = sessionManager.getProperty(sessionProperties, self.shortTitle, "VIEWING_TYPE_SURFACE")
     solidViewing = sessionManager.getProperty(sessionProperties, self.shortTitle, "VIEWING_TYPE_SOLID")
     crossSectionViewing = sessionManager.getProperty(sessionProperties, self.shortTitle, "VIEWING_TYPE_CROSS_SECTION")
     
     self.surfaceEditor.ui.radioButtonIsoSurface.setChecked(surfaceViewing)
     self.surfaceEditor.ui.radioButtonSolid.setChecked(solidViewing)
     self.surfaceEditor.ui.radioButtonCrossSection.setChecked(crossSectionViewing)
示例#3
0
 def unloadData(self):
     #overwriting the function in base viewer
     for chain in self.loadedChains:
         del chain
         chain = None
     self.loadedChains = []
     BaseViewer.unloadData(self)
示例#4
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)
 def emitElementClicked(self, hitStack, event):
     print "emitElementClicked overridden: ", self.title, hitStack
     print "self.displayStyle: ", self.displayStyle
     if (self.displayStyle == self.DisplayStyleRibbon):
         sseData = self.formatRibbonHitstack(hitStack)
         self.emit(QtCore.SIGNAL("ribbonClicked (int, PyQt_PyObject, PyQt_PyObject, QMouseEvent)"), sseData[0], sseData[1], sseData[2], event)
     else:
         BaseViewer.emitElementClicked(self, hitStack, event)
示例#6
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 = []
示例#7
0
 def emitElementMouseOver(self, hitStack, event):
     if (self.displayStyle == self.DisplayStyleRibbon):
         sseData = self.formatRibbonHitstack(hitStack)
         self.emit(
             QtCore.SIGNAL(
                 "ribbonMouseOver (int, PyQt_PyObject, PyQt_PyObject, QMouseEvent)"
             ), sseData[0], sseData[1], sseData[2], event)
     else:
         BaseViewer.emitElementMouseOver(self, hitStack, event)
示例#8
0
 def loadSessionInfo(self, sessionManager, sessionProperties):
     BaseViewer.loadSessionInfo(self, sessionManager, sessionProperties)        
     self.helixLoaded = sessionManager.getProperty(sessionProperties, self.shortTitle, "HELIX_LOADED")
     if self.helixLoaded:
         self.helixFileName = sessionManager.getProperty(sessionProperties, self.shortTitle, "HELIX_FILE")
         self.loadHelixDataFromFile(self.helixFileName)
     self.sheetLoaded = sessionManager.getProperty(sessionProperties, self.shortTitle, "SHEET_LOADED")
     if self.sheetLoaded:
         self.sheetFileName = sessionManager.getProperty(sessionProperties, self.shortTitle, "SHEET_FILE")
         self.loadSheetDataFromFile(self.sheetFileName)
示例#9
0
 def emitElementClicked(self, hitStack, event):
     if (self.app.viewers["calpha"].displayStyle ==
             self.app.viewers["calpha"].DisplayStyleRibbon):
         if (self.app.mainCamera.mouseRightPressed and hitStack[0] == 0):
             self.emit(
                 QtCore.SIGNAL(
                     "SSERightClicked(PyQt_PyObject, PyQt_PyObject, QMouseEvent)"
                 ), hitStack[0], hitStack[1], event)
     else:
         BaseViewer.emitElementClicked(self, hitStack, event)
示例#10
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))    
示例#11
0
 def getSessionInfo(self, sessionManager):
     info = BaseViewer.getSessionInfo(self, sessionManager)  
     info.extend(sessionManager.getRemarkLines(self.shortTitle, "HELIX_LOADED", self.helixLoaded))
     info.extend(sessionManager.getRemarkLines(self.shortTitle, "HELIX_FILE", self.helixFileName))        
     info.extend(sessionManager.getRemarkLines(self.shortTitle, "SHEET_LOADED", self.sheetLoaded))
     info.extend(sessionManager.getRemarkLines(self.shortTitle, "SHEET_FILE", self.sheetFileName))
     return info
示例#12
0
 def getSessionInfo(self, sessionManager):
     info = BaseViewer.getSessionInfo(self, sessionManager)
     info.extend(
         sessionManager.getRemarkLines(
             self.shortTitle, "ISO_LEVEL",
             self.surfaceEditor.ui.histogram.lowerValue()))
     info.extend(
         sessionManager.getRemarkLines(
             self.shortTitle, "MAX_ISO_LEVEL",
             self.surfaceEditor.ui.histogram.higherValue()))
     info.extend(
         sessionManager.getRemarkLines(
             self.shortTitle, "SAMPLING_INTERVAL",
             self.surfaceEditor.getSamplingValue()))
     info.extend(
         sessionManager.getRemarkLines(
             self.shortTitle, "DISPLAY_RADIUS",
             self.surfaceEditor.ui.spinBoxDisplayRadius.value()))
     info.extend(
         sessionManager.getRemarkLines(
             self.shortTitle, "VIEWING_TYPE_SURFACE",
             self.surfaceEditor.ui.radioButtonIsoSurface.isChecked()))
     info.extend(
         sessionManager.getRemarkLines(
             self.shortTitle, "VIEWING_TYPE_SOLID",
             self.surfaceEditor.ui.radioButtonSolid.isChecked()))
     info.extend(
         sessionManager.getRemarkLines(
             self.shortTitle, "VIEWING_TYPE_CROSS_SECTION",
             self.surfaceEditor.ui.radioButtonCrossSection.isChecked()))
     info.extend(
         sessionManager.getRemarkLines(
             self.shortTitle, "USE_DISPLAY_RADIUS",
             self.surfaceEditor.ui.checkBoxUseRadius.checkState()))
     return info
示例#13
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)
示例#14
0
 def clearSelection(self):
     BaseViewer.clearSelection(self)
     self.main_chain.setSelection([], None, None, None)
     self.emitAtomSelectionUpdated(self.main_chain.getSelection())