Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
0ff83cba
Commit
0ff83cba
authored
Mar 18, 2008
by
charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MODULE::GetBoundingBox() takes in account the clearence around the pads. other very minor changes
parent
89acca7d
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
97 additions
and
49 deletions
+97
-49
change_log.txt
change_log.txt
+8
-2
base_struct.cpp
common/base_struct.cpp
+73
-30
cmpclass.cpp
eeschema/cmpclass.cpp
+2
-6
how-to-build-kicad.txt
how-to-build-kicad.txt
+1
-1
CMakeLists.txt
kicad/minizip/CMakeLists.txt
+7
-10
class_module.cpp
pcbnew/class_module.cpp
+5
-0
class_module.h
pcbnew/class_module.h
+1
-0
No files found.
change_log.txt
View file @
0ff83cba
...
@@ -5,6 +5,12 @@ Started 2007-June-11
...
@@ -5,6 +5,12 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with
Please add newer entries at the top, list the date and your name with
email address.
email address.
2008-Mar-18 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
+pcbnew
MODULE::GetBoundingBox() takes in account the clearence around the pads
(the clearence limit shape around pads (when shown) was not always erased )
2008-Mar-17 UPDATE Dick Hollenbeck <dick@softplc.com>
2008-Mar-17 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
================================================================================
...
@@ -35,8 +41,8 @@ email address.
...
@@ -35,8 +41,8 @@ email address.
some code cleaning and comment translations.
some code cleaning and comment translations.
added:
added:
/** EDA_Rect::Merge( EDA_Rect & aRect )
/** EDA_Rect::Merge( EDA_Rect & aRect )
* Modify Position and Size of this in order to contain
s
the given rect
* Modify Position and Size of this in order to contain the given rect
* mainly used to calculate bouding boxes
* mainly used to calculate bou
n
ding boxes
* @param aRect = given rect to merge with this
* @param aRect = given rect to merge with this
*/
*/
...
...
common/base_struct.cpp
View file @
0ff83cba
...
@@ -123,9 +123,9 @@ void EDA_BaseStruct::Place( WinEDA_DrawFrame* frame, wxDC* DC )
...
@@ -123,9 +123,9 @@ void EDA_BaseStruct::Place( WinEDA_DrawFrame* frame, wxDC* DC )
// see base_struct.h
// see base_struct.h
SEARCH_RESULT
EDA_BaseStruct
::
IterateForward
(
EDA_BaseStruct
*
listStart
,
SEARCH_RESULT
EDA_BaseStruct
::
IterateForward
(
EDA_BaseStruct
*
listStart
,
INSPECTOR
*
inspector
,
INSPECTOR
*
inspector
,
const
void
*
testData
,
const
void
*
testData
,
const
KICAD_T
scanTypes
[]
)
const
KICAD_T
scanTypes
[]
)
{
{
EDA_BaseStruct
*
p
=
listStart
;
EDA_BaseStruct
*
p
=
listStart
;
...
@@ -200,11 +200,11 @@ void EDA_BaseStruct::Show( int nestLevel, std::ostream& os )
...
@@ -200,11 +200,11 @@ void EDA_BaseStruct::Show( int nestLevel, std::ostream& os )
NestedSpace
(
nestLevel
,
os
)
<<
'<'
<<
s
.
Lower
().
mb_str
()
<<
">
\n
"
;
NestedSpace
(
nestLevel
,
os
)
<<
'<'
<<
s
.
Lower
().
mb_str
()
<<
">
\n
"
;
/*
/*
* EDA_BaseStruct* kid = m_Son;
* EDA_BaseStruct* kid = m_Son;
* for( ; kid; kid = kid->Pnext )
* for( ; kid; kid = kid->Pnext )
* {
* {
* kid->Show( nestLevel+1, os );
* kid->Show( nestLevel+1, os );
* }
* }
*/
*/
NestedSpace
(
nestLevel
+
1
,
os
)
<<
"Need ::Show() override
\n
"
;
NestedSpace
(
nestLevel
+
1
,
os
)
<<
"Need ::Show() override
\n
"
;
...
@@ -729,33 +729,76 @@ bool EDA_Rect::Intersects( const EDA_Rect aRect ) const
...
@@ -729,33 +729,76 @@ bool EDA_Rect::Intersects( const EDA_Rect aRect ) const
/**************************************************/
/**************************************************/
EDA_Rect
&
EDA_Rect
::
Inflate
(
wxCoord
dx
,
wxCoord
dy
)
EDA_Rect
&
EDA_Rect
::
Inflate
(
wxCoord
dx
,
wxCoord
dy
)
/**************************************************/
/**************************************************/
/** Function Inflate
* Inflate "this": move each horizontal edge by dx and each vertical edge by dy
* toward rect outside
* if dx and/or dy is negative, move toward rect inside (deflate)
* Works for positive and negative rect size
*
*/
{
{
if
(
-
2
*
dx
>
m_Size
.
x
)
if
(
m_Size
.
x
>=
0
)
{
{
// Don't allow deflate to eat more width than we have,
if
(
m_Size
.
x
<
-
2
*
dx
)
// a well-defined rectangle cannot have negative width.
{
m_Pos
.
x
+=
m_Size
.
x
/
2
;
// Don't allow deflate to eat more width than we have,
m_Size
.
x
=
0
;
m_Pos
.
x
+=
m_Size
.
x
/
2
;
m_Size
.
x
=
0
;
}
else
{
// The inflate is valid.
m_Pos
.
x
-=
dx
;
m_Size
.
x
+=
2
*
dx
;
}
}
}
else
else
// size.x < 0:
{
{
// The inflate is valid.
if
(
m_Size
.
x
>
-
2
*
dx
)
m_Pos
.
x
-=
dx
;
{
m_Size
.
x
+=
2
*
dx
;
// Don't allow deflate to eat more width than we have,
m_Pos
.
x
-=
m_Size
.
x
/
2
;
m_Size
.
x
=
0
;
}
else
{
// The inflate is valid.
m_Pos
.
x
+=
dx
;
m_Size
.
x
-=
2
*
dx
;
// m_Size.x <0: inflate when dx > 0
}
}
}
if
(
-
2
*
dy
>
m_Size
.
y
)
if
(
m_Size
.
y
>=
0
)
{
{
// Don't allow deflate to eat more height than we have,
if
(
m_Size
.
y
<
-
2
*
dy
)
// a well-defined rectangle cannot have negative height.
{
m_Pos
.
y
+=
m_Size
.
y
/
2
;
// Don't allow deflate to eat more height than we have,
m_Size
.
y
=
0
;
m_Pos
.
y
+=
m_Size
.
y
/
2
;
m_Size
.
y
=
0
;
}
else
{
// The inflate is valid.
m_Pos
.
y
-=
dy
;
m_Size
.
y
+=
2
*
dy
;
}
}
}
else
else
// size.y < 0:
{
{
// The inflate is valid.
if
(
m_Size
.
y
>
2
*
dy
)
m_Pos
.
y
-=
dy
;
{
m_Size
.
y
+=
2
*
dy
;
// Don't allow deflate to eat more height than we have,
m_Pos
.
y
-=
m_Size
.
y
/
2
;
m_Size
.
y
=
0
;
}
else
{
// The inflate is valid.
m_Pos
.
y
+=
dy
;
m_Size
.
y
-=
2
*
dy
;
// m_Size.y <0: inflate when dy > 0
}
}
}
return
*
this
;
return
*
this
;
...
@@ -772,14 +815,14 @@ void EDA_Rect::Merge( const EDA_Rect& aRect )
...
@@ -772,14 +815,14 @@ void EDA_Rect::Merge( const EDA_Rect& aRect )
Normalize
();
// ensure width and height >= 0
Normalize
();
// ensure width and height >= 0
EDA_Rect
rect
=
aRect
;
EDA_Rect
rect
=
aRect
;
rect
.
Normalize
();
// ensure width and height >= 0
rect
.
Normalize
();
// ensure width and height >= 0
wxPoint
end
=
GetEnd
();
wxPoint
end
=
GetEnd
();
wxPoint
rect_end
=
rect
.
GetEnd
();
wxPoint
rect_end
=
rect
.
GetEnd
();
// Change origin and size in order to contain the given rect
// Change origin and size in order to contain the given rect
m_Pos
.
x
=
MIN
(
m_Pos
.
x
,
rect
.
m_Pos
.
x
);
m_Pos
.
x
=
MIN
(
m_Pos
.
x
,
rect
.
m_Pos
.
x
);
m_Pos
.
y
=
MIN
(
m_Pos
.
y
,
rect
.
m_Pos
.
y
);
m_Pos
.
y
=
MIN
(
m_Pos
.
y
,
rect
.
m_Pos
.
y
);
end
.
x
=
MAX
(
end
.
x
,
rect_end
.
x
);
end
.
x
=
MAX
(
end
.
x
,
rect_end
.
x
);
end
.
y
=
MAX
(
end
.
y
,
rect_end
.
y
);
end
.
y
=
MAX
(
end
.
y
,
rect_end
.
y
);
SetEnd
(
end
);
SetEnd
(
end
);
}
}
...
...
eeschema/cmpclass.cpp
View file @
0ff83cba
...
@@ -282,13 +282,9 @@ EDA_Rect EDA_SchComponentStruct::GetBoundingBox()
...
@@ -282,13 +282,9 @@ EDA_Rect EDA_SchComponentStruct::GetBoundingBox()
ret
.
Merge
(
m_Field
[
i
].
GetBoundaryBox
()
);
ret
.
Merge
(
m_Field
[
i
].
GetBoundaryBox
()
);
}
}
// ... add padding TODO: improve this
// ... add padding
ret
.
m_Pos
.
x
-=
PADDING
;
ret
.
Inflate
(
PADDING
,
PADDING
);
ret
.
m_Pos
.
y
-=
PADDING
;
ret
.
m_Size
.
x
+=
2
*
PADDING
;
ret
.
m_Size
.
y
+=
2
*
PADDING
;
// D( printf("final box: %d,%d, %d,%d\n", ret.m_Pos.x, ret.m_Pos.y, ret.m_Size.x, ret.m_Size.y); )
return
ret
;
return
ret
;
}
}
...
...
how-to-build-kicad.txt
View file @
0ff83cba
...
@@ -68,7 +68,7 @@ and then:
...
@@ -68,7 +68,7 @@ and then:
-- debug
-- debug
cd build-debug
cd build-debug
../conf
gi
ure --enable-unicode --enable-monolithic --enable-debug --enable-debug_gdb --disable-shared --with-msw --with-opengl
../conf
ig
ure --enable-unicode --enable-monolithic --enable-debug --enable-debug_gdb --disable-shared --with-msw --with-opengl
make
make
make install
make install
...
...
kicad/minizip/CMakeLists.txt
View file @
0ff83cba
...
@@ -3,16 +3,13 @@ if(ZLIB_FOUND)
...
@@ -3,16 +3,13 @@ if(ZLIB_FOUND)
message
(
STATUS
"Check for installed zlib -- found"
)
message
(
STATUS
"Check for installed zlib -- found"
)
else
(
ZLIB_FOUND
)
else
(
ZLIB_FOUND
)
message
(
STATUS
"Check for installed zlib -- not found"
)
message
(
STATUS
"Check for installed zlib -- not found"
)
if
(
NOT MINGW
)
message
(
STATUS
"Use wxWidgets zlib"
)
message
(
FATAL_ERROR
# zlib is not installed, and in this case wxWidgets creates its own zlib library
"zlib was not found - it is required to build KiCad"
)
# include files are in ${wxWidgets_ROOT_DIR}/src/zlib
else
(
NOT MINGW
)
# and the corresponding library is libwxzlib-<version>.a (like libwxzlib-2.8.a)
# zlib is not installed, and in this case wxWidgets creates its own zlib library
# and we try to use it
# include files are in ${wxWidgets_ROOT_DIR}/src/zlib
INCLUDE_DIRECTORIES
(
${
wxWidgets_ROOT_DIR
}
/src/zlib
)
# and the corresponding library is libwxzlib-<version>.a (like libwxzlib-2.8.a)
set
(
ZLIB_LIBRARIES
${
wxWidgets_ROOT_DIR
}
/lib/libwxzlib-2.8.a
)
# and we try to use it
include_directories
(
${
wxWidgets_ROOT_DIR
}
/src/zlib
)
endif
(
NOT MINGW
)
endif
(
ZLIB_FOUND
)
endif
(
ZLIB_FOUND
)
set
(
MINIZIP_SRCS
set
(
MINIZIP_SRCS
...
...
pcbnew/class_module.cpp
View file @
0ff83cba
...
@@ -1054,6 +1054,7 @@ void MODULE::SetRectangleExinscrit()
...
@@ -1054,6 +1054,7 @@ void MODULE::SetRectangleExinscrit()
/**
/**
* Function GetBoundingBox
* Function GetBoundingBox
* returns the full bounding box of this Footprint, including texts
* returns the full bounding box of this Footprint, including texts
* Mainly used to redraw the screen area occuped by the footprint
*/
*/
EDA_Rect
MODULE
::
GetBoundingBox
()
EDA_Rect
MODULE
::
GetBoundingBox
()
{
{
...
@@ -1078,6 +1079,10 @@ EDA_Rect MODULE::GetBoundingBox()
...
@@ -1078,6 +1079,10 @@ EDA_Rect MODULE::GetBoundingBox()
area
.
Merge
(
text_area
);
area
.
Merge
(
text_area
);
}
}
// Add the Clearence shape size: (shape around the pads when the clearence is shown
// Not optimized, but the draw cost is small (perhaps smaller than optimization)
area
.
Inflate
(
g_DesignSettings
.
m_TrackClearence
,
g_DesignSettings
.
m_TrackClearence
);
return
area
;
return
area
;
}
}
...
...
pcbnew/class_module.h
View file @
0ff83cba
...
@@ -87,6 +87,7 @@ public:
...
@@ -87,6 +87,7 @@ public:
/**
/**
* Function GetBoundingBox
* Function GetBoundingBox
* returns the bounding box of this Footprint
* returns the bounding box of this Footprint
* Mainly used to redraw the screen area occuped by the footprint
*/
*/
EDA_Rect
GetBoundingBox
();
EDA_Rect
GetBoundingBox
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment