本文整理汇总了C++中GetDefaultLineThickness函数的典型用法代码示例。如果您正苦于以下问题:C++ GetDefaultLineThickness函数的具体用法?C++ GetDefaultLineThickness怎么用?C++ GetDefaultLineThickness使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetDefaultLineThickness函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: GetDefaultLineThickness
void SCH_TEXT::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, const wxPoint& aOffset,
GR_DRAWMODE DrawMode, EDA_COLOR_T Color )
{
EDA_COLOR_T color;
int linewidth = ( m_Thickness == 0 ) ? GetDefaultLineThickness() : m_Thickness;
linewidth = Clamp_Text_PenSize( linewidth, m_Size, m_Bold );
if( Color >= 0 )
color = Color;
else
color = ReturnLayerColor( m_Layer );
GRSetDrawMode( DC, DrawMode );
wxPoint text_offset = aOffset + GetSchematicTextOffset();
EXCHG( linewidth, m_Thickness ); // Set the minimum width
EDA_TEXT::Draw( panel, DC, text_offset, color, DrawMode, FILLED, UNSPECIFIED_COLOR );
EXCHG( linewidth, m_Thickness ); // set initial value
if( m_isDangling )
DrawDanglingSymbol( panel, DC, m_Pos + aOffset, color );
// Enable these line to draw the bounding box (debug tests purposes only)
#if 0
{
EDA_RECT BoundaryBox = GetBoundingBox();
GRRect( panel->GetClipBox(), DC, BoundaryBox, 0, BROWN );
}
#endif
}
开发者ID:james-sakalaukus,项目名称:kicad,代码行数:31,代码来源:sch_text.cpp
示例2: GetScreen
/*
* Redraws only the active window which is assumed to be whole visible.
*/
void SCH_EDIT_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg )
{
if( GetScreen() == NULL )
return;
m_canvas->DrawBackGround( DC );
GetScreen()->Draw( m_canvas, DC, GR_DEFAULT_DRAWMODE );
DrawWorkSheet( DC, GetScreen(), GetDefaultLineThickness(), IU_PER_MILS,
GetScreen()->GetFileName() );
#ifdef USE_WX_OVERLAY
if( IsShown() )
{
m_overlay.Reset();
wxDCOverlay overlaydc( m_overlay, (wxWindowDC*)DC );
overlaydc.Clear();
/* TODO: Investigate why toolbars are affected - to be searched in wxWidgets */
m_mainToolBar->Refresh();
m_drawToolBar->Refresh();
m_optionsToolBar->Refresh();
}
#endif
if( m_canvas->IsMouseCaptured() )
m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
m_canvas->DrawCrossHair( DC );
// Display the sheet filename, and the sheet path, for non root sheets
UpdateTitle();
}
开发者ID:Caerbannog,项目名称:kicad-git-bzr,代码行数:36,代码来源:eeredraw.cpp
示例3: switch
bool PANEL_EESCHEMA_DISPLAY_OPTIONS::TransferDataToWindow()
{
// Reference style one of: "A" ".A" "-A" "_A" ".1" "-1" "_1"
int refStyleSelection;
switch( LIB_PART::GetSubpartIdSeparator() )
{
default:
case 0: refStyleSelection = 0; break;
case '.': refStyleSelection = LIB_PART::GetSubpartFirstId() == '1' ? 4 : 1; break;
case '-': refStyleSelection = LIB_PART::GetSubpartFirstId() == '1' ? 5 : 2; break;
case '_': refStyleSelection = LIB_PART::GetSubpartFirstId() == '1' ? 6 : 3; break;
}
m_choiceSeparatorRefId->SetSelection( refStyleSelection );
m_busWidthCtrl->SetValue( StringFromValue( INCHES, GetDefaultBusThickness(), false, true ) );
m_lineWidthCtrl->SetValue( StringFromValue( INCHES, GetDefaultLineThickness(), false, true ) );
m_jctSizeCtrl->SetValue( StringFromValue( INCHES, SCH_JUNCTION::GetSymbolSize(), false, true ) );
m_checkShowHiddenPins->SetValue( m_frame->GetShowAllPins() );
m_checkPageLimits->SetValue( m_frame->ShowPageLimits() );
m_galOptsPanel->TransferDataToWindow();
return true;
}
开发者ID:KiCad,项目名称:kicad-source-mirror,代码行数:26,代码来源:panel_eeschema_display_options.cpp
示例4: GetScreen
void SCH_EDIT_FRAME::PrintPage( wxDC* aDC, LAYER_MSK aPrintMask, bool aPrintMirrorMode,
void* aData )
{
GetScreen()->Draw( m_canvas, aDC, GR_DEFAULT_DRAWMODE );
DrawWorkSheet( aDC, GetScreen(), GetDefaultLineThickness(), IU_PER_MILS,
GetScreen()->GetFileName() );
}
开发者ID:metropt,项目名称:kicad-source-mirror,代码行数:7,代码来源:schframe.cpp
示例5: GetThickness
const EDA_RECT SCH_TEXT::GetBoundingBox() const
{
// We must pass the effective text thickness to GetTextBox
// when calculating the bounding box
int linewidth = GetThickness() == 0 ? GetDefaultLineThickness() : GetThickness();
linewidth = Clamp_Text_PenSize( linewidth, GetTextSize(), IsBold() );
EDA_RECT rect = GetTextBox( -1, linewidth );
if( GetTextAngle() != 0 ) // Rotate rect
{
wxPoint pos = rect.GetOrigin();
wxPoint end = rect.GetEnd();
RotatePoint( &pos, GetTextPos(), GetTextAngle() );
RotatePoint( &end, GetTextPos(), GetTextAngle() );
rect.SetOrigin( pos );
rect.SetEnd( end );
}
rect.Normalize();
return rect;
}
开发者ID:johnbeard,项目名称:kicad,代码行数:25,代码来源:sch_text.cpp
示例6: GetDefaultLineThickness
EDA_RECT SCH_FIELD::GetBoundingBox() const
{
SCH_COMPONENT* parentComponent = (SCH_COMPONENT*) m_Parent;
int linewidth = ( m_Thickness == 0 ) ? GetDefaultLineThickness() : m_Thickness;
// We must pass the effective text thickness to GetTextBox
// when calculating the bounding box
linewidth = Clamp_Text_PenSize( linewidth, m_Size, m_Bold );
// Calculate the text bounding box:
EDA_RECT rect;
// set USE_TEXT_JUSTIFY_INITIAL_BEHAVIOR to 0 to use
// a justification relative to the text itself
// i.e. justification relative to an horizontal text
// or to 1 to keep the initial behavior
#if (USE_TEXT_JUSTIFY_INITIAL_BEHAVIOR == 1 )
if( m_Orient == TEXT_ORIENT_VERT )
{
// For vertical texts, exchange the horizontal and the vertical justification
// The idea is to keep the justification always left or top for instance,
// no matter the text orientation
SCH_FIELD text( *this ); // Make a local copy to swap justifications
// because GetBoundingBox() is const
int tmp = (int)text.m_VJustify;
NEGATE( tmp );
text.m_VJustify = (EDA_TEXT_VJUSTIFY_T)text.m_HJustify;
text.m_HJustify = (EDA_TEXT_HJUSTIFY_T)tmp;
rect = text.GetTextBox( -1, linewidth );
}
else
#endif
rect = GetTextBox( -1, linewidth );
// Calculate the bounding box position relative to the component:
wxPoint origin = parentComponent->GetPosition();
wxPoint pos = m_Pos - origin;
wxPoint begin = rect.GetOrigin() - origin;
wxPoint end = rect.GetEnd() - origin;
RotatePoint( &begin, pos, m_Orient );
RotatePoint( &end, pos, m_Orient );
// Due to the Y axis direction, we must mirror the bounding box,
// relative to the text position:
begin.y -= pos.y;
end.y -= pos.y;
NEGATE( begin.y );
NEGATE( end.y );
begin.y += pos.y;
end.y += pos.y;
// Now, apply the component transform (mirror/rot)
begin = parentComponent->GetTransform().TransformCoordinate( begin );
end = parentComponent->GetTransform().TransformCoordinate( end );
rect.SetOrigin( begin);
rect.SetEnd( end);
rect.Move( origin );
rect.Normalize();
return rect;
}
开发者ID:james-sakalaukus,项目名称:kicad,代码行数:60,代码来源:sch_field.cpp
示例7: GetDefaultLineThickness
int LIB_CIRCLE::GetPenSize() const
{
if( m_Width > 0 )
return m_Width;
if( m_Width == 0 )
return GetDefaultLineThickness();
return -1; // a value to use a minimal pen size
}
开发者ID:johnbeard,项目名称:kicad,代码行数:10,代码来源:lib_circle.cpp
示例8: GetDefaultLineThickness
bool SCH_NO_CONNECT::HitTest( const wxPoint& aPosition, int aAccuracy ) const
{
int delta = ( ( m_size.x + GetDefaultLineThickness() ) / 2 ) + aAccuracy;
wxPoint dist = aPosition - m_pos;
if( ( std::abs( dist.x ) <= delta ) && ( std::abs( dist.y ) <= delta ) )
return true;
return false;
}
开发者ID:cpavlina,项目名称:kicad,代码行数:11,代码来源:sch_no_connect.cpp
示例9: GetDefaultLineThickness
int SCH_BUS_ENTRY::GetPenSize() const
{
int pensize = ( m_width == 0 ) ? GetDefaultLineThickness() : m_width;
if( m_Layer == LAYER_BUS )
{
pensize = ( m_width == 0 ) ? GetDefaultBusThickness() : m_width;
}
return pensize;
}
开发者ID:james-sakalaukus,项目名称:kicad,代码行数:11,代码来源:sch_bus_entry.cpp
示例10: m_End
EDA_RECT SCH_BUS_ENTRY::GetBoundingBox() const
{
EDA_RECT box;
box.SetOrigin( m_pos );
box.SetEnd( m_End() );
box.Normalize();
int width = ( m_width == 0 ) ? GetDefaultLineThickness() : m_width;
box.Inflate( width / 2 );
return box;
}
开发者ID:james-sakalaukus,项目名称:kicad,代码行数:13,代码来源:sch_bus_entry.cpp
示例11: GetTextPos
const EDA_RECT SCH_GLOBALLABEL::GetBoundingBox() const
{
int x, y, dx, dy, length, height;
x = GetTextPos().x;
y = GetTextPos().y;
dx = dy = 0;
int width = GetThickness() == 0 ? GetDefaultLineThickness() : GetThickness();
height = ( (GetTextHeight() * 15) / 10 ) + width + 2 * TXT_MARGIN;
// text X size add height for triangular shapes(bidirectional)
length = LenSize( GetShownText(), width ) + height + DANGLING_SYMBOL_SIZE;
switch( GetLabelSpinStyle() ) // respect orientation
{
default:
case 0: // Horiz Normal Orientation (left justified)
dx = -length;
dy = height;
x += DANGLING_SYMBOL_SIZE;
y -= height / 2;
break;
case 1: // Vert Orientation UP
dx = height;
dy = -length;
x -= height / 2;
y += DANGLING_SYMBOL_SIZE;
break;
case 2: // Horiz Orientation - Right justified
dx = length;
dy = height;
x -= DANGLING_SYMBOL_SIZE;
y -= height / 2;
break;
case 3: // Vert Orientation BOTTOM
dx = height;
dy = length;
x -= height / 2;
y -= DANGLING_SYMBOL_SIZE;
break;
}
EDA_RECT box( wxPoint( x, y ), wxSize( dx, dy ) );
box.Normalize();
return box;
}
开发者ID:johnbeard,项目名称:kicad,代码行数:51,代码来源:sch_text.cpp
示例12: setModeColor
// Initialize the dialog options:
void DIALOG_PLOT_SCHEMATIC::initDlg()
{
// Set color or B&W plot option
bool tmp;
m_config->Read( PLOT_MODECOLOR_KEY, &tmp, true );
setModeColor( tmp );
// Set plot or not frame reference option
m_config->Read( PLOT_FRAME_REFERENCE_KEY, &tmp, true );
setPlotFrameRef( tmp );
// Set HPGL plot origin to center of paper of left bottom corner
m_config->Read( PLOT_HPGL_ORIGIN_KEY, &tmp, false );
SetPlotOriginCenter( tmp );
m_config->Read( PLOT_HPGL_PAPERSIZE_KEY, &m_HPGLPaperSizeSelect, 0 );
// HPGL Pen Size is stored in mm in config
m_config->Read( PLOT_HPGL_PEN_SIZE_KEY, &m_HPGLPenSize, 0.5 );
m_HPGLPenSize *= IU_PER_MM;
// Switch to the last save plot format
long plotfmt;
m_config->Read( PLOT_FORMAT_KEY, &plotfmt, 0 );
switch( plotfmt )
{
default:
case PLOT_FORMAT_POST: m_plotFormatOpt->SetSelection( 0 ); break;
case PLOT_FORMAT_PDF: m_plotFormatOpt->SetSelection( 1 ); break;
case PLOT_FORMAT_SVG: m_plotFormatOpt->SetSelection( 2 ); break;
case PLOT_FORMAT_DXF: m_plotFormatOpt->SetSelection( 3 ); break;
case PLOT_FORMAT_HPGL: m_plotFormatOpt->SetSelection( 4 ); break;
}
// Set the default line width (pen width which should be used for
// items that do not have a pen size defined (like frame ref)
m_defaultLineWidth.SetValue( GetDefaultLineThickness() );
// Initialize HPGL specific widgets
m_penWidth.SetValue( m_HPGLPenSize );
// Plot directory
wxString path = m_parent->GetPlotDirectoryName();
#ifdef __WINDOWS__
path.Replace( '/', '\\' );
#endif
m_outputDirectoryName->SetValue( path );
}
开发者ID:KiCad,项目名称:kicad-source-mirror,代码行数:50,代码来源:dialog_plot_schematic.cpp
示例13: GetDefaultLineThickness
const EDA_RECT SCH_FIELD::GetBoundingBox() const
{
SCH_COMPONENT* parentComponent = (SCH_COMPONENT*) m_Parent;
int linewidth = ( m_Thickness == 0 ) ? GetDefaultLineThickness() : m_Thickness;
// We must pass the effective text thickness to GetTextBox
// when calculating the bounding box
linewidth = Clamp_Text_PenSize( linewidth, m_Size, m_Bold );
// Calculate the text bounding box:
EDA_RECT rect;
if( m_id == REFERENCE ) // multi units have one letter or more added to reference
{
SCH_FIELD text( *this ); // Make a local copy to change text
// because GetBoundingBox() is const
text.SetText( GetFullyQualifiedText() );
rect = text.GetTextBox( -1, linewidth );
}
else
rect = GetTextBox( -1, linewidth );
// Calculate the bounding box position relative to the component:
wxPoint origin = parentComponent->GetPosition();
wxPoint pos = m_Pos - origin;
wxPoint begin = rect.GetOrigin() - origin;
wxPoint end = rect.GetEnd() - origin;
RotatePoint( &begin, pos, m_Orient );
RotatePoint( &end, pos, m_Orient );
// Due to the Y axis direction, we must mirror the bounding box,
// relative to the text position:
begin.y -= pos.y;
end.y -= pos.y;
NEGATE( begin.y );
NEGATE( end.y );
begin.y += pos.y;
end.y += pos.y;
// Now, apply the component transform (mirror/rot)
begin = parentComponent->GetTransform().TransformCoordinate( begin );
end = parentComponent->GetTransform().TransformCoordinate( end );
rect.SetOrigin( begin);
rect.SetEnd( end);
rect.Move( origin );
rect.Normalize();
return rect;
}
开发者ID:LDavis4559,项目名称:kicad-source-mirror,代码行数:48,代码来源:sch_field.cpp
示例14: GetScreen
void LIB_EDIT_FRAME::SVG_PlotComponent( const wxString& aFullFileName )
{
const bool plotBW = false;
const PAGE_INFO& pageInfo = GetScreen()->GetPageSettings();
SVG_PLOTTER* plotter = new SVG_PLOTTER();
plotter->SetPageSettings( pageInfo );
plotter->SetDefaultLineWidth( GetDefaultLineThickness() );
plotter->SetColorMode( plotBW );
wxPoint plot_offset;
const double scale = 1.0;
// Currently, plot units are in decimil
plotter->SetViewport( plot_offset, IU_PER_MILS/10, scale, false );
// Init :
plotter->SetCreator( wxT( "Eeschema-SVG" ) );
if( ! plotter->OpenFile( aFullFileName ) )
{
delete plotter;
return;
}
LOCALE_IO toggle;
plotter->StartPlot();
LIB_PART* part = GetCurPart();
if( part )
{
TRANSFORM temp; // Uses default transform
wxPoint plotPos;
plotPos.x = pageInfo.GetWidthIU() /2;
plotPos.y = pageInfo.GetHeightIU()/2;
part->Plot( plotter, GetUnit(), GetConvert(), plotPos, temp );
// Plot lib fields, not plotted by m_component->Plot():
part->PlotLibFields( plotter, GetUnit(), GetConvert(), plotPos, temp );
}
plotter->EndPlot();
delete plotter;
}
开发者ID:zhihuitech,项目名称:kicad-source-mirror,代码行数:48,代码来源:libedit_plot_component.cpp
示例15: GetPenSizeForBold
int SCH_FIELD::GetPenSize() const
{
int pensize = m_Thickness;
if( pensize == 0 ) // Use default values for pen size
{
if( m_Bold )
pensize = GetPenSizeForBold( m_Size.x );
else
pensize = GetDefaultLineThickness();
}
// Clip pen size for small texts:
pensize = Clamp_Text_PenSize( pensize, m_Size, m_Bold );
return pensize;
}
开发者ID:james-sakalaukus,项目名称:kicad,代码行数:16,代码来源:sch_field.cpp
示例16: GetThickness
int LIB_TEXT::GetPenSize() const
{
int pensize = GetThickness();
if( pensize == 0 ) // Use default values for pen size
{
if( IsBold() )
pensize = GetPenSizeForBold( GetTextWidth() );
else
pensize = GetDefaultLineThickness();
}
// Clip pen size for small texts:
pensize = Clamp_Text_PenSize( pensize, GetTextSize(), IsBold() );
return pensize;
}
开发者ID:cpavlina,项目名称:kicad,代码行数:16,代码来源:lib_text.cpp
示例17: GetLayerColor
void SCH_TEXT::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, const wxPoint& aOffset )
{
COLOR4D color = GetLayerColor( m_Layer );
int linewidth = GetThickness() == 0 ? GetDefaultLineThickness() : GetThickness();
EDA_RECT* clipbox = panel? panel->GetClipBox() : NULL;
linewidth = Clamp_Text_PenSize( linewidth, GetTextSize(), IsBold() );
wxPoint text_offset = aOffset + GetSchematicTextOffset();
int savedWidth = GetThickness();
SetThickness( linewidth ); // Set the minimum width
EDA_TEXT::Draw( clipbox, DC, text_offset, color, GR_DEFAULT_DRAWMODE );
SetThickness( savedWidth );
}
开发者ID:johnbeard,项目名称:kicad,代码行数:17,代码来源:sch_text.cpp
示例18: SVG_PLOTTER
bool DIALOG_PLOT_SCHEMATIC::plotOneSheetSVG( EDA_DRAW_FRAME* aFrame,
const wxString& aFileName,
SCH_SCREEN* aScreen,
bool aPlotBlackAndWhite,
bool aPlotFrameRef )
{
SVG_PLOTTER* plotter = new SVG_PLOTTER();
const PAGE_INFO& pageInfo = aScreen->GetPageSettings();
plotter->SetPageSettings( pageInfo );
plotter->SetDefaultLineWidth( GetDefaultLineThickness() );
plotter->SetColorMode( aPlotBlackAndWhite ? false : true );
wxPoint plot_offset;
double scale = 1.0;
plotter->SetViewport( plot_offset, IU_PER_DECIMILS, scale, false );
// Init :
plotter->SetCreator( wxT( "Eeschema-SVG" ) );
if( ! plotter->OpenFile( aFileName ) )
{
delete plotter;
return false;
}
LOCALE_IO toggle;
plotter->StartPlot();
if( aPlotFrameRef )
{
plotter->SetColor( BLACK );
PlotWorkSheet( plotter, aFrame->GetTitleBlock(),
aFrame->GetPageSettings(),
aScreen->m_ScreenNumber, aScreen->m_NumberOfScreens,
aFrame->GetScreenDesc(),
aScreen->GetFileName() );
}
aScreen->Plot( plotter );
plotter->EndPlot();
delete plotter;
return true;
}
开发者ID:natsfr,项目名称:kicad,代码行数:46,代码来源:plot_schematic_SVG.cpp
示例19: GetPenSize
wxPoint SCH_TEXT::GetSchematicTextOffset() const
{
wxPoint text_offset;
// add an offset to x (or y) position to aid readability of text on a wire or line
int thick_offset = TXT_MARGIN + ( GetPenSize() + GetDefaultLineThickness() ) / 2;
switch( GetLabelSpinStyle() )
{
default:
case 0: text_offset.y = -thick_offset; break; // Horiz Normal Orientation (left justified)
case 1: text_offset.x = -thick_offset; break; // Vert Orientation UP
case 2: text_offset.y = -thick_offset; break; // Horiz Orientation - Right justified
case 3: text_offset.x = -thick_offset; break; // Vert Orientation BOTTOM
}
return text_offset;
}
开发者ID:johnbeard,项目名称:kicad,代码行数:18,代码来源:sch_text.cpp
示例20: PS_PLOTTER
bool DIALOG_PLOT_SCHEMATIC::plotOneSheetPS( const wxString& aFileName,
SCH_SCREEN* aScreen,
const PAGE_INFO& aPageInfo,
wxPoint aPlot0ffset,
double aScale,
bool aPlotFrameRef )
{
PS_PLOTTER* plotter = new PS_PLOTTER();
plotter->SetPageSettings( aPageInfo );
plotter->SetDefaultLineWidth( GetDefaultLineThickness() );
plotter->SetColorMode( getModeColor() );
// Currently, plot units are in decimil
plotter->SetViewport( aPlot0ffset, IU_PER_MILS/10, aScale, false );
// Init :
plotter->SetCreator( wxT( "Eeschema-PS" ) );
if( ! plotter->OpenFile( aFileName ) )
{
delete plotter;
return false;
}
LOCALE_IO toggle; // Switch the locale to standard C
plotter->StartPlot();
if( aPlotFrameRef )
{
plotter->SetColor( BLACK );
PlotWorkSheet( plotter, m_parent->GetTitleBlock(),
m_parent->GetPageSettings(),
aScreen->m_ScreenNumber, aScreen->m_NumberOfScreens,
m_parent->GetScreenDesc(),
aScreen->GetFileName() );
}
aScreen->Plot( plotter );
plotter->EndPlot();
delete plotter;
return true;
}
开发者ID:RocFan,项目名称:kicad-source-mirror,代码行数:44,代码来源:plot_schematic_PS.cpp
注:本文中的GetDefaultLineThickness函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论