78 lines
1.9 KiB
C++
78 lines
1.9 KiB
C++
//-------------------------------------------------------------------------------------------------------+
|
|
// Copyright (C), 1998-2007, Beijing Tangent Software Co. Ltd.
|
|
// = FileName : TPGeLine3D Àà
|
|
// = Version : ver2.0
|
|
// = Author : wlw
|
|
// = CreateDate : 2002-09-09
|
|
// = Description: TPGeLine3D ÉùÃ÷ ·½³Ì£ºx=basePoint.x+a*t;y=basePoint.y+b*t;z=basePoint.z+c*t;TGVector3D=(a,b,c)
|
|
// = Maintainers:
|
|
//
|
|
//-------------------------------------------------------------------------------------------------------+
|
|
#ifndef _TPGELINE3D_H_
|
|
#define _TPGELINE3D_H_
|
|
|
|
#ifndef _TGVECTOR3D_H_
|
|
#include "TGVector3D.h"
|
|
#endif
|
|
|
|
#ifndef _TGPOINT_H_
|
|
#include "TGPoint.h"
|
|
#endif
|
|
|
|
#ifndef _TPGECIRCLE_H_
|
|
#include "TPGeCircle.h"
|
|
#endif
|
|
|
|
class TGMatrix;
|
|
|
|
class GEOAPI TPGeLine3D : public TGVector3D
|
|
{
|
|
public:
|
|
|
|
TPGeLine3D();
|
|
|
|
TPGeLine3D(const TPGeLine3D& line);
|
|
|
|
TPGeLine3D(const TGVector3D& vt,const TGPoint& pt);
|
|
|
|
TPGeLine3D(const TGPoint& pt0,const TGPoint& pt1);
|
|
|
|
virtual ~TPGeLine3D();
|
|
|
|
|
|
TPGeLine3D& operator = (const TPGeLine3D& line);
|
|
|
|
bool IsValid() const;
|
|
|
|
void Pt2Pa(const TGPoint& pt,double& pa) const;
|
|
|
|
void Pa2Pt(double pa,TGPoint& pt) const;
|
|
|
|
void TransformBy(const TGMatrix* pMatrix);
|
|
|
|
GRelation HitTest(const TGPoint& pt,bool bNormalized = false) const;
|
|
|
|
int Intersect(const TPGeLine3D& line,double& pa,bool bNormalized = false) const;
|
|
|
|
int Intersect(const TPGeLine3D& line,double& pa1,double& pa2,bool bNormalized = false) const;
|
|
|
|
int Intersect(const TPGeLine3D& line,TGPoint& pt,bool bNormalized = false) const;
|
|
|
|
bool IsInSamePlane(const TPGeLine3D& line) const;
|
|
|
|
bool IsSameLine(const TPGeLine3D& line,bool bSameDirection,bool bNormalized = false) const;
|
|
|
|
public:
|
|
|
|
double &a,&b,&c;
|
|
|
|
TGPoint basePoint;
|
|
|
|
private:
|
|
|
|
int LineInt3D(const TGPoint &pt1,const TGVector3D &vt1, const TGPoint &pt2,const TGVector3D &vt2, double &pa1)const;
|
|
};
|
|
|
|
#endif
|
|
|