/* $Id: feplot2.h,v 1.2 1996/11/05 12:20:33 roitzsch Exp $ */

#ifndef FEPLOT2_H
#define FEPLOT2_H

#include "feplot.h"

class EDG2;
class PT2;
class TR2;
class MESH2;

//-------------------------------------------------------------------------


class FEPlotMESH2 : public FEPlot
{ 

 public:

  FEPlotMESH2(MESH* t, int plotType=SCREEN, char* caption=0, float size=0.5);
  virtual ~FEPlotMESH2() { }

  virtual void updateMesh(MESH* t);

  virtual void plotBoundary();
  virtual void plotElements();

  virtual void plotSolution(Vector<Real>& x);
  virtual void plot3D(Vector<Real>& x);

  virtual void plotPointNodes();
  virtual void plotEdgeNodes();
  virtual void plotTriangleNodes();

  void plotEdge(EDG2* ed, int type= -999);
  void setMinMax();


 protected:

  MESH2* mesh;	
  Vector<Real> levelsAt;

  Real xMin, xMax, yMin, yMax, xSelMin, xSelMax, ySelMin, ySelMax;
  Real plotSize;

  int  triFineCol, backCol, triCoarseCol, levelCol, noOfLevels,
  	dirichletCol, neumannCol, cauchyCol;
  int  percentage;

			   // 2D plots:

  void compLineLevels(Vector<Real>& x);
  void plotContourLine(Real xh, EDG2 *ed1, EDG2 *ed2, Vector<Real>& x);
  void plotSolTriangle(TR2 *t, Vector<Real>& x);


  			   // 3D plot:

  void VTr_bCube();
  void ViewTransPoint(PT2 *p, Real z, Real& rTrx, Real& rTry, Real& rTrz);
  void Dr_bCube(int background);
  void TesT(TR2 *t, Vector<Real>& rTrx, Vector<Real>& rTry);
  void SortTri(TR2 *t, Real currFarZ);
  void QuartSort(TR2 *t,Real p1x,Real p1y,Real p1z,Real p2x,Real p2y,
		 Real p2z,Real p3x,Real p3y,Real p3z,Real jac);
  void Dr3D(TR2 *t, Vector<Real>& rTrx, Vector<Real>& rTry);
  void DivEtSort(TR2 *t, Vector<Real>& rTrx, Vector<Real>& rTry,
		 Vector<Real>& rTrz );
};

#endif
