Files
envi-code/SourceCode/Code2026/tg_shs/shs_pipebase/TEImpCabCross.h
T
2026-09-28 15:28:50 +08:00

193 lines
7.5 KiB
C++

#ifndef __TEIMPCABCROSS_H__
#define __TEIMPCABCROSS_H__
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "TImpSpecFitting.h"
class TEImpCabCross : public TImpSpecFitting
{
public:
TEImpCabCross();
virtual ~TEImpCabCross();
public:
// 接口描述对象
virtual BOOL GetInterface(int nIndex,TInterface& pipeInterface) const;
virtual BOOL GetInterface(const AcGePoint3d& ptCon,TInterface& pipeInterface) const;
virtual BOOL HasInterface(const AcGePoint3d& ptCon,const AcGeVector3d& vtDir);
virtual int GetInterfaceCount() const;
// 建立接口关联关系
virtual BOOL SetInterfaceRelation(const AcGePoint3d& ptConnect,const AcDbObjectId& idConnect);
// 移除接口关联关系
virtual BOOL RemoveInterfaceRelation(const AcGePoint3d& ptConnect,const AcDbObjectId& idConnect);
// 接口更改通知
virtual BOOL NotifyInterfaceToModify(const TInterfaceModifyMsg& iModiMsg,TInterfaceModifyMsgs& iModiMsgs);
virtual TDb::Position ExplainGripIndex(int nIndex) const;
virtual void GetKindName(CString& sName);
virtual void GetTips(CMapStringToString& mapLable2Tip) const;
//获取三维的壳对象
int GetXBaseShellForSpace(TXShell& xShell);
int GetXBaseShellForPlane(TXShell& xShell);
virtual int GetXBaseShell(TXShell& xShell);
int GetXBaseShellForSpace2(TXShell& xShell) const;
int GetXBaseShellForPlane2(TXShell& xShell) const;
int GetXBaseShell2(TXShell& xShell) const;
AcDbFace* CreateAcDbFace2(const AcGePoint3d& pt1,const AcGePoint3d& pt2,const AcGePoint3d& pt3,const AcGePoint3d& pt4) const;
//获取体的范围方块
virtual int GetBodyBox(AcDbExtents& ext);
virtual CString GetXml() const;
virtual CString GetXml(const AcGeMatrix3d& mat) const;
// add by 2011.02.21 剖切功能 注意 GetSection内不应将std::vector<TObjSectionRecord>参数清空
virtual bool GetSection(const AcDbFace &face, const AcGeVector3d &vtPlaneSecDir,
std::vector<TObjSectionRecord> &sectionRecord, AcDbVoidPtrArray& arFillPtrs) const;
// 剖切用,返回Z坐标最高、最低点
virtual Acad::ErrorStatus GetExtents(TADSGePoint3d &ptLow, TADSGePoint3d &ptUp) const;
public:
//{{AFX_ARX_METHODS(TEImpCabCross)
virtual Acad::ErrorStatus ExplodeOrDraw2d(XExplodeDraw &mode) const;
virtual Acad::ErrorStatus ExplodeOrDraw3d(XExplodeDraw &mode) const;
virtual Acad::ErrorStatus getStretchPoints(AcGePoint3dArray& stretchPoints) const;
virtual Acad::ErrorStatus moveStretchPointsAt(const AcDbIntArray& indices,
const AcGeVector3d& offset);
virtual Acad::ErrorStatus getGripPoints(AcGePoint3dArray& gripPoints,
AcDbIntArray& osnapModes,
AcDbIntArray& geomIds) const;
virtual Acad::ErrorStatus moveGripPointsAt(const AcDbIntArray& indices,
const AcGeVector3d& offset);
virtual Acad::ErrorStatus transformBy(const AcGeMatrix3d& xform);
virtual Acad::ErrorStatus getOsnapPoints(AcDb::OsnapMode osnapMode,
INT_PTR gsSelectionMark,
const AcGePoint3d& pickPoint,
const AcGePoint3d& lastPoint,
const AcGeMatrix3d& viewXform,
AcGePoint3dArray& snapPoints,
AcDbIntArray& geomIds) const;
virtual void list() const;
virtual Acad::ErrorStatus getClassID(CLSID* pClsid) const;
//}}AFX_ARX_METHODS
public:
virtual BOOL MakeCurves(TComplexCurve& cplCurve) const;
virtual AcDbPolyline* MakePolyCurve() const;
virtual BOOL GetCurvesInSide(TComplexCurve& compCurve) const;
virtual BOOL MakePolyCurveFaces(AcDbVoidPtrArray& arFaces);
virtual BOOL NoneConectLineIfNeed(TComplexCurve& cplCurve) const;
private:
int MakeCurvesBase(TComplexCurve& cplCurve) const;
int MakeCurvesZNor(TComplexCurve& cplCurve) const;
int MakeCurvesNoZNor(TComplexCurve& cplCurve) const;
int MakeCurvesForSpace(TComplexCurve& cplCurve) const;
int makeCurvesForIncline(TComplexCurve& cplCurve) const; // 斜向四通 add by wzh 2012/11/19
void GetCurvesInSideZNor(TComplexCurve& compCurve) const;
void GetCurvesInSideNoZNor(TComplexCurve& compCurve) const;
void GetCurvesInSideForSpace(TComplexCurve& compCurve) const;
void GetCurvesInSideForIncline(TComplexCurve& compCurve) const; // null
void MakePolyCurveFaceZNor(AcDbVoidPtrArray& arFaces);
void MakePolyCurveFaceNoZNor(AcDbVoidPtrArray& arFaces);
void FormatPolyline(AcDbPolyline*& pPl,TComplexCurve& cplCurve,int nNum) const;
void FormatArcPolyline(AcDbPolyline*& pPl,TComplexCurve& cplCurve,int nNum) const;
private:
Acad::ErrorStatus ExplodeOrDraw3dNLine(XExplodeDraw &mode) const;
protected:
static void FreeBuffer(AcDbVoidPtrArray& arCurves);
BOOL OnMoveGripPointMsgNotify(const TInterfaceModifyMsg& iModiMsg,TInterfaceModifyMsgs& iModiMsgs);
BOOL OnTransformByMsgNotify(const TInterfaceModifyMsg& iModiMsg,TInterfaceModifyMsgs& iModiMsgs);
BOOL OnSizeMsgNotify(const TInterfaceModifyMsg& iModiMsg,TInterfaceModifyMsgs& iModiMsgs);
private:
// 槽式下平等径接头的夹点移动动作
Acad::ErrorStatus OnHorSameRCrossMoveGripPointsAt(const AcDbIntArray& indices,const AcGeVector3d& offset);
// 获取垂足点
BOOL GetVerticalFootPoint(const AcGePoint3d& pickPoint, const AcGePoint3d& lastPoint, AcGePoint3d& ptVerFoot) const;
// 获取中心线
BOOL GetCrossMidLine(TComplexCurve& compCurve) const;
// 获取最近点
BOOL GetNearestPoint(const AcGePoint3d& pickPoint, AcGePoint3d& ptNear) const;
// 计算曲线中点
AcGePoint3d GetPolyCurMidPoint(const AcGePoint3d& pt1,const AcGePoint3d& pt2,const AcGePoint3d& ptGeM) const;
AcGePoint3d GetPolyCurMidPoint(const AcGePoint3d& pt1,const AcGePoint3d& pt2,const AcGePoint3d& ptGeM,double dAngle) const;
// 计算外切于两等距线的圆心, 用于拐角为单弧/双弧的斜向三通/四通 2012/11/16 add by wzh
AcGePoint3d GetPolyCurveCentre(const AcGePoint3d& pt1,const AcGePoint3d& pt2,const AcGePoint3d& ptGeM,double dAngle) const;
// 判断当前视口是否为3d
BOOL EnsureCurViewPortIs3D(const AcGeVector3d& vtNormal) const;
// 生成面
AcDbFace* CreateAcDbFace(const AcGePoint3d& pt1,const AcGePoint3d& pt2,const AcGePoint3d& pt3,const AcGePoint3d& pt4);
BOOL CreateAcDbArcFace(AcDbVoidPtrArray& arFaces,const AcGePoint3d& ptSta,const AcGePoint3d& ptEnd,const AcGePoint3d& ptMid);
void CreateFace(XExplodeDraw &mode,AcGePoint3d& pt1,AcGePoint3d& pt2,AcGePoint3d& pt3,AcGePoint3d& pt4,
AcGePoint3d& pt5,AcGePoint3d& pt6,AcGePoint3d& pt7,AcGePoint3d& pt8) const;
void CreateFace2(XExplodeDraw &mode,AcGePoint3d& pt1,AcGePoint3d& pt2,AcGePoint3d& pt3,AcGePoint3d& pt4,
AcGePoint3d& pt5,AcGePoint3d& pt6) const;
BOOL GetIndexOfPointIsOn(TComplexCurve& cplCurv,const AcGePoint3d& ptOn,int& nIndex) const;
CString GetCurrentTypeName() const;
void AppendAcDbExtents(std::vector<AcGePoint3d>& vctpt,AcDbExtents& ext);
Acad::ErrorStatus ExplodeOrDraw3dOfC(XExplodeDraw &mode) const;
Acad::ErrorStatus ExplodeOrDraw3dOfP(XExplodeDraw &mode) const;
Acad::ErrorStatus ExplodeOrDraw3dOfT(XExplodeDraw &mode) const;
// 平面四通
Acad::ErrorStatus Draw3dCrossForPlaneOfC(XExplodeDraw &mode) const; // 三维 槽式 平面四通
Acad::ErrorStatus Draw3dCrossForPlaneOfP(XExplodeDraw &mode) const; // 三维 盘式 平面四通
Acad::ErrorStatus Draw3dCrossForPlaneOfT(XExplodeDraw &mode) const; // 三维 梯式 平面正向四通
Acad::ErrorStatus Draw3dCrossForInclineOfT(XExplodeDraw &mode) const; // 三维 梯式 平面斜向四通
// 空间四通
Acad::ErrorStatus Draw3dCrossForSpaceOfC(XExplodeDraw &mode) const; // 三维 槽式 空间四通
Acad::ErrorStatus Draw3dCrossForSpaceOfP(XExplodeDraw &mode) const; // 三维 盘式 空间四通
Acad::ErrorStatus Draw3dCrossForSpaceOfT(XExplodeDraw &mode) const; // 三维 梯式 空间四通
void DrawCube(XExplodeDraw &mode,const AcGeVector3d &vtDir, const AcGePoint3dArray &ptArr, double dThick) const;
};
#endif // __TEImpCabCross_H__