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

做网站要会哪些软件qq推广官网

做网站要会哪些软件,qq推广官网,广东网站建设服务,抽奖网站开发开发环境: 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.15wanjia.com/news/25443.html

相关文章:

  • 金水郑州网站建设重庆网站seo服务
  • 最好的机票网站建设chatgpt 网址
  • wordpress robt.txtseo手机关键词网址
  • 做 理财网站有哪些问题武汉网站营销seo方案
  • 深圳做微商网站互联网域名交易中心
  • 织梦素材网站模板百度大数据分析工具
  • 白云做网站公司自动引流免费app
  • 东莞市人才招聘网官网网页优化包括
  • 刷赞网站怎么做西安网站建设制作
  • 阳西县建设局网站设计网站
  • 甘肃泾川县门户网站两学一做大连seo顾问
  • 有源码怎么搭建游戏百度seo建议
  • wordpress 栏目设置石家庄谷歌seo公司
  • 网站内容和功能清单东莞疫情最新消息今天又封了
  • 网站虚拟旅游怎么做的如何快速推广网站
  • 网上做外贸都有哪些网站百度站内搜索代码
  • 大作设计网站公司整站优化排名
  • 实体企业做网站好么网站关键词优化怎么做的
  • 网站加入联盟谷歌google浏览器官方下载
  • 康师傅品牌策划方案站长工具seo排名
  • 海南省住房城乡建设厅网站首页全国新增确诊病例
  • 毛片做暧视频在线观看网站网站内链优化
  • 请问如何做网站成都达洱狐网络科技有限公司
  • 做网站那些好百度热榜实时热点
  • 制作论坛类网站模板外贸网站建设案例
  • 网站建设最流行语言北京网讯百度科技有限公司
  • 真实的做视频网站如何联系百度平台客服
  • 网站定制开发成本郑州关键词优化费用
  • 织梦做企业网站国家免费职业技能培训官网
  • 张北北京网站建设考拉seo