// Copyright 2004, FreeHEP.
package hep.graphics.heprep1.adapter;

import java.util.*;

import hep.graphics.heprep.HepRepAttValue;
import hep.graphics.heprep.HepRepInstance;
import hep.graphics.heprep.HepRepInstanceTree;
import hep.graphics.heprep.HepRepPoint;
import hep.graphics.heprep.HepRepSelectFilter;
import hep.graphics.heprep.HepRepType;
import hep.graphics.heprep.HepRepTypeTree;

/**
 *
 * @author Mark Donszelmann
 * @version $Id: HepRepInstanceFromPrimitiveAdapter.java,v 1.3 2004/07/27 21:40:27 duns Exp $
 */
public class HepRepInstanceFromPrimitiveAdapter extends AbstractHepRepInstanceAdapter {

    private hep.graphics.heprep1.HepRepPrimitive primitive1;
    private List points;

    public HepRepInstanceFromPrimitiveAdapter(hep.graphics.heprep1.HepRepInstance instance1,
                                              hep.graphics.heprep1.HepRepPrimitive primitive1,
                                              HepRepInstance parent,
                                              HepRepType type) {
        super(instance1, primitive1, parent, type);
        this.primitive1 = primitive1;
        points = new ArrayList();

        HepRepAdapterFactory factory = HepRepAdapterFactory.getFactory();        
        for (Enumeration e=primitive1.getPoints(); e.hasMoreElements(); ) {
            points.add(factory.createHepRepPoint((hep.graphics.heprep1.HepRepPoint)e.nextElement(), this));
        }
    }
        
    public List/*<HepRepPoint>*/ getPoints() {
        return points;
    }    

}
