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


Python QtViewer.add_post_processing方法代码示例

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


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

示例1: test_ball_and_stick_renderer

# 需要导入模块: from chemlab.graphics.qtviewer import QtViewer [as 别名]
# 或者: from chemlab.graphics.qtviewer.QtViewer import add_post_processing [as 别名]
def test_ball_and_stick_renderer():
    from collections import defaultdict
    from chemlab.io import datafile
    from chemlab.db.cirdb import CirDB
    
    v = QtViewer()
    v.add_post_processing(SSAOEffect, kernel_radius = 0.15)
    
    #v.widget.background_color = black
    #mol = Molecule([Atom("O", [-0.499, 0.249, 0.0]),
    #                Atom("H", [-0.402, 0.249, 0.0]),
    #                Atom("H", [-0.532, 0.198, 0.10])])
    
    #mol.bonds = np.array([[0, 1],[0, 2]])
    
    #mol = CirDB().get("molecule", "moronic acid")
    mol = datafile('tests/data/3ZJE.pdb').read('molecule')
    mol.bonds = find_bonds(mol)
    
    ar = v.add_renderer(BallAndStickRenderer, mol.r_array, mol.type_array, mol.bonds)

    
    # Try without bonds
    # ar2 = v.add_renderer(BallAndStickRenderer, mol.r_array + 0.5, mol.type_array, np.array([]))
    
    v.run()
开发者ID:,项目名称:,代码行数:28,代码来源:

示例2: test_ball_and_stick_renderer

# 需要导入模块: from chemlab.graphics.qtviewer import QtViewer [as 别名]
# 或者: from chemlab.graphics.qtviewer.QtViewer import add_post_processing [as 别名]
def test_ball_and_stick_renderer():


    v = QtViewer()
    v.add_post_processing(SSAOEffect, kernel_radius = 0.15)
    
    mol = datafile('tests/data/3ZJE.pdb').read('molecule')
    mol.bonds = find_bonds(mol)

    ar = v.add_renderer(BallAndStickRenderer, mol.r_array, mol.type_array, mol.bonds)
    # ar2 = v.add_renderer(BallAndStickRenderer, mol.r_array + 0.5, mol.type_array, np.array([]))

    v.run()
开发者ID:B-Rich,项目名称:chemlab,代码行数:15,代码来源:test_graphics.py

示例3: test_gamma

# 需要导入模块: from chemlab.graphics.qtviewer import QtViewer [as 别名]
# 或者: from chemlab.graphics.qtviewer.QtViewer import add_post_processing [as 别名]
def test_gamma():
    cdb = ChemlabDB()

    mol = datafile('tests/data/3ZJE.pdb').read('system')
    v = QtViewer()

    v.widget.camera.autozoom(mol.r_array)
    v.widget.camera.orbit_y(3.14/3)
    sr = v.add_renderer(AtomRenderer, mol.r_array, mol.type_array,
                        'impostors', shading='phong')

    v.add_post_processing(SSAOEffect, ssao_power=4.0)
    v.add_post_processing(GammaCorrectionEffect)
    v.run()
开发者ID:B-Rich,项目名称:chemlab,代码行数:16,代码来源:test_graphics.py

示例4: test_multiple_post_processing

# 需要导入模块: from chemlab.graphics.qtviewer import QtViewer [as 别名]
# 或者: from chemlab.graphics.qtviewer.QtViewer import add_post_processing [as 别名]
def test_multiple_post_processing():
    v = QtViewer()
    cdb = ChemlabDB()
    mol = cdb.get('molecule', 'example.norbornene')
    #mol = datafile('/home/gabriele/projects/LiCl/interface/loafintjc-heat/equilibrium.gro').read('system')
    sr = v.add_renderer(AtomRenderer, mol.r_array, mol.type_array, 'impostors', shading='toon')

    # Adding multiple post processing effects


    v.add_post_processing(SSAOEffect)
    v.add_post_processing(GammaCorrectionEffect, 2.0)
    #v.add_post_processing(GammaCorrectionEffect, 2.0)
    #v.add_post_processing(FXAAEffect)

    v.run()
