254 lines
6.6 KiB
C++
254 lines
6.6 KiB
C++
//-----------------------------------------------------------------------------+
|
|
// Copyright (C), 1998-2007, Beijing Tangent Software Co. Ltd.
|
|
// = FileName : TGGiExplodeDrawBase 类
|
|
// = Version : ver2.0
|
|
// = Author : wlw
|
|
// = CreateDate : 2002-09-09
|
|
// = Description: TGGiExplodeDrawBase 声明
|
|
// = Maintainers:
|
|
//
|
|
//-----------------------------------------------------------------------------+
|
|
#ifndef _TGGIEXPLODEDRAWBASE_H_
|
|
#define _TGGIEXPLODEDRAWBASE_H_
|
|
|
|
#ifndef _TMASTERPROPERTIES_H_
|
|
#include "TMasterProperties.h"
|
|
#endif
|
|
|
|
#ifndef _TGGIDRAWSTREAMBASE_H_
|
|
#include "TGGiDrawStreamBase.h"
|
|
#endif
|
|
|
|
#ifndef _TADSGEPOINT3D_H_
|
|
#include "TADSGePoint3d.h"
|
|
#endif
|
|
|
|
#ifndef _TGGELINE_H_
|
|
#include "TGGeLine.h"
|
|
#endif
|
|
|
|
#ifndef _TGGEARC_H_
|
|
#include "TGGeArc.h"
|
|
#endif
|
|
|
|
#ifndef _TGGECIRCLE_H_
|
|
#include "TGGeCircle.h"
|
|
#endif
|
|
|
|
#ifndef _TGGEPOLY2D_H_
|
|
#include "TGGePoly2D.h"
|
|
#endif
|
|
|
|
#ifndef _TGGE3DFACE_H_
|
|
#include "TGGe3DFace.h"
|
|
#endif
|
|
|
|
#ifndef _TGGECURVESEGMENT_H_
|
|
#include "TGGeCurveSegment.h"
|
|
#endif
|
|
|
|
class GEOAPI 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 TADSGePoint3d &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, TADSGePoint3d pt1, TADSGePoint3d 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 TGGeLine &ln, double nThickness = 0.0) = 0;
|
|
|
|
virtual void DrawArc(const TGGeArc &ar, double nThickness = 0.0) = 0;
|
|
|
|
virtual void DrawCircle(const TGGeCircle &cir, double nThickness = 0.0) = 0;
|
|
|
|
// 3D Draw
|
|
// 根据给定的边界和凸起方向, 绘制三维外壳
|
|
virtual void DrawMesh(const TGGePoly2D &polyOut, const TVector3D &vtOffset) = 0;
|
|
|
|
// 显示分别连接两个区域的边缘构成的侧面
|
|
virtual void DrawMesh(const TGGePoly2D &polyRegion1, const TGGePoly2D &polyRegion2) = 0;
|
|
|
|
void DrawColumn(const TGGePoly2D &polyRegion1, const TGGePoly2D &polyRegion2);
|
|
|
|
void DrawShell(const TGGePoly2D &polyRegion);
|
|
|
|
virtual void DrawMesh( const Adesk::UInt32 rows,
|
|
const Adesk::UInt32 columns,
|
|
const AcGePoint3d* pVertexList,
|
|
const AcGiEdgeData* pEdgeData = NULL) = 0;
|
|
|
|
// 根据给定的内外边界, 绘制三维外壳, 已经对区域进行离散
|
|
virtual void DrawShell(const TGGePoly2D &polyOut, const TDPtrList<TGGePoly2D> &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 TGGePoly2D &polySrc, const TVector3D &vtOffset) = 0;
|
|
|
|
virtual void DrawBody(const TGGePoly2D &polyOut, const TGGePoly2D &polyIn, const TVector3D &vtOffset) = 0;
|
|
|
|
virtual void DrawBody(const TGGePoly2D &polyOut, const TDPtrList<TGGePoly2D> &lstHoles,const TVector3D &vtOffset);
|
|
|
|
virtual void DrawFace(const TGGe3DFace &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 TGGeCurveSegment &cv, double nThickness = 0.0);
|
|
|
|
void DrawCurveList(const TDPtrList<TGGeCurveSegment> &lstCurves, double nThickness = 0.0);
|
|
|
|
// derived from TGGiDrawStreamBase
|
|
virtual void DrawXCurve(const TGGeCurveSegment&curve,double nThick);
|
|
|
|
virtual void DrawX3DFace(const TGGe3DFace&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 TADSGePoint3d Align2Base(TGGiExplodeDrawBase::TextAlignment nAlign,
|
|
TADSGePoint3d ptAlign, TADSGePoint3d ext);
|
|
|
|
static TADSGePoint3d Base2Align(TGGiExplodeDrawBase::TextAlignment nAlign, TADSGePoint3d ptBase, TADSGePoint3d ext);
|
|
|
|
protected:
|
|
|
|
int m_nControlFlag;
|
|
|
|
AcDbObjectId m_idTextStyle;
|
|
|
|
TADSGePoint3d 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();
|
|
|
|
};
|
|
|
|
#endif |