#if !defined(__CKTDIMUTILITY_H__) #define __CKTDIMUTILITY_H__ class CKTDimUtility { public: static int GetVector(AcDbObjectId id, AcGeVector3d& V0,double& dAngle,AcGePoint3d pt); static AcGePoint3d P2d_to_P3d(AcGePoint2d pt); static AcGePoint2d P3d_to_P2d(AcGePoint3d pt); static int KTPipeDimTxt(CString& sTopDimTxt,CString& sBomDimTxt,AcGePoint3d& pt3d,double dPipeW,AcGeVector3d& vc,double& dpipedn,double& dangel,int& npipe); static AcGePoint3d Mid(AcGePoint3d pt1,AcGePoint3d pt2); static Acad::ErrorStatus addToModelSpace(AcDbEntity * pEntity,AcDbObjectId& objectID,bool bClose=true); static void Getinit(AecDbObjXDataMap& xInitDataMap,double& dpipew,double& dtxtH,double& dtxtW,int& nDimType); static AcDbObjectId SetLayer(CString sLayer); static AcDbObjectId GetLayerId(CString sLayer); static AcDbObjectId SetLayer(CString sLayer,AcGiWorldDraw* mode); static BOOL CreateGroup(AcDbObjectIdArray& objIds,LPCTSTR pGroupName,AcDbObjectId &GroupID); static AcGePoint3d MirrorPt(AcGePoint3d pt1,AcGePoint3d pt2,AcGePoint3d ptUser,AcGeVector3d vector = AcGeVector3d::kZAxis); static AcGePoint3d GetIntersectWith(AcGePoint3d pt,AcGePoint3d pt1,AcDbEntity* pEnt); static void Pipedimside(AcGePoint3dArray& arDimpts,CStringArray& arstexts); static void PointsInCorner(AcGePoint3d pt1,AcGePoint3d pt2,AcGePoint3dArray& arDimpts); static double ScaletoDouble(CString sScale); static int GetPipeAngle(double& dAngle,AcGeVector3d& vc); static int KTPipeDimTxtEL(CString& sValveEL,int& nEL,AcGePoint3d& pt3d,double dPipeW,AcGeVector3d& vc,double& dpipedn,double& dangel,int& npipe); static int GetValveDim(AcGePoint3d pt,CString& sValvename,CString& sDn); static AcDbObjectId GetGroupId(AcDbObjectId objId); static AcDbObjectId GetObjectId(AcGePoint3d pt); static AcDbEntity * DrowARC(AcGePoint3d ptHead,AcGePoint3d ptMid,AcGePoint3d ptTail,double dR); static void DrowPBreak(AcGePoint3d m_ptBase,AcGePoint3d ptEnd,double m_dD,bool m_bDrawTail,int nFlag,AcDbObjectIdArray &idGroup); static BOOL FindPipeCenPt(AcGePoint3d& ptGeIn,AcDbObjectId& idCen,int& npipe,double dPipeW,AcGePoint3d& pts,AcGePoint3d& pte); static void DrowPTemp(AcDbObjectIdArray& idGroup,AcGePoint3d m_ptBase,AcGePoint3d ptEnd,double m_dD,bool m_bDrawTai); static int GetValveEL(AcGePoint3d pt,CString& sValvename); static void SetELDrawgraphic(CString& sText); static BOOL DrawArrow(AcGePoint3d ptBase,AcGePoint3d ptDynamic,int nDimType,AcDbObjectId idLayer,AcDbObjectId &id); static int GetDimTextLen(LPCTSTR pszDimText); static AcDbObjectId GetTempEntityId(AcRxClass *pClass, const TCHAR *szBlockName, BOOL *bFirstNew); static void MakeTangentLn(AcDbArc* pArc,AcGePoint3d& ptSta,AcGePoint3d& ptMid,AcGePoint3d& ptEnd,AcDbVoidPtrArray& arCurPtrs); static void WipeOutArc(AcGePoint3d m_ptBase,AcGePoint3d ptEnd,double m_dD,AcDbVoidPtrArray& arCurPtrs); static int AddWipeOut(AcGePoint3d ptFrom,AcGePoint3d ptTo,double dDN,AcDbObjectIdArray& idGroup,BOOL bIsArcStyle = TRUE); }; #endif // !defined(__CKTDIMUTILITY_H__)