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


Python BaseModeLogic._setSheet方法代码示例

本文整理汇总了Python中suit.cf.BaseModeLogic._setSheet方法的典型用法代码示例。如果您正苦于以下问题:Python BaseModeLogic._setSheet方法的具体用法?Python BaseModeLogic._setSheet怎么用?Python BaseModeLogic._setSheet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在suit.cf.BaseModeLogic的用法示例。


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

示例1: _setSheet

# 需要导入模块: from suit.cf import BaseModeLogic [as 别名]
# 或者: from suit.cf.BaseModeLogic import _setSheet [as 别名]
 def _setSheet(self, _sheet):
     """Sets sheet for a logic
     """
     BaseModeLogic._setSheet(self, _sheet)
     
     _sheet.eventRootChanged = self._onRootChanged
     _sheet.eventUpdate = self._onUpdate
     
     
     # getting data from content and save to temporary file
     import os
     import suit.core.sc_utils as sc_utils
     
     _addr = _sheet._getScAddr()
     if _addr is None:   return
     
     kernel = Kernel.getSingleton()
     session = kernel.session()
     fmt = sc_utils.getContentFormat(session, _addr)
     assert fmt is not None
     file_name = "%s.%s" %(str(_addr.this), session.get_idtf(fmt).lower())
     
     # saving data to file
     _cont = session.get_content_const(_addr)
     assert _cont is not None
     _cont_data = _cont.convertToCont()
     data = _cont.get_data(_cont_data.d.size)
     
     path = os.path.join(kernel.cache_path, 'video')
     out_file = os.path.join(path, file_name)
     file(out_file, "wb").write(data)
     
     ogre.ResourceGroupManager.getSingleton().initialiseResourceGroup("video")
     self.setVideo(file_name)
开发者ID:Alexandra-H,项目名称:pyUI,代码行数:36,代码来源:video_viewer.py

示例2: _setSheet

# 需要导入模块: from suit.cf import BaseModeLogic [as 别名]
# 或者: from suit.cf.BaseModeLogic import _setSheet [as 别名]
    def _setSheet(self, _sheet):
        BaseModeLogic._setSheet(self, _sheet)
        
        _sheet.eventRootChanged = self._onRoot
        _sheet.eventContentUpdate = self._onContentUpdate
        
        # trying to get data for showing
        import suit.core.sc_utils as sc_utils
        session = core.Kernel.session()
        _addr = _sheet._getScAddr()   
        _fmt = sc_utils.getContentFormat(session, _addr)     
  
        assert _fmt is not None
        
        _cont = session.get_content_const(_addr)
        assert _cont is not None
        
        _cont_data = _cont.convertToCont()
        self.file_addr = _cont_data
        
        _type = session.get_idtf(_fmt).lower()
        global count
        count += 1
        
