void Qt_cartesian_grid_summary::init( const Geostat_grid* grid ) {
  //TL modified
  const Cartesian_grid* cgrid = dynamic_cast<const Cartesian_grid*>( grid );
  if( !cgrid ) return;

  geostat_grid_ = cgrid;
  GsTLCoordVector cell_dims = cgrid->cell_dimensions();
  GsTLPoint origin = cgrid->origin();

  desc_widget_ = new QGroupBox( 1, Qt::Horizontal );
  QGroupBox* groupbox = (QGroupBox*) desc_widget_;
  groupbox->setInsideSpacing( 4 );

  QString count;
  QFont font;
  font.setBold(true);

  // number of cells
  QLabel* dimslabel;
  dimslabel = new QLabel( "Number of cells", groupbox );
  dimslabel->setFont( font );
  count.setNum( cgrid->nx() );
  new QLabel( QString("X: ")+count, groupbox );
  count.setNum( cgrid->ny() );
  new QLabel( QString("Y: ")+count, groupbox );
  count.setNum( cgrid->nz() );
  new QLabel( QString("Z: ")+count, groupbox );

  QLabel * num;
  

  // cell dimensions
  groupbox->addSpace( 8 );
  QLabel* sizelabel = new QLabel( "Cells dimensions", groupbox );
  sizelabel->setFont( font );
  count.setNum( cell_dims.x() );
  new QLabel( QString("X: ")+count, groupbox );
  count.setNum( cell_dims.y() );
  new QLabel( QString("Y: ")+count, groupbox );
  count.setNum( cell_dims.z() );
  new QLabel( QString("Z: ")+count, groupbox );

  // Origin
  groupbox->addSpace( 8 );
  QLabel* originlabel = new QLabel( "Origin (center of origin cell)", groupbox );
  originlabel->setFont( font );
  count.setNum( origin.x() );
  new QLabel( QString("X: ")+count, groupbox );
  count.setNum( origin.y() );
  new QLabel( QString("Y: ")+count, groupbox );
  count.setNum( origin.z() );
  new QLabel( QString("Z: ")+count, groupbox );

}; 
void Qt_pointset_summary::init( const Geostat_grid* grid ) {
  const Point_set* pset = dynamic_cast<const Point_set*>( grid );
  if( !pset ) return;

  geostat_grid_ = pset;
  int points_count = pset->size();
  QString count;
  count.setNum( points_count );
 
  desc_widget_ = new QGroupBox( 1, Qt::Horizontal );
  QGroupBox* groupbox = (QGroupBox*) desc_widget_;
  groupbox->setInsideSpacing( 4 );

  new QLabel( QString("# of points: ")+count, groupbox );


  GsTLPoint min, max;
  bounding_box( min, max, pset );

  QFont font;
  font.setBold(true);

  groupbox->addSpace( 8 );
  QLabel* bboxlabel = new QLabel( "Bounding Box", groupbox );
  bboxlabel->setFont( font );
  std::ostringstream minlabel;

  minlabel << "Min: ( " << min.x() << " , " << min.y() << " , " << min.z() << " )";
  new QLabel( QString( minlabel.str() ), groupbox );

  std::ostringstream maxlabel;
  maxlabel << "Max: ( " << max.x() << " , " << max.y() << " , " << max.z() << " )";
  new QLabel( QString( maxlabel.str() ), groupbox );

}
void Qt_masked_grid_summary::init( const Geostat_grid* grid ) {
  //TL modified
  const Reduced_grid * rgrid = dynamic_cast<const Reduced_grid*>(grid);
  if( !rgrid ) return;

  //geostat_grid_ = cgrid;
  GsTLCoordVector cell_dims = rgrid->cell_dimensions();
  GsTLPoint origin = rgrid->origin();

  desc_widget_ = new QGroupBox( 1, Qt::Horizontal );
  QGroupBox* groupbox = (QGroupBox*) desc_widget_;
  groupbox->setInsideSpacing( 4 );

  QString count;
  QFont font;
  font.setBold(true);


  QLabel * title;
  title = new QLabel(QString("Grid with inactive cells"),groupbox);
  title->setFont(font);


  // number of cells
  QLabel* dimslabel;
  dimslabel = new QLabel ("Bounding box", groupbox);
  dimslabel->setFont( font );
  count.setNum( rgrid->nx() );
  new QLabel( QString("X: ")+count, groupbox );
  count.setNum( rgrid->ny() );
  new QLabel( QString("Y: ")+count, groupbox );
  count.setNum( rgrid->nz() );
  new QLabel( QString("Z: ")+count, groupbox );

  //TL modified
  QLabel * num;
  num = new QLabel(QString("# of active cells: ")+count.setNum(rgrid->numActive()), groupbox);
  num->setFont(font);


  // cell dimensions
  groupbox->addSpace( 8 );
  QLabel* sizelabel = new QLabel( "Cells dimensions", groupbox );
  sizelabel->setFont( font );
  count.setNum( cell_dims.x() );
  new QLabel( QString("X: ")+count, groupbox );
  count.setNum( cell_dims.y() );
  new QLabel( QString("Y: ")+count, groupbox );
  count.setNum( cell_dims.z() );
  new QLabel( QString("Z: ")+count, groupbox );

  // Origin
  groupbox->addSpace( 8 );
  QLabel* originlabel = new QLabel( "Origin (center of origin cell)", groupbox );
  originlabel->setFont( font );
  count.setNum( origin.x() );
  new QLabel( QString("X: ")+count, groupbox );
  count.setNum( origin.y() );
  new QLabel( QString("Y: ")+count, groupbox );
  count.setNum( origin.z() );
  new QLabel( QString("Z: ")+count, groupbox );

}