255 lines
6.3 KiB
C++
255 lines
6.3 KiB
C++
//-----------------------------------------------------------------------------+
|
|
// Copyright (C), 1998-2007, SH Software Co. Ltd.
|
|
// = FileName : XExplodeDraw 类
|
|
// = Version : ver2.0
|
|
// = Author : zjq
|
|
// = CreateDate : 2002-09-09
|
|
// = Description: XExplodeDraw 声明
|
|
// = Maintainers:
|
|
//
|
|
//-----------------------------------------------------------------------------+
|
|
#ifndef _XEXPLODESTREAMBASE_H_
|
|
#define _XEXPLODESTREAMBASE_H_
|
|
|
|
#ifndef _XMASTERPROPERTIES_H_
|
|
#include "XMasterProperties.h"
|
|
#endif
|
|
|
|
#ifndef _XDcStream_H_
|
|
#include "XDcStream.h"
|
|
#endif
|
|
|
|
#ifndef _XPOINT_H_
|
|
#include "XPoint.h"
|
|
#endif
|
|
|
|
#ifndef _XLINE_H_
|
|
#include "XLine.h"
|
|
#endif
|
|
|
|
#ifndef _XARC_H_
|
|
#include "XArc.h"
|
|
#endif
|
|
|
|
#ifndef _XCIRCLE_H_
|
|
#include "XCircle.h"
|
|
#endif
|
|
|
|
#ifndef _XPOLY2D_H_
|
|
#include "XPoly2D.h"
|
|
#endif
|
|
|
|
#ifndef _X3DFACE_H_
|
|
#include "X3DFace.h"
|
|
#endif
|
|
|
|
#ifndef _XCURVESEGMENT_H_
|
|
#include "XCurveSegment.h"
|
|
#endif
|
|
|
|
class GEOAPI XExplodeDraw : public XDcStream
|
|
{
|
|
public:
|
|
|
|
XExplodeDraw();
|
|
|
|
virtual ~XExplodeDraw();
|
|
|
|
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(XMasterProperties &prop);
|
|
|
|
void RestoreProperties(XMasterProperties prop);
|
|
|
|
virtual void SetPropertiesFrom(const AcDbEntity *pEnt);
|
|
|
|
virtual BOOL IsFullExplode() const;
|
|
|
|
virtual BOOL IsExportTch4() const;
|
|
|
|
void SetLocation(const XPoint &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, XPoint pt1, XPoint 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 XLine &ln, double nThickness = 0.0) = 0;
|
|
|
|
virtual void DrawArc(const XArc &ar, double nThickness = 0.0) = 0;
|
|
|
|
virtual void DrawCircle(const XCircle &cir, double nThickness = 0.0) = 0;
|
|
|
|
// 3D Draw
|
|
// 根据给定的边界和凸起方向, 绘制三维外壳
|
|
virtual void DrawMesh(const XPoly2D &polyOut, const XVector3D &vtOffset) = 0;
|
|
|
|
// 显示分别连接两个区域的边缘构成的侧面
|
|
virtual void DrawMesh(const XPoly2D &polyRegion1, const XPoly2D &polyRegion2) = 0;
|
|
|
|
void DrawColumn(const XPoly2D &polyRegion1, const XPoly2D &polyRegion2);
|
|
|
|
void DrawShell(const XPoly2D &polyRegion);
|
|
|
|
virtual void DrawMesh( const Adesk::UInt32 rows,
|
|
const Adesk::UInt32 columns,
|
|
const AcGePoint3d* pVertexList,
|
|
const AcGiEdgeData* pEdgeData = NULL) = 0;
|
|
|
|
// 根据给定的内外边界, 绘制三维外壳, 已经对区域进行离散
|
|
virtual void DrawShell(const XPoly2D &polyOut, const DList<XPoly2D> &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 XPoly2D &polySrc, const XVector3D &vtOffset) = 0;
|
|
|
|
virtual void DrawBody(const XPoly2D &polyOut, const XPoly2D &polyIn, const XVector3D &vtOffset) = 0;
|
|
|
|
virtual void DrawBody(const XPoly2D &polyOut, const DList<XPoly2D> &lstHoles,const XVector3D &vtOffset);
|
|
|
|
virtual void DrawFace(const X3DFace &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 XCurveSegment &cv, double nThickness = 0.0);
|
|
|
|
void DrawCurveList(const DList<XCurveSegment> &lstCurves, double nThickness = 0.0);
|
|
|
|
// derived from XDcStream
|
|
virtual void DrawXCurve(const XCurveSegment&curve,double nThick);
|
|
|
|
virtual void DrawX3DFace(const X3DFace&face);
|
|
|
|
virtual Adesk::Boolean IsDragging() const;
|
|
|
|
//add by zjq on 100629
|
|
//virtual COLORREF GetTrueColor() const;
|
|
//virtual void SetTrueColor(COLORREF crRef);
|
|
virtual AcCmColor GetTrueColor() const;
|
|
virtual void SetTrueColor(AcCmColor crRef);
|
|
|
|
public:
|
|
|
|
static XExplodeDraw::TextAlignment GetTextAlignment(AcDb::TextHorzMode nHMode, AcDb::TextVertMode nVMode);
|
|
|
|
static Adesk::UInt16 GetTextAlignment(XExplodeDraw::TextAlignment nAlign);
|
|
|
|
static XPoint Align2Base(XExplodeDraw::TextAlignment nAlign,
|
|
XPoint ptAlign, XPoint ext);
|
|
|
|
static XPoint Base2Align(XExplodeDraw::TextAlignment nAlign, XPoint ptBase, XPoint ext);
|
|
|
|
protected:
|
|
|
|
int m_nControlFlag;
|
|
|
|
AcDbObjectId m_idTextStyle;
|
|
|
|
XPoint 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
|