Loading change_log.txt +12 −0 Original line number Diff line number Diff line Loading @@ -5,6 +5,18 @@ Please add newer entries at the top, list the date and your name with email address. 2007-Aug-07 UPDATE Dick Hollenbeck <dick@softplc.com> ================================================================================ + pcbnew & common * More searching work. Made HitTest() virtual. Factored out a HitTest() function for both class_module and class_pad from existing code. * Embellished the Show() function for several of the classes. Could be the basis of a possible future XML export, but with the native format being ascii already, this is of questionable value as an export. * Discovered a long time existing bug in class_module hit-testing. Still need to understand it. It could just be an improperly formatted module. 2007-Aug-06 UPDATE Dick Hollenbeck <dick@softplc.com> ================================================================================ + pcbnew & common Loading common/base_struct.cpp +14 −0 Original line number Diff line number Diff line Loading @@ -191,6 +191,20 @@ wxString EDA_BaseStruct::ReturnClassName() const #if defined(DEBUG) // A function that should have been in wxWidgets std::ostream& operator<<( std::ostream& out, wxSize& size ) { out << " width=\"" << size.GetWidth() << "\" height=\"" << size.GetHeight() << "\""; return out; } // A function that should have been in wxWidgets std::ostream& operator<<( std::ostream& out, wxPoint& pt ) { out << " x=\"" << pt.x << "\" y=\"" << pt.y << "\""; return out; } /** * Function Show Loading include/base_struct.h +21 −5 Original line number Diff line number Diff line Loading @@ -8,6 +8,8 @@ #if defined(DEBUG) #include <iostream> // needed for Show() extern std::ostream& operator<<( std::ostream& out, wxSize& size ); extern std::ostream& operator<<( std::ostream& out, wxPoint& pt ); #endif Loading Loading @@ -178,6 +180,18 @@ public: int draw_mode, int Color = -1 ); /** * Function HitTest * tests if the given wxPoint is within the bounds of this object. * @param refPos A wxPoint to test * @return bool - true if a hit, else false */ virtual bool HitTest( const wxPoint& refPos ) { return false; // derived classes should override this function } #if defined(DEBUG) /** Loading Loading @@ -330,10 +344,10 @@ public: /** * Function HitTest * tests if the given wxPoint is within the bounds of this object. * @param posref A wxPoint to test * @param ref_pos A wxPoint to test * @return bool - true if a hit, else false */ bool HitTest( const wxPoint& posref ); bool HitTest( const wxPoint& ref_pos ); int Len_Size( void ); // Return the text lenght in internal units }; Loading Loading @@ -381,7 +395,9 @@ public: }; /* class to handle component boundary box. /** * Class EDA_Rect * handles the component boundary box. * This class is similar to wxRect, but some wxRect functions are very curious, * so I prefer this suitable class */ Loading include/drawpanel_wxstruct.h +23 −10 Original line number Diff line number Diff line Loading @@ -180,6 +180,7 @@ public: wxSize m_ScrollbarNumber; /* Valeur effective des Nombres de Scrool * c.a.d taille en unites de scroll de la surface totale affichable */ wxPoint m_StartVisu; // Coord absolues du 1er pixel visualis�a l'ecran (en nombre de pixels) wxSize m_SizeVisu; /* taille en pixels de l'ecran (fenetre de visu * Utile pour recadrer les affichages lors de la * navigation dans la hierarchie */ Loading Loading @@ -274,8 +275,21 @@ public: void SetLastGrid( void ); /* ajuste la grille au max */ #if defined (DEBUG) /** * Function RefPos * returns the reference position, coming from either the mouse position or the * the cursor position. * @param useMouse If true, return mouse posistion, else cursor's. * @return wxPoint - The reference point, either the mouse position or * the cursor position. */ wxPoint RefPos( bool useMouse ) { return useMouse ? m_MousePosition : m_Curseur; } #if defined (DEBUG) /** * Function GetClass * returns the class name. Loading @@ -285,7 +299,6 @@ public: { return wxT( "BASE_SCREEN" ); } #endif }; Loading include/pcbstruct.h +11 −8 Original line number Diff line number Diff line Loading @@ -66,16 +66,15 @@ #define ECO1_LAYER 0x04000000 #define ECO2_LAYER 0x08000000 #define EDGE_LAYER 0x10000000 #define intS_LAYER 0xE0000000 /* 4 bits MSB = autres flags */ // extra bits 0xE0000000 /* masques generaux : */ #define ALL_LAYERS 0x1FFFFFFF #define ALL_NO_CU_LAYERS 0x1FFF0000 #define ALL_CU_LAYERS 0x0000FFFF #define INTERNAL_LAYERS 0x00007FFE /* Bits layers internes */ #define EXTERNAL_LAYERS 0x00008001 /* Flags pour les couches cuivres */ #define LAYER_is_PLAN 0x80000000 /* Flags pour les couches cuivres */ /* numero des couches particulieres */ #define LAYER_CUIVRE_N 0 #define CUIVRE_N 0 Loading @@ -96,6 +95,7 @@ #define LAYER_CMP_N 15 #define CMP_N 15 #define NB_COPPER_LAYERS (CMP_N + 1) #define FIRST_NO_COPPER_LAYER 16 #define ADHESIVE_N_CU 16 #define ADHESIVE_N_CMP 17 Loading @@ -112,6 +112,7 @@ #define EDGE_N 28 #define LAST_NO_COPPER_LAYER 28 #define NB_LAYERS (EDGE_N + 1) #define LAYER_COUNT 32 /* Forme des segments (pistes, contours ..) ( parametre .shape ) */ Loading Loading @@ -257,12 +258,13 @@ public: /** * Function FindModuleOrPad * searches for either a module or a pad, giving precedence to pads. * Function FindPadOrModule * searches for either a pad or module, giving precedence to pads. * @param refPos The wxPoint to hit-test. * @param typeloc * @return EDA_BaseStruct* - if a direct hit, else NULL. */ EDA_BaseStruct* FindModuleOrPad( const wxPoint& refPos ); EDA_BaseStruct* FindPadOrModule( const wxPoint& refPos, int layer, int typeloc ); #endif }; Loading Loading @@ -375,6 +377,7 @@ public: int DisplayModText; bool DisplayPcbTrackFill; /* FALSE = sketch , TRUE = filled */ bool DisplayTrackIsol; int m_DisplayViaMode; /* 0 do not show via hole, * 1 show via hole for non default value * 2 show all via hole */ Loading Loading
change_log.txt +12 −0 Original line number Diff line number Diff line Loading @@ -5,6 +5,18 @@ Please add newer entries at the top, list the date and your name with email address. 2007-Aug-07 UPDATE Dick Hollenbeck <dick@softplc.com> ================================================================================ + pcbnew & common * More searching work. Made HitTest() virtual. Factored out a HitTest() function for both class_module and class_pad from existing code. * Embellished the Show() function for several of the classes. Could be the basis of a possible future XML export, but with the native format being ascii already, this is of questionable value as an export. * Discovered a long time existing bug in class_module hit-testing. Still need to understand it. It could just be an improperly formatted module. 2007-Aug-06 UPDATE Dick Hollenbeck <dick@softplc.com> ================================================================================ + pcbnew & common Loading
common/base_struct.cpp +14 −0 Original line number Diff line number Diff line Loading @@ -191,6 +191,20 @@ wxString EDA_BaseStruct::ReturnClassName() const #if defined(DEBUG) // A function that should have been in wxWidgets std::ostream& operator<<( std::ostream& out, wxSize& size ) { out << " width=\"" << size.GetWidth() << "\" height=\"" << size.GetHeight() << "\""; return out; } // A function that should have been in wxWidgets std::ostream& operator<<( std::ostream& out, wxPoint& pt ) { out << " x=\"" << pt.x << "\" y=\"" << pt.y << "\""; return out; } /** * Function Show Loading
include/base_struct.h +21 −5 Original line number Diff line number Diff line Loading @@ -8,6 +8,8 @@ #if defined(DEBUG) #include <iostream> // needed for Show() extern std::ostream& operator<<( std::ostream& out, wxSize& size ); extern std::ostream& operator<<( std::ostream& out, wxPoint& pt ); #endif Loading Loading @@ -178,6 +180,18 @@ public: int draw_mode, int Color = -1 ); /** * Function HitTest * tests if the given wxPoint is within the bounds of this object. * @param refPos A wxPoint to test * @return bool - true if a hit, else false */ virtual bool HitTest( const wxPoint& refPos ) { return false; // derived classes should override this function } #if defined(DEBUG) /** Loading Loading @@ -330,10 +344,10 @@ public: /** * Function HitTest * tests if the given wxPoint is within the bounds of this object. * @param posref A wxPoint to test * @param ref_pos A wxPoint to test * @return bool - true if a hit, else false */ bool HitTest( const wxPoint& posref ); bool HitTest( const wxPoint& ref_pos ); int Len_Size( void ); // Return the text lenght in internal units }; Loading Loading @@ -381,7 +395,9 @@ public: }; /* class to handle component boundary box. /** * Class EDA_Rect * handles the component boundary box. * This class is similar to wxRect, but some wxRect functions are very curious, * so I prefer this suitable class */ Loading
include/drawpanel_wxstruct.h +23 −10 Original line number Diff line number Diff line Loading @@ -180,6 +180,7 @@ public: wxSize m_ScrollbarNumber; /* Valeur effective des Nombres de Scrool * c.a.d taille en unites de scroll de la surface totale affichable */ wxPoint m_StartVisu; // Coord absolues du 1er pixel visualis�a l'ecran (en nombre de pixels) wxSize m_SizeVisu; /* taille en pixels de l'ecran (fenetre de visu * Utile pour recadrer les affichages lors de la * navigation dans la hierarchie */ Loading Loading @@ -274,8 +275,21 @@ public: void SetLastGrid( void ); /* ajuste la grille au max */ #if defined (DEBUG) /** * Function RefPos * returns the reference position, coming from either the mouse position or the * the cursor position. * @param useMouse If true, return mouse posistion, else cursor's. * @return wxPoint - The reference point, either the mouse position or * the cursor position. */ wxPoint RefPos( bool useMouse ) { return useMouse ? m_MousePosition : m_Curseur; } #if defined (DEBUG) /** * Function GetClass * returns the class name. Loading @@ -285,7 +299,6 @@ public: { return wxT( "BASE_SCREEN" ); } #endif }; Loading
include/pcbstruct.h +11 −8 Original line number Diff line number Diff line Loading @@ -66,16 +66,15 @@ #define ECO1_LAYER 0x04000000 #define ECO2_LAYER 0x08000000 #define EDGE_LAYER 0x10000000 #define intS_LAYER 0xE0000000 /* 4 bits MSB = autres flags */ // extra bits 0xE0000000 /* masques generaux : */ #define ALL_LAYERS 0x1FFFFFFF #define ALL_NO_CU_LAYERS 0x1FFF0000 #define ALL_CU_LAYERS 0x0000FFFF #define INTERNAL_LAYERS 0x00007FFE /* Bits layers internes */ #define EXTERNAL_LAYERS 0x00008001 /* Flags pour les couches cuivres */ #define LAYER_is_PLAN 0x80000000 /* Flags pour les couches cuivres */ /* numero des couches particulieres */ #define LAYER_CUIVRE_N 0 #define CUIVRE_N 0 Loading @@ -96,6 +95,7 @@ #define LAYER_CMP_N 15 #define CMP_N 15 #define NB_COPPER_LAYERS (CMP_N + 1) #define FIRST_NO_COPPER_LAYER 16 #define ADHESIVE_N_CU 16 #define ADHESIVE_N_CMP 17 Loading @@ -112,6 +112,7 @@ #define EDGE_N 28 #define LAST_NO_COPPER_LAYER 28 #define NB_LAYERS (EDGE_N + 1) #define LAYER_COUNT 32 /* Forme des segments (pistes, contours ..) ( parametre .shape ) */ Loading Loading @@ -257,12 +258,13 @@ public: /** * Function FindModuleOrPad * searches for either a module or a pad, giving precedence to pads. * Function FindPadOrModule * searches for either a pad or module, giving precedence to pads. * @param refPos The wxPoint to hit-test. * @param typeloc * @return EDA_BaseStruct* - if a direct hit, else NULL. */ EDA_BaseStruct* FindModuleOrPad( const wxPoint& refPos ); EDA_BaseStruct* FindPadOrModule( const wxPoint& refPos, int layer, int typeloc ); #endif }; Loading Loading @@ -375,6 +377,7 @@ public: int DisplayModText; bool DisplayPcbTrackFill; /* FALSE = sketch , TRUE = filled */ bool DisplayTrackIsol; int m_DisplayViaMode; /* 0 do not show via hole, * 1 show via hole for non default value * 2 show all via hole */ Loading