Logo Search packages:      
Sourcecode: octave-vrml version File versions  Download package

vrml_newname.m

## n = vrml_newname (root)      - A name for a vrml node, starting by root
## 
## vrml_newname ("-clear")
function n = vrml_newname (root)

static vrml_namespace = struct();

if nargin < 1, root = ""; end

if strcmp (root, "-clear"),
  vrml_namespace = struct ();
  return
end
if isempty (root), root = "N"; end

n = sprintf ([root,"%0d"],100000*rand());
while struct_contains (vrml_namespace, n)
  n = sprintf ([root,"%0d"],100000*rand());
end
endfunction


Generated by  Doxygen 1.6.0   Back to index