- UID
- 11232
- 积分
- 0
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2002-10-12
- 最后登录
- 1970-1-1
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
为什么一下代码不能显示填充图案?请各位高手帮我分析一下,谢谢!
- [font=courier new]
- Adesk::Boolean zmyrectangle::worldDraw(AcGiWorldDraw* mode)
- {
- assertReadEnabled();
- // TODO: implement this function.
- AcGePoint3d Pts[2];
- AcGePoint3d pt[4];
- AcDbObjectId lineId0;
- AcDbObjectId lineId1;
- AcDbObjectId lineId2;
- AcDbObjectId lineId3;
- AcDbObjectIdArray dbObjIds;
- AcDbLine *line0;
- AcDbLine *line1;
- AcDbLine *line2;
- AcDbLine *line3;
- point(pt);
- Pts[0].x=pt[0].x;Pts[0].y=pt[0].y;Pts[0].z=0;
- Pts[1].x=pt[1].x;Pts[1].y=pt[1].y;Pts[1].z=0;
- line0=new AcDbLine(Pts[0],Pts[1]);
- line0->worldDraw(mode);
- //line->postToDb(line, lineId);
- dbObjIds.append(lineId0);
-
-
- Pts[0].x=pt[1].x;Pts[0].y=pt[1].y;Pts[0].z=0;
- Pts[1].x=pt[2].x;Pts[1].y=pt[2].y;Pts[1].z=0;
- line1=new AcDbLine(Pts[0],Pts[1]);
- line1->worldDraw(mode);
- //line->postToDb(line, lineId);
- dbObjIds.append(lineId1);
- Pts[0].x=pt[2].x;Pts[0].y=pt[2].y;Pts[0].z=0;
- Pts[1].x=pt[3].x;Pts[1].y=pt[3].y;Pts[1].z=0;
- line2=new AcDbLine(Pts[0],Pts[1]);
- line2->worldDraw(mode);
- //line->postToDb(line, lineId);
- dbObjIds.append(lineId2);
- Pts[0].x=pt[3].x;Pts[0].y=pt[3].y;Pts[0].z=0;
- Pts[1].x=pt[0].x;Pts[1].y=pt[0].y;Pts[1].z=0;
- line3=new AcDbLine(Pts[0],Pts[1]);
- line3->worldDraw(mode);
- //line->postToDb(line, lineId);
- dbObjIds.append(lineId3);
-
- AcDbHatch *pHatch=new AcDbHatch();
- AcGeVector3d normal(0.0, 1.0, 0.0);
- pHatch->setNormal(normal);
- //pHatch->setElevation(0.0);
- // Set hatch pattern to ANSI31 predefined type
- //
- pHatch->setPattern(AcDbHatch::kPreDefined, "ANSI31");
- // Set Associativity
- //
- // pHatch->setAssociative(Adesk::kTrue);
-
- // Append an internal loop (circle) to hatch boundary
- //
- //pHatch->appendLoop(AcDbHatch::kDefault, dbObjIds);
- pHatch->appendLoop(AcDbHatch::kExternal, dbObjIds);
- pHatch->worldDraw(mode);
- // Elaborate hatch lines
- //
- pHatch->evaluateHatch();
- // Post hatch entity to database
- //
- //pHatch->postToDb(pHatch);
-
- delete pHatch;
- delete line0;
- delete line1;
- delete line2;
- delete line3;
- return Acad::eOk;
- }Adesk::Boolean zmyrectangle::worldDraw(AcGiWorldDraw* mode)
- {
- assertReadEnabled();
- // TODO: implement this function.
- AcGePoint3d Pts[2];
- AcGePoint3d pt[4];
- AcDbObjectId lineId0;
- AcDbObjectId lineId1;
- AcDbObjectId lineId2;
- AcDbObjectId lineId3;
- AcDbObjectIdArray dbObjIds;
- AcDbLine *line0;
- AcDbLine *line1;
- AcDbLine *line2;
- AcDbLine *line3;
- point(pt);
- Pts[0].x=pt[0].x;Pts[0].y=pt[0].y;Pts[0].z=0;
- Pts[1].x=pt[1].x;Pts[1].y=pt[1].y;Pts[1].z=0;
- line0=new AcDbLine(Pts[0],Pts[1]);
- line0->worldDraw(mode);
- //line->postToDb(line, lineId);
- dbObjIds.append(lineId0);
-
-
- Pts[0].x=pt[1].x;Pts[0].y=pt[1].y;Pts[0].z=0;
- Pts[1].x=pt[2].x;Pts[1].y=pt[2].y;Pts[1].z=0;
- line1=new AcDbLine(Pts[0],Pts[1]);
- line1->worldDraw(mode);
- //line->postToDb(line, lineId);
- dbObjIds.append(lineId1);
- Pts[0].x=pt[2].x;Pts[0].y=pt[2].y;Pts[0].z=0;
- Pts[1].x=pt[3].x;Pts[1].y=pt[3].y;Pts[1].z=0;
- line2=new AcDbLine(Pts[0],Pts[1]);
- line2->worldDraw(mode);
- //line->postToDb(line, lineId);
- dbObjIds.append(lineId2);
- Pts[0].x=pt[3].x;Pts[0].y=pt[3].y;Pts[0].z=0;
- Pts[1].x=pt[0].x;Pts[1].y=pt[0].y;Pts[1].z=0;
- line3=new AcDbLine(Pts[0],Pts[1]);
- line3->worldDraw(mode);
- //line->postToDb(line, lineId);
- dbObjIds.append(lineId3);
-
- AcDbHatch *pHatch=new AcDbHatch();
- AcGeVector3d normal(0.0, 1.0, 0.0);
- pHatch->setNormal(normal);
- //pHatch->setElevation(0.0);
- // Set hatch pattern to ANSI31 predefined type
- //
- pHatch->setPattern(AcDbHatch::kPreDefined, "ANSI31");
- // Set Associativity
- //
- // pHatch->setAssociative(Adesk::kTrue);
-
- // Append an internal loop (circle) to hatch boundary
- //
- //pHatch->appendLoop(AcDbHatch::kDefault, dbObjIds);
- pHatch->appendLoop(AcDbHatch::kExternal, dbObjIds);
- pHatch->worldDraw(mode);
- // Elaborate hatch lines
- //
- pHatch->evaluateHatch();
- // Post hatch entity to database
- //
- //pHatch->postToDb(pHatch);
-
- delete pHatch;
- delete line0;
- delete line1;
- delete line2;
- delete line3;
- return Acad::eOk;
- }Adesk::Boolean zmyrectangle::worldDraw(AcGiWorldDraw* mode)
- {
- assertReadEnabled();
- // TODO: implement this function.
- AcGePoint3d Pts[2];
- AcGePoint3d pt[4];
- AcDbObjectId lineId0;
- AcDbObjectId lineId1;
- AcDbObjectId lineId2;
- AcDbObjectId lineId3;
- AcDbObjectIdArray dbObjIds;
- AcDbLine *line0;
- AcDbLine *line1;
- AcDbLine *line2;
- AcDbLine *line3;
- point(pt);
- Pts[0].x=pt[0].x;Pts[0].y=pt[0].y;Pts[0].z=0;
- Pts[1].x=pt[1].x;Pts[1].y=pt[1].y;Pts[1].z=0;
- line0=new AcDbLine(Pts[0],Pts[1]);
- line0->worldDraw(mode);
- //line->postToDb(line, lineId);
- dbObjIds.append(lineId0);
-
-
- Pts[0].x=pt[1].x;Pts[0].y=pt[1].y;Pts[0].z=0;
- Pts[1].x=pt[2].x;Pts[1].y=pt[2].y;Pts[1].z=0;
- line1=new AcDbLine(Pts[0],Pts[1]);
- line1->worldDraw(mode);
- //line->postToDb(line, lineId);
- dbObjIds.append(lineId1);
- Pts[0].x=pt[2].x;Pts[0].y=pt[2].y;Pts[0].z=0;
- Pts[1].x=pt[3].x;Pts[1].y=pt[3].y;Pts[1].z=0;
- line2=new AcDbLine(Pts[0],Pts[1]);
- line2->worldDraw(mode);
- //line->postToDb(line, lineId);
- dbObjIds.append(lineId2);
- Pts[0].x=pt[3].x;Pts[0].y=pt[3].y;Pts[0].z=0;
- Pts[1].x=pt[0].x;Pts[1].y=pt[0].y;Pts[1].z=0;
- line3=new AcDbLine(Pts[0],Pts[1]);
- line3->worldDraw(mode);
- //line->postToDb(line, lineId);
- dbObjIds.append(lineId3);
-
- AcDbHatch *pHatch=new AcDbHatch();
- AcGeVector3d normal(0.0, 1.0, 0.0);
- pHatch->setNormal(normal);
- //pHatch->setElevation(0.0);
- // Set hatch pattern to ANSI31 predefined type
- //
- pHatch->setPattern(AcDbHatch::kPreDefined, "ANSI31");
- // Set Associativity
- //
- // pHatch->setAssociative(Adesk::kTrue);
-
- // Append an internal loop (circle) to hatch boundary
- //
- //pHatch->appendLoop(AcDbHatch::kDefault, dbObjIds);
- pHatch->appendLoop(AcDbHatch::kExternal, dbObjIds);
- pHatch->worldDraw(mode);
- // Elaborate hatch lines
- //
- pHatch->evaluateHatch();
- // Post hatch entity to database
- //
- //pHatch->postToDb(pHatch);
-
- delete pHatch;
- delete line0;
- delete line1;
- delete line2;
- delete line3;
- return Acad::eOk;
- }
- [/font]
复制代码 |
|