当前位置: 首页>>代码示例>>C++>>正文


C++ Millimeter2iu函数代码示例

本文整理汇总了C++中Millimeter2iu函数的典型用法代码示例。如果您正苦于以下问题:C++ Millimeter2iu函数的具体用法?C++ Millimeter2iu怎么用?C++ Millimeter2iu使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了Millimeter2iu函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ReadParam

    void ReadParam( wxConfigBase* aConfig ) const override
    {
        if( !m_Pt_param || !aConfig )
            return;

        m_Pt_param->clear();

        for( int index = 1; ; ++index )
        {
            double width, gap, viagap;

            wxString key = dPairWidthKey;

            if( !aConfig->Read( key << index, &width ) )
                break;

            key = dPairGapKey;
            gap = aConfig->ReadDouble( key << index, 0.0 );

            key = dPairViaGapKey;
            viagap = aConfig->ReadDouble( key << index, 0.0 );

            m_Pt_param->emplace_back( DIFF_PAIR_DIMENSION( Millimeter2iu( width ),
                                                           Millimeter2iu( gap ),
                                                           Millimeter2iu( viagap ) ) );
        }
    }
开发者ID:johnbeard,项目名称:kicad,代码行数:27,代码来源:board_design_settings.cpp

示例2: CREATE_ARRAY_DIALOG_ENTRIES

 /**
  * Construct with some sensible defaults.
  * In future, this could be loaded from config?
  */
 CREATE_ARRAY_DIALOG_ENTRIES()
         : m_optionsSet( true ),
           m_gridNx( 5 ),
           m_gridNy( 5 ),
           m_gridDx( Millimeter2iu( 2.54 ) ),
           m_gridDy( Millimeter2iu( 2.54 ) ),
           m_gridOffsetX( 0 ),
           m_gridOffsetY( 0 ),
           m_gridStagger( 1 ),
           m_gridStaggerType( 0 ),   // rows
           m_gridNumberingAxis( 0 ), // h then v
           m_gridNumberingReverseAlternate( false ),
           m_gridNumberingStartSet( 1 ),    // use specified start
           m_grid2dArrayNumbering( 0 ),     // linear numbering
           m_gridPriAxisNumScheme( 0 ),     // numeric
           m_gridSecAxisNumScheme( 0 ),     // numeric
           m_gridPriNumberingOffset( "1" ), // numeric
           m_gridSecNumberingOffset( "1" ), // numeric
           m_circCentreX( 0 ),
           m_circCentreY( 0 ),
           m_circAngle( 0.0 ),
           m_circCount( 4 ),
           m_circNumberingStartSet( 1 ), // use specified start
           m_circNumberingOffset( "1" ),
           m_circRotate( false ),
           m_arrayTypeTab( 0 ) // start on grid view
 {
 }
开发者ID:johnbeard,项目名称:kicad,代码行数:32,代码来源:dialog_create_array.cpp

示例3: write_layers

