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

全国商务网站大全景德镇做网站的公司

全国商务网站大全,景德镇做网站的公司,什么值得买wordpress模板,电商网站设计岗位主要是前一段事件看到VTK的一个例子#xff1a; 该案例是vtk.js写的#xff0c;觉得很有意思#xff0c;个人正好也要用到#xff0c;于是萌生了用C修改VTK源码来实现该功能的想法。原本以为很简单#xff0c;只需要修改一下vtkResliceCursor就可以了#xff0c;加上小球#…        前一段事件看到VTK的一个例子 该案例是vtk.js写的觉得很有意思个人正好也要用到于是萌生了用C修改VTK源码来实现该功能的想法。原本以为很简单只需要修改一下vtkResliceCursor就可以了加上小球加上几个Actor就能实现没想到该功能整花了我差不多一个月的时间。但也学到了不少知识下面就该功能的实现效果和方法做个大致解说 我实现的效果 实现方法 1首先在vtkResliceCursor中定义六个小球的位置。因为是XYZ三个轴每个轴上两个小球所以总共有六个小球。代码 void vtkResliceCursor::BuildCursorGeometryWithoutHole() {// 其他源码省略.......for (int i 0; i 3; i){//wulc{this-SpherePoints[0][i] this-Center[i] - sphereLength * this-XAxis[i];this-SpherePoints[1][i] this-Center[i] sphereLength * this-XAxis[i];this-SpherePoints[2][i] this-Center[i] - sphereLength * this-YAxis[i];this-SpherePoints[3][i] this-Center[i] sphereLength * this-YAxis[i];this-SpherePoints[4][i] this-Center[i] - sphereLength * this-ZAxis[i];this-SpherePoints[5][i] this-Center[i] sphereLength * this-ZAxis[i];}}// 其他源码省略....... }sphereLength 是一个自定义的常数也就是中心到小球的距离。可以是 30 40 50 .。。。。 除此之外我们还要定义一个函数通过该函数可以获取这六个小球的坐标。比如 GetPointPosition(double p[6][3]); 2,在vtkResliceCursorPicker中判断鼠标是否靠近小球中心位置靠近小球坐标时将鼠标光标变为手掌形状。判断方法就是鼠标的位置和小球位置的距离其中有现成的代码 /----------------wulc--------------------------------------------------- int vtkResliceCursorPicker::IntersectPointWithPoint(double p1[3], double p2[3], double Points[], double tol) {double pts[6][3] { {0,0,0} };for (size_t i 0; i 6; i){pts[i][0] Points[3*i];pts[i][1] Points[3*i 1];pts[i][2] Points[3 * i 2];}int j 0;for ( ; j 6; j){double X[4] { pts[j][0], pts[j][1], pts[j][2], 1 };int i;double ray[3], rayFactor, projXYZ[3];for (i 0; i 3; i){ray[i] p2[i] - p1[i];}if ((rayFactor vtkMath::Dot(ray, ray)) 0.0){return 0;}const double t (ray[0] * (X[0] - p1[0]) ray[1] * (X[1] - p1[1]) ray[2] * (X[2] - p1[2])) / rayFactor;if (t 0.0 t 1.0){for (i 0; i 3; i){projXYZ[i] p1[i] t * ray[i];if (fabs(X[i] - projXYZ[i]) tol){break;}}if (i 2) // within tolerance{return 1;}}}return 0; } 3最后要在vtkResliceCursorActor类中添加小球代码 //wulcif (this-Renderer nullptr) return;if (axisNormal 1)//x-z平面{double* position this-CursorAlgorithm-GetResliceCursor()-GetSpherePostion(2);if (fabs(position[0] - 0.0) 0.001 || fabs(position[1] - 0.0) 0.001 || fabs(position[2] - 0.0) 0.001){this-SphereActor[2]-GetProperty()-SetColor(1, 0, 0);this-SphereActor[3]-GetProperty()-SetColor(1, 0, 0);this-SphereActor[2]-SetPosition(position[0], position[1], position[2]);this-SphereActor[3]-SetPosition(position[3], position[4], position[5]);position this-CursorAlgorithm-GetResliceCursor()-GetSpherePostion(0);this-SphereActor[0]-GetProperty()-SetColor(0, 0, 1);this-SphereActor[1]-GetProperty()-SetColor(0, 0, 1);this-SphereActor[0]-SetPosition(position[0], position[1], position[2]);this-SphereActor[1]-SetPosition(position[3], position[4], position[5]);}}else if (axisNormal 2)//x-y平面{double* position this-CursorAlgorithm-GetResliceCursor()-GetSpherePostion(0);if (fabs(position[0] - 0.0) 0.001 || fabs(position[1] - 0.0) 0.001 || fabs(position[2] - 0.0) 0.001){this-SphereActor[0]-GetProperty()-SetColor(0, 1, 0);this-SphereActor[1]-GetProperty()-SetColor(0, 1, 0);this-SphereActor[0]-SetPosition(position[0], position[1], position[2]);this-SphereActor[1]-SetPosition(position[3], position[4], position[5]);position this-CursorAlgorithm-GetResliceCursor()-GetSpherePostion(1);this-SphereActor[2]-GetProperty()-SetColor(1, 0, 0);this-SphereActor[3]-GetProperty()-SetColor(1, 0, 0);this-SphereActor[2]-SetPosition(position[0], position[1], position[2]);this-SphereActor[3]-SetPosition(position[3], position[4], position[5]);}}else if (axisNormal 0) //y-z平面{double* position this-CursorAlgorithm-GetResliceCursor()-GetSpherePostion(2);if (fabs(position[0] - 0.0) 0.001 || fabs(position[1] - 0.0) 0.001 || fabs(position[2] - 0.0) 0.001){this-SphereActor[0]-GetProperty()-SetColor(0, 1, 0);this-SphereActor[1]-GetProperty()-SetColor(0, 1, 0);this-SphereActor[0]-SetPosition(position[0], position[1], position[2]);this-SphereActor[1]-SetPosition(position[3], position[4], position[5]);position this-CursorAlgorithm-GetResliceCursor()-GetSpherePostion(1);this-SphereActor[2]-GetProperty()-SetColor(0, 0, 1);this-SphereActor[3]-GetProperty()-SetColor(0, 0, 1);this-SphereActor[2]-SetPosition(position[0], position[1], position[2]);this-SphereActor[3]-SetPosition(position[3], position[4], position[5]);}} 这就可以了欢迎小伙伴能够一块讨论。
http://www.hkea.cn/news/14579798/

