- UID
- 254909
- 积分
- 0
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2005-5-7
- 最后登录
- 1970-1-1
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
AcDbVoidPtrArray Region1,Region2,Form1,Form2;
AcDbPolyline *pintersectline; //用于存放交集生成的POLY线
AcGePlane planetemp; //不知道有什么用,参数要求的
AcGePoint3dArray intersectpoint; //用于存放交集的点数组
AcGePoint2dArray interpoint; //用于存放交集的2d点数组,用于生成POLY线
AcDbPolyline* Pline1=m_RadialLine;//8小时16小时范围Pline
//用等时线范围暂时代替等时线
AcDbPolyline *Pline2=m_RangeLine;
//AcDbPolyline* Pline2=m_PlaneIsoChrone;//等时线的Pline
AcDbRegion *pRegion1,*pRegion2;
Acad::ErrorStatus es;
int i;
Form1.append((AcDbCurve *)Pline1);
Form2.append((AcDbCurve *)Pline2);
es=AcDbRegion::createFromCurves(Form1,Region1);
for (i=0;i<Form1.length();i++)
((AcDbCurve *)Form1)->close();
SCGGraphCreate TempLine1;
Pline1->close();
//TempLine1.AddToDatabase(Pline1);
//TempLine1.AddToDatabase(Pline2);
if (es!=Acad::eOk)
{
AfxMessageBox("计算失败!");
Pline2->close();
return FALSE;
}
pRegion1=(AcDbRegion *)Region1[0];
es=AcDbRegion::createFromCurves(Form2,Region2);
for (i=0;i<Form2.length();i++)
((AcDbCurve *)Form2)->close();
Pline2->close();
if (es!=Acad::eOk)
{
AfxMessageBox("计算失败!");
for(i=0; i<Region2.length();i++)
delete (AcDbRegion *)Region2;
delete pRegion1;
return FALSE;
}
pRegion2=(AcDbRegion *)Region2[0];
es=pRegion1->intersectWith((AcDbEntity*)pRegion2,AcDb::Intersect::kOnBothOperands,planetemp,intersectpoint,0,0);
delete pRegion1;
delete pRegion2;
if (es!=Acad::eOk)
{
AfxMessageBox("交集失败!");
return FALSE;
}
TempLine1.Convert3dTo2d(intersectpoint,interpoint);
pintersectline=CreatePLine(interpoint,1,3,"SA_LAYER_SHADOW",0,0);
// TempLine1.AddToDatabase(pintersectline);
// pintersectline->close();
AcDbVoidPtrArray Region3,Form3;
AcDbRegion *pRegion3;//上面两个面域都能创建,就下面这个不行,急啊,谢谢!
Form3.append((AcDbCurve *)pintersectline);
es=AcDbRegion::createFromCurves(Form3,Region3);
for (i=0;i<Form3.length();i++)
((AcDbCurve *)Form3)->close();
pintersectline->close();
if (es!=Acad::eOk)
{
AfxMessageBox("计算失败!");
Pline2->close();
return FALSE;
}
pRegion3=(AcDbRegion *)Region3[0];
delete pRegion3;
return FALSE; |
|