本文整理汇总了C++中TEXTE_MODULE::GetTextSize方法的典型用法代码示例。如果您正苦于以下问题:C++ TEXTE_MODULE::GetTextSize方法的具体用法?C++ TEXTE_MODULE::GetTextSize怎么用?C++ TEXTE_MODULE::GetTextSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TEXTE_MODULE
的用法示例。
在下文中一共展示了TEXTE_MODULE::GetTextSize方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TransformGraphicTextWithClearanceToPolygonSet
// Same as function TransformGraphicShapesWithClearanceToPolygonSet but
// this only render text
void MODULE::TransformGraphicTextWithClearanceToPolygonSet(
PCB_LAYER_ID aLayer, SHAPE_POLY_SET& aCornerBuffer, int aInflateValue, int aError ) const
{
std::vector<TEXTE_MODULE *> texts; // List of TEXTE_MODULE to convert
for( EDA_ITEM* item = GraphicalItemsList(); item != NULL; item = item->Next() )
{
switch( item->Type() )
{
case PCB_MODULE_TEXT_T:
{
TEXTE_MODULE* text = static_cast<TEXTE_MODULE*>( item );
if( text->GetLayer() == aLayer && text->IsVisible() )
texts.push_back( text );
break;
}
case PCB_MODULE_EDGE_T:
// This function does not render this
break;
default:
break;
}
}
// Convert texts sur modules
if( Reference().GetLayer() == aLayer && Reference().IsVisible() )
texts.push_back( &Reference() );
if( Value().GetLayer() == aLayer && Value().IsVisible() )
texts.push_back( &Value() );
prms.m_cornerBuffer = &aCornerBuffer;
for( unsigned ii = 0; ii < texts.size(); ii++ )
{
TEXTE_MODULE *textmod = texts[ii];
prms.m_textWidth = textmod->GetThickness() + ( 2 * aInflateValue );
prms.m_error = aError;
wxSize size = textmod->GetTextSize();
if( textmod->IsMirrored() )
size.x = -size.x;
DrawGraphicText( NULL, NULL, textmod->GetTextPos(), BLACK,
textmod->GetShownText(), textmod->GetDrawRotation(), size,
textmod->GetHorizJustify(), textmod->GetVertJustify(),
textmod->GetThickness(), textmod->IsItalic(),
true, addTextSegmToPoly, &prms );
}
}
示例2: ResetTextSize
void PCB_BASE_FRAME::ResetTextSize( BOARD_ITEM* aItem, wxDC* aDC )
{
wxSize newSize;
int newThickness;
if( aItem->Type() == PCB_TEXT_T )
{
newSize = GetDesignSettings().m_PcbTextSize;
newThickness = GetDesignSettings().m_PcbTextWidth;
TEXTE_PCB* text = static_cast<TEXTE_PCB*>( aItem );
// Exit if there's nothing to do
if( text->GetTextSize() == newSize && text->GetThickness() == newThickness )
return;
SaveCopyInUndoList( text, UR_CHANGED );
text->SetTextSize( newSize );
text->SetThickness( newThickness );
}
else if( aItem->Type() == PCB_MODULE_TEXT_T )
{
newSize = GetDesignSettings().m_ModuleTextSize;
newThickness = GetDesignSettings().m_ModuleTextWidth;
TEXTE_MODULE* text = static_cast<TEXTE_MODULE*>( aItem );
// Exit if there's nothing to do
if( text->GetTextSize() == newSize && text->GetThickness() == newThickness )
return;
SaveCopyInUndoList( text->GetParent(), UR_CHANGED );
text->SetTextSize( newSize );
text->SetThickness( newThickness );
}
else
return;
if( aDC )
m_canvas->Refresh();
OnModify();
}
示例3: ResetModuleTextSizes
void PCB_BASE_FRAME::ResetModuleTextSizes( const wxString & aFilter, bool aRef,
bool aValue, bool aOthers )
{
BOARD_COMMIT commit( this );
int modTextWidth = GetDesignSettings().m_ModuleTextWidth;
const wxSize& modTextSize = GetDesignSettings().m_ModuleTextSize;
bool modified = false;
// Change fields of footprints with fpid matching the filter
for( MODULE* module = GetBoard()->m_Modules; module; module = module->Next() )
{
if( !aFilter.IsEmpty() )
{
if( ! WildCompareString( aFilter, FROM_UTF8( module->GetFPID().Format().c_str() ),
false ) )
continue;
}
if( aRef )
{
TEXTE_MODULE* item = &module->Reference();
if( item->GetTextSize() != GetDesignSettings().m_ModuleTextSize ||
item->GetThickness() != GetDesignSettings().m_ModuleTextWidth )
{
commit.Modify( item );
item->SetThickness( modTextWidth );
item->SetTextSize( modTextSize );
modified = true;
}
}
if( aValue )
{
TEXTE_MODULE* item = &module->Value();
if( item->GetTextSize() != GetDesignSettings().m_ModuleTextSize ||
item->GetThickness() != GetDesignSettings().m_ModuleTextWidth )
{
commit.Modify( item );
item->SetThickness( modTextWidth );
item->SetTextSize( modTextSize );
modified = true;
}
}
if( aOthers )
{
// Go through all other module text fields
for( BOARD_ITEM* boardItem = module->GraphicalItemsList(); boardItem; boardItem = boardItem->Next() )
{
if( boardItem->Type() == PCB_MODULE_TEXT_T )
{
TEXTE_MODULE* item = static_cast<TEXTE_MODULE*>( boardItem );
if( item->GetTextSize() != GetDesignSettings().m_ModuleTextSize
|| item->GetThickness() != GetDesignSettings().m_ModuleTextWidth )
{
commit.Modify( item );
item->SetThickness( modTextWidth );
item->SetTextSize( modTextSize );
modified = true;
}
}
}
}
}
if( modified )
{
commit.Push( "Reset module text size" );
GetCanvas()->Refresh();
}
}