Commit edf64afc authored by charras's avatar charras

Eeschema: Added patch from Torsten Huter addeing hotkeys and enhancements in libeditor

Some fixes.
parent ac97a574
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -514,6 +514,10 @@ void SaveStructListForPaste( PICKED_ITEMS_LIST& aItemsList )
/* save the new list: */
ITEM_PICKER item;
// In list the wrapper is owner of the shematic item, we can use the UR_DELETED
// status for the picker because pickers with this status are owner of the picked item
// (or TODO ?: create a new status like UR_DUPLICATE)
item.m_UndoRedoStatus = UR_DELETED;
for( unsigned ii = 0; ii < aItemsList.GetCount(); ii++ )
{
/* Make a copy of the original picked item. */
......
......@@ -17,7 +17,6 @@
#include "protos.h"
#include "classes_body_items.h"
static int fill_tab[3] = { 'N', 'F', 'f' };
//#define DRAW_ARC_WITH_ANGLE // Used to draw arcs
......@@ -231,13 +230,12 @@ bool LIB_ARC::HitTest( const wxPoint& aRefPoint )
int mindist = m_Width ? m_Width / 2 : g_DrawDefaultLineThickness / 2;
// Have a minimal tolerance for hit test
if( mindist < 3 )
mindist = 3; // = 3 mils
if( mindist < MINIMUM_SELECTION_DISTANCE )
mindist = MINIMUM_SELECTION_DISTANCE;
return HitTest( aRefPoint, mindist, DefaultTransformMatrix );
}
/** Function HitTest
* @return true if the point aPosRef is near this object
* @param aRefPoint = a wxPoint to test
......@@ -245,38 +243,45 @@ bool LIB_ARC::HitTest( const wxPoint& aRefPoint )
* of a line)
* @param aTransMat = the transform matrix
*/
bool LIB_ARC::HitTest( wxPoint aRefPoint, int aThreshold,
const int aTransMat[2][2] )
bool LIB_ARC::HitTest( wxPoint aReferencePoint, int aThreshold,
const int aTransformationMatrix[2][2] )
{
// TODO: use aTransMat to calculmates parameters
wxPoint relpos = aRefPoint;
wxPoint relativePosition = aReferencePoint;
NEGATE( relpos.y ); // reverse Y axis
NEGATE( relativePosition.y ); // reverse Y axis
relpos -= m_Pos;
int dist = wxRound( sqrt( ( (double) relpos.x * (double) relpos.x ) +
( (double) relpos.y * (double) relpos.y ) ) );
int distance = wxRound( EuclideanNorm(TwoPointVector(m_Pos, relativePosition) ) );
if( abs( dist - m_Radius ) > aThreshold )
if( abs( distance - m_Radius ) > aThreshold )
return false;
// We are on the circle, ensure we are only on the arc, i.e. between
// m_ArcStart and m_ArcEnd
int astart = m_t1; // arc starting point ( in 0.1 degree)
int aend = m_t2; // arc ending point ( in 0.1 degree)
int atest = wxRound( atan2( (double) relpos.y,
(double) relpos.x ) * 1800.0 / M_PI );
NORMALIZE_ANGLE_180( atest );
NORMALIZE_ANGLE_180( astart );
NORMALIZE_ANGLE_180( aend );
if( astart > aend )
EXCHG( astart, aend );
if( atest >= astart && atest <= aend )
return true;
return false;
wxPoint startEndVector = TwoPointVector( m_ArcStart, m_ArcEnd);
wxPoint startRelativePositionVector = TwoPointVector( m_ArcStart, relativePosition);
wxPoint centerStartVector = TwoPointVector( m_Pos, m_ArcStart);
wxPoint centerEndVector = TwoPointVector( m_Pos, m_ArcEnd);
wxPoint centerRelativePositionVector = TwoPointVector( m_Pos, relativePosition);
// Compute the cross product to check if the point is in the sector
int crossProductStart = CrossProduct(centerStartVector, centerRelativePositionVector);
int crossProductEnd = CrossProduct(centerEndVector, centerRelativePositionVector);
// The cross products need to be exchanged, depending on which side the center point
// relative to the start point to end point vector lies
if (CrossProduct(startEndVector, startRelativePositionVector) < 0 ){
EXCHG(crossProductStart, crossProductEnd);
}
// When the cross products have a different sign, the point lies in sector
// also check, if the reference is near start or end point
return HitTestPoints(m_ArcStart, relativePosition, MINIMUM_SELECTION_DISTANCE) ||
HitTestPoints(m_ArcEnd, relativePosition, MINIMUM_SELECTION_DISTANCE) ||
(crossProductStart <= 0 && crossProductEnd >= 0);
}
......@@ -603,8 +608,8 @@ bool LIB_CIRCLE::HitTest( const wxPoint& aPosRef )
int mindist = m_Width ? m_Width / 2 : g_DrawDefaultLineThickness / 2;
// Have a minimal tolerance for hit test
if( mindist < 3 )
mindist = 3; // = 3 mils
if( mindist < MINIMUM_SELECTION_DISTANCE )
mindist = MINIMUM_SELECTION_DISTANCE;
return HitTest( aPosRef, mindist, DefaultTransformMatrix );
}
......@@ -811,6 +816,9 @@ LIB_RECTANGLE::LIB_RECTANGLE( LIB_COMPONENT* aParent ) :
m_Fill = NO_FILL;
m_isFillable = true;
m_typeName = _( "Rectangle" );
m_isHeightLocked = false;
m_isWidthLocked = false;
m_isStartPointSelected = false;
}
......@@ -1037,8 +1045,8 @@ bool LIB_RECTANGLE::HitTest( const wxPoint& aRefPoint )
int mindist = (m_Width ? m_Width / 2 : g_DrawDefaultLineThickness / 2) + 1;
// Have a minimal tolerance for hit test
if( mindist < 3 )
mindist = 3; // = 3 mils
if( mindist < MINIMUM_SELECTION_DISTANCE )
mindist = MINIMUM_SELECTION_DISTANCE;
return HitTest( aRefPoint, mindist, DefaultTransformMatrix );
}
......@@ -1079,8 +1087,9 @@ bool LIB_RECTANGLE::HitTest( wxPoint aRefPoint, int aThreshold,
return true;
// locate left segment
start.x = actualStart.x;
end.x = actualStart.y;
start = actualStart;
end.x = actualStart.x;
end.y = actualEnd.y;
if( TestSegmentHit( aRefPoint, start, end, aThreshold ) )
return true;
......@@ -1282,8 +1291,8 @@ bool LIB_SEGMENT::HitTest( const wxPoint& aPosRef )
int mindist = m_Width ? m_Width / 2 : g_DrawDefaultLineThickness / 2;
// Have a minimal tolerance for hit test
if( mindist < 3 )
mindist = 3; // = 3 mils
if( mindist < MINIMUM_SELECTION_DISTANCE )
mindist = MINIMUM_SELECTION_DISTANCE;
return HitTest( aPosRef, mindist, DefaultTransformMatrix );
}
......@@ -1613,8 +1622,8 @@ bool LIB_POLYLINE::HitTest( const wxPoint& aRefPos )
int mindist = m_Width ? m_Width / 2 : g_DrawDefaultLineThickness / 2;
// Have a minimal tolerance for hit test
if( mindist < 3 )
mindist = 3; // = 3 mils
if( mindist < MINIMUM_SELECTION_DISTANCE )
mindist = MINIMUM_SELECTION_DISTANCE;
return HitTest( aRefPos, mindist, DefaultTransformMatrix );
}
......@@ -1980,8 +1989,8 @@ bool LIB_BEZIER::HitTest( const wxPoint& aRefPos )
{
int mindist = m_Width ? m_Width /2 : g_DrawDefaultLineThickness / 2;
// Have a minimal tolerance for hit test
if ( mindist < 3 )
mindist = 3; // = 3 mils
if ( mindist < MINIMUM_SELECTION_DISTANCE )
mindist = MINIMUM_SELECTION_DISTANCE;
return HitTest( aRefPos, mindist, DefaultTransformMatrix );
}
......
......@@ -32,7 +32,7 @@ class LIB_PIN;
#define CLOCK_PIN_DIM 40 /* Dim of clock pin symbol. */
#define IEEE_SYMBOL_PIN_DIM 40 /* Dim of special pin symbol. */
#define MINIMUM_SELECTION_DISTANCE 15 // Minimum selection distance in mils
/**
* The component library pin object electrical types used in ERC tests.
......@@ -978,6 +978,9 @@ public:
wxPoint m_End; /* Rectangle end point. */
wxPoint m_Pos; /* Rectangle start point. */
int m_Width; /* Line width */
bool m_isWidthLocked; /* Flag: Keep width locked */
bool m_isHeightLocked; /* Flag: Keep height locked */
bool m_isStartPointSelected; /* Flag: is the upper left edge selected ? */
public:
LIB_RECTANGLE(LIB_COMPONENT * aParent);
......@@ -1146,6 +1149,7 @@ class LIB_POLYLINE : public LIB_DRAW_ITEM
public:
int m_Width; /* Line width */
std::vector<wxPoint> m_PolyPoints; // list of points (>= 2)
int m_ModifyIndex; // Index of the polyline point to modify
public:
LIB_POLYLINE(LIB_COMPONENT * aParent);
......
This diff is collapsed.
This diff is collapsed.
......@@ -25,8 +25,8 @@ enum hotkey_id_commnand {
HK_UNDO,
HK_REDO,
HK_MOVEBLOCK_TO_DRAGBLOCK,
HK_ROTATE_COMPONENT_OR_ITEM,
HK_EDIT_COMPONENT_OR_LABEL,
HK_ROTATE,
HK_EDIT,
HK_EDIT_COMPONENT_VALUE,
HK_EDIT_COMPONENT_FOOTPRINT,
HK_MIRROR_X_COMPONENT,
......@@ -34,7 +34,7 @@ enum hotkey_id_commnand {
HK_ORIENT_NORMAL_COMPONENT,
HK_MOVE_COMPONENT_OR_ITEM,
HK_COPY_COMPONENT_OR_LABEL,
HK_DRAG_COMPONENT,
HK_DRAG,
HK_ADD_NEW_COMPONENT,
HK_BEGIN_WIRE
};
......
......@@ -30,7 +30,9 @@ void WinEDA_LibeditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
{
if( DrawEntry && DrawEntry->m_Flags )
{
SaveCopyInUndoList( m_component );
// Don't put copy in undo list while resizing (because it's already done)
if (!(DrawEntry->m_Flags & IS_RESIZED))
SaveCopyInUndoList( m_component );
switch( DrawEntry->Type() )
{
......
......@@ -84,9 +84,17 @@ bool WinEDA_LibeditFrame::OnRightClick( const wxPoint& MousePos,
HK_LIBEDIT_MOVE_GRAPHIC_ITEM );
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_MOVE_ITEM_REQUEST,
msg, move_arc_xpm );
msg = AddHotkeyName( _( "Drag Arc Size" ), s_Libedit_Hokeys_Descr,
HK_DRAG );
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_MODIFY_ITEM,
msg, move_arc_xpm );
}
msg = AddHotkeyName( _( "Edit Arc Options" ), s_Libedit_Hokeys_Descr,
HK_EDIT );
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_BODY_EDIT_ITEM,
_( "Arc Options" ), options_arc_xpm );
msg, options_arc_xpm );
if( DrawEntry->m_Flags == 0 )
{
msg = AddHotkeyName( _( "Delete Arc " ), s_Libedit_Hokeys_Descr,
......@@ -104,8 +112,20 @@ bool WinEDA_LibeditFrame::OnRightClick( const wxPoint& MousePos,
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_MOVE_ITEM_REQUEST,
msg, move_circle_xpm );
}
if( DrawEntry->m_Flags == 0 )
{
msg = AddHotkeyName( _( "Drag Circle Outline" ), s_Libedit_Hokeys_Descr,
HK_DRAG );
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_MODIFY_ITEM,
msg, move_rectangle_xpm );
}
msg = AddHotkeyName( _( "Edit Circle Options" ), s_Libedit_Hokeys_Descr,
HK_EDIT );
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_BODY_EDIT_ITEM,
_( "Circle Options" ), options_circle_xpm );
msg, options_circle_xpm );
if( DrawEntry->m_Flags == 0 )
{
msg = AddHotkeyName( _( "Delete Circle " ),
......@@ -118,20 +138,33 @@ bool WinEDA_LibeditFrame::OnRightClick( const wxPoint& MousePos,
case COMPONENT_RECT_DRAW_TYPE:
if( DrawEntry->m_Flags == 0 )
{
msg = AddHotkeyName( _( "Move Rect " ), s_Libedit_Hokeys_Descr,
msg = AddHotkeyName( _( "Move Rectangle " ), s_Libedit_Hokeys_Descr,
HK_LIBEDIT_MOVE_GRAPHIC_ITEM );
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_MOVE_ITEM_REQUEST,
msg, move_rectangle_xpm );
}
msg = AddHotkeyName( _( "Edit Rectangle Options" ), s_Libedit_Hokeys_Descr,
HK_EDIT );
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_BODY_EDIT_ITEM,
_( "Rect Options" ), options_rectangle_xpm );
msg, options_rectangle_xpm );
if( DrawEntry->m_Flags == 0 )
{
msg = AddHotkeyName( _( "Drag Rectangle Edge" ), s_Libedit_Hokeys_Descr,
HK_DRAG );
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_MODIFY_ITEM,
msg, move_rectangle_xpm );
}
if( DrawEntry->m_Flags == 0 )
{
msg = AddHotkeyName( _( "Delete Rect " ), s_Libedit_Hokeys_Descr,
msg = AddHotkeyName( _( "Delete Rectangle " ), s_Libedit_Hokeys_Descr,
HK_DELETE_PIN );
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_DELETE_ITEM,
msg, delete_rectangle_xpm );
}
break;
case COMPONENT_GRAPHIC_TEXT_DRAW_TYPE:
......@@ -142,10 +175,17 @@ bool WinEDA_LibeditFrame::OnRightClick( const wxPoint& MousePos,
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_MOVE_ITEM_REQUEST,
msg, move_text_xpm );
}
msg = AddHotkeyName( _( "Edit Text " ), s_Libedit_Hokeys_Descr,
HK_EDIT );
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_BODY_EDIT_ITEM,
_( "Text Editor" ), edit_text_xpm );
msg, edit_text_xpm );
msg = AddHotkeyName( _( "Rotate Text " ), s_Libedit_Hokeys_Descr,
HK_ROTATE );
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_ROTATE_GRAPHIC_TEXT,
_( "Rotate Text" ), edit_text_xpm );
msg, edit_text_xpm );
if( DrawEntry->m_Flags == 0 )
{
msg = AddHotkeyName( _( "Delete Text " ), s_Libedit_Hokeys_Descr,
......@@ -162,14 +202,23 @@ bool WinEDA_LibeditFrame::OnRightClick( const wxPoint& MousePos,
HK_LIBEDIT_MOVE_GRAPHIC_ITEM );
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_MOVE_ITEM_REQUEST,
msg, move_line_xpm );
msg = AddHotkeyName( _( "Drag Edge Point" ), s_Libedit_Hokeys_Descr,
HK_DRAG );
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_MODIFY_ITEM,
msg, move_line_xpm );
}
if( DrawEntry->m_Flags & IS_NEW )
{
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_END_CREATE_ITEM,
_( "Line End" ), apply_xpm );
}
msg = AddHotkeyName( _( "Edit Line Options" ), s_Libedit_Hokeys_Descr,
HK_EDIT );
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_BODY_EDIT_ITEM,
_( "Line Options" ), options_segment_xpm );
msg, options_segment_xpm );
if( DrawEntry->m_Flags == 0 )
{
msg = AddHotkeyName( _( "Delete Line " ), s_Libedit_Hokeys_Descr,
......@@ -188,6 +237,7 @@ bool WinEDA_LibeditFrame::OnRightClick( const wxPoint& MousePos,
msg, delete_segment_xpm );
}
}
break;
case COMPONENT_FIELD_DRAW_TYPE:
......@@ -236,10 +286,10 @@ void AddMenusForPin( wxMenu* PopMenu,
msg, move_xpm );
}
msg = AddHotkeyName( _( "Edit Pin " ), s_Libedit_Hokeys_Descr, HK_EDIT_PIN );
msg = AddHotkeyName( _( "Edit Pin " ), s_Libedit_Hokeys_Descr, HK_EDIT);
ADD_MENUITEM( PopMenu, ID_LIBEDIT_EDIT_PIN, msg, edit_xpm );
msg = AddHotkeyName( _( "Rotate Pin " ), s_Libedit_Hokeys_Descr, HK_LIBEDIT_ROTATE_PIN );
msg = AddHotkeyName( _( "Rotate Pin " ), s_Libedit_Hokeys_Descr, HK_ROTATE );
ADD_MENUITEM( PopMenu, ID_LIBEDIT_ROTATE_PIN, msg, rotate_pin_xpm );
if( not_in_move )
......
This diff is collapsed.
This diff is collapsed.
......@@ -247,7 +247,7 @@ void AddMenusForComponentField( wxMenu* PopMenu, SCH_FIELD* Field )
}
msg = AddHotkeyName( _( "Rotate Field" ),
s_Schematic_Hokeys_Descr, HK_ROTATE_COMPONENT_OR_ITEM );
s_Schematic_Hokeys_Descr, HK_ROTATE );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_ROTATE_FIELD,
msg, rotate_field_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_EDIT_FIELD,
......@@ -285,14 +285,14 @@ void AddMenusForComponent( wxMenu* PopMenu, SCH_COMPONENT* Component )
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_MOVE_CMP_REQUEST,
msg, move_xpm );
msg = AddHotkeyName( _( "Drag Component" ), s_Schematic_Hokeys_Descr,
HK_DRAG_COMPONENT );
HK_DRAG );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DRAG_CMP_REQUEST,
msg, move_xpm );
}
wxMenu* orientmenu = new wxMenu;
msg = AddHotkeyName( _( "Rotate +" ), s_Schematic_Hokeys_Descr,
HK_ROTATE_COMPONENT_OR_ITEM );
HK_ROTATE );
ADD_MENUITEM( orientmenu, ID_POPUP_SCH_ROTATE_CMP_COUNTERCLOCKWISE,
msg, rotate_pos_xpm );
ADD_MENUITEM( orientmenu, ID_POPUP_SCH_ROTATE_CMP_CLOCKWISE,
......@@ -312,7 +312,7 @@ void AddMenusForComponent( wxMenu* PopMenu, SCH_COMPONENT* Component )
wxMenu* editmenu = new wxMenu;
msg = AddHotkeyName( _( "Edit" ), s_Schematic_Hokeys_Descr,
HK_EDIT_COMPONENT_OR_LABEL );
HK_EDIT );
ADD_MENUITEM( editmenu, ID_POPUP_SCH_EDIT_CMP, msg,
edit_component_xpm );
......@@ -393,11 +393,11 @@ void AddMenusForGLabel( wxMenu* PopMenu, SCH_GLOBALLABEL* GLabel )
msg, copy_button );
}
msg = AddHotkeyName( _( "Rotate Global Label" ), s_Schematic_Hokeys_Descr,
HK_ROTATE_COMPONENT_OR_ITEM );
HK_ROTATE );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_ROTATE_TEXT,
msg, rotate_glabel_xpm );
msg = AddHotkeyName( _( "Edit Global Label" ), s_Schematic_Hokeys_Descr,
HK_EDIT_COMPONENT_OR_LABEL );
HK_EDIT );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_EDIT_TEXT,
msg, edit_text_xpm );
msg = AddHotkeyName( _( "Delete Global Label" ), s_Schematic_Hokeys_Descr,
......@@ -437,11 +437,11 @@ void AddMenusForHLabel( wxMenu* PopMenu, SCH_HIERLABEL* HLabel )
msg, copy_button );
}
msg = AddHotkeyName( _( "Rotate Hierarchical Label" ), s_Schematic_Hokeys_Descr,
HK_ROTATE_COMPONENT_OR_ITEM );
HK_ROTATE );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_ROTATE_TEXT,
_( "Rotate Hierarchical Label" ), rotate_glabel_xpm );
msg = AddHotkeyName( _( "Edit Hierarchical Label" ), s_Schematic_Hokeys_Descr,
HK_EDIT_COMPONENT_OR_LABEL );
HK_EDIT );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_EDIT_TEXT,
_( "Edit Hierarchical Label" ), edit_text_xpm );
msg = AddHotkeyName( _( "Delete Hierarchical Label" ), s_Schematic_Hokeys_Descr,
......@@ -480,11 +480,11 @@ void AddMenusForLabel( wxMenu* PopMenu, SCH_LABEL* Label )
msg, copy_button );
}
msg = AddHotkeyName( _( "Rotate Label" ), s_Schematic_Hokeys_Descr,
HK_ROTATE_COMPONENT_OR_ITEM );
HK_ROTATE );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_ROTATE_TEXT,
msg, rotate_pos_xpm );
msg = AddHotkeyName( _( "Edit Label" ), s_Schematic_Hokeys_Descr,
HK_EDIT_COMPONENT_OR_LABEL );
HK_EDIT );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_EDIT_TEXT,
msg, edit_text_xpm );
msg = AddHotkeyName( _( "Delete Label" ), s_Schematic_Hokeys_Descr,
......@@ -524,11 +524,11 @@ void AddMenusForText( wxMenu* PopMenu, SCH_TEXT* Text )
msg, copy_button );
}
msg = AddHotkeyName( _( "Rotate Text" ), s_Schematic_Hokeys_Descr,
HK_ROTATE_COMPONENT_OR_ITEM );
HK_ROTATE );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_ROTATE_TEXT, msg,
rotate_pos_xpm );
msg = AddHotkeyName( _( "Edit Text" ), s_Schematic_Hokeys_Descr,
HK_EDIT_COMPONENT_OR_LABEL );
HK_EDIT );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_EDIT_TEXT, msg,
edit_text_xpm );
msg = AddHotkeyName( _( "Delete Text" ), s_Schematic_Hokeys_Descr,
......@@ -601,7 +601,7 @@ void AddMenusForWire( wxMenu* PopMenu, SCH_LINE* Wire,
}
msg = AddHotkeyName( _( "Drag Wire" ), s_Schematic_Hokeys_Descr,
HK_DRAG_COMPONENT );
HK_DRAG );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DRAG_WIRE_REQUEST, msg,
move_track_xpm );
PopMenu->AppendSeparator();
......@@ -688,7 +688,7 @@ void AddMenusForHierchicalSheet( wxMenu* PopMenu, SCH_SHEET* Sheet )
else
{
msg = AddHotkeyName( _( "Edit Sheet" ),
s_Schematic_Hokeys_Descr, HK_EDIT_COMPONENT_OR_LABEL );
s_Schematic_Hokeys_Descr, HK_EDIT );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_EDIT_SHEET, msg,
edit_sheet_xpm );
......
This diff is collapsed.
......@@ -22,6 +22,36 @@ int ArcTangente( int dy, int dx );
bool DistanceTest( int seuil, int dx, int dy, int spot_cX, int spot_cY );
//! @brief Compute the distance between a line and a reference point
//! Reference: http://mathworld.wolfram.com/Point-LineDistance2-Dimensional.html
//! @param linePointA Point on line
//! @param linePointB Point on line
//! @param referencePoint Reference point
double DistanceLinePoint(wxPoint linePointA, wxPoint linePointB, wxPoint referencePoint);
//! @brief Euclidean norm of a 2D vector
//! @param vector Two-dimensional vector
//! @return Euclidean norm of the vector
double EuclideanNorm(wxPoint vector);
//! @brief Vector between two points
//! @param startPoint The start point
//! @param endPoint The end point
//! @return Vector between the points
wxPoint TwoPointVector(wxPoint startPoint, wxPoint endPoint);
//! @brief Test, if two points are near each other
//! @param pointA First point
//! @param pointB Second point
//! @param threshold The maximum distance
//! @return True or false
bool HitTestPoints(wxPoint pointA, wxPoint pointB, double threshold);
//! @brief Determine the cross product
//! @param vectorA Two-dimensional vector
//! @param vectorB Two-dimensional vector
int CrossProduct(wxPoint vectorA, wxPoint vectorB);
/** Function TestSegmentHit
* test for hit on line segment
......@@ -34,6 +64,8 @@ bool DistanceTest( int seuil, int dx, int dy, int spot_cX, int spot_cY );
bool TestSegmentHit( wxPoint aRefPoint, wxPoint aStart, wxPoint aEnd,
int aDist );
/*******************/
/* Macro NEW_COORD */
/*******************/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment