mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-04-21 18:23:45 +00:00
Prefix DIMENSION types.
This commit is contained in:
parent
6ab995d6a4
commit
16b0147af8
3d-viewer/3d_canvas
common
include/core
pcbnew
CMakeLists.txtboard_design_settings.cppboard_items_to_polygon_shape_transform.cppcollectors.cpp
dialogs
dialog_dimension_properties.cppdialog_dimension_properties.hdialog_global_edit_text_and_graphics.cpp
drc
edit.cpppcb_base_edit_frame.cpppcb_dimension.cpppcb_dimension.hpcb_edit_frame.hpcb_painter.cpppcb_painter.hpcbplot.hplot_board_layers.cppplot_brditems_plotter.cppplugins
altium
cadstar
eagle
kicad
legacy
python/swig
tools
undo_redo.cpp@ -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 );
|
||||
|
@ -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 )
|
||||
{
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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>
|
||||
|
@ -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." );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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:
|
||||
|
@ -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() ) );
|
||||
}
|
||||
|
||||
|
@ -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();
|
||||
};
|
||||
|
@ -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();
|
||||
|
@ -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.
|
||||
|
@ -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;
|
||||
|
@ -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 )
|
||||
{
|
||||
|
@ -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 ) );
|
@ -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;
|
@ -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();
|
||||
|
||||
/**
|
||||
|
@ -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 );
|
||||
|
||||
|
@ -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 );
|
||||
|
||||
|
@ -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 );
|
||||
|
@ -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>
|
||||
|
@ -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;
|
||||
|
@ -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 );
|
||||
|
@ -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 );
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user