本文整理汇总了C++中BOX2I::GetOrigin方法的典型用法代码示例。如果您正苦于以下问题:C++ BOX2I::GetOrigin方法的具体用法?C++ BOX2I::GetOrigin怎么用?C++ BOX2I::GetOrigin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BOX2I
的用法示例。
在下文中一共展示了BOX2I::GetOrigin方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: redraw
void DIALOG_PAD_PROPERTIES::redraw()
{
if( m_parent->IsGalCanvasActive() )
{
m_dummyPad->ViewUpdate();
BOX2I bbox = m_dummyPad->ViewBBox();
if( bbox.GetSize().x > 0 && bbox.GetSize().y > 0 )
{
// gives a size to the full drawable area
BOX2I drawbox;
drawbox.Move( m_dummyPad->GetPosition() );
drawbox.Inflate( bbox.GetSize().x*2, bbox.GetSize().y*2 );
m_panelShowPadGal->GetView()->SetBoundary( drawbox );
// Autozoom
m_panelShowPadGal->GetView()->SetViewport( BOX2D( bbox.GetOrigin(), bbox.GetSize() ) );
// Add a margin
m_panelShowPadGal->GetView()->SetScale( m_panelShowPadGal->GetView()->GetScale() * 0.7 );
m_panelShowPadGal->Refresh();
}
}
else
{
m_panelShowPad->Refresh();
}
}
示例2: AddBox
void AddBox( BOX2I aB, int aColor )
{
SHAPE_LINE_CHAIN l;
VECTOR2I o = aB.GetOrigin();
VECTOR2I s = aB.GetSize();
l.Append( o );
l.Append( o.x + s.x, o.y );
l.Append( o.x + s.x, o.y + s.y );
l.Append( o.x, o.y + s.y );
l.Append( o );
AddLine( l, aColor, 10000 );
}
示例3: DrawDebugBox
void DrawDebugBox( BOX2I aB, int aColor )
{
SHAPE_LINE_CHAIN l;
VECTOR2I o = aB.GetOrigin();
VECTOR2I s = aB.GetSize();
l.Append( o );
l.Append( o.x + s.x, o.y );
l.Append( o.x + s.x, o.y + s.y );
l.Append( o.x, o.y + s.y );
l.Append( o );
ROUTER::GetInstance()->DisplayDebugLine( l, aColor, 10000 );
}
示例4: ConvexHull
const SHAPE_LINE_CHAIN ConvexHull( const SHAPE_CONVEX& aConvex, int aClearance )
{
// this defines the horizontal and vertical lines in the hull octagon
BOX2I box = aConvex.BBox( aClearance + HULL_MARGIN );
box.Normalize();
SEG topline = SEG( VECTOR2I( box.GetX(), box.GetY() + box.GetHeight() ),
VECTOR2I( box.GetX() + box.GetWidth(), box.GetY() + box.GetHeight() ) );
SEG rightline = SEG( VECTOR2I( box.GetX() + box.GetWidth(), box.GetY() + box.GetHeight() ),
VECTOR2I( box.GetX() + box.GetWidth(), box.GetY() ) );
SEG bottomline = SEG( VECTOR2I( box.GetX() + box.GetWidth(), box.GetY() ),
box.GetOrigin() );
SEG leftline = SEG( box.GetOrigin(), VECTOR2I( box.GetX(), box.GetY() + box.GetHeight() ) );
const SHAPE_LINE_CHAIN& vertices = aConvex.Vertices();
// top right diagonal
VECTOR2I corner = box.GetOrigin() + box.GetSize();
SEG toprightline = SEG( corner,
corner + VECTOR2I( box.GetHeight(), -box.GetHeight() ) );
MoveDiagonal( toprightline, vertices, aClearance );
// bottom right diagonal
corner = box.GetOrigin() + VECTOR2I( box.GetWidth(), 0 );
SEG bottomrightline = SEG( corner + VECTOR2I( box.GetHeight(), box.GetHeight() ),
corner );
MoveDiagonal( bottomrightline, vertices, aClearance );
// bottom left diagonal
corner = box.GetOrigin();
SEG bottomleftline = SEG( corner,
corner + VECTOR2I( -box.GetHeight(), box.GetHeight() ) );
MoveDiagonal( bottomleftline, vertices, aClearance );
// top left diagonal
corner = box.GetOrigin() + VECTOR2I( 0, box.GetHeight() );
SEG topleftline = SEG( corner + VECTOR2I( -box.GetHeight(), -box.GetHeight() ),
corner );
MoveDiagonal( topleftline, vertices, aClearance );
SHAPE_LINE_CHAIN octagon;
octagon.SetClosed( true );
octagon.Append( *leftline.IntersectLines( bottomleftline ) );
octagon.Append( *bottomline.IntersectLines( bottomleftline ) );
octagon.Append( *bottomline.IntersectLines( bottomrightline ) );
octagon.Append( *rightline.IntersectLines( bottomrightline ) );
octagon.Append( *rightline.IntersectLines( toprightline ) );
octagon.Append( *topline.IntersectLines( toprightline ) );
octagon.Append( *topline.IntersectLines( topleftline ) );
octagon.Append( *leftline.IntersectLines( topleftline ) );
return octagon;
}
示例5: redraw
void DIALOG_PAD_PROPERTIES::redraw()
{
if( m_parent->IsGalCanvasActive() )
{
m_dummyPad->ViewUpdate();
BOX2I bbox = m_dummyPad->ViewBBox();
if( bbox.GetSize().x > 0 && bbox.GetSize().y > 0 )
{
// Autozoom
m_panelShowPadGal->GetView()->SetViewport( BOX2D( bbox.GetOrigin(), bbox.GetSize() ) );
// Add a margin
m_panelShowPadGal->GetView()->SetScale( m_panelShowPadGal->GetView()->GetScale() * 0.7 );
m_panelShowPadGal->Refresh();
}
}
else
{
m_panelShowPad->Refresh();
}
}