BIMHome v1.0.0
BIMHome接口文档说明
LineSegment2D.h
浏览该文件的文档.
1/************************************************************************
2* @file LineSegment2D.h
3*
4* @brief 二维直线段
5*
6* @details 二维直线段
7*
8* @author lirf
9*
10* @version 1.0
11*
12* @date 2025-6-7
13*
14* @license 北京华科软科技有限公司
15*
16*************************************************************************/
17
18#ifndef BIMHOMEBASE_LINESEGMENT2D_H
19#define BIMHOMEBASE_LINESEGMENT2D_H
20
21#include "Base/Math/Geometry/Curve2D.h"
22
23namespace Base
24{
25 class BoundBox2d;
26 //直线段
27 class BaseExport LineSegment2D :public Curve2D
28 {
29 public:
31
41 virtual Geometry2D* copy(void) const;
42
48
54
61
67 void setEndPoint(const Base::Vector2d& pt);
68 bool isClosed();
69 double getLength()const;
70
72
74
75 // misc
76 inline bool Contains(const Vector2d& rclV) const;
77 bool Intersect(const LineSegment2D& rclLine, Vector2d& rclV) const;
78 bool Intersect(const Vector2d& rclV, double eps) const;
79 bool IntersectAndContain(const LineSegment2D& rclLine, Vector2d& rclV) const;
80 Vector2d FromPos(double fDistance) const;
81
82 // operators
83 inline LineSegment2D& operator= (const LineSegment2D& rclLine);
84 inline bool operator== (const LineSegment2D& rclLine) const;
85
86 private:
89
90 };
91
92
93}
94
95#endif
二维轴对齐包围盒(AABB)实现
Definition BoundBox2D.h:63
Definition Curve2D.h:28
Definition Geometry2D.h:72
Base::Vector2d getEndPoint() const
获取终点
Base::Vector2d mStartPoint
Definition LineSegment2D.h:87
void setEndPoint(const Base::Vector2d &pt)
设置终点
bool Intersect(const Vector2d &rclV, double eps) const
bool Intersect(const LineSegment2D &rclLine, Vector2d &rclV) const
Base::Vector2d getMidPoint()
BoundBox2d CalcBoundBox() const
LineSegment2D(Base::Vector2d startPoint, Base::Vector2d endPoint)
Base::Vector2d getStartPoint() const
获取起点
virtual Geometry2D * copy(void) const
Base::Vector2d mEndPoint
Definition LineSegment2D.h:88
void setStartPoint(const Base::Vector2d &pt)
设置起点
bool Contains(const Vector2d &rclV) const
bool IntersectAndContain(const LineSegment2D &rclLine, Vector2d &rclV) const
LineSegment2D(const LineSegment2D &rclLine)
构造二维直线段
Vector2d FromPos(double fDistance) const
double getLength() const
获取长度
Definition LineSegment2D.h:28
Vector2d 类,表示二维空间中的向量
Definition Vector2D.h:58
Definition BaseFigureFactory.h:24