当前位置: 首页>>代码示例>>Python>>正文


Python debug_prefs.debug_pref函数代码示例

本文整理汇总了Python中utilities.debug_prefs.debug_pref函数的典型用法代码示例。如果您正苦于以下问题:Python debug_pref函数的具体用法?Python debug_pref怎么用?Python debug_pref使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了debug_pref函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _setup_shader_prefs

    def _setup_shader_prefs(self):
        # note: as of bruce 090304 these all should work as same-session prefs,
        # and most of them have been tested that way.

        self.use_sphere_shaders_pref = debug_pref(
            "GLPane: use sphere-shaders?",
            _choices[self.use_sphere_shaders_default],
            non_debug = True,
            prefs_key = self.use_sphere_shaders_prefs_key )

        self.use_cylinder_shaders_pref = debug_pref(
            "GLPane: use cylinder-shaders?",
            _choices[self.use_cylinder_shaders_default],
            non_debug = True,
            prefs_key = self.use_cylinder_shaders_prefs_key )

        self.use_cone_shaders_pref = debug_pref(
            "GLPane: use cone-shaders?",
            _choices[self.use_cone_shaders_default],
            non_debug = True,
            prefs_key = self.use_cone_shaders_prefs_key )

        self.use_batched_primitive_shaders_pref = debug_pref(
            "GLPane: use batched primitive shaders?",
            _choices[ self.use_batched_primitive_shaders_default],
            non_debug = True,
            prefs_key = self.use_batched_primitive_shaders_prefs_key )

        #russ 080403: Added drawing variant selection for unbatched spheres
        # (update, bruce 090304: mainly of historical interest or for testing,
        #  but does matter on older machines that can't use shaders;
        #  could be extended to affect other primitives, but hasn't been
        #  as of 090304)
        variants = [
            "0. OpenGL 1.0 - glBegin/glEnd tri-strips vertex-by-vertex.",
            "1. OpenGL 1.1 - glDrawArrays from CPU RAM.",
            "2. OpenGL 1.1 - glDrawElements indexed arrays from CPU RAM.",
            "3. OpenGL 1.5 - glDrawArrays from graphics RAM VBO.",
            "4. OpenGL 1.5 - glDrawElements, verts in VBO, index in CPU.",
            "5. OpenGL 1.5 - VBO/IBO buffered glDrawElements.",
         ]
        self.use_drawing_variant = debug_pref(
            "GLPane: drawing method (unbatched spheres)",
            Choice(names = variants,
                   values = range(len(variants)),
                   defaultValue = self.use_drawing_variant_default),
            prefs_key = self.use_drawing_variant_prefs_key)
        return
开发者ID:alaindomissy,项目名称:nanoengineer,代码行数:48,代码来源:glprefs.py

示例2: debug_pref_enable_pam_convert_sticky_ends

def debug_pref_enable_pam_convert_sticky_ends(): #bruce 080514; remove when this feature fully works
    res = debug_pref("DNA: ghost bases when converting sticky ends to PAM5?", #bruce 080529 revised text
                     Choice_boolean_True, #bruce 080602 revised default value & prefs_key
                     non_debug = True, #bruce 080529
                     prefs_key = "v1.1/DNA: PAM3+5 make ghost bases for sticky ends?"
                    )
    return res
开发者ID:alaindomissy,项目名称:nanoengineer,代码行数:7,代码来源:GlobalPreferences.py

示例3: debug_pref_remove_ghost_bases_from_pam3

def debug_pref_remove_ghost_bases_from_pam3(): #bruce 080602
    res = debug_pref("DNA: remove ghost bases when converting to PAM3?",
                     Choice_boolean_True, # because they mess up DNA ui ops
                     non_debug = True, # because you should keep them for more accurate repeated Minimize
                     prefs_key = "v1.1/DNA: remove ghost bases when converting to PAM3?"
                    )
    return res
开发者ID:alaindomissy,项目名称:nanoengineer,代码行数:7,代码来源:GlobalPreferences.py

示例4: _show_all_kids_for_debug

 def _show_all_kids_for_debug(self):
     classname_short = self.__class__.__name__.split('.')[-1]
     debug_pref_name = "Model Tree: show content of %s?" % classname_short
         # typical examples (for text searches to find them here):
         # Model Tree: show content of DnaGroup?
         # Model Tree: show content of Block?
     return debug_pref( debug_pref_name, Choice_boolean_False )
开发者ID:elfion,项目名称:nanoengineer,代码行数:7,代码来源:Block.py

