mirror of
https://github.com/NGSolve/netgen.git
synced 2025-04-08 22:37:28 +05:00
removed some comments. formatting
This commit is contained in:
parent
d778d9dcef
commit
37e0e17919
@ -18,7 +18,6 @@ namespace netgen
|
|||||||
{
|
{
|
||||||
char buf[10000];
|
char buf[10000];
|
||||||
strcpy (buf, cmd);
|
strcpy (buf, cmd);
|
||||||
|
|
||||||
// MPI_Bcast (&buf, 100, MPI_CHAR, 0, MPI_COMM_WORLD);
|
// MPI_Bcast (&buf, 100, MPI_CHAR, 0, MPI_COMM_WORLD);
|
||||||
|
|
||||||
for (int dest = 1; dest < ntasks; dest++)
|
for (int dest = 1; dest < ntasks; dest++)
|
||||||
|
@ -21,7 +21,7 @@ puts "togl-version : $toglversion"
|
|||||||
set toglok 0
|
set toglok 0
|
||||||
if { [Ng_GetToglVersion] == 2 } {
|
if { [Ng_GetToglVersion] == 2 } {
|
||||||
# Togl 2.x
|
# Togl 2.x
|
||||||
if {[catch {togl .ndraw -width 400 -height 300 -rgba true -double true -depth true -privatecmap false -stereo false -indirect false -create init -display draw -reshape reshape }] } {
|
if {[catch {togl .ndraw -width 400 -height 300 -rgba true -double true -depth true -privatecmap false -stereo false -indirect true -create init -display draw -reshape reshape }] } {
|
||||||
puts "no OpenGL"
|
puts "no OpenGL"
|
||||||
} {
|
} {
|
||||||
# puts "have Togl 2.1"
|
# puts "have Togl 2.1"
|
||||||
@ -29,7 +29,7 @@ if { [Ng_GetToglVersion] == 2 } {
|
|||||||
}
|
}
|
||||||
} {
|
} {
|
||||||
# Togl 1.7
|
# Togl 1.7
|
||||||
if {[catch {togl .ndraw -width 400 -height 300 -rgba true -double true -depth true -privatecmap false -stereo false -indirect false }] } {
|
if {[catch {togl .ndraw -width 400 -height 300 -rgba true -double true -depth true -privatecmap false -stereo false -indirect true }] } {
|
||||||
puts "no OpenGL"
|
puts "no OpenGL"
|
||||||
} {
|
} {
|
||||||
# puts "have Togl 1.7"
|
# puts "have Togl 1.7"
|
||||||
|
@ -77,6 +77,7 @@ void ParallelRun()
|
|||||||
while ( true )
|
while ( true )
|
||||||
{
|
{
|
||||||
message = MyMPI_RecvCmd();
|
message = MyMPI_RecvCmd();
|
||||||
|
|
||||||
if ( message.compare(0, 3, "ngs") == 0 )
|
if ( message.compare(0, 3, "ngs") == 0 )
|
||||||
{
|
{
|
||||||
// PrintMessage ( 1, "Starting NgSolve routine ", message ) ;
|
// PrintMessage ( 1, "Starting NgSolve routine ", message ) ;
|
||||||
@ -137,7 +138,7 @@ void ParallelRun()
|
|||||||
string redraw_cmd;
|
string redraw_cmd;
|
||||||
// MyMPI_Recv (redraw_cmd, 0, MPI_TAG_VIS);
|
// MyMPI_Recv (redraw_cmd, 0, MPI_TAG_VIS);
|
||||||
redraw_cmd = MyMPI_RecvCmd();
|
redraw_cmd = MyMPI_RecvCmd();
|
||||||
|
|
||||||
// PrintMessage (1, "Redraw - ", redraw_cmd);
|
// PrintMessage (1, "Redraw - ", redraw_cmd);
|
||||||
|
|
||||||
static string displname;
|
static string displname;
|
||||||
@ -155,6 +156,7 @@ void ParallelRun()
|
|||||||
MyMPI_Recv (contextid, 0, MPI_TAG_VIS);
|
MyMPI_Recv (contextid, 0, MPI_TAG_VIS);
|
||||||
|
|
||||||
display = XOpenDisplay (displname.c_str());
|
display = XOpenDisplay (displname.c_str());
|
||||||
|
|
||||||
/*
|
/*
|
||||||
PrintMessage (3, "displ - name = ", displname);
|
PrintMessage (3, "displ - name = ", displname);
|
||||||
PrintMessage (3, "display = ", display,
|
PrintMessage (3, "display = ", display,
|
||||||
@ -163,20 +165,21 @@ void ParallelRun()
|
|||||||
" , h = ", XDisplayHeight (display, 0));
|
" , h = ", XDisplayHeight (display, 0));
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Window win;
|
/*
|
||||||
// int wx, wy;
|
Window win;
|
||||||
// unsigned int ww, wh, bw, depth;
|
int wx, wy;
|
||||||
// cout << "got drawable: " << curDrawable << ", contextid: " << contextid << endl;
|
unsigned int ww, wh, bw, depth;
|
||||||
|
cout << "got drawable: " << curDrawable << ", contextid: " << contextid << endl;
|
||||||
|
|
||||||
// cout << "get geometriy..." << endl;
|
cout << "get geometriy..." << endl;
|
||||||
// XGetGeometry(display, curDrawable, &win,
|
XGetGeometry(display, curDrawable, &win,
|
||||||
// &wx, &wy, &ww, &wh,
|
&wx, &wy, &ww, &wh,
|
||||||
// &bw, &depth);
|
&bw, &depth);
|
||||||
// cout << "have!" << endl;
|
cout << "have!" << endl;
|
||||||
|
|
||||||
// cout << "P" << id << ": window-props: x = " << wx << ", y = " << wy
|
|
||||||
// << ", w = " << ww << ", h = " << wh << ", depth = " << depth << endl;
|
|
||||||
|
|
||||||
|
cout << "P" << id << ": window-props: x = " << wx << ", y = " << wy
|
||||||
|
<< ", w = " << ww << ", h = " << wh << ", depth = " << depth << endl;
|
||||||
|
*/
|
||||||
|
|
||||||
#define VISUAL
|
#define VISUAL
|
||||||
#ifdef VISUAL
|
#ifdef VISUAL
|
||||||
@ -221,29 +224,23 @@ void ParallelRun()
|
|||||||
attrib_list[attrib_count++] = GLX_DOUBLEBUFFER;
|
attrib_list[attrib_count++] = GLX_DOUBLEBUFFER;
|
||||||
|
|
||||||
attrib_list[attrib_count++] = None;
|
attrib_list[attrib_count++] = None;
|
||||||
|
|
||||||
{
|
|
||||||
int hi = 0;
|
|
||||||
std::cout << "min attribs = ";
|
|
||||||
while (attrib_list[hi] != None)
|
|
||||||
std::cout << attrib_list[hi++] << " ";
|
|
||||||
std::cout << std::endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
cout << "choose visual!!" << endl;
|
|
||||||
visinfo = NULL;
|
|
||||||
visinfo = glXChooseVisual(display, 0,
|
visinfo = glXChooseVisual(display, 0,
|
||||||
attrib_list);
|
attrib_list);
|
||||||
cout << "have vis?" << endl;
|
cout << "have vis?" << endl;
|
||||||
|
|
||||||
if (visinfo) {
|
if (visinfo) {
|
||||||
/* found a GLX visual! */
|
/* found a GLX visual! */
|
||||||
|
// cout << "found VISINFO !!!" << endl;
|
||||||
cout << "found VISINFO !!!" << endl;
|
cout << "found VISINFO !!!" << endl;
|
||||||
|
|
||||||
|
/*
|
||||||
int hi = 0;
|
int hi = 0;
|
||||||
std::cout << "attribs = ";
|
std::cout << "attribs = ";
|
||||||
while (attrib_list[hi] != None)
|
while (attrib_list[hi] != None)
|
||||||
std::cout << attrib_list[hi++] << " ";
|
std::cout << attrib_list[hi++] << " ";
|
||||||
std::cout << std::endl;
|
std::cout << std::endl;
|
||||||
|
*/
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -251,17 +248,15 @@ void ParallelRun()
|
|||||||
if (!visinfo)
|
if (!visinfo)
|
||||||
cerr << "no VISINFO found" << endl;
|
cerr << "no VISINFO found" << endl;
|
||||||
|
|
||||||
|
|
||||||
#else
|
#else
|
||||||
//get all confs
|
//get all possible confs
|
||||||
int nconfs;
|
int nconfs;
|
||||||
auto cptr = glXGetFBConfigs (display,0, &nconfs);
|
auto cptr = glXGetFBConfigs (display,0, &nconfs);
|
||||||
cout << "found " << nconfs << " valid confs " << endl;
|
|
||||||
Array<int> conf_ids(nconfs);
|
Array<int> conf_ids(nconfs);
|
||||||
for(int k=0;k<nconfs;k++)
|
for(int k=0;k<nconfs;k++)
|
||||||
glXGetFBConfigAttrib(display, cptr[k], GLX_FBCONFIG_ID, &(conf_ids[k]));
|
glXGetFBConfigAttrib(display, cptr[k], GLX_FBCONFIG_ID, &(conf_ids[k]));
|
||||||
|
|
||||||
//get drawable->FBConfig->visual and try with that
|
//get drawable->FBConfig->visual
|
||||||
unsigned int d_fbc_id;
|
unsigned int d_fbc_id;
|
||||||
glXQueryDrawable( display, curDrawable, GLX_FBCONFIG_ID, &d_fbc_id);
|
glXQueryDrawable( display, curDrawable, GLX_FBCONFIG_ID, &d_fbc_id);
|
||||||
GLXFBConfig d_fbc;
|
GLXFBConfig d_fbc;
|
||||||
@ -287,7 +282,8 @@ void ParallelRun()
|
|||||||
|
|
||||||
// PrintMessage (1, "redraw - init complete");
|
// PrintMessage (1, "redraw - init complete");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (redraw_cmd == "broadcast")
|
if (redraw_cmd == "broadcast")
|
||||||
{
|
{
|
||||||
vsmesh.Broadcast ();
|
vsmesh.Broadcast ();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user