Guest User

Untitled

a guest
Apr 25th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. class Node {
  2. Graph g;
  3. Particle p;
  4. int id;
  5. String label;
  6.  
  7. /**
  8. * Node's constructor
  9. *
  10. * @param Graph g : The graph the Node belongs
  11. * @param int id : The node's id
  12. * @param String label : The node's label
  13. * [@param] float mass : Optional node's mass (default = 1.0)
  14. * [@param] float x, float y, float z : Optional node's position (Default = 0.0, 0.0, 0.0)
  15. * [@param] Vector3D position : Optional node's position ( default = Vector3D(0.0, 0.0, 0.0) )
  16. **/
  17. public Node(Graph g, int id, String label)
  18. {
  19. this.g = g;
  20. this.p = this.g.ps.makeParticle();
  21. this.id = id;
  22. this.label = label;
  23. }
  24. public Node(Graph g, int id, String label, float mass, float x, float y, float z)
  25. {
  26. this.g = g;
  27. this.p = this.g.ps.makeParticle(mass, x, y, z);
  28. this.id = id;
  29. this.label = label;
  30. }
  31. public Node(Graph g, int id, String label, float mass, Vector3D position)
  32. {
  33. this.g = g;
  34. this.p = this.g.ps.makeParticle(mass, position.x, position.y, position.z);
  35. this.id = id;
  36. this.label = label;
  37. }
  38. }
Add Comment
Please, Sign In to add comment