本文整理汇总了C++中TEXTE_MODULE::GetOrientation方法的典型用法代码示例。如果您正苦于以下问题:C++ TEXTE_MODULE::GetOrientation方法的具体用法?C++ TEXTE_MODULE::GetOrientation怎么用?C++ TEXTE_MODULE::GetOrientation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TEXTE_MODULE
的用法示例。
在下文中一共展示了TEXTE_MODULE::GetOrientation方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: initDlg
void DialogEditModuleText::initDlg( )
{
SetFocus();
wxString msg;
if( m_module )
{
wxString format = m_ModuleInfoText->GetLabel();
msg.Printf( format,
GetChars( m_module->GetReference() ),
GetChars( m_module->GetValue() ),
m_module->GetOrientation() / 10.0 );
}
else
{
msg.Empty();
}
m_ModuleInfoText->SetLabel( msg );
switch( m_currentText->GetType() )
{
case TEXTE_MODULE::TEXT_is_VALUE:
m_TextDataTitle->SetLabel( _( "Value:" ) );
break;
case TEXTE_MODULE::TEXT_is_DIVERS:
m_TextDataTitle->SetLabel( _( "Text:" ) );
break;
default:
m_TextDataTitle->SetLabel( _( "Reference:" ) );
break;
}
m_Name->SetValue( m_currentText->GetText() );
m_Style->SetSelection( m_currentText->IsItalic() ? 1 : 0 );
AddUnitSymbol( *m_SizeXTitle );
PutValueInLocalUnits( *m_TxtSizeCtrlX, m_currentText->GetSize().x );
AddUnitSymbol( *m_SizeYTitle );
PutValueInLocalUnits( *m_TxtSizeCtrlY, m_currentText->GetSize().y );
AddUnitSymbol( *m_PosXTitle );
PutValueInLocalUnits( *m_TxtPosCtrlX, m_currentText->GetPos0().x );
AddUnitSymbol( *m_PosYTitle );
PutValueInLocalUnits( *m_TxtPosCtrlY, m_currentText->GetPos0().y );
AddUnitSymbol( *m_WidthTitle );
PutValueInLocalUnits( *m_TxtWidthCtlr, m_currentText->GetThickness() );
double text_orient = m_currentText->GetOrientation();
NORMALIZE_ANGLE_90( text_orient );
if( (text_orient != 0) )
m_Orient->SetSelection( 1 );
if( !m_currentText->IsVisible() )
m_Show->SetSelection( 1 );;
}
示例2: RotateMarkedItems
/** Rotate marked items, refer to a rotation point at position offset
* Note: because this function is used in global transform,
* if force_all is true, all items will be rotated
*/
void RotateMarkedItems( MODULE* module, wxPoint offset, bool force_all )
{
#define ROTATE( z ) RotatePoint( (&z), offset, 900 )
if( module == NULL )
return;
for( D_PAD* pad = module->Pads(); pad; pad = pad->Next() )
{
if( !pad->IsSelected() && !force_all )
continue;
wxPoint pos = pad->GetPosition();
ROTATE( pos );
pad->SetPosition( pos );
pad->SetPos0( pad->GetPosition() );
pad->SetOrientation( pad->GetOrientation() + 900 );
}
for( EDA_ITEM* item = module->GraphicalItems(); item; item = item->Next() )
{
if( !item->IsSelected() && !force_all)
continue;
switch( item->Type() )
{
case PCB_MODULE_EDGE_T:
{
EDGE_MODULE* em = (EDGE_MODULE*) item;
wxPoint tmp = em->GetStart();
ROTATE( tmp );
em->SetStart( tmp );
em->SetStart0( tmp );
tmp = em->GetEnd();
ROTATE( tmp );
em->SetEnd( tmp );
em->SetEnd0( tmp );
}
break;
case PCB_MODULE_TEXT_T:
{
TEXTE_MODULE* tm = (TEXTE_MODULE*) item;
wxPoint pos = tm->GetTextPosition();
ROTATE( pos );
tm->SetTextPosition( pos );
tm->SetPos0( tm->GetTextPosition() );
tm->SetOrientation( tm->GetOrientation() + 900 );
}
break;
default:
;
}
item->ClearFlags();
}
}
示例3: CreateComponentsSection
/* Creates the section $COMPONENTS (Footprints placement)
* Bottom side components are difficult to handle: shapes must be mirrored or
* flipped, silk layers need to be handled correctly and so on. Also it seems
* that *noone* follows the specs...
*/
static void CreateComponentsSection( FILE* aFile, BOARD* aPcb )
{
fputs( "$COMPONENTS\n", aFile );
int cu_count = aPcb->GetCopperLayerCount();
for( MODULE* module = aPcb->m_Modules; module; module = module->Next() )
{
const char* mirror;
const char* flip;
double fp_orient = module->GetOrientation();
if( module->GetFlag() )
{
mirror = "0";
flip = "FLIP";
NEGATE_AND_NORMALIZE_ANGLE_POS( fp_orient );
}
else
{
mirror = "0";
flip = "0";
}
fprintf( aFile, "\nCOMPONENT %s\n",
TO_UTF8( module->GetReference() ) );
fprintf( aFile, "DEVICE %s_%s\n",
TO_UTF8( module->GetReference() ),
TO_UTF8( module->GetValue() ) );
fprintf( aFile, "PLACE %g %g\n",
MapXTo( module->GetPosition().x ),
MapYTo( module->GetPosition().y ) );
fprintf( aFile, "LAYER %s\n",
(module->GetFlag()) ? "BOTTOM" : "TOP" );
fprintf( aFile, "ROTATION %g\n",
fp_orient / 10.0 );
fprintf( aFile, "SHAPE %s %s %s\n",
TO_UTF8( module->GetReference() ),
mirror, flip );
// Text on silk layer: RefDes and value (are they actually useful?)
TEXTE_MODULE *textmod = &module->Reference();
for( int ii = 0; ii < 2; ii++ )
{
double txt_orient = textmod->GetOrientation();
std::string layer = GenCADLayerName( cu_count, module->GetFlag() ? B_SilkS : F_SilkS );
fprintf( aFile, "TEXT %g %g %g %g %s %s \"%s\"",
textmod->GetPos0().x / SCALE_FACTOR,
-textmod->GetPos0().y / SCALE_FACTOR,
textmod->GetSize().x / SCALE_FACTOR,
txt_orient / 10.0,
mirror,
layer.c_str(),
TO_UTF8( textmod->GetText() ) );
// Please note, the width is approx
fprintf( aFile, " 0 0 %g %g\n",
( textmod->GetSize().x * textmod->GetLength() ) / SCALE_FACTOR,
textmod->GetSize().y / SCALE_FACTOR );
textmod = &module->Value(); // Dirty trick for the second iteration
}
// The SHEET is a 'generic description' for referencing the component
fprintf( aFile, "SHEET \"RefDes: %s, Value: %s\"\n",
TO_UTF8( module->GetReference() ),
TO_UTF8( module->GetValue() ) );
}
fputs( "$ENDCOMPONENTS\n\n", aFile );
}