static void write_layers( MODEL_VRML& aModel, std::ofstream& output_file, BOARD* aPcb )
{
    // VRML_LAYER board;
    aModel.board.Tesselate( &aModel.holes );
    double brdz = aModel.board_thickness / 2.0
                  - ( Millimeter2iu( ART_OFFSET / 2.0 ) ) * aModel.scale;
    write_triangle_bag( output_file, aModel.GetColor( VRML_COLOR_PCB ),
            &aModel.board, false, false, brdz, -brdz, aModel.precision );

    // VRML_LAYER top_copper;
    aModel.top_copper.Tesselate( &aModel.holes );
    write_triangle_bag( output_file, aModel.GetColor( VRML_COLOR_TRACK ),
            &aModel.top_copper, true, true,
            aModel.GetLayerZ( F_Cu ), 0, aModel.precision );

    // VRML_LAYER top_tin;
    aModel.top_tin.Tesselate( &aModel.holes );
    write_triangle_bag( output_file, aModel.GetColor( VRML_COLOR_TIN ),
            &aModel.top_tin, true, true,
            aModel.GetLayerZ( F_Cu )
            + Millimeter2iu( ART_OFFSET / 2.0 ) * aModel.scale,
            0, aModel.precision );

    // VRML_LAYER bot_copper;
    aModel.bot_copper.Tesselate( &aModel.holes );
    write_triangle_bag( output_file, aModel.GetColor( VRML_COLOR_TRACK ),
            &aModel.bot_copper, true, false,
            aModel.GetLayerZ( B_Cu ), 0, aModel.precision );

    // VRML_LAYER bot_tin;
    aModel.bot_tin.Tesselate( &aModel.holes );
    write_triangle_bag( output_file, aModel.GetColor( VRML_COLOR_TIN ),
                        &aModel.bot_tin, true, false,
                        aModel.GetLayerZ( B_Cu )
                        - Millimeter2iu( ART_OFFSET / 2.0 ) * aModel.scale,
                        0, aModel.precision );

    // VRML_LAYER PTH;
    aModel.plated_holes.Tesselate( NULL, true );
    write_triangle_bag( output_file, aModel.GetColor( VRML_COLOR_TIN ),
                        &aModel.plated_holes, false, false,
                        aModel.GetLayerZ( F_Cu )
                        + Millimeter2iu( ART_OFFSET / 2.0 ) * aModel.scale,
                        aModel.GetLayerZ( B_Cu )
                        - Millimeter2iu( ART_OFFSET / 2.0 ) * aModel.scale,
                        aModel.precision );

    // VRML_LAYER top_silk;
    aModel.top_silk.Tesselate( &aModel.holes );
    write_triangle_bag( output_file, aModel.GetColor( VRML_COLOR_SILK ),
            &aModel.top_silk, true, true,
            aModel.GetLayerZ( F_SilkS ), 0, aModel.precision );

    // VRML_LAYER bot_silk;
    aModel.bot_silk.Tesselate( &aModel.holes );
    write_triangle_bag( output_file, aModel.GetColor( VRML_COLOR_SILK ),
            &aModel.bot_silk, true, false,
            aModel.GetLayerZ( B_SilkS ), 0, aModel.precision );
}
开发者ID:LDavis4559,项目名称:kicad-source-mirror,代码行数:59,代码来源:export_vrml.cpp

示例4: BOARD_ITEM

PCB_TARGET::PCB_TARGET( BOARD_ITEM* aParent ) :
    BOARD_ITEM( aParent, PCB_TARGET_T )
{
    m_Shape = 0;
    m_Size  = Millimeter2iu( 5 );       // Gives a decent size
    m_Width = Millimeter2iu( 0.15 );    // Gives a decent width
    m_Layer = Edge_Cuts;                   // a target is on all layers
}
开发者ID:cpavlina,项目名称:kicad,代码行数:8,代码来源:class_pcb_target.cpp

示例5: switch

