ElecField.h 635 B

123456789101112131415161718192021222324252627282930313233343536
  1. #ifndef ELECFIELD_H
  2. #define ELECFIELD_H
  3. #include <iostream>
  4. #include <vector>
  5. #include <cmath>
  6. #include <SDL/SDL.h>
  7. #undef main
  8. #include "SDL/SDL_gfxPrimitives.h"
  9. struct Charge;
  10. class ElecField
  11. {
  12. /// Méthodes
  13. public:
  14. ElecField();
  15. virtual ~ElecField();
  16. void renderGraph( int w, int h );
  17. SDL_Surface* getGraph() const;
  18. void addCharge(int value, double x, double y, Uint16 nbOut = 24 );
  19. protected :
  20. void drawLineFrom( double x, double y );
  21. /// Attributs
  22. protected:
  23. SDL_Surface* m_graph;
  24. std::vector< Charge > m_chList;
  25. };
  26. #endif // ELECFIELD_H