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
aa0fdb1c
Commit
aa0fdb1c
authored
Oct 04, 2010
by
jean-pierre charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed issues in 3D viewer
parent
d207988f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
41 deletions
+24
-41
3d_canvas.cpp
3d-viewer/3d_canvas.cpp
+12
-30
3d_read_mesh.cpp
3d-viewer/3d_read_mesh.cpp
+2
-8
3d_toolbar.cpp
3d-viewer/3d_toolbar.cpp
+10
-3
No files found.
3d-viewer/3d_canvas.cpp
View file @
aa0fdb1c
...
@@ -568,9 +568,9 @@ void Pcb3D_GLCanvas::TakeScreenshot( wxCommandEvent& event )
...
@@ -568,9 +568,9 @@ void Pcb3D_GLCanvas::TakeScreenshot( wxCommandEvent& event )
fmt_is_jpeg
=
TRUE
;
fmt_is_jpeg
=
TRUE
;
if
(
event
.
GetId
()
!=
ID_TOOL_SCREENCOPY_TOCLIBBOARD
)
if
(
event
.
GetId
()
!=
ID_TOOL_SCREENCOPY_TOCLIBBOARD
)
{
{
file_ext
=
fmt_is_jpeg
?
wxT
(
"jpg"
)
:
wxT
(
"png"
);
file_ext
=
fmt_is_jpeg
?
wxT
(
"jpg"
)
:
wxT
(
"png"
);
mask
=
wxT
(
"*."
)
+
file_ext
;
mask
=
wxT
(
"*."
)
+
file_ext
;
FullFileName
=
m_Parent
->
m_Parent
->
GetScreen
()
->
m_FileName
;
FullFileName
=
m_Parent
->
m_Parent
->
GetScreen
()
->
m_FileName
;
fn
.
SetExt
(
file_ext
);
fn
.
SetExt
(
file_ext
);
FullFileName
=
FullFileName
=
...
@@ -582,17 +582,7 @@ void Pcb3D_GLCanvas::TakeScreenshot( wxCommandEvent& event )
...
@@ -582,17 +582,7 @@ void Pcb3D_GLCanvas::TakeScreenshot( wxCommandEvent& event )
return
;
return
;
}
}
Redraw
(
true
);
wxSize
image_size
=
GetClientSize
();
wxSize
image_size
=
GetClientSize
();
#ifndef __WXMAC__
wxClientDC
dc
(
this
);
wxBitmap
bitmap
(
image_size
.
x
,
image_size
.
y
);
wxMemoryDC
memdc
;
memdc
.
SelectObject
(
bitmap
);
memdc
.
Blit
(
0
,
0
,
image_size
.
x
,
image_size
.
y
,
&
dc
,
0
,
0
);
memdc
.
SelectObject
(
wxNullBitmap
);
#else
struct
vieport_params
struct
vieport_params
{
{
GLint
originx
;
GLint
originx
;
...
@@ -600,7 +590,8 @@ void Pcb3D_GLCanvas::TakeScreenshot( wxCommandEvent& event )
...
@@ -600,7 +590,8 @@ void Pcb3D_GLCanvas::TakeScreenshot( wxCommandEvent& event )
GLint
x
;
GLint
x
;
GLint
y
;
GLint
y
;
}
viewport
;
}
viewport
;
// Build image from the 3D buffer
wxWindowUpdateLocker
noUpdates
(
this
);
wxWindowUpdateLocker
noUpdates
(
this
);
glGetIntegerv
(
GL_VIEWPORT
,
(
GLint
*
)
&
viewport
);
glGetIntegerv
(
GL_VIEWPORT
,
(
GLint
*
)
&
viewport
);
...
@@ -610,27 +601,18 @@ void Pcb3D_GLCanvas::TakeScreenshot( wxCommandEvent& event )
...
@@ -610,27 +601,18 @@ void Pcb3D_GLCanvas::TakeScreenshot( wxCommandEvent& event )
glPixelStorei
(
GL_PACK_ALIGNMENT
,
1
);
glPixelStorei
(
GL_PACK_ALIGNMENT
,
1
);
glReadBuffer
(
GL_BACK_LEFT
);
glReadBuffer
(
GL_BACK_LEFT
);
glReadPixels
(
viewport
.
originx
,
glReadPixels
(
viewport
.
originx
,
viewport
.
originy
,
viewport
.
originy
,
viewport
.
x
,
viewport
.
y
,
viewport
.
x
,
GL_RGB
,
GL_UNSIGNED_BYTE
,
pixelbuffer
);
viewport
.
y
,
glReadPixels
(
viewport
.
originx
,
viewport
.
originy
,
GL_RGB
,
viewport
.
x
,
viewport
.
y
,
GL_UNSIGNED_BYTE
,
GL_ALPHA
,
GL_UNSIGNED_BYTE
,
alphabuffer
);
pixelbuffer
);
glReadPixels
(
viewport
.
originx
,
viewport
.
originy
,
viewport
.
x
,
viewport
.
y
,
GL_ALPHA
,
GL_UNSIGNED_BYTE
,
alphabuffer
);
image
.
SetData
(
pixelbuffer
);
image
.
SetData
(
pixelbuffer
);
image
.
SetAlpha
(
alphabuffer
);
image
.
SetAlpha
(
alphabuffer
);
image
=
image
.
Mirror
(
false
);
image
=
image
.
Mirror
(
false
);
wxBitmap
bitmap
(
image
);
wxBitmap
bitmap
(
image
);
#endif
if
(
event
.
GetId
()
==
ID_TOOL_SCREENCOPY_TOCLIBBOARD
)
if
(
event
.
GetId
()
==
ID_TOOL_SCREENCOPY_TOCLIBBOARD
)
{
{
...
...
3d-viewer/3d_read_mesh.cpp
View file @
aa0fdb1c
...
@@ -2,12 +2,6 @@
...
@@ -2,12 +2,6 @@
// Name: 3d_read_mesh.cpp
// Name: 3d_read_mesh.cpp
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
#pragma implementation
#pragma interface
#endif
#include "fctsys.h"
#include "fctsys.h"
#include "common.h"
#include "common.h"
#include "macros.h"
#include "macros.h"
...
@@ -417,7 +411,7 @@ int S3D_MASTER::ReadGeometry( FILE* file, int* LineNum )
...
@@ -417,7 +411,7 @@ int S3D_MASTER::ReadGeometry( FILE* file, int* LineNum )
int
coord_number
;
int
coord_number
;
double
*
buf_points
=
ReadCoordsList
(
file
,
line
,
&
coord_number
,
double
*
buf_points
=
ReadCoordsList
(
file
,
line
,
&
coord_number
,
LineNum
);
LineNum
);
continue
;
// Do something if needed
free
(
buf_points
);
free
(
buf_points
);
continue
;
continue
;
}
}
...
@@ -445,7 +439,7 @@ int S3D_MASTER::ReadGeometry( FILE* file, int* LineNum )
...
@@ -445,7 +439,7 @@ int S3D_MASTER::ReadGeometry( FILE* file, int* LineNum )
int
coord_number
;
int
coord_number
;
double
*
buf_points
=
ReadCoordsList
(
file
,
line
,
&
coord_number
,
double
*
buf_points
=
ReadCoordsList
(
file
,
line
,
&
coord_number
,
LineNum
);
LineNum
);
continue
;
// Do something if needed
free
(
buf_points
);
free
(
buf_points
);
continue
;
continue
;
}
}
...
...
3d-viewer/3d_toolbar.cpp
View file @
aa0fdb1c
...
@@ -104,9 +104,9 @@ void WinEDA3D_DrawFrame::ReCreateMenuBar()
...
@@ -104,9 +104,9 @@ void WinEDA3D_DrawFrame::ReCreateMenuBar()
// If called from the display frame of cvpcb, only some options are
// If called from the display frame of cvpcb, only some options are
// relevant
// relevant
if
(
m_Parent
->
m_FrameName
==
wxT
(
"CmpFrame"
)
)
// Called from cvpcb !
if
(
m_Parent
->
m_FrameName
==
wxT
(
"CmpFrame"
)
)
full_options
=
false
;
// Do not display all
// Called from cvpcb: do not display all options
// options
full_options
=
false
;
wxMenuBar
*
menuBar
=
new
wxMenuBar
;
wxMenuBar
*
menuBar
=
new
wxMenuBar
;
...
@@ -118,6 +118,13 @@ void WinEDA3D_DrawFrame::ReCreateMenuBar()
...
@@ -118,6 +118,13 @@ void WinEDA3D_DrawFrame::ReCreateMenuBar()
_
(
"Create Image (png format)"
)
);
_
(
"Create Image (png format)"
)
);
fileMenu
->
Append
(
ID_MENU_SCREENCOPY_JPEG
,
fileMenu
->
Append
(
ID_MENU_SCREENCOPY_JPEG
,
_
(
"Create Image (jpeg format)"
)
);
_
(
"Create Image (jpeg format)"
)
);
#if (defined(__WINDOWS__) || defined(__APPLE__ ) )
// Does not work properly under linux
fileMenu
->
AppendSeparator
();
fileMenu
->
Append
(
ID_TOOL_SCREENCOPY_TOCLIBBOARD
,
_
(
"Copy 3D Image to Clipboard"
)
);
#endif
fileMenu
->
AppendSeparator
();
fileMenu
->
AppendSeparator
();
fileMenu
->
Append
(
wxID_EXIT
,
_
(
"&Exit"
)
);
fileMenu
->
Append
(
wxID_EXIT
,
_
(
"&Exit"
)
);
...
...
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