gmsh-TingyuanDoc
0.1
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
|
Go to the documentation of this file.
28 #if defined(HAVE_FLTK)
39 std::vector<T *> &elements,
int forceColor = 0,
40 unsigned int color = 0)
43 glColor4ubv((GLubyte *)&col);
46 if(labelStep <= 0) labelStep = 1;
48 for(std::size_t i = 0; i < elements.size(); i++) {
51 if(i % labelStep == 0) {
55 sprintf(str,
"(%g,%g,%g)", pc.
x(), pc.
y(), pc.
z());
61 sprintf(str,
"%d", p);
64 sprintf(str,
"%d", e->
tag());
66 sprintf(str,
"%lu", ele->
getNum());
76 for(std::size_t i = 0; i < elements.size(); i++) {
80 for(
int j = 0; j < 3; j++)
92 for(std::size_t i = 0; i < elements.size(); i++) {
96 for(
int j = 0; j < 3; j++)
110 int physical = np ? e->
physicals[np - 1] : 0;
113 sprintf(str,
"(%.16g,%.16g,%.16g)", v->
x(), v->
y(), v->
z());
118 sprintf(str,
"%d", partition);
121 sprintf(str,
"%d", physical);
123 sprintf(str,
"%d", e->
tag());
125 sprintf(str,
"%lu", v->
getNum());
137 glColor4ubv((GLubyte *)&col);
142 ctx->
drawString(str, v->
x() + offset / ctx->
s[0], v->
y() + offset / ctx->
s[1],
143 v->
z() + offset / ctx->
s[2]);
163 glColor4ubv((GLubyte *)&col);
184 glColor4ubv((GLubyte *)&col);
186 glVertex3d(v->
x(), v->
y(), v->
z());
193 if(labelStep <= 0) labelStep = 1;
201 std::vector<T *> &elements)
203 for(std::size_t i = 0; i < elements.size(); i++) {
221 glColor4ubv((GLubyte *)&col);
228 glVertex3d(v->
x(), v->
y(), v->
z());
242 glEnable(GL_LINE_STIPPLE);
243 glLineStipple(1, 0x0F0F);
246 for(std::size_t i = 0; i < elements.size(); i++) {
254 glVertex3d(pc.
x(), pc.
y(), pc.
z());
255 glVertex3d(p.
x(), p.
y(), p.
z());
258 else if(ele->
getDim() == 3) {
262 glVertex3d(pc.
x(), pc.
y(), pc.
z());
263 glVertex3d(p.
x(), p.
y(), p.
z());
264 for(std::size_t k = 0; k <
f.getNumVertices(); k++) {
265 MEdge e(
f.getVertex(k), (k ==
f.getNumVertices() - 1) ?
269 glVertex3d(p.
x(), p.
y(), p.
z());
270 glVertex3d(pe.
x(), pe.
y(), pe.
z());
276 glDisable(GL_LINE_STIPPLE);
283 glEnable(GL_LINE_STIPPLE);
284 glLineStipple(1, 0x0F0F);
287 for(std::size_t i = 0; i < elements.size(); i++) {
288 T *ele = elements[i];
290 SPoint3 pc = ele->circumcenter();
291 if(ele->getDim() == 2) {
292 for(
int j = 0; j < ele->getNumEdges(); j++) {
293 MEdge e = ele->getEdge(j);
300 double alpha =
dot(pcp1, p2p1) /
dot(p2p1, p2p1);
305 glVertex3d(pc.
x(), pc.
y(), pc.
z());
306 glVertex3d(p.
x(), p.
y(), p.
z());
309 else if(ele->getDim() == 3) {
310 for(
int j = 0; j < ele->getNumFaces(); j++) {
311 MFace f = ele->getFace(j);
313 glVertex3d(pc.
x(), pc.
y(), pc.
z());
314 glVertex3d(p.
x(), p.
y(), p.
z());
315 for(std::size_t k = 0; k <
f.getNumVertices(); k++) {
316 MEdge e(
f.getVertex(k), (k ==
f.getNumVertices() - 1) ?
320 glVertex3d(p.
x(), p.
y(), p.
z());
321 glVertex3d(pe.
x(), pe.
y(), pe.
z());
327 glDisable(GL_LINE_STIPPLE);
334 GLint type,
bool useNormalArray,
int forceColor = 0,
335 unsigned int color = 0)
362 glEnableClientState(GL_VERTEX_ARRAY);
365 glEnable(GL_LIGHTING);
367 glEnableClientState(GL_NORMAL_ARRAY);
370 glDisableClientState(GL_NORMAL_ARRAY);
373 glDisableClientState(GL_COLOR_ARRAY);
374 glColor4ubv((GLubyte *)&color);
380 glEnableClientState(GL_COLOR_ARRAY);
383 glDisableClientState(GL_COLOR_ARRAY);
385 glColor4ubv((GLubyte *)&color);
389 glEnable(GL_POLYGON_OFFSET_FILL);
393 glDisable(GL_POLYGON_OFFSET_FILL);
394 glDisable(GL_LIGHTING);
396 glDisableClientState(GL_VERTEX_ARRAY);
397 glDisableClientState(GL_NORMAL_ARRAY);
398 glDisableClientState(GL_COLOR_ARRAY);
417 glPushName(v->
tag());
420 glLightModelf(GL_LIGHT_MODEL_TWO_SIDE, GL_FALSE);
450 glPushName(e->
tag());
453 glLightModelf(GL_LIGHT_MODEL_TWO_SIDE, GL_FALSE);
486 if(!
f->getVisibility()) {
494 glPushName(
f->tag());
497 glLightModelf(GL_LIGHT_MODEL_TWO_SIDE, GL_FALSE);
505 glLightModelf(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE);
525 if(
f->getAllElementsVisible())
574 glPushName(r->
tag());
577 glLightModelf(GL_LIGHT_MODEL_TWO_SIDE, GL_FALSE);
585 glLightModelf(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE);
664 glBlendFunc(GL_SRC_ALPHA, GL_ONE);
668 glDisable(GL_DEPTH_TEST);
675 glEnable(GL_DEPTH_TEST);
689 for(std::size_t j = 0; j <
PView::list.size(); j++)
703 for(
int i = 0; i < 6; i++)
705 glEnable((GLenum)(GL_CLIP_PLANE0 + i));
707 glDisable((GLenum)(GL_CLIP_PLANE0 + i));
713 if(changed)
Msg::Debug(
"mesh vertex arrays have changed");
714 #if defined(HAVE_FLTK) && defined(__APPLE__)
716 if(changed) gl_texture_pile_height(gl_texture_pile_height());
736 for(
int i = 0; i < 6; i++) glDisable((GLenum)(GL_CLIP_PLANE0 + i));
static void beginFakeTransparency()
virtual std::size_t getNum() const
void operator()(GRegion *r)
GL2PSDLL_API GLint gl2psEnable(GLint mode)
double dot(const SVector3 &a, const SMetric3 &m, const SVector3 &b)
int getNumVerticesPerElement()
std::vector< MLine * > lines
static void Debug(const char *fmt,...)
virtual int getDim() const =0
static void drawVerticesPerElement(drawContext *ctx, GEntity *e, std::vector< T * > &elements)
static void drawTangents(drawContext *ctx, std::vector< T * > &elements)
VertexArray * va_triangles
std::vector< int > physicals
void drawString(const std::string &s, double x, double y, double z, const std::string &font_name, int font_enum, int font_size, int align, int line_num=0)
double epsPointSizeFactor
void f(int n, double u, double *val)
std::size_t getNum() const
double epsLineWidthFactor
static void drawNormals(drawContext *ctx, std::vector< T * > &elements)
drawMeshGRegion(drawContext *ctx)
virtual char getSelection()
void drawVector(int Type, int Fill, double x, double y, double z, double dx, double dy, double dz, int light)
unsigned int getColorByEntity(GEntity *e)
GL2PSDLL_API GLint gl2psPointSize(GLfloat value)
virtual std::size_t getNumVertices() const =0
std::vector< MPolyhedron * > polyhedra
virtual const MVertex * getVertex(int num) const =0
std::vector< MHexahedron * > hexahedra
virtual MEdge getEdge(int num) const =0
void operator()(GEdge *e)
MVertex * getVertex(std::size_t i) const
std::vector< MVertex * > mesh_vertices
virtual int getNumFaces()=0
bool isVisible(GModel *m)
static void drawVoronoiDual(std::vector< T * > &elements)
static void drawBarycentricDual(std::vector< T * > &elements)
unsigned char * getColorArray(int i=0)
void operator()(GFace *f)
normal_type * getNormalArray(int i=0)
virtual MFace getFace(int num) const =0
SPoint3 barycenter() const
std::vector< MTrihedron * > trihedra
drawMeshGEdge(drawContext *ctx)
bool isElementVisible(MElement *ele)
static void drawElementLabels(drawContext *ctx, GEntity *e, std::vector< T * > &elements, int forceColor=0, unsigned int color=0)
#define GL2PS_LINE_STIPPLE
virtual char getVisibility()
static std::vector< GModel * > list
static void drawArrays(drawContext *ctx, GEntity *e, VertexArray *va, GLint type, bool useNormalArray, int forceColor=0, unsigned int color=0)
std::vector< MPrism * > prisms
std::vector< MPyramid * > pyramids
float * getVertexArray(int i=0)
char getVisibility() const
bool getAllElementsVisible()
GL2PSDLL_API GLint gl2psDisable(GLint mode)
int getNumElementPointers()
static void drawVerticesPerEntity(drawContext *ctx, GEntity *e)
static void endFakeTransparency()
drawMeshGVertex(drawContext *ctx)
void operator()(GVertex *v)
drawMeshGFace(drawContext *ctx)
GL2PSDLL_API GLint gl2psLineWidth(GLfloat value)
virtual SPoint3 barycenter(bool primary=false) const
virtual int getPartition() const
static std::vector< PView * > list
static void drawVertexLabel(drawContext *ctx, GEntity *e, MVertex *v, int partition=-1)
int getMeshStatus(bool countDiscrete=true)
virtual char getVisibility()
virtual int getNumEdges() const =0
void drawSphere(double R, double x, double y, double z, int n1, int n2, int light)
std::vector< MTetrahedron * > tetrahedra
static GModel * current(int index=-1)