mirror of
https://github.com/wxWidgets/wxWidgets.git
synced 2026-09-23 06:33:59 +08:00
Fixed img2py to work correctly with Python 2.1.
Added enhanced wxVTKRenderWindow by Prabhu Ramachandran git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10855 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -2,7 +2,7 @@ CHANGES.txt for wxPython
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
?????
|
||||
2.3.1
|
||||
-----
|
||||
Added EVT_GRID_EDITOR_CREATED and wxGridEditorCreatedEvent so the user
|
||||
code can get access to the edit control when it is created, (to push
|
||||
@@ -18,6 +18,10 @@ Added wxGridAutoEditMixin to the mixins library package.
|
||||
|
||||
Made ColourSelect be derived from wxButton.
|
||||
|
||||
Fixed img2py to work correctly with Python 2.1.
|
||||
|
||||
Added enhanced wxVTKRenderWindow by Prabhu Ramachandran
|
||||
|
||||
|
||||
|
||||
2.3.0
|
||||
|
||||
@@ -1957,15 +1957,9 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
|
||||
{ "_wxPrintQuality","_EBool",0},
|
||||
{ "_wxPrintQuality","_size_t",0},
|
||||
{ "_wxPrintQuality","_time_t",0},
|
||||
{ "_class_wxEvtHandler","_class_wxPyShapeCanvas",SwigwxPyShapeCanvasTowxEvtHandler},
|
||||
{ "_class_wxEvtHandler","_wxPyShapeCanvas",SwigwxPyShapeCanvasTowxEvtHandler},
|
||||
{ "_byte","_unsigned_char",0},
|
||||
{ "_long","_unsigned_long",0},
|
||||
{ "_long","_signed_long",0},
|
||||
{ "_class_wxObject","_class_wxPyShapeCanvas",SwigwxPyShapeCanvasTowxObject},
|
||||
{ "_class_wxObject","_wxPyShapeCanvas",SwigwxPyShapeCanvasTowxObject},
|
||||
{ "_class_wxObject","_class_wxDiagram",SwigwxDiagramTowxObject},
|
||||
{ "_class_wxObject","_wxDiagram",SwigwxDiagramTowxObject},
|
||||
{ "_size_t","_wxCoord",0},
|
||||
{ "_size_t","_wxPrintQuality",0},
|
||||
{ "_size_t","_time_t",0},
|
||||
@@ -1973,7 +1967,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
|
||||
{ "_size_t","_int",0},
|
||||
{ "_size_t","_wxWindowID",0},
|
||||
{ "_size_t","_uint",0},
|
||||
{ "_wxPanel","_class_wxPyShapeCanvas",SwigwxPyShapeCanvasTowxPanel},
|
||||
{ "_wxPanel","_wxPyShapeCanvas",SwigwxPyShapeCanvasTowxPanel},
|
||||
{ "_uint","_wxCoord",0},
|
||||
{ "_uint","_wxPrintQuality",0},
|
||||
@@ -1990,8 +1983,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
|
||||
{ "_EBool","_int",0},
|
||||
{ "_EBool","_wxWindowID",0},
|
||||
{ "_unsigned_long","_long",0},
|
||||
{ "_class_wxPanel","_class_wxPyShapeCanvas",SwigwxPyShapeCanvasTowxPanel},
|
||||
{ "_class_wxPanel","_wxPyShapeCanvas",SwigwxPyShapeCanvasTowxPanel},
|
||||
{ "_signed_int","_wxCoord",0},
|
||||
{ "_signed_int","_wxPrintQuality",0},
|
||||
{ "_signed_int","_EBool",0},
|
||||
@@ -2004,15 +1995,10 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
|
||||
{ "_unsigned_short","_wxDateTime_t",0},
|
||||
{ "_unsigned_short","_WXTYPE",0},
|
||||
{ "_unsigned_short","_short",0},
|
||||
{ "_class_wxWindow","_class_wxPyShapeCanvas",SwigwxPyShapeCanvasTowxWindow},
|
||||
{ "_class_wxWindow","_wxPyShapeCanvas",SwigwxPyShapeCanvasTowxWindow},
|
||||
{ "_wxObject","_class_wxPyShapeCanvas",SwigwxPyShapeCanvasTowxObject},
|
||||
{ "_wxObject","_wxPyShapeCanvas",SwigwxPyShapeCanvasTowxObject},
|
||||
{ "_wxObject","_class_wxDiagram",SwigwxDiagramTowxObject},
|
||||
{ "_wxObject","_wxDiagram",SwigwxDiagramTowxObject},
|
||||
{ "_signed_short","_WXTYPE",0},
|
||||
{ "_signed_short","_short",0},
|
||||
{ "_wxScrolledWindow","_class_wxPyShapeCanvas",SwigwxPyShapeCanvasTowxScrolledWindow},
|
||||
{ "_wxScrolledWindow","_wxPyShapeCanvas",SwigwxPyShapeCanvasTowxScrolledWindow},
|
||||
{ "_unsigned_char","_byte",0},
|
||||
{ "_unsigned_int","_wxCoord",0},
|
||||
@@ -2063,11 +2049,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
|
||||
{ "_wxCoord","_size_t",0},
|
||||
{ "_wxCoord","_time_t",0},
|
||||
{ "_wxCoord","_wxPrintQuality",0},
|
||||
{ "_wxEvtHandler","_class_wxPyShapeCanvas",SwigwxPyShapeCanvasTowxEvtHandler},
|
||||
{ "_wxEvtHandler","_wxPyShapeCanvas",SwigwxPyShapeCanvasTowxEvtHandler},
|
||||
{ "_class_wxScrolledWindow","_class_wxPyShapeCanvas",SwigwxPyShapeCanvasTowxScrolledWindow},
|
||||
{ "_class_wxScrolledWindow","_wxPyShapeCanvas",SwigwxPyShapeCanvasTowxScrolledWindow},
|
||||
{ "_wxWindow","_class_wxPyShapeCanvas",SwigwxPyShapeCanvasTowxWindow},
|
||||
{ "_wxWindow","_wxPyShapeCanvas",SwigwxPyShapeCanvasTowxWindow},
|
||||
{0,0,0}};
|
||||
|
||||
|
||||
@@ -8,36 +8,27 @@ except ImportError:
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
|
||||
def MakeCone(vtkwin):
|
||||
cone = vtk.vtkConeSource()
|
||||
cone.SetResolution(128)
|
||||
coneMapper = vtk.vtkPolyDataMapper()
|
||||
coneMapper.SetInput(cone.GetOutput())
|
||||
coneActor = vtk.vtkActor()
|
||||
coneActor.SetMapper(coneMapper)
|
||||
|
||||
ren = vtk.vtkRenderer()
|
||||
vtkwin.GetRenderWindow().AddRenderer(ren)
|
||||
ren.AddActor(coneActor)
|
||||
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
|
||||
def runTest(frame, nb, log):
|
||||
if haveVTK:
|
||||
f = wxFrame(frame, -1, "wxVTKRenderWindow", size=(450, 300))
|
||||
f = wxFrame(frame, -1, "wxVTKRenderWindow", size=(450, 300),
|
||||
style=wxDEFAULT_FRAME_STYLE|wxNO_FULL_REPAINT_ON_RESIZE)
|
||||
win = vtk.wxVTKRenderWindow(f, -1)
|
||||
|
||||
# Get the render window
|
||||
renWin = win.GetRenderWindow()
|
||||
|
||||
# Next, do the VTK stuff
|
||||
ren = vtk.vtkRenderer()
|
||||
renWin.AddRenderer(ren)
|
||||
cone = vtk.vtkConeSource()
|
||||
cone.SetResolution(80)
|
||||
coneMapper = vtk.vtkPolyDataMapper()
|
||||
coneMapper.SetInput(cone.GetOutput())
|
||||
coneActor = vtk.vtkActor()
|
||||
coneActor.SetMapper(coneMapper)
|
||||
ren.AddActor(coneActor)
|
||||
coneMapper.GetLookupTable().Build()
|
||||
|
||||
# Create a scalar bar
|
||||
scalarBar = vtk.vtkScalarBarActor()
|
||||
scalarBar.SetLookupTable(coneMapper.GetLookupTable())
|
||||
scalarBar.SetTitle("Temperature")
|
||||
scalarBar.GetPositionCoordinate().SetCoordinateSystemToNormalizedViewport()
|
||||
scalarBar.GetPositionCoordinate().SetValue(0.1, 0.01)
|
||||
scalarBar.SetOrientationToHorizontal()
|
||||
scalarBar.SetWidth(0.8)
|
||||
scalarBar.SetHeight(0.17)
|
||||
ren.AddActor2D(scalarBar)
|
||||
MakeCone(win)
|
||||
|
||||
f.Show(true)
|
||||
frame.otherWin = f
|
||||
|
||||
@@ -68,6 +68,7 @@ def crunch_data(data, compressed):
|
||||
c = i = 0
|
||||
word = ""
|
||||
octdigits = "01234567"
|
||||
hexdigits = "0123456789abcdef"
|
||||
while i < len(data):
|
||||
if data[i] != "\\":
|
||||
word = data[i]
|
||||
@@ -79,9 +80,16 @@ def crunch_data(data, compressed):
|
||||
break
|
||||
word = data[i:i+n]
|
||||
i = i + n
|
||||
elif data[i+1] == 'x':
|
||||
for n in range(2, 5):
|
||||
if data[i+n] not in hexdigits:
|
||||
break
|
||||
word = data[i:i+n]
|
||||
i = i + n
|
||||
else:
|
||||
word = data[i:i+2]
|
||||
i = i + 2
|
||||
|
||||
l = len(word)
|
||||
if c + l >= 78-1:
|
||||
fp.write("\\\n")
|
||||
|
||||
+495
-66
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user