381 lines
10 KiB
C++
381 lines
10 KiB
C++
#include "StdAfx.h"
|
|
#include "AecUnknownWorldGeometry.h"
|
|
#include <vector>
|
|
#include "AecUnknownWorldDraw.h"
|
|
|
|
ACRX_CONS_DEFINE_MEMBERS(AecUnknownWorldGeometry,AcGiWorldGeometry,AcDb::kDHL_CURRENT)
|
|
|
|
AecUnknownWorldGeometry::AecUnknownWorldGeometry()
|
|
{
|
|
mpCustomWorldDraw = NULL;
|
|
m_bToFindDrawingFrame = false;
|
|
m_bToFindForESignTrue = false;
|
|
}
|
|
|
|
AecUnknownWorldGeometry::AecUnknownWorldGeometry(AecUnknownWorldDraw* pWorldDraw)
|
|
{
|
|
mpCustomWorldDraw = pWorldDraw;
|
|
m_bToFindDrawingFrame = false;
|
|
m_bToFindForESignTrue = false;
|
|
}
|
|
|
|
AecUnknownWorldGeometry::~AecUnknownWorldGeometry()
|
|
{
|
|
}
|
|
|
|
void AecUnknownWorldGeometry::setToFindDrawingFrame()
|
|
{
|
|
m_bToFindDrawingFrame = true;
|
|
}
|
|
|
|
void AecUnknownWorldGeometry::setToFindForESignTrue()
|
|
{
|
|
m_bToFindForESignTrue = true;
|
|
}
|
|
|
|
void AecUnknownWorldGeometry::getModelToWorldTransform(AcGeMatrix3d &pMatrix) const
|
|
{
|
|
return;
|
|
}
|
|
void AecUnknownWorldGeometry::getWorldToModelTransform(AcGeMatrix3d &pMatrix) const
|
|
{
|
|
return;
|
|
}
|
|
|
|
#if (ARX>=18)
|
|
AcGeMatrix3d AecUnknownWorldGeometry::pushPositionTransform (AcGiPositionTransformBehavior behavior, const AcGePoint3d& offset)
|
|
{
|
|
return AcGeMatrix3d::kIdentity;
|
|
}
|
|
|
|
AcGeMatrix3d AecUnknownWorldGeometry::pushPositionTransform (AcGiPositionTransformBehavior behavior, const AcGePoint2d& offset)
|
|
{
|
|
return AcGeMatrix3d::kIdentity;
|
|
}
|
|
|
|
AcGeMatrix3d AecUnknownWorldGeometry::pushScaleTransform (AcGiScaleTransformBehavior behavior, const AcGePoint3d& extents)
|
|
{
|
|
return AcGeMatrix3d::kIdentity;
|
|
}
|
|
|
|
AcGeMatrix3d AecUnknownWorldGeometry::pushScaleTransform (AcGiScaleTransformBehavior behavior, const AcGePoint2d& extents)
|
|
{
|
|
return AcGeMatrix3d::kIdentity;
|
|
}
|
|
|
|
AcGeMatrix3d AecUnknownWorldGeometry::pushOrientationTransform (AcGiOrientationTransformBehavior behavior)
|
|
{
|
|
return AcGeMatrix3d::kIdentity;
|
|
}
|
|
#endif
|
|
|
|
void AecUnknownWorldGeometry::setExtents(AcGePoint3d *pNewExtents) const
|
|
{
|
|
|
|
}
|
|
|
|
Adesk::Boolean AecUnknownWorldGeometry::circle(const AcGePoint3d& center,
|
|
const double radius,
|
|
const AcGeVector3d& normal
|
|
) const
|
|
{
|
|
return Adesk::kTrue;
|
|
}
|
|
|
|
Adesk::Boolean AecUnknownWorldGeometry::circle(const AcGePoint3d& pt1,
|
|
const AcGePoint3d& pt2,
|
|
const AcGePoint3d& pt3
|
|
) const
|
|
{
|
|
return Adesk::kTrue;
|
|
}
|
|
|
|
Adesk::Boolean AecUnknownWorldGeometry::circularArc(const AcGePoint3d& center,
|
|
const double radius,
|
|
const AcGeVector3d& normal,
|
|
const AcGeVector3d& startVector,
|
|
const double sweepAngle,
|
|
const AcGiArcType arcType
|
|
) const
|
|
{
|
|
double dSta = AcGeVector3d::kXAxis.angleTo(startVector);
|
|
double dEnd = sweepAngle - dSta;
|
|
AcDbArc* pArc = new AcDbArc(center,normal,radius,dSta,dEnd);
|
|
mpCustomWorldDraw->m_prcDrawingFlowData->append(pArc);
|
|
|
|
return Adesk::kTrue;
|
|
}
|
|
|
|
Adesk::Boolean AecUnknownWorldGeometry::circularArc(const AcGePoint3d& start,
|
|
const AcGePoint3d& point,
|
|
const AcGePoint3d& end,
|
|
const AcGiArcType arcType
|
|
) const
|
|
{
|
|
return Adesk::kTrue;
|
|
}
|
|
|
|
#if (ARX>=18)
|
|
Adesk::Boolean AecUnknownWorldGeometry::polyline(const AcGiPolyline& polylineObj) const
|
|
{
|
|
return true;
|
|
}
|
|
|
|
Adesk::Boolean AecUnknownWorldGeometry::polyPolyline( Adesk::UInt32 nbPolylines,
|
|
const AcGiPolyline* pPolylines) const
|
|
{
|
|
return Adesk::kTrue;
|
|
}
|
|
|
|
Adesk::Boolean AecUnknownWorldGeometry::polyPolygon(const Adesk::UInt32 numPolygonIndices,
|
|
const Adesk::UInt32* numPolygonPositions,
|
|
const AcGePoint3d* polygonPositions,
|
|
const Adesk::UInt32* numPolygonPoints,
|
|
const AcGePoint3d* polygonPoints,
|
|
const AcCmEntityColor* outlineColors,
|
|
const AcGiLineType* outlineTypes,
|
|
const AcCmEntityColor* fillColors,
|
|
const AcCmTransparency* fillOpacities) const
|
|
{
|
|
return Adesk::kTrue;
|
|
}
|
|
|
|
Adesk::Boolean AecUnknownWorldGeometry::ellipticalArc(const AcGePoint3d& center,
|
|
const AcGeVector3d& normal,
|
|
double majorAxisLength,
|
|
double minorAxisLength,
|
|
double startDegreeInRads,
|
|
double endDegreeInRads,
|
|
double tiltDegreeInRads,
|
|
AcGiArcType arcType) const
|
|
{
|
|
return Adesk::kTrue;
|
|
}
|
|
Adesk::Boolean AecUnknownWorldGeometry::image( const AcGiImageBGRA32& imageSource,
|
|
const AcGePoint3d& position,
|
|
const AcGeVector3d& u, //orientation and magnitude of width
|
|
const AcGeVector3d& v, //orientation and magnitude of height
|
|
TransparencyMode transparencyMode
|
|
) const
|
|
{
|
|
return Adesk::kTrue;
|
|
}
|
|
|
|
Adesk::Boolean AecUnknownWorldGeometry::rowOfDots( int count,
|
|
const AcGePoint3d& start,
|
|
const AcGeVector3d& step
|
|
) const
|
|
{
|
|
return Adesk::kTrue;
|
|
}
|
|
#endif
|
|
|
|
#ifdef _WIN64
|
|
Adesk::Boolean AecUnknownWorldGeometry::polyline(const Adesk::UInt32 nbPoints,
|
|
const AcGePoint3d* pVertexList,
|
|
const AcGeVector3d* pNormal,
|
|
Adesk::LongPtr lBaseSubEntMarker) const
|
|
{
|
|
AcGePlane plan;
|
|
if (pNormal != NULL)
|
|
plan.set(AcGePoint3d::kOrigin,*pNormal);
|
|
else
|
|
plan = AcGePlane::kXYPlane;
|
|
|
|
AcDbPolyline* pPl = new AcDbPolyline;
|
|
for (int i = 0;i < nbPoints;i++)
|
|
{
|
|
pPl->addVertexAt(i,pVertexList[i].convert2d(plan));
|
|
}
|
|
mpCustomWorldDraw->m_prcDrawingFlowData->append(pPl);
|
|
|
|
return Adesk::kTrue;
|
|
}
|
|
#else
|
|
Adesk::Boolean AecUnknownWorldGeometry::polyline(const Adesk::UInt32 nbPoints,
|
|
const AcGePoint3d* pVertexList,
|
|
const AcGeVector3d* pNormal,
|
|
Adesk::Int32 lBaseSubEntMarker) const
|
|
{
|
|
|
|
AcGePlane plan;
|
|
if (pNormal != NULL)
|
|
plan.set(AcGePoint3d::kOrigin,*pNormal);
|
|
else
|
|
plan = AcGePlane::kXYPlane;
|
|
|
|
AcDbPolyline* pPl = new AcDbPolyline;
|
|
for (int i = 0;i < nbPoints;i++)
|
|
{
|
|
pPl->addVertexAt(i,pVertexList[i].convert2d(plan));
|
|
}
|
|
mpCustomWorldDraw->m_prcDrawingFlowData->append(pPl);
|
|
|
|
return Adesk::kTrue;
|
|
}
|
|
#endif
|
|
|
|
Adesk::Boolean AecUnknownWorldGeometry::polygon( const Adesk::UInt32 nbPoints,
|
|
const AcGePoint3d* pVertexList) const
|
|
{
|
|
return Adesk::kTrue;
|
|
}
|
|
#if ARX>16
|
|
Adesk::Boolean AecUnknownWorldGeometry::mesh(const Adesk::UInt32 rows,
|
|
const Adesk::UInt32 columns,
|
|
const AcGePoint3d* pVertexList,
|
|
const AcGiEdgeData* pEdgeData,//6
|
|
const AcGiFaceData* pFaceData,//8
|
|
const AcGiVertexData* pVertexData,//3
|
|
const bool bAutoGenerateNormals
|
|
) const
|
|
{
|
|
return Adesk::kTrue;
|
|
}
|
|
|
|
Adesk::Boolean AecUnknownWorldGeometry::shell(const Adesk::UInt32 nbVertex,
|
|
const AcGePoint3d* pVertexList,
|
|
const Adesk::UInt32 faceListSize,
|
|
const Adesk::Int32* pFaceList,
|
|
const AcGiEdgeData* pEdgeData,//6-2
|
|
const AcGiFaceData* pFaceData ,//6-2
|
|
const AcGiVertexData* pVertexData,//3-1
|
|
const struct resbuf* pResBuf,
|
|
const bool bAutoGenerateNormals
|
|
) const
|
|
|
|
{
|
|
return Adesk::kTrue;
|
|
}
|
|
#else
|
|
Adesk::Boolean AecUnknownWorldGeometry::mesh(const Adesk::UInt32 rows,
|
|
const Adesk::UInt32 columns,
|
|
const AcGePoint3d* pVertexList,
|
|
const AcGiEdgeData* pEdgeData,//6-2
|
|
const AcGiFaceData* pFaceData,//8-2
|
|
const AcGiVertexData* pVertexData //3-1
|
|
) const
|
|
{
|
|
return Adesk::kTrue;
|
|
}
|
|
|
|
Adesk::Boolean AecUnknownWorldGeometry::shell(const Adesk::UInt32 nbVertex,
|
|
const AcGePoint3d* pVertexList,
|
|
const Adesk::UInt32 faceListSize,
|
|
const Adesk::Int32* pFaceList,
|
|
const AcGiEdgeData* pEdgeData,//6-2
|
|
const AcGiFaceData* pFaceData ,//8-2
|
|
const AcGiVertexData* pVertexData,//3-1
|
|
const struct resbuf* pResBuf
|
|
) const
|
|
|
|
{
|
|
return Adesk::kTrue;
|
|
}
|
|
#endif
|
|
|
|
Adesk::Boolean AecUnknownWorldGeometry::text(const AcGePoint3d& position,
|
|
const AcGeVector3d& normal,
|
|
const AcGeVector3d& direction,
|
|
const double height,
|
|
const double width,
|
|
const double oblique,
|
|
const TCHAR* pMsg
|
|
) const
|
|
{
|
|
AcDbText* pText = new AcDbText;
|
|
pText->setPosition(position);
|
|
pText->setNormal(normal);
|
|
pText->setTextString(pMsg);
|
|
pText->setHeight(height);
|
|
pText->setWidthFactor(width / height);
|
|
pText->setOblique(oblique);
|
|
|
|
double dAngle = AcGeVector3d::kXAxis.angleTo(direction);
|
|
pText->setRotation(dAngle);
|
|
mpCustomWorldDraw->m_prcDrawingFlowData->append(pText);
|
|
|
|
return Adesk::kTrue;
|
|
}
|
|
|
|
Adesk::Boolean AecUnknownWorldGeometry::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
|
|
{
|
|
AcDbText* pText = new AcDbText;
|
|
pText->setPosition(position);
|
|
pText->setNormal(normal);
|
|
pText->setTextString(pMsg);
|
|
pText->setHeight(pTextStyle.textSize());
|
|
pText->setWidthFactor(pTextStyle.xScale());
|
|
pText->setOblique(pTextStyle.obliquingAngle());
|
|
|
|
double dAngle = AcGeVector3d::kXAxis.angleTo(direction);
|
|
pText->setRotation(dAngle);
|
|
|
|
AcDbObjectId id;
|
|
toAcDbTextStyle((AcGiTextStyle &)pTextStyle,id);
|
|
pText->setTextStyle(id);
|
|
|
|
mpCustomWorldDraw->m_prcDrawingFlowData->append(pText);
|
|
|
|
return Adesk::kTrue;
|
|
}
|
|
|
|
Adesk::Boolean AecUnknownWorldGeometry::xline(const AcGePoint3d& one_xline_point,
|
|
const AcGePoint3d& a_different_xline_point
|
|
) const
|
|
{
|
|
return Adesk::kTrue;
|
|
}
|
|
|
|
Adesk::Boolean AecUnknownWorldGeometry::pline(const AcDbPolyline& lwBuf,
|
|
Adesk::UInt32 fromIndex,
|
|
Adesk::UInt32 numSegs
|
|
) const
|
|
{
|
|
return Adesk::kTrue;
|
|
}
|
|
|
|
Adesk::Boolean AecUnknownWorldGeometry::ray(const AcGePoint3d& rays_starting_point,
|
|
const AcGePoint3d& a_different_ray_point
|
|
) const
|
|
{
|
|
return Adesk::kTrue;
|
|
}
|
|
|
|
|
|
Adesk::Boolean AecUnknownWorldGeometry::pushModelTransform(const AcGeVector3d & vNormal)
|
|
{
|
|
return Adesk::kTrue;
|
|
}
|
|
|
|
Adesk::Boolean AecUnknownWorldGeometry::pushModelTransform(const AcGeMatrix3d & xMat)
|
|
{
|
|
return Adesk::kTrue;
|
|
}
|
|
|
|
Adesk::Boolean AecUnknownWorldGeometry::popModelTransform()
|
|
{
|
|
return Adesk::kTrue;
|
|
}
|
|
|
|
Adesk::Boolean AecUnknownWorldGeometry::draw(AcGiDrawable* pDra) const
|
|
{
|
|
return Adesk::kTrue;
|
|
}
|
|
|
|
Adesk::Boolean AecUnknownWorldGeometry::pushClipBoundary(AcGiClipBoundary * pBoundary)
|
|
{
|
|
return Adesk::kTrue;
|
|
}
|
|
|
|
void AecUnknownWorldGeometry::popClipBoundary()
|
|
{
|
|
return;
|
|
} |