216 lines
5.2 KiB
C++
216 lines
5.2 KiB
C++
#pragma once
|
|
|
|
#include "TMasterProperties.h"
|
|
#include "TGGiDrawStreamBase.h"
|
|
#include "ADSGePoint3d.h"
|
|
#include "GeLine.h"
|
|
#include "GeArc.h"
|
|
#include "GeCircle.h"
|
|
#include "GePoly2D.h"
|
|
#include "Ge3DFace.h"
|
|
#include "GeCurveSegment.h"
|
|
|
|
class TGGiExplodeDrawBase : public TGGiDrawStreamBase
|
|
{
|
|
public:
|
|
|
|
TGGiExplodeDrawBase();
|
|
|
|
virtual ~TGGiExplodeDrawBase();
|
|
|
|
enum TextAlignment
|
|
{
|
|
kUnknown = 0, //未知
|
|
|
|
kTopLeft = 1, //左上
|
|
|
|
kTopCenter = 2, //中上
|
|
|
|
kTopRight = 3, //右上
|
|
|
|
kMiddleLeft = 4, //左中
|
|
|
|
kMiddleCenter = 5, //正中
|
|
|
|
kMiddleRight = 6, //右中
|
|
|
|
kBottomLeft = 7, //左下
|
|
|
|
kBottomCenter = 8, //中下
|
|
|
|
kBottomRight = 9, //右下
|
|
|
|
kLeft = 10, //左
|
|
|
|
kCenter = 11, //中心
|
|
|
|
kRight = 12, //右
|
|
|
|
kMiddle = 13, //中间
|
|
|
|
kTextFit = 14, //调整
|
|
};
|
|
|
|
void BackUpProperties(TMasterProperties &prop);
|
|
|
|
void RestoreProperties(TMasterProperties prop);
|
|
|
|
virtual void SetPropertiesFrom(const AcDbEntity *pEnt);
|
|
|
|
virtual BOOL IsFullExplode() const;
|
|
|
|
virtual BOOL IsExportTch4() const;
|
|
|
|
void SetLocation(const ADSGePoint3d &ptLoc);
|
|
|
|
void SetRotation(double nRot);
|
|
|
|
virtual void SetStyle(const TCHAR * szStyle);
|
|
|
|
virtual void SetStyle(AcDbObjectId id);
|
|
|
|
void SetAlignment(TextAlignment align);
|
|
|
|
void SetHeight(double nHeight);
|
|
|
|
void SetWidthFactor(double nWidthFactor);
|
|
|
|
void SetAutoProp(BOOL bTrue);
|
|
|
|
BOOL IsAutoProp() const;
|
|
|
|
virtual void SetSelectionMarker(int nMark);
|
|
|
|
virtual BOOL IsPlotGeneration() const;
|
|
|
|
virtual void DrawText(const TCHAR *pszContent = NULL) = 0;
|
|
|
|
virtual void DrawTextFit(const TCHAR *pszText, ADSGePoint3d pt1, ADSGePoint3d pt2, double nTextHeight);
|
|
|
|
virtual void DrawAtomicEntSet(const AcDbVoidPtrArray &entSet, const AcGeMatrix3d &matTrans);
|
|
|
|
virtual void DrawEntity(const AcDbEntity &ent);
|
|
|
|
// 2D draw
|
|
virtual void Polyline(AcDbPolyline &pline);
|
|
|
|
virtual void DrawLine(const GeLine &ln, double nThickness = 0.0) = 0;
|
|
|
|
virtual void DrawArc(const GeArc &ar, double nThickness = 0.0) = 0;
|
|
|
|
virtual void DrawCircle(const GeCircle &cir, double nThickness = 0.0) = 0;
|
|
|
|
// 3D Draw
|
|
// 根据给定的边界和凸起方向, 绘制三维外壳
|
|
virtual void DrawMesh(const GePoly2D &polyOut, const TVector3D &vtOffset) = 0;
|
|
|
|
// 显示分别连接两个区域的边缘构成的侧面
|
|
virtual void DrawMesh(const GePoly2D &polyRegion1, const GePoly2D &polyRegion2) = 0;
|
|
|
|
void DrawColumn(const GePoly2D &polyRegion1, const GePoly2D &polyRegion2);
|
|
|
|
void DrawShell(const GePoly2D &polyRegion);
|
|
|
|
virtual void DrawMesh(const Adesk::UInt32 rows,
|
|
const Adesk::UInt32 columns,
|
|
const AcGePoint3d* pVertexList,
|
|
const AcGiEdgeData* pEdgeData = NULL) = 0;
|
|
|
|
// 根据给定的内外边界, 绘制三维外壳, 已经对区域进行离散
|
|
virtual void DrawShell(const GePoly2D &polyOut, const PtrList<GePoly2D> &lstPolyIn) = 0;
|
|
|
|
virtual void DrawShell(Adesk::UInt32 nbVertex,
|
|
const AcGePoint3d* pVertexList,
|
|
Adesk::UInt32 faceListSize,
|
|
const Adesk::Int32* pFaceList,
|
|
const AcGiEdgeData* pEdgeData = NULL) = 0;
|
|
|
|
virtual void DrawBody(const GePoly2D &polySrc, const TVector3D &vtOffset) = 0;
|
|
|
|
virtual void DrawBody(const GePoly2D &polyOut, const GePoly2D &polyIn, const TVector3D &vtOffset) = 0;
|
|
|
|
virtual void DrawBody(const GePoly2D &polyOut, const PtrList<GePoly2D> &lstHoles, const TVector3D &vtOffset);
|
|
|
|
virtual void DrawFace(const Ge3DFace &face) = 0;
|
|
|
|
virtual Adesk::UInt16 GetColor() const;
|
|
|
|
virtual void SetColor(Adesk::UInt16 nColor);
|
|
|
|
virtual void SetColor1(Adesk::UInt16 nColor);//显示类起作用,分解类不起作用
|
|
|
|
virtual AcDbObjectId GetLayerId() const;
|
|
|
|
virtual AcDbObjectId GetLineTypeId() const;
|
|
|
|
virtual AcDbObjectId GetMaterialId() const;
|
|
|
|
virtual Acad::ErrorStatus SetLayer(const AcDbObjectId &id);
|
|
|
|
virtual Acad::ErrorStatus SetLayer(const TCHAR *pszLay);
|
|
|
|
virtual Acad::ErrorStatus SetLineType(const TCHAR *pltype);
|
|
|
|
virtual Acad::ErrorStatus SetLineType(AcDbObjectId idLinetype);
|
|
|
|
virtual Acad::ErrorStatus SetMaterial(AcDbObjectId idMaterial);
|
|
|
|
//设置图层以及颜色
|
|
virtual void SetColorLayer(Adesk::UInt16 iObjColor, const AcDbObjectId &id);
|
|
|
|
void DrawCurve(const GeCurveSegment &cv, double nThickness = 0.0);
|
|
|
|
void DrawCurveList(const PtrList<GeCurveSegment> &lstCurves, double nThickness = 0.0);
|
|
|
|
// derived from TGGiDrawStreamBase
|
|
virtual void DrawXCurve(const GeCurveSegment&curve, double nThick);
|
|
|
|
virtual void DrawX3DFace(const Ge3DFace&face);
|
|
|
|
virtual Adesk::Boolean IsDragging() const;
|
|
|
|
//add by xlc on 100629 TArch8.5
|
|
//virtual COLORREF GetTrueColor() const;
|
|
//virtual void SetTrueColor(COLORREF crRef);
|
|
virtual AcCmColor GetTrueColor() const;
|
|
virtual void SetTrueColor(AcCmColor crRef);
|
|
|
|
public:
|
|
|
|
static TGGiExplodeDrawBase::TextAlignment GetTextAlignment(AcDb::TextHorzMode nHMode, AcDb::TextVertMode nVMode);
|
|
|
|
static Adesk::UInt16 GetTextAlignment(TGGiExplodeDrawBase::TextAlignment nAlign);
|
|
|
|
static ADSGePoint3d Align2Base(TGGiExplodeDrawBase::TextAlignment nAlign,
|
|
ADSGePoint3d ptAlign, ADSGePoint3d ext);
|
|
|
|
static ADSGePoint3d Base2Align(TGGiExplodeDrawBase::TextAlignment nAlign, ADSGePoint3d ptBase, ADSGePoint3d ext);
|
|
|
|
protected:
|
|
|
|
int m_nControlFlag;
|
|
|
|
AcDbObjectId m_idTextStyle;
|
|
|
|
ADSGePoint3d m_ptLocation; //定位点
|
|
|
|
double m_nRotation;
|
|
|
|
double m_nHeight;
|
|
|
|
double m_nWidthFactor;
|
|
|
|
AcGeVector3d m_vtNormal;
|
|
|
|
TextAlignment m_align;
|
|
|
|
protected:
|
|
|
|
AcGiTextStyle m_textStyle;
|
|
|
|
BOOL m_bInitStyle;
|
|
|
|
void LoadAcGiStyle();
|
|
|
|
};
|