// This may look like C code, but it is really -*- C++ -*-
// Module PI : Peida Interactive     PICMapView
// Visualisation de table de couleur     R. Ansari  07/98
// LAL (Orsay) / IN2P3-CNRS  DAPNIA/SPP (Saclay) / CEA

#ifndef PICMAPVIEW_H_SEEN
#define PICMAPVIEW_H_SEEN

#include "pisysdep.h"

#include PIBWDG_H
#include PICMAP_H

class PICMapView : public PIBaseWdg
{
public:
  enum {ClassId = 5150};

                  PICMapView(PIContainerGen *par, char *nom,
                             int sx=256, int sy=10, int px=0, int py=0);
  virtual         ~PICMapView();

  virtual long	  kind() {return ClassId; }

  void            SetColMap(PIColorMap* cmp=NULL, double min=1., double max=-1., bool refr=true);
  void            SetColMapId(CMapId cmapid, bool revidx, double min, double max, bool refr);
  inline void     SetColMapId(CMapId cmapid, double min=1., double max=-1., bool refr=true)
                  { SetColMapId(cmapid, false, min, max, refr); }

// Traitement des evenements   

  virtual void   Draw(PIGraphic* g, int x0, int y0, int dx, int dy);


protected:
  PIColorMap* cmap;
  double vmin, vmax;
};


#endif 
