#if !defined(AFX_COLLECTELEVATION_H__6AAF4828_4C38_4EE9_897D_53583279027F__INCLUDED_) #define AFX_COLLECTELEVATION_H__6AAF4828_4C38_4EE9_897D_53583279027F__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif #include "vector" #include "map" typedef struct { double dHeight; double dDist; }SourcePoint; class CCollectElevation { public: CCollectElevation(); virtual ~CCollectElevation(); public: // double GetBlockZValue(XPoint pt,Entity ent,double &dDis); //返回图块Z坐标值 并得到选择点 // BOOL GetTextTag(CString &sTag,Entity ent);//得到属性字Tag // double GetSelectPointElevation(XPoint ptSel,Entity ent,int nType,LPCTSTR lpTag = NULL);//得到选择点的高程 // void SetCollectObjectCount(int nCount); void SetLandForm(int nType); //设置地形 void SetPickSet(PickSet &ssAll); // cet 2010.4.15 add bool GetSelectPointElevation(XPoint ptSel,Entity ent,int nType, double &dEle);//得到选择点的高程 cet 2010.4.16 void SetGradient(bool bGradient); // cet 2010.4.16 add double GetGradient(); // cet 2010.4.16 add void SetGradient(double dGradient); // cet 2010.4.16 add void SetExternalBlk(bool bExternalBlk); // 设置实体是否为外部参照 cet 2011.12.2 add void SetExnternalBlkMat(const AcGeMatrix3d &mat); // 设置外部参照转换矩阵 cet 2011.12.2 add private: // double GetOverCastRadius(PickSet &ssAll,XPoint pt,int nType); //得到需要覆盖图块的圆的半径 // void GetCirClePolyLine(AcDbPolyline *pLine,XPoint pt,double dRdius);//得到圆POLYLINE // BOOL GetTextValueByTag(XPoint pt,const CString sTag,CString &sValue,Entity ent,double &dDis);//得到属性字的VALUE // double GetDbouleValueByNearValueArray(std::vector vecPt); //通过一组点和选择点的位置得到选择点的高程 double GetTextValue(XPoint pt,Entity ent,double &dDis,XPoint &ptVal);//得到实体文字的数值 并得到选择点与文字的距离 // double GetPointZValue(XPoint pt,Entity ent,double &dDis);//得到实体点Z坐标 并得到选择点与该实体的距离 // double GetCirCleZValue(XPoint pt,Entity ent,double &dDis);//得到实体圆Z坐标 并得到选择点与该实体的距离 // void GetAllPickSet(PickSet &ssAll,int nType,RBList &rbMask,Entity ent); // void GetNeedPicSet(PickSet &ss,double &dRidus,int nType,XPoint ptSel,PickSet &ssAll,RBList &rbMask);//得到需要的选择集 // void GetAroundElevation(PickSet &ss,std::vector &vecPt,int nType,XPoint ptSel,LPCTSTR lpTag);//得到周围点的高程 // void FiletratePickSet(PickSet &ss,XPoint pt,RBList &rbMask,double dRidus);//过滤掉无用实体 // void FiletratePickSet(PickSet &ss,XPoint pt,double dAngle);//过滤掉无用实体 // BOOL IsPointInArc(AcGeVector3d vec1,AcGeVector3d vec2,AcGePoint3d pt,AcGePoint3d ptCenter);//判断点是否在两个向量组成扇形区域 void FiletratePickSet(PickSet &ss, Entity &ent);// 过滤掉无用实体 cet 2010.4.12 add void FiletrateInvalidEnt(PickSet &ss, Entity &ent); // 过滤掉无效数据 cet 2010.4.13 add bool IsNumValue(const CString &strText); //是否为数值型字符串 cet 2010.4.12 add bool GetNearestPtEle(const AcGePoint3d &pt, int nType, double &dEle); // 最近数据源标高 cet 2010.4.13 bool GetEleByThreePt(PickSet &ssAll, const AcGePoint3d &pt, int nType, double &dEle); // 根据三点求标高 cet 2010.4.13 add void GetNearestThreePt(std::vector &vecId, const AcGePoint3d &pt); // 获取三个最近点 cet 2010.4.13 add void GetAllPickSetPt(PickSet &ssAll, const AcGePoint3d &pt, int nType); // 获取选择集中实体的插入点 cet 2010.4.13 add double GetEntEle(const AcDbObjectId &id, int nType); // 获取实体标高 cet 2010.4.13 add void GetNeedPicSet(Entity ent, AcGePoint3d pt, int nType); // 获得pt点周围有效数据源 cet 2010.4.13 add void DrawAcrossLine(std::vector &vecPt); // 绘制交叉线,以表示选择的数据源 cet 2010.4.13 add double GetAnglePlaneToXYPlane(const AcGePlane &plane); // 获取面与xy面的角度 cet 2010.4.16 add AcDbObjectId GetNearestPt(const AcGePoint3d &pt); // 获取最近点 cet 2010.4.13 add bool IsPtInTriangle(AcGePoint3d pt1, AcGePoint3d pt2, AcGePoint3d pt3, AcGePoint3d pt); bool IsPtOnLine(const AcDbLine &line, const AcGePoint3d &pt); bool IsIntersectionLineByLine(const AcDbLine &l1, const AcDbLine &l2); AcGePoint3d GetProjectPt(const AcGePoint3d pt1, const AcGePoint3d pt2, const AcGePoint3d pt3, const AcGePoint3d pt); // cet 2011.12.7 判断pt4点是否在pt1, pt2, pt3所组成三角形有效范围内 pt为插入点 dScale为比例系数 bool IsValidPt(const AcGePoint3d &pt1, const AcGePoint3d &pt2, const AcGePoint3d &pt3, const AcGePoint3d &pt4, const AcGePoint3d &pt, double dScale); private: int m_nMinObjectCount;//需要采集点的个数 std::map m_mapIDToPt; //存放实体已经对应的POSITION double m_dAngel; //切分圆的单位角度 XPoint m_ptNearest; //最近的采集点 int m_nLandForm; // 地形 double m_dMinVal; // cet 2010.4.13 add double m_dMaxVal; // cet 2010.4.13 add std::vector m_vecId; // cet 2010.4.13 add PickSet m_ssAll; // cet 2010.4.15 add bool m_bGradient; // 是否考虑坡度 cet 2010.4.16 add double m_dGradient; // 坡度值 cet 2010.4.16 add bool m_bExternalBlk;// 是否为外部参照 cet 2011.12.2 add AcGeMatrix3d m_mat; // 外部参照转换矩阵 cet 2011.12.2 add }; #endif // !defined(AFX_COLLECTELEVATION_H__6AAF4828_4C38_4EE9_897D_53583279027F__INCLUDED_)