Prefix DIMENSION types.

This commit is contained in:
Jeff Young 2021-06-11 17:59:28 +01:00
parent 6ab995d6a4
commit 16b0147af8
44 changed files with 291 additions and 291 deletions

View File

@ -42,7 +42,7 @@
#include <pcb_base_frame.h>
#include <pcb_text.h>
#include <pcb_shape.h>
#include <dimension.h>
#include <pcb_dimension.h>
#include <zone.h>
#include <footprint.h>
#include <reporter.h>
@ -586,8 +586,9 @@ private:
void addShapeWithClearance( const PCB_SHAPE* aShape, CONTAINER_2D_BASE* aDstContainer,
PCB_LAYER_ID aLayerId, int aClearanceValue );
void addShapeWithClearance( const DIMENSION_BASE* aDimension, CONTAINER_2D_BASE* aDstContainer,
PCB_LAYER_ID aLayerId, int aClearanceValue );
void addShapeWithClearance( const PCB_DIMENSION_BASE* aDimension,
CONTAINER_2D_BASE* aDstContainer, PCB_LAYER_ID aLayerId,
int aClearanceValue );
void addSolidAreasShapes( const ZONE* aZoneContainer, CONTAINER_2D_BASE* aDstContainer,
PCB_LAYER_ID aLayerId );

View File

