p->customptr = '\0';
/*set event functions */
- p->common.functions.draw = glCompButtonDraw;
+ p->common.functions.draw = (glcompdrawfunc_t)glCompButtonDraw;
p->common.functions.click = glCompButtonClick;
p->common.functions.doubleclick = glCompButtonDoubleClick;
p->common.functions.mouseup = glCompButtonMouseUp;
/*caption */
- p->common.font = new_font_from_parent((glCompObj *) p, NULL);
+ p->common.font = glNewFontFromParent ((glCompObj *) p, NULL);
p->label = glCompLabelNew((glCompObj *) p, 0, 0, caption);
p->label->common.font->justify.VJustify = glFontVJustifyCenter;
p->label->common.font->justify.HJustify = glFontHJustifyCenter;
glObjType objType; /*always keep this here for each drawable object */
glCompCommon common;
glCompTex *texture;
- char *pngFile;
+ GLfloat width, height; /* width and height in world coords */
+ /* char *pngFile; */
int stretch;
} glCompImage;
-
-
-
-
/*generic panel*/
typedef struct _glCompPanel {
glObjType objType; /*always keep this here for each drawable object */
#include "memory.h"
#include <GL/glut.h>
-void print_bitmap_string(void *font, char *s)
+static void print_bitmap_string(void *font, char *s)
{
if (s && strlen(s)) {
while (*s) {
}
}
+#if 0
void init_gl_vars(glCompFont * f)
{
glDisable(GL_TEXTURE_2D);
glMatrixMode(f->glcache.matrix);*/
}
+#endif
void glprintfglut(void *font, GLfloat xpos, GLfloat ypos, GLfloat zpos,
char *bf)
{
}
-
-
+#if 0
static void
glPrintf(glCompFont * font, GLfloat xpos, GLfloat ypos, GLfloat zpos,
GLfloat width, char *bf, int usez)
glPrintf(font, xpos, ypos, zpos, width, bf, 0);
}
-
-
static int fontId(fontset_t * fontset, char *fontdesc)
{
int ind = 0;
}
-glCompFont *glut_font_init(void)
+static glCompFont *glut_font_init(void)
{
glCompFont *font = NEW(glCompFont);
font->color.R = 1.00;
return font;
}
-void delete_font(glCompFont * f)
+#endif
+void glDeleteFont(glCompFont * f)
{
if (f->fontdesc)
free(f->fontdesc);
}
-glCompFont *new_font(glCompSet * s, char *text, glCompColor * c,glCompFontType type, char *fontdesc, int fs,int is2D)
+glCompFont *glNewFont (glCompSet * s, char *text, glCompColor * c,glCompFontType type, char *fontdesc, int fs,int is2D)
{
glCompFont *font = (glCompFont*) malloc(sizeof(glCompFont));
font->reference = 0;
-glCompFont *new_font_from_parent(glCompObj * o, char *text)
+glCompFont *glNewFontFromParent(glCompObj * o, char *text)
{
glCompCommon *parent;
glCompFont *font = NEW(glCompFont);
c.B = GLCOMPSET_FONT_COLOR_B;
c.A = GLCOMPSET_FONT_COLOR_ALPHA;
font =
- new_font(o->common.compset, text, &c, pangotext,
+ glNewFont (o->common.compset, text, &c, pangotext,
GLCOMPSET_FONT_DESC, GLCOMPSET_FONT_SIZE,1);
}
return font;
}
-
+#if 0
#ifndef _WIN32
#define TMPTEMP "/tmp/_sfXXXX"
fontpath = ALLOC(fontpathsz, fontpath, char);
}
/* sprintf(fontpath, "%s/%s.png", fontset->font_directory, fontdesc);
- if (create_font_file(fontdesc,fs, fontpath, (float) 32, (float) 32) ==
+ if (glCompCreateFontFile(fontdesc,fs, fontpath, (float) 32, (float) 32) ==
0) {
fontset->fonts =
ALLOC(fontset->count + 1, fontset->fonts, glCompFont *);
font->color.B = b;
font->color.A = a;
}
-
+#endif
/*texture base 3d text rendering*/
void glCompDrawText3D(glCompFont * f,GLfloat x,GLfloat y,GLfloat z,GLfloat w,GLfloat h)
glEnable(GL_BLEND);
}
+#if 0
/*bitmap base 2D text rendering */
static void change_fontC(unsigned char* d,int w,int h,glCompColor* c)
{
int size=w*h*4;
int ind=0;
- for (ind;ind <=size; ind=ind+4)
+ for (;ind <=size; ind=ind+4)
{
if(d[ind+3] != 0)
{
}
}
}
-
+#endif
void glCompDrawText(glCompFont * f,GLfloat x,GLfloat y)
{
glCompDrawText(f,x,y);
}
+
+#if 0
+#define imageWidth 256
+#define imageHeight 256
+static GLubyte imageData[imageWidth][imageHeight][4];
+#endif
+
+#if 0
+int glCompLoadFontPNG(char *name, int id)
+{
+ GLubyte *imageData = NULL;
+ int imageWidth, imageHeight, idx2, c;
+
+// imageData = fontGetData (s, size, imageBits);
+ imageData = glCompLoadPng (name, &imageWidth, &imageHeight);
+
+ c = 0;
+ idx2 = 0;
+/* for (idx=0;idx < imageWidth*imageHeight+30000;idx=idx+1)
+ {
+ if (c!=imageData[idx])
+ {
+ c=imageData[idx];
+ printf ("%i) %i \n ",idx2,imageData[idx]);
+ }
+
+ idx2++;
+ c=((((idx&0x8)==0)^((idx2&0x8))==0))*255;
+ imageData[idx][idx2][0] = c;
+ imageData[idx][idx2][1] = c;
+ imageData[idx][idx2][2] = c;
+ imageData[idx][idx2][3] = 255;
+
+ }*/
+
+
+ /* no image data */
+ if (imageData == NULL)
+ return -1;
+
+ glBindTexture(GL_TEXTURE_2D, id);
+ glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
+ /* glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); */
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ /* glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); */
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+ glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
+// glTexEnvf(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE , GL_DECAL);
+
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, imageWidth, imageHeight, 0,
+ GL_ALPHA, GL_UNSIGNED_BYTE, imageData);
+// glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA, 256, 256, 0, GL_RGBA, GL_UNSIGNED_BYTE, imageData);
+
+ /* release data, its been uploaded */
+
+ return 1;
+}
+#endif
#ifdef __cplusplus
extern "C" {
#endif
- extern fontset_t *fontset_init(void);
- extern void free_font_set(fontset_t * fontset);
- extern void copy_font(glCompFont * targetfont,
- const glCompFont * sourcefont);
- extern glCompFont *add_font(fontset_t * fontset, char *fontdesc,
- int fs);
- extern glCompFont *add_glut_font(fontset_t * fontset, void *glutfont);
- extern void glprintf(glCompFont *, GLfloat, GLfloat, GLfloat, GLfloat,
- char *);
- extern void glprintfglut(void *font, GLfloat xpos, GLfloat ypos,
- GLfloat zpos, char *bf);
- extern glCompFont *font_init(void);
- extern void fontColor(glCompFont * font, float r, float g, float b,
- float a);
- extern int glCompLoadFontPNG(char *name, int id);
- extern glCompFont *new_font(glCompSet * s, char *text, glCompColor * c,glCompFontType type, char *fontdesc, int fs,int is2D);
- extern glCompFont *new_font_from_parent(glCompObj * o, char *text);
- extern void delete_font(glCompFont * f);
- extern void glCompDrawText(glCompFont * f,GLfloat x,GLfloat y);
- extern void glCompRenderText(glCompFont * f, glCompObj * parentObj);
- extern void glCompDrawText3D(glCompFont * f,GLfloat x,GLfloat y,GLfloat z,GLfloat w,GLfloat h);
+#if 0
+ void copy_font(glCompFont * targetfont, const glCompFont * sourcefont);
+ fontset_t *fontset_init(void);
+ void free_font_set(fontset_t * fontset);
+ glCompFont *add_font(fontset_t * fontset, char *fontdesc, int fs);
+ glCompFont *add_glut_font(fontset_t * fontset, void *glutfont);
+ void fontColor(glCompFont * font, float r, float g, float b, float a);
+ glCompFont *font_init(void);
+ int glCompLoadFontPNG(char *name, int id);
+ void glprintf(glCompFont *, GLfloat, GLfloat, GLfloat, GLfloat, char *);
+#endif
+
+ void glprintfglut(void *font, GLfloat xpos, GLfloat ypos, GLfloat zpos, char *bf);
+
+ glCompFont *glNewFont(glCompSet * s, char *text, glCompColor * c,
+ glCompFontType type, char *fontdesc, int fs,int is2D);
+ glCompFont *glNewFontFromParent(glCompObj * o, char *text);
+ void glDeleteFont(glCompFont * f);
+ void glCompDrawText(glCompFont * f,GLfloat x,GLfloat y);
+ void glCompRenderText(glCompFont * f, glCompObj * parentObj);
+ void glCompDrawText3D(glCompFont * f,GLfloat x,GLfloat y,GLfloat z,GLfloat w,GLfloat h);
#ifdef __cplusplus
}
p->objType = glImageObj;
p->stretch = 0;
+#if 0
p->pngFile = (char *) 0;
+#endif
p->texture = NULL;
p->common.functions.draw = glCompImageDraw;
return p;
}
+/* glCompImageNewFile:
+ * Creates image from given input file.
+ * At present, we assume png input.
+ * Return 0 on failure.
+ */
+glCompImage *glCompImageNewFile (glCompObj * par, GLfloat x, GLfloat y, char* imgfile, int is2D)
+{
+ int imageWidth, imageHeight;
+ unsigned char *data = glCompLoadPng (imgfile, &imageWidth, &imageHeight);
+ glCompImage *p;
+
+ if (!data) return NULL;
+ p = glCompImageNew (par, x, y);
+ if (!glCompImageLoad (p, data, imageWidth, imageHeight, is2D)) {
+ glCompImageDelete (p);
+ return NULL;
+ }
+ return p;
+}
+
void glCompImageDelete(glCompImage * p)
{
glCompEmptyCommon(&p->common);
+#if 0
if (p->pngFile)
free(p->pngFile);
+#endif
if (p->texture)
glCompDeleteTexture(p->texture);
free(p);
}
-extern unsigned char *load_png(char *file_name, int *imageWidth,
- int *imageHeight);
+
int glCompImageLoad(glCompImage * i, unsigned char *data, int width,
int height,int is2D)
{
{
int imageWidth, imageHeight;
unsigned char *data;
- data = load_png(pngFile, &imageWidth, &imageHeight);
+ data = glCompLoadPng (pngFile, &imageWidth, &imageHeight);
return glCompImageLoad(i, data, imageWidth, imageHeight,is2D);
}
+
+#if 0
int glCompImageLoadRaw(glCompSet * s, glCompImage * i, char *rawFile,int is2D)
{
int imageWidth, imageHeight;
unsigned char *data;
- data = load_png(rawFile, &imageWidth, &imageHeight);
+ data = glCompLoadPng (rawFile, &imageWidth, &imageHeight);
return glCompImageLoad(i, data, imageWidth, imageHeight,is2D);
}
+#endif
void glCompImageDraw(void *obj)
{
- glCompImage *p;
- static glCompCommon ref;
- static GLfloat w,h,d;
- p = (glCompImage *) obj;
- ref = p->common;
+ glCompImage *p = (glCompImage *) obj;
+ glCompCommon ref = p->common;
+ GLfloat w,h,d;
+
glCompCalcWidget((glCompCommon *) p->common.parent, &p->common, &ref);
if (!p->common.visible)
return;
}
else
{
-
+#if 0
w=ref.width;
h=ref.height;
+#endif
+ w = p->width;
+ h = p->height;
d=(GLfloat)p->common.layer* (GLfloat)GLCOMPSET_BEVEL_DIFF;
glDisable(GL_BLEND);
glEnable(GL_TEXTURE_2D);
extern "C" {
#endif
+ extern glCompImage *glCompImageNewFile(glCompObj * par, GLfloat x,
+ GLfloat y, char* imgfile, int is2D);
extern glCompImage *glCompImageNew(glCompObj * par, GLfloat x,
GLfloat y);
extern void glCompImageDelete(glCompImage * p);
//typedef enum {glPanelObj,glbuttonObj,glLabelObj,glImageObj}glObjType;
p->text = strdup(text);
- p->common.font = new_font_from_parent((glCompObj*)p, text);
- p->common.functions.draw = glCompLabelDraw;
+ p->common.font = glNewFontFromParent ((glCompObj*)p, text);
+ p->common.functions.draw = (glcompdrawfunc_t)glCompLabelDraw;
return p;
}
if (strlen(text) >512)
return ;
- p->common.font=new_font(p->common.compset,text,&p->common.color,temp->type,desc,fs,temp->is2D);
+ p->common.font=glNewFont (p->common.compset,text,&p->common.color,temp->type,desc,fs,temp->is2D);
if(temp)
- delete_font(temp);
+ glDeleteFont(temp);
if(p->text)
free(p->text);
p->text = strdup(text);
p->common.width = w;
p->common.height = h;
- p->common.font = new_font_from_parent((glCompObj *) p, NULL);
+ p->common.font = glNewFontFromParent((glCompObj *) p, NULL);
p->text = (char *) 0;
- p->common.functions.draw = glCompPanelDraw;
+ p->common.functions.draw = (glcompdrawfunc_t)glCompPanelDraw;
p->image = (glCompImage *) 0;
return p;
}
}
-
+#if 0
void glCompPanelSetText(glCompPanel * p, char *str)
{
// replacestr(str, &p->text);
}
+#endif
-extern void glCompInitCommon(glCompObj * childObj, glCompObj * parentObj,
+void glCompInitCommon(glCompObj * childObj, glCompObj * parentObj,
GLfloat x, GLfloat y)
{
glCompCommon *c;
c->layer = 0;
c->pos.z = 0;
}
- c->font = new_font_from_parent(childObj, NULL);
+ c->font = glNewFontFromParent(childObj, NULL);
}
void glCompEmptyCommon(glCompCommon * c)
{
- delete_font(c->font);
+ glDeleteFont(c->font);
}
glCompSet *glCompSetNew(int w, int h)
{
s->obj = (glCompObj **) 0;
s->textureCount = 0;
s->textures = (glCompTex **) 0;
- s->common.font = new_font_from_parent((glCompObj *) s, NULL);
+ s->common.font = glNewFontFromParent((glCompObj *) s, NULL);
s->common.compset = (glCompSet *) s;
- s->common.functions.mouseover = glCompMouseMove;
- s->common.functions.mousedown = glCompSetMouseDown;
- s->common.functions.mouseup = glCompSetMouseUp;
+ s->common.functions.mouseover = (glcompmouseoverfunc_t)glCompMouseMove;
+ s->common.functions.mousedown = (glcompmousedownfunc_t)glCompSetMouseDown;
+ s->common.functions.mouseup = (glcompmouseupfunc_t)glCompSetMouseUp;
glCompMouseInit(&s->mouse);
return s;
}
}
-
-
-
-
-
-
-
-
-
-
-
-
-
void glCompSetClear(glCompSet * s)
{
/* int ind = 0;
extern int glcompsetGetGroupId(glCompSet * s);
extern void glCompDrawBegin(void);
extern void glCompDrawEnd(void);
- extern void glCompDeleteTexture(glCompTex * t);
extern void glCompSetAddObj(glCompSet * s, glCompObj * obj);
glCompObj *glCompGetObjByMouse(glCompSet * s, glCompMouse * m,
int onlyClickable);
#include <gtk/gtk.h>
#include <png.h>
-unsigned char *load_png(char *filename, int *imageWidth, int *imageHeight)
+unsigned char *glCompLoadPng (char *filename, int *imageWidth, int *imageHeight)
{
cairo_surface_t *surface;
cairo_format_t format;
unsigned char *d;
surface = NULL;
-/* d=create_pango_texture("Arial",14,"hello world \ n hello mars",surface,&w,&h);
- *imageWidth=w;
- *imageHeight=h;*/
-
-
surface = cairo_image_surface_create_from_png(filename);
+ if (!surface) return 0;
w = cairo_image_surface_get_width(surface);
h = cairo_image_surface_get_height(surface);
*imageWidth = w;
format = cairo_image_surface_get_format(surface);
d = cairo_image_surface_get_data(surface);
return d;
-
-
-
-
}
+#if 0
unsigned char *load_raw(char *filename, int width, int height)
{
return data;
}
-
-
unsigned char *load_png2(char *file_name, int *imageWidth,
int *imageHeight)
{
fclose (fp);
return imageData;
}
+#endif
-/*#define imageWidth 256
-#define imageHeight 256
-static GLubyte imageData[imageWidth][imageHeight][4];*/
-
-int glCompLoadFontPNG(char *name, int id)
-{
- GLubyte *imageData = NULL;
- int imageWidth, imageHeight, idx2, c;
-
-// imageData = fontGetData (s, size, imageBits);
- imageData = load_png(name, &imageWidth, &imageHeight);
-
- c = 0;
- idx2 = 0;
-/* for (idx=0;idx < imageWidth*imageHeight+30000;idx=idx+1)
- {
- if (c!=imageData[idx])
- {
- c=imageData[idx];
- printf ("%i) %i \n ",idx2,imageData[idx]);
- }
-
- idx2++;
- c=((((idx&0x8)==0)^((idx2&0x8))==0))*255;
- imageData[idx][idx2][0] = c;
- imageData[idx][idx2][1] = c;
- imageData[idx][idx2][2] = c;
- imageData[idx][idx2][3] = 255;
-
- }*/
-
-
- /* no image data */
- if (imageData == NULL)
- return -1;
-
- glBindTexture(GL_TEXTURE_2D, id);
- glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
- /* glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); */
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- /* glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); */
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
-// glTexEnvf(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE , GL_DECAL);
-
- glTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, imageWidth, imageHeight, 0,
- GL_ALPHA, GL_UNSIGNED_BYTE, imageData);
-// glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA, 256, 256, 0, GL_RGBA, GL_UNSIGNED_BYTE, imageData);
-
- /* release data, its been uploaded */
-
- return 1;
-}
* AT&T Research, Florham Park NJ *
**********************************************************/
-unsigned char *load_png(char *filename, int *imageWidth, int *imageHeight);
+unsigned char *glCompLoadPng (char *filename, int *imageWidth, int *imageHeight);
#include "memory.h"
+#if 0
void glCompSetRemoveTexLabel(glCompSet * s, glCompFont * t)
{
}
-
+#endif
static glCompTex *glCompSetAddNewTexture(glCompSet * s, int width,
int height, unsigned char *data,
}
}
if (is2D && !Er) {
- t->data = N_NEW(4 * width * height, char);
+ t->data = N_NEW(4 * width * height, unsigned char);
offset = 4; //RGBA mod,TO DO implement other modes
/*data upside down because of pango gl coord system */
for (ind = 0; ind < height; ind++) {
}
- data = create_pango_texture(def, fs, text, surface, &width, &height);
+ data = glCompCreatePangoTexture(def, fs, text, surface, &width, &height);
if (!data) /*pango error , */
Er = 1;
t = glCompSetAddNewTexture(s, width, height, data, is2D,fs);
int fs, char *text,
int is2D);
+ extern void glCompDeleteTexture(glCompTex * t);
#ifdef __cplusplus
}
#endif
return CAIRO_STATUS_WRITE_ERROR;
}
-int create_font_file(char *fontdescription, int fs, char *fontfile,
+int glCompCreateFontFile(char *fontdescription, int fs, char *fontfile,
float gw, float gh)
{
}
-unsigned char *create_pango_texture(char *fontdescription, int fontsize,
+unsigned char *glCompCreatePangoTexture(char *fontdescription, int fontsize,
char *txt, cairo_surface_t * surface,
int *w, int *h)
{
//creates a font file with given name and font description
//returns non-zero if fails
- unsigned char *create_pango_texture(char *fontdescription,
+ unsigned char *glCompCreatePangoTexture(char *fontdescription,
int fontsize, char *txt,
cairo_surface_t * surface, int *w,
int *h);
- int create_font_file(char *fontdescription, int fs, char *fontfile,
+ int glCompCreateFontFile(char *fontdescription, int fs, char *fontfile,
float gw, float gh);
#ifdef __cplusplus
return 1;
}
-void linear_interplotate(float x1, float y1, float x2, float y2, float x3,
+#if 0
+void linear_interpolate(float x1, float y1, float x2, float y2, float x3,
float *y3)
{
*y3 = a * x3 + b;
}
-#if 0
int glreversecamera(ViewInfo * view)
{
+#if 0
static glCompPoint add(glCompPoint p, glCompPoint q)
{
p.x += q.x;
p.z += q.z;
return p;
}
+#endif
static glCompPoint sub(glCompPoint p, glCompPoint q)
{
return sqrt(dot(p, p));
}
+#if 0
static glCompPoint scale(double d, glCompPoint p)
{
p.x *= (float) d;
p.z *= (float) d;
return p;
}
+#endif
static glCompPoint blend(glCompPoint p, glCompPoint q, float m)
{
return r;
}
+static double dist(glCompPoint p, glCompPoint q)
+{
+ return (len(sub(p, q)));
+}
+
+#if 0
static glCompPoint normalize(glCompPoint p)
{
double d = len(p);
return scale(1 / d, p);
}
-static double dist(glCompPoint p, glCompPoint q)
-{
- return (len(sub(p, q)));
-}
-
static glCompPoint intersect(line l, plane J)
{
double t = -(J.d + dot(l.u, J.N)) / dot(l.v, J.N);
return (dist(p, q));
}
+#endif
/*
}
+#if 0
/*
Calculates the parameters of a plane via given 3 points on it
*/
-
void make_plane(glCompPoint a, glCompPoint b, glCompPoint c, plane * P)
{
P->N.x = a.y * (b.z - c.z) + b.y * (c.z - a.z) + c.y * (a.z - b.z); //+
(a.x * (b.y * c.z - c.y * b.z) + b.x * (c.y * a.z - a.y * c.z) +
c.x * (a.y * b.z - b.y * a.z)) * -1;
}
+#endif
void replacestr(char *source, char **target)
{
*target = strdup(source);
}
+#if 0
/*
move a point on the great circle of it (spherical)
return 0;
}
+#endif
void glCompSelectionBox(glCompSet * s)
{
}
-
-double area2(glCompPoint * p1p, glCompPoint * p2p, glCompPoint * p3p)
+#if 0
+static double area2(glCompPoint * p1p, glCompPoint * p2p, glCompPoint * p3p)
{
double d;
enum {ISCCW, ISON, ISCW}; /* counterclockwise; collinear; clockwise */
-int sideOf (glCompPoint * p1p, glCompPoint * p2p, glCompPoint * p3p) {
+static int sideOf (glCompPoint * p1p, glCompPoint * p2p, glCompPoint * p3p) {
double d = area2 (p1p,p2p,p3p);
if (d < 0) return ISCCW;
else if (d > 0) return ISCW;
{
return ((sideOf(a,b,c) != sideOf(a,b,d)) && (sideOf(c,d,a) != sideOf(c,d,b)));
}
+#endif
GLfloat distBetweenPts(glCompPoint A,glCompPoint B,float R)
{
GLfloat rv=0;
int GetFixedOGLPoslocal(int x, int y, GLfloat * X, GLfloat * Y,
GLfloat * Z);
void to3D(int x, int y, GLfloat * X, GLfloat * Y, GLfloat * Z);
- void linear_interplotate(float, float, float, float, float, float *);
- double point_to_line_dist(glCompPoint p, glCompPoint u, glCompPoint v);
double point_to_lineseg_dist(glCompPoint p, glCompPoint a, glCompPoint b);
+#if 0
+ void linear_interpolate(float, float, float, float, float, float *);
+ double point_to_line_dist(glCompPoint p, glCompPoint u, glCompPoint v);
int rot_spherex(plane J, float tet, glCompPoint P, glCompPoint * P2);
void make_plane(glCompPoint a, glCompPoint b, glCompPoint c, plane * P);
+ int lines_intersect (glCompPoint* a, glCompPoint* b, glCompPoint* c, glCompPoint* d);
+#endif
void replacestr(char *source, char **target);
extern void glCompCalcWidget(glCompCommon * parent,
glCompCommon * child, glCompCommon * ref);
extern void glCompSetColor(glCompColor * c);
void glCompSelectionBox(glCompSet * s);
- extern int lines_intersect (glCompPoint* a, glCompPoint* b, glCompPoint* c, glCompPoint* d);
extern GLfloat distBetweenPts(glCompPoint A,glCompPoint B,float R);
extern int is_point_in_rectangle(float X, float Y, float RX, float RY, float RW,float RH);