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

WordPress多站点绑定域名深圳住房建设部官方网站

WordPress多站点绑定域名,深圳住房建设部官方网站,打好代码怎么做网站,制作微信的网站有哪些问题前言#xff1a; 本文主要介绍了如何使用Python VTK高亮显示actor#xff0c;使用Python语言#xff0c;高亮显示选中的actor。当窗口中的圆球actor被选中时#xff0c;会变成红色#xff0c;并且会显示actor三遍面片边缘信息。 效果#xff1a; VTK VTK#xff0c; 本文主要介绍了如何使用Python VTK高亮显示actor使用Python语言高亮显示选中的actor。当窗口中的圆球actor被选中时会变成红色并且会显示actor三遍面片边缘信息。 效果 VTK VTKvisualizationtoolkit是一个开放资源的免费软件系统主要用于三维计算机图形学、图像处理和可视化。Vtk是在面向对象原理的基础上设计和实现的它的内核是用C构建。 主要函数介绍 NewPickedActor.GetProperty()  通过该函数可以设置actor的性质如颜色、表面样式等。 vtk.vtkSphereSource()  创建球体的函数文中通过一个for循环创建了6个球体。 vtk.vtkMinimalStandardRandomSequence() VTK的随机数生成器用于代码中的球体随机生成球体的大小和位置。 MouseInteractorHighLightActor  定义actor操作方法这个是一个鼠标操作控件的控制方法。 leftButtonPressEvent(self, obj, event)  这是一个事件触发函数当鼠标左键点击对应的actor时会触发函数对点的actor高亮显示。 Code: #!/usr/bin/env python# noinspection PyUnresolvedReferences import vtkcolors vtk.vtkNamedColors() NUMBER_OF_SPHERES 6class MouseInteractorHighLightActor(vtk.vtkInteractorStyleTrackballCamera):def __init__(self, parentNone):self.AddObserver(LeftButtonPressEvent, self.leftButtonPressEvent)self.LastPickedActor Noneself.LastPickedProperty vtk.vtkProperty()def leftButtonPressEvent(self, obj, event):clickPos self.GetInteractor().GetEventPosition()picker vtk.vtkPropPicker()picker.Pick(clickPos[0], clickPos[1], 0, self.GetDefaultRenderer())# 创建一个新的actorself.NewPickedActor picker.GetActor()# If something was selectedif self.NewPickedActor:# If we picked something before, reset its propertyif self.LastPickedActor:self.LastPickedActor.GetProperty().DeepCopy(self.LastPickedProperty)if self.LastPickedActor self.NewPickedActor:self.NewPickedActor.GetProperty().DeepCopy(self.LastPickedProperty)self.LastPickedActorNoneelse:# Save the property of the picked actor so that we can# restore it next timeself.LastPickedProperty.DeepCopy(self.NewPickedActor.GetProperty())# 高亮选中球体并显示边缘self.NewPickedActor.GetProperty().SetColor(colors.GetColor3d(Red))self.NewPickedActor.GetProperty().SetDiffuse(1.0)self.NewPickedActor.GetProperty().SetSpecular(0.0)self.NewPickedActor.GetProperty().EdgeVisibilityOn()# 保存最后一个选中的actorself.LastPickedActor self.NewPickedActorself.OnLeftButtonDown()returndef main():# 创建render和windowrenderer vtk.vtkRenderer()renderer.SetBackground(colors.GetColor3d(SteelBlue))renwin vtk.vtkRenderWindow()renwin.AddRenderer(renderer)renwin.SetSize(640, 600)renwin.SetWindowName(HighlightPickedActor)# 建立interactor(交互操作)interactor vtk.vtkRenderWindowInteractor()interactor.SetRenderWindow(renwin)# 交互操作方法style MouseInteractorHighLightActor()style.SetDefaultRenderer(renderer)interactor.SetInteractorStyle(style)randomSequence vtk.vtkMinimalStandardRandomSequence()randomSequence.SetSeed(8775070)# 添加球体for i in range(NUMBER_OF_SPHERES):source vtk.vtkSphereSource()# random position and radiusx randomSequence.GetRangeValue(-5.0, 5.0)randomSequence.Next()y randomSequence.GetRangeValue(-5.0, 5.0)randomSequence.Next()z randomSequence.GetRangeValue(-5.0, 5.0)randomSequence.Next()radius randomSequence.GetRangeValue(0.5, 1.0)randomSequence.Next()source.SetRadius(radius)source.SetCenter(x, y, z)source.SetPhiResolution(11)source.SetThetaResolution(21)mapper vtk.vtkPolyDataMapper()mapper.SetInputConnection(source.GetOutputPort())actor vtk.vtkActor()actor.SetMapper(mapper)r randomSequence.GetRangeValue(0.4, 1.0)randomSequence.Next()g randomSequence.GetRangeValue(0.1, 1.0)randomSequence.Next()b randomSequence.GetRangeValue(0.6, 1.0)randomSequence.Next()actor.GetProperty().SetDiffuseColor(r, g, b)actor.GetProperty().SetDiffuse(.8)actor.GetProperty().SetSpecular(.5)actor.GetProperty().SetSpecularColor(colors.GetColor3d(White))actor.GetProperty().SetSpecularPower(10.0)renderer.AddActor(actor)# 运行interactor.Initialize()renwin.Render()interactor.Start()if __name__ __main__:main()
http://www.w-s-a.com/news/973845/

相关文章:

  • 网站建设公司zgkr上海网页网络技术有限公司
  • wordpress附件扩展格式徐州seo关键词
  • wordpress博客站模板织梦网站 联系方式修改
  • 北京城乡建设厅网站重庆网站建设解决方案
  • 网站建设和维护工作内容网站的空间与域名
  • 济南做门户网站开发公司网页发布的步骤
  • 江苏省交通厅门户网站建设管理办法做的网站怎么让百度收录
  • 关于怎么做网站网站site的收录数量要多远索引量
  • 传世网站建设阳光创信-网站建设首选品牌
  • 周口建设网站中国装修公司十大排名
  • wordpress自助发卡青浦网站优化
  • 南京建设银行公积金查询网站wordpress加载插件下载
  • 做网站怎么那么难网站的建设与管理的心得体会
  • 黄冈网站建设哪家快些网站规划与建设评分标准
  • 建站平台 绑定域名怎么在手机上做网站
  • 做电影网站违法吗莱芜 网站
  • 品牌咨询公司泉州seo不到首页不扣费
  • 做网站做一个什么主题的怎样搭建一个企业网站
  • 做设计的有什么网站桂林论坛网站有哪些
  • 做的网站不能放视频开发公司春联
  • 重庆装修房子可以提取公积金吗长沙优化官网公司
  • 做外贸的网站都有哪些带后台的html网站源码
  • 厦门百度快速优化排名手机系统优化工具
  • 宁波网站制作公司推荐公司建站多少钱
  • 网络营销薪酬公司温州网站优化定制
  • 橙色在网站中的应用淘宝客绑定网站备案号
  • 杭州视频网站建设成都设计院排行
  • 慈溪建设网站盘丝洞app破解无限盘币
  • 关于服装店网站建设的策划方案seo关键词优化软件官网
  • 丰台高端网站建设土巴兔装修贵吗