请版主和高手指点,困扰我很久了,急呀
<p>我想在模型空间中选一多边形,然后在布局空间把这个多边形区域用视口剪切出来,可用旋转和缩放.现在我在旋转时发现视口边界里面的图形与模型空间的多边形不完全重合,缩放是没有问题的.</p><p> AcDbViewport *pViewport = new AcDbViewport();<br/> pViewport->setCenterPoint(AcGePoint3d(printableXmin/2+printableXmax/2, printableYmin/2+printableYmax/2,0)); <br/> double width,height;width=0;height=0;<br/> width=GetViewportWidth(trimobjectid);<br/> height=GetViewportHeigth(trimobjectid);<br/> pViewport->setHeight(height);<br/> pViewport->setWidth(width);<br/> AcGePoint3d rotatemodelcenterpt;<br/> rotatemodelcenterpt=GetModelSpaceObjectCenter(entId);<br/> rotatemodelcenterpt=rotatemodelcenterpt.rotateBy(twistangle,AcGeVector3d(0,0,1)); <br/> pViewport->setViewCenter(AcGePoint2d(rotatemodelcenterpt.x,rotatemodelcenterpt.y)); <br/> pViewport->setLensLength(50.0); <br/> pViewport->setNonRectClipEntityId(trimobjectid);<br/> pViewport->setNonRectClipOn();<br/> pViewport->setViewHeight(height*scale);<br/> pViewport->setViewDirection(AcGeVector3d(0,0,1));<br/> SetViewPortScale(pViewport,scale);<br/> pViewport->setTwistAngle(twistangle);<br/> // 将新的布局对象添加到图纸空间块表记录中<br/> AcDbObjectId viewportId;<br/> pBlkTblRcd->appendAcDbEntity(viewportId, pViewport);<br/> //pViewport->downgradeOpen();<br/> pViewport->setOn();<br/> pViewport->upgradeOpen();<br/> pViewport->close();<br/> pBlkTblRcd->close();</p> <p>这个是图片</p> 我的图片怎么不能上传
页:
[1]