示例#1
0
    def _loadGroupBox1(self, pmGroupBox):
        """
        Load widgets in group box.
        """

        #stereoSettingsGroupBox = PM_GroupBox( None )

        self.stereoEnabledCheckBox = \
            PM_CheckBox(pmGroupBox,
                        text         = 'Enable Stereo View',
                        widgetColumn = 1
                        )

        stereoModeChoices = [
            'Relaxed view', 'Cross-eyed view', 'Red/blue anaglyphs',
            'Red/cyan anaglyphs', 'Red/green anaglyphs'
        ]

        self.stereoModeComboBox  = \
            PM_ComboBox( pmGroupBox,
                         label         =  "Stereo Mode:",
                         choices       =  stereoModeChoices,
                         setAsDefault  =  True)

        self.stereoModeComboBox.setCurrentIndex(
            env.prefs[stereoViewMode_prefs_key] - 1)

        self.stereoSeparationSlider =  \
            PM_Slider( pmGroupBox,
                       currentValue = 50,
                       minimum      = 0,
                       maximum      = 300,
                       label        = 'Separation'
                       )

        self.stereoSeparationSlider.setValue(
            env.prefs[stereoViewSeparation_prefs_key])

        self.stereoAngleSlider =  \
            PM_Slider( pmGroupBox,
                       currentValue = 50,
                       minimum      = 0,
                       maximum      = 100,
                       label        = 'Angle'
                       )

        self.stereoAngleSlider.setValue(env.prefs[stereoViewAngle_prefs_key])

        self._updateWidgets()
    def _loadProductSpecsGroupBox(self, inPmGroupBox):
        """
        Load widgets in the Product specifications group box.
        @param inPmGroupBox: The roduct specifications box in the PM
        @type  inPmGroupBox: L{PM_GroupBox}
        """

        productChoices = ['Rod', 'Ring']

        self.extrude_productTypeComboBox = \
            PM_ComboBox( inPmGroupBox,
                         label        = 'Final product:',
                         labelColumn  = 0,
                         choices      = productChoices,
                         index        = 0,
                         setAsDefault = True,
                         spanWidth    = False )

        # names used in the code, same order
        #if you comment out items from combobox, you also have to remove them
        # from this list unless they are at the end!!!
        self.extrude_productTypeComboBox_ptypes = ["straight rod", \
                                                   "closed ring", \
                                                   "corkscrew"]

        self.extrudeSpinBox_n = \
            PM_SpinBox( inPmGroupBox,
                        label         =  "Number of copies:",
                        labelColumn   =  0,
                        value         =  3,
                        minimum       =  1,
                        maximum       =  99
                    )
        #@WARNING: This method initializes some instance varaiables for various
        #checkboxes. (Example: self.mergeCopiesCheckBox.default = False).
        #These values are needed in extrudemode.py. This
        #won't be needed once extrudeMode.py is cleaned up. -- ninad 2007-09-10

        self.extrudeBondCriterionSlider =  \
            PM_Slider( inPmGroupBox,
                       currentValue = 100,
                       minimum      = 0,
                       maximum      = 300,
                       label        = 'Tolerence'
                   )
        self.extrudeBondCriterionLabel = \
            self.extrudeBondCriterionSlider.labelWidget

        self.extrudeBondCriterionSlider_dflt = 100
        self.extrudeBondCriterionSlider.setPageStep(5)

        self.makeBondsCheckBox = \
            PM_CheckBox(inPmGroupBox,
                        text         = 'Make bonds' ,
                        widgetColumn = 0,
                        state        = Qt.Checked
                    )
        self.makeBondsCheckBox.default = True
        self.makeBondsCheckBox.attr = 'whendone_make_bonds'
        self.makeBondsCheckBox.repaintQ = False
 def _loadFuseOptionsGroupBox(self, inPmGroupBox):
     """
     Load the widgets inside the Fuse Options groupbox.
     """
     
     #@ Warning: If you change fuseChoices, you must also change the
     #  constants MAKEBONDS and FUSEATOMS in FuseChunks_Command.py.
     #  This implementation is fragile and should be fixed. Mark 2008-07-16
     
     fuseChoices = ['Make bonds between chunks', 
                    'Fuse overlapping atoms']
     
     self.fuseComboBox = \
         PM_ComboBox( inPmGroupBox,
                      label        = '', 
                      choices      = fuseChoices, 
                      index        = 0, 
                      setAsDefault = False,
                      spanWidth    = True)
     
     self.connect(self.fuseComboBox, 
                  SIGNAL("activated(const QString&)"), 
                  self.parentMode.change_fuse_mode)
     
     self.fusePushButton = PM_PushButton( inPmGroupBox,
                                          label     = "",
                                          text      = "Make Bonds",
                                          spanWidth = True )
     
     self.connect( self.fusePushButton,
                   SIGNAL("clicked()"),
                   self.parentMode.fuse_something)
     
     self.toleranceSlider =  PM_Slider( inPmGroupBox,
                                        currentValue = 100,
                                        minimum      = 0,
                                        maximum      = 300,
                                        label        = \
                                        'Tolerance:100% => 0 bondable pairs'
                                      )
     self.connect(self.toleranceSlider,
                    SIGNAL("valueChanged(int)"),
                    self.parentMode.tolerance_changed)
     
     self.mergeChunksCheckBox = PM_CheckBox( inPmGroupBox,
                                             text         = 'Merge chunks',
                                             widgetColumn = 0,
                                             state        = Qt.Checked )
 def _loadMovieControlsGroupBox(self, inPmGroupBox):
     """
     Load widgets in the Movie Controls group box.
     @param inPmGroupBox: The Movie Controls groupbox in the PM
     @type  inPmGroupBox: L{PM_GroupBox} 
     """
     #Movie Slider
     self.frameNumberSlider = \
         PM_Slider( inPmGroupBox,
                    currentValue = 0,
                    minimum      = 0,
                    maximum      = 999999,
                    label        = 'Current Frame: 0/900'
                  )
     
     self.movieFrameUpdateLabel = self.frameNumberSlider.labelWidget
     
     #Movie Controls
     
     self.movieButtonsToolBar = NE1ToolBar(inPmGroupBox)
     
     _movieActionList = [self.movieResetAction,
                         self.moviePlayRevActiveAction,
                         self.moviePlayRevAction,
                         self.moviePauseAction,
                         self.moviePlayAction,
                         self.moviePlayActiveAction,
                         self.movieMoveToEndAction
                         ]
     
     for _action in _movieActionList:
         self.movieButtonsToolBar.addAction(_action)
             
     self.moviePlayActiveAction.setVisible(0)
     self.moviePlayRevActiveAction.setVisible(0)
     
     WIDGET_LIST = [("PM_", self.movieButtonsToolBar, 0)]
     
     self.moviecontrolsWidgetRow = PM_WidgetRow(inPmGroupBox, 
                                                widgetList = WIDGET_LIST,
                                                spanWidth = True)
     
     self.movieLoop_checkbox = PM_CheckBox(inPmGroupBox,
                                           text = "Loop",
                                           widgetColumn = 0,
                                           state = Qt.Unchecked)