bool DIALOG_NON_COPPER_ZONES_EDITOR::TransferDataToWindow()
{
    m_cornerSmoothingChoice->SetSelection( m_settings.GetCornerSmoothingType() );
    m_cornerRadius.SetValue( m_settings.GetCornerRadius() );

    m_minWidth.SetValue( m_settings.m_ZoneMinThickness );
    m_ConstrainOpt->SetValue( m_settings.m_Zone_45_Only );

    switch( m_settings.m_Zone_HatchingStyle )
    {
    case ZONE_CONTAINER::NO_HATCH:      m_OutlineAppearanceCtrl->SetSelection( 0 ); break;
    case ZONE_CONTAINER::DIAGONAL_EDGE: m_OutlineAppearanceCtrl->SetSelection( 1 ); break;
    case ZONE_CONTAINER::DIAGONAL_FULL: m_OutlineAppearanceCtrl->SetSelection( 2 ); break;
    }

    SetInitialFocus( m_OutlineAppearanceCtrl );

    switch( m_settings.m_FillMode )
    {
    case ZFM_HATCH_PATTERN:
        m_GridStyleCtrl->SetSelection( 1 ); break;
    default:
        m_GridStyleCtrl->SetSelection( 0 ); break;
    }

    m_gridStyleRotation.SetUnits( DEGREES );
    m_gridStyleRotation.SetValue( m_settings.m_HatchFillTypeOrientation*10 ); // IU is decidegree

    // Gives a reasonable value to grid style parameters, if currently there are no defined
    // parameters for grid pattern thickness and gap (if the value is 0)
    // the grid pattern thickness default value is (arbitrary) m_ZoneMinThickness * 4
    // or 1mm
    // the grid pattern gap default value is (arbitrary) m_ZoneMinThickness * 6
    // or 1.5 mm
    int bestvalue = m_settings.m_HatchFillTypeThickness;

    if( bestvalue <= 0 )     // No defined value for m_HatchFillTypeThickness
        bestvalue = std::max( m_settings.m_ZoneMinThickness * 4, Millimeter2iu( 1.0 ) );

    m_gridStyleThickness.SetValue( std::max( bestvalue, m_settings.m_ZoneMinThickness ) );

    bestvalue = m_settings.m_HatchFillTypeGap;

    if( bestvalue <= 0 )     // No defined value for m_HatchFillTypeGap
        bestvalue = std::max( m_settings.m_ZoneMinThickness * 6, Millimeter2iu( 1.5 ) );

    m_gridStyleGap.SetValue( std::max( bestvalue, m_settings.m_ZoneMinThickness ) );

    m_spinCtrlSmoothLevel->SetValue( m_settings.m_HatchFillTypeSmoothingLevel );
    m_spinCtrlSmoothValue->SetValue( m_settings.m_HatchFillTypeSmoothingValue );

    // Enable/Disable some widgets
    wxCommandEvent event;
    OnStyleSelection( event );

    return true;
}
开发者ID:KiCad,项目名称:kicad-source-mirror,代码行数:57,代码来源:dialog_non_copper_zones_properties.cpp

示例6: ValueFromTextCtrl

void DIALOG_PLOT_SCHEMATIC::SetHPGLPenWidth()
{
    m_HPGLPenSize = ValueFromTextCtrl( *m_penHPGLWidthCtrl );

    if( m_HPGLPenSize > Millimeter2iu( 2 ) )
        m_HPGLPenSize = Millimeter2iu( 2 );

    if( m_HPGLPenSize < Millimeter2iu( 0.01 ) )
        m_HPGLPenSize = Millimeter2iu( 0.01 );
}
开发者ID:PatMart,项目名称:kicad-source-mirror,代码行数:10,代码来源:plot_schematic_HPGL.cpp

示例7: EDGE_MODULE

void DXF2BRD_CONVERTER::insertLine( const wxRealPoint& aSegStart,
                                    const wxRealPoint& aSegEnd, int aWidth )
{
    DRAWSEGMENT* segm = ( m_useModuleItems ) ?
                        static_cast< DRAWSEGMENT* >( new EDGE_MODULE( NULL ) ) : new DRAWSEGMENT;
    wxPoint segment_startpoint( Millimeter2iu( aSegStart.x ), Millimeter2iu( aSegStart.y ) );
    wxPoint segment_endpoint( Millimeter2iu( aSegEnd.x ), Millimeter2iu( aSegEnd.y ) );

    segm->SetLayer( ToLAYER_ID( m_brdLayer ) );
    segm->SetStart( segment_startpoint );
    segm->SetEnd( segment_endpoint );
    segm->SetWidth( aWidth );

    m_newItemsList.push_back( segm );
    return;
}
开发者ID:AlexanderBrevig,项目名称:kicad-source-mirror,代码行数:16,代码来源:dxf2brd_items.cpp

示例8: wxGetApp

