ftp.nice.ch/pub/next/graphics/3d/geomview.1.4.1.s.tar.gz#/Geomview/src/bin/crayola/common/crayola.c

This is crayola.c in view mode; [Download] [Up]

#include "geom.h"
#include "color.h"
#include "crayolaP.h"

ColorA crayDefColor = {CRAY_DEFR, CRAY_DEFG, CRAY_DEFB, CRAY_DEFA};

static char methods[][CRAYOLA_MAXNAME] = 
{
  CRAYOLA_METHNAMES
};
int sel[CRAYOLA_MAXMETH];

void crayolaInit() {
  int i;

  for (i = 0; i < CRAYOLA_MAXMETH; i++) 
    sel[i] = GeomNewMethod(methods[i], crayFalse);

  cray_bezier_init();
  cray_inst_init();
  cray_list_init();
  cray_mesh_init();
  cray_polylist_init();
  cray_quad_init();
  cray_vect_init();

}

void crayInitSpec(craySpecFunc *specfunc, int n_func, GeomClass *class) {
  int i;
  for (i = 0; i < n_func; i++) 
    GeomSpecifyMethod(GeomMethodSel(specfunc[i].name), class,
				    specfunc[i].func);
}

int crayHasColor(Geom *geom, int *gpath) {
  return (int)GeomCall(sel[0], geom, gpath);
}

int crayHasVColor(Geom *geom, int *gpath) {
  return (int)GeomCall(sel[1], geom, gpath);
}

int crayHasFColor(Geom *geom, int *gpath) {
  return (int)GeomCall(sel[2], geom, gpath);
}

int crayCanUseVColor(Geom *geom, int *gpath) {
  return (int)GeomCall(sel[3], geom, gpath);
}

int crayCanUseFColor(Geom *geom, int *gpath) {
  return (int)GeomCall(sel[4], geom, gpath);
}

int crayUseVColor(Geom *geom, ColorA *color, int *gpath) {
  return (int)GeomCall(sel[5], geom, color, gpath);
}

int crayUseFColor(Geom *geom, ColorA *color, int *gpath) {
  return (int)GeomCall(sel[6], geom, color, gpath);
}

int crayEliminateColor(Geom *geom, int *gpath) {
  return (int)GeomCall(sel[7], geom, gpath);
}

int craySetColorAll(Geom *geom, ColorA *color, int *gpath) {
  return (int)GeomCall(sel[8], geom, color, gpath);
}

int craySetColorAt(Geom *geom, ColorA *color, int vindex, int findex, 
		   int *edge, int *gpath, HPoint3 *pt) {
  return (int)GeomCall(sel[9], geom, color, vindex, findex, edge, gpath, 
		       pt);
}

int craySetColorAtV(Geom *geom, ColorA *color, int index, int *gpath,
		    HPoint3 *pt) {
  return (int)GeomCall(sel[10], geom, color, index, gpath, pt);
}

int craySetColorAtF(Geom *geom, ColorA *color, int index, int *gpath) {
  return (int)GeomCall(sel[11], geom, color, index, gpath);
}

int crayGetColorAt(Geom *geom, ColorA *color, int vindex, int findex,
		   int *edge, int *gpath, HPoint3 *pt) {
  return (int)GeomCall(sel[12], geom, color, vindex, findex, edge, gpath, pt);
}

int crayGetColorAtV(Geom *geom, ColorA *color, int index, int *gpath,
		    HPoint3 *pt) {
  return (int)GeomCall(sel[13], geom, color, index, gpath, pt);
}

int crayGetColorAtF(Geom *geom, ColorA *color, int index, int *gpath) {
  return (int)GeomCall(sel[14], geom, color, index, gpath);
}

void *crayTrue(int sel, Geom *geom, va_list args) {
  return (void *)1;
}

void *crayFalse(int sel, Geom *geom, va_list args) {
  return (void *)0;
}

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.