// -*- Mode: C++; tab-width: 2; -*-
// vi: set ts=2:
//
// $Id: vertex2.iC,v 1.3 2003/11/24 23:49:15 amoll Exp $

BALL_INLINE
void Vertex2::setVertex1(const Vector3& v)
{
  *vertex1_ptr_ = v;
}

BALL_INLINE
void Vertex2::setVertex1
  (const float x, const float y, const float z)
{
  vertex1_ptr_->set(x, y, z);
}

BALL_INLINE
Vector3& Vertex2::getVertex1()
{
  return *vertex1_ptr_;
}

BALL_INLINE
const Vector3& Vertex2::getVertex1() const
{
  return *vertex1_ptr_;
}

BALL_INLINE
void Vertex2::getVertex1(Vector3& v) const
{
  v = *vertex1_ptr_;
}

BALL_INLINE
void Vertex2::getVertex1
  (float& x, float& y, float& z) const
{
  vertex1_ptr_->get(x, y, z);
}

BALL_INLINE
void Vertex2::setVertex1Address(const Vector3& v)
{
  vertex1_ptr_ = (Vector3 *)&v;
}

BALL_INLINE
void Vertex2::setDefaultVertex1Address()
{
  vertex1_ptr_ =  (Vector3 *)&vertex1_;
}

BALL_INLINE
Vector3* Vertex2::getVertex1Address() const
{
  return vertex1_ptr_;
}

BALL_INLINE
void Vertex2::setVertex2(const Vector3& v)
{
  *vertex2_ptr_ = v;
}

BALL_INLINE
void Vertex2::setVertex2
  (const float x, const float y, const float z)
{
  vertex2_ptr_->set(x, y, z);
}

BALL_INLINE
Vector3& Vertex2::getVertex2()
{
  return *vertex2_ptr_;
}

BALL_INLINE
const Vector3& 
Vertex2::getVertex2() const
{
  return *vertex2_ptr_;
}

BALL_INLINE
void Vertex2::getVertex2(Vector3& v) const
{
  v = *vertex2_ptr_;
}

BALL_INLINE
void Vertex2::getVertex2
  (float &x, float &y, float &z) const
{
  vertex2_ptr_->get(x, y, z);
}

BALL_INLINE
void Vertex2::setVertex2Address(const Vector3& v)
{
  vertex2_ptr_ = (Vector3 *)&v;
}

BALL_INLINE
void Vertex2::setDefaultVertex2Address()
{
  vertex2_ptr_ = (Vector3 *)&vertex2_;
}

BALL_INLINE
Vector3* Vertex2::getVertex2Address() const
{
  return vertex2_ptr_;
}

BALL_INLINE
void Vertex2::setVertices
  (const Vector3& vertex1,
   const Vector3& vertex2)
{
  vertex1_ptr_->set(vertex1);
  vertex2_ptr_->set(vertex2);
}

BALL_INLINE
void Vertex2::setVertices
  (const float vertex1_x,
   const float vertex1_y,
   const float vertex1_z,
   const float vertex2_x,
   const float vertex2_y,
   const float vertex2_z)
{
  vertex1_ptr_->set(vertex1_x, vertex1_y, vertex1_z);
  vertex2_ptr_->set(vertex2_x, vertex2_y, vertex2_z);
}

BALL_INLINE
void Vertex2::setVertexAddresses
  (const Vector3& vertex1, const Vector3& vertex2)
{
  vertex1_ptr_ = (Vector3*)&vertex1;
  vertex2_ptr_ = (Vector3*)&vertex2;
}

BALL_INLINE
void Vertex2::getVertices
  (Vector3& vertex1, Vector3& vertex2)
{
  vertex1 = *vertex1_ptr_;
  vertex2 = *vertex2_ptr_;
}

BALL_INLINE
void Vertex2::getVertices
  (float& vertex1_x,
   float& vertex1_y,
   float& vertex1_z,
   float& vertex2_x,
   float& vertex2_y,
   float& vertex2_z)
{
  vertex1_ptr_->get(vertex1_x, vertex1_y, vertex1_z);
  vertex2_ptr_->get(vertex2_x, vertex2_y, vertex2_z);
}

BALL_INLINE
void Vertex2::setDefaultVertexAddresses()
{
  vertex1_ptr_ = (Vector3*)&vertex1_;
  vertex2_ptr_ = (Vector3*)&vertex2_;
}

BALL_INLINE
bool Vertex2::isDefaultVertex1Address() const
{
  return (vertex1_ptr_ == (Vector3*)&vertex1_);
}

BALL_INLINE
bool Vertex2::isDefaultVertex2Address() const
{
  return (vertex2_ptr_ == (Vector3 *)&vertex2_);
}

BALL_INLINE
bool Vertex2::isDefaultVertexAddresses() const
{
  return (vertex1_ptr_ == (Vector3*)&vertex1_ &&
				  vertex2_ptr_ == (Vector3*)&vertex2_);
}
