如何在自定义实体中创建 AcDbWipeout?
我搜索了一些代码,但它不起作用。
- Adesk::Boolean CMyGcd::subWorldDraw (AcGiWorldDraw *mode) {
- assertReadEnabled () ;
- //return (AcDbCurve::subWorldDraw (mode)) ;
- Acad::ErrorStatus es;
- //......
- //wipeout
- es = AcDbWipeout::createImageDefinition();
- AcDbWipeout *pWipe = new AcDbWipeout();
- if(pWipe == NULL) return (Adesk::kFalse);
- pWipe->setDatabaseDefaults();
- AcGePoint3d originPnt;
- getTextPosition(originPnt);
- AcGeVector3d Udirection(1,0,0);
- AcGeVector3d Vdirection(0,-1,0);
- pWipe->setOrientation(originPnt,Udirection,Vdirection);
- // Set the clip boundary for the wipeout - this is very important
- AcGePoint2dArray *ptArray = new AcGePoint2dArray(5,5);
- AcGePoint3dArray vertexArray;
- es = getExtentsBox(vertexArray);
- AcGePoint2d p0,p1;
- p0 = AcGePoint2d(vertexArray[0].x,vertexArray[0].y);
- p1 = AcGePoint2d(vertexArray[1].x,vertexArray[1].y);
-
- //AcGePoint2dArray ptArray;
- ptArray->append(p0);
- ptArray->append(AcGePoint2d(p1.x,p0.y));
- ptArray->append(p1);
- ptArray->append(AcGePoint2d(p0.x,p1.y));
- ptArray->append(p0);
- pWipe->setDisplayOpt(AcDbRasterImage::kTransparent,Adesk::kTrue);
- pWipe->setDisplayOpt( AcDbRasterImage::kShow, true);
- es = pWipe->setClipBoundaryToWholeImage();
- es = pWipe->setClipBoundary(AcDbRasterImage::kPoly,*ptArray);
- pWipe->worldDraw(mode);
- //mode->geometry().draw(pWipe);
- delete pWipe;
- pWipe = NULL;
- //...
- return (Adesk::kTrue);
- }
|