219 lines
6.1 KiB
C++
219 lines
6.1 KiB
C++
#pragma once
|
|
|
|
#include "DbEquipment.h"
|
|
#include "DbPipeLabel.h"
|
|
|
|
class AecXDbWell : public CDbEquipment, public CLabelStyle
|
|
{
|
|
public:
|
|
ACRX_DECLARE_MEMBERS(AecXDbWell);
|
|
private:
|
|
static const Adesk::UInt8 g_nVersion;
|
|
public:
|
|
AecXDbWell();
|
|
protected:
|
|
XString m_sWellName; // 井编号
|
|
XPoint m_ptLabel; // 标注点
|
|
double m_nEleDown; // 井底标高
|
|
double m_nEleUp; // 地面标高
|
|
double m_nWellDn; // 井直径
|
|
BOOL m_bDrawLabel; // 是否显示标注
|
|
AcDbHardPointerId m_idLabelLayer;// 标注文字图层
|
|
BOOL m_bDrawProperty; // 在管线中点位置显示标高属性 Not Database Resident
|
|
bool m_bIsModify; // 是否更新管底标注位置 zxl 2013.09.29 add
|
|
|
|
public:
|
|
void SetLabelLocation(const XPoint &pt) {// 标注位置
|
|
assertWriteEnabled();
|
|
m_ptLabel = pt;
|
|
}
|
|
XPoint GetLabelLocation() const {
|
|
return m_ptLabel;
|
|
}
|
|
const TCHAR* GetWellName() const {
|
|
return (const TCHAR*)m_sWellName;
|
|
}
|
|
void SetWellName(const TCHAR *szLab) {
|
|
assertWriteEnabled();
|
|
m_sWellName = szLab;
|
|
m_bIsModify = true;
|
|
}
|
|
double GetWellEleUp() const {
|
|
return m_nEleUp;
|
|
}
|
|
void SetWellEleUp(double nEleUp) {
|
|
assertWriteEnabled();
|
|
m_nEleUp = nEleUp;
|
|
}
|
|
double GetWellEleDown() const {
|
|
return m_nEleDown;
|
|
}
|
|
void SetWellEleDown(double nEleDown) {
|
|
assertWriteEnabled();
|
|
m_nEleDown = nEleDown;
|
|
}
|
|
double GetWellDn() const {
|
|
return m_nWellDn;
|
|
}
|
|
void SetWellDn(double nWellDn) {
|
|
assertWriteEnabled();
|
|
m_nWellDn = nWellDn;
|
|
}
|
|
BOOL IsDropWell() const {
|
|
if (m_dDang > 0.6)
|
|
return TRUE;
|
|
else
|
|
return FALSE;
|
|
}
|
|
void SetDropWell(BOOL bFlag) {
|
|
assertWriteEnabled();
|
|
if (bFlag)
|
|
m_dDang = 1.0;
|
|
else
|
|
m_dDang = 0;
|
|
}
|
|
|
|
BOOL IsDrawLabel() const {
|
|
return m_bDrawLabel;
|
|
}
|
|
void EnableDrawLabel(BOOL bFlag, double nScale = 1.2) {
|
|
assertWriteEnabled();
|
|
m_bDrawLabel = bFlag;
|
|
if (m_bDrawLabel && !m_ptLabel)
|
|
InitLabelLocation(nScale);
|
|
}
|
|
AcDbObjectId GetLabelLayer() const {
|
|
return m_idLabelLayer;
|
|
}
|
|
void SetLabelLayer(const AcDbObjectId& id) {
|
|
assertWriteEnabled();
|
|
m_idLabelLayer = id;
|
|
}
|
|
void DrawPropertyText(BOOL bDraw) {
|
|
m_bDrawProperty = bDraw;
|
|
}
|
|
BOOL IsShowPropertyText() const {
|
|
return m_bDrawProperty;
|
|
}
|
|
//cet 2011.8.25 add 增加井编号标注角度
|
|
double GetDimAngle() const
|
|
{
|
|
assertReadEnabled();
|
|
const EntityFields &fd = GetFields();
|
|
double dAngle = 0.0;
|
|
fd.GFD(_T("WELL_DIMANGLE"), dAngle);
|
|
return dAngle;
|
|
}
|
|
|
|
void SetDimAngle(double dAngle)
|
|
{
|
|
assertWriteEnabled();
|
|
EntityFields &fd = Fields();
|
|
fd.SFD(_T("WELL_DIMANGLE"), dAngle);
|
|
}
|
|
|
|
void SetWellModify()
|
|
{
|
|
m_bIsModify = true;
|
|
}
|
|
|
|
//zxl 2013.12.11 add
|
|
AcDbObjectId GetSpaceId() const
|
|
{
|
|
assertReadEnabled();
|
|
const EntityFields &fd = GetFields();
|
|
AcDbSoftPointerId id = NULL;
|
|
fd.GFD(_T("ID_SPACE"), id);
|
|
return (AcDbObjectId)id;
|
|
}
|
|
|
|
void SetSpaceId(AcDbSoftPointerId id)
|
|
{
|
|
assertWriteEnabled();
|
|
EntityFields &fd = Fields();
|
|
fd.SFD(_T("ID_SPACE"), (AcDbSoftPointerId)id);
|
|
}
|
|
|
|
// zxl 2014.02.11 add 是否更新井上的汇流面积和井底标注,对速度有要求时可设置为false,仅对本次操作有效
|
|
void SetUpdatable(BOOL bUpdata)
|
|
{
|
|
assertWriteEnabled();
|
|
EntityFields &fd = Fields();
|
|
fd.SFD(_T("UPDATA"), bUpdata);
|
|
}
|
|
|
|
BOOL GetUpdatable()
|
|
{
|
|
assertReadEnabled();
|
|
const EntityFields &fd = GetFields();
|
|
BOOL bRet = true;
|
|
fd.GFD(_T("UPDATA"), bRet);
|
|
return bRet;
|
|
}
|
|
|
|
void SetPipeEndEle(AcDbObjectId id, const TCHAR* szEle);
|
|
public: // Override TDbEntity
|
|
virtual double GetWidth(const CDbPipePrototype* pPipe = NULL) const;
|
|
virtual Acad::ErrorStatus GetGripText(int idx, CString &cs) const;
|
|
virtual void CopyPropertiesFrom(AcDbEntity *pSrc, unsigned gMatchFlag);
|
|
//virtual Acad::ErrorStatus subGetClassID(CLSID* pClsid) const;
|
|
virtual Acad::ErrorStatus Draw2d(AcGiDraw &dc) const;
|
|
virtual Acad::ErrorStatus Draw3d(AcGiDraw &dc) const;
|
|
virtual void GetTips(DList<ObjInfoUnit> &) const; //取动态属性显示数据
|
|
virtual void UpdateLinkage(const XPoint &ptAt, TPipeSys::SysType st,
|
|
const DList<AcDbObjectId> &idPipes);
|
|
virtual BOOL CanLinkSide(const AcDbObjectId &idPipe, int nPos) const;
|
|
virtual SubText* HitTestText(XPoint pt)const { return NULL; };
|
|
|
|
virtual int GetFirstVersion()const { return 7; }
|
|
|
|
public: // Override AcDbEntity
|
|
Acad::ErrorStatus subGetOsnapPoints(AcDb::OsnapMode osnapMode,
|
|
INT_PTR gsSelectionMark,
|
|
const AcGePoint3d& ptPick,
|
|
const AcGePoint3d& lastPoint,
|
|
const AcGeMatrix3d& viewXform,
|
|
AcGePoint3dArray& snapPoints,
|
|
AcDbIntArray& geomIds) const;
|
|
virtual Acad::ErrorStatus dwgInFields(AcDbDwgFiler*);
|
|
virtual Acad::ErrorStatus dwgOutFields(AcDbDwgFiler*) const;
|
|
virtual Acad::ErrorStatus dxfInFields(AcDbDxfFiler*);
|
|
virtual Acad::ErrorStatus dxfOutFields(AcDbDxfFiler*) const;
|
|
virtual Acad::ErrorStatus subGetGripPoints(AcGePoint3dArray& gripPoints,
|
|
AcDbIntArray& osnapModes,
|
|
AcDbIntArray& geomIds) const;
|
|
virtual Acad::ErrorStatus subGetGripPoints(AcDbGripDataPtrArray& grips,
|
|
const double curViewUnitSize,
|
|
const int gripSize,
|
|
const AcGeVector3d& curViewDir,
|
|
const int bitflags) const;
|
|
virtual Acad::ErrorStatus subGetStretchPoints(AcGePoint3dArray & stretchPoints) const;
|
|
virtual Acad::ErrorStatus subMoveGripPointsAt(const AcDbIntArray& indices,
|
|
const AcGeVector3d& offset);
|
|
virtual Acad::ErrorStatus subMoveStretchPointsAt(const AcDbIntArray& indices,
|
|
const AcGeVector3d& offset);
|
|
virtual Acad::ErrorStatus subTransformBy(const AcGeMatrix3d& xform);
|
|
virtual Acad::ErrorStatus subClose();//zxl 2013.07.23 add
|
|
virtual Acad::ErrorStatus subIntersectWith(const AcDbEntity* pEnt,
|
|
AcDb::Intersect intType,
|
|
AcGePoint3dArray& points,
|
|
INT_PTR thisGsMarker = 0,
|
|
INT_PTR otherGsMarker = 0) const;
|
|
virtual Acad::ErrorStatus subIntersectWith(const AcDbEntity* pEnt,
|
|
AcDb::Intersect intType,
|
|
const AcGePlane& projPlane,
|
|
AcGePoint3dArray& points,
|
|
INT_PTR thisGsMarker = 0,
|
|
INT_PTR otherGsMarker = 0) const;
|
|
private:
|
|
Acad::ErrorStatus MoveGSPointsAt(const AcDbIntArray& indices, const AcGeVector3d& offset, bool bGripMove = true);
|
|
void InitLabelLocation(double nScale = 1.2);
|
|
Acad::ErrorStatus DrawLabelText(AcGiDraw &dc) const;
|
|
//zxl 2013.07.23 add 井大小或位置变化时,调整井标注位置
|
|
void ModifyWellDimPos(const AcDbObjectId &idPipe);
|
|
// zxl 2013.06.07 add 根据管线 获取当前井标注位置
|
|
XPoint GetWellDimPosByPipe(const AcDbObjectId &idPipe);
|
|
|
|
};
|
|
|