28 #ifndef _util_render_polygons_h
29 #define _util_render_polygons_h
31 #include <util/keyval/keyval.h>
32 #include <util/render/object.h>
38 enum Coloring { None,
Vertex };
40 RenderedPolygons::Coloring coloring_;
46 int* nvertex_in_face_;
54 void initialize(
int nvertex,
int nface,
55 RenderedPolygons::Coloring c = RenderedPolygons::None);
56 void set_vertex(
int,
double x,
double y,
double z);
57 void set_vertex_rgb(
int,
double r,
double g,
double b);
58 void set_vertex_color(
int i,
const Color&c) {
59 set_vertex_rgb(i, c.red(), c.green(), c.blue());
61 void set_face(
int iface,
int v1,
int v2,
int v3);
62 void set_face(
int iface,
int v1,
int v2,
int v3,
int v4);
64 int nvertex()
const {
return nvertex_; }
65 int nface()
const {
return nface_; }
66 int nvertex_in_face(
int iface)
const {
return nvertex_in_face_[iface]; }
67 const double *vertex(
int i)
const {
return vertices_[i]; }
68 double vertex(
int i,
int j)
const {
return vertices_[i][j]; }
69 int face(
int i,
int j)
const {
return faces_[i][j]; }
70 double vertex_rgb(
int i,
int j)
const {
return vertex_rgb_[i][j]; }
71 int have_vertex_rgb()
const {
return coloring_ ==
Vertex; }