在下面的示例中,在绘制任何内容之前将剪辑边界推送到剪辑边界堆栈上,并在完成此对象的绘制后再次弹出: Adesk::Boolean MyObject::subWorldDraw(AcGiWorldDraw* pDraw) { AcGiWorldGeometry * pGeom = &pDraw->geometry(); pGeom->pushModelTransform(myTransform()); AcGiClipBoundary cb; cb.m_bDrawBoundary = true; cb.m_vNormal = AcGeVector3d::kZAxis; cb.m_ptPoint = AcGePoint3d::kOrigin; // Two points treated as a rectangle, three creates a triangle cb.m_aptPoints.append(AcGePoint2d(0,0)); cb.m_aptPoints.append(AcGePoint2d(5,5)); // We are clipping in our own space cb.m_xToClipSpace.setToIdentity(); cb.m_xInverseBlockRefXForm = myTransform().inverse(); // No Z clipping cb.m_bClippingBack = cb.m_bClippingFront = false; cb.m_dFrontClipZ = cb.m_dBackClipZ = 0.; Adesk::Boolean bPopClipBoundary = pGeom->pushClipBoundary(&cb); // Draw something pGeom->circle(...); pGeom->popModelTransform(); if(bPopClipBoundary){ pGeom->popClipBoundary(); } return true; // world-only } 由于此剪辑是一项复杂的操作,因此某些 AcGi 实现可能不完全支持它。在这种情况下,AcGi 实现可能会返回 false,因此不应调用。pushClipBoundary()popClipBoundary() |
|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2025-1-8 19:06
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.