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

濮阳做网站多少钱网络推广营销公司

濮阳做网站多少钱,网络推广营销公司,dwcc2017做网站教程,外贸推广软件有哪些开发环境: Windows 11 家庭中文版Microsoft Visual Studio Community 2019VTK-9.3.0.rc0vtk-example参考代码 demo解决问题:框选或者点选某一区域,并获取区域prop3D对象(红线内为有效区域,polydata组成的3d几何对象&a…

开发环境:

  1. Windows 11 家庭中文版
  2. Microsoft Visual Studio Community 2019
  3. VTK-9.3.0.rc0
  4. vtk-example
  5. 参考代码

demo解决问题:框选或者点选某一区域,并获取区域prop3D对象(红线内为有效区域,polydata组成的3d几何对象)
在这里插入图片描述

1. vtkInteractorStyleRubberBandPick

  /*与TrackBallCamera类似,但是它可以选择橡皮筋选择矩形下面的道具。该交互器样式允许用户通过按下'r'并使用左鼠标按钮在渲染窗口中绘制矩形。当释放鼠标按钮时,附加的拾取器将在选择矩形中心的像素上操作。如果拾取器恰好是vtkAreaPicker,则它将在整个选择矩形上操作。当按下'p'键时,上述拾取操作在1x1矩形上发生。在其他方面,它的行为与其父类相同。另请参见vtkAreaPicker*/// r使能或禁用区域框选,框选区域中pick有效区域// For vtkInteractorStyleRubberBandPick - use 'r' and left-mouse to draw a// selection box used to pick.// // p按下时,pick当前鼠标位置所在的区域// For vtkInteractorStyleTrackballCamera - use 'p' to pick at the current// mouse position.vtkNew<vtkInteractorStyleRubberBandPick> style;

2. vtkAreaPicker

	vtkNew<vtkAreaPicker> areaPicker;vtkNew<vtkCallbackCommand> pickCallback;pickCallback->SetCallback(PickCallbackFunction);areaPicker->AddObserver(vtkCommand::EndPickEvent, pickCallback);

prj name: AreaPicking

#include <vtkActor.h>
#include <vtkAreaPicker.h>
#include <vtkCallbackCommand.h>
#include <vtkCellArray.h>
#include <vtkInteractorStyleRubberBandPick.h>
#include <vtkInteractorStyleTrackball.h>
// #include <vtkInteractorStyleTrackballCamera.h>
#include <vtkNamedColors.h>
#include <vtkNew.h>
#include <vtkPoints.h>
#include <vtkPolyData.h>
#include <vtkPolyDataMapper.h>
#include <vtkProp3DCollection.h>
#include <vtkProperty.h>
#include <vtkRenderWindow.h>
#include <vtkRenderWindowInteractor.h>
#include <vtkRenderer.h>namespace {
void PickCallbackFunction(vtkObject* caller, long unsigned int eventId,void* clientData, void* callData);
}int main(int, char*[])
{// Create a set of points.vtkNew<vtkPoints> points;vtkNew<vtkCellArray> vertices;vtkIdType pid[1];pid[0] = points->InsertNextPoint(1.0, 0.0, 0.0);vertices->InsertNextCell(1, pid);pid[0] = points->InsertNextPoint(0.0, 0.0, 0.0);vertices->InsertNextCell(1, pid);pid[0] = points->InsertNextPoint(0.0, 1.0, 0.0);vertices->InsertNextCell(1, pid);// Create a polydatavtkNew<vtkPolyData> polydata;polydata->SetPoints(points);polydata->SetVerts(vertices);// VisualizevtkNew<vtkPolyDataMapper> mapper;mapper->SetInputData(polydata);vtkNew<vtkNamedColors> colors;vtkNew<vtkActor> actor;actor->SetMapper(mapper);actor->GetProperty()->SetPointSize(8);                                //设置顶点的显示大小actor->GetProperty()->SetColor(colors->GetColor3d("Gold").GetData()); //设置顶点的显示颜色vtkNew<vtkRenderer> renderer;vtkNew<vtkRenderWindow> renderWindow;renderWindow->AddRenderer(renderer);renderWindow->SetWindowName("AreaPicking");vtkNew<vtkAreaPicker> areaPicker;vtkNew<vtkRenderWindowInteractor> renderWindowInteractor;renderWindowInteractor->SetRenderWindow(renderWindow);renderWindowInteractor->SetPicker(areaPicker);renderer->AddActor(actor);renderer->SetBackground(colors->GetColor3d("DarkSlateGray").GetData());renderWindow->Render();// r使能或禁用区域框选,框选区域中pick有效区域// For vtkInteractorStyleRubberBandPick - use 'r' and left-mouse to draw a// selection box used to pick.vtkNew<vtkInteractorStyleRubberBandPick> style;// p按下时,pick当前鼠标位置所在的区域// For vtkInteractorStyleTrackballCamera - use 'p' to pick at the current// mouse position.//  vtkNew<vtkInteractorStyleTrackballCamera> style;//    paraviewstyle->SetCurrentRenderer(renderer);renderWindowInteractor->SetInteractorStyle(style);vtkNew<vtkCallbackCommand> pickCallback;pickCallback->SetCallback(PickCallbackFunction);areaPicker->AddObserver(vtkCommand::EndPickEvent, pickCallback);renderWindowInteractor->Start();return EXIT_SUCCESS;
}namespace {
void PickCallbackFunction(vtkObject* caller,long unsigned int vtkNotUsed(eventId),void* vtkNotUsed(clientData),void* vtkNotUsed(callData))
{std::cout << "Pick." << std::endl;vtkAreaPicker* areaPicker = static_cast<vtkAreaPicker*>(caller);vtkProp3DCollection* props = areaPicker->GetProp3Ds();props->InitTraversal();//遍历当权pick到那些区域(Prop3Ds)for (vtkIdType i = 0; i < props->GetNumberOfItems(); i++){vtkProp3D* prop = props->GetNextProp3D();std::cout << "Picked prop: " << prop << std::endl;}
}
} // namespace
http://www.tj-hxxt.cn/news/59377.html

