All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jmol.adapter.readers.pymol.PyMOLGroup Maven / Gradle / Ivy

There is a newer version: 14.31.10
Show newest version
package org.jmol.adapter.readers.pymol;

import java.util.Hashtable;
import java.util.Map;

import org.jmol.java.BS;

import javajs.util.Lst;

class PyMOLGroup {
  String name;
  String objectNameID;
  Map list = new Hashtable();
  Lst object;
  boolean visible = true;
  boolean occluded = false;
  BS bsAtoms = new BS();
  int firstAtom;
  int type;

  PyMOLGroup parent;
  
  PyMOLGroup(String name) {
    this.name = name;
  }

  void addList(PyMOLGroup child) {
    PyMOLGroup group = list.get(child.name);
    if (group != null)
      return;
    list.put(child.name, child);
    child.parent = this;
  }
  
  void set() {
    if (parent != null)
      return;    
  }
  
  void addGroupAtoms(BS bs) {
    bsAtoms.or(bs);
    if (parent != null)
      parent.addGroupAtoms(bsAtoms);
  }

  @Override
  public String toString() {
    return this.name;
  }

}