#        import os, pm.pm
#        self.imageName = os.path.join(env.res_tmp_dir, "%s.jpg" % str(_addr.this))
#        pm.pm.saveContentToFile(self.imageName + "%d.jpg" % count, _cont)

        
#        file(self.imageName + "_", "wb").write(_cont.get_data(_cont_data.d.size))
        
        """data = _cont.get_data(_cont_data.d.size)
开发者ID:Okne,项目名称:ymapostis,代码行数:34,代码来源:yandexmaps_viewer.py

示例3: _setSheet

# 需要导入模块: from suit.cf import BaseModeLogic [as 别名]
# 或者: from suit.cf.BaseModeLogic import _setSheet [as 别名]
 def _setSheet(self, _sheet):
     BaseModeLogic._setSheet(self, _sheet)
     
     _sheet.eventRootChanged = self._onRootChanged
     _sheet.eventContentUpdate = self._onContentUpdate
     
     import suit.core.layout.LayoutGroupForceDirected as layout
     _sheet.setLayoutGroup(layout.LayoutGroupForceSimple())
开发者ID:Plutinsky,项目名称:pyUI,代码行数:10,代码来源:graph_viewer.py

示例4: _setSheet

# 需要导入模块: from suit.cf import BaseModeLogic [as 别名]
# 或者: from suit.cf.BaseModeLogic import _setSheet [as 别名]
    def _setSheet(self, _sheet):
        """Sets sheet that controls by this logic
        """
        BaseModeLogic._setSheet(self, _sheet)

        _sheet.eventContentUpdate = self._onContentUpdate

        self.createTextureAndMaterialNames()
开发者ID:Alexandra-H,项目名称:pyUI,代码行数:10,代码来源:scg_viewer.py

示例5: _setSheet

# 需要导入模块: from suit.cf import BaseModeLogic [as 别名]
# 或者: from suit.cf.BaseModeLogic import _setSheet [as 别名]
 def _setSheet(self, _sheet):
     BaseModeLogic._setSheet(self, _sheet)
     
     _sheet.eventRootChanged = self._onRootChanged
     _sheet.eventUpdate = self._onUpdate
     _sheet.eventObjectUnderMouse = self._getObjectsUnderMouse
     _sheet.eventContentUpdate = self._onContentUpdate
     _sheet.eventHaveChild = self._haveChild
开发者ID:Alexandra-H,项目名称:pyUI,代码行数:10,代码来源:space_viewer.py

示例6: _setSheet

# 需要导入模块: from suit.cf import BaseModeLogic [as 别名]
# 或者: from suit.cf.BaseModeLogic import _setSheet [as 别名]
 def _setSheet(self, _sheet):
     BaseModeLogic._setSheet(self, _sheet)
     
     _sheet.eventRootChanged = self._onRoot
             
     self._createFieldFromContent()                
     self._createMaterial()
     self.rect.setMaterial(self.getMaterialName())
     self._redraw()
开发者ID:Alexandra-H,项目名称:pyUI,代码行数:11,代码来源:map_viewer.py

示例7: _setSheet

# 需要导入模块: from suit.cf import BaseModeLogic [as 别名]
# 或者: from suit.cf.BaseModeLogic import _setSheet [as 别名]
 def _setSheet(self, _sheet):
     # process event to viewer
     self._viewer._setSheet(_sheet)
     
     BaseModeLogic._setSheet(self, _sheet)
     
     #subscribe events
     _sheet.eventRootChanged = self._onRootChanged
     _sheet.eventUpdate = self._onUpdate
开发者ID:Alexandra-H,项目名称:pyUI,代码行数:11,代码来源:chem_editor.py

示例8: _setSheet

# 需要导入模块: from suit.cf import BaseModeLogic [as 别名]
# 或者: from suit.cf.BaseModeLogic import _setSheet [as 别名]
 def _setSheet(self, _sheet):
     """Notification on sheet changed
     
     @param _sheet: new sheet controlled by logic
     @type _sheet: objects.ObjectSheet 
     """
     self._viewer._setSheet(_sheet)
     BaseModeLogic._setSheet(self, _sheet)
     
     _sheet.eventRootChanged = self._onRootChanged
开发者ID:mozhejko,项目名称:pyUI,代码行数:12,代码来源:geom_editor.py

示例9: _setSheet

# 需要导入模块: from suit.cf import BaseModeLogic [as 别名]
# 或者: from suit.cf.BaseModeLogic import _setSheet [as 别名]
 def _setSheet(self, _sheet):
     BaseModeLogic._setSheet(self, _sheet)
     
     _sheet.eventRootChanged = self._onRootChanged
     _sheet.eventUpdate = self._onUpdate 
     
     # go to 3d mode
     #_sheet.changeMode(render_engine.Mode_Perspective)
     import suit.core.layout.LayoutGroupForceDirected as layout
     _sheet.setLayoutGroup(layout.LayoutGroupForceSimple(_gravity = 0.1,
                                                         _repulsion = 3.5,
                                                         _length = 2.0,
                                                         _rigidity = 10.0,
                                                         _step_max = 0.05,
                                                         _step_min = 0.001))
开发者ID:Alexandra-H,项目名称:pyUI,代码行数:17,代码来源:chem_viewer.py

示例10: _setSheet

# 需要导入模块: from suit.cf import BaseModeLogic [as 别名]
# 或者: from suit.cf.BaseModeLogic import _setSheet [as 别名]
    def _setSheet(self, _sheet):
        """Notification about sheet changed for logic
        
        @param _sheet: sheet object logic sets to
        @type _sheet: ObjectSheet  
         
        @attention: this method only for internal usage and calls by 
        ObhectSheet automatically when you set logic for it 
        """
        self.__viewer._setSheet(_sheet)
        BaseModeLogic._setSheet(self, _sheet)

        _sheet.eventUpdateView = self._onUpdateView
        _sheet.eventUpdate = self._onUpdate        
        
        _sheet.eventRootChanged = self._onRootChanged
                
        _sheet.eventSelectionChanged = self._modes[ois.KC_E]._handlerSelChanged
开发者ID:Alexandra-H,项目名称:pyUI,代码行数:20,代码来源:scg_editor.py

示例11: _setSheet

# 需要导入模块: from suit.cf import BaseModeLogic [as 别名]
# 或者: from suit.cf.BaseModeLogic import _setSheet [as 别名]
    def _setSheet(self, _sheet):
        BaseModeLogic._setSheet(self, _sheet)
        
        _sheet.eventRootChanged = self._onRoot
        
        # trying to get data for showing
        import suit.core.sc_utils as sc_utils
        session = core.Kernel.session()
        _addr = _sheet._getScAddr()
        _fmt = sc_utils.getContentFormat(session, _addr)
        assert _fmt is not None
        
        _cont = session.get_content_const(_addr)
        assert _cont is not None
        
        _cont_data = _cont.convertToCont()
        
        _type = session.get_idtf(_fmt).lower()
        global count
        count += 1
        
#        import os, pm.pm
#        self.imageName = os.path.join(env.res_tmp_dir, "%s.jpg" % str(_addr.this))
#        pm.pm.saveContentToFile(self.imageName + "%d.jpg" % count, _cont)

        
#        file(self.imageName + "_", "wb").write(_cont.get_data(_cont_data.d.size))
        
        data = _cont.get_data(_cont_data.d.size)
        stream = ogre.MemoryDataStream("%s" % str(self), _cont_data.d.size, False)
        stream.setData(data)
#     
        try:
            img = ogre.Image()
            img.load(stream, ogre.Image.getFileExtFromMagic(stream))
            self._createTexture(img)
            self._createMaterial()
            self._resizeRect()
        except:
            import sys, traceback
            print "Error:", sys.exc_info()[0]
            traceback.print_exc(file=sys.stdout)
开发者ID:Alexandra-H,项目名称:pyUI,代码行数:44,代码来源:image_viewer.py

示例12: _setSheet

# 需要导入模块: from suit.cf import BaseModeLogic [as 别名]
# 或者: from suit.cf.BaseModeLogic import _setSheet [as 别名]
 def _setSheet(self, _sheet):
     """Sets sheet for a logic
     """
     BaseModeLogic._setSheet(self, _sheet)
     
     _sheet.eventRootChanged = self._onRootChanged
开发者ID:Alexandra-H,项目名称:pyUI,代码行数:8,代码来源:audio_viewer.py

示例13: _setSheet

# 需要导入模块: from suit.cf import BaseModeLogic [as 别名]
# 或者: from suit.cf.BaseModeLogic import _setSheet [as 别名]
 def _setSheet(self, _sheet):
     """Sets sheet that controls by this logic
     """
     BaseModeLogic._setSheet(self, _sheet)
     
     _sheet.eventContentUpdate = self._onContentUpdate
开发者ID:AnastasiaAvramova,项目名称:pyUI,代码行数:8,代码来源:scg_viewer.py

示例14: _setSheet

# 需要导入模块: from suit.cf import BaseModeLogic [as 别名]
# 或者: from suit.cf.BaseModeLogic import _setSheet [as 别名]
 def _setSheet(self, _sheet):
     BaseModeLogic._setSheet(self, _sheet)
     
     _sheet.eventRootChanged = self._onRootChanged
开发者ID:Alexandra-H,项目名称:pyUI,代码行数:6,代码来源:graph_viewer.py


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