相关文章:

  • 建立网站是什么建立的百度百度网址大全
  • app wordpress类似seo排名优化是什么意思
  • windows 2003 iis 多网站国内最近发生的重大新闻
  • 哔哩网站开发需求分析模板抖音seo源码搭建
  • 全民建站怎么做一个网页
  • 如何借助网站打广告谷歌play
  • 做网站是先买域名新闻稿
  • 网站上传文件不大于5M定么做搜索引擎优化包括哪些方面
  • 织梦cms电影网站源码推广普通话文字素材
  • 织梦做的网站很老优化大师官方正版下载
  • 怎么做网站的关键词库正规软件开发培训学校
  • 做问卷赚钱的网站网站模板商城
  • css 网站根目录深圳网络营销软件
  • 聊城网站百度推广刷关键词排名seo软件软件
  • 营销网页制作百度seo和sem的区别
  • 淘宝网站制作教程浏览器直接进入网站的注意事项
  • 嘉兴网站制作建设上海app网络推广公司
  • WordPress的成都网站优化及推广
  • 公司请外包做的网站怎么维护谷歌seo代运营
  • wordpress建站多少钱对网站的建议和优化
  • 网站做填充营销案例分析报告模板
  • b2b网站如何做社群运营360搜索引擎地址
  • 男女做污视频网站搭建网站多少钱
  • wordpress生产静态页面文大侠seo
  • 开发公司解决停车费贵的发言稿seo网课培训
  • 凡科网站制作如何创建一个网址
  • 美工设计网站推荐网页生成器
  • 在唐山做网站多少钱百度网站收录
  • 美国一级a做爰片免网站 视频播放能够免费换友链的平台
  • 建设网站后如何上线媒体宣传推广方案