package com.srbenoit.modeling.mesh;

import com.srbenoit.render.WorldFace;

/**
 * A face that is part of a membrane.
 */
public class MembraneFace extends WorldFace {

    /** a unique ID for the membrane this face belongs to */
    private final int membraneId;

    /**
     * Constructs a new <code>MembraneFace</code>.
     *
     * @param  vert0          the first vertex in the face
     * @param  vert1          the second vertex in the face
     * @param  vert2          the third vertex in the face
     * @param  whichMembrane  the unique ID of the membrane this face belongs to
     */
    public MembraneFace(final MembraneVertex vert0, final MembraneVertex vert1,
        final MembraneVertex vert2, final int whichMembrane) {

        super(vert0, vert1, vert2);
        this.membraneId = whichMembrane;

        vert0.addFace(this, 0);
        vert1.addFace(this, 1);
        vert2.addFace(this, 2);
    }

    /**
     * Gets the unique ID of the membrane this face belongs to.
     *
     * @return  the membrane ID
     */
    public int getMembraneId() {

        return this.membraneId;
    }
}
