246 lines
9.2 KiB
C++
246 lines
9.2 KiB
C++
#pragma once
|
|
|
|
#include "AcGiDraw.h"
|
|
#include "AecGiSubEntityTraits.h"
|
|
|
|
#ifdef AECRXBASE_EXPORT
|
|
#define AECDLLIMPEXP __declspec(dllexport)
|
|
#else
|
|
#define AECDLLIMPEXP __declspec(dllimport)
|
|
#endif
|
|
|
|
class AECDLLIMPEXP AcGiViewDraw : public AcGiDraw
|
|
{
|
|
public:
|
|
AcGiViewDraw();
|
|
AcGiViewDraw(AcGiWorldDraw *pWd, AcGiViewportDraw *pVd = NULL);
|
|
virtual ~AcGiViewDraw(void);
|
|
|
|
virtual AcGiCommonDraw * GetCommonDraw() const;
|
|
|
|
void SetDrawRaw(AcDbEntity* pEnt);
|
|
|
|
void BackUpGiSubEntityTraits(AecGiSubEntityTraits &prop);
|
|
|
|
void RestoreGiSubEntityTraits(AecGiSubEntityTraits prop);
|
|
|
|
AcGeMatrix3d BlockTransform(const AcDbBlockReference *pInsert);
|
|
|
|
//设置绘制属性 -> AcGiSubEntityTraits
|
|
virtual void SetColor(const Adesk::UInt16 color);
|
|
virtual Adesk::UInt16 GetColor() const;
|
|
|
|
virtual void SetTrueColor(const AcCmEntityColor& color);
|
|
virtual AcCmEntityColor GetTrueColor() const;
|
|
|
|
virtual bool SetColorLayer(int nColor,const AcDbObjectId layerId);
|
|
|
|
virtual void SetLayer(const AcDbObjectId layerId);
|
|
virtual void SetLayer(LPCTSTR pszLayer);
|
|
virtual AcDbObjectId GetLayerId() const;
|
|
|
|
#if ARX > 17
|
|
virtual AcCmTransparency SetTransparency(const AcCmTransparency& transparency);
|
|
#endif
|
|
|
|
virtual void SetLineType(const AcDbObjectId linetypeId);
|
|
virtual AcDbObjectId GetLineTypeId() const;
|
|
|
|
virtual void SetFillType(const AcGiFillType fillType);
|
|
virtual AcGiFillType GetFillType() const;
|
|
|
|
virtual void SetLineWeight(const AcDb::LineWeight lw);
|
|
virtual AcDb::LineWeight GetLineWeight() const;
|
|
|
|
virtual void SetLineWidth(double dW);
|
|
virtual double GetLineWidth() const;
|
|
|
|
virtual void SetLineTypeScale(double dScale = 1.0);
|
|
virtual double GetLineTypeScale() const;
|
|
|
|
virtual void SetThickness(double dThickness);
|
|
virtual double GetThickness() const;
|
|
|
|
virtual void SetPropertiesFrom(const AcDbEntity *pEnt);
|
|
|
|
virtual void SetSelectionMarker(int nMark);
|
|
|
|
virtual void SetTextStyle(const TCHAR * szStyle);
|
|
virtual void SetTextStyle(AcDbObjectId id);
|
|
virtual AcDbObjectId GetTextStyle() const;
|
|
virtual AcDbObjectId GetTextStyle(const TCHAR * szStyle) const;
|
|
|
|
virtual AcDbObjectId GetMaterialId() const;
|
|
virtual Acad::ErrorStatus SetMaterial(AcDbObjectId idMaterial);
|
|
|
|
//原生Draw方法
|
|
virtual Adesk::Boolean DrawCircle( const AcGePoint3d& center,
|
|
const double radius,
|
|
const AcGeVector3d& normal) const;
|
|
|
|
virtual Adesk::Boolean DrawCircle( const AcGePoint3d& pt1,
|
|
const AcGePoint3d& pt2,
|
|
const AcGePoint3d& pt3) const;
|
|
|
|
virtual Adesk::Boolean DrawCircularArc(const AcGePoint3d& center,
|
|
const double radius,
|
|
const AcGeVector3d& normal,
|
|
const AcGeVector3d& startVector,
|
|
const double sweepAngle,
|
|
const AcGiArcType arcType = kAcGiArcSimple) const;
|
|
|
|
virtual Adesk::Boolean DrawCircularArc(const AcGePoint3d& start,
|
|
const AcGePoint3d& point,
|
|
const AcGePoint3d& end,
|
|
const AcGiArcType arcType = kAcGiArcSimple) const;
|
|
|
|
|
|
virtual Adesk::Boolean DrawPolyline(const Adesk::UInt32 nbPoints,const AcGePoint3d* pVertexList,const AcGeVector3d* pNormal = NULL) const;
|
|
|
|
|
|
virtual Adesk::Boolean DrawPolygon(const Adesk::UInt32 nbPoints,const AcGePoint3d* pVertexList) const;
|
|
|
|
virtual AcDbEntity* DrawMesh( const Adesk::UInt32 rows,
|
|
const Adesk::UInt32 columns,
|
|
const AcGePoint3d* pVertexList,
|
|
const AcGiEdgeData* pEdgeData = NULL,
|
|
const AcGiFaceData* pFaceData = NULL,
|
|
const AcGiVertexData* pVertexData = NULL) const;
|
|
|
|
//绘制简易Mesh
|
|
virtual AcDbEntity* DrawMeshS( const Adesk::UInt32 rows,
|
|
const Adesk::UInt32 columns,
|
|
const AcGePoint3d* pVertexList,
|
|
bool bHasSeal = false) const;
|
|
|
|
virtual Adesk::Boolean DrawShell( const Adesk::UInt32 nbVertex,
|
|
const AcGePoint3d* pVertexList,
|
|
const Adesk::UInt32 faceListSize,
|
|
const Adesk::Int32* pFaceList,
|
|
const AcGiEdgeData* pEdgeData = NULL,
|
|
const AcGiFaceData* pFaceData = NULL,
|
|
const AcGiVertexData* pVertexData = NULL,
|
|
const struct resbuf* pResBuf = NULL) const;
|
|
|
|
|
|
virtual Adesk::Boolean DrawText( const AcGePoint3d& position,
|
|
const AcGeVector3d& normal,
|
|
const AcGeVector3d& direction,
|
|
const double height,
|
|
const double width,
|
|
const double oblique,
|
|
const TCHAR* pMsg) const;
|
|
|
|
|
|
virtual Adesk::Boolean DrawText( const AcGePoint3d& position,
|
|
const AcGeVector3d& normal,
|
|
const AcGeVector3d& direction,
|
|
const TCHAR* pMsg,
|
|
const Adesk::Int32 length,
|
|
const Adesk::Boolean raw,
|
|
const AcGiTextStyle &pTextStyle) const;
|
|
|
|
virtual Adesk::Boolean DrawXline( const AcGePoint3d& one_xline_point,const AcGePoint3d& a_different_xline_point) const;
|
|
|
|
virtual Adesk::Boolean DrawRay(const AcGePoint3d& rays_starting_point,const AcGePoint3d& a_different_ray_point) const;
|
|
|
|
virtual Adesk::Boolean DrawPline(const AcDbPolyline& lwBuf,Adesk::UInt32 fromIndex = 0,Adesk::UInt32 numSegs = 0) const;
|
|
|
|
virtual void DrawPolyline(AcDbPolyline &pline);
|
|
|
|
virtual void DrawLine(const AcGeLineSeg3d &ln, double nThickness = 0.0);
|
|
|
|
//二次包装应用绘制方法
|
|
virtual void DrawText(const TCHAR *pszContent,const AcGePoint3d& ptLocation,TextAlignment align,double dHeight,double dWidthFact,double dRotation,const TCHAR * pszStyle);
|
|
|
|
virtual void DrawTextFit(const TCHAR *pszText, const AcGePoint3d& pt1, const AcGePoint3d& pt2, double nTextHeight,const TCHAR * pszStyle);
|
|
|
|
virtual void DrawEntity(const AcDbEntity &ent);
|
|
|
|
virtual void DrawEntity(const AcDbEntity* pEnt);
|
|
|
|
virtual void DrawSolid(const AcGiPoly2d& polyOutline);
|
|
|
|
virtual AcDbHatch * DrawHatch(const AcGiPoly2d& polyOutline, const TCHAR *pszPattern, double nScale,double dRotation = 0.0);
|
|
|
|
// 根据给定的边界和凸起方向, 绘制三维外壳
|
|
virtual AcDbEntity* DrawMesh(const AcGiPoly2d& polyOut, const AcGeVector3d &vtOffset);
|
|
virtual AcDbEntity* DrawMesh(const AcGiPoly2d &polyRegion1, const AcGiPoly2d &polyRegion2);
|
|
|
|
// 根据给定的内外边界, 绘制三维外壳, 已经对区域进行离散
|
|
virtual void DrawShell(const AcGiPoly2d& polyOut, const AcArray<AcGiPoly2d*> &lstPolyIn);
|
|
|
|
virtual void DrawBody(const AcGiPoly2d &polySrc, const AcGeVector3d &vtOffset);
|
|
|
|
virtual void DrawBody(const AcGiPoly2d &polyOut, const AcGiPoly2d &polyIn, const AcGeVector3d &vtOffset);
|
|
|
|
virtual void DrawBody(const AcGiPoly2d &polyOut, const AcArray<AcGiPoly2d*> &lstHoles,const AcGeVector3d &vtOffset);
|
|
|
|
virtual void DrawFace(const AcGePoint3d* pVertexList,int nCount = 4);
|
|
|
|
virtual void DrawFace(const AcDbFace *pFace, const AcGeMatrix3d *mat = NULL);
|
|
|
|
virtual void DrawBlock(const AcDbBlockTableRecord &blockRec, const AcGePoint3d &ptInsert,const AcGeScale3d &scales, double nRot, BOOL bMakeBlock);
|
|
|
|
virtual void DrawBlock(const AcDbObjectId& idRec, const AcGePoint3d &ptInsert,const AcGeScale3d &scales, double nRot, BOOL bMakeBlock);
|
|
|
|
virtual AcDbEntity* DrawBox(const AcGePoint3d& ptOrg,const AcGeVector3d& vtX,const AcGeVector3d& vtY,const AcGeVector3d& vtZ);
|
|
|
|
virtual AcDbEntity* DrawCone( const AcGePoint3d &ptB , const double &Br , const AcGePoint3d &ptT , const double &Tr);
|
|
|
|
virtual AcDbEntity* DrawConeOff( const AcGePoint3d &ptB , const double &Br , const AcGePoint3d &ptT ,const AcGeVector3d& vtDir,const double &Tr);
|
|
|
|
virtual AcDbEntity* DrawConeOff(AcDbCurve* pPath,double dSD,double dED);
|
|
|
|
virtual AcDbEntity* DrawPipe(const AcGePoint3d& ptFrom,const AcGePoint3d& ptTo,double dRadius,double dThick,int nSegs = 20);
|
|
|
|
virtual AcDbEntity* DrawPipe(const AcDbCurve* pCurve,const AcDbRegion* pRegion,const AcGePoint3d& ptCenInRgn);
|
|
|
|
virtual AcDbEntity* DrawPipe(const AcDbCurve* pCurve,const AcDbPolyline* pRegion,const AcGePoint3d& ptCenInRgn);
|
|
|
|
virtual AcDbEntity * DrawPipe(const AcDbCurve *pCurve, double dR);
|
|
|
|
virtual AcDbEntity* DrawExclude(const AcGePoint3dArray& arSectionPtrs,const AcGeVector3d &vtPath);
|
|
|
|
virtual AcDbEntity* DrawExclude(const AcDbCurve *pPolyOut,const AcGeVector3d &vtPath);
|
|
|
|
virtual AcDbEntity* DrawRevolve(const AcDbLine& lnAxis,const AcGePoint3dArray& arSectionPtrs);
|
|
|
|
virtual AcDbEntity* DrawRevolve(const AcDbLine& lnAxis,const AcDbCurve *pSection);
|
|
|
|
virtual AcDbEntity* DrawRevolve(const AcDbLine& lnAxis,const AcDbRegion *pSection);
|
|
|
|
virtual AcDbEntity* DrawSphere(const AcGePoint3d &ptCenter, const double &dRadius);
|
|
|
|
virtual AcDbEntity* DrawLoft(const AcDbCurve *pTop , const AcDbCurve *pBottom , const AcDbLine *pLine);
|
|
|
|
//其他
|
|
virtual Adesk::Boolean pushModelTransform(const AcGeVector3d & vNormal);
|
|
virtual Adesk::Boolean pushModelTransform(const AcGeMatrix3d & xMat);
|
|
virtual Adesk::Boolean popModelTransform();
|
|
|
|
virtual void getModelToWorldTransform(AcGeMatrix3d&) const;
|
|
virtual void getWorldToModelTransform(AcGeMatrix3d&) const;
|
|
|
|
virtual void setExtents(AcGePoint3d *pNewExtents) const;
|
|
|
|
virtual Adesk::Boolean draw(AcGiDrawable*) const;
|
|
|
|
virtual Adesk::Boolean IsDragging() const;
|
|
|
|
private:
|
|
|
|
Acad::ErrorStatus DrawBlackHole(AcDb3dSolid *pSolid);
|
|
|
|
public:
|
|
|
|
BOOL m_bInitStyle;
|
|
int m_nGsMark;
|
|
double m_dLineWidth;
|
|
AcDbObjectId m_idTextStyle;
|
|
AcGiTextStyle m_textStyle;
|
|
AcGiWorldDraw* m_pWd;
|
|
AcGiViewportDraw* m_pVd;
|
|
AcDbEntity* m_pEntRaw;
|
|
};
|