<commit_before>/*=========================================================================

  Program:   Insight Segmentation & Registration Toolkit
  Module:    itkBoundingBox.h
  Language:  C++
  Date:      $Date$
  Version:   $Revision$


  Copyright (c) 2000 National Library of Medicine
  All rights reserved.

  See COPYRIGHT.txt for copyright details.

=========================================================================*/
#ifndef __itkBoundingBox_h
#define __itkBoundingBox_h

#include "itkObject.h"
#include "itkPoint.h"
#include "itkNumericTraits.h"
#include "itkVectorContainer.h"

namespace itk
{

/** \class BoundingBox
 * \brief Represent and compute information about bounding boxes.
 *
 * BoundingBox is a supporting class that represents, computes, and
 * caches information about bounding boxes. The bounding box can
 * be computed from several sources, including manual specification
 * and computation from an input points container.
 *
 * This is a templated, n-dimensional version of the bounding box.
 * Bounding boxes are represented by n pairs of (min,max) pairs,
 * where min is the minimum coordinate value and max is the
 * maximum coordinate value for coordinate axis i.
 *
 * Template parameters for BoundingBox:
 *
 * TPointIdentifier =
 *     The type used to access a particular point (i.e., a point's id)
 *
 * TCoordRep =
 *     Numerical type with which to represent each coordinate value.
 *
 * VPointDimension =
 *    Geometric dimension of space.
 */
  
template <
  typename TPointIdentifier = unsigned long,
  int VPointDimension = 3,
  typename TCoordRep = float,
  typename TPointsContainer = 
    VectorContainer< TPointIdentifier,Point<VPointDimension,TCoordRep> >
  >
class ITK_EXPORT BoundingBox : public Object
{
public:
  /**
   * Standard "Self" typedef.
   */
  typedef BoundingBox         Self;
  
  /**
   * Standard "Superclass" typedef.
   */
  typedef Object  Superclass;

  /**
   * Smart pointer typedef support.
   */
  typedef SmartPointer<Self>  Pointer;
  typedef SmartPointer<const Self>  ConstPointer;
  
  /**
   * Method for creation through the object factory.
   */
  itkNewMacro(Self);

  //@{
  /**
   * Hold on to the type information specified by the template parameters.
   */
  typedef TPointIdentifier PointIdentifier;
  typedef TCoordRep CoordRepType;
  enum { PointDimension = VPointDimension };
  typedef TPointsContainer PointsContainer;
  typedef typename PointsContainer::Pointer PointsContainerPointer;
  typedef Point< PointDimension , CoordRepType >  PointType;
  //@}

  //@{
  /**
   * Convenient typedefs.
   */
  typedef typename
          PointsContainer::ConstIterator        PointsContainerConstIterator;
  typedef typename
          PointsContainer::Iterator             PointsContainerIterator;
  //@}
  
  /**
   * Set the points from which the bounding box should be computed. The 
   * bounding box is cached and is not recomputed if the points are not 
   * changed.
   */
  void SetPoints(PointsContainer *);
  PointsContainerPointer GetPoints(void);

  /**
   * Method that actually computes bounding box.
   */
  bool ComputeBoundingBox(void);

  /**
   * Get the bounding box. NULL is returned if the bounding box cannot be<commit_msg>ENH: Order of itkPoint template parameters reversed<commit_after>/*=========================================================================

  Program:   Insight Segmentation & Registration Toolkit
  Module:    itkBoundingBox.h
  Language:  C++
  Date:      $Date$
  Version:   $Revision$


  Copyright (c) 2000 National Library of Medicine
  All rights reserved.

  See COPYRIGHT.txt for copyright details.

=========================================================================*/
#ifndef __itkBoundingBox_h
#define __itkBoundingBox_h

#include "itkObject.h"
#include "itkPoint.h"
#include "itkNumericTraits.h"
#include "itkVectorContainer.h"

namespace itk
{

/** \class BoundingBox
 * \brief Represent and compute information about bounding boxes.
 *
 * BoundingBox is a supporting class that represents, computes, and
 * caches information about bounding boxes. The bounding box can
 * be computed from several sources, including manual specification
 * and computation from an input points container.
 *
 * This is a templated, n-dimensional version of the bounding box.
 * Bounding boxes are represented by n pairs of (min,max) pairs,
 * where min is the minimum coordinate value and max is the
 * maximum coordinate value for coordinate axis i.
 *
 * Template parameters for BoundingBox:
 *
 * TPointIdentifier =
 *     The type used to access a particular point (i.e., a point's id)
 *
 * TCoordRep =
 *     Numerical type with which to represent each coordinate value.
 *
 * VPointDimension =
 *    Geometric dimension of space.
 */
  
template <
  typename TPointIdentifier = unsigned long,
  int VPointDimension = 3,
  typename TCoordRep = float,
  typename TPointsContainer = 
    VectorContainer< TPointIdentifier,Point<TCoordRep, VPointDimension> >
  >
class ITK_EXPORT BoundingBox : public Object
{
public:
  /**
   * Standard "Self" typedef.
   */
  typedef BoundingBox         Self;
  
  /**
   * Standard "Superclass" typedef.
   */
  typedef Object  Superclass;

  /**
   * Smart pointer typedef support.
   */
  typedef SmartPointer<Self>  Pointer;
  typedef SmartPointer<const Self>  ConstPointer;
  
  /**
   * Method for creation through the object factory.
   */
  itkNewMacro(Self);

  //@{
  /**
   * Hold on to the type information specified by the template parameters.
   */
  typedef TPointIdentifier PointIdentifier;
  typedef TCoordRep CoordRepType;
  enum { PointDimension = VPointDimension };
  typedef TPointsContainer PointsContainer;
  typedef typename PointsContainer::Pointer PointsContainerPointer;
  typedef Point< CoordRepType, VPointDimension >  PointType;
  //@}

  //@{
  /**
   * Convenient typedefs.
   */
  typedef typename
          PointsContainer::ConstIterator        PointsContainerConstIterator;
  typedef typename
          PointsContainer::Iterator             PointsContainerIterator;
  //@}
  
  /**
   * Set the points from which the bounding box should be computed. The 
   * bounding box is cached and is not recomputed if the points are not 
   * changed.
   */
  void SetPoints(PointsContainer *);
  PointsContainerPointer GetPoints(void);

  /**
   * Method that actually computes bounding box.
   */
  bool ComputeBoundingBox(void);

  /**
   * Get the bounding box. NULL is returned if the bounding box cannot be
{'fraction_non_alphanumeric': 0.11911697071899432, 'fraction_numerical': 0.0015330369461904031, 'mean_word_length': 3.5911330049261085, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1434983', 'n_tokens_mistral': 1803, 'n_tokens_neox': 1697, 'n_words': 610}