// ****************************************************************************
//
//  $Id: cisValueSegment3D.h,v 1.1.1.1 2001/09/27 20:12:22 anton Exp $
//
//  Description:
//
//  Usage:
//
//  See Also:
//
//  Author(s):	Ofri Sadowsky
//  Created on: 2003-04-01
//
//
//              Developed by the Engineering Research Center for
//          Computer-Integrated Surgical Systems & Technology (CISST)
//
//               Copyright(c) 2001, The Johns Hopkins University
//                          All Rights Reserved.
//
//  Experimental Software - Not certified for clinical use.
//  For use only by CISST sponsored research projects.  For use outside of
//  CISST, please contact Dr. Russell Taylor, CISST Director, at rht@cs.jhu.edu
//  or Dr. Gabor Fichtinger, CISST Engineering Director, at gabor@cs.jhu.edu.
//  
// ****************************************************************************

#ifndef _cisValueSegment3D_h
#define _cisValueSegment3D_h

#include "cisAbstractSegment3D.h"

// class cisValueSegment3D
// Provides a concrete implementation for the cisAbstractSegment3D by storing
// the vertices of the segment by value. This means that any instance
// of cisValueSegment3D contains its own copy of the vertex coordinates.
class cisEXPORT cisValueSegment3D : public cisAbstractSegment3D
{
public:
	typedef cisAbstractSegment3D::ParametrizationType ParametrizationType;
	typedef cisAbstractSegment3D::AngleType AngleType;
	typedef cisAbstractSegment3D::LocalPointType LocalPointType;
	typedef cisAbstractSegment3D::LocalDirectionType LocalDirectionType;
	typedef cisAbstractSegment3D::GlobalPointType GlobalPointType;
	typedef cisAbstractSegment3D::GlobalDirectionType GlobalDirectionType;

protected:
	LocalPointType Vertices[NUM_VERTICES];

public:
	cisValueSegment3D(const LocalPointType & p0, const LocalPointType & p1)
	  {
	    Vertices[0] = p0;
	    Vertices[1] = p1;
	  }

	virtual const LocalPointType & GetVertex(unsigned int index) const
	  {
	    assert( (index >= 0) && (index < GetNumVertices()) );
	    return Vertices[index];
	  }

	virtual const LocalPointType & GetVertex0() const
	  {
	    return Vertices[0];
	  }

	virtual const LocalPointType & GetVertex1() const
	  {
	    return Vertices[1];
	  }

	virtual ~cisValueSegment3D()
	  {}
};

#endif