相关文章:

  • 有经验的常州手机网站国外空间租用
  • 办事处网站建设江苏省建设通官方网站
  • 网站怎么做竞价推广浙江网站建设品牌升级
  • 外贸网站设计模板分类信息网站发布标题
  • 设计素材网站p开头的网站建设制作公司思企互联
  • 通过云主机建设网站创业做招商加盟类网站赚钱
  • 中小企业网站用什么技术如何在电脑建设网站
  • 网站的ftp服务器wordpress 连不到js
  • 企业网络推广培训长尾关键词在网站优化中起的作用有哪些
  • 网站建设经费计划内容如何做好网站的推广工作
  • 北京快三佛山正规企业网站排名优化
  • 成都网站建设门户淘宝联盟微信里做网站
  • 如何用ps做照片模板下载网站做盗版网站 国外服务器
  • 中山网站建设中山网站攻击方式
  • 常见的网站名称有哪些营销型门户网站建设方案
  • c 可以做网站吗自己做一款app需要多少钱
  • 粉丝网站制作wordpress获取自定义文章列表
  • 佛山企业网站建设公司网站创建需要什么
  • o2o电子商务网站建设教你如何做网站
  • 西安做门户网站最好的公司做资讯类网站需要特殊资质吗
  • 能添加网站的导航科技让生活更美好作文500字
  • 男女做暖暖的视频试看网站wordpress会员期限
  • 大学生服装网站建设策划书镇江网站制作服务
  • 全国好的深圳网站设计建网站现软件
  • 推进网站集约化建设wordpress投稿验证码
  • 网站设计报价方案网页编程入门
  • 政务信息化建设网站wordpress高亮代码转义
  • 个人网站做多久有效果wordpress主题文章列表
  • 网站开发如何避开法律什么网站可以教做面包
  • 深圳专业网站优化公司报价网站建设与网页制作教程