1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
| /**
* @author sylvain
*/
// Classe de gestion des graphes de scènes
////////////////////////////////////////////////////////////////////
// Constructeur de noeud du graphe de scène
// Arguments : Les parents, les enfants, un identifiant, un objet
// et une transformation
//
////////////////////////////////////////////////////////////////////
var WebGL_Node = Class.create({
initialize : function(obj, node) {
this.obj = obj;
this.node = node;
this.nb_elem = 0;
node = new WebGL_GroupNode(null);
},
////////////////////////////////////////////////////////////////////
// Méthode pour ajouter un enfant à l'arbre
// Entrée : Un objet WebGL, le parent, la matrice de transformation
// Sortie : Le nouveau parent
//
////////////////////////////////////////////////////////////////////
addNode : function ( node) {
// L'arbre est nul, on le crée
if(node == null) {
node = new WebGL_Node(this.obj, this.node);
} else {
this.node = node;
this.nb_elem = this.nb_elem + 1;
}
return node;
},
////////////////////////////////////////////////////////////////////
// Méthode pour supprimer un noeud
//
//
//
////////////////////////////////////////////////////////////////////
removeParent : function (id_node) {
},
////////////////////////////////////////////////////////////////////
// Méthode pour rechercher un noeud avec son identifiant
// Entrée : l'arbre, et l'identifiant
// Sortie : le nouvel arbre
//
////////////////////////////////////////////////////////////////////
searchNode : function (id_node, root) {
},
////////////////////////////////////////////////////////////////////
// Méthode pour savoir si un arbre est vide ou non
//
//
//
////////////////////////////////////////////////////////////////////
isEmpty : function () {
return (this.root == null);
}
}); |