/usr/lib/python2.7/dist-packages/PyMca/Object3D/Object3DPlugins/Object3DMeshConfig.py is in pymca 4.7.1+dfsg-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | try:
from PyMca.Object3D import Object3DQt as qt
from PyMca.Object3D import Object3DPrivateConfig
from PyMca.Object3D import PrivateConfigTools
from PyMca.Object3D.HorizontalSpacer import HorizontalSpacer
from PyMca.Object3D.VerticalSpacer import VerticalSpacer
except ImportError:
from Object3D import Object3DQt as qt
from Object3D import Object3DPrivateConfig
from Object3D import PrivateConfigTools
from Object3D.HorizontalSpacer import HorizontalSpacer
from Object3D.VerticalSpacer import VerticalSpacer
import weakref
DEBUG = 0
class Object3DMeshConfig(Object3DPrivateConfig.Object3DPrivateConfig):
def __init__(self, parent = None, name=""):
Object3DPrivateConfig.Object3DPrivateConfig.__init__(self, parent, name)
self._configuration = {}
self._configuration['widget'] = weakref.proxy(self)
def build(self):
self.mainLayout = qt.QGridLayout(self)
self.mainLayout.setMargin(4)
self.mainLayout.setSpacing(4)
#info
self.infoLabel = PrivateConfigTools.InfoLabel(self)
#color filtering
self.colorFilter = PrivateConfigTools.ColorFilter(self)
self.connect(self.colorFilter,
qt.SIGNAL('ColorFilterSignal'),
self.updateCallBack)
#value filtering
self.valueFilter = PrivateConfigTools.ValueFilter(self)
#isosurfaces
self.isosurfaces = PrivateConfigTools.Isosurfaces(self)
#actions
self.updateButton = qt.QPushButton(self)
self.updateButton.setText("Update")
self.updateButton.setAutoDefault(False)
#self.mainLayout.addWidget(HorizontalSpacer(self), 0, 0)
self.mainLayout.addWidget(self.infoLabel, 0, 0, 1, 4)
#self.mainLayout.addWidget(HorizontalSpacer(self), 0, 2)
self.mainLayout.addWidget(self.colorFilter, 1, 0)
self.mainLayout.addWidget(self.valueFilter, 1, 1)
self.mainLayout.addWidget(self.isosurfaces, 1, 2)
self.mainLayout.addWidget(HorizontalSpacer(self), 2, 0)
self.mainLayout.addWidget(self.updateButton, 2, 1)
self.mainLayout.addWidget(HorizontalSpacer(self), 2, 3)
self.mainLayout.addWidget(VerticalSpacer(self), 3, 0)
#connect
self.connect(self.colorFilter,
qt.SIGNAL('ColorFilterSignal'),
self.updateCallBack)
self.connect(self.updateButton,
qt.SIGNAL('clicked()'),
self.updateCallBack)
def setParameters(self, ddict):
#if ddict.has_key('widget'):
# del ddict['widget']
self._configuration.update(ddict)
self._updateWidget()
return True
def _updateWidget(self):
self.infoLabel.setParameters(self._configuration)
self.colorFilter.setParameters(self._configuration)
self.valueFilter.setParameters(self._configuration)
self.isosurfaces.setParameters(self._configuration)
return
def getParameters(self):
self._configuration.update(self.infoLabel.getParameters())
self._configuration.update(self.colorFilter.getParameters())
self._configuration.update(self.valueFilter.getParameters())
self._configuration.update(self.isosurfaces.getParameters())
return self._configuration
if __name__ == "__main__":
import sys
app = qt.QApplication(sys.argv)
def myslot():
print "Callback called"
w = Object3DMeshConfig()
w.setCallBack(myslot)
w.show()
app.exec_()
|