为了正常的体验网站,请在浏览器设置里面开启Javascript功能!

Study_VTK_Together03

2013-07-25 9页 ppt 327KB 322阅读

用户头像

is_935719

暂无简介

举报
Study_VTK_Together03nullStudy VTK Together 一起学习VTK水灵 QQ: 348774226 MSN: shuiling119@hotmail.com Study VTK Together 一起学习VTKAll Rights Reserved by 水灵一起学习VTK-第3讲Company Logo一起学习VTK-第3讲VTK Observer/command设计模式 VTK 对象工厂设计模式 这两个内容留到以后再讲。 All Rights Reserved b...
Study_VTK_Together03
nullStudy VTK Together 一起学习VTK水灵 QQ: 348774226 MSN: shuiling119@hotmail.com Study VTK Together 一起学习VTKAll Rights Reserved by 水灵一起学习VTK-第3讲Company Logo一起学习VTK-第3讲VTK Observer/command设计模式 VTK 对象工厂设计模式 这两个内容留到以后再讲。 All Rights Reserved by 水灵这一讲的主要内容: VTK交互类与交互机制(vtkRenderWindowInteractor) VTK里如何改变Actor的属性(vtkProperty) 一起学习VTK-第3讲vtkCameravtkLightvtkActor vtkProperty vtkMappervtkRenderWindowvtkRenderervtkRenderWindowInteractorAll Rights Reserved by 水灵一起学习VTK-第3讲一起学习VTK-第3讲Company Logo一起学习VTK-第3讲VTK交互类与交互机制 vtkRenderWindowInteractor vtkInteractorStyle All Rights Reserved by 水灵 类vtkRenderWindowInteractor被用来获取绘制窗口上发生的鼠标和键盘事件, 然后把这些事件分发到另一个类——vtkInteractorStyle。因此,要增加新的交互方式到VTK里的话,应该先从vtkInteractorStyle派生出一个子类,如:vtkInteractorStyleTrackball, vtkInteractorStyleJoystickActor, vtkInteractorStyleJoystickCamera, vtkInteractorStyleUser等。vtkInteractorStyleUser允许用户自定义交互方式。 一起学习VTK-第3讲Company Logo一起学习VTK-第3讲 实际上,vtkRenderWindowInteractor的工作方式是这样的:这个类会截取 发生在与它关联的vtkRenderWindow(通过vtkRenderWindowInteractor的 SetRenderWindow()方法加入的那个绘制窗口)上的事件,然后, vtkRenderWindowInteractor类会根据具体的设备以及操作系统实例化一个对 象,比如说,Unix下是vtkXRenderWindowInteractor,而Windows下则是 vtkWin32RenderWindowInteractor。当vtkRenderWindowInteractor::Start()方法被调用时,事件的截取功能就会被激活。最后,这些所截取的事件会被送往vtkRenderWindowInteractor::InteractorStyle这个实例进行处理。InteractorStyle是vtkRenderWindowInteractor类里面的一个保护的数据成员,是vtkInteractorObserver类型的指针,而vtkInteractorObserver是被vtkRenderWindowInteractor调用的类,它的作用是监测所发生的事件,这样,由vtkRenderWindowInteractor所截取的消息就有了归宿。 All Rights Reserved by 水灵一起学习VTK-第3讲Company Logo一起学习VTK-第3讲All Rights Reserved by 水灵一起学习VTK-第3讲Company Logo一起学习VTK-第3讲#include "vtkRenderWindowInteractor.h“ #include "vtkInteractorStyleTrackballCamera.h“ vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New(); iren->SetRenderWindow(renWin); vtkInteractorStyleTrackballCamera *style = vtkInteractorStyleTrackballCamera::New(); iren->SetInteractorStyle(style); iren->Initialize(); iren->Start();All Rights Reserved by 水灵一起学习VTK-第3讲Company Logo一起学习VTK-第3讲VTK里如何改变Actor的属性(vtkProperty) #include "vtkProperty.h“ vtkProperty *property = vtkProperty::New(); property->SetColor(1.0, 0.3882, 0.2784); property->SetDiffuse(0.7); property->SetSpecular(0.4); property->SetSpecularPower(20); actor->SetProperty(property);All Rights Reserved by 水灵一起学习VTK-第4讲(预告)Company Logo一起学习VTK-第4讲(预告)vtkCamera vtkLight All Rights Reserved by 水灵
/
本文档为【Study_VTK_Together03】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。 本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。 网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。

历史搜索

    清空历史搜索