首页 > 编程语言 >OCC gp_Ax1源码阅读记录

OCC gp_Ax1源码阅读记录

时间:2022-12-01 10:36:49浏览次数:41  
标签:Ax1 const gp double OCC vdir 源码 void

gp_Ax1描述了一个三维轴。

轴包含以下内容:

- 原点(Location point)

- 单位向量(称作 "Direction" 或 "main Direction")

轴通常有以下用途:

- 描述三维几何体(例如:旋转体的轴)

- 定义几何体的转换(对称轴、旋转轴等等)

 

class gp_Ax1

{

private:

    gp_Pnt loc;    // 定位

    gp_Dir vdir;    // 方向

 

public:

    // 以下函数没啥好说的,看看就懂

    gp_Ax1() : loc(0,0,0), vdir(0,0,1) {}

    gp_Ax1(const gp_Pnt &theP, const gp_Dir &theV) : loc(theP), vdir(theV) {}

    void SetDirection(const gp_Dir &theV)  {vdir = theV;}

    void SetLocation(const gp_Pnt &theP) {loc = theP;}

    const gp_Dir &Direction() const { return vdir; }

    const gp_Pnt &Location() const { return loc; }

 

    // 以下内容大都是通过成员vdir实现的,此类中仍提供接口,应该是为了使用便利性考虑    

 

    // 是否和Other同轴

    // 同轴判定条件:1:旋转轴夹角小于 AngularTolerance

    // 2:<me>.Location到Other的距离小于 LinearTolerance 且 Other.Location到<me>的距离小于LinearTolerance

    bool IsCoaxial(const gp_Ax1 &Other, const double AngularTolerance, const double LinearTolerance) const

    {}

 

    // 判断<me>和theOther的夹角是否等于 Pi / 2

    bool IsNormal(const gp_Ax1 &theOther, const double theAngularTolerance) const

    {}

 

        // 判断两个轴是否相反 (夹角等于Pi)

        bool IsOpposite(const gp_Ax1 &theOther, const double theAngularTolerance) const

    {}

 

    // 判断两个轴是否平行 (夹角等于0或Pi)

    bool IsParallel(const gp_Ax1 &theOther, const double theAngularTolerance) const

    {}

 

    // 计算两个轴的夹角

    double Angle(const gp_Ax1 &theOther) const  

    {}

 

    // 反向

    void Reverse()

    {}

 

    // 轴关于点P镜像

    void Mirror(const gp_Pnt &P)

    {

        loc.Mirror(P);  vdir.Reverse();

    }

 

    // 轴关于另一个轴镜像

    void Mirror(const gp_Ax1 &A1)

    {}

 

    // 轴关于右手坐标系A2镜像

    void Mirror(const gp_Ax2 &A2)

    {}

 

    // 绕另一个轴旋转

    void Rotate(const gp_Ax1 &theA1, const double theAngRad)

    {}

 

     // 绕点缩放

    void Scale(const gp_Pnt &theP, const double theS)

    {}

    

    // 转换矩阵转换

    void Transform(const gp_Trsf &theT)

    {}

 

    // 平移

    void Translate(const gp_Vec &theV)

    {}

 

    

};

标签:Ax1,const,gp,double,OCC,vdir,源码,void
From: https://www.cnblogs.com/06NN08/p/16940621.html

相关文章

  • Arrays - OddOccurrencesInArray
    Question:https://app.codility.com/programmers/lessons/2-arrays/odd_occurrences_in_array/Anon-emptyarrayAconsistingofNintegersisgiven.Thearraycont......
  • 实战 | OpenCV带掩码(mask)的模板匹配使用技巧与演示(附源码)
    导读本文将重点介绍OpenCV带掩码(mask)的模板匹配使用技巧与演示。(公众号:OpenCV与AI深度学习) 背景介绍  在使用模板匹配时,一些特定情况中我们并不需要将整个模板图......
  • 实战 | 电感元件定位--Halcon与OpenCV实现详解(附源码)
    导读本文给大家分享一个电感元件定位实例,并附Halcon和OpenCV实现步骤和代码。(公众号:OpenCV与AI深度学习) 背景介绍  本实例来源于EmguCV学员交流群,已经同意使用图片......
  • OpenCV技巧 | 二值图孔洞填充方法与实现(附源码)
    重磅干货,第一时间送达导读本文主要介绍使用OpenCV对二值图做孔洞填充的方法与实现。背景介绍为什么要做孔洞填充?因为在部分情况下,二值图内部的孔洞和外部轮廓是一个整体,填......
  • top源码可编译版
    循环打印当前系统的进程状态信息/**Copyright(c)2008,TheAndroidOpenSourceProject*Allrightsreserved.**Redistributionanduseinsourceandbin......
  • JUC源码学习笔记6——ReentrantReadWriteLock
    系列文章目录和关于我阅读此文需要有AQS独占和AQS共享的源码功底,推荐阅读:1.JUC源码学习笔记1——AQS独占模式和ReentrantLock2.JUC源码学习笔记2——AQS共享和Semaphore......
  • Caffeine 源码、架构、原理(史上最全,10W超级字长文)
    文章很长,而且持续更新,建议收藏起来,慢慢读!疯狂创客圈总目录博客园版为您奉上珍贵的学习资源:免费赠送:《尼恩Java面试宝典》持续更新+史上最全+面试必备2000页+面......
  • drupal源码分析
    说实在的,drupal确实很复杂,在国内用的人也不多,唯一看的懂的中文技术网站估计就是drupalchina.org了,但是对于源代码的分析是少之又少.没有办法,只能自己来从头看起了!越......
  • RocketMQ系列-搭建Namesrv源码调试环境
    RocketMQ系列-搭建Namesrv源码调试环境在学习任何一个技术框架的时候,我们通常都是先了解是什么,有什么作用、解决什么问题、设计亮点和设计思想是什么;当然对于技术学习上来......
  • MySQL源码编译安装
    MySQL源码编译安装Linux环境:CentOS7.6MySQL版本:MySQL5.7.37安装路径:/usr/local/mysql1.创建相关目录#创建用户useradd-s/sbin/nologinmysql#创建安装目录并......