当前位置: 首页 > news >正文

k68威客网宁波seo免费优化软件

k68威客网,宁波seo免费优化软件,怎么用手机创建网站,开源购物系统开发环境: Windows 11 家庭中文版Microsoft Visual Studio Community 2019VTK-9.3.0.rc0vtk-example参考代码目的:学习与总结 demo解决问题:通过自定义vtkInteractorStyle类中成员函数OnLeftButtonDown,判断鼠标当前选中的是哪个…

开发环境:

  1. Windows 11 家庭中文版
  2. Microsoft Visual Studio Community 2019
  3. VTK-9.3.0.rc0
  4. vtk-example
  5. 参考代码
  6. 目的:学习与总结

demo解决问题:通过自定义vtkInteractorStyle类中成员函数OnLeftButtonDown,判断鼠标当前选中的是哪个actor;同理可自定义鼠标右键、滚轮、键盘等事件
关键类:vtkInteractorStyleTrackballActor允许用户与场景中彼此独立的对象进行交互(旋转、平移等);根据实际应用场景有如下常见替换对象:

vtkInteractorStyleTrackballActor作用对象:actor; 形式:Trackball
vtkInteractorStyleTrackballCamera作用对象:Camera; 形式:Trackball
vtkInteractorStyleJoystickActor作用对象:actor; 形式:Joystick
vtkInteractorStyleJoystickCamera作用对象:Camera; 形式:Joystick
vtkInteractorStyleImage作用对象:vtkImageActor; 形式:绑定使相机的视图平面垂直于x-y平面

参考:vtkInteractorStyle详细介绍


#include <vtkActor.h>
#include <vtkCamera.h>
#include <vtkCubeSource.h>
#include <vtkInteractorStyleTrackballActor.h>
#include <vtkNamedColors.h>
#include <vtkNew.h>
#include <vtkPolyDataMapper.h>
#include <vtkProperty.h>
#include <vtkRenderWindow.h>
#include <vtkRenderWindowInteractor.h>
#include <vtkRenderer.h>
#include <vtkSphereSource.h>namespace {// Handle mouse events.
class MouseInteractorStyle5 : public vtkInteractorStyleTrackballActor
{
public:static MouseInteractorStyle5* New();vtkTypeMacro(MouseInteractorStyle5, vtkInteractorStyleTrackballActor);virtual void OnLeftButtonDown() override{// Forward events.vtkInteractorStyleTrackballActor::OnLeftButtonDown();if (this->InteractionProp == this->Cube){std::cout << "Picked cube." << std::endl;}else if (this->InteractionProp == this->Sphere){std::cout << "Picked sphere." << std::endl;}}vtkActor* Cube;vtkActor* Sphere;
};vtkStandardNewMacro(MouseInteractorStyle5);} // namespaceint main(int, char*[])
{vtkNew<vtkNamedColors> colors;// Create a cube.vtkNew<vtkCubeSource> cubeSource;cubeSource->Update();vtkNew<vtkPolyDataMapper> cubeMapper;cubeMapper->SetInputConnection(cubeSource->GetOutputPort());vtkNew<vtkActor> cubeActor;cubeActor->SetMapper(cubeMapper);cubeActor->GetProperty()->SetColor(colors->GetColor3d("MistyRose").GetData());// Create a sphere.vtkNew<vtkSphereSource> sphereSource;sphereSource->SetCenter(2, 0, 0);sphereSource->Update();// Create a mapper.vtkNew<vtkPolyDataMapper> sphereMapper;sphereMapper->SetInputConnection(sphereSource->GetOutputPort());// Create an actor.vtkNew<vtkActor> sphereActor;sphereActor->SetMapper(sphereMapper);sphereActor->GetProperty()->SetColor(colors->GetColor3d("LightGoldenrodYellow").GetData());// A renderer and render window.vtkNew<vtkRenderer> renderer;vtkNew<vtkRenderWindow> renderWindow;renderWindow->AddRenderer(renderer);renderWindow->SetWindowName("SelectAnActor");// An interactor.vtkNew<vtkRenderWindowInteractor> renderWindowInteractor;renderWindowInteractor->SetRenderWindow(renderWindow);// Set the custom stype to use for interaction.vtkNew<MouseInteractorStyle5> style;style->SetDefaultRenderer(renderer);style->Cube = cubeActor;style->Sphere = sphereActor;renderWindowInteractor->SetInteractorStyle(style);renderer->AddActor(cubeActor);renderer->AddActor(sphereActor);renderer->SetBackground(colors->GetColor3d("SlateGray").GetData());renderer->ResetCamera();renderer->GetActiveCamera()->Zoom(0.9);// Render and interact.renderWindow->Render();renderWindowInteractor->Initialize();renderWindowInteractor->Start();return EXIT_SUCCESS;
}
http://www.laogonggong.com/news/43906.html

相关文章:

  • 目前网站开发趋势世界杯比分查询
  • 社区网站优化网站优化哪个公司好
  • 班服定制的网站百度云盘登录入口
  • 哪里有网站可以做动态视频倒计时在线网站seo诊断
  • 岳阳网站建设联系方式百度一下官网首页
  • 柯桥做网站的公司bing搜索引擎国际版
  • 芜湖做网站需要多少钱重庆seo技术分享
  • 内江网站建设0832hdsj做电商需要什么条件
  • 竭诚网络网站建设优化网络软件
  • 个人免费自助建站购物网站页面设计
  • 唯品会 一家专做特卖的网站视频号的网站链接
  • 免费建立自己微网站吗app推广方式有哪些
  • 手机wap网站制作需要多少钱江门seo外包公司
  • 做网站需要哪些框架谷歌排名推广公司
  • WordPress 夜间模式主题上海专业优化排名工具
  • 关于文化建设网站网络推广的方法有多选题
  • 各类东莞微信网站建设百度扫一扫识别图片
  • 网站开发设计课程排名优化公司电话
  • 队徽logo在线设计百度seo有用吗
  • 低代码网站开发平台长沙seo关键词
  • 营销型网站建设的利与弊自己做的网址如何推广
  • 织梦 一键更新后网站空白做网销的一天都在干嘛
  • 做网站编辑有前途全国疫情高峰感染高峰
  • 商城网站建设策划书seo网站排名助手
  • 网业端云服务合肥网站优化公司
  • 网站建设v杏信zhousi69seo计费系统登录
  • asp.net mvc 统计网站流量数据北京百度seo价格
  • 网站推广传单google搜索引擎优化
  • 钢板防护罩做网站百度一下就会知道了
  • 北京市建设工程信息网中标公告网站推广优化c重庆