//======================================================================== // Copyright (C), 1994-2011, Beijing Tangent Engineering Software Co.Ltd. // = FileName : TDbEquWorldDraw.h // = Version : 1.0 // = Author : hh // = CreateDate : 2011-09-27 // = Description : 用于实现设备的遮挡时,从设备图块中提取所有的图元 // = Maintainers : //======================================================================== #ifndef _TDBQUEWORLDDRAW_H_ #define _TDBQUEWORLDDRAW_H_ #if _MSC_VER > 1000 #pragma once #endif class TDbEquWorldDraw; class TDbEquWorldGeometry : public AcGiWorldGeometry { public: ACRX_DECLARE_MEMBERS(TDbEquWorldGeometry); TDbEquWorldGeometry(TDbEquWorldDraw* pMode); virtual ~TDbEquWorldGeometry(); virtual void setExtents(AcGePoint3d *pNewExtents) const; virtual void startAttributesSegment(); virtual void getModelToWorldTransform(AcGeMatrix3d&) const; virtual void getWorldToModelTransform(AcGeMatrix3d&) const; virtual Adesk::Boolean pushModelTransform(const AcGeVector3d & vNormal); virtual Adesk::Boolean pushModelTransform(const AcGeMatrix3d & xMat); virtual Adesk::Boolean popModelTransform(); #if ADS > 19 virtual Adesk::Boolean edge(const AcArray& edges) const; #endif // draw functions virtual Adesk::Boolean circle( const AcGePoint3d& center, const double radius, const AcGeVector3d& normal) const; virtual Adesk::Boolean circle( const AcGePoint3d& first, const AcGePoint3d& second, const AcGePoint3d& third) const; virtual Adesk::Boolean circularArc( const AcGePoint3d& center, const double radius, const AcGeVector3d& normal, const AcGeVector3d& startVector, const double sweepAngle, const AcGiArcType arcType = kAcGiArcSimple) const; virtual Adesk::Boolean circularArc( const AcGePoint3d& start, const AcGePoint3d& point, const AcGePoint3d& end, const AcGiArcType arcType = kAcGiArcSimple) const; #ifdef _WIN64 virtual Adesk::Boolean polyline( const Adesk::UInt32 nbPoints, const AcGePoint3d* pVertexList, const AcGeVector3d* pNormal = NULL, Adesk::LongPtr lBaseSubEntMarker = -1) const; #else virtual Adesk::Boolean polyline( const Adesk::UInt32 nbPoints, const AcGePoint3d* pVertexList, const AcGeVector3d* pNormal = NULL, Adesk::Int32 lBaseSubEntMarker = -1) const; #endif virtual Adesk::Boolean polygon( const Adesk::UInt32 nbPoints, const AcGePoint3d* pVertexList) const; virtual Adesk::Boolean mesh( const Adesk::UInt32 rows, const Adesk::UInt32 columns, const AcGePoint3d* pVertexList, const AcGiEdgeData* pEdgeData = NULL, const AcGiFaceData* pFaceData = NULL, const AcGiVertexData* pVertexData = NULL) const; virtual Adesk::Boolean mesh( const Adesk::UInt32 rows, const Adesk::UInt32 columns, const AcGePoint3d* pVertexList, const AcGiEdgeData* pEdgeData = NULL, const AcGiFaceData* pFaceData = NULL, const AcGiVertexData* pVertexData = NULL, const bool bAutoGenerateNormals = true) const; virtual Adesk::Boolean shell( 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 shell( 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 bool bAutoGenerateNormals = true) const; virtual Adesk::Boolean text( 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 text( 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 ray(const AcGePoint3d&, const AcGePoint3d&) const; virtual Adesk::Boolean xline(const AcGePoint3d&, const AcGePoint3d&) const; virtual Adesk::Boolean pline( const AcDbPolyline& lwBuf, Adesk::UInt32 fromIndex = 0, Adesk::UInt32 numSegs = 0) const; virtual Adesk::Boolean draw(AcGiDrawable*) const; virtual Adesk::Boolean pushClipBoundary(AcGiClipBoundary * pBoundary); virtual void popClipBoundary(); #if ADS > 17 virtual AcGeMatrix3d pushPositionTransform (AcGiPositionTransformBehavior behavior, const AcGePoint3d& offset); virtual AcGeMatrix3d pushPositionTransform (AcGiPositionTransformBehavior behavior, const AcGePoint2d& offset); virtual AcGeMatrix3d pushScaleTransform (AcGiScaleTransformBehavior behavior, const AcGePoint3d& extents); virtual AcGeMatrix3d pushScaleTransform (AcGiScaleTransformBehavior behavior, const AcGePoint2d& extents); virtual AcGeMatrix3d pushOrientationTransform (AcGiOrientationTransformBehavior behavior); virtual Adesk::Boolean polyline(const AcGiPolyline& polylineObj) const; virtual Adesk::Boolean polyPolyline (Adesk::UInt32 nbPolylines, const AcGiPolyline* pPolylines) const; virtual Adesk::Boolean polyPolygon(const Adesk::UInt32 numPolygonIndices, const Adesk::UInt32* numPolygonPositions, const AcGePoint3d* polygonPositions, const Adesk::UInt32* numPolygonPoints, const AcGePoint3d* polygonPoints, const AcCmEntityColor* outlineColors = NULL, const AcGiLineType* outlineTypes = NULL, const AcCmEntityColor* fillColors = NULL, const AcCmTransparency* fillOpacities = NULL) const; virtual Adesk::Boolean image(const AcGiImageBGRA32& imageSource, const AcGePoint3d& position, const AcGeVector3d& u, const AcGeVector3d& v, TransparencyMode transparencyMode = kTransparency8Bit)const; virtual Adesk::Boolean rowOfDots(int count,const AcGePoint3d& start,const AcGeVector3d& step) const; virtual Adesk::Boolean ellipticalArc(const AcGePoint3d& center,const AcGeVector3d& normal,double majorAxisLength,double minorAxisLength,double startDegreeInRads,double endDegreeInRads,double tiltDegreeInRads,AcGiArcType arcType = kAcGiArcSimple) const; #endif // ADS>17 protected: TDbEquWorldDraw* m_pMode; int m_nPart; }; class TDbEquWorldDraw : public AcGiWorldDraw { friend class TDbEquWorldGeometry; public: ACRX_DECLARE_MEMBERS(TDbEquWorldDraw); TDbEquWorldDraw(); virtual ~TDbEquWorldDraw(); void VirtualWordDraw(AcDbEntity* pEnt); void SetTransMatrix(const AcGeMatrix3d& mat); void SetComplexCurvePtr(TComplexCurve* pCompCurve); void SetCurveSegmentPtr(TDPtrList* pLstCurSegs); void SetExcluding(const TComplexCurve& comCurve); void ClearExcluding(); protected: void AddCurveElement(AcGePoint3d pt1, AcGePoint3d pt2, AcGePoint3d pt3, double nWidth = 0); void AddCurveElement(AcGePoint3d ptS, AcGePoint3d ptE, double nWidth = 0); BOOL Excluding(const TCurveElement elem); virtual AcGiRegenType regenType() const; virtual Adesk::Boolean regenAbort() const; virtual AcGiSubEntityTraits& subEntityTraits() const; virtual AcGiGeometry* rawGeometry() const; virtual AcGiContext* context(); virtual AcGiWorldGeometry& geometry() const; virtual Adesk::Boolean isDragging() const; virtual double deviation(const AcGiDeviationType, const AcGePoint3d&) const; virtual Adesk::UInt32 numberOfIsolines() const; protected: AcGiSubEntityTraits* m_pSubEntityTraits; AcGiWorldGeometry* m_pGeometry; TDb::TCurveElement m_elemCurve; TComplexCurve* m_pCompCuve; AcGeMatrix3d m_matTrans; TDPtrList* m_pLstCurSegs; TComplexCurve m_curExclude; double m_dPScale; }; #endif // _TDBQUEWORLDDRAW_H_