开发者ID:B-Rich,项目名称:chemlab,代码行数:18,代码来源:test_graphics.py

示例5: test_glow

# 需要导入模块: from chemlab.graphics.qtviewer import QtViewer [as 别名]
# 或者: from chemlab.graphics.qtviewer.QtViewer import add_post_processing [as 别名]
def test_glow():
    from PySide import QtCore
    
    cdb = ChemlabDB()
    mol = cdb.get('molecule', 'example.norbornene')
    
    v = QtViewer()
    colors = np.array([(255, 0, 0, 255)]*mol.n_atoms)
    colors[0][3] = 0

    v.widget.camera.autozoom(mol.r_array)
    sr = v.add_renderer(SphereImpostorRenderer, mol.r_array, [0.1]*mol.n_atoms,
                        colors)

    ge = v.add_post_processing(GlowEffect)
    #v.add_post_processing(GammaCorrectionEffect)
    def changeglow():
        #ge.radius = np.sin(time.time()*10.0) + 2.5
        colors[0][3] = 255 * (np.sin(time.time()*10.0)*0.5 + 0.5)
        sr.update_colors(colors)
        v.widget.update()

    timer = QtCore.QTimer()
    timer.timeout.connect(changeglow)
    timer.start(10)
    v.run()
开发者ID:B-Rich,项目名称:chemlab,代码行数:28,代码来源:test_graphics.py

示例6: test_glow

# 需要导入模块: from chemlab.graphics.qtviewer import QtViewer [as 别名]
# 或者: from chemlab.graphics.qtviewer.QtViewer import add_post_processing [as 别名]
def test_glow():
    from chemlab.db import ChemlabDB, CirDB
    from chemlab.io import datafile
    from chemlab.graphics.postprocessing.glow import GlowEffect
    from PySide import QtCore

    cdb = ChemlabDB()
    mol = cdb.get('molecule', 'example.norbornene')
    #mol = datafile('tests/data/3ZJE.pdb').read('system')

    v = QtViewer()

    colors = np.array([(255, 0, 0, 255)]*mol.n_atoms)
    colors[0][3] = 0

    v.widget.camera.autozoom(mol.r_array)
    sr = v.add_renderer(SphereImpostorRenderer, mol.r_array, [0.1]*mol.n_atoms,
                        colors)

    ge = v.add_post_processing(GlowEffect)
    #v.add_post_processing(GammaCorrectionEffect)
    def changeglow():
        #ge.radius = np.sin(time.time()*10.0) + 2.5
        colors[0][3] = 255 * (np.sin(time.time()*10.0)*0.5 + 0.5)
        sr.update_colors(colors)
        v.widget.update()

    timer = QtCore.QTimer()
    timer.timeout.connect(changeglow)
    timer.start(10)
    #v.add_post_processing(SSAOEffect, ssao_power = 5.0)
    #v.add_post_processing(FXAAEffect)
    #v.add_post_processing(GammaCorrectionEffect)
    v.run()
开发者ID:yotama9,项目名称:chemlab,代码行数:36,代码来源:test_graphics.py

示例7: test_offline

# 需要导入模块: from chemlab.graphics.qtviewer import QtViewer [as 别名]
# 或者: from chemlab.graphics.qtviewer.QtViewer import add_post_processing [as 别名]
def test_offline():
    # Api for PNG saving
    v = QtViewer()
    mol = cdb.get('molecule', 'example.norbornene')
    sr = v.add_renderer(AtomRenderer, mol.r_array, mol.type_array, 'impostors', shading='toon')
    v.add_post_processing(SSAOEffect, kernel_size=128)
    v.add_post_processing(FXAAEffect)
    ne = v.add_post_processing(NoEffect)
    
    v.widget.camera.autozoom(mol.r_array)
    
    def dump():
        image = v.widget.toimage(2048, 2048)
        image.save("/tmp/hello.png")
        os.system("eog /tmp/hello.png")        
        
    from PySide.QtCore import Qt
    v.key_actions[Qt.Key_A] = dump
    
    v.run()
