visualization fixes

This commit is contained in:
Joachim Schoeberl 2009-08-05 14:20:30 +00:00
parent 20cfea7f30
commit 1420b8dc9e
7 changed files with 252 additions and 501 deletions

View File

@ -267,6 +267,7 @@ namespace netgen
void CalcPartition (double l, double h, double h1, double h2, void CalcPartition (double l, double h, double h1, double h2,
double hcurve, double elto0, Array<double> & points) double hcurve, double elto0, Array<double> & points)
{ {
cout << "calcpart, h = " << h << ", h1 = " << h1 << ", h2 = " << h2 << ", hcurve = " << hcurve << endl;
int i, j, n, nel; int i, j, n, nel;
double sum, t, dt, fun, fperel, oldf, f; double sum, t, dt, fun, fperel, oldf, f;

View File

@ -876,6 +876,7 @@ void SplineGeometry<D> :: LoadData ( ifstream & infile )
geompoints.Append (GeomPoint<D>(x, hd)); geompoints.Append (GeomPoint<D>(x, hd));
geompoints.Last().hpref = flags.GetDefineFlag ("hpref"); geompoints.Last().hpref = flags.GetDefineFlag ("hpref");
geompoints.Last().hmax = 1e99;
} }
PrintMessage (3, nump, " points loaded"); PrintMessage (3, nump, " points loaded");
@ -935,6 +936,7 @@ void SplineGeometry<D> :: LoadData ( ifstream & infile )
infile >> spline->reffak; infile >> spline->reffak;
spline -> leftdom = leftdom; spline -> leftdom = leftdom;
spline -> rightdom = rightdom; spline -> rightdom = rightdom;
spline -> hmax = 1e99;
splines.Append (spline); splines.Append (spline);

View File

@ -1180,6 +1180,8 @@ namespace netgen
bool CurvedElements :: IsSurfaceElementCurved (SurfaceElementIndex elnr) const bool CurvedElements :: IsSurfaceElementCurved (SurfaceElementIndex elnr) const
{ {
if (!IsHighOrder()) return false;
if (mesh.coarsemesh) if (mesh.coarsemesh)
{ {
const HPRefElement & hpref_el = const HPRefElement & hpref_el =

View File

@ -490,8 +490,12 @@ public:
// by JS, only for 2D meshes ???? // by JS, only for 2D meshes ????
int GetPartition () const { return partitionNumber; } int GetPartition () const { return partitionNumber; }
void SetPartition (int nr) { partitionNumber = nr; }; void SetPartition (int nr) { partitionNumber = nr; };
#else
bool IsGhost () const { return false; }
#endif #endif
}; };
@ -756,6 +760,8 @@ public:
bool IsGhost () const { return isghost; } bool IsGhost () const { return isghost; }
void SetGhost ( const bool aisghost ) { isghost = aisghost; } void SetGhost ( const bool aisghost ) { isghost = aisghost; }
#else
bool IsGhost () const { return false; }
#endif #endif
friend class Mesh; friend class Mesh;

View File

@ -184,7 +184,6 @@ namespace netgen
void FieldLineCalc :: GenerateFieldLines(Array<Point3d> & potential_startpoints, const int numlines, const int gllist, void FieldLineCalc :: GenerateFieldLines(Array<Point3d> & potential_startpoints, const int numlines, const int gllist,
const double minval, const double maxval, const int logscale, double phaser, double phasei) const double minval, const double maxval, const int logscale, double phaser, double phasei)
{ {
glNewList(gllist, GL_COMPILE);
Array<Point3d> points; Array<Point3d> points;
@ -232,6 +231,9 @@ namespace netgen
cout << endl; cout << endl;
for(int i=0; i<potential_startpoints.Size(); i++) for(int i=0; i<potential_startpoints.Size(); i++)
{ {
cout << "\rFieldline Calculation " << int(100.*i/potential_startpoints.Size()) << "%"; cout.flush(); cout << "\rFieldline Calculation " << int(100.*i/potential_startpoints.Size()) << "%"; cout.flush();
@ -253,19 +255,19 @@ namespace netgen
usable = true; usable = true;
// vss.SetOpenGlColor (0.5*(values[k]+values[k+1]), minval, maxval, logscale); // vss.SetOpenGlColor (0.5*(values[k]+values[k+1]), minval, maxval, logscale);
/*
if (vss.usetexture == 1) if (vss.usetexture == 1)
glTexCoord1f ( 0.5*(values[k]+values[k+1]) ); glTexCoord1f ( 0.5*(values[k]+values[k+1]) );
else else
vss.SetOpenGlColor (0.5*(values[k]+values[k+1]) ); */
vss.SetOpenGlColor (0.5*(values[k]+values[k+1]) );
vss.DrawCylinder (points[k], points[k+1], thickness); vss.DrawCylinder (points[k], points[k+1], thickness);
} }
if(usable) calculated++; if(usable) calculated++;
} }
cout << "\rFieldline Calculation " << 100 << "%" << endl; cout << "\rFieldline Calculation " << 100 << "%" << endl;
glEndList ();
} }
@ -707,9 +709,14 @@ namespace netgen
double phaser = cos(phi), phasei = sin(phi); double phaser = cos(phi), phasei = sin(phi);
glNewList(fieldlineslist+ln, GL_COMPILE);
SetTextureMode (usetexture);
linecalc.GenerateFieldLines(startpoints,num_fieldlines / num_fieldlineslists+1, linecalc.GenerateFieldLines(startpoints,num_fieldlines / num_fieldlineslists+1,
fieldlineslist+ln,minval,maxval,logscale,phaser,phasei); fieldlineslist+ln,minval,maxval,logscale,phaser,phasei);
glEndList ();
} }
} }

File diff suppressed because it is too large Load Diff

View File

@ -47,7 +47,7 @@ class VisualSceneSolution : public VisualScene
int isolinelist; int isolinelist;
int clipplane_isolinelist; int clipplane_isolinelist;
int surface_vector_list; int surface_vector_list;
int cone_list; // int cone_list;
int isosurface_list; int isosurface_list;
int pointcurvelist; int pointcurvelist;
@ -299,10 +299,13 @@ public:
const Array<ClipPlaneTrig> & trigs, const Array<ClipPlaneTrig> & trigs,
const Array<ClipPlanePoint> & points); const Array<ClipPlanePoint> & points);
void SetOpenGlColor(double val, double valmin, double valmax, int logscale = 0); // void SetOpenGlColor(double val, double valmin, double valmax, int logscale = 0);
void SetOpenGlColor(double val); void SetOpenGlColor(double val);
// 0 .. non, 1 .. scalar, 2 .. complex
void SetTextureMode (int texturemode) const;
#ifndef SMALLLIB #ifndef SMALLLIB
#ifndef NOTCL #ifndef NOTCL