Results 1 to 3 of 3

Thread: [Qwt3d]Animated plot

  1. #1
    Join Date
    May 2011
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default [Qwt3d]Animated plot

    Hello,

    Any know if there is an easy way to draw a 3d animated plot, to visualize that kind of function :
    z = f(x, y, t)

    Thanks in advance

  2. #2
    Join Date
    May 2011
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: [Qwt3d]Animated plot

    Finally I tried something but it didn't work :

    Qt Code:
    1. from PyQt4.Qwt3D.ezplot import SurfacePlot
    2. from PyQt4.Qwt3D import Function
    3. from PyQt4 import Qwt3D, QtCore
    4.  
    5. from PyQt4.QtCore import QTimer, QObject
    6.  
    7.  
    8.  
    9. class MyFunc(Function):
    10. def __init__(self, pw):
    11. super(MyFunc, self).__init__(pw)
    12. self.pw = pw
    13. self.t = 0
    14. self.deltaT = 100
    15. self.timer = QTimer()
    16. qtObject = QObject()
    17. qtObject.connect(self.timer, QtCore.SIGNAL("timeout()"), self.updatePW)
    18. self.timer.start(self.deltaT)
    19.  
    20. def __call__(self, x, y):
    21. print "__call__"
    22. return 3 + 4*x**2 - 5*y**2 + self.t
    23.  
    24. def updatePW(self):
    25. self.debugCalled = True
    26. self.t += self.deltaT/1000
    27. #self.pw.calcNormals()
    28. #self.pw.calculateHull()
    29. #self.pw.createPoints()
    30. #self.pw.createData()
    31. #self.pw.updateNormals()
    32. #self.pw.updateData()
    33. #self.pw.updateGL()
    34. #self.pw.update()
    35.  
    36. class Plot(SurfacePlot):
    37. def __init__(self):
    38. super(Plot, self).__init__()
    39. self.myFunc = MyFunc(self)
    40. self.myFunc.setMesh(41,31)
    41. self.myFunc.setDomain(-1.73, 1.5, -1.5, 1.5)
    42. self.myFunc.setMinZ(-10)
    43.  
    44. self.myFunc.create()
    45.  
    46. self.setRotation(30, 0, 15)
    47. self.setScale(1, 1, 1)
    48. self.setShift(0.15, 0, 0)
    49. self.setZoom(0.9)
    50.  
    51. for i in xrange(self.coordinates().axes.size()):
    52. self.coordinates().axes[i].setMajors(7)
    53. self.coordinates().axes[i].setMinors(3)
    54. self.coordinates().axes[Qwt3D.X1].setLabelString("x-axis")
    55. self.coordinates().axes[Qwt3D.Y1].setLabelString("y-axis")
    56. self.coordinates().axes[Qwt3D.Z1].setLabelString("z-axis")
    57.  
    58. self.setCoordinateStyle(Qwt3D.BOX)
    59.  
    60. #self.updateData()
    61. #self.updateGL()
    62.  
    63.  
    64. if __name__ == "__main__":
    65. from PyQt4.QtGui import QApplication
    66. import sys
    67. app = QApplication(sys.argv)
    68. plot = Plot()
    69. plot.resize(800,600)
    70. plot.show()
    71. sys.exit(app.exec_())
    To copy to clipboard, switch view to plain text mode 

    Every time my funtion updatePW is called, I would like to recalculate the graph data, but I don't know how I could do that, I tried a bound of functions.
    Anyone has an idea ?

    Thanks in advance

  3. #3
    Join Date
    Oct 2010
    Location
    Berlin, Germany
    Posts
    358
    Thanks
    18
    Thanked 68 Times in 66 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: [Qwt3d]Animated plot

    maybe you should take a look into the qwt3d forum at sourceforge. the qwt we are talking about here has nothing to do with qwt3d...

Similar Threads

  1. unresolved external symbol with qwt3d
    By pospiech in forum Qt Programming
    Replies: 6
    Last Post: 2nd February 2016, 21:47
  2. Replies: 3
    Last Post: 18th June 2010, 13:18
  3. Qwt3D::SufacePlot, running time error
    By locke in forum Qt Programming
    Replies: 2
    Last Post: 1st March 2010, 17:57
  4. Replies: 7
    Last Post: 22nd September 2008, 22:05
  5. Qwt3D - Pie chart
    By jd in forum Qwt
    Replies: 0
    Last Post: 7th May 2008, 11:24

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.