查看单个帖子
旧 2009-05-07, 03:56 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】simple Hatch Problem

simple hatch problem
simple hatch problem
odgepoint2darray vertexpts;
odgedoublearray vertexbulges;
oddbblocktablerecordptr precord;
precord = current_block_id_.safeopenobject(oddb::kforwrite);
oddbhatchptr phatch;
phatch = oddbhatch::createobject();
odgevector3d normal(0.0, 0.0, 1.0);
phatch->setnormal(normal);
phatch->setelevation(0.0);
phatch->setpattern(oddbhatch::kpredefined, "solid");
phatch->sethatchstyle(oddbhatch::knormal );
phatch->setassociative( false );
//populate the vertex points and bulges from our data:
//point1: -68.181599, 52.303400
//point2: -1.116669, 50.842521
//point3: -1.116669, 0.081812
//point4: -65.909121, 0.081811
for( n=0; n < our_point_array.size(); n++)
{
vertexpts.push_back( our_point_array[n] );
vertexbulges.push_back( 0 );
}
// make sure start and end points are coincident
if( vertexpts.first() != vertexpts.last() )
{
vertexpts.push_back( vertexpts.first() );
vertexbulges.push_back( 0 );
}
//and it crashes hard here:
phatch->appendloop(oddbhatch::kexternal, vertexpts, vertexbulges);
i'm using the 1.14 libraries, where am i going wrong?
i've upgraded to the 2.2 libraries, and the problem still exists. am i the only one unable to create a hatch using this method? my next course of action is to convert my polygon points to edge pointers. any advice is appreciated.
ray
you need specify polyline flag in looptype parameter:
code:
phatch->appendloop(oddbhatch::kexternal | oddbhatch::kpolyline, vertexpts, vertexbulges);
sergey slezkin
thank you,
that solved the issue.
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)