mirror of
https://github.com/NGSolve/netgen.git
synced 2025-04-10 07:17:27 +05:00
opengl visualization
This commit is contained in:
parent
e398e948b6
commit
ece18134d1
@ -74,7 +74,6 @@ namespace netgen
|
|||||||
|
|
||||||
double shine = vispar.shininess;
|
double shine = vispar.shininess;
|
||||||
double transp = vispar.transp;
|
double transp = vispar.transp;
|
||||||
|
|
||||||
glMaterialf (GL_FRONT_AND_BACK, GL_SHININESS, shine);
|
glMaterialf (GL_FRONT_AND_BACK, GL_SHININESS, shine);
|
||||||
glLogicOp (GL_COPY);
|
glLogicOp (GL_COPY);
|
||||||
|
|
||||||
@ -93,7 +92,6 @@ namespace netgen
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
glPolygonOffset (1, 1);
|
glPolygonOffset (1, 1);
|
||||||
glEnable (GL_POLYGON_OFFSET_FILL);
|
glEnable (GL_POLYGON_OFFSET_FILL);
|
||||||
|
|
||||||
@ -185,7 +183,6 @@ namespace netgen
|
|||||||
|
|
||||||
glDisableClientState(GL_VERTEX_ARRAY);
|
glDisableClientState(GL_VERTEX_ARRAY);
|
||||||
glDisableClientState(GL_NORMAL_ARRAY);
|
glDisableClientState(GL_NORMAL_ARRAY);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
for (int j = 0; j < ta.GetNT(); j++)
|
for (int j = 0; j < ta.GetNT(); j++)
|
||||||
{
|
{
|
||||||
@ -195,6 +192,7 @@ namespace netgen
|
|||||||
int pi = ta.GetTriangle(j)[k];
|
int pi = ta.GetTriangle(j)[k];
|
||||||
glNormal3dv (ta.GetNormal(pi));
|
glNormal3dv (ta.GetNormal(pi));
|
||||||
glVertex3dv (ta.GetPoint(pi));
|
glVertex3dv (ta.GetPoint(pi));
|
||||||
|
cout << "v = " << ta.GetPoint(pi) << endl;
|
||||||
}
|
}
|
||||||
glEnd ();
|
glEnd ();
|
||||||
}
|
}
|
||||||
@ -528,8 +526,6 @@ inline string ToString (const T& t)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
void Hi () { cout << "hi from csgvis" << endl; }
|
|
||||||
|
|
||||||
#ifdef NG_PYTHON
|
#ifdef NG_PYTHON
|
||||||
#include <boost/python.hpp>
|
#include <boost/python.hpp>
|
||||||
namespace bp = boost::python;
|
namespace bp = boost::python;
|
||||||
@ -549,20 +545,17 @@ BOOST_PYTHON_MODULE(libcsgvis)
|
|||||||
|
|
||||||
bp::def ("VS", FunctionPointer
|
bp::def ("VS", FunctionPointer
|
||||||
([] (CSGeometry & geom)
|
([] (CSGeometry & geom)
|
||||||
// ([] (shared_ptr<CSGeometry> geom)
|
|
||||||
{
|
{
|
||||||
geom.FindIdenticSurfaces (1e-6);
|
geom.FindIdenticSurfaces (1e-6);
|
||||||
geom.CalcTriangleApproximation (0.01, 20);
|
geom.CalcTriangleApproximation (0.01, 20);
|
||||||
|
|
||||||
auto vs = make_shared<VisualSceneGeometry>();
|
auto vs = make_shared<VisualSceneGeometry>();
|
||||||
vs->SetGeometry(const_cast<CSGeometry*>(&geom));
|
|
||||||
// vs->SetGeometry(geom.get());
|
vs->SetGeometry(&geom);
|
||||||
return vs;
|
return vs;
|
||||||
}));
|
}));
|
||||||
|
|
||||||
bp::def ("MouseMove", FunctionPointer
|
bp::def ("MouseMove", FunctionPointer
|
||||||
([] ( VisualSceneGeometry &vsgeom, int oldx, int oldy, int newx, int newy, char mode)
|
([] ( VisualSceneGeometry &vsgeom, int oldx, int oldy, int newx, int newy, char mode)
|
||||||
// ([] (shared_ptr<CSGeometry> geom)
|
|
||||||
{
|
{
|
||||||
vsgeom.MouseMove(oldx,oldy,newx,newy,mode);
|
vsgeom.MouseMove(oldx,oldy,newx,newy,mode);
|
||||||
}));
|
}));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user