本文整理汇总了C++中EDA_RECT::GetBoundingBoxRotated方法的典型用法代码示例。如果您正苦于以下问题:C++ EDA_RECT::GetBoundingBoxRotated方法的具体用法?C++ EDA_RECT::GetBoundingBoxRotated怎么用?C++ EDA_RECT::GetBoundingBoxRotated使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EDA_RECT
的用法示例。
在下文中一共展示了EDA_RECT::GetBoundingBoxRotated方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetBoundingBox
const EDA_RECT TEXTE_PCB::GetBoundingBox() const
{
EDA_RECT rect = GetTextBox( -1, -1 );
if( m_Orient )
rect = rect.GetBoundingBoxRotated( m_Pos, m_Orient );
return rect;
}
示例2: GetBoundingBox
const EDA_RECT TEXTE_PCB::GetBoundingBox() const
{
EDA_RECT rect = GetTextBox( -1, -1 );
if( GetTextAngle() )
rect = rect.GetBoundingBoxRotated( GetTextPos(), GetTextAngle() );
return rect;
}
示例3: GetBoundingBox
const EDA_RECT D_PAD::GetBoundingBox() const
{
EDA_RECT area;
wxPoint quadrant1, quadrant2, quadrant3, quadrant4;
int x, y, r, dx, dy;
wxPoint center = ShapePos();
wxPoint endPoint;
EDA_RECT endRect;
switch( GetShape() )
{
case PAD_SHAPE_CIRCLE:
area.SetOrigin( center );
area.Inflate( m_Size.x / 2 );
break;
case PAD_SHAPE_OVAL:
/* To get the BoundingBox of an oval pad:
* a) If the pad is ROUND, see method for PAD_SHAPE_CIRCLE above
* OTHERWISE:
* b) Construct EDA_RECT for portion between circular ends
* c) Rotate that EDA_RECT
* d) Add the circular ends to the EDA_RECT
*/
// Test if the shape is circular
if( m_Size.x == m_Size.y )
{
area.SetOrigin( center );
area.Inflate( m_Size.x / 2 );
break;
}
if( m_Size.x > m_Size.y )
{
// Pad is horizontal
dx = ( m_Size.x - m_Size.y ) / 2;
dy = m_Size.y / 2;
// Location of end-points
x = dx;
y = 0;
r = dy;
}
else
{
// Pad is vertical
dx = m_Size.x / 2;
dy = ( m_Size.y - m_Size.x ) / 2;
x = 0;
y = dy;
r = dx;
}
// Construct the center rectangle and rotate
area.SetOrigin( center );
area.Inflate( dx, dy );
area = area.GetBoundingBoxRotated( center, m_Orient );
endPoint = wxPoint( x, y );
RotatePoint( &endPoint, m_Orient );
// Add points at each quadrant of circular regions
endRect.SetOrigin( center + endPoint );
endRect.Inflate( r );
area.Merge( endRect );
endRect.SetSize( 0, 0 );
endRect.SetOrigin( center - endPoint );
endRect.Inflate( r );
area.Merge( endRect );
break;
case PAD_SHAPE_RECT:
case PAD_SHAPE_ROUNDRECT:
// Use two opposite corners and track their rotation
// (use symmetry for other points)
quadrant1.x = m_Size.x/2;
quadrant1.y = m_Size.y/2;
quadrant2.x = -m_Size.x/2;
quadrant2.y = m_Size.y/2;
RotatePoint( &quadrant1, m_Orient );
RotatePoint( &quadrant2, m_Orient );
dx = std::max( std::abs( quadrant1.x ) , std::abs( quadrant2.x ) );
dy = std::max( std::abs( quadrant1.y ) , std::abs( quadrant2.y ) );
// Set the bbox
area.SetOrigin( ShapePos() );
area.Inflate( dx, dy );
break;
case PAD_SHAPE_TRAPEZOID:
// Use the four corners and track their rotation
//.........这里部分代码省略.........