示例5: _compute_remake_display_lists_now

    def _compute_remake_display_lists_now(self): #bruce 090224
        """
        [can be overridden in subclasses, but isn't so far]
        """
        # as of 090317, defined and used only in this class
        remake_during_movies = debug_pref(
            "GLPane: remake display lists during movies?",
            Choice_boolean_True,
                # Historically this was hardcoded to False;
                # but I don't know whether it's still a speedup
                # to avoid remaking them (on modern graphics cards),
                # or perhaps a slowdown, so I'm making it optional.
                # Also, when active it will disable shader primitives,
                # forcing use of polygonal primitives instead;
                #### REVIEW whether it makes sense at all in that case.
                # [bruce 090224]
                # update: I'll make it default True, since that's more reliable,
                # and we might not have time to test it.
                # [bruce 090225]
            non_debug = True,
            prefs_key = "v1.2/GLPane: remake display lists during movies?" )

        # whether to actually remake is more complicated -- it depends on self
        # (thumbviews always remake) and on movie_is_playing flag (external).
        remake_during_movies = remake_during_movies or \
                               self._always_remake_during_movies
        remake_now = remake_during_movies or not self._movie_is_playing()
        if remake_now != self._remake_display_lists:
            # (kluge: knows how calling code uses value)
            # leave this in until we've tested the performance of movie playing
            # for both prefs values; it's not verbose
            print "fyi: setting _remake_display_lists = %r" % remake_now
        return remake_now
开发者ID:pmetzger,项目名称:nanoengineer,代码行数:33,代码来源:GLPane_drawingset_methods.py

示例6: pref_MMKit_include_experimental_PAM_atoms

def pref_MMKit_include_experimental_PAM_atoms(): #bruce 080412
    res = debug_pref("MMKit: include experimental PAM atoms (next session)?",
                     Choice_boolean_False,
                         # not on by default, and not visible without ATOM_DEBUG,
                         # since these elements would confuse users
                     prefs_key = "A10/MMKit: include experimental PAM atoms?" )
    return res
开发者ID:alaindomissy,项目名称:nanoengineer,代码行数:7,代码来源:GlobalPreferences.py

示例7: set_Color_Theme_from_pref

def set_Color_Theme_from_pref():
    global COLOR_THEME
    COLOR_THEME = debug_pref("Color Theme (next session)",
                                       _colortheme_Choice,
                                       non_debug = True,
                                       prefs_key = COLOR_THEME_prefs_key)
    return
开发者ID:foulowl,项目名称:nanoengineer,代码行数:7,代码来源:PM_Colors.py

示例8: pref_fix_deprecated_PAM3_atoms

def pref_fix_deprecated_PAM3_atoms():
    res = debug_pref("DNA: fix deprecated PAM3 atoms?",
                     Choice_boolean_True,
                     ## non_debug = True, # disabled, bruce 080317
                     prefs_key = "A10/DNA: fix deprecated PAM3 atoms?", # changed, bruce 080317
                     call_with_new_value = _changed_dna_updater_behavior_pref )
    return res
开发者ID:alaindomissy,项目名称:nanoengineer,代码行数:7,代码来源:dna_updater_prefs.py

示例9: pref_draw_internal_markers

def pref_draw_internal_markers():
    res = debug_pref("DNA: draw internal DnaMarkers?", #bruce 080317 revised text
                     Choice_boolean_False,
                     non_debug = True,
                     prefs_key = "A10/DNA: draw internal markers?", # changed, bruce 080317
                     call_with_new_value = (lambda val: env.mainwindow().glpane.gl_update()) )
    return res
开发者ID:alaindomissy,项目名称:nanoengineer,代码行数:7,代码来源:dna_updater_prefs.py

示例10: pref_dna_updater_convert_to_PAM3plus5

def pref_dna_updater_convert_to_PAM3plus5():
    res = debug_pref("DNA: edit as PAM3+5? ",
                      Choice_boolean_False, # when True, I'll remove the ending space
                      ## non_debug = True,
                      prefs_key = True,
                      call_with_new_value = _changed_dna_updater_behavior_pref )
    return res
开发者ID:alaindomissy,项目名称:nanoengineer,代码行数:7,代码来源:dna_updater_prefs.py

示例11: displist_disabled

 def displist_disabled(self): #070215 split this out, modified it to notice _exprs__warpfuncs
     """
     Is the use of our displist (or of all displists) disabled at the moment?
     """
     return self._disabled or \
            debug_pref("disable DisplayListChunk?", Choice_boolean_False, prefs_key = True) or \
            getattr(self.env.glpane, '_exprs__warpfuncs', None) ###BUG: this will be too inefficient a response for nice dragging.
开发者ID:elfion,项目名称:nanoengineer,代码行数:7,代码来源:DisplayListChunk.py

示例12: pref_fix_bare_PAM5_atoms

