这篇教程C++ GetPenSize函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中GetPenSize函数的典型用法代码示例。如果您正苦于以下问题:C++ GetPenSize函数的具体用法?C++ GetPenSize怎么用?C++ GetPenSize使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了GetPenSize函数的24个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: wxASSERTvoid LIB_BEZIER::Plot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill, const TRANSFORM& aTransform ){ wxASSERT( aPlotter != NULL ); static std::vector< wxPoint > cornerList; cornerList.clear(); for( unsigned ii = 0; ii < m_PolyPoints.size(); ii++ ) { wxPoint pos = m_PolyPoints[ii]; pos = aTransform.TransformCoordinate( pos ) + aOffset; cornerList.push_back( pos ); } if( aFill && m_Fill == FILLED_WITH_BG_BODYCOLOR ) { aPlotter->SetColor( GetLayerColor( LAYER_DEVICE_BACKGROUND ) ); aPlotter->PlotPoly( cornerList, FILLED_WITH_BG_BODYCOLOR, 0 ); } bool already_filled = m_Fill == FILLED_WITH_BG_BODYCOLOR; auto pen_size = GetPenSize(); if( !already_filled || pen_size > 0 ) { pen_size = std::max( 0, pen_size ); aPlotter->SetColor( GetLayerColor( LAYER_DEVICE ) ); aPlotter->PlotPoly( cornerList, already_filled ? NO_FILL : m_Fill, GetPenSize() ); }}
开发者ID:johnbeard,项目名称:kicad,代码行数:31,
示例2: GetLayerColorvoid LIB_POLYLINE::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset, EDA_COLOR_T aColor, GR_DRAWMODE aDrawMode, void* aData, const TRANSFORM& aTransform ){ wxPoint pos1; EDA_COLOR_T color = GetLayerColor( LAYER_DEVICE ); wxPoint* buffer = NULL; if( aColor < 0 ) // Used normal color or selected color { if( IsSelected() ) color = GetItemSelectedColor(); } else { color = aColor; } buffer = new wxPoint[ m_PolyPoints.size() ]; for( unsigned ii = 0; ii < m_PolyPoints.size(); ii++ ) { buffer[ii] = aTransform.TransformCoordinate( m_PolyPoints[ii] ) + aOffset; } FILL_T fill = aData ? NO_FILL : m_Fill; if( aColor >= 0 ) fill = NO_FILL; GRSetDrawMode( aDC, aDrawMode ); EDA_RECT* const clipbox = aPanel? aPanel->GetClipBox() : NULL; if( fill == FILLED_WITH_BG_BODYCOLOR ) GRPoly( clipbox, aDC, m_PolyPoints.size(), buffer, 1, GetPenSize(), (m_Flags & IS_MOVED) ? color : GetLayerColor( LAYER_DEVICE_BACKGROUND ), GetLayerColor( LAYER_DEVICE_BACKGROUND ) ); else if( fill == FILLED_SHAPE ) GRPoly( clipbox, aDC, m_PolyPoints.size(), buffer, 1, GetPenSize(), color, color ); else GRPoly( clipbox, aDC, m_PolyPoints.size(), buffer, 0, GetPenSize(), color, color ); delete[] buffer; /* Set to one (1) to draw bounding box around polyline to validate * bounding box calculation. */#if 0 EDA_RECT bBox = GetBoundingBox(); bBox.RevertYAxis(); bBox = aTransform.TransformCoordinate( bBox ); bBox.Move( aOffset ); GRRect( clipbox, aDC, bBox, 0, LIGHTMAGENTA );#endif}
开发者ID:JOE-JOE-NGIGI,项目名称:kicad,代码行数:56,
示例3: GetLayerColorvoid SCH_TEXT::Plot( PLOTTER* aPlotter ){ static std::vector <wxPoint> Poly; COLOR4D color = GetLayerColor( GetLayer() ); int tmp = GetThickness(); int thickness = GetPenSize(); // Two thicknesses are set here: // The first is for EDA_TEXT, which controls the interline spacing based on text thickness // The second is for the output that sets the actual stroke size SetThickness( thickness ); aPlotter->SetCurrentLineWidth( thickness ); if( IsMultilineAllowed() ) { std::vector<wxPoint> positions; wxArrayString strings_list; wxStringSplit( GetShownText(), strings_list, '/n' ); positions.reserve( strings_list.Count() ); GetPositionsOfLinesOfMultilineText(positions, (int) strings_list.Count() ); for( unsigned ii = 0; ii < strings_list.Count(); ii++ ) { wxPoint textpos = positions[ii] + GetSchematicTextOffset(); wxString& txt = strings_list.Item( ii ); aPlotter->Text( textpos, color, txt, GetTextAngle(), GetTextSize(), GetHorizJustify(), GetVertJustify(), thickness, IsItalic(), IsBold() ); } } else { wxPoint textpos = GetTextPos() + GetSchematicTextOffset(); aPlotter->Text( textpos, color, GetShownText(), GetTextAngle(), GetTextSize(), GetHorizJustify(), GetVertJustify(), thickness, IsItalic(), IsBold() ); } // Draw graphic symbol for global or hierarchical labels CreateGraphicShape( Poly, GetTextPos() ); aPlotter->SetCurrentLineWidth( GetPenSize() ); if( Poly.size() ) aPlotter->PlotPoly( Poly, NO_FILL ); SetThickness( tmp );}
开发者ID:johnbeard,项目名称:kicad,代码行数:50,
示例4: GetLayerColorvoid LIB_RECTANGLE::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset, EDA_COLOR_T aColor, GR_DRAWMODE aDrawMode, void* aData, const TRANSFORM& aTransform ){ wxPoint pos1, pos2; EDA_COLOR_T color = GetLayerColor( LAYER_DEVICE ); if( aColor < 0 ) // Used normal color or selected color { if( IsSelected() ) color = GetItemSelectedColor(); } else { color = aColor; } pos1 = aTransform.TransformCoordinate( m_Pos ) + aOffset; pos2 = aTransform.TransformCoordinate( m_End ) + aOffset; FILL_T fill = aData ? NO_FILL : m_Fill; if( aColor >= 0 ) fill = NO_FILL; GRSetDrawMode( aDC, aDrawMode ); EDA_RECT* const clipbox = aPanel? aPanel->GetClipBox() : NULL; if( fill == FILLED_WITH_BG_BODYCOLOR && !aData ) GRFilledRect( clipbox, aDC, pos1.x, pos1.y, pos2.x, pos2.y, GetPenSize( ), (m_Flags & IS_MOVED) ? color : GetLayerColor( LAYER_DEVICE_BACKGROUND ), GetLayerColor( LAYER_DEVICE_BACKGROUND ) ); else if( m_Fill == FILLED_SHAPE && !aData ) GRFilledRect( clipbox, aDC, pos1.x, pos1.y, pos2.x, pos2.y, GetPenSize(), color, color ); else GRRect( clipbox, aDC, pos1.x, pos1.y, pos2.x, pos2.y, GetPenSize(), color ); /* Set to one (1) to draw bounding box around rectangle to validate * bounding box calculation. */#if 0 EDA_RECT bBox = GetBoundingBox(); bBox.RevertYAxis(); bBox = aTransform.TransformCoordinate( bBox ); bBox.Move( aOffset ); GRRect( clipbox, aDC, bBox, 0, LIGHTMAGENTA );#endif}
开发者ID:Caerbannog,项目名称:kicad-git-bzr,代码行数:49,
示例5: wxASSERTvoid LIB_POLYLINE::Plot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill, const TRANSFORM& aTransform ){ wxASSERT( aPlotter != NULL ); static std::vector< wxPoint > cornerList; cornerList.clear(); for( unsigned ii = 0; ii < m_PolyPoints.size(); ii++ ) { wxPoint pos = m_PolyPoints[ii]; pos = aTransform.TransformCoordinate( pos ) + aOffset; cornerList.push_back( pos ); } if( aFill && m_Fill == FILLED_WITH_BG_BODYCOLOR ) { aPlotter->SetColor( GetLayerColor( LAYER_DEVICE_BACKGROUND ) ); aPlotter->PlotPoly( cornerList, FILLED_WITH_BG_BODYCOLOR, 0 ); aFill = false; // body is now filled, do not fill it later. } bool already_filled = m_Fill == FILLED_WITH_BG_BODYCOLOR; aPlotter->SetColor( GetLayerColor( LAYER_DEVICE ) ); aPlotter->PlotPoly( cornerList, already_filled ? NO_FILL : m_Fill, GetPenSize() );}
开发者ID:JOE-JOE-NGIGI,项目名称:kicad,代码行数:26,
示例6: GetPenSizeconst EDA_RECT LIB_BEZIER::GetBoundingBox() const{ EDA_RECT rect; int xmin, xmax, ymin, ymax; if( !GetCornerCount() ) return rect; xmin = xmax = m_PolyPoints[0].x; ymin = ymax = m_PolyPoints[0].y; for( unsigned ii = 1; ii < GetCornerCount(); ii++ ) { xmin = std::min( xmin, m_PolyPoints[ii].x ); xmax = std::max( xmax, m_PolyPoints[ii].x ); ymin = std::min( ymin, m_PolyPoints[ii].y ); ymax = std::max( ymax, m_PolyPoints[ii].y ); } rect.SetOrigin( xmin, ymin ); rect.SetEnd( xmax, ymax ); rect.Inflate( ( GetPenSize()+1 ) / 2 ); rect.RevertYAxis(); return rect;}
开发者ID:johnbeard,项目名称:kicad,代码行数:27,
示例7: GetBoundingBoxvoid LIB_FIELD::Plot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill, const TRANSFORM& aTransform ){ if( IsVoid() ) return; /* Calculate the text orientation, according to the component * orientation/mirror */ int orient = m_Orient; if( aTransform.y1 ) // Rotate component 90 deg. { if( orient == TEXT_ORIENT_HORIZ ) orient = TEXT_ORIENT_VERT; else orient = TEXT_ORIENT_HORIZ; } EDA_RECT BoundaryBox = GetBoundingBox(); EDA_TEXT_HJUSTIFY_T hjustify = GR_TEXT_HJUSTIFY_CENTER; EDA_TEXT_VJUSTIFY_T vjustify = GR_TEXT_VJUSTIFY_CENTER; wxPoint textpos = aTransform.TransformCoordinate( BoundaryBox.Centre() ) + aOffset; aPlotter->Text( textpos, GetDefaultColor(), m_Text, orient, m_Size, hjustify, vjustify, GetPenSize(), m_Italic, m_Bold );}
开发者ID:johnbeard,项目名称:kicad-source-mirror,代码行数:28,
示例8: wxASSERTvoid LIB_TEXT::Plot( PLOTTER* plotter, const wxPoint& offset, bool fill, const TRANSFORM& aTransform ){ wxASSERT( plotter != NULL ); EDA_RECT bBox = GetBoundingBox(); // convert coordinates from draw Y axis to libedit Y axis bBox.RevertYAxis(); wxPoint txtpos = bBox.Centre(); /* The text orientation may need to be flipped if the * transformation matrix causes xy axes to be flipped. */ int t1 = ( aTransform.x1 != 0 ) ^ ( GetTextAngle() != 0 ); wxPoint pos = aTransform.TransformCoordinate( txtpos ) + offset; // Get color COLOR4D color; if( plotter->GetColorMode() ) // Used normal color or selected color color = IsSelected() ? GetItemSelectedColor() : GetDefaultColor(); else color = COLOR4D::BLACK; plotter->Text( pos, color, GetShownText(), t1 ? TEXT_ANGLE_HORIZ : TEXT_ANGLE_VERT, GetTextSize(), GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, GetPenSize(), IsItalic(), IsBold() );}
开发者ID:cpavlina,项目名称:kicad,代码行数:28,
示例9: boxconst EDA_RECT SCH_SHEET::GetBoundingBox() const{ wxPoint end; EDA_RECT box( m_pos, m_size ); int lineWidth = GetPenSize(); // Determine length of texts wxString text = wxT( "Sheet: " ) + m_name; int textlen = GraphicTextWidth( text, wxSize( m_sheetNameSize, m_sheetNameSize ), false, false ); text = wxT( "File: " ) + m_fileName; int textlen2 = GraphicTextWidth( text, wxSize( m_fileNameSize, m_fileNameSize ), false, false ); // Calculate bounding box X size: textlen = std::max( textlen, textlen2 ); end.x = std::max( m_size.x, textlen ); // Calculate bounding box pos: end.y = m_size.y; end += m_pos; // Move upper and lower limits to include texts: box.SetY( box.GetY() - ( KiROUND( m_sheetNameSize * 1.3 ) + 8 ) ); end.y += KiROUND( m_fileNameSize * 1.3 ) + 8; box.SetEnd( end ); box.Inflate( lineWidth / 2 ); return box;}
开发者ID:cpavlina,项目名称:kicad,代码行数:32,
示例10: GetLayerColorvoid SCH_BUS_ENTRY_BASE::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset, GR_DRAWMODE aDrawMode, COLOR4D aColor ){ COLOR4D color; EDA_RECT* clipbox = aPanel->GetClipBox(); if( aColor != COLOR4D::UNSPECIFIED ) color = aColor; else color = GetLayerColor( GetState( BRIGHTENED ) ? LAYER_BRIGHTENED : m_Layer ); GRSetDrawMode( aDC, aDrawMode ); GRLine( clipbox, aDC, m_pos.x + aOffset.x, m_pos.y + aOffset.y, m_End().x + aOffset.x, m_End().y + aOffset.y, GetPenSize(), color ); // Draw pin targets if part is being dragged bool dragging = aPanel->GetScreen()->GetCurItem() == this && aPanel->IsMouseCaptured(); if( m_isDanglingStart || dragging ) { GRCircle( clipbox, aDC, m_pos.x + aOffset.x, m_pos.y + aOffset.y, TARGET_BUSENTRY_RADIUS, 0, color ); } if( m_isDanglingEnd || dragging ) { GRCircle( clipbox, aDC, m_End().x + aOffset.x, m_End().y + aOffset.y, TARGET_BUSENTRY_RADIUS, 0, color ); }}
开发者ID:cpavlina,项目名称:kicad,代码行数:32,
示例11: GetPenSizevoid SCH_BUS_ENTRY_BASE::Plot( PLOTTER* aPlotter ){ aPlotter->SetCurrentLineWidth( GetPenSize() ); aPlotter->SetColor( GetLayerColor( GetLayer() ) ); aPlotter->MoveTo( m_pos ); aPlotter->FinishTo( m_End() );}
开发者ID:cpavlina,项目名称:kicad,代码行数:7,
示例12: GetParentvoid SCH_FIELD::Plot( PLOTTER* aPlotter ){ SCH_COMPONENT* parent = ( SCH_COMPONENT* ) GetParent(); wxCHECK_RET( parent != NULL && parent->Type() == SCH_COMPONENT_T, wxT( "Cannot plot field with invalid parent." ) ); EDA_COLOR_T color = ReturnLayerColor( GetLayer() ); if( m_Attributs & TEXT_NO_VISIBLE ) return; if( IsVoid() ) return; /* Calculate the text orientation, according to the component * orientation/mirror */ int orient = m_Orient; if( parent->GetTransform().y1 ) // Rotate component 90 deg. { if( orient == TEXT_ORIENT_HORIZ ) orient = TEXT_ORIENT_VERT; else orient = TEXT_ORIENT_HORIZ; } /* Calculate the text justification, according to the component * orientation/mirror * this is a bit complicated due to cumulative calculations: * - numerous cases (mirrored or not, rotation) * - the DrawGraphicText function recalculate also H and H justifications * according to the text orientation. * - When a component is mirrored, the text is not mirrored and * justifications are complicated to calculate * so the more easily way is to use no justifications ( Centered text ) * and use GetBoundaryBox to know the text coordinate considered as centered */ EDA_RECT BoundaryBox = GetBoundingBox(); EDA_TEXT_HJUSTIFY_T hjustify = GR_TEXT_HJUSTIFY_CENTER; EDA_TEXT_VJUSTIFY_T vjustify = GR_TEXT_VJUSTIFY_CENTER; wxPoint textpos = BoundaryBox.Centre(); int thickness = GetPenSize(); if( (parent->GetPartCount() <= 1) || (m_id != REFERENCE) ) { aPlotter->Text( textpos, color, m_Text, orient, m_Size, hjustify, vjustify, thickness, m_Italic, m_Bold ); } else /* We plot the reference, for a multiple parts per package */ { /* Adding A, B ... to the reference */ wxString Text = m_Text + LIB_COMPONENT::ReturnSubReference( parent->GetUnit() ); aPlotter->Text( textpos, color, Text, orient, m_Size, hjustify, vjustify, thickness, m_Italic, m_Bold ); }}
开发者ID:james-sakalaukus,项目名称:kicad,代码行数:59,
示例13: GetLayerColorvoid LIB_CIRCLE::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset, void* aData, const TRANSFORM& aTransform ){ wxPoint pos1 = aTransform.TransformCoordinate( m_Pos ) + aOffset; COLOR4D color = GetLayerColor( LAYER_DEVICE ); COLOR4D bgColor = GetLayerColor( LAYER_DEVICE_BACKGROUND ); FILL_T fill = aData ? NO_FILL : m_Fill; EDA_RECT* const clipbox = aPanel? aPanel->GetClipBox() : NULL; if( fill == FILLED_WITH_BG_BODYCOLOR ) GRFilledCircle( clipbox, aDC, pos1.x, pos1.y, m_Radius, GetPenSize(), bgColor, bgColor ); else if( fill == FILLED_SHAPE ) GRFilledCircle( clipbox, aDC, pos1.x, pos1.y, m_Radius, 0, color, color ); else GRCircle( clipbox, aDC, pos1.x, pos1.y, m_Radius, GetPenSize(), color );}
开发者ID:johnbeard,项目名称:kicad,代码行数:17,
示例14: GetLayerColorvoid LIB_CIRCLE::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset, COLOR4D aColor, GR_DRAWMODE aDrawMode, void* aData, const TRANSFORM& aTransform ){ wxPoint pos1; COLOR4D color = GetLayerColor( LAYER_DEVICE ); if( aColor == COLOR4D::UNSPECIFIED ) // Used normal color or selected color { if( IsSelected() ) color = GetItemSelectedColor(); } else { color = aColor; } pos1 = aTransform.TransformCoordinate( m_Pos ) + aOffset; GRSetDrawMode( aDC, aDrawMode ); FILL_T fill = aData ? NO_FILL : m_Fill; if( aColor != COLOR4D::UNSPECIFIED ) fill = NO_FILL; EDA_RECT* const clipbox = aPanel? aPanel->GetClipBox() : NULL; if( fill == FILLED_WITH_BG_BODYCOLOR ) GRFilledCircle( clipbox, aDC, pos1.x, pos1.y, m_Radius, GetPenSize(), (m_Flags & IS_MOVED) ? color : GetLayerColor( LAYER_DEVICE_BACKGROUND ), GetLayerColor( LAYER_DEVICE_BACKGROUND ) ); else if( fill == FILLED_SHAPE ) GRFilledCircle( clipbox, aDC, pos1.x, pos1.y, m_Radius, 0, color, color ); else GRCircle( clipbox, aDC, pos1.x, pos1.y, m_Radius, GetPenSize(), color ); /* Set to one (1) to draw bounding box around circle to validate bounding * box calculation. */#if 0 EDA_RECT bBox = GetBoundingBox(); bBox.RevertYAxis(); bBox = aTransform.TransformCoordinate( bBox ); bBox.Move( aOffset ); GRRect( clipbox, aDC, bBox, 0, LIGHTMAGENTA );#endif}
开发者ID:AlexanderBrevig,项目名称:kicad-source-mirror,代码行数:45,
示例15: GetBoundingBoxEDA_RECT LIB_RECTANGLE::GetBoundingBox() const{ EDA_RECT rect; rect.SetOrigin( m_Pos.x, m_Pos.y * -1 ); rect.SetEnd( m_End.x, m_End.y * -1 ); rect.Inflate( (GetPenSize() / 2) + 1 ); return rect;}
开发者ID:james-sakalaukus,项目名称:kicad,代码行数:9,
示例16: ReturnLayerColorvoid SCH_TEXT::Plot( PLOTTER* aPlotter ){ static std::vector <wxPoint> Poly; EDA_COLOR_T color = ReturnLayerColor( GetLayer() ); wxPoint textpos = m_Pos + GetSchematicTextOffset(); int thickness = GetPenSize(); aPlotter->SetCurrentLineWidth( thickness ); if( m_MultilineAllowed ) { wxPoint pos = textpos; wxArrayString* list = wxStringSplit( m_Text, '/n' ); wxPoint offset; offset.y = GetInterline(); RotatePoint( &offset, m_Orient ); for( unsigned i = 0; i<list->Count(); i++ ) { wxString txt = list->Item( i ); aPlotter->Text( pos, color, txt, m_Orient, m_Size, m_HJustify, m_VJustify, thickness, m_Italic, m_Bold ); pos += offset; } delete (list); } else { aPlotter->Text( textpos, color, m_Text, m_Orient, m_Size, m_HJustify, m_VJustify, thickness, m_Italic, m_Bold ); } /* Draw graphic symbol for global or hierarchical labels */ CreateGraphicShape( Poly, m_Pos ); aPlotter->SetCurrentLineWidth( GetPenSize() ); if( Poly.size() ) aPlotter->PlotPoly( Poly, NO_FILL );}
开发者ID:james-sakalaukus,项目名称:kicad,代码行数:44,
示例17: GetPenSizeconst EDA_RECT SCH_NO_CONNECT::GetBoundingBox() const{ int delta = ( GetPenSize() + m_size.x ) / 2; EDA_RECT box; box.SetOrigin( m_pos ); box.Inflate( delta ); return box;}
开发者ID:cpavlina,项目名称:kicad,代码行数:10,
示例18: GetPenSizebool LIB_CIRCLE::HitTest( const wxPoint& aPosRef ) const{ int mindist = GetPenSize() / 2; // Have a minimal tolerance for hit test if( mindist < MINIMUM_SELECTION_DISTANCE ) mindist = MINIMUM_SELECTION_DISTANCE; return HitTest( aPosRef, mindist, DefaultTransform );}
开发者ID:johnbeard,项目名称:kicad,代码行数:10,
示例19: GetPenSizebool LIB_RECTANGLE::HitTest( const wxPoint& aPosition ){ int mindist = ( GetPenSize() / 2 ) + 1; // Have a minimal tolerance for hit test if( mindist < MINIMUM_SELECTION_DISTANCE ) mindist = MINIMUM_SELECTION_DISTANCE; return HitTest( aPosition, mindist, DefaultTransform );}
开发者ID:james-sakalaukus,项目名称:kicad,代码行数:10,
示例20: GetPenSizevoid LIB_FIELD::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset, EDA_COLOR_T aColor, GR_DRAWMODE aDrawMode, void* aData, const TRANSFORM& aTransform ){ wxPoint text_pos; int color; int linewidth = GetPenSize(); if( m_Bold ) linewidth = GetPenSizeForBold( m_Size.x ); else linewidth = Clamp_Text_PenSize( linewidth, m_Size, m_Bold ); if( ( m_Attributs & TEXT_NO_VISIBLE ) && ( aColor < 0 ) ) { color = GetInvisibleItemColor(); } else if( IsSelected() && ( aColor < 0 ) ) { color = GetItemSelectedColor(); } else { color = aColor; } if( color < 0 ) color = GetDefaultColor(); text_pos = aTransform.TransformCoordinate( m_Pos ) + aOffset; wxString text; if( aData ) text = *(wxString*)aData; else text = m_Text; GRSetDrawMode( aDC, aDrawMode ); EDA_RECT* clipbox = aPanel? aPanel->GetClipBox() : NULL; DrawGraphicText( clipbox, aDC, text_pos, (EDA_COLOR_T) color, text, m_Orient, m_Size, m_HJustify, m_VJustify, linewidth, m_Italic, m_Bold ); /* Set to one (1) to draw bounding box around field text to validate * bounding box calculation. */#if 0 EDA_RECT bBox = GetBoundingBox(); EDA_RECT grBox; grBox.SetOrigin( aTransform.TransformCoordinate( bBox.GetOrigin() ) ); grBox.SetEnd( aTransform.TransformCoordinate( bBox.GetEnd() ) ); grBox.Move( aOffset ); GRRect( clipbox, aDC, grBox, 0, LIGHTMAGENTA );#endif}
开发者ID:johnbeard,项目名称:kicad-source-mirror,代码行数:54,
示例21: m_Endconst EDA_RECT SCH_BUS_ENTRY_BASE::GetBoundingBox() const{ EDA_RECT box; box.SetOrigin( m_pos ); box.SetEnd( m_End() ); box.Normalize(); box.Inflate( GetPenSize() / 2 ); return box;}
开发者ID:cpavlina,项目名称:kicad,代码行数:12,
示例22: GetPenSizeconst EDA_RECT LIB_RECTANGLE::GetBoundingBox() const{ EDA_RECT rect; rect.SetOrigin( m_Pos ); rect.SetEnd( m_End ); rect.Inflate( ( GetPenSize()+1 ) / 2 ); rect.RevertYAxis(); return rect;}
开发者ID:Caerbannog,项目名称:kicad-git-bzr,代码行数:12,
示例23: GetLayerColorvoid SCH_TEXT::Plot( PLOTTER* aPlotter ){ static std::vector <wxPoint> Poly; EDA_COLOR_T color = GetLayerColor( GetLayer() ); wxPoint textpos = m_Pos + GetSchematicTextOffset(); int thickness = GetPenSize(); aPlotter->SetCurrentLineWidth( thickness ); if( m_MultilineAllowed ) { std::vector<wxPoint> positions; wxArrayString strings_list; wxStringSplit( GetShownText(), strings_list, '/n' ); positions.reserve( strings_list.Count() ); GetPositionsOfLinesOfMultilineText(positions, strings_list.Count() ); for( unsigned ii = 0; ii < strings_list.Count(); ii++ ) { wxString& txt = strings_list.Item( ii ); aPlotter->Text( positions[ii], color, txt, m_Orient, m_Size, m_HJustify, m_VJustify, thickness, m_Italic, m_Bold ); } } else { aPlotter->Text( textpos, color, GetShownText(), m_Orient, m_Size, m_HJustify, m_VJustify, thickness, m_Italic, m_Bold ); } /* Draw graphic symbol for global or hierarchical labels */ CreateGraphicShape( Poly, m_Pos ); aPlotter->SetCurrentLineWidth( GetPenSize() ); if( Poly.size() ) aPlotter->PlotPoly( Poly, NO_FILL );}
开发者ID:bpkempke,项目名称:kicad-source-mirror,代码行数:40,
示例24: GetParentvoid SCH_FIELD::Plot( PLOTTER* aPlotter ){ SCH_COMPONENT* parent = ( SCH_COMPONENT* ) GetParent(); wxCHECK_RET( parent != NULL && parent->Type() == SCH_COMPONENT_T, wxT( "Cannot plot field with invalid parent." ) ); COLOR4D color = GetLayerColor( GetLayer() ); if( !IsVisible() ) return; if( IsVoid() ) return; /* Calculate the text orientation, according to the component * orientation/mirror */ int orient = GetTextAngle(); if( parent->GetTransform().y1 ) // Rotate component 90 deg. { if( orient == TEXT_ANGLE_HORIZ ) orient = TEXT_ANGLE_VERT; else orient = TEXT_ANGLE_HORIZ; } /* Calculate the text justification, according to the component * orientation/mirror * this is a bit complicated due to cumulative calculations: * - numerous cases (mirrored or not, rotation) * - the DrawGraphicText function recalculate also H and H justifications * according to the text orientation. * - When a component is mirrored, the text is not mirrored and * justifications are complicated to calculate * so the more easily way is to use no justifications ( Centered text ) * and use GetBoundaryBox to know the text coordinate considered as centered */ EDA_RECT BoundaryBox = GetBoundingBox(); EDA_TEXT_HJUSTIFY_T hjustify = GR_TEXT_HJUSTIFY_CENTER; EDA_TEXT_VJUSTIFY_T vjustify = GR_TEXT_VJUSTIFY_CENTER; wxPoint textpos = BoundaryBox.Centre(); int thickness = GetPenSize(); aPlotter->Text( textpos, color, GetFullyQualifiedText(), orient, GetTextSize(), hjustify, vjustify, thickness, IsItalic(), IsBold() );}
开发者ID:AlexanderBrevig,项目名称:kicad-source-mirror,代码行数:49,
注:本文中的GetPenSize函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ GetPeripheralClock函数代码示例 C++ GetPeiServicesTablePointer函数代码示例 |