98 lines
1.9 KiB
C++
98 lines
1.9 KiB
C++
#pragma once
|
|
|
|
#include "AcGiDraw.h"
|
|
|
|
#if ARX < 26
|
|
class AcDbX3dSolid;
|
|
class AecDbEwPipeBase;
|
|
#else
|
|
#include "AecDbEwPipeBase.h"
|
|
#include "AcDbX3dSolid.h"
|
|
#endif
|
|
#ifdef AECRXBASE_EXPORT
|
|
#define AECDLLIMPEXP __declspec(dllexport)
|
|
#else
|
|
#define AECDLLIMPEXP __declspec(dllimport)
|
|
#endif
|
|
|
|
#ifndef DBXDRAW_DBXSERVICE
|
|
#define DBXDRAW_DBXSERVICE "DBXDRAW_DBXSERVICE"
|
|
#endif
|
|
|
|
class AecDbObjXDataMap;
|
|
class AECDLLIMPEXP AecDbXDraw : public AcRxObject
|
|
{
|
|
public:
|
|
ACRX_DECLARE_MEMBERS(AecDbXDraw);
|
|
|
|
public:
|
|
AecDbXDraw(void);
|
|
~AecDbXDraw(void);
|
|
|
|
public://小组成员重载
|
|
|
|
virtual Acad::ErrorStatus Draw2d(AcGiDraw &dc) const;
|
|
virtual Acad::ErrorStatus Draw3d(AcGiDraw &dc) const;
|
|
virtual Acad::ErrorStatus Edit();
|
|
|
|
public://小组成员使用
|
|
|
|
const AecDbObjXDataMap* GetSpecialtyData() const;
|
|
|
|
private://小组成员不可调用
|
|
|
|
void Attach(AcDbEntity* pEnt);
|
|
void Attach(const AcDbObjectId& id);
|
|
|
|
protected:
|
|
|
|
AcDbEntity* GetAttach();
|
|
AcDbEntity* GetAttach() const;
|
|
void GetAttach(AcDbObjectId &id);
|
|
|
|
private:
|
|
AcDbEntity* m_pVoid;
|
|
AcDbObjectId m_idAt;
|
|
friend class AecDbXDrawPointer;
|
|
|
|
public:
|
|
template <class T>
|
|
void add3DCache(AecDbEwPipeBase *p) const
|
|
{
|
|
AcDbEntity *pEntReal = GetAttach();
|
|
if (!pEntReal) return;
|
|
|
|
T *pStair = T::cast(pEntReal);
|
|
if (!pStair) return;
|
|
|
|
pStair->m_pipes.push_back((AecDbEwPipeBase *)p->clone());
|
|
}
|
|
|
|
template <class T>
|
|
void add3DCache(AcDbX3dSolid *p) const
|
|
{
|
|
AcDbEntity *pEntReal = GetAttach();
|
|
if (!pEntReal) return;
|
|
|
|
T *pStair = T::cast(pEntReal);
|
|
if (!pStair) return;
|
|
|
|
pStair->m_solids.push_back(p->Clone());
|
|
}
|
|
|
|
template <class T>
|
|
void del3DCache() const
|
|
{
|
|
AcDbEntity *pEntReal = GetAttach();
|
|
if (!pEntReal) return;
|
|
|
|
T *pStair = T::cast(pEntReal);
|
|
if (!pStair) return;
|
|
|
|
for (size_t i(0); i < pStair->m_solids.size(); ++i)
|
|
DELETE_PTR(pStair->m_solids[i]);
|
|
for (size_t i(0); i < pStair->m_pipes.size(); ++i)
|
|
DELETE_PTR(pStair->m_pipes[i]);
|
|
}
|
|
};
|