def pref_fix_bare_PAM5_atoms():
    res = debug_pref("DNA: fix bare PAM5 atoms?",
                     Choice_boolean_True, # False -> True, 080201
                     ## non_debug = True, # disabled, bruce 080317
                     prefs_key = "A10/DNA: fix bare PAM5 atoms?", # changed, bruce 080317
                     call_with_new_value = _changed_dna_updater_behavior_pref )
    return res
开发者ID:alaindomissy,项目名称:nanoengineer,代码行数:7,代码来源:dna_updater_prefs.py

示例13: _loadTexture

    def _loadTexture(self):
        """
        Load texture data from current image object
        """
        ix, iy, image = self.image_obj.getTextureData() 

        # allocate texture object if never yet done [bruce 060207 revised all related code, to fix bug 1059]
        if self.tex_name is None:
            self.tex_name = glGenTextures(1)
            # note: by experiment (iMac G5 Panther), this returns a single number (1L, 2L, ...), not a list or tuple,
            # but for an argument >1 it returns a list of longs. We depend on this behavior here. [bruce 060207]

        # initialize texture data
        glBindTexture(GL_TEXTURE_2D, self.tex_name)   # 2d texture (x and y size)

        glPixelStorei(GL_UNPACK_ALIGNMENT,1)
        self.have_mipmaps = False
        if debug_pref("smoother tiny textures", Choice_boolean_False, prefs_key = True):
            #bruce 060212 new feature; only takes effect when image is reloaded for some reason (like "load image" button)
            gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGBA, ix, iy, GL_RGBA, GL_UNSIGNED_BYTE, image)
            self.have_mipmaps = True
        else:
            glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, ix, iy, 0, GL_RGBA, GL_UNSIGNED_BYTE, image)
                # 0 is mipmap level, GL_RGBA is internal format, ix, iy is size, 0 is borderwidth,
                # and (GL_RGBA, GL_UNSIGNED_BYTE, image) describe the external image data. [bruce 060212 comment]

        ## self._initTextureEnv() #bruce 060207 do this in draw method, not here
        self.assy.o.gl_update()
        return
开发者ID:ematvey,项目名称:NanoEngineer-1,代码行数:29,代码来源:ESPImage.py

示例14: initTextureEnv

def initTextureEnv(have_mipmaps):
    "have_mipmaps is boolean #doc"
    glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP)
        # [looks like a bug that we overwrite clamp with repeat, just below?
        # bruce 060212 comment]
    glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP)
    glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT)
    glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT)
    if (0 and "kluge" and
        debug_pref("smoother textures", Choice_boolean_False,
                   prefs_key = True)): ###@@@ revise to param
        #bruce 060212 new feature (only visible in debug version so far);
        # ideally it'd be controllable per-jig for side-by-side comparison;
        # also, changing its menu item ought to gl_update but doesn't ##e
        glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR)
        if have_mipmaps: #####@@@@@
            glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,
                            GL_LINEAR_MIPMAP_LINEAR)
        else:
            glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR)
    else:
        glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST)
        glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST)
    glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL)
    return
开发者ID:ematvey,项目名称:NanoEngineer-1,代码行数:25,代码来源:texture_helpers.py

示例15: setupUi

def setupUi(win):
    """
    Populates the "Build Structures" menu, a submenu of the "Tools" menu.

    @param win: NE1's main window object.
    @type  win: Ui_MainWindow
    """
    
    # Populate the "Build Structures" menu. 
    # Start with "Builders", then add single shot "Generators".
    win.buildStructuresMenu.addAction(win.toolsDepositAtomAction)
    win.buildStructuresMenu.addAction(win.buildDnaAction)
    
    #  New Nanotube Builder or old Nanotube Generator?
    if debug_pref("Use new 'Build > Nanotube' builder? (next session)", 
                      Choice_boolean_True, 
                      prefs_key = "A10 devel/Old Nanotube Generator"):
        win.buildStructuresMenu.addAction(win.buildNanotubeAction) 
    else:
        # Original "Build > Nanotube"
        win.buildStructuresMenu.addAction(win.nanotubeGeneratorAction)
        
    win.buildStructuresMenu.addAction(win.toolsCookieCutAction)
    
    win.buildStructuresMenu.addSeparator() # Generators after this separator.
    win.buildStructuresMenu.addAction(win.insertPeptideAction) # piotr 080304
    win.buildStructuresMenu.addAction(win.insertGrapheneAction)
    win.buildStructuresMenu.addAction(win.insertAtomAction)
开发者ID:ematvey,项目名称:NanoEngineer-1,代码行数:28,代码来源:Ui_BuildStructuresMenu.py


注:本文中的utilities.debug_prefs.debug_pref函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。