void PCB_EDIT_FRAME::LoadSettings()
{
    wxConfig* config = wxGetApp().GetSettings();

    if( config == NULL )
        return;

    // The configuration setting that used to be mixed in with the project file settings.
    wxGetApp().ReadCurrentSetupValues( GetConfigurationSettings() );

    PCB_BASE_FRAME::LoadSettings();

    double dtmp;
    config->Read( OPTKEY_DEFAULT_LINEWIDTH_VALUE, &dtmp, 0.1 ); // stored in mm
    if( dtmp < 0.01 )
        dtmp = 0.01;
    if( dtmp > 5.0 )
        dtmp = 5.0;
    g_DrawDefaultLineThickness = Millimeter2iu( dtmp );
    long tmp;
    config->Read( PCB_SHOW_FULL_RATSNET_OPT, &tmp );
    GetBoard()->SetElementVisibility(RATSNEST_VISIBLE, tmp);

    config->Read( PCB_MAGNETIC_PADS_OPT, &g_MagneticPadOption );
    config->Read( PCB_MAGNETIC_TRACKS_OPT, &g_MagneticTrackOption );
    config->Read( SHOW_MICROWAVE_TOOLS, &m_show_microwave_tools );
    config->Read( SHOW_LAYER_MANAGER_TOOLS, &m_show_layer_manager_tools );

    // WxWidgets 2.9.1 seems call setlocale( LC_NUMERIC, "" )
    // when reading doubles in config,
    // but forget to back to current locale. So we call SetLocaleTo_Default
    SetLocaleTo_Default( );
}
开发者ID:jerkey,项目名称:kicad,代码行数:33,代码来源:pcbframe.cpp

示例9: wxConfigLoadSetups

void PCB_EDIT_FRAME::LoadSettings( wxConfigBase* aCfg )
{
    PCB_BASE_FRAME::LoadSettings( aCfg );

    wxConfigLoadSetups( aCfg, GetConfigurationSettings() );

    double dtmp;
    aCfg->Read( OPTKEY_DEFAULT_LINEWIDTH_VALUE, &dtmp, 0.1 ); // stored in mm

    if( dtmp < 0.01 )
        dtmp = 0.01;

    if( dtmp > 5.0 )
        dtmp = 5.0;

    g_DrawDefaultLineThickness = Millimeter2iu( dtmp );

    long tmp;

    aCfg->Read( PCB_SHOW_FULL_RATSNET_OPT, &tmp );
    GetBoard()->SetElementVisibility(RATSNEST_VISIBLE, tmp);

    aCfg->Read( PCB_MAGNETIC_PADS_OPT, &g_MagneticPadOption );
    aCfg->Read( PCB_MAGNETIC_TRACKS_OPT, &g_MagneticTrackOption );
    aCfg->Read( SHOW_MICROWAVE_TOOLS, &m_show_microwave_tools );
    aCfg->Read( SHOW_LAYER_MANAGER_TOOLS, &m_show_layer_manager_tools );

    // WxWidgets 2.9.1 seems call setlocale( LC_NUMERIC, "" )
    // when reading doubles in cfg,
    // but forget to back to current locale. So we call SetLocaleTo_Default
    SetLocaleTo_Default( );
}
开发者ID:michaellis,项目名称:kicad-source-mirror,代码行数:32,代码来源:pcbframe.cpp

示例10: wxConfigLoadSetups

void PCB_EDIT_FRAME::LoadSettings( wxConfigBase* aCfg )
{
    PCB_BASE_FRAME::LoadSettings( aCfg );

    wxConfigLoadSetups( aCfg, GetConfigurationSettings() );

    double dtmp;
    aCfg->Read( OPTKEY_DEFAULT_LINEWIDTH_VALUE, &dtmp, 0.1 ); // stored in mm

    if( dtmp < 0.01 )
        dtmp = 0.01;

    if( dtmp > 5.0 )
        dtmp = 5.0;

    g_DrawDefaultLineThickness = Millimeter2iu( dtmp );

    long tmp;

    aCfg->Read( PCB_SHOW_FULL_RATSNET_OPT, &tmp );
    GetBoard()->SetElementVisibility(RATSNEST_VISIBLE, tmp);

    aCfg->Read( PCB_MAGNETIC_PADS_OPT, &g_MagneticPadOption );
    aCfg->Read( PCB_MAGNETIC_TRACKS_OPT, &g_MagneticTrackOption );
    aCfg->Read( SHOW_MICROWAVE_TOOLS, &m_show_microwave_tools );
    aCfg->Read( SHOW_LAYER_MANAGER_TOOLS, &m_show_layer_manager_tools );
}
开发者ID:khaterahmohammadi,项目名称:kicad-source-mirror,代码行数:27,代码来源:pcbframe.cpp

示例11: BOARD_ITEM