@ -110,7 +110,7 @@ void BOARD_ADAPTER::addShapeWithClearance( const PCB_TEXT* aText, CONTAINER_2D_B
}
void BOARD_ADAPTER::addShapeWithClearance( const DIMENSION_BASE* aDimension,
void BOARD_ADAPTER::addShapeWithClearance( const PCB_DIMENSION_BASE* aDimension,
CONTAINER_2D_BASE* aDstContainer,
PCB_LAYER_ID aLayerId, int aClearanceValue )
{

View File

@ -625,7 +625,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
case PCB_DIM_CENTER_T:
case PCB_DIM_ORTHOGONAL_T:
case PCB_DIM_LEADER_T:
addShapeWithClearance( static_cast<DIMENSION_BASE*>( item ),
addShapeWithClearance( static_cast<PCB_DIMENSION_BASE*>( item ),
layerContainer, curr_layer_id, 0 );
break;
@ -919,7 +919,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
case PCB_DIM_CENTER_T:
case PCB_DIM_ORTHOGONAL_T:
case PCB_DIM_LEADER_T:
addShapeWithClearance( static_cast<DIMENSION_BASE*>( item ), layerContainer,
addShapeWithClearance( static_cast<PCB_DIMENSION_BASE*>( item ), layerContainer,
curr_layer_id, 0 );
break;

View File

@ -516,7 +516,7 @@ set( PCB_COMMON_SRCS
${CMAKE_SOURCE_DIR}/pcbnew/board_items_to_polygon_shape_transform.cpp
${CMAKE_SOURCE_DIR}/pcbnew/board.cpp
${CMAKE_SOURCE_DIR}/pcbnew/board_item.cpp
${CMAKE_SOURCE_DIR}/pcbnew/dimension.cpp
${CMAKE_SOURCE_DIR}/pcbnew/pcb_dimension.cpp
${CMAKE_SOURCE_DIR}/pcbnew/pcb_shape.cpp
${CMAKE_SOURCE_DIR}/pcbnew/fp_shape.cpp
${CMAKE_SOURCE_DIR}/pcbnew/pcb_group.cpp

View File

@ -96,11 +96,11 @@ enum KICAD_T
PCB_VIA_T, ///< class VIA, a via (like a track segment on a copper layer)
PCB_ARC_T, ///< class ARC, an arc track segment on a copper layer
PCB_MARKER_T, ///< class MARKER_PCB, a marker used to show something
PCB_DIMENSION_T, ///< class DIMENSION_BASE: abstract dimension meta-type
PCB_DIM_ALIGNED_T, ///< class ALIGNED_DIMENSION, a linear dimension (graphic item)
PCB_DIM_LEADER_T, ///< class LEADER, a leader dimension (graphic item)
PCB_DIM_CENTER_T, ///< class CENTER_DIMENSION, a center point marking (graphic item)
PCB_DIM_ORTHOGONAL_T, ///< class ORTHOGONAL_DIMENSION, a linear dimension constrained to x/y
PCB_DIMENSION_T, ///< class PCB_DIMENSION_BASE: abstract dimension meta-type
PCB_DIM_ALIGNED_T, ///< class PCB_DIM_ALIGNED, a linear dimension (graphic item)
PCB_DIM_LEADER_T, ///< class PCB_DIM_LEADER, a leader dimension (graphic item)
PCB_DIM_CENTER_T, ///< class PCB_DIM_CENTER, a center point marking (graphic item)
PCB_DIM_ORTHOGONAL_T, ///< class PCB_DIM_ORTHOGONAL, a linear dimension constrained to x/y
PCB_TARGET_T, ///< class PCB_TARGET, a target (graphic item)
PCB_ZONE_T, ///< class ZONE, a copper pour area
PCB_ITEM_LIST_T, ///< class BOARD_ITEM_LIST, a list of board items

View File

@ -452,10 +452,10 @@ add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/pcbnew_wrap.cxx
DEPENDS python/swig/board_item.i
DEPENDS python/swig/board_item_container.i
DEPENDS python/swig/connectivity.i
DEPENDS python/swig/dimension.i
DEPENDS python/swig/pcb_dimension.i
DEPENDS python/swig/pcb_shape.i
DEPENDS python/swig/fp_shape.i
DEPENDS python/swig/marker_pcb.i
DEPENDS python/swig/pcb_marker.i
DEPENDS python/swig/pcb_target.i
DEPENDS python/swig/pcb_plot_params.i
DEPENDS python/swig/footprint.i

View File

@ -21,7 +21,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <dimension.h>
#include <pcb_dimension.h>
#include <track.h>
#include <layers_id_colors_and_visibility.h>
#include <kiface_i.h>

View File

@ -28,7 +28,7 @@
#include <trigo.h>
#include <board.h>
#include <pad.h>
#include <dimension.h>
#include <pcb_dimension.h>
#include <track.h>
#include <kicad_string.h>
#include <pcb_shape.h>
@ -774,10 +774,10 @@ void ZONE::TransformShapeWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer,
}
void DIMENSION_BASE::TransformShapeWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer,
PCB_LAYER_ID aLayer, int aClearance,
int aError, ERROR_LOC aErrorLoc,
bool aIgnoreLineWidth ) const
void PCB_DIMENSION_BASE::TransformShapeWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer,
PCB_LAYER_ID aLayer, int aClearance,
int aError, ERROR_LOC aErrorLoc,
bool aIgnoreLineWidth ) const
{
wxASSERT_MSG( !aIgnoreLineWidth, "IgnoreLineWidth has no meaning for dimensions." );
@ -800,7 +800,7 @@ void DIMENSION_BASE::TransformShapeWithClearanceToPolygon( SHAPE_POLY_SET& aCorn
}
else
{
wxFAIL_MSG( "DIMENSION::TransformShapeWithClearanceToPolygon unexpected shape type." );
wxFAIL_MSG( "PCB_DIMENSION_BASE::TransformShapeWithClearanceToPolygon unexpected shape type." );
}
}
}

View File

@ -30,7 +30,7 @@
#include <pad.h>
#include <track.h>
#include <pcb_marker.h>
#include <dimension.h>
#include <pcb_dimension.h>
#include <zone.h>
#include <pcb_shape.h>
#include <pcb_group.h>
@ -156,16 +156,16 @@ const KICAD_T GENERAL_COLLECTOR::DraggableItems[] = {
SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_ITEM* testItem, void* testData )
{
BOARD_ITEM* item = (BOARD_ITEM*) testItem;
FOOTPRINT* footprint = nullptr;
PCB_GROUP* group = nullptr;
PAD* pad = nullptr;
bool pad_through = false;
VIA* via = nullptr;
PCB_MARKER* marker = nullptr;
ZONE* zone = nullptr;
PCB_SHAPE* shape = nullptr;
DIMENSION_BASE* dimension = nullptr;
BOARD_ITEM* item = (BOARD_ITEM*) testItem;
FOOTPRINT* footprint = nullptr;
PCB_GROUP* group = nullptr;
PAD* pad = nullptr;
bool pad_through = false;
VIA* via = nullptr;
PCB_MARKER* marker = nullptr;
ZONE* zone = nullptr;
PCB_SHAPE* shape = nullptr;
PCB_DIMENSION_BASE* dimension = nullptr;
#if 0 // debugging
static int breakhere = 0;
@ -288,7 +288,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_ITEM* testItem, void* testData )
case PCB_DIM_CENTER_T:
case PCB_DIM_ORTHOGONAL_T:
case PCB_DIM_LEADER_T:
dimension = static_cast<DIMENSION_BASE*>( item );
dimension = static_cast<PCB_DIMENSION_BASE*>( item );
break;
case PCB_TARGET_T:

View File

@ -20,7 +20,7 @@
#include <board.h>
#include <board_commit.h>
#include <dimension.h>
#include <pcb_dimension.h>
#include <pcb_base_edit_frame.h>
#include <pcb_layer_box_selector.h>
#include <widgets/unit_binder.h>
@ -47,8 +47,8 @@ DIALOG_DIMENSION_PROPERTIES::DIALOG_DIMENSION_PROPERTIES( PCB_BASE_EDIT_FRAME* a
m_extensionOffset( aParent, m_lblExtensionOffset, m_txtExtensionOffset, m_lblExtensionOffsetUnits )
{
wxASSERT( BaseType( aItem->Type() ) == PCB_DIMENSION_T );
m_dimension = static_cast<DIMENSION_BASE*>( aItem );
m_previewDimension = static_cast<DIMENSION_BASE*>( m_dimension->Clone() );
m_dimension = static_cast<PCB_DIMENSION_BASE*>( aItem );
m_previewDimension = static_cast<PCB_DIMENSION_BASE*>( m_dimension->Clone() );
m_previewDimension->SetParent( m_frame->GetBoard() );
switch( m_dimension->Type() )
@ -247,7 +247,7 @@ bool DIALOG_DIMENSION_PROPERTIES::TransferDataToWindow()
if( m_dimension->Type() == PCB_DIM_LEADER_T )
{
LEADER* leader = static_cast<LEADER*>( m_dimension );
PCB_DIM_LEADER* leader = static_cast<PCB_DIM_LEADER*>( m_dimension );
m_cbTextFrame->SetSelection( static_cast<int>( leader->GetTextFrame() ) );
}
@ -283,7 +283,7 @@ bool DIALOG_DIMENSION_PROPERTIES::TransferDataFromWindow()
}
void DIALOG_DIMENSION_PROPERTIES::updateDimensionFromDialog( DIMENSION_BASE* aTarget )
void DIALOG_DIMENSION_PROPERTIES::updateDimensionFromDialog( PCB_DIMENSION_BASE* aTarget )
{
BOARD* board = m_frame->GetBoard();
@ -353,7 +353,7 @@ void DIALOG_DIMENSION_PROPERTIES::updateDimensionFromDialog( DIMENSION_BASE* aTa
if( aTarget->Type() == PCB_DIM_LEADER_T )
{
LEADER* leader = static_cast<LEADER*>( aTarget );
PCB_DIM_LEADER* leader = static_cast<PCB_DIM_LEADER*>( aTarget );
leader->SetTextFrame( static_cast<DIM_TEXT_FRAME>( m_cbTextFrame->GetSelection() ) );
}

View File

@ -28,7 +28,7 @@
class BOARD_ITEM;
class DIMENSION_BASE;
class PCB_DIMENSION_BASE;
class PCB_BASE_EDIT_FRAME;
@ -48,8 +48,8 @@ private:
PCB_BASE_EDIT_FRAME* m_frame;
DIMENSION_BASE* m_dimension;
DIMENSION_BASE* m_previewDimension;
PCB_DIMENSION_BASE* m_dimension;
PCB_DIMENSION_BASE* m_previewDimension;
PCB_LAYER_BOX_SELECTOR* m_cbLayerActual; // The active layer box control
wxTextCtrl* m_txtValueActual; // The active value control
@ -67,7 +67,7 @@ private:
UNIT_BINDER m_arrowLength;
UNIT_BINDER m_extensionOffset;
void updateDimensionFromDialog( DIMENSION_BASE* aTarget );
void updateDimensionFromDialog( PCB_DIMENSION_BASE* aTarget );
void updatePreviewText();
};

View File

@ -30,7 +30,7 @@
#include <board.h>
#include <board_design_settings.h>
#include <footprint.h>
#include <dimension.h>
#include <pcb_dimension.h>
#include <fp_shape.h>
#include <pcb_text.h>
#include <widgets/unit_binder.h>
@ -287,10 +287,10 @@ void DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::processItem( BOARD_COMMIT& aCommit, B
{
aCommit.Modify( aItem );
EDA_TEXT* textItem = dynamic_cast<EDA_TEXT*>( aItem );
FP_TEXT* fpTextItem = dynamic_cast<FP_TEXT*>( aItem );
PCB_SHAPE* drawItem = dynamic_cast<PCB_SHAPE*>( aItem );
DIMENSION_BASE* dimension = dynamic_cast<DIMENSION_BASE*>( aItem );
EDA_TEXT* textItem = dynamic_cast<EDA_TEXT*>( aItem );
FP_TEXT* fpTextItem = dynamic_cast<FP_TEXT*>( aItem );
PCB_SHAPE* drawItem = dynamic_cast<PCB_SHAPE*>( aItem );
PCB_DIMENSION_BASE* dimension = dynamic_cast<PCB_DIMENSION_BASE*>( aItem );
if( dimension )
textItem = &dimension->Text();

View File

@ -40,7 +40,7 @@
#include <drc/drc_item.h>
#include <drc/drc_rule.h>
#include <drc/drc_test_provider_clearance_base.h>
#include <dimension.h>
#include <pcb_dimension.h>
/*
Copper clearance test. Checks all copper items (pads, vias, tracks, drawings, zones) for their electrical clearance.

View File

@ -35,7 +35,7 @@
#include <track.h>
#include <zone.h>
#include <pcb_target.h>
#include <dimension.h>
#include <pcb_dimension.h>
#include <pcb_layer_box_selector.h>
#include <dialog_drc.h>
#include <connectivity/connectivity_data.h>
@ -139,7 +139,7 @@ void PCB_EDIT_FRAME::OnEditItemRequest( BOARD_ITEM* aItem )
case PCB_DIM_CENTER_T:
case PCB_DIM_ORTHOGONAL_T:
case PCB_DIM_LEADER_T:
ShowDimensionPropertiesDialog( static_cast<DIMENSION_BASE*>( aItem ) );
ShowDimensionPropertiesDialog( static_cast<PCB_DIMENSION_BASE*>( aItem ) );
break;
case PCB_FP_TEXT_T:
@ -164,7 +164,7 @@ void PCB_EDIT_FRAME::OnEditItemRequest( BOARD_ITEM* aItem )
}
void PCB_EDIT_FRAME::ShowDimensionPropertiesDialog( DIMENSION_BASE* aDimension )
void PCB_EDIT_FRAME::ShowDimensionPropertiesDialog( PCB_DIMENSION_BASE* aDimension )
{
if( aDimension == nullptr )
return;

View File

@ -32,7 +32,7 @@
#include <pgm_base.h>
#include <board.h>
#include <board_design_settings.h>
#include <dimension.h>
#include <pcb_dimension.h>
#include <footprint_info_impl.h>
#include <project.h>
#include <settings/color_settings.h>
@ -187,7 +187,7 @@ void PCB_BASE_EDIT_FRAME::unitsChangeRefresh()
INSPECTOR_FUNC inspector =
[units, view]( EDA_ITEM* aItem, void* aTestData )
{
DIMENSION_BASE* dimension = static_cast<DIMENSION_BASE*>( aItem );
PCB_DIMENSION_BASE* dimension = static_cast<PCB_DIMENSION_BASE*>( aItem );
if( dimension->GetUnitsMode() == DIM_UNITS_MODE::AUTOMATIC )
{

View File

@ -28,7 +28,7 @@
#include <pcb_edit_frame.h>
#include <base_units.h>
#include <board.h>
#include <dimension.h>
#include <pcb_dimension.h>
#include <pcb_text.h>
#include <geometry/shape_compound.h>
#include <geometry/shape_circle.h>
@ -39,7 +39,7 @@
#include <i18n_utility.h>
DIMENSION_BASE::DIMENSION_BASE( BOARD_ITEM* aParent, KICAD_T aType ) :
PCB_DIMENSION_BASE::PCB_DIMENSION_BASE( BOARD_ITEM* aParent, KICAD_T aType ) :
BOARD_ITEM( aParent, aType ),
m_overrideTextEnabled( false ),
m_units( EDA_UNITS::INCHES ),
@ -59,14 +59,14 @@ DIMENSION_BASE::DIMENSION_BASE( BOARD_ITEM* aParent, KICAD_T aType ) :
}
void DIMENSION_BASE::SetParent( EDA_ITEM* aParent )
void PCB_DIMENSION_BASE::SetParent( EDA_ITEM* aParent )
{
BOARD_ITEM::SetParent( aParent );
m_text.SetParent( aParent );
}
void DIMENSION_BASE::updateText()
void PCB_DIMENSION_BASE::updateText()
{
wxString text = m_overrideTextEnabled ? m_valueString : GetValueText();
@ -95,13 +95,13 @@ void DIMENSION_BASE::updateText()
template<typename ShapeType>
void DIMENSION_BASE::addShape( const ShapeType& aShape )
void PCB_DIMENSION_BASE::addShape( const ShapeType& aShape )
{
m_shapes.push_back( std::make_shared<ShapeType>( aShape ) );
}
wxString DIMENSION_BASE::GetValueText() const
wxString PCB_DIMENSION_BASE::GetValueText() const
{
struct lconv* lc = localeconv();
wxChar sep = lc->decimal_point[0];
@ -130,25 +130,25 @@ wxString DIMENSION_BASE::GetValueText() const
}
void DIMENSION_BASE::SetPrefix( const wxString& aPrefix )
void PCB_DIMENSION_BASE::SetPrefix( const wxString& aPrefix )
{
m_prefix = aPrefix;
}
void DIMENSION_BASE::SetSuffix( const wxString& aSuffix )
void PCB_DIMENSION_BASE::SetSuffix( const wxString& aSuffix )
{
m_suffix = aSuffix;
}
void DIMENSION_BASE::SetUnits( EDA_UNITS aUnits )
void PCB_DIMENSION_BASE::SetUnits( EDA_UNITS aUnits )
{
m_units = aUnits;
}
DIM_UNITS_MODE DIMENSION_BASE::GetUnitsMode() const
DIM_UNITS_MODE PCB_DIMENSION_BASE::GetUnitsMode() const
{
if( m_autoUnits )
{
@ -172,7 +172,7 @@ DIM_UNITS_MODE DIMENSION_BASE::GetUnitsMode() const
}
void DIMENSION_BASE::SetUnitsMode( DIM_UNITS_MODE aMode )
void PCB_DIMENSION_BASE::SetUnitsMode( DIM_UNITS_MODE aMode )
{
m_autoUnits = false;
@ -197,27 +197,27 @@ void DIMENSION_BASE::SetUnitsMode( DIM_UNITS_MODE aMode )
}
void DIMENSION_BASE::SetText( const wxString& aNewText )
void PCB_DIMENSION_BASE::SetText( const wxString& aNewText )
{
m_valueString = aNewText;
updateText();
}
const wxString DIMENSION_BASE::GetText() const
const wxString PCB_DIMENSION_BASE::GetText() const
{
return m_text.GetText();
}
void DIMENSION_BASE::SetLayer( PCB_LAYER_ID aLayer )
void PCB_DIMENSION_BASE::SetLayer( PCB_LAYER_ID aLayer )
{
m_layer = aLayer;
m_text.SetLayer( aLayer );
}
void DIMENSION_BASE::Move( const wxPoint& offset )
void PCB_DIMENSION_BASE::Move( const wxPoint& offset )
{
m_text.Offset( offset );
@ -228,7 +228,7 @@ void DIMENSION_BASE::Move( const wxPoint& offset )
}
void DIMENSION_BASE::Rotate( const wxPoint& aRotCentre, double aAngle )
void PCB_DIMENSION_BASE::Rotate( const wxPoint& aRotCentre, double aAngle )
{
double newAngle = m_text.GetTextAngle() + aAngle;
@ -248,7 +248,7 @@ void DIMENSION_BASE::Rotate( const wxPoint& aRotCentre, double aAngle )
}
void DIMENSION_BASE::Flip( const wxPoint& aCentre, bool aFlipLeftRight )
void PCB_DIMENSION_BASE::Flip( const wxPoint& aCentre, bool aFlipLeftRight )
{
Mirror( aCentre );
@ -256,7 +256,7 @@ void DIMENSION_BASE::Flip( const wxPoint& aCentre, bool aFlipLeftRight )
}
void DIMENSION_BASE::Mirror( const wxPoint& axis_pos, bool aMirrorLeftRight )
void PCB_DIMENSION_BASE::Mirror( const wxPoint& axis_pos, bool aMirrorLeftRight )
{
int axis = aMirrorLeftRight ? axis_pos.x : axis_pos.y;
wxPoint newPos = m_text.GetTextPos();
@ -289,7 +289,7 @@ void DIMENSION_BASE::Mirror( const wxPoint& axis_pos, bool aMirrorLeftRight )
}
void DIMENSION_BASE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList )
void PCB_DIMENSION_BASE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList )
{
// for now, display only the text within the DIMENSION using class PCB_TEXT.
wxString msg;
@ -352,7 +352,7 @@ void DIMENSION_BASE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PA
}
std::shared_ptr<SHAPE> DIMENSION_BASE::GetEffectiveShape( PCB_LAYER_ID aLayer ) const
std::shared_ptr<SHAPE> PCB_DIMENSION_BASE::GetEffectiveShape( PCB_LAYER_ID aLayer ) const
{
std::shared_ptr<SHAPE_COMPOUND> effectiveShape = std::make_shared<SHAPE_COMPOUND>();
@ -365,7 +365,7 @@ std::shared_ptr<SHAPE> DIMENSION_BASE::GetEffectiveShape( PCB_LAYER_ID aLayer )
}
bool DIMENSION_BASE::HitTest( const wxPoint& aPosition, int aAccuracy ) const
bool PCB_DIMENSION_BASE::HitTest( const wxPoint& aPosition, int aAccuracy ) const
{
if( m_text.TextHitTest( aPosition ) )
return true;
@ -384,7 +384,7 @@ bool DIMENSION_BASE::HitTest( const wxPoint& aPosition, int aAccuracy ) const
}
bool DIMENSION_BASE::HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy ) const
bool PCB_DIMENSION_BASE::HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy ) const
{
EDA_RECT arect = aRect;
arect.Inflate( aAccuracy );
@ -401,7 +401,7 @@ bool DIMENSION_BASE::HitTest( const EDA_RECT& aRect, bool aContained, int aAccur
}
const EDA_RECT DIMENSION_BASE::GetBoundingBox() const
const EDA_RECT PCB_DIMENSION_BASE::GetBoundingBox() const
{
EDA_RECT bBox;
int xmin, xmax, ymin, ymax;
@ -434,7 +434,7 @@ const EDA_RECT DIMENSION_BASE::GetBoundingBox() const
}
wxString DIMENSION_BASE::GetSelectMenuText( EDA_UNITS aUnits ) const
wxString PCB_DIMENSION_BASE::GetSelectMenuText( EDA_UNITS aUnits ) const
{
return wxString::Format( _( "Dimension '%s' on %s" ),
GetText(),
@ -443,7 +443,7 @@ wxString DIMENSION_BASE::GetSelectMenuText( EDA_UNITS aUnits ) const
const BOX2I DIMENSION_BASE::ViewBBox() const
const BOX2I PCB_DIMENSION_BASE::ViewBBox() const
{
BOX2I dimBBox = BOX2I( VECTOR2I( GetBoundingBox().GetPosition() ),
VECTOR2I( GetBoundingBox().GetSize() ) );
@ -453,7 +453,8 @@ const BOX2I DIMENSION_BASE::ViewBBox() const
}
OPT_VECTOR2I DIMENSION_BASE::segPolyIntersection( const SHAPE_POLY_SET& aPoly, const SEG& aSeg, bool aStart )
OPT_VECTOR2I PCB_DIMENSION_BASE::segPolyIntersection( const SHAPE_POLY_SET& aPoly, const SEG& aSeg,
bool aStart )
{
VECTOR2I start( aStart ? aSeg.A : aSeg.B );
VECTOR2I endpoint( aStart ? aSeg.B : aSeg.A );
@ -477,7 +478,7 @@ OPT_VECTOR2I DIMENSION_BASE::segPolyIntersection( const SHAPE_POLY_SET& aPoly, c
}
OPT_VECTOR2I DIMENSION_BASE::segCircleIntersection( CIRCLE& aCircle, SEG& aSeg, bool aStart )
OPT_VECTOR2I PCB_DIMENSION_BASE::segCircleIntersection( CIRCLE& aCircle, SEG& aSeg, bool aStart )
{
VECTOR2I start( aStart ? aSeg.A : aSeg.B );
VECTOR2I endpoint( aStart ? aSeg.B : aSeg.A );
@ -501,8 +502,8 @@ OPT_VECTOR2I DIMENSION_BASE::segCircleIntersection( CIRCLE& aCircle, SEG& aSeg,
}
ALIGNED_DIMENSION::ALIGNED_DIMENSION( BOARD_ITEM* aParent, KICAD_T aType ) :
DIMENSION_BASE( aParent, aType ),
PCB_DIM_ALIGNED::PCB_DIM_ALIGNED( BOARD_ITEM* aParent, KICAD_T aType ) :
PCB_DIMENSION_BASE( aParent, aType ),
m_height( 0 )
{
// To preserve look of old dimensions, initialize extension height based on default arrow length
@ -510,32 +511,31 @@ ALIGNED_DIMENSION::ALIGNED_DIMENSION( BOARD_ITEM* aParent, KICAD_T aType ) :
}
EDA_ITEM* ALIGNED_DIMENSION::Clone() const
EDA_ITEM* PCB_DIM_ALIGNED::Clone() const
{
return new ALIGNED_DIMENSION( *this );
return new PCB_DIM_ALIGNED( *this );
}
void ALIGNED_DIMENSION::SwapData( BOARD_ITEM* aImage )
void PCB_DIM_ALIGNED::SwapData( BOARD_ITEM* aImage )
{
assert( aImage->Type() == PCB_DIM_ALIGNED_T );
m_shapes.clear();
static_cast<ALIGNED_DIMENSION*>( aImage )->m_shapes.clear();
static_cast<PCB_DIM_ALIGNED*>( aImage )->m_shapes.clear();
std::swap( *static_cast<ALIGNED_DIMENSION*>( this ),
*static_cast<ALIGNED_DIMENSION*>( aImage ) );
std::swap( *static_cast<PCB_DIM_ALIGNED*>( this ), *static_cast<PCB_DIM_ALIGNED*>( aImage ) );
Update();
}
BITMAPS ALIGNED_DIMENSION::GetMenuImage() const
BITMAPS PCB_DIM_ALIGNED::GetMenuImage() const
{
return BITMAPS::add_aligned_dimension;
}
void ALIGNED_DIMENSION::UpdateHeight( const wxPoint& aCrossbarStart, const wxPoint& aCrossbarEnd )
void PCB_DIM_ALIGNED::UpdateHeight( const wxPoint& aCrossbarStart, const wxPoint& aCrossbarEnd )
{
VECTOR2D height( aCrossbarStart - GetStart() );
VECTOR2D crossBar( aCrossbarEnd - aCrossbarStart );
@ -549,7 +549,7 @@ void ALIGNED_DIMENSION::UpdateHeight( const wxPoint& aCrossbarStart, const wxPoi
}
void ALIGNED_DIMENSION::updateGeometry()
void PCB_DIM_ALIGNED::updateGeometry()
{
m_shapes.clear();
@ -637,7 +637,7 @@ void ALIGNED_DIMENSION::updateGeometry()
}
void ALIGNED_DIMENSION::updateText()
void PCB_DIM_ALIGNED::updateText()
{
VECTOR2I crossbarCenter( ( m_crossBarEnd - m_crossBarStart ) / 2 );
@ -673,21 +673,20 @@ void ALIGNED_DIMENSION::updateText()
m_text.SetTextAngle( textAngle );
}
DIMENSION_BASE::updateText();
PCB_DIMENSION_BASE::updateText();
}
void ALIGNED_DIMENSION::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame,
std::vector<MSG_PANEL_ITEM>& aList )
void PCB_DIM_ALIGNED::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList )
{
DIMENSION_BASE::GetMsgPanelInfo( aFrame, aList );
PCB_DIMENSION_BASE::GetMsgPanelInfo( aFrame, aList );
aList.emplace_back( _( "Height" ), MessageTextFromValue( aFrame->GetUserUnits(), m_height ) );
}
ORTHOGONAL_DIMENSION::ORTHOGONAL_DIMENSION( BOARD_ITEM* aParent ) :
ALIGNED_DIMENSION( aParent, PCB_DIM_ORTHOGONAL_T )
PCB_DIM_ORTHOGONAL::PCB_DIM_ORTHOGONAL( BOARD_ITEM* aParent ) :
PCB_DIM_ALIGNED( aParent, PCB_DIM_ORTHOGONAL_T )
{
// To preserve look of old dimensions, initialize extension height based on default arrow length
m_extensionHeight = static_cast<int>( m_arrowLength * std::sin( DEG2RAD( s_arrowAngle ) ) );
@ -695,33 +694,33 @@ ORTHOGONAL_DIMENSION::ORTHOGONAL_DIMENSION( BOARD_ITEM* aParent ) :
}
EDA_ITEM* ORTHOGONAL_DIMENSION::Clone() const
EDA_ITEM* PCB_DIM_ORTHOGONAL::Clone() const
{
return new ORTHOGONAL_DIMENSION( *this );
return new PCB_DIM_ORTHOGONAL( *this );
}
void ORTHOGONAL_DIMENSION::SwapData( BOARD_ITEM* aImage )
void PCB_DIM_ORTHOGONAL::SwapData( BOARD_ITEM* aImage )
{
assert( aImage->Type() == PCB_DIM_ORTHOGONAL_T );
m_shapes.clear();
static_cast<ORTHOGONAL_DIMENSION*>( aImage )->m_shapes.clear();
static_cast<PCB_DIM_ORTHOGONAL*>( aImage )->m_shapes.clear();
std::swap( *static_cast<ORTHOGONAL_DIMENSION*>( this ),
*static_cast<ORTHOGONAL_DIMENSION*>( aImage ) );
std::swap( *static_cast<PCB_DIM_ORTHOGONAL*>( this ),
*static_cast<PCB_DIM_ORTHOGONAL*>( aImage ) );
Update();
}
BITMAPS ORTHOGONAL_DIMENSION::GetMenuImage() const
BITMAPS PCB_DIM_ORTHOGONAL::GetMenuImage() const
{
return BITMAPS::add_orthogonal_dimension;
}
void ORTHOGONAL_DIMENSION::updateGeometry()
void PCB_DIM_ORTHOGONAL::updateGeometry()
{
m_shapes.clear();
@ -822,7 +821,7 @@ void ORTHOGONAL_DIMENSION::updateGeometry()
}
void ORTHOGONAL_DIMENSION::updateText()
void PCB_DIM_ORTHOGONAL::updateText()
{
VECTOR2I crossbarCenter( ( m_crossBarEnd - m_crossBarStart ) / 2 );
@ -856,11 +855,11 @@ void ORTHOGONAL_DIMENSION::updateText()
m_text.SetTextAngle( textAngle );
}
DIMENSION_BASE::updateText();
PCB_DIMENSION_BASE::updateText();
}
void ORTHOGONAL_DIMENSION::Rotate( const wxPoint& aRotCentre, double aAngle )
void PCB_DIM_ORTHOGONAL::Rotate( const wxPoint& aRotCentre, double aAngle )
{
// restrict angle to -179.9 to 180.0 degrees
if( aAngle > 1800 )
@ -910,12 +909,12 @@ void ORTHOGONAL_DIMENSION::Rotate( const wxPoint& aRotCentre, double aAngle )
}
// this will update m_crossBarStart and m_crossbarEnd
DIMENSION_BASE::Rotate( aRotCentre, aAngle );
PCB_DIMENSION_BASE::Rotate( aRotCentre, aAngle );
}
LEADER::LEADER( BOARD_ITEM* aParent ) :
DIMENSION_BASE( aParent, PCB_DIM_LEADER_T ),
PCB_DIM_LEADER::PCB_DIM_LEADER( BOARD_ITEM* aParent ) :
PCB_DIMENSION_BASE( aParent, PCB_DIM_LEADER_T ),
m_textFrame( DIM_TEXT_FRAME::NONE )
{
m_unitsFormat = DIM_UNITS_FORMAT::NO_SUFFIX;
@ -924,27 +923,27 @@ LEADER::LEADER( BOARD_ITEM* aParent ) :
}
EDA_ITEM* LEADER::Clone() const
EDA_ITEM* PCB_DIM_LEADER::Clone() const
{
return new LEADER( *this );
return new PCB_DIM_LEADER( *this );
}
void LEADER::SwapData( BOARD_ITEM* aImage )
void PCB_DIM_LEADER::SwapData( BOARD_ITEM* aImage )
{
assert( aImage->Type() == PCB_DIM_LEADER_T );
std::swap( *static_cast<LEADER*>( this ), *static_cast<LEADER*>( aImage ) );
std::swap( *static_cast<PCB_DIM_LEADER*>( this ), *static_cast<PCB_DIM_LEADER*>( aImage ) );
}
BITMAPS LEADER::GetMenuImage() const
BITMAPS PCB_DIM_LEADER::GetMenuImage() const
{
return BITMAPS::add_leader;
}
void LEADER::updateGeometry()
void PCB_DIM_LEADER::updateGeometry()
{
m_shapes.clear();
@ -1035,7 +1034,7 @@ void LEADER::updateGeometry()
}
void LEADER::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList )
void PCB_DIM_LEADER::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList )
{
wxString msg;
@ -1055,35 +1054,35 @@ void LEADER::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM
}
CENTER_DIMENSION::CENTER_DIMENSION( BOARD_ITEM* aParent ) :
DIMENSION_BASE( aParent, PCB_DIM_CENTER_T )
PCB_DIM_CENTER::PCB_DIM_CENTER( BOARD_ITEM* aParent ) :
PCB_DIMENSION_BASE( aParent, PCB_DIM_CENTER_T )
{
m_unitsFormat = DIM_UNITS_FORMAT::NO_SUFFIX;
m_overrideTextEnabled = true;
}
EDA_ITEM* CENTER_DIMENSION::Clone() const
EDA_ITEM* PCB_DIM_CENTER::Clone() const
{
return new CENTER_DIMENSION( *this );
return new PCB_DIM_CENTER( *this );
}
void CENTER_DIMENSION::SwapData( BOARD_ITEM* aImage )
void PCB_DIM_CENTER::SwapData( BOARD_ITEM* aImage )
{
assert( aImage->Type() == PCB_DIM_CENTER_T );
std::swap( *static_cast<CENTER_DIMENSION*>( this ), *static_cast<CENTER_DIMENSION*>( aImage ) );
std::swap( *static_cast<PCB_DIM_CENTER*>( this ), *static_cast<PCB_DIM_CENTER*>( aImage ) );
}
BITMAPS CENTER_DIMENSION::GetMenuImage() const
BITMAPS PCB_DIM_CENTER::GetMenuImage() const
{
return BITMAPS::add_center_dimension;
}
const EDA_RECT CENTER_DIMENSION::GetBoundingBox() const
const EDA_RECT PCB_DIM_CENTER::GetBoundingBox() const
{
int halfWidth = VECTOR2I( m_end - m_start ).x + ( m_lineThickness / 2.0 );
@ -1100,14 +1099,14 @@ const EDA_RECT CENTER_DIMENSION::GetBoundingBox() const
}
const BOX2I CENTER_DIMENSION::ViewBBox() const
const BOX2I PCB_DIM_CENTER::ViewBBox() const
{
return BOX2I( VECTOR2I( GetBoundingBox().GetPosition() ),
VECTOR2I( GetBoundingBox().GetSize() ) );
}
void CENTER_DIMENSION::updateGeometry()
void PCB_DIM_CENTER::updateGeometry()
{
m_shapes.clear();
@ -1127,8 +1126,8 @@ static struct DIMENSION_DESC
DIMENSION_DESC()
{
PROPERTY_MANAGER& propMgr = PROPERTY_MANAGER::Instance();
REGISTER_TYPE( DIMENSION_BASE );
propMgr.InheritsAfter( TYPE_HASH( DIMENSION_BASE ), TYPE_HASH( BOARD_ITEM ) );
REGISTER_TYPE( PCB_DIMENSION_BASE );
propMgr.InheritsAfter( TYPE_HASH( PCB_DIMENSION_BASE ), TYPE_HASH( BOARD_ITEM ) );
// TODO: add dimension properties:
//propMgr.AddProperty( new PROPERTY<DIMENSION, int>( _HKI( "Height" ),
//&DIMENSION::SetHeight, &DIMENSION::GetHeight, PROPERTY_DISPLAY::DISTANCE ) );

View File

@ -22,8 +22,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef DIMENSION_H
#define DIMENSION_H
#ifndef PCB_DIMENSION_H
#define PCB_DIMENSION_H
#include <board_item.h>
@ -92,10 +92,10 @@ enum class DIM_TEXT_FRAME
* - "crossbar" refers to the perpendicular line (usually with arrows at each end) between feature
* lines on linear dimensions
*/
class DIMENSION_BASE : public BOARD_ITEM
class PCB_DIMENSION_BASE : public BOARD_ITEM
{
public:
DIMENSION_BASE( BOARD_ITEM* aParent, KICAD_T aType = PCB_DIMENSION_T );
PCB_DIMENSION_BASE( BOARD_ITEM* aParent, KICAD_T aType = PCB_DIMENSION_T );
bool IsType( const KICAD_T aScanTypes[] ) const override
{
@ -338,15 +338,15 @@ protected:
* The height (distance from features to crossbar) can be set directly, or set by manipulating the
* crossbar start or end point (with the point editor).
*/
class ALIGNED_DIMENSION : public DIMENSION_BASE
class PCB_DIM_ALIGNED : public PCB_DIMENSION_BASE
{
public:
ALIGNED_DIMENSION( BOARD_ITEM* aParent, KICAD_T aType = PCB_DIM_ALIGNED_T );
PCB_DIM_ALIGNED( BOARD_ITEM* aParent, KICAD_T aType = PCB_DIM_ALIGNED_T );
// Do not create a copy constructor & operator=.
// The ones generated by the compiler are adequate.
~ALIGNED_DIMENSION() = default;
~PCB_DIM_ALIGNED() = default;
static inline bool ClassOf( const EDA_ITEM* aItem )
{
@ -395,7 +395,7 @@ public:
wxString GetClass() const override
{
return wxT( "ALIGNED_DIMENSION" );
return wxT( "PCB_DIM_ALIGNED" );
}
void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
@ -419,7 +419,7 @@ protected:
* An orthogonal dimension is like an aligned dimension, but the extension lines are locked to the
* X or Y axes, and the measurement is only taken in the X or Y direction.
*/
class ORTHOGONAL_DIMENSION : public ALIGNED_DIMENSION
class PCB_DIM_ORTHOGONAL : public PCB_DIM_ALIGNED
{
public:
enum class DIR
@ -428,9 +428,9 @@ public:
VERTICAL // Aligned with y-axis
};
ORTHOGONAL_DIMENSION( BOARD_ITEM* aParent );
PCB_DIM_ORTHOGONAL( BOARD_ITEM* aParent );
~ORTHOGONAL_DIMENSION() = default;
~PCB_DIM_ORTHOGONAL() = default;
static inline bool ClassOf( const EDA_ITEM* aItem )
{
@ -453,7 +453,7 @@ public:
wxString GetClass() const override
{
return wxT( "ORTHOGONAL_DIMENSION" );
return wxT( "PCB_DIM_ORTHOGONAL" );
}
void Rotate( const wxPoint& aRotCentre, double aAngle ) override;
@ -483,10 +483,10 @@ private:
* Point (a) is m_start, point (b) is m_end, point (c) is the end of the "text line"
* The b-c line is drawn from b to the text center, and clipped on the text bounding box.
*/
class LEADER : public DIMENSION_BASE
class PCB_DIM_LEADER : public PCB_DIMENSION_BASE
{
public:
LEADER( BOARD_ITEM* aParent );
PCB_DIM_LEADER( BOARD_ITEM* aParent );
static inline bool ClassOf( const EDA_ITEM* aItem )
{
@ -501,7 +501,7 @@ public:
wxString GetClass() const override
{
return wxT( "LEADER" );
return wxT( "PCB_DIM_LEADER" );
}
void SetTextFrame( DIM_TEXT_FRAME aFrame ) { m_textFrame = aFrame; }
@ -523,10 +523,10 @@ private:
* The size and orientation of the cross is adjustable.
* m_start always marks the center being measured; m_end marks the end of one leg of the cross.
*/
class CENTER_DIMENSION : public DIMENSION_BASE
class PCB_DIM_CENTER : public PCB_DIMENSION_BASE
{
public:
CENTER_DIMENSION( BOARD_ITEM* aParent );
PCB_DIM_CENTER( BOARD_ITEM* aParent );
static inline bool ClassOf( const EDA_ITEM* aItem )
{
@ -541,7 +541,7 @@ public:
wxString GetClass() const override
{
return wxT( "CENTER_DIMENSION" );
return wxT( "PCB_DIM_CENTER" );
}
const EDA_RECT GetBoundingBox() const override;

View File

@ -38,7 +38,7 @@ class VIA;
class PAD;
class PCB_TARGET;
class PCB_GROUP;
class DIMENSION_BASE;
class PCB_DIMENSION_BASE;
class DRC;
class DIALOG_PLOT;
class ZONE;
@ -555,7 +555,7 @@ public:
// Properties dialogs
void ShowTargetOptionsDialog( PCB_TARGET* aTarget );
void ShowDimensionPropertiesDialog( DIMENSION_BASE* aDimension );
void ShowDimensionPropertiesDialog( PCB_DIMENSION_BASE* aDimension );
void InstallNetlistFrame();
/**

View File

@ -34,7 +34,7 @@
#include <zone.h>
#include <pcb_text.h>
#include <pcb_marker.h>
#include <dimension.h>
#include <pcb_dimension.h>
#include <pcb_target.h>
#include <advanced_config.h>
#include <core/arraydim.h>
@ -522,7 +522,7 @@ bool PCB_PAINTER::Draw( const VIEW_ITEM* aItem, int aLayer )
case PCB_DIM_CENTER_T:
case PCB_DIM_ORTHOGONAL_T:
case PCB_DIM_LEADER_T:
draw( static_cast<const DIMENSION_BASE*>( item ), aLayer );
draw( static_cast<const PCB_DIMENSION_BASE*>( item ), aLayer );
break;
case PCB_TARGET_T:
@ -1686,7 +1686,7 @@ void PCB_PAINTER::draw( const ZONE* aZone, int aLayer )
}
void PCB_PAINTER::draw( const DIMENSION_BASE* aDimension, int aLayer )
void PCB_PAINTER::draw( const PCB_DIMENSION_BASE* aDimension, int aLayer )
{
const COLOR4D& strokeColor = m_pcbSettings.GetColor( aDimension, aLayer );

View File

@ -48,7 +48,7 @@ class FOOTPRINT;
class ZONE;
class PCB_TEXT;
class FP_TEXT;
class DIMENSION_BASE;
class PCB_DIMENSION_BASE;
class PCB_TARGET;
class PCB_MARKER;
class NET_SETTINGS;
@ -264,7 +264,7 @@ protected:
void draw( const FOOTPRINT* aFootprint, int aLayer );
void draw( const PCB_GROUP* aGroup, int aLayer );
void draw( const ZONE* aZone, int aLayer );
void draw( const DIMENSION_BASE* aDimension, int aLayer );
void draw( const PCB_DIMENSION_BASE* aDimension, int aLayer );
void draw( const PCB_TARGET* aTarget );
void draw( const PCB_MARKER* aMarker, int aLayer );

View File

@ -39,7 +39,7 @@ class PLOTTER;
class PCB_TEXT;
class PAD;
class PCB_SHAPE;
class DIMENSION_BASE;
class PCB_DIMENSION_BASE;
class FOOTPRINT;
class FP_SHAPE;
class PCB_TARGET;
@ -92,7 +92,7 @@ public:
*/
void PlotFootprintTextItems( const FOOTPRINT* aFootprint );
void PlotDimension( const DIMENSION_BASE* aDim );
void PlotDimension( const PCB_DIMENSION_BASE* aDim );
void PlotPcbTarget( const PCB_TARGET* aMire );
void PlotFilledAreas( const ZONE* aZone, const SHAPE_POLY_SET& aPolysList );
void PlotPcbText( const PCB_TEXT* aText );

View File

@ -46,7 +46,7 @@
#include <zone.h>
#include <pcb_shape.h>
#include <pcb_target.h>
#include <dimension.h>
#include <pcb_dimension.h>
#include <pcbplot.h>
#include <plotters_specific.h>

View File

@ -54,7 +54,7 @@
#include <board.h>
#include <board_item.h> // for BOARD_ITEM, S_CIRCLE
#include <dimension.h>
#include <pcb_dimension.h>
#include <pcb_shape.h>
#include <fp_shape.h>
#include <footprint.h>
@ -355,7 +355,7 @@ void BRDITEMS_PLOTTER::PlotBoardGraphicItems()
case PCB_DIM_CENTER_T:
case PCB_DIM_ORTHOGONAL_T:
case PCB_DIM_LEADER_T:
PlotDimension( (DIMENSION_BASE*) item );
PlotDimension( (PCB_DIMENSION_BASE*) item );
break;
case PCB_TARGET_T:
@ -407,7 +407,7 @@ void BRDITEMS_PLOTTER::PlotFootprintTextItem( const FP_TEXT* aTextMod, COLOR4D a
}
void BRDITEMS_PLOTTER::PlotDimension( const DIMENSION_BASE* aDim )
void BRDITEMS_PLOTTER::PlotDimension( const PCB_DIMENSION_BASE* aDim )
{
if( !m_layerMask[aDim->GetLayer()] )
return;

View File

@ -28,7 +28,7 @@
#include <board.h>
#include <board_design_settings.h>
#include <dimension.h>
#include <pcb_dimension.h>
#include <pad.h>
#include <pcb_shape.h>
#include <pcb_text.h>
@ -924,7 +924,7 @@ void ALTIUM_PCB::HelperParseDimensions6Linear( const ADIMENSION6& aElem )
wxPoint referencePoint0 = aElem.referencePoint.at( 0 );
wxPoint referencePoint1 = aElem.referencePoint.at( 1 );
ALIGNED_DIMENSION* dimension = new ALIGNED_DIMENSION( m_board );
PCB_DIM_ALIGNED* dimension = new PCB_DIM_ALIGNED( m_board );
m_board->Add( dimension, ADD_MODE::APPEND );
dimension->SetPrecision( aElem.textprecision );
@ -1102,7 +1102,7 @@ void ALTIUM_PCB::HelperParseDimensions6Center( const ADIMENSION6& aElem )
wxPoint vec = wxPoint( 0, aElem.height / 2 );
RotatePoint( &vec, aElem.angle * 10. );
CENTER_DIMENSION* dimension = new CENTER_DIMENSION( m_board );
PCB_DIM_CENTER* dimension = new PCB_DIM_CENTER( m_board );
m_board->Add( dimension, ADD_MODE::APPEND );
dimension->SetLayer( klayer );
dimension->SetLineThickness( aElem.linewidth );

View File

@ -29,7 +29,7 @@
#include <board_stackup_manager/stackup_predefined_prms.h> // KEY_COPPER, KEY_CORE, KEY_PREPREG
#include <board.h>
#include <board_design_settings.h>
#include <dimension.h>
#include <pcb_dimension.h>
#include <pcb_shape.h>
#include <fp_shape.h>
#include <footprint.h>
@ -1311,21 +1311,21 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadDimensions()
csDim.ID ) );
}
ALIGNED_DIMENSION* dimension = nullptr;
PCB_DIM_ALIGNED* dimension = nullptr;
if( csDim.Subtype == DIMENSION::SUBTYPE::ORTHOGONAL )
{
dimension = new ORTHOGONAL_DIMENSION( m_board );
ORTHOGONAL_DIMENSION* orDim = static_cast<ORTHOGONAL_DIMENSION*>( dimension );
dimension = new PCB_DIM_ORTHOGONAL( m_board );
PCB_DIM_ORTHOGONAL* orDim = static_cast<PCB_DIM_ORTHOGONAL*>( dimension );
if( csDim.ExtensionLineParams.Start.x == csDim.Line.Start.x )
orDim->SetOrientation( ORTHOGONAL_DIMENSION::DIR::HORIZONTAL );
orDim->SetOrientation( PCB_DIM_ORTHOGONAL::DIR::HORIZONTAL );
else
orDim->SetOrientation( ORTHOGONAL_DIMENSION::DIR::VERTICAL );
orDim->SetOrientation( PCB_DIM_ORTHOGONAL::DIR::VERTICAL );
}
else
{
dimension = new ALIGNED_DIMENSION( m_board );
dimension = new PCB_DIM_ALIGNED( m_board );
}
m_board->Add( dimension, ADD_MODE::APPEND );
@ -1374,7 +1374,7 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadDimensions()
if( csDim.Line.Style == DIMENSION::LINE::STYLE::INTERNAL )
{
// "internal" is a simple double sided arrow from start to end (no extension lines)
ALIGNED_DIMENSION* dimension = new ALIGNED_DIMENSION( m_board );
PCB_DIM_ALIGNED* dimension = new PCB_DIM_ALIGNED( m_board );
m_board->Add( dimension, ADD_MODE::APPEND );
applyDimensionSettings( csDim, dimension );
@ -1390,7 +1390,7 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadDimensions()
else
{
// "external" is a "leader" style dimension
LEADER* leaderDim = new LEADER( m_board );
PCB_DIM_LEADER* leaderDim = new PCB_DIM_LEADER( m_board );
m_board->Add( leaderDim, ADD_MODE::APPEND );
applyDimensionSettings( csDim, leaderDim );
@ -3475,7 +3475,7 @@ void CADSTAR_PCB_ARCHIVE_LOADER::checkAndLogHatchCode( const HATCHCODE_ID& aCads
void CADSTAR_PCB_ARCHIVE_LOADER::applyDimensionSettings( const DIMENSION& aCadstarDim,
DIMENSION_BASE* aKiCadDim )
PCB_DIMENSION_BASE* aKiCadDim )
{
UNITS dimensionUnits = aCadstarDim.LinearUnits;
TEXTCODE txtCode = getTextCode( aCadstarDim.Text.TextCodeID );

View File

@ -34,7 +34,7 @@
class BOARD;
class BOARD_STACKUP_ITEM;
class DIMENSION_BASE;
class PCB_DIMENSION_BASE;
class CADSTAR_PCB_ARCHIVE_LOADER : public CADSTAR_PCB_ARCHIVE_PARSER
{
@ -169,7 +169,7 @@ private:
/// Load via and return via size
int loadNetVia( const NET_ID& aCadstarNetID, const NET_PCB::VIA& aCadstarVia );
void checkAndLogHatchCode( const HATCHCODE_ID& aCadstarHatchcodeID );
void applyDimensionSettings( const DIMENSION& aCadstarDim, DIMENSION_BASE* aKiCadDim );
void applyDimensionSettings( const DIMENSION& aCadstarDim, PCB_DIMENSION_BASE* aKiCadDim );
/**

View File

@ -77,7 +77,7 @@ Load() TODO's
#include <zone.h>
#include <pad_shapes.h>
#include <pcb_text.h>
#include <dimension.h>
#include <pcb_dimension.h>
#include <plugins/eagle/eagle_plugin.h>
@ -874,7 +874,7 @@ void EAGLE_PLUGIN::loadPlain( wxXmlNode* aGraphics )
if( layer != UNDEFINED_LAYER )
{
const BOARD_DESIGN_SETTINGS& designSettings = m_board->GetDesignSettings();
ALIGNED_DIMENSION* dimension = new ALIGNED_DIMENSION( m_board );
PCB_DIM_ALIGNED* dimension = new PCB_DIM_ALIGNED( m_board );
m_board->Add( dimension, ADD_MODE::APPEND );
if( d.dimensionType )

View File

@ -30,7 +30,7 @@
#include <confirm.h>
#include <convert_basic_shapes_to_polygon.h> // for enum RECT_CHAMFER_POSITIONS definition
#include <core/arraydim.h>
#include <dimension.h>
#include <pcb_dimension.h>
#include <footprint.h>
#include <fp_shape.h>
#include <kicad_string.h>
@ -406,7 +406,7 @@ void PCB_IO::Format( const BOARD_ITEM* aItem, int aNestLevel ) const
case PCB_DIM_CENTER_T:
case PCB_DIM_ORTHOGONAL_T:
case PCB_DIM_LEADER_T:
format( static_cast<const DIMENSION_BASE*>( aItem ), aNestLevel );
format( static_cast<const PCB_DIMENSION_BASE*>( aItem ), aNestLevel );
break;
case PCB_SHAPE_T:
@ -691,12 +691,12 @@ void PCB_IO::format( const BOARD* aBoard, int aNestLevel ) const
}
void PCB_IO::format( const DIMENSION_BASE* aDimension, int aNestLevel ) const
void PCB_IO::format( const PCB_DIMENSION_BASE* aDimension, int aNestLevel ) const
{
const ALIGNED_DIMENSION* aligned = dynamic_cast<const ALIGNED_DIMENSION*>( aDimension );
const ORTHOGONAL_DIMENSION* ortho = dynamic_cast<const ORTHOGONAL_DIMENSION*>( aDimension );
const CENTER_DIMENSION* center = dynamic_cast<const CENTER_DIMENSION*>( aDimension );
const LEADER* leader = dynamic_cast<const LEADER*>( aDimension );
const PCB_DIM_ALIGNED* aligned = dynamic_cast<const PCB_DIM_ALIGNED*>( aDimension );
const PCB_DIM_ORTHOGONAL* ortho = dynamic_cast<const PCB_DIM_ORTHOGONAL*>( aDimension );
const PCB_DIM_CENTER* center = dynamic_cast<const PCB_DIM_CENTER*>( aDimension );
const PCB_DIM_LEADER* leader = dynamic_cast<const PCB_DIM_LEADER*>( aDimension );
m_out->Print( aNestLevel, "(dimension" );

View File

@ -35,7 +35,7 @@ class FP_CACHE;
class PCB_PARSER;
class NETINFO_MAPPING;
class BOARD_DESIGN_SETTINGS;
class DIMENSION_BASE;
class PCB_DIMENSION_BASE;
class FP_SHAPE;
class PCB_SHAPE;
class PCB_TARGET;
@ -242,7 +242,7 @@ protected:
private:
void format( const BOARD* aBoard, int aNestLevel = 0 ) const;
void format( const DIMENSION_BASE* aDimension, int aNestLevel = 0 ) const;
void format( const PCB_DIMENSION_BASE* aDimension, int aNestLevel = 0 ) const;
void format( const FP_SHAPE* aFPShape, int aNestLevel = 0 ) const;

View File

@ -37,7 +37,7 @@
#include <advanced_config.h>
#include <board.h>
#include <board_design_settings.h>
#include <dimension.h>
#include <pcb_dimension.h>
#include <pcb_shape.h>
#include <fp_shape.h>
#include <pcb_group.h>
@ -2566,14 +2566,14 @@ PCB_TEXT* PCB_PARSER::parsePCB_TEXT()
}
DIMENSION_BASE* PCB_PARSER::parseDIMENSION()
PCB_DIMENSION_BASE* PCB_PARSER::parseDIMENSION()
{
wxCHECK_MSG( CurTok() == T_dimension, NULL,
wxT( "Cannot parse " ) + GetTokenString( CurTok() ) + wxT( " as DIMENSION." ) );
T token;
bool locked = false;
std::unique_ptr<DIMENSION_BASE> dimension;
std::unique_ptr<PCB_DIMENSION_BASE> dimension;
token = NextTok();
@ -2595,7 +2595,7 @@ DIMENSION_BASE* PCB_PARSER::parseDIMENSION()
if( token == T_width )
{
isLegacyDimension = true;
dimension = std::make_unique<ALIGNED_DIMENSION>( nullptr );
dimension = std::make_unique<PCB_DIM_ALIGNED>( nullptr );
dimension->SetLineThickness( parseBoardUnits( "dimension width value" ) );
NeedRIGHT();
}
@ -2607,19 +2607,19 @@ DIMENSION_BASE* PCB_PARSER::parseDIMENSION()
switch( NextTok() )
{
case T_aligned:
dimension = std::make_unique<ALIGNED_DIMENSION>( nullptr );
dimension = std::make_unique<PCB_DIM_ALIGNED>( nullptr );
break;
case T_orthogonal:
dimension = std::make_unique<ORTHOGONAL_DIMENSION>( nullptr );
dimension = std::make_unique<PCB_DIM_ORTHOGONAL>( nullptr );
break;
case T_leader:
dimension = std::make_unique<LEADER>( nullptr );
dimension = std::make_unique<PCB_DIM_LEADER>( nullptr );
break;
case T_center:
dimension = std::make_unique<CENTER_DIMENSION>( nullptr );
dimension = std::make_unique<PCB_DIM_CENTER>( nullptr );
break;
default:
@ -2691,7 +2691,7 @@ DIMENSION_BASE* PCB_PARSER::parseDIMENSION()
wxCHECK_MSG( dimension->Type() == PCB_DIM_ALIGNED_T ||
dimension->Type() == PCB_DIM_ORTHOGONAL_T, nullptr,
wxT( "Invalid height token" ) );
ALIGNED_DIMENSION* aligned = static_cast<ALIGNED_DIMENSION*>( dimension.get() );
PCB_DIM_ALIGNED* aligned = static_cast<PCB_DIM_ALIGNED*>( dimension.get() );
aligned->SetHeight( parseBoardUnits( "dimension height value" ) );
NeedRIGHT();
break;
@ -2701,11 +2701,11 @@ DIMENSION_BASE* PCB_PARSER::parseDIMENSION()
{
wxCHECK_MSG( dimension->Type() == PCB_DIM_ORTHOGONAL_T, nullptr,
wxT( "Invalid orientation token" ) );
ORTHOGONAL_DIMENSION* ortho = static_cast<ORTHOGONAL_DIMENSION*>( dimension.get() );
PCB_DIM_ORTHOGONAL* ortho = static_cast<PCB_DIM_ORTHOGONAL*>( dimension.get() );
int orientation = parseInt( "orthogonal dimension orientation" );
orientation = std::max( 0, std::min( 1, orientation ) );
ortho->SetOrientation( static_cast<ORTHOGONAL_DIMENSION::DIR>( orientation ) );
ortho->SetOrientation( static_cast<PCB_DIM_ORTHOGONAL::DIR>( orientation ) );
NeedRIGHT();
break;
}
@ -2806,7 +2806,7 @@ DIMENSION_BASE* PCB_PARSER::parseDIMENSION()
case T_extension_height:
{
ALIGNED_DIMENSION* aligned = dynamic_cast<ALIGNED_DIMENSION*>( dimension.get() );
PCB_DIM_ALIGNED* aligned = dynamic_cast<PCB_DIM_ALIGNED*>( dimension.get() );
wxCHECK_MSG( aligned, nullptr, wxT( "Invalid extension_height token" ) );
aligned->SetExtensionHeight( parseBoardUnits( "extension height" ) );
NeedRIGHT();
@ -2826,7 +2826,7 @@ DIMENSION_BASE* PCB_PARSER::parseDIMENSION()
{
wxCHECK_MSG( dimension->Type() == PCB_DIM_LEADER_T, nullptr,
wxT( "Invalid text_frame token" ) );
LEADER* leader = static_cast<LEADER*>( dimension.get() );
PCB_DIM_LEADER* leader = static_cast<PCB_DIM_LEADER*>( dimension.get() );
int textFrame = parseInt( "dimension text frame mode" );
textFrame = std::max( 0, std::min( 3, textFrame ) );
@ -2893,7 +2893,7 @@ DIMENSION_BASE* PCB_PARSER::parseDIMENSION()
if( token == T_pts )
{
// If we have a crossbar, we know we're an old aligned dimension
ALIGNED_DIMENSION* aligned = static_cast<ALIGNED_DIMENSION*>( dimension.get() );
PCB_DIM_ALIGNED* aligned = static_cast<PCB_DIM_ALIGNED*>( dimension.get() );
// Old style: calculate height from crossbar
wxPoint point1, point2;

View File

@ -46,7 +46,7 @@ class BOARD_ITEM;
class BOARD_ITEM_CONTAINER;
class PAD;
class BOARD_DESIGN_SETTINGS;
class DIMENSION_BASE;
class PCB_DIMENSION_BASE;
class PCB_SHAPE;
class EDA_TEXT;
class FP_SHAPE;
@ -185,30 +185,30 @@ private:
void parseNETINFO_ITEM();
void parseNETCLASS();
PCB_SHAPE* parsePCB_SHAPE();
PCB_TEXT* parsePCB_TEXT();
DIMENSION_BASE* parseDIMENSION();
PCB_SHAPE* parsePCB_SHAPE();
PCB_TEXT* parsePCB_TEXT();
PCB_DIMENSION_BASE* parseDIMENSION();
// Parse a footprint, but do not replace PARSE_ERROR with FUTURE_FORMAT_ERROR automatically.
FOOTPRINT* parseFOOTPRINT_unchecked( wxArrayString* aInitialComments = nullptr );
FOOTPRINT* parseFOOTPRINT_unchecked( wxArrayString* aInitialComments = nullptr );
FP_TEXT* parseFP_TEXT();
FP_SHAPE* parseFP_SHAPE();
PAD* parsePAD( FOOTPRINT* aParent = NULL );
FP_TEXT* parseFP_TEXT();
FP_SHAPE* parseFP_SHAPE();
PAD* parsePAD( FOOTPRINT* aParent = NULL );
// Parse only the (option ...) inside a pad description
bool parsePAD_option( PAD* aPad );
bool parsePAD_option( PAD* aPad );
ARC* parseARC();
TRACK* parseTRACK();
VIA* parseVIA();
ZONE* parseZONE( BOARD_ITEM_CONTAINER* aParent );
PCB_TARGET* parsePCB_TARGET();
BOARD* parseBOARD();
void parseGROUP( BOARD_ITEM* aParent );
ARC* parseARC();
TRACK* parseTRACK();
VIA* parseVIA();
ZONE* parseZONE( BOARD_ITEM_CONTAINER* aParent );
PCB_TARGET* parsePCB_TARGET();
BOARD* parseBOARD();
void parseGROUP( BOARD_ITEM* aParent );
// Parse a board, but do not replace PARSE_ERROR with FUTURE_FORMAT_ERROR automatically.
BOARD* parseBOARD_unchecked();
BOARD* parseBOARD_unchecked();
/**
* Parse the current token for the layer definition of a #BOARD_ITEM object.

View File

@ -78,7 +78,7 @@
#include <track.h>
#include <pcb_text.h>
#include <zone.h>
#include <dimension.h>
#include <pcb_dimension.h>
#include <pcb_shape.h>
#include <pcb_target.h>
#include <fp_shape.h>
@ -2720,7 +2720,7 @@ void LEGACY_PLUGIN::loadZONE_CONTAINER()
void LEGACY_PLUGIN::loadDIMENSION()
{
std::unique_ptr<ALIGNED_DIMENSION> dim = std::make_unique<ALIGNED_DIMENSION>( m_board );
std::unique_ptr<PCB_DIM_ALIGNED> dim = std::make_unique<PCB_DIM_ALIGNED>( m_board );
char* line;

View File

@ -44,7 +44,7 @@ class TRACK;
class NETCLASS;
class NETCLASSES;
class ZONE;
class DIMENSION_BASE;
class PCB_DIMENSION_BASE;
class NETINFO_ITEM;
class FP_TEXT;
class TRACK;

View File

@ -54,9 +54,9 @@ HANDLE_EXCEPTIONS(BOARD::TracksInNetBetweenPoints)
%include zone.i
%include zone_settings.i
%include pcb_text.i
%include dimension.i
%include pcb_dimension.i
%include pcb_shape.i
%include marker_pcb.i
%include pcb_marker.i
%include pcb_target.i
%include fp_shape.i
%include fp_text.i

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2012 Miguel Angel Ajo <miguelangel@nbee.es>
* Copyright (C) 1992-2012 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -62,10 +62,10 @@ const int S_CURVE = (const int)PCB_SHAPE_TYPE::CURVE;
%{
class PCB_TEXT;
class ALIGNED_DIMENSION;
class ORTHOGONAL_DIMENSION;
class LEADER;
class CENTER_DIMENSION;
class PCB_DIM_ALIGNED;
class PCB_DIM_ORTHOGONAL;
class PCB_DIM_LEADER;
class PCB_DIM_CENTER;
class FOOTPRINT;
class PCB_GROUP;
class FP_TEXT;
@ -88,10 +88,10 @@ extern "C" {
#endif
static PCB_TEXT* Cast_to_PCB_TEXT( BOARD_ITEM* );
static ALIGNED_DIMENSION* Cast_to_ALIGNED_DIMENSION( BOARD_ITEM* );
static ORTHOGONAL_DIMENSION* Cast_to_ORTHOGONAL_DIMENSION( BOARD_ITEM* );
static LEADER* Cast_to_LEADER( BOARD_ITEM* );
static CENTER_DIMENSION* Cast_to_CENTER_DIMENSION( BOARD_ITEM* );
static PCB_DIM_ALIGNED* Cast_to_PCB_DIM_ALIGNED( BOARD_ITEM* );
static PCB_DIM_ORTHOGONAL* Cast_to_PCB_DIM_ORTHOGONAL( BOARD_ITEM* );
static PCB_DIM_LEADER* Cast_to_PCB_DIM_LEADER( BOARD_ITEM* );
static PCB_DIM_CENTER* Cast_to_PCB_DIM_CENTER( BOARD_ITEM* );
static FOOTPRINT* Cast_to_FOOTPRINT( BOARD_ITEM* );
static PCB_GROUP* Cast_to_PCB_GROUP( BOARD_ITEM* );
static FP_TEXT* Cast_to_FP_TEXT( BOARD_ITEM* );
@ -114,10 +114,10 @@ static PCB_TARGET* Cast_to_PCB_TARGET( BOARD_ITEM* );
static PCB_TEXT* Cast_to_PCB_TEXT( BOARD_ITEM* );
static ALIGNED_DIMENSION* Cast_to_ALIGNED_DIMENSION( BOARD_ITEM* );
static ORTHOGONAL_DIMENSION* Cast_to_ORTHOGONAL_DIMENSION( BOARD_ITEM* );
static LEADER* Cast_to_LEADER( BOARD_ITEM* );
static CENTER_DIMENSION* Cast_to_CENTER_DIMENSION( BOARD_ITEM* );
static PCB_DIM_ALIGNED* Cast_to_PCB_DIM_ALIGNED( BOARD_ITEM* );
static PCB_DIM_ORTHOGONAL* Cast_to_PCB_DIM_ORTHOGONAL( BOARD_ITEM* );
static PCB_DIM_LEADER* Cast_to_PCB_DIM_LEADER( BOARD_ITEM* );
static PCB_DIM_CENTER* Cast_to_PCB_DIM_CENTER( BOARD_ITEM* );
static FOOTPRINT* Cast_to_FOOTPRINT( BOARD_ITEM* );
static PCB_GROUP* Cast_to_PCB_GROUP( BOARD_ITEM* );
static FP_TEXT* Cast_to_FP_TEXT( BOARD_ITEM* );
@ -147,19 +147,19 @@ static PCB_TARGET* Cast_to_PCB_TARGET( BOARD_ITEM* );
elif ct=="BOARD":
return Cast_to_BOARD(self)
elif ct=="ALIGNED_DIMENSION":
return Cast_to_ALIGNED_DIMENSION(self)
return Cast_to_PCB_DIM_ALIGNED(self)
elif ct=="LEADER":
return Cast_to_LEADER(self)
return Cast_to_PCB_DIM_LEADER(self)
elif ct=="CENTER_DIMENSION":
return Cast_to_CENTER_DIMENSION(self)
return Cast_to_PCB_DIM_CENTER(self)
elif ct=="ORTHOGONAL_DIMENSION":
return Cast_to_ORTHOGONAL_DIMENSION(self)
return Cast_to_PCB_DIM_ORTHOGONAL(self)
elif ct=="PCB_SHAPE":
return Cast_to_PCB_SHAPE(self)
elif ct=="MGRAPHIC":
return Cast_to_FP_SHAPE(self)
elif ct=="MODULE":
return Cast_to_MODULE(self)
return Cast_to_FOOTPRINT(self)
elif ct=="PCB_GROUP":
return Cast_to_PCB_GROUP(self)
elif ct=="PAD":
@ -205,10 +205,10 @@ static PCB_TARGET* Cast_to_PCB_TARGET( BOARD_ITEM* );
// the %header section. See section 5.6.2 of SWIG 3.0 documentation.
%wrapper %{
static PCB_TEXT* Cast_to_PCB_TEXT( BOARD_ITEM* self ) { return dynamic_cast<PCB_TEXT*>(self); }
static ALIGNED_DIMENSION* Cast_to_ALIGNED_DIMENSION( BOARD_ITEM* self ) { return dynamic_cast<ALIGNED_DIMENSION*>(self); }
static ORTHOGONAL_DIMENSION* Cast_to_ORTHOGONAL_DIMENSION( BOARD_ITEM* self ) { return dynamic_cast<ORTHOGONAL_DIMENSION*>(self); }
static LEADER* Cast_to_LEADER( BOARD_ITEM* self ) { return dynamic_cast<LEADER*>(self); }
static CENTER_DIMENSION* Cast_to_CENTER_DIMENSION( BOARD_ITEM* self ) { return dynamic_cast<CENTER_DIMENSION*>(self); }
static PCB_DIM_ALIGNED* Cast_to_PCB_DIM_ALIGNED( BOARD_ITEM* self ) { return dynamic_cast<PCB_DIM_ALIGNED *>(self); }
static PCB_DIM_ORTHOGONAL* Cast_to_PCB_DIM_ORTHOGONAL( BOARD_ITEM* self ) { return dynamic_cast<PCB_DIM_ORTHOGONAL *>(self); }
static PCB_DIM_LEADER* Cast_to_PCB_DIM_LEADER( BOARD_ITEM* self ) { return dynamic_cast<PCB_DIM_LEADER *>(self); }
static PCB_DIM_CENTER* Cast_to_PCB_DIM_CENTER( BOARD_ITEM* self ) { return dynamic_cast<PCB_DIM_CENTER *>(self); }
static FOOTPRINT* Cast_to_FOOTPRINT( BOARD_ITEM* self ) { return dynamic_cast<FOOTPRINT*>(self); }
static PCB_GROUP* Cast_to_PCB_GROUP( BOARD_ITEM* self ) { return dynamic_cast<PCB_GROUP*>(self); }
static FP_TEXT* Cast_to_FP_TEXT( BOARD_ITEM* self ) { return dynamic_cast<FP_TEXT*>(self); }

View File

@ -1,6 +0,0 @@
%include dimension.h
%{
#include <dimension.h>
%}

View File

@ -0,0 +1,6 @@
%include pcb_dimension.h
%{
#include <pcb_dimension.h>
%}

View File

@ -49,7 +49,7 @@
#include <fp_shape.h>
#include <pcb_group.h>
#include <pcb_text.h>
#include <dimension.h>
#include <pcb_dimension.h>
#include <zone.h>
#include <footprint.h>
#include <preview_items/two_point_assistant.h>
@ -643,7 +643,7 @@ int DRAWING_TOOL::PlaceText( const TOOL_EVENT& aEvent )
}
void DRAWING_TOOL::constrainDimension( DIMENSION_BASE* aDim )
void DRAWING_TOOL::constrainDimension( PCB_DIMENSION_BASE* aDim )
{
const VECTOR2I lineVector{ aDim->GetEnd() - aDim->GetStart() };
@ -666,7 +666,7 @@ int DRAWING_TOOL::DrawDimension( const TOOL_EVENT& aEvent )
};
TOOL_EVENT originalEvent = aEvent;
DIMENSION_BASE* dimension = nullptr;
PCB_DIMENSION_BASE* dimension = nullptr;
BOARD_COMMIT commit( m_frame );
PCB_GRID_HELPER grid( m_toolMgr, m_frame->GetMagneticItemsSettings() );
BOARD_DESIGN_SETTINGS& boardSettings = m_board->GetDesignSettings();
@ -795,7 +795,7 @@ int DRAWING_TOOL::DrawDimension( const TOOL_EVENT& aEvent )
// Init the new item attributes
auto setMeasurementAttributes =
[&]( DIMENSION_BASE* aDim )
[&]( PCB_DIMENSION_BASE* aDim )
{
aDim->SetUnitsMode( boardSettings.m_DimensionUnitsMode );
aDim->SetUnitsFormat( boardSettings.m_DimensionUnitsFormat );
@ -810,21 +810,21 @@ int DRAWING_TOOL::DrawDimension( const TOOL_EVENT& aEvent )
if( originalEvent.IsAction( &PCB_ACTIONS::drawAlignedDimension ) )
{
dimension = new ALIGNED_DIMENSION( m_board );
dimension = new PCB_DIM_ALIGNED( m_board );
setMeasurementAttributes( dimension );
}
else if( originalEvent.IsAction( &PCB_ACTIONS::drawOrthogonalDimension ) )
{
dimension = new ORTHOGONAL_DIMENSION( m_board );
dimension = new PCB_DIM_ORTHOGONAL( m_board );
setMeasurementAttributes( dimension );
}
else if( originalEvent.IsAction( &PCB_ACTIONS::drawCenterDimension ) )
{
dimension = new CENTER_DIMENSION( m_board );
dimension = new PCB_DIM_CENTER( m_board );
}
else if( originalEvent.IsAction( &PCB_ACTIONS::drawLeader ) )
{
dimension = new LEADER( m_board );
dimension = new PCB_DIM_LEADER( m_board );
dimension->Text().SetPosition( wxPoint( cursorPos ) );
}
else
@ -929,7 +929,7 @@ int DRAWING_TOOL::DrawDimension( const TOOL_EVENT& aEvent )
if( dimension->Type() == PCB_DIM_ORTHOGONAL_T )
{
ORTHOGONAL_DIMENSION* ortho = static_cast<ORTHOGONAL_DIMENSION*>( dimension );
PCB_DIM_ORTHOGONAL* ortho = static_cast<PCB_DIM_ORTHOGONAL*>( dimension );
BOX2I bounds( dimension->GetStart(),
dimension->GetEnd() - dimension->GetStart() );
@ -937,8 +937,8 @@ int DRAWING_TOOL::DrawDimension( const TOOL_EVENT& aEvent )
// Create a nice preview by measuring the longer dimension
bool vert = bounds.GetWidth() < bounds.GetHeight();
ortho->SetOrientation( vert ? ORTHOGONAL_DIMENSION::DIR::VERTICAL
: ORTHOGONAL_DIMENSION::DIR::HORIZONTAL );
ortho->SetOrientation( vert ? PCB_DIM_ORTHOGONAL::DIR::VERTICAL
: PCB_DIM_ORTHOGONAL::DIR::HORIZONTAL );
}
dimension->Update();
@ -952,7 +952,7 @@ int DRAWING_TOOL::DrawDimension( const TOOL_EVENT& aEvent )
{
if( dimension->Type() == PCB_DIM_ALIGNED_T )
{
ALIGNED_DIMENSION* aligned = static_cast<ALIGNED_DIMENSION*>( dimension );
PCB_DIM_ALIGNED* aligned = static_cast<PCB_DIM_ALIGNED*>( dimension );
// Calculating the direction of travel perpendicular to the selected axis
double angle = aligned->GetAngle() + ( M_PI / 2 );
@ -964,7 +964,7 @@ int DRAWING_TOOL::DrawDimension( const TOOL_EVENT& aEvent )
}
else if( dimension->Type() == PCB_DIM_ORTHOGONAL_T )
{
ORTHOGONAL_DIMENSION* ortho = static_cast<ORTHOGONAL_DIMENSION*>( dimension );
PCB_DIM_ORTHOGONAL* ortho = static_cast<PCB_DIM_ORTHOGONAL*>( dimension );
BOX2I bounds( dimension->GetStart(),
dimension->GetEnd() - dimension->GetStart() );
@ -996,12 +996,12 @@ int DRAWING_TOOL::DrawDimension( const TOOL_EVENT& aEvent )
{
vert = std::abs( direction.y ) < std::abs( direction.x );
}
ortho->SetOrientation( vert ? ORTHOGONAL_DIMENSION::DIR::VERTICAL
: ORTHOGONAL_DIMENSION::DIR::HORIZONTAL );
ortho->SetOrientation( vert ? PCB_DIM_ORTHOGONAL::DIR::VERTICAL
: PCB_DIM_ORTHOGONAL::DIR::HORIZONTAL );
}
else
{
vert = ortho->GetOrientation() == ORTHOGONAL_DIMENSION::DIR::VERTICAL;
vert = ortho->GetOrientation() == PCB_DIM_ORTHOGONAL::DIR::VERTICAL;
}
VECTOR2I heightVector( cursorPos - dimension->GetStart() );

View File

@ -259,7 +259,7 @@ private:
*
* @param aDimension is the dimension element currently being drawn.
*/
void constrainDimension( DIMENSION_BASE* aDim );
void constrainDimension( PCB_DIMENSION_BASE* aDim );
///< Return the appropriate width for a segment depending on the settings.
int getSegmentWidth( PCB_LAYER_ID aLayer ) const;

View File

@ -36,7 +36,7 @@
#include <board_design_settings.h>
#include <board_item.h>
#include <dialogs/dialog_paste_special.h>
#include <dimension.h>
#include <pcb_dimension.h>
#include <footprint.h>
#include <pcb_group.h>
#include <track.h>
@ -902,7 +902,7 @@ int PCB_CONTROL::placeBoardItems( std::vector<BOARD_ITEM*>& aItems, bool aIsNew,
case PCB_DIM_LEADER_T:
{
// Dimensions need to have their units updated if they are automatic
DIMENSION_BASE* dim = static_cast<DIMENSION_BASE*>( item );
PCB_DIMENSION_BASE* dim = static_cast<PCB_DIMENSION_BASE*>( item );
if( dim->GetUnitsMode() == DIM_UNITS_MODE::AUTOMATIC )
dim->SetUnits( frame()->GetUserUnits() );

View File

@ -25,7 +25,7 @@
#include <functional>
#include <board.h>
#include <dimension.h>
#include <pcb_dimension.h>
#include <fp_shape.h>
#include <footprint.h>
#include <pad.h>
@ -643,7 +643,7 @@ void PCB_GRID_HELPER::computeAnchors( BOARD_ITEM* aItem, const VECTOR2I& aRefPos
case PCB_DIM_ALIGNED_T:
case PCB_DIM_ORTHOGONAL_T:
{
const ALIGNED_DIMENSION* dim = static_cast<const ALIGNED_DIMENSION*>( aItem );
const PCB_DIM_ALIGNED* dim = static_cast<const PCB_DIM_ALIGNED*>( aItem );
addAnchor( dim->GetCrossbarStart(), CORNER | SNAPPABLE, aItem );
addAnchor( dim->GetCrossbarEnd(), CORNER | SNAPPABLE, aItem );
addAnchor( dim->GetStart(), CORNER | SNAPPABLE, aItem );
@ -653,7 +653,7 @@ void PCB_GRID_HELPER::computeAnchors( BOARD_ITEM* aItem, const VECTOR2I& aRefPos
case PCB_DIM_CENTER_T:
{
const CENTER_DIMENSION* dim = static_cast<const CENTER_DIMENSION*>( aItem );
const PCB_DIM_CENTER* dim = static_cast<const PCB_DIM_CENTER*>( aItem );
addAnchor( dim->GetStart(), CORNER | SNAPPABLE, aItem );
addAnchor( dim->GetEnd(), CORNER | SNAPPABLE, aItem );
@ -671,7 +671,7 @@ void PCB_GRID_HELPER::computeAnchors( BOARD_ITEM* aItem, const VECTOR2I& aRefPos
case PCB_DIM_LEADER_T:
{
const LEADER* leader = static_cast<const LEADER*>( aItem );
const PCB_DIM_LEADER* leader = static_cast<const PCB_DIM_LEADER*>( aItem );
addAnchor( leader->GetStart(), CORNER | SNAPPABLE, aItem );
addAnchor( leader->GetEnd(), CORNER | SNAPPABLE, aItem );
addAnchor( leader->Text().GetPosition(), CORNER | SNAPPABLE, aItem );

View File

@ -40,7 +40,7 @@ using namespace std::placeholders;
#include <status_popup.h>
#include <pcb_edit_frame.h>
#include <fp_shape.h>
#include <dimension.h>
#include <pcb_dimension.h>
#include <pad.h>
#include <zone.h>
#include <connectivity/connectivity_data.h>
@ -291,7 +291,7 @@ std::shared_ptr<EDIT_POINTS> PCB_POINT_EDITOR::makePoints( EDA_ITEM* aItem )
case PCB_DIM_ALIGNED_T:
case PCB_DIM_ORTHOGONAL_T:
{
const ALIGNED_DIMENSION* dimension = static_cast<const ALIGNED_DIMENSION*>( aItem );
const PCB_DIM_ALIGNED* dimension = static_cast<const PCB_DIM_ALIGNED*>( aItem );
points->AddPoint( dimension->GetStart() );
points->AddPoint( dimension->GetEnd() );
@ -315,7 +315,7 @@ std::shared_ptr<EDIT_POINTS> PCB_POINT_EDITOR::makePoints( EDA_ITEM* aItem )
case PCB_DIM_CENTER_T:
{
const CENTER_DIMENSION* dimension = static_cast<const CENTER_DIMENSION*>( aItem );
const PCB_DIM_CENTER* dimension = static_cast<const PCB_DIM_CENTER*>( aItem );
points->AddPoint( dimension->GetStart() );
points->AddPoint( dimension->GetEnd() );
@ -328,7 +328,7 @@ std::shared_ptr<EDIT_POINTS> PCB_POINT_EDITOR::makePoints( EDA_ITEM* aItem )
case PCB_DIM_LEADER_T:
{
const LEADER* dimension = static_cast<const LEADER*>( aItem );
const PCB_DIM_LEADER* dimension = static_cast<const PCB_DIM_LEADER*>( aItem );
points->AddPoint( dimension->GetStart() );
points->AddPoint( dimension->GetEnd() );
@ -1314,7 +1314,7 @@ void PCB_POINT_EDITOR::updateItem() const
case PCB_DIM_ALIGNED_T:
{
ALIGNED_DIMENSION* dimension = static_cast<ALIGNED_DIMENSION*>( item );
PCB_DIM_ALIGNED* dimension = static_cast<PCB_DIM_ALIGNED*>( item );
// Check which point is currently modified and updated dimension's points respectively
if( isModified( m_editPoints->Point( DIM_CROSSBARSTART ) ) )
@ -1376,7 +1376,7 @@ void PCB_POINT_EDITOR::updateItem() const
case PCB_DIM_ORTHOGONAL_T:
{
ORTHOGONAL_DIMENSION* dimension = static_cast<ORTHOGONAL_DIMENSION*>( item );
PCB_DIM_ORTHOGONAL* dimension = static_cast<PCB_DIM_ORTHOGONAL*>( item );
if( isModified( m_editPoints->Point( DIM_CROSSBARSTART ) ) ||
isModified( m_editPoints->Point( DIM_CROSSBAREND ) ) )
@ -1418,12 +1418,12 @@ void PCB_POINT_EDITOR::updateItem() const
{
vert = std::abs( direction.y ) < std::abs( direction.x );
}
dimension->SetOrientation( vert ? ORTHOGONAL_DIMENSION::DIR::VERTICAL
: ORTHOGONAL_DIMENSION::DIR::HORIZONTAL );
dimension->SetOrientation( vert ? PCB_DIM_ORTHOGONAL::DIR::VERTICAL
: PCB_DIM_ORTHOGONAL::DIR::HORIZONTAL );
}
else
{
vert = dimension->GetOrientation() == ORTHOGONAL_DIMENSION::DIR::VERTICAL;
vert = dimension->GetOrientation() == PCB_DIM_ORTHOGONAL::DIR::VERTICAL;
}
dimension->SetHeight( vert ? featureLine.x : featureLine.y );
@ -1452,7 +1452,7 @@ void PCB_POINT_EDITOR::updateItem() const
case PCB_DIM_CENTER_T:
{
CENTER_DIMENSION* dimension = static_cast<CENTER_DIMENSION*>( item );
PCB_DIM_CENTER* dimension = static_cast<PCB_DIM_CENTER*>( item );
if( isModified( m_editPoints->Point( DIM_START ) ) )
{
@ -1472,7 +1472,7 @@ void PCB_POINT_EDITOR::updateItem() const
case PCB_DIM_LEADER_T:
{
LEADER* dimension = static_cast<LEADER*>( item );
PCB_DIM_LEADER* dimension = static_cast<PCB_DIM_LEADER*>( item );
if( isModified( m_editPoints->Point( DIM_START ) ) )
{
@ -1723,7 +1723,7 @@ void PCB_POINT_EDITOR::updatePoints()
case PCB_DIM_ALIGNED_T:
case PCB_DIM_ORTHOGONAL_T:
{
const ALIGNED_DIMENSION* dimension = static_cast<const ALIGNED_DIMENSION*>( item );
const PCB_DIM_ALIGNED* dimension = static_cast<const PCB_DIM_ALIGNED*>( item );
m_editPoints->Point( DIM_START ).SetPosition( dimension->GetStart() );
m_editPoints->Point( DIM_END ).SetPosition( dimension->GetEnd() );
@ -1735,7 +1735,7 @@ void PCB_POINT_EDITOR::updatePoints()
case PCB_DIM_CENTER_T:
{
const CENTER_DIMENSION* dimension = static_cast<const CENTER_DIMENSION*>( item );
const PCB_DIM_CENTER* dimension = static_cast<const PCB_DIM_CENTER*>( item );
m_editPoints->Point( DIM_START ).SetPosition( dimension->GetStart() );
m_editPoints->Point( DIM_END ).SetPosition( dimension->GetEnd() );
@ -1744,7 +1744,7 @@ void PCB_POINT_EDITOR::updatePoints()
case PCB_DIM_LEADER_T:
{
const LEADER* dimension = static_cast<const LEADER*>( item );
const PCB_DIM_LEADER* dimension = static_cast<const PCB_DIM_LEADER*>( item );
m_editPoints->Point( DIM_START ).SetPosition( dimension->GetStart() );
m_editPoints->Point( DIM_END ).SetPosition( dimension->GetEnd() );

View File

@ -35,7 +35,7 @@ using namespace std::placeholders;
#include <pcb_target.h>
#include <footprint.h>
#include <pad.h>
#include <dimension.h>
#include <pcb_dimension.h>
#include <origin_viewitem.h>
#include <connectivity/connectivity_data.h>
#include <pcbnew_settings.h>