D_PAD::D_PAD( MODULE* parent ) : BOARD_CONNECTED_ITEM( parent, PCB_PAD_T ) { m_NumPadName = 0; m_Size.x = m_Size.y = DMils2iu( 600 ); // Default pad size 60 mils. m_Drill.x = m_Drill.y = DMils2iu( 300 ); // Default drill size 30 mils. m_Orient = 0; // Pad rotation in 1/10 degrees. m_LengthPadToDie = 0; if( m_Parent && m_Parent->Type() == PCB_MODULE_T ) { m_Pos = GetParent()->GetPosition(); } SetShape( PAD_SHAPE_CIRCLE ); // Default pad shape is PAD_CIRCLE. SetDrillShape( PAD_DRILL_SHAPE_CIRCLE ); // Default pad drill shape is a circle. m_Attribute = PAD_ATTRIB_STANDARD; // Default pad type is NORMAL (thru hole) m_LocalClearance = 0; m_LocalSolderMaskMargin = 0; m_LocalSolderPasteMargin = 0; m_LocalSolderPasteMarginRatio = 0.0; m_ZoneConnection = PAD_ZONE_CONN_INHERITED; // Use parent setting by default m_ThermalWidth = 0; // Use parent setting by default m_ThermalGap = 0; // Use parent setting by default // Set layers mask to default for a standard thru hole pad. m_layerMask = StandardMask(); SetSubRatsnest( 0 ); // used in ratsnest calculations m_boundingRadius = -1; }
D_PAD::D_PAD( MODULE* parent ) : BOARD_CONNECTED_ITEM( parent, PCB_PAD_T ) { m_NumPadName = 0; m_Size.x = m_Size.y = 500; // give it a reasonable size m_Orient = 0; // Pad rotation in 1/10 degrees m_LengthPadToDie = 0; if( m_Parent && m_Parent->Type() == PCB_MODULE_T ) { m_Pos = GetParent()->GetPosition(); } m_PadShape = PAD_CIRCLE; // Shape: PAD_CIRCLE, PAD_RECT PAD_OVAL // PAD_TRAPEZOID m_Attribute = PAD_STANDARD; // Type: NORMAL, PAD_SMD, PAD_CONN m_DrillShape = PAD_CIRCLE; // Drill shape = circle m_LocalClearance = 0; m_LocalSolderMaskMargin = 0; m_LocalSolderPasteMargin = 0; m_LocalSolderPasteMarginRatio = 0.0; m_ZoneConnection = UNDEFINED_CONNECTION; // Use parent setting by default m_ThermalWidth = 0; // Use parent setting by default m_ThermalGap = 0; // Use parent setting by default // set layers mask to default for a standard pad m_layerMask = PAD_STANDARD_DEFAULT_LAYERS; SetSubRatsnest( 0 ); // used in ratsnest calculations m_boundingRadius = -1; }
void D_PAD::Copy( D_PAD* source ) { if( source == NULL ) return; m_Pos = source->m_Pos; m_layerMask = source->m_layerMask; m_NumPadName = source->m_NumPadName; m_netinfo = source->m_netinfo; m_Drill = source->m_Drill; m_drillShape = source->m_drillShape; m_Offset = source->m_Offset; m_Size = source->m_Size; m_DeltaSize = source->m_DeltaSize; m_Pos0 = source->m_Pos0; m_boundingRadius = source->m_boundingRadius; m_padShape = source->m_padShape; m_Attribute = source->m_Attribute; m_Orient = source->m_Orient; m_LengthPadToDie = source->m_LengthPadToDie; m_LocalClearance = source->m_LocalClearance; m_LocalSolderMaskMargin = source->m_LocalSolderMaskMargin; m_LocalSolderPasteMargin = source->m_LocalSolderPasteMargin; m_LocalSolderPasteMarginRatio = source->m_LocalSolderPasteMarginRatio; m_ZoneConnection = source->m_ZoneConnection; m_ThermalWidth = source->m_ThermalWidth; m_ThermalGap = source->m_ThermalGap; SetSubRatsnest( 0 ); SetSubNet( 0 ); }
D_PAD::D_PAD( MODULE* parent ) : BOARD_CONNECTED_ITEM( parent, PCB_PAD_T ) { m_Size.x = m_Size.y = Mils2iu( 60 ); // Default pad size 60 mils. m_Drill.x = m_Drill.y = Mils2iu( 30 ); // Default drill size 30 mils. m_Orient = 0; // Pad rotation in 1/10 degrees. m_LengthPadToDie = 0; if( m_Parent && m_Parent->Type() == PCB_MODULE_T ) { m_Pos = GetParent()->GetPosition(); } SetShape( PAD_SHAPE_CIRCLE ); // Default pad shape is PAD_CIRCLE. SetAnchorPadShape( PAD_SHAPE_CIRCLE ); // Default shape for custom shaped pads // is PAD_CIRCLE. SetDrillShape( PAD_DRILL_SHAPE_CIRCLE ); // Default pad drill shape is a circle. m_Attribute = PAD_ATTRIB_STANDARD; // Default pad type is NORMAL (thru hole) m_LocalClearance = 0; m_LocalSolderMaskMargin = 0; m_LocalSolderPasteMargin = 0; m_LocalSolderPasteMarginRatio = 0.0; // Parameters for round rect only: m_padRoundRectRadiusScale = 0.25; // from IPC-7351C standard // Parameters for chamfered rect only: m_padChamferRectScale = 0.2; // Size of chamfer: ratio of smallest of X,Y size m_chamferPositions = RECT_NO_CHAMFER; // No chamfered corner m_ZoneConnection = PAD_ZONE_CONN_INHERITED; // Use parent setting by default m_ThermalWidth = 0; // Use parent setting by default m_ThermalGap = 0; // Use parent setting by default m_customShapeClearanceArea = CUST_PAD_SHAPE_IN_ZONE_OUTLINE; // Set layers mask to default for a standard thru hole pad. m_layerMask = StandardMask(); SetSubRatsnest( 0 ); // used in ratsnest calculations m_boundingRadius = -1; }