开发者ID:B-Rich,项目名称:chemlab,代码行数:22,代码来源:test_graphics.py

示例8: test_glow

# 需要导入模块: from chemlab.graphics.qtviewer import QtViewer [as 别名]
# 或者: from chemlab.graphics.qtviewer.QtViewer import add_post_processing [as 别名]
def test_glow():
    from chemlab.db import ChemlabDB, CirDB
    from chemlab.io import datafile
    from chemlab.graphics.postprocessing.glow import GlowEffect
    
    cdb = ChemlabDB()
    mol = cdb.get('molecule', 'example.norbornene')
    #mol = datafile('tests/data/3ZJE.pdb').read('system')

    v = QtViewer()

    colors = np.array([(255, 0, 0, 255)]*mol.n_atoms)
    colors[0][3] = 0
    
    v.widget.camera.autozoom(mol.r_array)
    sr = v.add_renderer(SphereImpostorRenderer, mol.r_array, [0.1]*mol.n_atoms,
                        colors)
    
    v.add_post_processing(GlowEffect)
    #v.add_post_processing(SSAOEffect, ssao_power = 5.0)
    #v.add_post_processing(FXAAEffect)
    #v.add_post_processing(GammaCorrectionEffect)
    v.run()
开发者ID:,项目名称:,代码行数:25,代码来源:

示例9: test_outline

# 需要导入模块: from chemlab.graphics.qtviewer import QtViewer [as 别名]
# 或者: from chemlab.graphics.qtviewer.QtViewer import add_post_processing [as 别名]
def test_outline():

    mol = cdb.get('molecule', 'example.norbornene')

    mol = datafile('tests/data/3ZJE.pdb').read('system')
    #mol = datafile('tests/data/water.gro').read('system')
    #mol = datafile('tests/data/benzene.mol').read('molecule')
    v = QtViewer()

    v.widget.camera.autozoom(mol.r_array)
    sr = v.add_renderer(AtomRenderer, mol.r_array, mol.type_array,
                        'impostors', shading='toon')

    v.add_post_processing(OutlineEffect, 'depthnormal')
    v.add_post_processing(SSAOEffect, ssao_power=4.0)
    v.add_post_processing(FXAAEffect)
    v.add_post_processing(GammaCorrectionEffect)
    v.run()
开发者ID:B-Rich,项目名称:chemlab,代码行数:20,代码来源:test_graphics.py

示例10: test_outline

# 需要导入模块: from chemlab.graphics.qtviewer import QtViewer [as 别名]
# 或者: from chemlab.graphics.qtviewer.QtViewer import add_post_processing [as 别名]
def test_outline():
    from chemlab.db import ChemlabDB, CirDB
    from chemlab.io import datafile
    from chemlab.graphics.postprocessing.outline import OutlineEffect
    
    cdb = ChemlabDB()
    mol = cdb.get('molecule', 'example.norbornene')
    
    mol = datafile('tests/data/3ZJE.pdb').read('system')
    #mol = datafile('tests/data/water.gro').read('system')
    #mol = datafile('tests/data/benzene.mol').read('molecule')
    v = QtViewer()

    v.widget.camera.autozoom(mol.r_array)
    sr = v.add_renderer(AtomRenderer, mol.r_array, mol.type_array,
                        'impostors', shading='toon')
    
    v.add_post_processing(OutlineEffect, 'depthonly')
    v.add_post_processing(FXAAEffect)
    v.add_post_processing(GammaCorrectionEffect)
    v.run()
开发者ID:,项目名称:,代码行数:23,代码来源:


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