/*
    C++ Mesh Generation Library
    Copyright (c) 2000echet <eric at bechet dot ca>

    This file is part of the C++ Mesh Generation Library.

    See the NOTICE & LICENSE files for conditions.
*/
#include "mesh_search.h"

void tr3d::getBox ( double &XminBox,double &XmaxBox,double &YminBox,double &YmaxBox,double &ZminBox,double &ZmaxBox )
{
  XminBox=coord[0][0];
  YminBox=coord[0][1];
  ZminBox=coord[0][2];

  XmaxBox=coord[0][0];
  YmaxBox=coord[0][1];
  ZmaxBox=coord[0][2];

  for ( int i=1; i<3; ++i )
  {
    if ( XminBox>coord[i][0] )
    {
      XminBox=coord[i][0];
    }

    if ( YminBox>coord[i][1] )
    {
      YminBox=coord[i][1];
    }

    if ( ZminBox>coord[i][2] )
    {
      ZminBox=coord[i][2];
    }

    if ( XmaxBox<coord[i][0] )
    {
      XmaxBox=coord[i][0];
    }

    if ( YmaxBox<coord[i][1] )
    {
      YmaxBox=coord[i][1];
    }

    if ( ZmaxBox<coord[i][2] )
    {
      ZmaxBox=coord[i][2];
    }
  }
}

int tr3d::get_index()
{
  return index;
}


//constructeur prenant en parametre les coordonnees des points et l'index de l'element correspondant
tr3d::tr3d ( double valeursParam[3][3],int ndx )
{
  for ( unsigned int i = 0; i < 3; ++i )
    for ( unsigned int j = 0; j < 3; ++j )
    {
      coord[i][j] = valeursParam[i][j];
    }

  index=ndx;
}

 
