netgen/libsrc/visualization/mvdraw.hpp

335 lines
6.6 KiB
C++
Raw Normal View History

2009-01-13 04:40:13 +05:00
#ifndef FILE_MVDRAW
#define FILE_MVDRAW
2009-07-20 14:36:36 +06:00
namespace netgen
{
2009-01-13 04:40:13 +05:00
2009-07-20 14:36:36 +06:00
extern void InitDrawMesh ();
extern void DrawMesh ();
extern void MouseMove(int oldx, int oldy,
int newx, int newy,
char mode);
2009-01-13 04:40:13 +05:00
2009-07-20 14:36:36 +06:00
extern void Render ();
2009-01-13 04:40:13 +05:00
2009-09-07 21:15:22 +06:00
2009-07-20 14:36:36 +06:00
class VisualScene
{
protected:
static Point3d center;
static double rad;
2009-01-13 04:40:13 +05:00
2009-07-20 14:36:36 +06:00
static float lookatmat[16];
static float transmat[16];
static float rotmat[16];
static float centermat[16];
static float transformationmat[16];
2009-01-13 04:40:13 +05:00
2009-07-20 14:36:36 +06:00
GLdouble clipplane[4];
2009-01-13 04:40:13 +05:00
2009-07-20 14:36:36 +06:00
int changeval;
static GLdouble backcolor;
2009-01-13 04:40:13 +05:00
2009-07-20 14:36:36 +06:00
static int selface;
static int selelement;
static int selpoint;
static int selpoint2;
static int locpi;
static int seledge;
2009-01-13 04:40:13 +05:00
2009-07-20 14:36:36 +06:00
static int selecttimestamp;
2009-01-13 04:40:13 +05:00
2009-07-20 14:36:36 +06:00
public:
2009-01-13 04:40:13 +05:00
2009-07-20 14:36:36 +06:00
// static GLubyte * colortexture;
static GLuint coltexname;
static int ntexcols;
// static bool linear_colors;
int invcolor;
2009-01-13 04:40:13 +05:00
2009-07-20 14:36:36 +06:00
public:
VisualScene ();
virtual ~VisualScene();
2009-01-13 04:40:13 +05:00
2009-07-20 14:36:36 +06:00
virtual void BuildScene (int zoomall = 0);
virtual void DrawScene ();
2009-01-13 04:40:13 +05:00
2009-07-20 14:36:36 +06:00
void CalcTransformationMatrices();
void StandardRotation (const char * dir);
void ArbitraryRotation (const Array<double> & alpha, const Array<Vec3d> & vec);
void ArbitraryRotation (const double alpha, const Vec3d & vec);
2009-01-13 04:40:13 +05:00
2009-07-20 14:36:36 +06:00
void MouseMove(int oldx, int oldy,
int newx, int newy,
char mode);
2009-01-13 04:40:13 +05:00
2009-07-20 14:36:36 +06:00
void LookAt (const Point<3> & cam, const Point<3> & obj,
const Point<3> & camup);
2009-01-13 04:40:13 +05:00
2009-07-20 14:36:36 +06:00
void SetClippingPlane ();
2009-01-13 04:40:13 +05:00
2009-07-20 14:36:36 +06:00
virtual void MouseDblClick (int px, int py);
2009-01-13 04:40:13 +05:00
2009-07-20 14:36:36 +06:00
void SetLight ();
static void SetBackGroundColor (double col)
2009-01-13 04:40:13 +05:00
{ backcolor = col; }
2009-07-20 14:36:36 +06:00
void CreateTexture (int ncols, int linear, int typ = GL_DECAL);
void DrawColorBar (double minval, double maxval, int logscale = 0, bool linear = 1);
void DrawCoordinateCross ();
void DrawNetgenLogo ();
void SetOpenGlColor(double val, double valmin, double valmax, int logscale = 0);
2009-01-13 04:40:13 +05:00
#ifdef PARALLELGL
2009-07-20 14:36:36 +06:00
void InitParallelGL ();
void Broadcast ();
2009-01-13 04:40:13 +05:00
#endif
2009-07-20 14:36:36 +06:00
};
2009-01-13 04:40:13 +05:00
2009-09-07 21:15:22 +06:00
extern void MyOpenGLText (const char * text);
2009-07-20 14:36:36 +06:00
class VisualSceneGeometry : public VisualScene
{
Array<int> trilists;
int selsurf;
public:
VisualSceneGeometry ();
virtual ~VisualSceneGeometry ();
2009-01-13 04:40:13 +05:00
2009-07-20 14:36:36 +06:00
virtual void SelectSurface (int aselsurf);
virtual void BuildScene (int zoomall = 0);
virtual void DrawScene ();
};
2009-01-13 04:40:13 +05:00
2009-07-20 14:36:36 +06:00
class VisualSceneSTLGeometry : public VisualScene
{
Array<int> trilists;
2009-01-13 04:40:13 +05:00
2009-07-20 14:36:36 +06:00
public:
VisualSceneSTLGeometry ();
virtual ~VisualSceneSTLGeometry ();
2009-01-13 04:40:13 +05:00
2009-07-20 14:36:36 +06:00
virtual void BuildScene (int zoomall = 0);
virtual void DrawScene ();
};
2009-01-13 04:40:13 +05:00
2009-07-20 14:36:36 +06:00
class VisualSceneGeometry2d : public VisualScene
{
public:
VisualSceneGeometry2d ();
virtual ~VisualSceneGeometry2d ();
2009-01-13 04:40:13 +05:00
2009-07-20 14:36:36 +06:00
virtual void BuildScene (int zoomall = 0);
virtual void DrawScene ();
};
2009-01-13 04:40:13 +05:00
#ifdef OCCGEOMETRY
2009-07-20 14:36:36 +06:00
class VisualSceneOCCGeometry : public VisualScene
{
Array<int> trilists;
Array<int> linelists;
int selsurf;
public:
VisualSceneOCCGeometry ();
virtual ~VisualSceneOCCGeometry ();
virtual void BuildScene (int zoomall = 0);
virtual void DrawScene ();
virtual void MouseDblClick (int px, int py);
};
2009-01-13 04:40:13 +05:00
#endif
#ifdef STEP
2009-07-20 14:36:36 +06:00
class VisualSceneSTEPGeometry : public VisualScene
{
Array<int> gllists;
2009-01-13 04:40:13 +05:00
2009-07-20 14:36:36 +06:00
public:
VisualSceneSTEPGeometry ();
virtual ~VisualSceneSTEPGeometry ();
2009-01-13 04:40:13 +05:00
2009-07-20 14:36:36 +06:00
virtual void BuildScene (int zoomall = 0);
virtual void DrawScene ();
};
2009-01-13 04:40:13 +05:00
#endif
2009-07-20 14:36:36 +06:00
class VisualSceneSTLMeshing : public VisualScene
{
Array<int> trilists;
int selecttrig, nodeofseltrig;
2009-01-13 04:40:13 +05:00
2009-07-20 14:36:36 +06:00
public:
VisualSceneSTLMeshing ();
virtual ~VisualSceneSTLMeshing ();
2009-01-13 04:40:13 +05:00
2009-07-20 14:36:36 +06:00
virtual void BuildScene (int zoomall = 0);
virtual void DrawScene ();
virtual void MouseDblClick (int px, int py);
2009-01-13 04:40:13 +05:00
2009-07-20 14:36:36 +06:00
int seltria;
};
2009-01-13 04:40:13 +05:00
2009-07-20 14:36:36 +06:00
class VisualSceneSurfaceMeshing : public VisualScene
{
public:
VisualSceneSurfaceMeshing ();
virtual ~VisualSceneSurfaceMeshing ();
2009-01-13 04:40:13 +05:00
2009-07-20 14:36:36 +06:00
virtual void BuildScene (int zoomall = 0);
virtual void DrawScene ();
};
2009-01-13 04:40:13 +05:00
2009-07-20 14:36:36 +06:00
class VisualSceneMesh : public VisualScene
{
int filledlist;
int linelist;
int edgelist;
int pointnumberlist;
2009-01-13 04:40:13 +05:00
2009-07-20 14:36:36 +06:00
int tetlist;
int prismlist;
int pyramidlist;
int hexlist;
2009-01-13 04:40:13 +05:00
2009-07-20 14:36:36 +06:00
int badellist;
int identifiedlist;
int domainsurflist;
2009-01-13 04:40:13 +05:00
2009-07-20 14:36:36 +06:00
int vstimestamp;//, selecttimestamp;
int filledtimestamp;
int linetimestamp;
int edgetimestamp;
int pointnumbertimestamp;
2009-01-13 04:40:13 +05:00
2009-07-20 14:36:36 +06:00
int tettimestamp;
int prismtimestamp;
int pyramidtimestamp;
int hextimestamp;
2009-01-13 04:40:13 +05:00
2009-07-20 14:36:36 +06:00
int badeltimestamp;
int identifiedtimestamp;
int domainsurftimestamp;
2009-01-13 04:40:13 +05:00
#ifdef PARALLELGL
2009-07-20 14:36:36 +06:00
Array<int> par_linelists;
Array<int> par_filledlists;
2009-01-13 04:40:13 +05:00
#endif
2009-07-20 14:36:36 +06:00
NgLock *lock;
2009-01-13 04:40:13 +05:00
2009-07-20 14:36:36 +06:00
// int selface, selelement;
// int selpoint, selpoint2, locpi;
// int seledge;
2009-01-13 04:40:13 +05:00
2009-07-20 14:36:36 +06:00
double minh, maxh; // for meshsize coloring
2009-01-13 04:40:13 +05:00
2009-07-20 14:36:36 +06:00
public:
VisualSceneMesh ();
virtual ~VisualSceneMesh ();
2009-01-13 04:40:13 +05:00
2009-07-20 14:36:36 +06:00
virtual void BuildScene (int zoomall = 0);
virtual void DrawScene ();
virtual void MouseDblClick (int px, int py);
2009-01-13 04:40:13 +05:00
2009-07-20 14:36:36 +06:00
int SelectedFace () const
2009-01-13 04:40:13 +05:00
{ return selface; }
2009-07-20 14:36:36 +06:00
void SetSelectedFace (int asf);
// { selface = asf; selecttimestamp = GetTimeStamp(); }
2009-01-13 04:40:13 +05:00
2009-07-20 14:36:36 +06:00
int SelectedEdge () const
2009-01-13 04:40:13 +05:00
{ return seledge; }
2009-07-20 14:36:36 +06:00
int SelectedElement () const
2009-01-13 04:40:13 +05:00
{ return selelement; }
2009-07-20 14:36:36 +06:00
int SelectedPoint () const
2009-01-13 04:40:13 +05:00
{ return selpoint; }
2009-07-20 14:36:36 +06:00
void BuildFilledList();
// private:
void BuildLineList();
void BuildEdgeList();
void BuildPointNumberList();
2009-01-13 04:40:13 +05:00
2009-07-20 14:36:36 +06:00
void BuildTetList();
void BuildPrismList();
void BuildPyramidList();
void BuildHexList();
2009-01-13 04:40:13 +05:00
2009-07-20 14:36:36 +06:00
void BuildBadelList();
void BuildIdentifiedList();
void BuildDomainSurfList();
};
2009-01-13 04:40:13 +05:00
2009-07-20 14:36:36 +06:00
class VisualSceneSpecPoints : public VisualScene
{
public:
VisualSceneSpecPoints ();
virtual ~VisualSceneSpecPoints ();
virtual void BuildScene (int zoomall = 0);
virtual void DrawScene ();
double len;
};
// extern struct Tcl_Interp * hinterp;
2009-01-13 04:40:13 +05:00
2009-07-20 14:36:36 +06:00
extern void AddVisualizationScene (const string & name,
VisualScene * vs);
2009-01-13 04:40:13 +05:00
2009-07-20 14:36:36 +06:00
void MouseDblClickSelect (const int px, const int py,
const GLdouble * clipplane, const GLdouble backcolor,
const float * transformationmat,
const Point3d & center,
const double rad,
const int displaylist,
int & selelement, int & selface, int & seledge, int & selpoint,
int & selpoint2, int & locpi);
2009-01-13 04:40:13 +05:00
2009-07-20 14:36:36 +06:00
}
2009-01-13 04:40:13 +05:00
#endif