本文整理汇总了C++中TEXTE_MODULE::SetDrawCoord方法的典型用法代码示例。如果您正苦于以下问题:C++ TEXTE_MODULE::SetDrawCoord方法的具体用法?C++ TEXTE_MODULE::SetDrawCoord怎么用?C++ TEXTE_MODULE::SetDrawCoord使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TEXTE_MODULE
的用法示例。
在下文中一共展示了TEXTE_MODULE::SetDrawCoord方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MoveAnchorPosition
void MODULE::MoveAnchorPosition( const wxPoint& aMoveVector )
{
/* Move the reference point of the footprint
* the footprints elements (pads, outlines, edges .. ) are moved
* but:
* - the footprint position is not modified.
* - the relative (local) coordinates of these items are modified
*/
wxPoint footprintPos = GetPosition();
/* Update the relative coordinates:
* The coordinates are relative to the anchor point.
* Calculate deltaX and deltaY from the anchor. */
wxPoint moveVector = aMoveVector;
RotatePoint( &moveVector, -GetOrientation() );
// Update of the reference and value.
m_Reference->SetPos0( m_Reference->GetPos0() + moveVector );
m_Reference->SetDrawCoord();
m_Value->SetPos0( m_Value->GetPos0() + moveVector );
m_Value->SetDrawCoord();
// Update the pad local coordinates.
for( D_PAD* pad = Pads(); pad; pad = pad->Next() )
{
pad->SetPos0( pad->GetPos0() + moveVector );
pad->SetPosition( pad->GetPos0() + footprintPos );
}
// Update the draw element coordinates.
for( EDA_ITEM* item = GraphicalItems(); item; item = item->Next() )
{
switch( item->Type() )
{
case PCB_MODULE_EDGE_T:
{
EDGE_MODULE* edge = static_cast<EDGE_MODULE*>( item );
edge->m_Start0 += moveVector;
edge->m_End0 += moveVector;
edge->SetDrawCoord();
break;
}
case PCB_MODULE_TEXT_T:
{
TEXTE_MODULE* text = static_cast<TEXTE_MODULE*>( item );
text->SetPos0( text->GetPos0() + moveVector );
text->SetDrawCoord();
break;
}
default:
break;
}
}
CalculateBoundingBox();
}
示例2: SetOrientation
void MODULE::SetOrientation( double newangle )
{
double angleChange = newangle - m_Orient; // change in rotation
wxPoint pt;
NORMALIZE_ANGLE_POS( newangle );
m_Orient = newangle;
for( D_PAD* pad = m_Pads; pad; pad = pad->Next() )
{
pt = pad->GetPos0();
pad->SetOrientation( pad->GetOrientation() + angleChange );
RotatePoint( &pt, m_Orient );
pad->SetPosition( GetPosition() + pt );
}
// Update of the reference and value.
m_Reference->SetDrawCoord();
m_Value->SetDrawCoord();
// Displace contours and text of the footprint.
for( BOARD_ITEM* item = m_Drawings; item; item = item->Next() )
{
if( item->Type() == PCB_MODULE_EDGE_T )
{
EDGE_MODULE* edge = (EDGE_MODULE*) item;
edge->SetDrawCoord();
}
else if( item->Type() == PCB_MODULE_TEXT_T )
{
TEXTE_MODULE* text = (TEXTE_MODULE*) item;
text->SetDrawCoord();
}
}
CalculateBoundingBox();
}
示例3: OnOkClick
void DialogEditModuleText::OnOkClick( wxCommandEvent& event )
{
wxString msg;
if ( m_module)
m_parent->SaveCopyInUndoList( m_module, UR_CHANGED );
#ifndef USE_WX_OVERLAY
if( m_dc ) //Erase old text on screen
{
m_currentText->Draw( m_parent->GetCanvas(), m_dc, GR_XOR,
(m_currentText->IsMoving()) ? MoveVector : wxPoint( 0, 0 ) );
}
#endif
m_currentText->SetText( m_Name->GetValue() );
m_currentText->SetItalic( m_Style->GetSelection() == 1 );
wxPoint tmp;
msg = m_TxtPosCtrlX->GetValue();
tmp.x = ValueFromString( g_UserUnit, msg );
msg = m_TxtPosCtrlY->GetValue();
tmp.y = ValueFromString( g_UserUnit, msg );
m_currentText->SetPos0( tmp );
wxSize textSize( wxSize( ValueFromString( g_UserUnit, m_TxtSizeCtrlX->GetValue() ),
ValueFromString( g_UserUnit, m_TxtSizeCtrlY->GetValue() ) ) );
// Test for a reasonnable size:
if( textSize.x < TEXTS_MIN_SIZE )
textSize.x = TEXTS_MIN_SIZE;
if( textSize.y < TEXTS_MIN_SIZE )
textSize.y = TEXTS_MIN_SIZE;
m_currentText->SetSize( textSize ),
msg = m_TxtWidthCtlr->GetValue();
int width = ValueFromString( g_UserUnit, msg );
// Test for a reasonnable width:
if( width <= 1 )
width = 1;
int maxthickness = Clamp_Text_PenSize(width, m_currentText->GetSize() );
if( width > maxthickness )
{
DisplayError( NULL,
_( "The text thickness is too large for the text size. It will be clamped" ) );
width = maxthickness;
}
m_currentText->SetThickness( width );
m_currentText->SetVisible( m_Show->GetSelection() == 0 );
int text_orient = (m_Orient->GetSelection() == 0) ? 0 : 900;
m_currentText->SetOrientation( text_orient );
m_currentText->SetDrawCoord();
#ifndef USE_WX_OVERLAY
if( m_dc ) // Display new text
{
m_currentText->Draw( m_parent->GetCanvas(), m_dc, GR_XOR,
(m_currentText->IsMoving()) ? MoveVector : wxPoint( 0, 0 ) );
}
#else
m_parent->Refresh();
#endif
m_parent->OnModify();
if( m_module )
m_module->SetLastEditTime();
EndModal(1);
}