TEXTE_MODULE::TEXTE_MODULE( MODULE* parent, TEXT_TYPE text_type ) :
    BOARD_ITEM( parent, PCB_MODULE_TEXT_T ),
    EDA_TEXT()
{
    MODULE* module = static_cast<MODULE*>( m_Parent );

    m_Type = text_type;
    m_unlocked = false;

    // Set text thickness to a default value
    SetThickness( Millimeter2iu( 0.15 ) );
    SetLayer( F_SilkS );

    // Set position and give a default layer if a valid parent footprint exists
    if( module && ( module->Type() == PCB_MODULE_T ) )
    {
        SetTextPos( module->GetPosition() );

        if( IsBackLayer( module->GetLayer() ) )
        {
            SetLayer( B_SilkS );
            SetMirrored( true );
        }
    }

    SetDrawCoord();
}
开发者ID:zhihuitech,项目名称:kicad-source-mirror,代码行数:27,代码来源:class_text_mod.cpp

示例12: switch

unsigned int GERBER_DRAW_ITEM::ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const
{
    // DCodes will be shown only if zoom is appropriate:
    // Returns the level of detail of the item.
    // A level of detail (LOD) is the minimal VIEW scale that
    // is sufficient for an item to be shown on a given layer.
    if( IsDCodeLayer( aLayer ) )
    {
        int size = 0;

        switch( m_Shape )
        {
        case GBR_SPOT_MACRO:
            size = GetDcodeDescr()->GetMacro()->GetBoundingBox().GetWidth();
            break;

        case GBR_ARC:
            size = GetLineLength( m_Start, m_ArcCentre );
            break;

        default:
            size = m_Size.x;
        }

        // the level of details is chosen experimentally, to show
        // only a readable text:
        const int level = Millimeter2iu( 4 );
        return ( level / ( size + 1 ) );
    }

    // Other layers are shown without any conditions
    return 0;
}
开发者ID:Lotharyx,项目名称:kicad-source-mirror,代码行数:33,代码来源:gerber_draw_item.cpp

示例13: BOARD_ITEM

TEXTE_MODULE::TEXTE_MODULE( MODULE* parent, TEXT_TYPE text_type ) :
    BOARD_ITEM( parent, PCB_MODULE_TEXT_T ),
    EDA_TEXT()
{
    MODULE* module = (MODULE*) m_Parent;

    m_Type = text_type;

    m_NoShow = false;

    // Set text tickness to a default value
    m_Thickness = Millimeter2iu( 0.15 );

    SetLayer( SILKSCREEN_N_FRONT );

    if( module && ( module->Type() == PCB_MODULE_T ) )
    {
        m_Pos = module->GetPosition();

        if( IsBackLayer( module->GetLayer() ) )
        {
            SetLayer( SILKSCREEN_N_BACK );
            m_Mirror = true;
        }
        else
        {
            SetLayer( SILKSCREEN_N_FRONT );
            m_Mirror = false;
        }
    }
}
开发者ID:Th0rN13,项目名称:kicad-source-mirror,代码行数:31,代码来源:class_text_mod.cpp

示例14: BOARD_CONNECTED_ITEM

TRACK::TRACK( BOARD_ITEM* aParent, KICAD_T idtype ) :
    BOARD_CONNECTED_ITEM( aParent, idtype )
{
    m_Width = Millimeter2iu( 0.2 );
    start   = end = NULL;
    m_Param = 0;
}
开发者ID:johnbeard,项目名称:kicad-source-mirror,代码行数:7,代码来源:class_track.cpp

示例15: BOARD_ITEM

DIMENSION::DIMENSION( BOARD_ITEM* aParent ) :
    BOARD_ITEM( aParent, PCB_DIMENSION_T ),
    m_Width( Millimeter2iu( 0.2 ) ), m_Unit( INCHES ), m_Value( 0 ), m_Height( 0 ), m_Text( this )
{
    m_Layer = Dwgs_User;
    m_Shape = 0;
}
开发者ID:RocFan,项目名称:kicad-source-mirror,代码行数:7,代码来源:class_dimension.cpp


注:本文中的Millimeter2iu函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。