// Filename: cullBin.I
// Created by:  drose (28Feb02)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001 - 2004, Disney Enterprises, Inc.  All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license.  You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://etc.cmu.edu/panda3d/docs/license/ .
//
// To contact the maintainers of this program write to
// panda3d-general@lists.sourceforge.net .
//
////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////
//     Function: CullBin::Copy Constructor
//       Access: Protected
//  Description: 
////////////////////////////////////////////////////////////////////
INLINE CullBin::
CullBin(const CullBin &copy) : 
  _name(copy._name),
  _bin_type(copy._bin_type),
  _gsg(copy._gsg),
  _cull_this_pcollector(copy._cull_this_pcollector),
  _draw_this_pcollector(copy._draw_this_pcollector)
{
  check_flash_color();
}

////////////////////////////////////////////////////////////////////
//     Function: CullBin::Constructor
//       Access: Public
//  Description: 
////////////////////////////////////////////////////////////////////
INLINE CullBin::
CullBin(const string &name, CullBin::BinType bin_type,
        GraphicsStateGuardianBase *gsg,
        const PStatCollector &draw_region_pcollector) :
  _name(name),
  _bin_type(bin_type),
  _gsg(gsg),
  _cull_this_pcollector(_cull_bin_pcollector, name),
  _draw_this_pcollector(draw_region_pcollector, name)
{
  check_flash_color();
}

////////////////////////////////////////////////////////////////////
//     Function: CullBin::get_name
//       Access: Public
//  Description: 
////////////////////////////////////////////////////////////////////
INLINE const string &CullBin::
get_name() const {
  return _name;
}

////////////////////////////////////////////////////////////////////
//     Function: CullBin::get_bin_tyep
//       Access: Public
//  Description: 
////////////////////////////////////////////////////////////////////
INLINE CullBin::BinType CullBin::
get_bin_type() const {
  return _bin_type;
}

////////////////////////////////////////////////////////////////////
//     Function: CullBin::has_flash_color
//       Access: Public
//  Description: Returns true if this bin has a flash color configured
//               via the flash-bin-binname config directive, or false
//               otherwise.
////////////////////////////////////////////////////////////////////
INLINE bool CullBin::
has_flash_color() const {
  return _has_flash_color;
}

////////////////////////////////////////////////////////////////////
//     Function: CullBin::get_flash_color
//       Access: Public
//  Description: If has_flash_color returns true, this returns the
//               color specified.
////////////////////////////////////////////////////////////////////
INLINE const Colorf &CullBin::
get_flash_color() const {
  return _flash_color;
}
