Select Git revision
linearSystem.h
Forked from
gmsh / gmsh
Source project has a limited visibility.
drawGeom.cpp 17.43 KiB
// Gmsh - Copyright (C) 1997-2009 C. Geuzaine, J.-F. Remacle
//
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to <gmsh@geuz.org>.
#include "drawContext.h"
#include "Context.h"
#include "gl2ps.h"
#include "VertexArray.h"
#include "GModel.h"
#include "SBoundingBox3d.h"
#include "GmshMessage.h"
class drawGVertex {
private :
drawContext *_ctx;
public :
drawGVertex(drawContext *ctx) : _ctx(ctx){}
void operator () (GVertex *v)
{
if(!v->getVisibility()) return;
if(v->geomType() == GEntity::BoundaryLayerPoint) return;
bool select = (_ctx->render_mode == drawContext::GMSH_SELECT &&
v->model() == GModel::current());
if(select) {
glPushName(0);
glPushName(v->tag());
}
if(v->getSelection()) {
glPointSize((float)CTX::instance()->geom.selectedPointSize);
gl2psPointSize((float)(CTX::instance()->geom.selectedPointSize *
CTX::instance()->print.epsPointSizeFactor));
glColor4ubv((GLubyte *) & CTX::instance()->color.geom.selection);
}
else {
glPointSize((float)CTX::instance()->geom.pointSize);
gl2psPointSize((float)(CTX::instance()->geom.pointSize *
CTX::instance()->print.epsPointSizeFactor));
glColor4ubv((GLubyte *) & CTX::instance()->color.geom.point);
}
if(CTX::instance()->geom.highlightOrphans){
std::list<GEdge*> edges = v->edges();
if(edges.size() == 0)
glColor4ubv((GLubyte *) & CTX::instance()->color.geom.highlight[0]);
else if(edges.size() == 1)
glColor4ubv((GLubyte *) & CTX::instance()->color.geom.highlight[1]);
}
double x = v->x(), y = v->y(), z = v->z();
_ctx->transform(x, y, z);
if(CTX::instance()->geom.points) {
if(CTX::instance()->geom.pointType > 0) {
if(v->getSelection())
_ctx->drawSphere(CTX::instance()->geom.selectedPointSize, x, y, z,
CTX::instance()->geom.light);
else
_ctx->drawSphere(CTX::instance()->geom.pointSize, x, y, z,
CTX::instance()->geom.light);
}
else {
glBegin(GL_POINTS);
glVertex3d(x, y, z);
glEnd();
}
}