Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Node {
- Graph g;
- Particle p;
- int id;
- String label;
- /**
- * Node's constructor
- *
- * @param Graph g : The graph the Node belongs
- * @param int id : The node's id
- * @param String label : The node's label
- * [@param] float mass : Optional node's mass (default = 1.0)
- * [@param] float x, float y, float z : Optional node's position (Default = 0.0, 0.0, 0.0)
- * [@param] Vector3D position : Optional node's position ( default = Vector3D(0.0, 0.0, 0.0) )
- **/
- public Node(Graph g, int id, String label)
- {
- this.g = g;
- this.p = this.g.ps.makeParticle();
- this.id = id;
- this.label = label;
- }
- public Node(Graph g, int id, String label, float mass, float x, float y, float z)
- {
- this.g = g;
- this.p = this.g.ps.makeParticle(mass, x, y, z);
- this.id = id;
- this.label = label;
- }
- public Node(Graph g, int id, String label, float mass, Vector3D position)
- {
- this.g = g;
- this.p = this.g.ps.makeParticle(mass, position.x, position.y, position.z);
- this.id = id;
- this.label = label;
- }
- }
Add Comment
Please, Sign In to add comment