267 lines
8.1 KiB
C++
267 lines
8.1 KiB
C++
#pragma once
|
|
|
|
#include "AecDbEntityBase.h"
|
|
#include "AecDbObjXDataMap.h"
|
|
#include "AcDbX3dSolid.h"
|
|
#include "aecdbewpipebase.h"
|
|
|
|
#ifdef EARTHWORM_EXPORT
|
|
#define DLLIMPEXP __declspec(dllexport)
|
|
#else
|
|
#define DLLIMPEXP __declspec(dllimport)
|
|
#endif
|
|
|
|
//屋顶
|
|
class DLLIMPEXP AecDbXRoof : public AecDbEntityBase
|
|
{
|
|
public:
|
|
AecDbXRoof(void);
|
|
virtual ~AecDbXRoof(void);
|
|
|
|
public:
|
|
ACRX_DECLARE_MEMBERS(AecDbXRoof);
|
|
|
|
protected:
|
|
static Adesk::UInt32 kCurrentVersionNumber;
|
|
|
|
public:
|
|
|
|
//屋脊样式
|
|
enum RidgeStyle{kNull=0,kRect,kArc};
|
|
|
|
//任意坡顶 人字屋顶 山脊屋顶 攒尖屋顶
|
|
enum RoofStyle{kSlopeRoof=0,kDualRoof,kMountRoof,kCuspRoof};
|
|
|
|
void SetRidgeStyle(AecDbXRoof::RidgeStyle rStyle);
|
|
AecDbXRoof::RidgeStyle GetRidgeStyle() const;
|
|
|
|
void SetRoofStyle(AecDbXRoof::RoofStyle rStyle);
|
|
AecDbXRoof::RoofStyle GetRoofStyle() const;
|
|
|
|
void SetSlabThick(double dThick);
|
|
double GetSlabThick() const;
|
|
|
|
void SetRidgeWidth(double dWidth);
|
|
double GetRidgeWidth() const;
|
|
|
|
void SetRidgeHeight(double dHeight);
|
|
double GetRidgeHeight() const;
|
|
|
|
void SetRidge(AcGePoint3d pt1,AcGePoint3d pt2);
|
|
AcGePoint3d GetRidgeStart()const;
|
|
AcGePoint3d GetRidgeEnd()const;
|
|
|
|
void SetHeightLim(Adesk::Boolean bTrue);
|
|
Adesk::Boolean IsHeightLim()const;
|
|
|
|
void SetRoofHeight(double h);
|
|
double GetRoofHeight()const;
|
|
|
|
double GetElevation()const;
|
|
void SetElevation(double dEl);
|
|
|
|
void SetEqualAngle(Adesk::Boolean bEqual);
|
|
Adesk::Boolean IsEqualAngle()const;
|
|
|
|
double GetAngleLeft()const;
|
|
double GetAngleRight()const;
|
|
|
|
void SetAngle(double a1,double a2);
|
|
|
|
void UnionScale(double nScale);
|
|
bool UnifyElevation(double dElevation = 0.0);
|
|
|
|
//初始化任意坡顶
|
|
bool InitEqualSlope(AcDbPolyline* pPl,double dEl,double dAng);
|
|
|
|
//设置轮廓Init方式
|
|
Acad::ErrorStatus SetPathPoly(AcDbPolyline* pPl,const AcGeVector3d&normal);
|
|
Acad::ErrorStatus GetPathPoly(AcDbPolyline*& pPl,AcGeVector3d&normal) const;
|
|
|
|
//设置轮廓Disperse方式
|
|
void SetPolyPath(AcDbPolyline* pPl);
|
|
bool GetPolyPath(AcDbPolyline*& pPl) const;
|
|
|
|
//mountroof
|
|
void SetRoofType(Adesk::UInt16 nRoofType);
|
|
Adesk::UInt16 GetRoofType() const;
|
|
|
|
AcGePoint3d GetLocation() const;
|
|
void SetLocation(const AcGePoint3d &pt);
|
|
|
|
double GetRotation() const;
|
|
void SetRotation(double dAng);
|
|
|
|
double GetEavesLen() const;
|
|
void SetEavesLen(double d);
|
|
|
|
double GetMountLen() const;
|
|
void SetMountLen(double dL);
|
|
|
|
double GetLength() const;
|
|
void SetLength(double dL);
|
|
|
|
double GetWidth() const;
|
|
void SetWidth(double dW);
|
|
|
|
double GetSlopeAngle(int idx) const;
|
|
void SetSlopeAngle(int idx, double nAngle);
|
|
|
|
double GetSlopeAngle1() const;
|
|
void SetSlopeAngle1(double dA);
|
|
|
|
double GetSlopeAngle2() const;
|
|
void SetSlopeAngle2(double dA);
|
|
|
|
double GetMountHeight() const;
|
|
void SetMountHeight(double dH);
|
|
|
|
Adesk::Boolean IsShowSide() const;
|
|
void SetShowSide(Adesk::Boolean bEqual);
|
|
|
|
double GetTopLength() const;
|
|
|
|
//CuspRoof
|
|
AcGePoint3d GetCenter() const;
|
|
void SetCenter(AcGePoint3d pt);
|
|
|
|
double GetRadius() const;
|
|
void SetRadius(double r);
|
|
|
|
void SetSideNum(Adesk::UInt8 num);
|
|
long GetSideNum() const;
|
|
|
|
//炸碎到面
|
|
bool ExploreToFaces(AcDbVoidPtrArray& arFacePtrs) const;
|
|
|
|
static bool HitGetPlane(AcGePoint3d& ptHit,AcDbVoidPtrArray& entSet,AcGePlane& plane);
|
|
|
|
public:
|
|
virtual void subList() const;
|
|
virtual Acad::ErrorStatus copyFrom(const AcRxObject* pSrc);
|
|
virtual Acad::ErrorStatus subTransformBy(const AcGeMatrix3d& xform);
|
|
|
|
virtual const AecDbObjXDataMap* GetSpecialtyData() const;
|
|
virtual AecDbObjXDataMap* GetSpecialtyData(AcDb::OpenMode bMode = AcDb::kForWrite);
|
|
|
|
virtual Acad::ErrorStatus Draw2d(AcGiDraw &dc) const;
|
|
virtual Acad::ErrorStatus Draw3d(AcGiDraw &dc) const;
|
|
|
|
virtual Acad::ErrorStatus dwgInFields (AcDbDwgFiler* pFiler);
|
|
virtual Acad::ErrorStatus dwgOutFields(AcDbDwgFiler* pFiler) const;
|
|
|
|
virtual Acad::ErrorStatus dxfInFields (AcDbDxfFiler* pFiler);
|
|
virtual Acad::ErrorStatus dxfOutFields(AcDbDxfFiler* pFiler) 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 { return Acad::eNotImplementedYet; }
|
|
virtual Acad::ErrorStatus subMoveGripPointsAt(const AcDbIntArray& indices,const AcGeVector3d& offset);
|
|
|
|
virtual Acad::ErrorStatus subGetStretchPoints(AcGePoint3dArray & stretchPoints) const;
|
|
virtual Acad::ErrorStatus subMoveStretchPointsAt(const AcDbIntArray& indices,const AcGeVector3d& offset);
|
|
|
|
virtual Acad::ErrorStatus subGetOsnapPoints(AcDb::OsnapMode osnapMode,
|
|
INT_PTR gsSelectionMark,
|
|
const AcGePoint3d& ptPick,
|
|
const AcGePoint3d& lastPoint,
|
|
const AcGeMatrix3d& viewXform,
|
|
AcGePoint3dArray& snapPoints,
|
|
AcDbIntArray& geomIds) const;
|
|
void subList();
|
|
private:
|
|
|
|
//绘制
|
|
Acad::ErrorStatus DrawSlopeRoof2d(AcGiDraw &dc) const;
|
|
Acad::ErrorStatus DrawDualRoof2d(AcGiDraw &dc) const;
|
|
Acad::ErrorStatus DrawMountRoof2d(AcGiDraw &dc) const;
|
|
Acad::ErrorStatus DrawCuspRoof2d(AcGiDraw &dc) const;
|
|
|
|
Acad::ErrorStatus DrawSlopeRoof3d(AcGiDraw* pDc,AcDbVoidPtrArray* pGetFaces = NULL) const;
|
|
Acad::ErrorStatus DrawDualRoof3d(AcGiDraw* pDc,AcDbVoidPtrArray* pGetFaces = NULL) const;
|
|
Acad::ErrorStatus DrawMountRoof3d(AcGiDraw* pDc,AcDbVoidPtrArray* pGetFaces = NULL) const;
|
|
Acad::ErrorStatus DrawCuspRoof3d(AcGiDraw* pDc,AcDbVoidPtrArray* pGetFaces = NULL) const;
|
|
|
|
//序列化
|
|
Acad::ErrorStatus RoofBaseDwgin(AcDbDwgFiler* pFiler);
|
|
Acad::ErrorStatus SlopeRoofDwgIn(AcDbDwgFiler* pFiler);
|
|
Acad::ErrorStatus DualRoofDwgIn(AcDbDwgFiler* pFiler);
|
|
Acad::ErrorStatus MountRoofDwgIn(AcDbDwgFiler* pFiler);
|
|
Acad::ErrorStatus CuspRoofDwgIn(AcDbDwgFiler* pFiler);
|
|
|
|
Acad::ErrorStatus RoofBaseDwgOut(AcDbDwgFiler* pFiler) const;
|
|
Acad::ErrorStatus SlopeRoofDwgOut(AcDbDwgFiler* pFiler) const;
|
|
Acad::ErrorStatus DualRoofDwgOut(AcDbDwgFiler* pFiler) const;
|
|
Acad::ErrorStatus MountRoofDwgOut(AcDbDwgFiler* pFiler) const;
|
|
Acad::ErrorStatus CuspRoofDwgOut(AcDbDwgFiler* pFiler) const;
|
|
|
|
Acad::ErrorStatus DrawEntsToSolid(AcGiDraw* pDC,AcDbVoidPtrArray* pGetFaces,AcDbVoidPtrArray& arEntPtrs) const;
|
|
|
|
//内部调用
|
|
BOOL CalAngle(double &angLeft,double &angRight);
|
|
|
|
//获取屋脊线
|
|
void GetMountLine(AcGeLineSeg3d &leftLine,AcGeLineSeg3d &rightLine,AcGeLineSeg3d &midLine) const;
|
|
|
|
virtual SHJson::WValue& ToJson(bool bExprotGeo = true) const;
|
|
|
|
public:
|
|
|
|
//外部调用
|
|
static void CalAngle(ads_name entPl,ads_point pt1,ads_point pt2,double &angLeft,double &angRight,double dHeight);
|
|
|
|
//mountroof
|
|
void CallFromJigUpdate(int nRoofType,int nPromptCounter,const AcGePoint3d& ptLoc,const AcGePoint3d& ptRightDown,const AcGePoint3d& ptRightUp);
|
|
|
|
private:
|
|
|
|
RidgeStyle m_nRidgeStyle; //屋脊样式
|
|
RoofStyle m_nRoofStyle; //屋顶样式
|
|
|
|
//关联的 AecDbX3dPartEntity 对象
|
|
AcDbObjectIdArray m_arAssocPartEntIds;//外部关联 洞口,天窗或老虎窗
|
|
|
|
//各种屋顶特定数据
|
|
void* m_SlopeRoofImpl;//计算对象,序列化
|
|
|
|
//通用数据
|
|
double m_dSlabThick;
|
|
double m_dRidgeWidth,m_dRidgeHeight;//屋脊大小
|
|
AcDbHardPointerId m_idTopFaceLayer; //顶面图层
|
|
AcDbHardPointerId m_idBotFaceLayer; //底面图层
|
|
AcDbHardPointerId m_idSlabLayer; //侧面图层
|
|
AcDbHardPointerId m_idRidgeLayer; //屋脊图层
|
|
|
|
//人字屋顶
|
|
AcGePoint3d m_ptRidge1,m_ptRidge2; //脊线起点、终点
|
|
double m_dAngleLeft,m_dAngleRight; //脊线两侧坡度
|
|
Adesk::Boolean m_bEqualAngle; //两侧是否等坡度(使用左坡度)
|
|
Adesk::Boolean m_bHeightLim; //是否限高
|
|
double m_dRoofHeight; //限高时的屋顶高
|
|
|
|
//矩形屋顶
|
|
AcGePoint3d m_ptLocation; //左下角,标高为底标高
|
|
double m_dRotation; //转角
|
|
double m_dLength,m_dWidth; //长,宽(出檐长和出山长不计在内)
|
|
double m_dEavesLen; //出檐长
|
|
double m_dMountLen; //出山长,人字坡有效
|
|
double m_dSlopeAngle1,m_dSlopeAngle2;//主坡角,副坡角
|
|
double m_dMountHeight; //歇山高
|
|
Adesk::UInt16 m_nRoofType; //类型
|
|
Adesk::Boolean m_bShowSide; //四坡屋顶,侧坡为90度时是否显示侧坡
|
|
|
|
//攒尖屋顶
|
|
AcGePoint3d m_ptCenter;//标高为底标高
|
|
double m_dRadius;//半径
|
|
Adesk::UInt8 m_nSideNum;//边数
|
|
|
|
//存储BIM属性
|
|
AecDbObjXDataMap m_mapSpecXData;
|
|
private:
|
|
// 缓存3D绘制,为toJson使用
|
|
mutable std::vector<AcDbX3dSolid *> m_solids;
|
|
mutable std::vector<AecDbEwPipeBase *> m_pipes;
|
|
}; |