Init
This commit is contained in:
61
usr.lib/libcorepas/Makefile
Normal file
61
usr.lib/libcorepas/Makefile
Normal file
@@ -0,0 +1,61 @@
|
||||
#
|
||||
# Copyright (c) 1986, 1987, 1988, 1989 by Sun Microsystems, Inc.
|
||||
# Permission to use, copy, modify, and distribute this software for any
|
||||
# purpose and without fee is hereby granted, provided that the above
|
||||
# copyright notice appear in all copies and that both that copyright
|
||||
# notice and this permission notice are retained, and that the name
|
||||
# of Sun Microsystems, Inc., not be used in advertising or publicity
|
||||
# pertaining to this software without specific, written prior permission.
|
||||
# Sun Microsystems, Inc., makes no representations about the suitability
|
||||
# of this software or the interface defined in this software for any
|
||||
# purpose. It is provided "as is" without express or implied warranty.
|
||||
#
|
||||
#
|
||||
# @(#)Makefile @(#)Makefile 1.1 94/10/31 SMI
|
||||
#
|
||||
# Build libcorepas.a -- Pascal interface routines for SunCore library
|
||||
|
||||
LIBS= libcorepas.a
|
||||
|
||||
OBJS= batchpas.o credelsegpas.o errorspas.o getvwsurfpas.o \
|
||||
init_termpas.o inprimspas.o inqinputpas.o inqprimattpas.o \
|
||||
inqsegattpas.o inqtextentpas.o inquirypas.o ndctowldpas.o \
|
||||
newframepas.o outprim2pas.o outprim3pas.o polygon2pas.o \
|
||||
polygon3pas.o rasterfiopas.o rasterprimpas.o savesegpas.o \
|
||||
segatt3pas.o segdefspas.o segmentspas.o setprimattpas.o \
|
||||
setsegattpas.o textmarkpas.o view_surfpas.o view_transpas.o \
|
||||
xformattpas.o zbufferpas.o
|
||||
|
||||
#LIBDIR= $(DESTDIR)/usr/lib
|
||||
LIBDIR= $(DESTDIR)/usr/old
|
||||
|
||||
LOCAL_HDRS= pasarray.h f77strings.h
|
||||
|
||||
HDRS= typedefspas.h usercorepas.h sunpas.h devincpas.h
|
||||
#HDRDIR= $(DESTDIR)/usr/include/pascal
|
||||
HDRDIR= $(DESTDIR)/usr/old
|
||||
|
||||
CFLAGS= -O
|
||||
PFLAGS= -c -w -g
|
||||
|
||||
.KEEP_STATE:
|
||||
|
||||
.INIT: $(LOCAL_HDRS)
|
||||
|
||||
all: $(LIBS)
|
||||
|
||||
$(LIBS): $(OBJS)
|
||||
ar rc $(LIBS) $?
|
||||
ranlib $(LIBS)
|
||||
|
||||
install: $(LIBS) install_h
|
||||
install -d $(LIBDIR)
|
||||
install -m 644 $(LIBS) $(LIBDIR)
|
||||
ranlib $(LIBDIR)/$(LIBS)
|
||||
|
||||
install_h: $(HDRS)
|
||||
install -o bin -m 755 -d $(HDRDIR)
|
||||
install -m 444 $(HDRS) $(HDRDIR)
|
||||
|
||||
clean:
|
||||
$(RM) $(LIBS) $(OBJS)
|
||||
34
usr.lib/libcorepas/batchpas.c
Normal file
34
usr.lib/libcorepas/batchpas.c
Normal file
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Copyright (c) 1986, 1987, 1988, 1989 by Sun Microsystems, Inc.
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose and without fee is hereby granted, provided that the above
|
||||
* copyright notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice are retained, and that the name
|
||||
* of Sun Microsystems, Inc., not be used in advertising or publicity
|
||||
* pertaining to this software without specific, written prior permission.
|
||||
* Sun Microsystems, Inc., makes no representations about the suitability
|
||||
* of this software or the interface defined in this software for any
|
||||
* purpose. It is provided "as is" without express or implied warranty.
|
||||
*/
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)batchpas.c 1.1 94/10/31 Copyr 1983 Sun Micro";
|
||||
#endif
|
||||
|
||||
/*
|
||||
Copyright (c) 1983 by Sun Microsystems, Inc.
|
||||
*/
|
||||
|
||||
int begin_batch_of_updates();
|
||||
int end_batch_of_updates();
|
||||
|
||||
int beginbatchupdate(dummy)
|
||||
int dummy;
|
||||
{
|
||||
return(begin_batch_of_updates());
|
||||
}
|
||||
|
||||
int endbatchupdate(dummy)
|
||||
int dummy;
|
||||
{
|
||||
return(end_batch_of_updates());
|
||||
}
|
||||
55
usr.lib/libcorepas/credelsegpas.c
Normal file
55
usr.lib/libcorepas/credelsegpas.c
Normal file
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* Copyright (c) 1986, 1987, 1988, 1989 by Sun Microsystems, Inc.
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose and without fee is hereby granted, provided that the above
|
||||
* copyright notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice are retained, and that the name
|
||||
* of Sun Microsystems, Inc., not be used in advertising or publicity
|
||||
* pertaining to this software without specific, written prior permission.
|
||||
* Sun Microsystems, Inc., makes no representations about the suitability
|
||||
* of this software or the interface defined in this software for any
|
||||
* purpose. It is provided "as is" without express or implied warranty.
|
||||
*/
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)credelsegpas.c 1.1 94/10/31 Copyr 1983 Sun Micro";
|
||||
#endif
|
||||
|
||||
/*
|
||||
Copyright (c) 1983 by Sun Microsystems, Inc.
|
||||
*/
|
||||
|
||||
int close_retained_segment();
|
||||
int close_temporary_segment();
|
||||
int create_retained_segment();
|
||||
int create_temporary_segment();
|
||||
int set_image_transformation_type();
|
||||
|
||||
int closeretainseg(dummy)
|
||||
int dummy;
|
||||
{
|
||||
return(close_retained_segment());
|
||||
}
|
||||
|
||||
int closetempseg(dummy)
|
||||
int dummy;
|
||||
{
|
||||
return(close_temporary_segment());
|
||||
}
|
||||
|
||||
int createretainseg(segname)
|
||||
int segname;
|
||||
{
|
||||
return(create_retained_segment(segname));
|
||||
}
|
||||
|
||||
int createtempseg(dummy)
|
||||
int dummy;
|
||||
{
|
||||
return(create_temporary_segment());
|
||||
}
|
||||
|
||||
int setimgxformtype(segtype)
|
||||
int segtype;
|
||||
{
|
||||
return(set_image_transformation_type(segtype));
|
||||
}
|
||||
27
usr.lib/libcorepas/devincpas.h
Normal file
27
usr.lib/libcorepas/devincpas.h
Normal file
@@ -0,0 +1,27 @@
|
||||
/* @(#)devincpas.h 1.1 94/10/31 SMI */
|
||||
/*
|
||||
* Copyright (c) 1986, 1987, 1988, 1989 by Sun Microsystems, Inc.
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose and without fee is hereby granted, provided that the above
|
||||
* copyright notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice are retained, and that the name
|
||||
* of Sun Microsystems, Inc., not be used in advertising or publicity
|
||||
* pertaining to this software without specific, written prior permission.
|
||||
* Sun Microsystems, Inc., makes no representations about the suitability
|
||||
* of this software or the interface defined in this software for any
|
||||
* purpose. It is provided "as is" without express or implied warranty.
|
||||
*/
|
||||
function bw1dd: integer;
|
||||
external;
|
||||
function bw2dd: integer;
|
||||
external;
|
||||
function cg1dd: integer;
|
||||
external;
|
||||
function pixwindd: integer;
|
||||
external;
|
||||
function cgpixwindd: integer;
|
||||
external;
|
||||
function gp1dd: integer;
|
||||
external;
|
||||
function gp1pixwindd: integer;
|
||||
external;
|
||||
45
usr.lib/libcorepas/errorspas.c
Normal file
45
usr.lib/libcorepas/errorspas.c
Normal file
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Copyright (c) 1986, 1987, 1988, 1989 by Sun Microsystems, Inc.
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose and without fee is hereby granted, provided that the above
|
||||
* copyright notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice are retained, and that the name
|
||||
* of Sun Microsystems, Inc., not be used in advertising or publicity
|
||||
* pertaining to this software without specific, written prior permission.
|
||||
* Sun Microsystems, Inc., makes no representations about the suitability
|
||||
* of this software or the interface defined in this software for any
|
||||
* purpose. It is provided "as is" without express or implied warranty.
|
||||
*/
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)errorspas.c 1.1 94/10/31 Copyr 1983 Sun Micro";
|
||||
#endif
|
||||
|
||||
/*
|
||||
Copyright (c) 1983 by Sun Microsystems, Inc.
|
||||
*/
|
||||
|
||||
int print_error();
|
||||
int report_most_recent_error();
|
||||
|
||||
int printerror(f77string, error)
|
||||
char *f77string;
|
||||
int error;
|
||||
{
|
||||
char *sptr;
|
||||
char pasarg[257];
|
||||
int i,strlen;
|
||||
|
||||
strlen = 256;
|
||||
sptr = f77string+256;
|
||||
while ((*--sptr) == ' ') {strlen--;};
|
||||
strncpy (pasarg,f77string,strlen);
|
||||
pasarg[strlen] = '\0';
|
||||
i = print_error(pasarg, error);
|
||||
return(i);
|
||||
}
|
||||
|
||||
int reportrecenterr(error)
|
||||
int *error;
|
||||
{
|
||||
return(report_most_recent_error(error));
|
||||
}
|
||||
15
usr.lib/libcorepas/f77strings.h
Normal file
15
usr.lib/libcorepas/f77strings.h
Normal file
@@ -0,0 +1,15 @@
|
||||
/* @(#)f77strings.h 1.1 94/10/31 SMI */
|
||||
/*
|
||||
* Copyright (c) 1986, 1987, 1988, 1989 by Sun Microsystems, Inc.
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose and without fee is hereby granted, provided that the above
|
||||
* copyright notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice are retained, and that the name
|
||||
* of Sun Microsystems, Inc., not be used in advertising or publicity
|
||||
* pertaining to this software without specific, written prior permission.
|
||||
* Sun Microsystems, Inc., makes no representations about the suitability
|
||||
* of this software or the interface defined in this software for any
|
||||
* purpose. It is provided "as is" without express or implied warranty.
|
||||
*/
|
||||
#define MAXLEN 256
|
||||
char _core_77string[MAXLEN+1];
|
||||
62
usr.lib/libcorepas/getvwsurfpas.c
Normal file
62
usr.lib/libcorepas/getvwsurfpas.c
Normal file
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright (c) 1986, 1987, 1988, 1989 by Sun Microsystems, Inc.
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose and without fee is hereby granted, provided that the above
|
||||
* copyright notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice are retained, and that the name
|
||||
* of Sun Microsystems, Inc., not be used in advertising or publicity
|
||||
* pertaining to this software without specific, written prior permission.
|
||||
* Sun Microsystems, Inc., makes no representations about the suitability
|
||||
* of this software or the interface defined in this software for any
|
||||
* purpose. It is provided "as is" without express or implied warranty.
|
||||
*/
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)getvwsurfpas.c 1.1 94/10/31 Copyr 1984 Sun Micro";
|
||||
#endif
|
||||
|
||||
/*
|
||||
Copyright (c) 1983 by Sun Microsystems, Inc.
|
||||
*/
|
||||
|
||||
#define DEVNAMESIZE 20
|
||||
|
||||
typedef struct {
|
||||
char screenname[DEVNAMESIZE];
|
||||
char windowname[DEVNAMESIZE];
|
||||
int fd;
|
||||
int (*dd)();
|
||||
int instance;
|
||||
int cmapsize;
|
||||
char cmapname[DEVNAMESIZE];
|
||||
int flags;
|
||||
char *ptr;
|
||||
} vwsurf;
|
||||
|
||||
int get_view_surface();
|
||||
extern char** _argv;
|
||||
|
||||
int getviewsurface(viewsurf)
|
||||
vwsurf *viewsurf;
|
||||
{
|
||||
char *sptr,*wptr,*cptr;
|
||||
int is,res;
|
||||
|
||||
res=get_view_surface(viewsurf,_argv);
|
||||
sptr = viewsurf->screenname;
|
||||
is = 0;
|
||||
while ((*sptr++) != '\0') is++;
|
||||
*--sptr = ' ';
|
||||
while (++is < DEVNAMESIZE) *++sptr = ' ';
|
||||
wptr = viewsurf->windowname;
|
||||
is = 0;
|
||||
while ((*wptr++) != '\0') is++;
|
||||
*--wptr = ' ';
|
||||
while (++is < DEVNAMESIZE) *++wptr = ' ';
|
||||
cptr = viewsurf->cmapname;
|
||||
is = 0;
|
||||
while ((*cptr++) != '\0') is++;
|
||||
*--cptr = ' ';
|
||||
while (++is < DEVNAMESIZE) *++cptr = ' ';
|
||||
return(res);
|
||||
}
|
||||
|
||||
34
usr.lib/libcorepas/init_termpas.c
Normal file
34
usr.lib/libcorepas/init_termpas.c
Normal file
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Copyright (c) 1986, 1987, 1988, 1989 by Sun Microsystems, Inc.
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose and without fee is hereby granted, provided that the above
|
||||
* copyright notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice are retained, and that the name
|
||||
* of Sun Microsystems, Inc., not be used in advertising or publicity
|
||||
* pertaining to this software without specific, written prior permission.
|
||||
* Sun Microsystems, Inc., makes no representations about the suitability
|
||||
* of this software or the interface defined in this software for any
|
||||
* purpose. It is provided "as is" without express or implied warranty.
|
||||
*/
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)init_termpas.c 1.1 94/10/31 Copyr 1983 Sun Micro";
|
||||
#endif
|
||||
|
||||
/*
|
||||
Copyright (c) 1983 by Sun Microsystems, Inc.
|
||||
*/
|
||||
|
||||
int initialize_core();
|
||||
int terminate_core();
|
||||
|
||||
int initializecore(outlev, inlev, dim)
|
||||
int outlev, inlev, dim;
|
||||
{
|
||||
return(initialize_core(outlev, inlev, dim));
|
||||
}
|
||||
|
||||
int terminatecore(dummy)
|
||||
int dummy;
|
||||
{
|
||||
return(terminate_core());
|
||||
}
|
||||
213
usr.lib/libcorepas/inprimspas.c
Normal file
213
usr.lib/libcorepas/inprimspas.c
Normal file
@@ -0,0 +1,213 @@
|
||||
/*
|
||||
* Copyright (c) 1986, 1987, 1988, 1989 by Sun Microsystems, Inc.
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose and without fee is hereby granted, provided that the above
|
||||
* copyright notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice are retained, and that the name
|
||||
* of Sun Microsystems, Inc., not be used in advertising or publicity
|
||||
* pertaining to this software without specific, written prior permission.
|
||||
* Sun Microsystems, Inc., makes no representations about the suitability
|
||||
* of this software or the interface defined in this software for any
|
||||
* purpose. It is provided "as is" without express or implied warranty.
|
||||
*/
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)inprimspas.c 1.1 94/10/31 Copyr 1983 Sun Micro";
|
||||
#endif
|
||||
|
||||
/*
|
||||
Copyright (c) 1983 by Sun Microsystems, Inc.
|
||||
*/
|
||||
|
||||
#include "pasarray.h"
|
||||
#include "f77strings.h"
|
||||
|
||||
int await_any_button();
|
||||
int await_any_button_get_locator_2();
|
||||
int await_any_button_get_valuator();
|
||||
int await_keyboard();
|
||||
int await_pick();
|
||||
int await_stroke_2();
|
||||
int get_mouse_state();
|
||||
int initialize_device();
|
||||
int set_echo();
|
||||
int set_echo_group();
|
||||
int set_echo_position();
|
||||
int set_echo_surface();
|
||||
int set_keyboard();
|
||||
int set_pick();
|
||||
int set_locator_2();
|
||||
int set_stroke();
|
||||
int set_valuator();
|
||||
int terminate_device();
|
||||
|
||||
int awaitanybutton(tim, butnum)
|
||||
int tim, *butnum;
|
||||
{
|
||||
return(await_any_button(tim, butnum));
|
||||
}
|
||||
|
||||
int awtbuttongetloc2(tim, locnum, butnum, x, y)
|
||||
int tim, locnum, *butnum;
|
||||
double *x, *y;
|
||||
{
|
||||
float tx,ty;
|
||||
int f;
|
||||
f=await_any_button_get_locator_2(tim, locnum, butnum, &tx, &ty);
|
||||
*x=tx;
|
||||
*y=ty;
|
||||
return(f);
|
||||
}
|
||||
|
||||
int awtbuttongetval(tim, valnum, butnum, val)
|
||||
int tim, valnum, *butnum;
|
||||
double *val;
|
||||
{
|
||||
float tval;
|
||||
int f;
|
||||
f=await_any_button_get_valuator(tim, valnum, butnum, &tval);
|
||||
*val=tval;
|
||||
return(f);
|
||||
}
|
||||
|
||||
int awaitkeyboard(tim, keynum, f77string, length)
|
||||
int tim, keynum, length;
|
||||
char *f77string;
|
||||
{
|
||||
char c, *sptr;
|
||||
int f, i;
|
||||
|
||||
f = await_keyboard(tim, keynum, f77string, length);
|
||||
f77string += length;
|
||||
for (i = (length+1); i < 257; i++)
|
||||
*++f77string = ' ';
|
||||
return(f);
|
||||
}
|
||||
|
||||
int awaitpick(tim, picknum, segnam, pickid)
|
||||
int tim, picknum, *segnam, *pickid;
|
||||
{
|
||||
return(await_pick(tim, picknum, segnam, pickid));
|
||||
}
|
||||
|
||||
int awaitstroke2(tim, strokenum, arraysize, xarray, yarray, numxy)
|
||||
int tim, strokenum, arraysize, numxy;
|
||||
double xarray[], yarray[];
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < numxy; ++i) {
|
||||
xcoort[i] = xarray[i];
|
||||
ycoort[i] = yarray[i];
|
||||
}
|
||||
return(await_stroke_2(tim, strokenum, arraysize, xcoort, ycoort, numxy));
|
||||
}
|
||||
|
||||
int getmousestate(devclass, devnum, x, y, buttons)
|
||||
int devclass, devnum;
|
||||
int *buttons;
|
||||
double *x, *y;
|
||||
{
|
||||
float tx,ty;
|
||||
int f;
|
||||
f=get_mouse_state(devclass, devnum, &tx, &ty, buttons);
|
||||
*x=tx;
|
||||
*y=ty;
|
||||
return(f);
|
||||
}
|
||||
|
||||
int initializedevice(devclass, devnum)
|
||||
int devclass, devnum;
|
||||
{
|
||||
return(initialize_device(devclass, devnum));
|
||||
}
|
||||
|
||||
int setecho(devclass, devnum, echotype)
|
||||
int devclass, devnum, echotype;
|
||||
{
|
||||
return(set_echo(devclass, devnum, echotype));
|
||||
}
|
||||
|
||||
int setechogroup(devclass, devnumarray, n, echotype)
|
||||
int devclass, devnumarray[], n, echotype;
|
||||
{
|
||||
return(set_echo_group(devclass, devnumarray, n, echotype));
|
||||
}
|
||||
|
||||
int setechoposition(devclass, devnum, x, y)
|
||||
int devclass, devnum;
|
||||
double x, y;
|
||||
{
|
||||
return(set_echo_position(devclass, devnum, x, y));
|
||||
}
|
||||
|
||||
|
||||
#define DEVNAMESIZE 20
|
||||
|
||||
typedef struct {
|
||||
char screenname[DEVNAMESIZE];
|
||||
char windowname[DEVNAMESIZE];
|
||||
int fd;
|
||||
int (*dd)();
|
||||
int instance;
|
||||
int cmapsize;
|
||||
char cmapname[DEVNAMESIZE];
|
||||
int flags;
|
||||
char *ptr;
|
||||
} vwsurf;
|
||||
|
||||
int setechosurface(devclass, devnum, surfname)
|
||||
int devclass, devnum;
|
||||
vwsurf *surfname;
|
||||
{
|
||||
return(set_echo_surface(devclass, devnum, surfname));
|
||||
}
|
||||
|
||||
int setkeyboard(keynum, bufsize, istr, pos)
|
||||
int keynum, bufsize, pos;
|
||||
char *istr;
|
||||
{
|
||||
char *sptr;
|
||||
char pasarg[257];
|
||||
int i,strlen;
|
||||
|
||||
strlen = 256;
|
||||
sptr = istr+256;
|
||||
while ((*--sptr) == ' ') {strlen--;};
|
||||
strncpy (pasarg,istr,strlen);
|
||||
pasarg[strlen] = '\0';
|
||||
i = set_keyboard(keynum, bufsize, pasarg, pos);
|
||||
return(i);
|
||||
}
|
||||
|
||||
int setpick(picknum, aperture)
|
||||
int picknum;
|
||||
double aperture;
|
||||
{
|
||||
return(set_pick(picknum, aperture));
|
||||
}
|
||||
|
||||
int setlocator2(locnum, x, y)
|
||||
int locnum;
|
||||
double x, y;
|
||||
{
|
||||
return(set_locator_2(locnum, x, y));
|
||||
}
|
||||
|
||||
int setstroke(strokenum, bufsize, dist, time)
|
||||
int strokenum, bufsize, time;
|
||||
double dist;
|
||||
{
|
||||
return(set_stroke(strokenum, bufsize, dist, time));
|
||||
}
|
||||
|
||||
int setvaluator(valnum, init, low, high)
|
||||
int valnum;
|
||||
double init, low, high;
|
||||
{
|
||||
return(set_valuator(valnum, init, low, high));
|
||||
}
|
||||
|
||||
int terminatedevice(devclass, devnum)
|
||||
int devclass, devnum;
|
||||
{
|
||||
return(terminate_device(devclass, devnum));
|
||||
}
|
||||
103
usr.lib/libcorepas/inqinputpas.c
Normal file
103
usr.lib/libcorepas/inqinputpas.c
Normal file
@@ -0,0 +1,103 @@
|
||||
/*
|
||||
* Copyright (c) 1986, 1987, 1988, 1989 by Sun Microsystems, Inc.
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose and without fee is hereby granted, provided that the above
|
||||
* copyright notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice are retained, and that the name
|
||||
* of Sun Microsystems, Inc., not be used in advertising or publicity
|
||||
* pertaining to this software without specific, written prior permission.
|
||||
* Sun Microsystems, Inc., makes no representations about the suitability
|
||||
* of this software or the interface defined in this software for any
|
||||
* purpose. It is provided "as is" without express or implied warranty.
|
||||
*/
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)inqinputpas.c 1.1 94/10/31 Copyr 1983 Sun Micro";
|
||||
#endif
|
||||
|
||||
/*
|
||||
Copyright (c) 1983 by Sun Microsystems, Inc.
|
||||
*/
|
||||
|
||||
#include "f77strings.h"
|
||||
|
||||
int inquire_echo();
|
||||
int inquire_echo_position();
|
||||
int inquire_echo_surface();
|
||||
int inquire_keyboard();
|
||||
int inquire_locator_2();
|
||||
int inquire_stroke();
|
||||
int inquire_valuator();
|
||||
|
||||
int inqecho(devclass, devnum, echotype)
|
||||
int devclass, devnum, *echotype;
|
||||
{
|
||||
return(inquire_echo(devclass, devnum, echotype));
|
||||
}
|
||||
|
||||
int inqechoposition(devclass, devnum, x, y)
|
||||
int devclass, devnum;
|
||||
double *x, *y;
|
||||
{
|
||||
float tx,ty;
|
||||
int f;
|
||||
f=inquire_echo_position(devclass, devnum, &tx, &ty);
|
||||
*x=tx;
|
||||
*y=ty;
|
||||
return(f);
|
||||
}
|
||||
|
||||
#define DEVNAMESIZE 20
|
||||
|
||||
typedef struct {
|
||||
char screenname[DEVNAMESIZE];
|
||||
char windowname[DEVNAMESIZE];
|
||||
int fd;
|
||||
int (*dd)();
|
||||
int instance;
|
||||
int cmapsize;
|
||||
char cmapname[DEVNAMESIZE];
|
||||
int flags;
|
||||
char *ptr;
|
||||
} vwsurf;
|
||||
|
||||
int inqechosurface(devclass, devnum, surfname)
|
||||
int devclass, devnum;
|
||||
vwsurf *surfname;
|
||||
{
|
||||
return(inquire_echo_surface(devclass, devnum, *surfname));
|
||||
}
|
||||
|
||||
int inqkeyboard(keynum, bufsize, istr, length)
|
||||
int keynum, *bufsize, *length;
|
||||
char *istr;
|
||||
{
|
||||
char c, *sptr;
|
||||
int f, i;
|
||||
|
||||
f = inquire_keyboard(keynum, bufsize, istr, length);
|
||||
istr += *length;
|
||||
for (i = (*length+1); i < 257; i++)
|
||||
*++istr = ' ';
|
||||
return(f);
|
||||
}
|
||||
|
||||
int inqlocator2(locnum, x, y)
|
||||
int locnum;
|
||||
double *x, *y;
|
||||
{
|
||||
return(inquire_locator_2(locnum, x, y));
|
||||
}
|
||||
|
||||
int inqstroke(strokenum, bufsize, dist, time)
|
||||
int strokenum, *bufsize, *time;
|
||||
double *dist;
|
||||
{
|
||||
return(inquire_stroke(strokenum, bufsize, dist, time));
|
||||
}
|
||||
|
||||
int inqvaluator(valnum, init, low, high)
|
||||
int valnum;
|
||||
double *init, *low, *high;
|
||||
{
|
||||
return(inquire_valuator(valnum, init, low, high));
|
||||
}
|
||||
315
usr.lib/libcorepas/inqprimattpas.c
Normal file
315
usr.lib/libcorepas/inqprimattpas.c
Normal file
@@ -0,0 +1,315 @@
|
||||
/*
|
||||
* Copyright (c) 1986, 1987, 1988, 1989 by Sun Microsystems, Inc.
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose and without fee is hereby granted, provided that the above
|
||||
* copyright notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice are retained, and that the name
|
||||
* of Sun Microsystems, Inc., not be used in advertising or publicity
|
||||
* pertaining to this software without specific, written prior permission.
|
||||
* Sun Microsystems, Inc., makes no representations about the suitability
|
||||
* of this software or the interface defined in this software for any
|
||||
* purpose. It is provided "as is" without express or implied warranty.
|
||||
*/
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)inqprimattpas.c 1.1 94/10/31 Copyr 1983 Sun Micro";
|
||||
#endif
|
||||
|
||||
/*
|
||||
Copyright (c) 1983 by Sun Microsystems, Inc.
|
||||
*/
|
||||
|
||||
#include "pasarray.h"
|
||||
|
||||
int inquire_charjust();
|
||||
int inquire_charpath_2();
|
||||
int inquire_charpath_3();
|
||||
int inquire_charprecision();
|
||||
int inquire_charsize();
|
||||
int inquire_charspace();
|
||||
int inquire_charup_2();
|
||||
int inquire_charup_3();
|
||||
int inquire_color_indices();
|
||||
int inquire_fill_index();
|
||||
int inquire_font();
|
||||
int inquire_line_index();
|
||||
int inquire_linestyle();
|
||||
int inquire_linewidth();
|
||||
int inquire_marker_symbol();
|
||||
int inquire_pen();
|
||||
int inquire_pick_id();
|
||||
int inquire_polygon_edge_style();
|
||||
int inquire_polygon_interior_style();
|
||||
int inquire_primitive_attributes();
|
||||
int inquire_rasterop();
|
||||
int inquire_text_index();
|
||||
|
||||
int inqcharjust(chjust)
|
||||
int *chjust;
|
||||
{
|
||||
return(inquire_charjust(chjust));
|
||||
}
|
||||
|
||||
int inqcharpath2(dx, dy)
|
||||
double *dx, *dy;
|
||||
{
|
||||
float tdx, tdy;
|
||||
int f;
|
||||
f=inquire_charpath_2(&tdx, &tdy);
|
||||
*dx = tdx;
|
||||
*dy = tdy;
|
||||
return(f);
|
||||
}
|
||||
|
||||
int inqcharpath3(dx, dy, dz)
|
||||
double *dx, *dy, *dz;
|
||||
{
|
||||
float tdx, tdy, tdz;
|
||||
int f;
|
||||
f=inquire_charpath_3(&tdx, &tdy, &tdz);
|
||||
*dx = tdx;
|
||||
*dy = tdy;
|
||||
*dz = tdz;
|
||||
return(f);
|
||||
}
|
||||
|
||||
int inqcharprecision(chqualty)
|
||||
int *chqualty;
|
||||
{
|
||||
return(inquire_charprecision(chqualty));
|
||||
}
|
||||
|
||||
int inqcharsize(dx, dy)
|
||||
double *dx, *dy;
|
||||
{
|
||||
float tdx, tdy;
|
||||
int f;
|
||||
f=inquire_charsize(&tdx, &tdy);
|
||||
*dx = tdx;
|
||||
*dy = tdy;
|
||||
return(f);
|
||||
}
|
||||
|
||||
int inqcharspace(space)
|
||||
double *space;
|
||||
{
|
||||
float tspace;
|
||||
int f;
|
||||
f=inquire_charspace(&tspace);
|
||||
*space = tspace;
|
||||
return(f);
|
||||
}
|
||||
|
||||
int inqcharup2(dx, dy)
|
||||
double *dx, *dy;
|
||||
{
|
||||
float tdx, tdy;
|
||||
int f;
|
||||
f=inquire_charup_2(&tdx, &tdy);
|
||||
*dx = tdx;
|
||||
*dy = tdy;
|
||||
return(f);
|
||||
}
|
||||
|
||||
int inqcharup3(dx, dy, dz)
|
||||
double *dx, *dy, *dz;
|
||||
{
|
||||
float tdx, tdy, tdz;
|
||||
int f;
|
||||
f=inquire_charup_3(&tdx, &tdy, &tdz);
|
||||
*dx = tdx;
|
||||
*dy = tdy;
|
||||
*dz = tdz;
|
||||
return(f);
|
||||
}
|
||||
|
||||
#define DEVNAMESIZE 20
|
||||
|
||||
typedef struct {
|
||||
char screenname[DEVNAMESIZE];
|
||||
char windowname[DEVNAMESIZE];
|
||||
int fd;
|
||||
int (*dd)();
|
||||
int instance;
|
||||
int cmapsize;
|
||||
char cmapname[DEVNAMESIZE];
|
||||
int flags;
|
||||
char *ptr;
|
||||
} vwsurf;
|
||||
|
||||
int inqcolorindices(surf, i1, i2, red, grn, blu)
|
||||
int i1, i2;
|
||||
vwsurf *surf;
|
||||
double red[], grn[], blu[];
|
||||
{
|
||||
int i, result;
|
||||
|
||||
/* Pascal arrays are conventionally indexed from 1, so remap indices*/
|
||||
|
||||
i1--; /* Pascal arrays are conventionally ... */
|
||||
i2--; /* indexed from 1..N, so remap indices to 0..N-1 */
|
||||
|
||||
result = inquire_color_indices(surf, i1, i2, xcoort, ycoort, zcoort);
|
||||
for (i = i1; i <= i2; ++i) {
|
||||
red[i] = xcoort[i];
|
||||
grn[i] = ycoort[i];
|
||||
blu[i] = zcoort[i];
|
||||
}
|
||||
return(result);
|
||||
}
|
||||
|
||||
int inqfillindex(color)
|
||||
int *color;
|
||||
{
|
||||
return(inquire_fill_index(color)+1);
|
||||
}
|
||||
|
||||
int inqfont(font)
|
||||
int *font;
|
||||
{
|
||||
return(inquire_font(font));
|
||||
}
|
||||
|
||||
int inqlineindex(color)
|
||||
int *color;
|
||||
{
|
||||
return(inquire_line_index(color)+1);
|
||||
}
|
||||
|
||||
int inqlinestyle(linestyl)
|
||||
int *linestyl;
|
||||
{
|
||||
return(inquire_linestyle(linestyl));
|
||||
}
|
||||
|
||||
int inqlinewidth(linwidth)
|
||||
double *linwidth;
|
||||
{
|
||||
float tlinwidth;
|
||||
int f;
|
||||
f=inquire_linewidth(&tlinwidth);
|
||||
*linwidth = tlinwidth;
|
||||
return(f);
|
||||
}
|
||||
|
||||
int inqmarkersymbol(mark)
|
||||
int *mark;
|
||||
{
|
||||
return(inquire_marker_symbol(mark));
|
||||
}
|
||||
|
||||
int inqpen(pen)
|
||||
int *pen;
|
||||
{
|
||||
return(inquire_pen(pen));
|
||||
}
|
||||
|
||||
int inqpickid(pickid)
|
||||
int *pickid;
|
||||
{
|
||||
return(inquire_pick_id(pickid));
|
||||
}
|
||||
|
||||
int inqpolyedgestyle(polyedgstyl)
|
||||
int *polyedgstyl;
|
||||
{
|
||||
return(inquire_polygon_edge_style(polyedgstyl));
|
||||
}
|
||||
|
||||
int inqpolyintrstyle(polyintstyl)
|
||||
int *polyintstyl;
|
||||
{
|
||||
return(inquire_polygon_interior_style(polyintstyl));
|
||||
}
|
||||
|
||||
typedef struct { double p_x,p_y,p_z,p_w;} p_pt_type;
|
||||
typedef struct { double p_width, p_height; }p_aspect;
|
||||
|
||||
typedef struct { /* primitive attribute list structure */
|
||||
int p_lineindx;
|
||||
int p_fillindx;
|
||||
int p_textindx;
|
||||
int p_linestyl;
|
||||
int p_polyintstyl;
|
||||
int p_polyedgstyl;
|
||||
double p_linwidth;
|
||||
int p_pen;
|
||||
int p_font;
|
||||
p_aspect p_charsize;
|
||||
p_pt_type p_chrup, p_chrpath, p_chrspace;
|
||||
int p_chjust;
|
||||
int p_chqualty;
|
||||
int p_marker;
|
||||
int p_pickid;
|
||||
int p_rasterop;
|
||||
} p_primattr;
|
||||
|
||||
typedef struct { float x, y, z, w;} pt_type;
|
||||
typedef struct { float width, height; } aspect;
|
||||
|
||||
typedef struct { /* primitive attribute list structure */
|
||||
int lineindx;
|
||||
int fillindx;
|
||||
int textindx;
|
||||
int linestyl;
|
||||
int polyintstyl;
|
||||
int polyedgstyl;
|
||||
float linwidth;
|
||||
int pen;
|
||||
int font;
|
||||
aspect charsize;
|
||||
pt_type chrup, chrpath, chrspace;
|
||||
int chjust;
|
||||
int chqualty;
|
||||
int marker;
|
||||
int pickid;
|
||||
int rasterop;
|
||||
} primattr;
|
||||
|
||||
int inqprimattribs(defprim2)
|
||||
p_primattr *defprim2;
|
||||
{
|
||||
primattr defprim;
|
||||
int f;
|
||||
f=inquire_primitive_attributes(&defprim);
|
||||
defprim2->p_lineindx = defprim.lineindx + 1;
|
||||
defprim2->p_fillindx = defprim.fillindx + 1;
|
||||
defprim2->p_textindx = defprim.textindx + 1;
|
||||
defprim2->p_linestyl = defprim.linestyl;
|
||||
defprim2->p_polyintstyl = defprim.polyintstyl;
|
||||
defprim2->p_polyedgstyl = defprim.polyedgstyl;
|
||||
defprim2->p_linwidth = defprim.linwidth;
|
||||
defprim2->p_pen = defprim.pen;
|
||||
defprim2->p_font = defprim.font;
|
||||
defprim2->p_charsize.p_width =defprim.charsize.width;
|
||||
defprim2->p_charsize.p_height =defprim.charsize.height;
|
||||
defprim2->p_chrup.p_x = defprim.chrup.x;
|
||||
defprim2->p_chrup.p_y = defprim.chrup.y;
|
||||
defprim2->p_chrup.p_z = defprim.chrup.z;
|
||||
defprim2->p_chrup.p_w = defprim.chrup.w;
|
||||
defprim2->p_chrpath.p_x = defprim.chrpath.x;
|
||||
defprim2->p_chrpath.p_y = defprim.chrpath.y;
|
||||
defprim2->p_chrpath.p_z = defprim.chrpath.z;
|
||||
defprim2->p_chrpath.p_w = defprim.chrpath.w;
|
||||
defprim2->p_chrspace.p_x = defprim.chrspace.x;
|
||||
defprim2->p_chrspace.p_y = defprim.chrspace.y;
|
||||
defprim2->p_chrspace.p_z = defprim.chrspace.z;
|
||||
defprim2->p_chrspace.p_w = defprim.chrspace.w;
|
||||
defprim2->p_chjust = defprim.chjust;
|
||||
defprim2->p_chqualty = defprim.chqualty;
|
||||
defprim2->p_marker = defprim.marker;
|
||||
defprim2->p_pickid = defprim.pickid;
|
||||
defprim2->p_rasterop = defprim.rasterop;
|
||||
return(f);
|
||||
}
|
||||
|
||||
int inqrasterop(rasterop)
|
||||
int *rasterop;
|
||||
{
|
||||
return(inquire_rasterop(rasterop));
|
||||
}
|
||||
|
||||
int inqtextindex(color)
|
||||
int *color;
|
||||
{
|
||||
return(inquire_text_index(color)+1);
|
||||
}
|
||||
71
usr.lib/libcorepas/inqsegattpas.c
Normal file
71
usr.lib/libcorepas/inqsegattpas.c
Normal file
@@ -0,0 +1,71 @@
|
||||
/*
|
||||
* Copyright (c) 1986, 1987, 1988, 1989 by Sun Microsystems, Inc.
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose and without fee is hereby granted, provided that the above
|
||||
* copyright notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice are retained, and that the name
|
||||
* of Sun Microsystems, Inc., not be used in advertising or publicity
|
||||
* pertaining to this software without specific, written prior permission.
|
||||
* Sun Microsystems, Inc., makes no representations about the suitability
|
||||
* of this software or the interface defined in this software for any
|
||||
* purpose. It is provided "as is" without express or implied warranty.
|
||||
*/
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)inqsegattpas.c 1.1 94/10/31 Copyr 1983 Sun Micro";
|
||||
#endif
|
||||
|
||||
/*
|
||||
Copyright (c) 1983 by Sun Microsystems, Inc.
|
||||
*/
|
||||
|
||||
int inquire_image_transformation_type();
|
||||
int inquire_segment_detectability();
|
||||
int inquire_segment_highlighting();
|
||||
int inquire_segment_image_transformation_2();
|
||||
int inquire_segment_image_transformation_type();
|
||||
int inquire_segment_image_translate_2();
|
||||
int inquire_segment_visibility();
|
||||
|
||||
int inqimgxformtype(segtype)
|
||||
int *segtype;
|
||||
{
|
||||
return(inquire_image_transformation_type(segtype));
|
||||
}
|
||||
|
||||
int inqsegdetectable(segname, detectbl)
|
||||
int segname, *detectbl;
|
||||
{
|
||||
return(inquire_segment_detectability(segname, detectbl));
|
||||
}
|
||||
|
||||
int inqseghighlight(segname, highlght)
|
||||
int segname, *highlght;
|
||||
{
|
||||
return(inquire_segment_highlighting(segname, highlght));
|
||||
}
|
||||
|
||||
int inqsegimgxform2(segname, sx, sy, a, tx, ty)
|
||||
int segname;
|
||||
float *sx, *sy, *a, *tx, *ty;
|
||||
{
|
||||
return(inquire_segment_image_transformation_2(segname,sx,sy,a,tx,ty));
|
||||
}
|
||||
|
||||
int inqsegimgxfrmtyp(segname, segtype)
|
||||
int segname, *segtype;
|
||||
{
|
||||
return(inquire_segment_image_transformation_type(segname, segtype));
|
||||
}
|
||||
|
||||
int inqsegimgxlate2(segname, tx, ty)
|
||||
int segname;
|
||||
float *tx, *ty;
|
||||
{
|
||||
return(inquire_segment_image_translate_2(segname, tx, ty));
|
||||
}
|
||||
|
||||
int inqsegvisibility(segname, visbilty)
|
||||
int segname, *visbilty;
|
||||
{
|
||||
return(inquire_segment_visibility(segname, visbilty));
|
||||
}
|
||||
66
usr.lib/libcorepas/inqtextentpas.c
Normal file
66
usr.lib/libcorepas/inqtextentpas.c
Normal file
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* Copyright (c) 1986, 1987, 1988, 1989 by Sun Microsystems, Inc.
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose and without fee is hereby granted, provided that the above
|
||||
* copyright notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice are retained, and that the name
|
||||
* of Sun Microsystems, Inc., not be used in advertising or publicity
|
||||
* pertaining to this software without specific, written prior permission.
|
||||
* Sun Microsystems, Inc., makes no representations about the suitability
|
||||
* of this software or the interface defined in this software for any
|
||||
* purpose. It is provided "as is" without express or implied warranty.
|
||||
*/
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)inqtextentpas.c 1.1 94/10/31 Copyr 1983 Sun Micro";
|
||||
#endif
|
||||
|
||||
/*
|
||||
Copyright (c) 1983 by Sun Microsystems, Inc.
|
||||
*/
|
||||
|
||||
#include "f77strings.h"
|
||||
|
||||
int inquire_text_extent_2();
|
||||
int inquire_text_extent_3();
|
||||
|
||||
int inqtextextent2(s, dx, dy)
|
||||
char *s;
|
||||
double *dx, *dy;
|
||||
{
|
||||
char *sptr;
|
||||
char pasarg[257];
|
||||
int i,strlen;
|
||||
float tdx,tdy;
|
||||
|
||||
strlen = 256;
|
||||
sptr = s+256;
|
||||
while ((*--sptr) == ' ') {strlen--;};
|
||||
strncpy (pasarg,s,strlen);
|
||||
pasarg[strlen] = '\0';
|
||||
i = inquire_text_extent_2(pasarg, &tdx, &tdy);
|
||||
*dx=tdx;
|
||||
*dy=tdy;
|
||||
return(i);
|
||||
}
|
||||
|
||||
int inqtextextent3(s, dx, dy, dz)
|
||||
char *s;
|
||||
double *dx, *dy, *dz;
|
||||
{
|
||||
char *sptr;
|
||||
char pasarg[257];
|
||||
int i,strlen;
|
||||
float tdx,tdy,tdz;
|
||||
|
||||
strlen = 256;
|
||||
sptr = s+256;
|
||||
while ((*--sptr) == ' ') {strlen--;};
|
||||
strncpy (pasarg,s,strlen);
|
||||
pasarg[strlen] = '\0';
|
||||
i = inquire_text_extent_3(pasarg, &dx, &dy, &dz);
|
||||
*dx=tdx;
|
||||
*dy=tdy;
|
||||
*dz=tdz;
|
||||
return(i);
|
||||
}
|
||||
|
||||
359
usr.lib/libcorepas/inquirypas.c
Normal file
359
usr.lib/libcorepas/inquirypas.c
Normal file
@@ -0,0 +1,359 @@
|
||||
/*
|
||||
* Copyright (c) 1986, 1987, 1988, 1989 by Sun Microsystems, Inc.
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose and without fee is hereby granted, provided that the above
|
||||
* copyright notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice are retained, and that the name
|
||||
* of Sun Microsystems, Inc., not be used in advertising or publicity
|
||||
* pertaining to this software without specific, written prior permission.
|
||||
* Sun Microsystems, Inc., makes no representations about the suitability
|
||||
* of this software or the interface defined in this software for any
|
||||
* purpose. It is provided "as is" without express or implied warranty.
|
||||
*/
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)inquirypas.c 1.1 94/10/31 Copyr 1983 Sun Micro";
|
||||
#endif
|
||||
|
||||
/*
|
||||
Copyright (c) 1983 by Sun Microsystems, Inc.
|
||||
*/
|
||||
|
||||
#include "pasarray.h"
|
||||
|
||||
int inquire_inverse_composite_matrix();
|
||||
int inquire_ndc_space_2();
|
||||
int inquire_ndc_space_3();
|
||||
int inquire_open_retained_segment();
|
||||
int inquire_open_temporary_segment();
|
||||
int inquire_projection();
|
||||
int inquire_retained_segment_names();
|
||||
int inquire_retained_segment_surfaces();
|
||||
int inquire_view_depth();
|
||||
int inquire_view_plane_distance();
|
||||
int inquire_view_plane_normal();
|
||||
int inquire_view_reference_point();
|
||||
int inquire_view_up_2();
|
||||
int inquire_view_up_3();
|
||||
int inquire_viewing_control_parameters();
|
||||
int inquire_viewing_parameters();
|
||||
int inquire_viewport_2();
|
||||
int inquire_viewport_3();
|
||||
int inquire_window();
|
||||
int inquire_world_coordinate_matrix_2();
|
||||
int inquire_world_coordinate_matrix_3();
|
||||
|
||||
int inqinvcompmatrix(arrayptr)
|
||||
double arrayptr[];
|
||||
{
|
||||
int i, f;
|
||||
float dummy[16], *dptr;
|
||||
|
||||
f = inquire_inverse_composite_matrix(dummy);
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
dptr = dummy + i;
|
||||
*arrayptr++ = *dptr;
|
||||
dptr += 4;
|
||||
*arrayptr++ = *dptr;
|
||||
dptr += 4;
|
||||
*arrayptr++ = *dptr;
|
||||
dptr += 4;
|
||||
*arrayptr++ = *dptr;
|
||||
}
|
||||
return(f);
|
||||
}
|
||||
|
||||
int inqndcspace2(width, height)
|
||||
double *width, *height;
|
||||
{
|
||||
float pwidth, pheight;
|
||||
int f;
|
||||
f=inquire_ndc_space_2(&pwidth, &pheight);
|
||||
*width = pwidth;
|
||||
*height = pheight;
|
||||
return(f);
|
||||
}
|
||||
|
||||
int inqndcspace3(width, height, depth)
|
||||
double *width, *height, *depth;
|
||||
{
|
||||
float pwidth, pheight, pdepth;
|
||||
int f;
|
||||
f=inquire_ndc_space_3(&pwidth, &pheight, &pdepth);
|
||||
*width = pwidth;
|
||||
*height = pheight;
|
||||
*depth = pdepth;
|
||||
return(f);
|
||||
}
|
||||
|
||||
int inqopenretainseg(segname)
|
||||
int *segname;
|
||||
{
|
||||
return(inquire_open_retained_segment(segname));
|
||||
}
|
||||
|
||||
int inqopentempseg(open)
|
||||
int *open;
|
||||
{
|
||||
return(inquire_open_temporary_segment(open));
|
||||
}
|
||||
|
||||
int inqprojection(projection_type, dx_proj, dy_proj, dz_proj)
|
||||
int *projection_type;
|
||||
double *dx_proj, *dy_proj, *dz_proj;
|
||||
{
|
||||
float tx,ty,tz;
|
||||
int f;
|
||||
f=inquire_projection(projection_type, &tx, &ty, &tz);
|
||||
*dx_proj=tx;
|
||||
*dy_proj=ty;
|
||||
*dz_proj=tz;
|
||||
return(f);
|
||||
}
|
||||
|
||||
int inqretainsegname(listcnt, seglist, segcnt)
|
||||
int listcnt, seglist[], *segcnt;
|
||||
{
|
||||
return(inquire_retained_segment_names(listcnt, seglist, segcnt));
|
||||
}
|
||||
|
||||
int inqretainsegsurf(segname, arraycnt, surfaray, surfnum)
|
||||
int segname, arraycnt, *surfnum;
|
||||
struct vwsurf surfaray[];
|
||||
{
|
||||
return(inquire_retained_segment_surfaces(segname, arraycnt,
|
||||
surfaray, surfnum));
|
||||
}
|
||||
|
||||
int inqviewdepth(front_distance, back_distance)
|
||||
double *front_distance, *back_distance;
|
||||
{
|
||||
float tx,ty;
|
||||
int f;
|
||||
f=inquire_view_depth(&tx, &ty);
|
||||
*front_distance=tx;
|
||||
*back_distance=ty;
|
||||
return(f);
|
||||
}
|
||||
|
||||
int inqviewplanedist(view_distance)
|
||||
double *view_distance;
|
||||
{
|
||||
float tx;
|
||||
int f;
|
||||
f=inquire_view_plane_distance(&tx);
|
||||
*view_distance=tx;
|
||||
return(f);
|
||||
}
|
||||
|
||||
int inqviewplanenorm(dx_norm, dy_norm, dz_norm)
|
||||
double *dx_norm, *dy_norm, *dz_norm;
|
||||
{
|
||||
float tx,ty,tz;
|
||||
int f;
|
||||
f=inquire_view_plane_normal(&tx, &ty, &tz);
|
||||
*dx_norm=tx;
|
||||
*dy_norm=ty;
|
||||
*dz_norm=tz;
|
||||
return(f);
|
||||
}
|
||||
|
||||
int inqviewrefpoint(x_ref, y_ref, z_ref)
|
||||
double *x_ref, *y_ref, *z_ref;
|
||||
{
|
||||
float tx,ty,tz;
|
||||
int f;
|
||||
f=inquire_view_reference_point(&tx, &ty, &tz);
|
||||
*x_ref=tx;
|
||||
*y_ref=ty;
|
||||
*z_ref=tz;
|
||||
return(f);
|
||||
}
|
||||
|
||||
int inqviewup2(dx_up, dy_up)
|
||||
double *dx_up, *dy_up;
|
||||
{
|
||||
float tx,ty;
|
||||
int f;
|
||||
f=inquire_view_up_2(&tx, &ty);
|
||||
*dx_up=tx;
|
||||
*dy_up=ty;
|
||||
return(f);
|
||||
}
|
||||
|
||||
int inqviewup3(dx_up, dy_up, dz_up)
|
||||
double *dx_up, *dy_up, *dz_up;
|
||||
{
|
||||
float tx,ty,tz;
|
||||
int f;
|
||||
f=inquire_view_up_3(&tx, &ty, &tz);
|
||||
*dx_up=tx;
|
||||
*dy_up=ty;
|
||||
*dz_up=tz;
|
||||
return(f);
|
||||
}
|
||||
|
||||
int inqvwgcntrlparms(windowclip,frontclip, backclip, type)
|
||||
int *windowclip, *frontclip, *backclip, *type;
|
||||
{
|
||||
return(inquire_viewing_control_parameters(windowclip, frontclip,
|
||||
backclip, type));
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
double p_xmin, p_xmax, p_ymin, p_ymax; } p_windtype;
|
||||
typedef struct {
|
||||
double p_xmin, p_xmax, p_ymin, p_ymax, p_zmin, p_zmax; } p_porttype;
|
||||
|
||||
typedef struct {
|
||||
double p_vwrefpt[3];
|
||||
double p_vwplnorm[3];
|
||||
double p_viewdis;
|
||||
double p_frontdis;
|
||||
double p_backdis;
|
||||
int p_projtype;
|
||||
double p_projdir[3];
|
||||
p_windtype p_window;
|
||||
double p_vwupdir[3];
|
||||
p_porttype p_viewport;
|
||||
} p_vwprmtype;
|
||||
|
||||
typedef struct {
|
||||
float xmin, xmax, ymin, ymax; } windtype;
|
||||
typedef struct {
|
||||
float xmin,xmax,ymin,ymax,zmin,zmax; } porttype;
|
||||
|
||||
typedef struct {
|
||||
float vwrefpt[3];
|
||||
float vwplnorm[3];
|
||||
float viewdis;
|
||||
float frontdis;
|
||||
float backdis;
|
||||
int projtype;
|
||||
float projdir[3];
|
||||
windtype window;
|
||||
float vwupdir[3];
|
||||
porttype viewport;
|
||||
} vwprmtype;
|
||||
|
||||
int inqviewingparams(viewparm2)
|
||||
p_vwprmtype *viewparm2;
|
||||
{
|
||||
vwprmtype viewparm;
|
||||
int f;
|
||||
f=inquire_viewing_parameters(&viewparm);
|
||||
viewparm2->p_vwrefpt[1] = viewparm.vwrefpt[1];
|
||||
viewparm2->p_vwrefpt[2] = viewparm.vwrefpt[2];
|
||||
viewparm2->p_vwrefpt[3] = viewparm.vwrefpt[3];
|
||||
viewparm2->p_vwplnorm[1] = viewparm.vwplnorm[1];
|
||||
viewparm2->p_vwplnorm[2] = viewparm.vwplnorm[2];
|
||||
viewparm2->p_vwplnorm[3] = viewparm.vwplnorm[3];
|
||||
viewparm2->p_viewdis = viewparm.viewdis;
|
||||
viewparm2->p_frontdis = viewparm.frontdis;
|
||||
viewparm2->p_backdis = viewparm.backdis;
|
||||
viewparm2->p_projtype = viewparm.projtype;
|
||||
viewparm2->p_projdir[1] = viewparm.projdir[1];
|
||||
viewparm2->p_projdir[2] = viewparm.projdir[2];
|
||||
viewparm2->p_projdir[3] = viewparm.projdir[3];
|
||||
viewparm2->p_window.p_xmin = viewparm.window.xmin;
|
||||
viewparm2->p_window.p_xmax = viewparm.window.xmax;
|
||||
viewparm2->p_window.p_ymin = viewparm.window.ymin;
|
||||
viewparm2->p_window.p_ymax = viewparm.window.ymax;
|
||||
viewparm2->p_vwupdir[1] = viewparm.vwupdir[1];
|
||||
viewparm2->p_vwupdir[2] = viewparm.vwupdir[2];
|
||||
viewparm2->p_vwupdir[3] = viewparm.vwupdir[3];
|
||||
viewparm2->p_viewport.p_xmin = viewparm.viewport.xmin;
|
||||
viewparm2->p_viewport.p_xmin = viewparm.viewport.xmax;
|
||||
viewparm2->p_viewport.p_ymin = viewparm.viewport.ymin;
|
||||
viewparm2->p_viewport.p_ymax = viewparm.viewport.ymax;
|
||||
viewparm2->p_viewport.p_zmin = viewparm.viewport.zmin;
|
||||
viewparm2->p_viewport.p_zmax = viewparm.viewport.zmax;
|
||||
return(f);
|
||||
}
|
||||
|
||||
int inqviewport2(xmin, xmax, ymin, ymax)
|
||||
double *xmin, *xmax, *ymin, *ymax;
|
||||
{
|
||||
float xminf, xmaxf, yminf, ymaxf;
|
||||
int f;
|
||||
f=inquire_viewport_2(&xminf, &xmaxf, &yminf, &ymaxf);
|
||||
*xmin = xminf;
|
||||
*xmax = xmaxf;
|
||||
*ymin = yminf;
|
||||
*ymax = ymaxf;
|
||||
return(f);
|
||||
}
|
||||
|
||||
int inqviewport3(xmin, xmax, ymin, ymax, zmin, zmax)
|
||||
double *xmin, *xmax, *ymin, *ymax, *zmin, *zmax;
|
||||
{
|
||||
float xminf, xmaxf, yminf, ymaxf, zminf, zmaxf;
|
||||
int f;
|
||||
f=inquire_viewport_3(&xminf, &xmaxf, &yminf, &ymaxf, &zminf, &zmaxf);
|
||||
*xmin = xminf;
|
||||
*xmax = xmaxf;
|
||||
*ymin = yminf;
|
||||
*ymax = ymaxf;
|
||||
*zmin = zminf;
|
||||
*zmax = zmaxf;
|
||||
return(f);
|
||||
}
|
||||
|
||||
int inqwindow(umin, umax, vmin, vmax)
|
||||
double *umin, *umax, *vmin, *vmax;
|
||||
{
|
||||
float uminf, umaxf, vminf, vmaxf;
|
||||
int f;
|
||||
f=inquire_window(&uminf, &umaxf, &vminf, &vmaxf);
|
||||
*umin = uminf;
|
||||
*umax = umaxf;
|
||||
*vmin = vminf;
|
||||
*vmax = vmaxf;
|
||||
return(f);
|
||||
}
|
||||
|
||||
int inqworldmatrix2(wmat)
|
||||
double *wmat;
|
||||
{
|
||||
int i, f;
|
||||
float dummy[9], *dptr;
|
||||
|
||||
f = inquire_world_coordinate_matrix_2(dummy);
|
||||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
dptr = dummy + i;
|
||||
*wmat++ = *dptr;
|
||||
dptr += 3;
|
||||
*wmat++ = *dptr;
|
||||
dptr += 3;
|
||||
*wmat++ = *dptr;
|
||||
}
|
||||
return(f);
|
||||
}
|
||||
|
||||
int inqworldmatrix3(wmat)
|
||||
double *wmat;
|
||||
{
|
||||
int i, f;
|
||||
float dummy[16], *dptr;
|
||||
|
||||
f = inquire_world_coordinate_matrix_3(dummy);
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
dptr = dummy + i;
|
||||
*wmat++ = *dptr;
|
||||
dptr += 4;
|
||||
*wmat++ = *dptr;
|
||||
dptr += 4;
|
||||
*wmat++ = *dptr;
|
||||
dptr += 4;
|
||||
*wmat++ = *dptr;
|
||||
}
|
||||
return(f);
|
||||
}
|
||||
|
||||
int pasloc(surfname)
|
||||
int (*surfname)();
|
||||
{
|
||||
return((int)surfname);
|
||||
}
|
||||
70
usr.lib/libcorepas/ndctowldpas.c
Normal file
70
usr.lib/libcorepas/ndctowldpas.c
Normal file
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
* Copyright (c) 1986, 1987, 1988, 1989 by Sun Microsystems, Inc.
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose and without fee is hereby granted, provided that the above
|
||||
* copyright notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice are retained, and that the name
|
||||
* of Sun Microsystems, Inc., not be used in advertising or publicity
|
||||
* pertaining to this software without specific, written prior permission.
|
||||
* Sun Microsystems, Inc., makes no representations about the suitability
|
||||
* of this software or the interface defined in this software for any
|
||||
* purpose. It is provided "as is" without express or implied warranty.
|
||||
*/
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)ndctowldpas.c 1.1 94/10/31 Copyr 1983 Sun Micro";
|
||||
#endif
|
||||
|
||||
/*
|
||||
Copyright (c) 1983 by Sun Microsystems, Inc.
|
||||
*/
|
||||
|
||||
int map_ndc_to_world_2();
|
||||
int map_ndc_to_world_3();
|
||||
int map_world_to_ndc_2();
|
||||
int map_world_to_ndc_3();
|
||||
|
||||
int mapndctoworld2(ndcx, ndcy, wldx, wldy)
|
||||
double ndcx, ndcy, *wldx, *wldy;
|
||||
{
|
||||
float tx,ty;
|
||||
int f;
|
||||
f=map_ndc_to_world_2(ndcx, ndcy, &tx, &ty);
|
||||
*wldx=tx;
|
||||
*wldy=ty;
|
||||
return(f);
|
||||
}
|
||||
|
||||
int mapndctoworld3(ndcx, ndcy, ndcz, wldx, wldy, wldz)
|
||||
double ndcx, ndcy, ndcz, *wldx, *wldy, *wldz;
|
||||
{
|
||||
float tx,ty,tz;
|
||||
int f;
|
||||
f=map_ndc_to_world_3(ndcx, ndcy, ndcz, &tx, &ty, &tz);
|
||||
*wldx=tx;
|
||||
*wldy=ty;
|
||||
*wldz=tz;
|
||||
return(f);
|
||||
}
|
||||
|
||||
int mapworldtondc2(wldx, wldy, ndcx, ndcy)
|
||||
double wldx, wldy, *ndcx, *ndcy;
|
||||
{
|
||||
float tx,ty;
|
||||
int f;
|
||||
f=map_world_to_ndc_2(wldx, wldy, &tx, &ty);
|
||||
*ndcx=tx;
|
||||
*ndcy=ty;
|
||||
return(f);
|
||||
}
|
||||
|
||||
int mapworldtondc3(wldx, wldy, wldz, ndcx, ndcy, ndcz)
|
||||
double wldx, wldy, wldz, *ndcx, *ndcy, *ndcz;
|
||||
{
|
||||
float tx,ty,tz;
|
||||
int f;
|
||||
f=map_world_to_ndc_3(wldx, wldy, wldz, &tx, &ty, &tz);
|
||||
*ndcx=tx;
|
||||
*ndcy=ty;
|
||||
*ndcz=tz;
|
||||
return(f);
|
||||
}
|
||||
27
usr.lib/libcorepas/newframepas.c
Normal file
27
usr.lib/libcorepas/newframepas.c
Normal file
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Copyright (c) 1986, 1987, 1988, 1989 by Sun Microsystems, Inc.
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose and without fee is hereby granted, provided that the above
|
||||
* copyright notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice are retained, and that the name
|
||||
* of Sun Microsystems, Inc., not be used in advertising or publicity
|
||||
* pertaining to this software without specific, written prior permission.
|
||||
* Sun Microsystems, Inc., makes no representations about the suitability
|
||||
* of this software or the interface defined in this software for any
|
||||
* purpose. It is provided "as is" without express or implied warranty.
|
||||
*/
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)newframepas.c 1.1 94/10/31 Copyr 1983 Sun Micro";
|
||||
#endif
|
||||
|
||||
/*
|
||||
Copyright (c) 1983 by Sun Microsystems, Inc.
|
||||
*/
|
||||
|
||||
int new_frame();
|
||||
|
||||
int newframe(dummy)
|
||||
int dummy;
|
||||
{
|
||||
return(new_frame());
|
||||
}
|
||||
88
usr.lib/libcorepas/outprim2pas.c
Normal file
88
usr.lib/libcorepas/outprim2pas.c
Normal file
@@ -0,0 +1,88 @@
|
||||
/*
|
||||
* Copyright (c) 1986, 1987, 1988, 1989 by Sun Microsystems, Inc.
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose and without fee is hereby granted, provided that the above
|
||||
* copyright notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice are retained, and that the name
|
||||
* of Sun Microsystems, Inc., not be used in advertising or publicity
|
||||
* pertaining to this software without specific, written prior permission.
|
||||
* Sun Microsystems, Inc., makes no representations about the suitability
|
||||
* of this software or the interface defined in this software for any
|
||||
* purpose. It is provided "as is" without express or implied warranty.
|
||||
*/
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)outprim2pas.c 1.1 94/10/31 Copyr 1983 Sun Micro";
|
||||
#endif
|
||||
|
||||
/*
|
||||
Copyright (c) 1983 by Sun Microsystems, Inc.
|
||||
*/
|
||||
|
||||
#include "pasarray.h"
|
||||
|
||||
int inquire_current_position_2();
|
||||
int line_abs_2();
|
||||
int line_rel_2();
|
||||
int move_abs_2();
|
||||
int move_rel_2();
|
||||
polyline_abs_2();
|
||||
polyline_rel_2();
|
||||
|
||||
int inqcurrpos2(x, y)
|
||||
double *x, *y;
|
||||
{
|
||||
float tx, ty;
|
||||
int f;
|
||||
f=inquire_current_position_2(&tx, &ty);
|
||||
*x=tx;
|
||||
*y=ty;
|
||||
return(f);
|
||||
}
|
||||
|
||||
int lineabs2(x, y)
|
||||
double x, y;
|
||||
{
|
||||
return(line_abs_2(x, y));
|
||||
}
|
||||
|
||||
int linerel2(dx, dy)
|
||||
double dx, dy;
|
||||
{
|
||||
return(line_rel_2(dx, dy));
|
||||
}
|
||||
|
||||
int moveabs2(x, y)
|
||||
double x, y;
|
||||
{
|
||||
return(move_abs_2(x, y));
|
||||
}
|
||||
|
||||
int moverel2(dx, dy)
|
||||
double dx, dy;
|
||||
{
|
||||
return(move_rel_2(dx, dy));
|
||||
}
|
||||
|
||||
int polylineabs2(xcoord, ycoord, n)
|
||||
double xcoord[], ycoord[];
|
||||
int n;
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < n; ++i) {
|
||||
xcoort[i] = xcoord[i];
|
||||
ycoort[i] = ycoord[i];
|
||||
}
|
||||
return(polyline_abs_2(xcoort, ycoort, n));
|
||||
}
|
||||
|
||||
int polylinerel2(xcoord, ycoord, n)
|
||||
double xcoord[], ycoord[];
|
||||
int n;
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < n; ++i) {
|
||||
xcoort[i] = xcoord[i];
|
||||
ycoort[i] = ycoord[i];
|
||||
}
|
||||
return(polyline_rel_2(xcoort, ycoort, n));
|
||||
}
|
||||
91
usr.lib/libcorepas/outprim3pas.c
Normal file
91
usr.lib/libcorepas/outprim3pas.c
Normal file
@@ -0,0 +1,91 @@
|
||||
/*
|
||||
* Copyright (c) 1986, 1987, 1988, 1989 by Sun Microsystems, Inc.
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose and without fee is hereby granted, provided that the above
|
||||
* copyright notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice are retained, and that the name
|
||||
* of Sun Microsystems, Inc., not be used in advertising or publicity
|
||||
* pertaining to this software without specific, written prior permission.
|
||||
* Sun Microsystems, Inc., makes no representations about the suitability
|
||||
* of this software or the interface defined in this software for any
|
||||
* purpose. It is provided "as is" without express or implied warranty.
|
||||
*/
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)outprim3pas.c 1.1 94/10/31 Copyr 1983 Sun Micro";
|
||||
#endif
|
||||
|
||||
/*
|
||||
Copyright (c) 1983 by Sun Microsystems, Inc.
|
||||
*/
|
||||
|
||||
#include "pasarray.h"
|
||||
|
||||
int inquire_current_position_3();
|
||||
int line_abs_3();
|
||||
int line_rel_3();
|
||||
int move_abs_3();
|
||||
int move_rel_3();
|
||||
int polyline_abs_3();
|
||||
int polyline_rel_3();
|
||||
|
||||
int inqcurrpos3(x, y, z)
|
||||
double *x, *y, *z;
|
||||
{
|
||||
float tx, ty, tz;
|
||||
int f;
|
||||
f=inquire_current_position_3(&tx, &ty, &tz);
|
||||
*x=tx;
|
||||
*y=ty;
|
||||
*z=tz;
|
||||
return(f);
|
||||
}
|
||||
|
||||
int lineabs3(x, y, z)
|
||||
double x, y, z;
|
||||
{
|
||||
return(line_abs_3(x, y, z));
|
||||
}
|
||||
|
||||
int linerel3(dx, dy, dz)
|
||||
double dx, dy, dz;
|
||||
{
|
||||
return(line_rel_3(dx, dy, dz));
|
||||
}
|
||||
|
||||
int moveabs3(x, y, z)
|
||||
double x, y, z;
|
||||
{
|
||||
return(move_abs_3(x, y, z));
|
||||
}
|
||||
|
||||
int moverel3(dx, dy, dz)
|
||||
double dx, dy, dz;
|
||||
{
|
||||
return(move_rel_3(dx, dy, dz));
|
||||
}
|
||||
|
||||
int polylineabs3(xcoord, ycoord, zcoord, n)
|
||||
double xcoord[], ycoord[], zcoord[];
|
||||
int n;
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < n; ++i) {
|
||||
xcoort[i] = xcoord[i];
|
||||
ycoort[i] = ycoord[i];
|
||||
zcoort[i] = zcoord[i];
|
||||
}
|
||||
return(polyline_abs_3(xcoort, ycoort, zcoort, n));
|
||||
}
|
||||
|
||||
int polylinerel3(xcoord, ycoord, zcoord, n)
|
||||
double xcoord[], ycoord[], zcoord[];
|
||||
int n;
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < n; ++i) {
|
||||
xcoort[i] = xcoord[i];
|
||||
ycoort[i] = ycoord[i];
|
||||
zcoort[i] = zcoord[i];
|
||||
}
|
||||
return(polyline_rel_3(xcoort, ycoort, zcoort, n));
|
||||
}
|
||||
16
usr.lib/libcorepas/pasarray.h
Normal file
16
usr.lib/libcorepas/pasarray.h
Normal file
@@ -0,0 +1,16 @@
|
||||
/* @(#)pasarray.h 1.1 94/10/31 SMI */
|
||||
/*
|
||||
* Copyright (c) 1986, 1987, 1988, 1989 by Sun Microsystems, Inc.
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose and without fee is hereby granted, provided that the above
|
||||
* copyright notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice are retained, and that the name
|
||||
* of Sun Microsystems, Inc., not be used in advertising or publicity
|
||||
* pertaining to this software without specific, written prior permission.
|
||||
* Sun Microsystems, Inc., makes no representations about the suitability
|
||||
* of this software or the interface defined in this software for any
|
||||
* purpose. It is provided "as is" without express or implied warranty.
|
||||
*/
|
||||
#define U_BOUND 255
|
||||
float xcoort[U_BOUND], ycoort[U_BOUND], zcoort[U_BOUND];
|
||||
int xint[U_BOUND];
|
||||
48
usr.lib/libcorepas/polygon2pas.c
Normal file
48
usr.lib/libcorepas/polygon2pas.c
Normal file
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* Copyright (c) 1986, 1987, 1988, 1989 by Sun Microsystems, Inc.
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose and without fee is hereby granted, provided that the above
|
||||
* copyright notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice are retained, and that the name
|
||||
* of Sun Microsystems, Inc., not be used in advertising or publicity
|
||||
* pertaining to this software without specific, written prior permission.
|
||||
* Sun Microsystems, Inc., makes no representations about the suitability
|
||||
* of this software or the interface defined in this software for any
|
||||
* purpose. It is provided "as is" without express or implied warranty.
|
||||
*/
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)polygon2pas.c 1.1 94/10/31 Copyr 1983 Sun Micro";
|
||||
#endif
|
||||
|
||||
/*
|
||||
Copyright (c) 1983 by Sun Microsystems, Inc.
|
||||
*/
|
||||
|
||||
#include "pasarray.h"
|
||||
|
||||
int polygon_abs_2();
|
||||
int polygon_rel_2();
|
||||
|
||||
int polygonabs2(xlist, ylist, n)
|
||||
double xlist[], ylist[];
|
||||
int n;
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < n; ++i) {
|
||||
xcoort[i] = xlist[i];
|
||||
ycoort[i] = ylist[i];
|
||||
}
|
||||
return(polygon_abs_2(xcoort, ycoort, n));
|
||||
}
|
||||
|
||||
int polygonrel2(xlist, ylist, n)
|
||||
double xlist[], ylist[];
|
||||
int n;
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < n; ++i) {
|
||||
xcoort[i] = xlist[i];
|
||||
ycoort[i] = ylist[i];
|
||||
}
|
||||
return(polygon_rel_2(xcoort, ycoort, n));
|
||||
}
|
||||
91
usr.lib/libcorepas/polygon3pas.c
Normal file
91
usr.lib/libcorepas/polygon3pas.c
Normal file
@@ -0,0 +1,91 @@
|
||||
/*
|
||||
* Copyright (c) 1986, 1987, 1988, 1989 by Sun Microsystems, Inc.
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose and without fee is hereby granted, provided that the above
|
||||
* copyright notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice are retained, and that the name
|
||||
* of Sun Microsystems, Inc., not be used in advertising or publicity
|
||||
* pertaining to this software without specific, written prior permission.
|
||||
* Sun Microsystems, Inc., makes no representations about the suitability
|
||||
* of this software or the interface defined in this software for any
|
||||
* purpose. It is provided "as is" without express or implied warranty.
|
||||
*/
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)polygon3pas.c 1.1 94/10/31 Copyr 1983 Sun Micro";
|
||||
#endif
|
||||
|
||||
/*
|
||||
Copyright (c) 1983 by Sun Microsystems, Inc.
|
||||
*/
|
||||
|
||||
#include "pasarray.h"
|
||||
|
||||
int polygon_abs_3();
|
||||
int polygon_rel_3();
|
||||
int set_light_direction();
|
||||
int set_shading_parameters();
|
||||
int set_vertex_indices();
|
||||
int set_vertex_normals();
|
||||
|
||||
int polygonabs3(xlist, ylist, zlist, n)
|
||||
double xlist[], ylist[], zlist[];
|
||||
int n;
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < n; ++i) {
|
||||
xcoort[i] = xlist[i];
|
||||
ycoort[i] = ylist[i];
|
||||
zcoort[i] = zlist[i];
|
||||
}
|
||||
return(polygon_abs_3(xcoort, ycoort, zcoort, n));
|
||||
}
|
||||
|
||||
int polygonrel3(xlist, ylist, zlist, n)
|
||||
double xlist[], ylist[], zlist[];
|
||||
int n;
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < n; ++i) {
|
||||
xcoort[i] = xlist[i];
|
||||
ycoort[i] = ylist[i];
|
||||
zcoort[i] = zlist[i];
|
||||
}
|
||||
return(polygon_rel_3(xcoort, ycoort, zcoort, n));
|
||||
}
|
||||
|
||||
int setlightdirect(dx, dy, dz)
|
||||
double dx, dy, dz;
|
||||
{
|
||||
return(set_light_direction(dx, dy, dz));
|
||||
}
|
||||
|
||||
int setshadingparams(amb, dif, spec, flood, bump, hue, style)
|
||||
double amb, dif, spec, flood, bump;
|
||||
int hue, style;
|
||||
{
|
||||
return(set_shading_parameters(amb, dif, spec, flood,
|
||||
bump, hue, style));
|
||||
}
|
||||
|
||||
int setvertexindices(indxlist, n)
|
||||
int indxlist[], n;
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < n; ++i) {
|
||||
xint[i] = indxlist[i];
|
||||
}
|
||||
return(set_vertex_indices(xint, n));
|
||||
}
|
||||
|
||||
int setvertexnormals(dxlist, dylist, dzlist, n)
|
||||
int n;
|
||||
double dxlist[], dylist[], dzlist[];
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < n; ++i) {
|
||||
xcoort[i] = dxlist[i];
|
||||
ycoort[i] = dylist[i];
|
||||
zcoort[i] = dzlist[i];
|
||||
}
|
||||
return(set_vertex_normals(xcoort, ycoort, zcoort, n));
|
||||
}
|
||||
59
usr.lib/libcorepas/rasterfiopas.c
Normal file
59
usr.lib/libcorepas/rasterfiopas.c
Normal file
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* Copyright (c) 1986, 1987, 1988, 1989 by Sun Microsystems, Inc.
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose and without fee is hereby granted, provided that the above
|
||||
* copyright notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice are retained, and that the name
|
||||
* of Sun Microsystems, Inc., not be used in advertising or publicity
|
||||
* pertaining to this software without specific, written prior permission.
|
||||
* Sun Microsystems, Inc., makes no representations about the suitability
|
||||
* of this software or the interface defined in this software for any
|
||||
* purpose. It is provided "as is" without express or implied warranty.
|
||||
*/
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)rasterfiopas.c 1.1 94/10/31 Copyr 1983 Sun Micro";
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983 by Sun Microsystems, Inc.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
int file_to_raster();
|
||||
int raster_to_file();
|
||||
FILE *ACTFILE();
|
||||
char *UNIT();
|
||||
|
||||
typedef struct { /* RASTER, pixel coords */
|
||||
int width, height, depth; /* width, height in pixels, bits/pixl */
|
||||
short *bits;
|
||||
} rast_type;
|
||||
|
||||
typedef struct { /* colormap struct */
|
||||
int type, nbytes;
|
||||
char *data;
|
||||
} colormap_type;
|
||||
|
||||
|
||||
int filetoraster(rasfid, raster, map)
|
||||
char *rasfid;
|
||||
rast_type *raster;
|
||||
colormap_type *map;
|
||||
{
|
||||
int fid;
|
||||
fid= fileno(ACTFILE(UNIT(rasfid)));
|
||||
return(file_to_raster(fid, raster, map));
|
||||
}
|
||||
|
||||
int rastertofile(raster, map, rasfid, n)
|
||||
rast_type *raster;
|
||||
colormap_type *map;
|
||||
char *rasfid;
|
||||
int n;
|
||||
{
|
||||
int fid;
|
||||
fid= fileno(ACTFILE(UNIT(rasfid)));
|
||||
return(raster_to_file(raster, map, fid, n));
|
||||
}
|
||||
|
||||
80
usr.lib/libcorepas/rasterprimpas.c
Normal file
80
usr.lib/libcorepas/rasterprimpas.c
Normal file
@@ -0,0 +1,80 @@
|
||||
/*
|
||||
* Copyright (c) 1986, 1987, 1988, 1989 by Sun Microsystems, Inc.
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose and without fee is hereby granted, provided that the above
|
||||
* copyright notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice are retained, and that the name
|
||||
* of Sun Microsystems, Inc., not be used in advertising or publicity
|
||||
* pertaining to this software without specific, written prior permission.
|
||||
* Sun Microsystems, Inc., makes no representations about the suitability
|
||||
* of this software or the interface defined in this software for any
|
||||
* purpose. It is provided "as is" without express or implied warranty.
|
||||
*/
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)rasterprimpas.c 1.1 94/10/31 Copyr 1983 Sun Micro";
|
||||
#endif
|
||||
|
||||
/*
|
||||
Copyright (c) 1983 by Sun Microsystems, Inc.
|
||||
*/
|
||||
|
||||
int allocate_raster();
|
||||
int free_raster();
|
||||
int get_raster();
|
||||
int put_raster();
|
||||
int size_raster();
|
||||
|
||||
typedef struct { /* RASTER, pixel coords */
|
||||
int width, height, depth; /* width, height in pixels, bits/pixl */
|
||||
short *bits;
|
||||
} rast_type;
|
||||
|
||||
#define DEVNAMESIZE 20
|
||||
|
||||
typedef struct {
|
||||
char screenname[DEVNAMESIZE];
|
||||
char windowname[DEVNAMESIZE];
|
||||
int fd;
|
||||
int (*dd)();
|
||||
int instance;
|
||||
int cmapsize;
|
||||
char cmapname[DEVNAMESIZE];
|
||||
int flags;
|
||||
char *ptr;
|
||||
} vwsurf;
|
||||
|
||||
int allocateraster(rptr)
|
||||
rast_type *rptr;
|
||||
{
|
||||
return(allocate_raster(rptr));
|
||||
}
|
||||
|
||||
int freeraster(rptr)
|
||||
rast_type *rptr;
|
||||
{
|
||||
return(free_raster(rptr));
|
||||
}
|
||||
|
||||
int getraster(surfname, xmin, xmax, ymin, ymax, xd, yd, raster)
|
||||
vwsurf *surfname;
|
||||
double xmin, xmax, ymin, ymax;
|
||||
int xd, yd;
|
||||
rast_type *raster;
|
||||
{
|
||||
return(get_raster(surfname, xmin, xmax, ymin, ymax,
|
||||
xd, yd, raster));
|
||||
}
|
||||
|
||||
int putraster(srast)
|
||||
rast_type *srast;
|
||||
{
|
||||
return(put_raster(srast));
|
||||
}
|
||||
|
||||
int sizeraster(surfname, xmin, xmax, ymin, ymax, raster)
|
||||
vwsurf *surfname;
|
||||
double xmin, xmax, ymin, ymax;
|
||||
rast_type *raster;
|
||||
{
|
||||
return(size_raster(surfname, xmin, xmax, ymin, ymax, raster));
|
||||
}
|
||||
58
usr.lib/libcorepas/savesegpas.c
Normal file
58
usr.lib/libcorepas/savesegpas.c
Normal file
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* Copyright (c) 1986, 1987, 1988, 1989 by Sun Microsystems, Inc.
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose and without fee is hereby granted, provided that the above
|
||||
* copyright notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice are retained, and that the name
|
||||
* of Sun Microsystems, Inc., not be used in advertising or publicity
|
||||
* pertaining to this software without specific, written prior permission.
|
||||
* Sun Microsystems, Inc., makes no representations about the suitability
|
||||
* of this software or the interface defined in this software for any
|
||||
* purpose. It is provided "as is" without express or implied warranty.
|
||||
*/
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)savesegpas.c 1.1 94/10/31 Copyr 1983 Sun Micro";
|
||||
#endif
|
||||
|
||||
/*
|
||||
Copyright (c) 1983 by Sun Microsystems, Inc.
|
||||
*/
|
||||
|
||||
#include "f77strings.h"
|
||||
|
||||
int restore_segment();
|
||||
int save_segment();
|
||||
|
||||
int restoresegment(segname, filename)
|
||||
char *filename;
|
||||
int segname;
|
||||
{
|
||||
char *sptr;
|
||||
char pasarg[257];
|
||||
int i,strlen;
|
||||
|
||||
strlen = 256;
|
||||
sptr = filename+256;
|
||||
while ((*--sptr) == ' ') {strlen--;};
|
||||
strncpy (pasarg,filename,strlen);
|
||||
pasarg[strlen] = '\0';
|
||||
i = restore_segment(segname,filename);
|
||||
return(i);
|
||||
}
|
||||
|
||||
int savesegment(segnum, filename)
|
||||
char *filename;
|
||||
int segnum;
|
||||
{
|
||||
char *sptr;
|
||||
char pasarg[257];
|
||||
int i,strlen;
|
||||
|
||||
strlen = 256;
|
||||
sptr = filename+256;
|
||||
while ((*--sptr) == ' ') {strlen--;};
|
||||
strncpy (pasarg,filename,strlen);
|
||||
pasarg[strlen] = '\0';
|
||||
i = save_segment(segnum,pasarg);
|
||||
return(i);
|
||||
}
|
||||
71
usr.lib/libcorepas/segatt3pas.c
Normal file
71
usr.lib/libcorepas/segatt3pas.c
Normal file
@@ -0,0 +1,71 @@
|
||||
/*
|
||||
* Copyright (c) 1986, 1987, 1988, 1989 by Sun Microsystems, Inc.
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose and without fee is hereby granted, provided that the above
|
||||
* copyright notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice are retained, and that the name
|
||||
* of Sun Microsystems, Inc., not be used in advertising or publicity
|
||||
* pertaining to this software without specific, written prior permission.
|
||||
* Sun Microsystems, Inc., makes no representations about the suitability
|
||||
* of this software or the interface defined in this software for any
|
||||
* purpose. It is provided "as is" without express or implied warranty.
|
||||
*/
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)segatt3pas.c 1.1 94/10/31 Copyr 1983 Sun Micro";
|
||||
#endif
|
||||
|
||||
/*
|
||||
Copyright (c) 1983 by Sun Microsystems, Inc.
|
||||
*/
|
||||
|
||||
int inquire_segment_image_transformation_3();
|
||||
int inquire_segment_image_translate_3();
|
||||
int set_segment_image_transformation_3();
|
||||
int set_segment_image_translate_3();
|
||||
|
||||
int inqsegimgxform3(segname, sx, sy, sz, rx, ry, rz, tx, ty, tz)
|
||||
int segname;
|
||||
double *sx, *sy, *sz, *rx, *ry, *rz, *tx, *ty, *tz;
|
||||
{
|
||||
float x1,y1,z1,x2,y2,z2,x3,y3,z3;
|
||||
int f;
|
||||
f=inquire_segment_image_translate_3(segname, &x1, &y1, &z1, &x2, &y2, &z2, &x3, &y3, &z3);
|
||||
*sx=x1;
|
||||
*sy=y1;
|
||||
*sz=z1;
|
||||
*rx=x2;
|
||||
*ry=y2;
|
||||
*rz=z2;
|
||||
*tx=x3;
|
||||
*ty=y3;
|
||||
*tz=z3;
|
||||
return(f);
|
||||
}
|
||||
|
||||
int inqsegimgxlate3(segname, tx, ty, tz)
|
||||
int segname;
|
||||
double *tx, *ty, *tz;
|
||||
{
|
||||
float x1,y1,z1;
|
||||
int f;
|
||||
f=inquire_segment_image_translate_3(segname, &x1, &y1, &z1);
|
||||
*tx=x1;
|
||||
*ty=y1;
|
||||
*tz=z1;
|
||||
return(f);
|
||||
}
|
||||
|
||||
int setsegimgxform3(segname, sx, sy, sz, rx, ry, rz, tx, ty, tz)
|
||||
int segname;
|
||||
double sx, sy, sz, rx, ry, rz, tx, ty, tz;
|
||||
{
|
||||
return(set_segment_image_transformation_3(segname, sx, sy, sz,
|
||||
rx, ry, rz, tx, ty, tz));
|
||||
}
|
||||
|
||||
int setsegimgxlate3(segname, dx, dy, dz)
|
||||
int segname;
|
||||
double dx, dy, dz;
|
||||
{
|
||||
return(set_segment_image_translate_3(segname, dx, dy, dz));
|
||||
}
|
||||
150
usr.lib/libcorepas/segdefspas.c
Normal file
150
usr.lib/libcorepas/segdefspas.c
Normal file
@@ -0,0 +1,150 @@
|
||||
/*
|
||||
* Copyright (c) 1986, 1987, 1988, 1989 by Sun Microsystems, Inc.
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose and without fee is hereby granted, provided that the above
|
||||
* copyright notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice are retained, and that the name
|
||||
* of Sun Microsystems, Inc., not be used in advertising or publicity
|
||||
* pertaining to this software without specific, written prior permission.
|
||||
* Sun Microsystems, Inc., makes no representations about the suitability
|
||||
* of this software or the interface defined in this software for any
|
||||
* purpose. It is provided "as is" without express or implied warranty.
|
||||
*/
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)segdefspas.c 1.1 94/10/31 Copyr 1983 Sun Micro";
|
||||
#endif
|
||||
|
||||
/*
|
||||
Copyright (c) 1983 by Sun Microsystems, Inc.
|
||||
*/
|
||||
|
||||
int inquire_detectability();
|
||||
int inquire_highlighting();
|
||||
int inquire_image_transformation_2();
|
||||
int inquire_image_transformation_3();
|
||||
int inquire_image_translate_2();
|
||||
int inquire_image_translate_3();
|
||||
int inquire_visibility();
|
||||
int set_detectability();
|
||||
int set_highlighting();
|
||||
int set_image_transformation_2();
|
||||
int set_image_transformation_3();
|
||||
int set_image_translate_2();
|
||||
int set_image_translate_3();
|
||||
int set_visibility();
|
||||
|
||||
int inqdetectability(detectability)
|
||||
int *detectability;
|
||||
{
|
||||
return(inquire_detectability(detectability));
|
||||
}
|
||||
|
||||
int inqhighlighting(highlighting)
|
||||
int *highlighting;
|
||||
{
|
||||
return(inquire_highlighting(highlighting));
|
||||
}
|
||||
|
||||
int inqimgtransform2(sx, sy, a, tx, ty)
|
||||
double *sx, *sy, *a, *tx, *ty;
|
||||
{
|
||||
float x1,y1,ta,x2,y2;
|
||||
int f;
|
||||
f=inquire_image_transformation_2(&x1, &y1, &ta, &x2, &y2);
|
||||
*sx=x1;
|
||||
*sy=y1;
|
||||
*a=ta;
|
||||
*tx=x2;
|
||||
*ty=y2;
|
||||
return(f);
|
||||
}
|
||||
|
||||
int inqimgtransform3(sx, sy, sz, ax, ay, az, tx, ty, tz)
|
||||
double *sx, *sy, *sz, *ax, *ay, *az, *tx, *ty, *tz;
|
||||
{
|
||||
float x1,y1,z1,x2,y2,z2,x3,y3,z3;
|
||||
int f;
|
||||
f=inquire_image_transformation_3(&x1, &y1, &z1, &x2, &y2, &z2, &x3, &y3, &z3);
|
||||
*sx=x1;
|
||||
*sy=y1;
|
||||
*sz=z1;
|
||||
*ax=x2;
|
||||
*ay=y2;
|
||||
*az=z2;
|
||||
*tx=x3;
|
||||
*ty=y3;
|
||||
*tz=z3;
|
||||
return(f);
|
||||
}
|
||||
|
||||
int inqimgtranslate2(tx, ty)
|
||||
double *tx, *ty;
|
||||
{
|
||||
float x1,y1;
|
||||
int f;
|
||||
f=inquire_image_translate_2(&x1, &y1);
|
||||
*tx=x1;
|
||||
*ty=y1;
|
||||
return(f);
|
||||
}
|
||||
|
||||
int inqimgtranslate3(tx, ty, tz)
|
||||
double *tx, *ty, *tz;
|
||||
{
|
||||
float x1,y1,z1;
|
||||
int f;
|
||||
f=inquire_image_translate_3(&x1, &y1, &z1);
|
||||
*tx=x1;
|
||||
*ty=y1;
|
||||
*tz=z1;
|
||||
return(f);
|
||||
}
|
||||
|
||||
int inqvisibility(visibility)
|
||||
int *visibility;
|
||||
{
|
||||
return(inquire_visibility(visibility));
|
||||
}
|
||||
|
||||
int setdetectability(detectability)
|
||||
int detectability;
|
||||
{
|
||||
return(set_detectability(detectability));
|
||||
}
|
||||
|
||||
int sethighlighting(highlighting)
|
||||
int highlighting;
|
||||
{
|
||||
return(set_highlighting(highlighting));
|
||||
}
|
||||
|
||||
int setimgtransform2(sx, sy, a, tx, ty)
|
||||
double sx, sy, a, tx, ty;
|
||||
{
|
||||
return(set_image_transformation_2(sx, sy, a, tx, ty));
|
||||
}
|
||||
|
||||
int setimgtransform3(sx, sy, sz, ax, ay, az, tx, ty, tz)
|
||||
double sx, sy, sz, ax, ay, az, tx, ty, tz;
|
||||
{
|
||||
return(set_image_transformation_3(sx, sy, sz, ax, ay,
|
||||
az, tx, ty, tz));
|
||||
}
|
||||
|
||||
int setimgtranslate2(tx, ty)
|
||||
double tx, ty;
|
||||
{
|
||||
return(set_image_translate_2(tx, ty));
|
||||
}
|
||||
|
||||
int setimgtranslate3(tx, ty, tz)
|
||||
double tx, ty, tz;
|
||||
{
|
||||
return(set_image_translate_3(tx, ty, tz));
|
||||
}
|
||||
|
||||
int setvisibility(visibility)
|
||||
int visibility;
|
||||
{
|
||||
return(set_visibility(visibility));
|
||||
}
|
||||
40
usr.lib/libcorepas/segmentspas.c
Normal file
40
usr.lib/libcorepas/segmentspas.c
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Copyright (c) 1986, 1987, 1988, 1989 by Sun Microsystems, Inc.
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose and without fee is hereby granted, provided that the above
|
||||
* copyright notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice are retained, and that the name
|
||||
* of Sun Microsystems, Inc., not be used in advertising or publicity
|
||||
* pertaining to this software without specific, written prior permission.
|
||||
* Sun Microsystems, Inc., makes no representations about the suitability
|
||||
* of this software or the interface defined in this software for any
|
||||
* purpose. It is provided "as is" without express or implied warranty.
|
||||
*/
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)segmentspas.c 1.1 94/10/31 Copyr 1983 Sun Micro";
|
||||
#endif
|
||||
|
||||
/*
|
||||
Copyright (c) 1983 by Sun Microsystems, Inc.
|
||||
*/
|
||||
|
||||
int delete_all_retained_segments();
|
||||
int delete_retained_segment();
|
||||
int rename_retained_segment();
|
||||
|
||||
int delallretainsegs()
|
||||
{
|
||||
return(delete_all_retained_segments());
|
||||
}
|
||||
|
||||
int delretainsegment(segname)
|
||||
int segname;
|
||||
{
|
||||
return(delete_retained_segment(segname));
|
||||
}
|
||||
|
||||
int renameretainseg(segname, newname)
|
||||
int segname, newname;
|
||||
{
|
||||
return(rename_retained_segment(segname, newname));
|
||||
}
|
||||
289
usr.lib/libcorepas/setprimattpas.c
Normal file
289
usr.lib/libcorepas/setprimattpas.c
Normal file
@@ -0,0 +1,289 @@
|
||||
/*
|
||||
* Copyright (c) 1986, 1987, 1988, 1989 by Sun Microsystems, Inc.
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose and without fee is hereby granted, provided that the above
|
||||
* copyright notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice are retained, and that the name
|
||||
* of Sun Microsystems, Inc., not be used in advertising or publicity
|
||||
* pertaining to this software without specific, written prior permission.
|
||||
* Sun Microsystems, Inc., makes no representations about the suitability
|
||||
* of this software or the interface defined in this software for any
|
||||
* purpose. It is provided "as is" without express or implied warranty.
|
||||
*/
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)setprimattpas.c 1.1 94/10/31 Copyr 1983 Sun Micro";
|
||||
#endif
|
||||
|
||||
/*
|
||||
Copyright (c) 1983 by Sun Microsystems, Inc.
|
||||
*/
|
||||
|
||||
#include "pasarray.h"
|
||||
|
||||
int define_color_indices();
|
||||
int set_charjust();
|
||||
int set_charpath_2();
|
||||
int set_charpath_3();
|
||||
int set_charprecision();
|
||||
int set_charsize();
|
||||
int set_charspace();
|
||||
int set_charup_2();
|
||||
int set_charup_3();
|
||||
int set_drag();
|
||||
int set_fill_index();
|
||||
int set_font();
|
||||
int set_line_index();
|
||||
int set_linestyle();
|
||||
int set_linewidth();
|
||||
int set_marker_symbol();
|
||||
int set_pen();
|
||||
int set_pick_id();
|
||||
int set_polygon_edge_style();
|
||||
int set_polygon_interior_style();
|
||||
int set_primitive_attributes();
|
||||
int set_rasterop();
|
||||
int set_text_index();
|
||||
|
||||
#define DEVNAMESIZE 20
|
||||
|
||||
typedef struct {
|
||||
char screenname[DEVNAMESIZE];
|
||||
char windowname[DEVNAMESIZE];
|
||||
int fd;
|
||||
int (*dd)();
|
||||
int instance;
|
||||
int cmapsize;
|
||||
char cmapname[DEVNAMESIZE];
|
||||
int flags;
|
||||
char *ptr;
|
||||
} vwsurf;
|
||||
|
||||
int defcolorindices(surf, i1, i2, red, grn, blu)
|
||||
int i1, i2;
|
||||
vwsurf *surf;
|
||||
double red[], grn[], blu[];
|
||||
|
||||
{
|
||||
int i;
|
||||
|
||||
/* map array indiced from [1..N] (Pascal convention) to [0..N-1] */
|
||||
/* 'C' convention */
|
||||
i1--;
|
||||
i2--;
|
||||
for (i = i1; i <= i2; ++i) {
|
||||
xcoort[i] = red[i];
|
||||
ycoort[i] = grn[i];
|
||||
zcoort[i] = blu[i];
|
||||
}
|
||||
return(define_color_indices(surf, i1, i2, xcoort, ycoort,zcoort));
|
||||
}
|
||||
|
||||
int setcharjust(chjust)
|
||||
int chjust;
|
||||
{
|
||||
return(set_charjust(chjust));
|
||||
}
|
||||
|
||||
int setcharpath2(dx, dy)
|
||||
double dx, dy;
|
||||
{
|
||||
return(set_charpath_2(dx, dy));
|
||||
}
|
||||
|
||||
int setcharpath3(dx, dy, dz)
|
||||
double dx, dy, dz;
|
||||
{
|
||||
return(set_charpath_3(dx, dy, dz));
|
||||
}
|
||||
|
||||
int setcharprecision(chqualty)
|
||||
int chqualty;
|
||||
{
|
||||
return(set_charprecision(chqualty));
|
||||
}
|
||||
|
||||
int setcharsize(chwidth, cheight)
|
||||
double chwidth, cheight;
|
||||
{
|
||||
float tchwidth, tcheight;
|
||||
tchwidth = chwidth;
|
||||
tcheight = cheight;
|
||||
return(set_charsize(tchwidth, tcheight));
|
||||
}
|
||||
|
||||
int setcharspace(space)
|
||||
double space;
|
||||
{
|
||||
return(set_charspace(space));
|
||||
}
|
||||
|
||||
int setcharup2(dx, dy)
|
||||
double dx, dy;
|
||||
{
|
||||
return(set_charup_2(dx, dy));
|
||||
}
|
||||
|
||||
int setcharup3(dx, dy, dz)
|
||||
double dx, dy, dz;
|
||||
{
|
||||
return(set_charup_3(dx, dy, dz));
|
||||
}
|
||||
|
||||
int setdrag(drag)
|
||||
int drag;
|
||||
{
|
||||
return(set_drag(drag));
|
||||
}
|
||||
|
||||
int setfillindex(color)
|
||||
int color;
|
||||
{
|
||||
return(set_fill_index(color-1));
|
||||
}
|
||||
|
||||
int setfont(font)
|
||||
int font;
|
||||
{
|
||||
return(set_font(font));
|
||||
}
|
||||
|
||||
int setlineindex(color)
|
||||
int color;
|
||||
{
|
||||
/* Pascal indexes are [1..N] map to [0..N-1] */
|
||||
return(set_line_index(color-1));
|
||||
}
|
||||
|
||||
int setlinestyle(linestyl)
|
||||
int linestyl;
|
||||
{
|
||||
return(set_linestyle(linestyl));
|
||||
}
|
||||
|
||||
int setlinewidth(linwidth)
|
||||
double linwidth;
|
||||
{
|
||||
return(set_linewidth(linwidth));
|
||||
}
|
||||
|
||||
int setmarkersymbol(mark)
|
||||
int mark;
|
||||
{
|
||||
return(set_marker_symbol(mark));
|
||||
}
|
||||
|
||||
int setpen(pen)
|
||||
int pen;
|
||||
{
|
||||
return(set_pen(pen));
|
||||
}
|
||||
|
||||
int setpickid(pickid)
|
||||
int pickid;
|
||||
{
|
||||
return(set_pick_id(pickid));
|
||||
}
|
||||
|
||||
int setpolyedgestyle(polyedgstyl)
|
||||
int polyedgstyl;
|
||||
{
|
||||
return(set_polygon_edge_style(polyedgstyl));
|
||||
}
|
||||
|
||||
int setpolyintrstyle(polyintstyl)
|
||||
int polyintstyl;
|
||||
{
|
||||
return(set_polygon_interior_style(polyintstyl));
|
||||
}
|
||||
|
||||
typedef struct { double x,y,z,w;} pt_type;
|
||||
typedef struct { double width, height;} aspect;
|
||||
|
||||
typedef struct { /* primitive attribute list structure */
|
||||
int lineindx;
|
||||
int fillindx;
|
||||
int textindx;
|
||||
int linestyl;
|
||||
int polyintstyl;
|
||||
int polyedgstyl;
|
||||
float linwidth;
|
||||
int pen;
|
||||
int font;
|
||||
aspect charsize;
|
||||
pt_type chrup, chrpath, chrspace;
|
||||
int chjust;
|
||||
int chqualty;
|
||||
int marker;
|
||||
int pickid;
|
||||
int rasterop;
|
||||
} primattr;
|
||||
|
||||
typedef struct { double p_x,p_y,p_z,p_w;} p_pt_type;
|
||||
typedef struct { double p_width, p_height;} p_aspect;
|
||||
|
||||
typedef struct { /* primitive attribute list structure */
|
||||
int p_lineindx;
|
||||
int p_fillindx;
|
||||
int p_textindx;
|
||||
int p_linestyl;
|
||||
int p_polyintstyl;
|
||||
int p_polyedgstyl;
|
||||
double p_linwidth;
|
||||
int p_pen;
|
||||
int p_font;
|
||||
p_aspect p_charsize;
|
||||
p_pt_type p_chrup, p_chrpath, p_chrspace;
|
||||
int p_chjust;
|
||||
int p_chqualty;
|
||||
int p_marker;
|
||||
int p_pickid;
|
||||
int p_rasterop;
|
||||
} p_primattr;
|
||||
|
||||
int setprimattribs(defprim2)
|
||||
p_primattr *defprim2;
|
||||
{
|
||||
primattr *defprim;
|
||||
defprim->lineindx = defprim2->p_lineindx - 1;
|
||||
defprim->fillindx = defprim2->p_fillindx - 1;
|
||||
defprim->textindx = defprim2->p_textindx - 1;
|
||||
defprim->linestyl = defprim2->p_linestyl;
|
||||
defprim->polyintstyl = defprim2->p_polyintstyl;
|
||||
defprim->polyedgstyl = defprim2->p_polyedgstyl;
|
||||
defprim->linwidth = defprim2->p_linwidth;
|
||||
defprim->pen = defprim2->p_pen;
|
||||
defprim->font = defprim2->p_font;
|
||||
defprim->charsize.width = defprim2->p_charsize.p_width;
|
||||
defprim->charsize.height = defprim2->p_charsize.p_height;
|
||||
defprim->chrup.x = defprim2->p_chrup.p_x;
|
||||
defprim->chrup.y = defprim2->p_chrup.p_y;
|
||||
defprim->chrup.z = defprim2->p_chrup.p_z;
|
||||
defprim->chrup.w = defprim2->p_chrup.p_w;
|
||||
defprim->chrpath.x = defprim2->p_chrpath.p_x;
|
||||
defprim->chrpath.y = defprim2->p_chrpath.p_y;
|
||||
defprim->chrpath.z = defprim2->p_chrpath.p_z;
|
||||
defprim->chrpath.w = defprim2->p_chrpath.p_w;
|
||||
defprim->chrspace.x = defprim2->p_chrspace.p_x;
|
||||
defprim->chrspace.y = defprim2->p_chrspace.p_y;
|
||||
defprim->chrspace.z = defprim2->p_chrspace.p_z;
|
||||
defprim->chrspace.w = defprim2->p_chrspace.p_w;
|
||||
defprim->chjust = defprim2->p_chjust;
|
||||
defprim->chqualty = defprim2->p_chqualty;
|
||||
defprim->marker = defprim2->p_marker;
|
||||
defprim->pickid = defprim2->p_pickid;
|
||||
defprim->rasterop = defprim2->p_rasterop;
|
||||
return(set_primitive_attributes(defprim));
|
||||
}
|
||||
|
||||
int setrasterop(flag)
|
||||
int flag;
|
||||
{
|
||||
return(set_rasterop(flag));
|
||||
}
|
||||
|
||||
int settextindex(color)
|
||||
int color;
|
||||
{
|
||||
return(set_text_index(color-1));
|
||||
}
|
||||
|
||||
57
usr.lib/libcorepas/setsegattpas.c
Normal file
57
usr.lib/libcorepas/setsegattpas.c
Normal file
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Copyright (c) 1986, 1987, 1988, 1989 by Sun Microsystems, Inc.
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose and without fee is hereby granted, provided that the above
|
||||
* copyright notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice are retained, and that the name
|
||||
* of Sun Microsystems, Inc., not be used in advertising or publicity
|
||||
* pertaining to this software without specific, written prior permission.
|
||||
* Sun Microsystems, Inc., makes no representations about the suitability
|
||||
* of this software or the interface defined in this software for any
|
||||
* purpose. It is provided "as is" without express or implied warranty.
|
||||
*/
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)setsegattpas.c 1.1 94/10/31 Copyr 1983 Sun Micro";
|
||||
#endif
|
||||
|
||||
/*
|
||||
Copyright (c) 1983 by Sun Microsystems, Inc.
|
||||
*/
|
||||
|
||||
int set_segment_detectability();
|
||||
int set_segment_highlighting();
|
||||
int set_segment_image_transformation_2();
|
||||
int set_segment_image_translate_2();
|
||||
int set_segment_visibility();
|
||||
|
||||
int setsegdetectable(segname, detectbl)
|
||||
int segname, detectbl;
|
||||
{
|
||||
return(set_segment_detectability(segname, detectbl));
|
||||
}
|
||||
|
||||
int setseghighlight(segname, highlght)
|
||||
int segname, highlght;
|
||||
{
|
||||
return(set_segment_highlighting(segname, highlght));
|
||||
}
|
||||
|
||||
int setsegimgxform2(segname, sx, sy, a, tx, ty)
|
||||
int segname;
|
||||
double sx, sy, a, tx, ty;
|
||||
{
|
||||
return(set_segment_image_transformation_2(segname,sx,sy,a,tx,ty));
|
||||
}
|
||||
|
||||
int setsegimgxlate2(segname, tx, ty)
|
||||
int segname;
|
||||
double tx, ty;
|
||||
{
|
||||
return(set_segment_image_translate_2(segname, tx, ty));
|
||||
}
|
||||
|
||||
int setsegvisibility(segname, visbilty)
|
||||
int segname, visbilty;
|
||||
{
|
||||
return(set_segment_visibility(segname, visbilty));
|
||||
}
|
||||
346
usr.lib/libcorepas/sunpas.h
Normal file
346
usr.lib/libcorepas/sunpas.h
Normal file
@@ -0,0 +1,346 @@
|
||||
/* @(#)sunpas.h 1.1 94/10/31 SMI */
|
||||
/*
|
||||
* Copyright (c) 1986, 1987, 1988, 1989 by Sun Microsystems, Inc.
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose and without fee is hereby granted, provided that the above
|
||||
* copyright notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice are retained, and that the name
|
||||
* of Sun Microsystems, Inc., not be used in advertising or publicity
|
||||
* pertaining to this software without specific, written prior permission.
|
||||
* Sun Microsystems, Inc., makes no representations about the suitability
|
||||
* of this software or the interface defined in this software for any
|
||||
* purpose. It is provided "as is" without express or implied warranty.
|
||||
*/
|
||||
function allocateraster(var rptr:rasttyp):integer; external;
|
||||
function awaitanybutton(tim:integer;
|
||||
var buttonnum:integer):integer; external;
|
||||
function awtbuttongetloc2(time:integer; locatornum:integer;
|
||||
var buttonnum:integer; var x:real;
|
||||
var y:real):integer; external;
|
||||
function awtbuttongetval(time:integer; valnum:integer;
|
||||
var buttonnum:integer; var val:real):
|
||||
integer; external;
|
||||
function awaitkeyboard(tim:integer;keynum:integer;var sptr:cct;
|
||||
var length:integer):integer; external;
|
||||
function awaitpick(time:integer; picknum:integer;
|
||||
var segnam:integer; var pickid:integer)
|
||||
:integer; external;
|
||||
function awaitstroke2(tim:integer;picknum:integer;asize:integer;var x:parr;
|
||||
var y:parr;numxy:integer):integer; external;
|
||||
function beginbatchupdate:integer; external;
|
||||
function closeretainseg:integer; external;
|
||||
function closetempseg:integer; external;
|
||||
function createretainseg(segname:integer):integer; external;
|
||||
function createtempseg:integer; external;
|
||||
function defcolorindices(var surfacename:vwsurf;
|
||||
i1:integer;i2:integer;
|
||||
var r:parr;var g:parr;var b:parr
|
||||
):integer; external;
|
||||
function delallretainsegs:integer; external;
|
||||
function delretainsegment(segname:integer):integer; external;
|
||||
function deselectvwsurf(var surfacename:vwsurf
|
||||
):integer; external;
|
||||
function endbatchupdate:integer; external;
|
||||
function filetoraster(var rasfid:text; var rptr:rasttyp;
|
||||
var map:cmap):integer; external;
|
||||
function freeraster(var rptr:rasttyp):integer; external;
|
||||
function getmousestate(devclass:integer;devnum:integer;
|
||||
var x:real;var y:real;var buttons:integer)
|
||||
:integer; external;
|
||||
function getraster(var surfacename :vwsurf;
|
||||
xmin:real;xmax:real;ymin:real;ymax:real;
|
||||
xd:integer;yd:integer;var rptr:rasttyp):integer;
|
||||
external;
|
||||
function getviewsurface(var surfacename:vwsurf):integer; external;
|
||||
function initializecore(outputlevel:integer;
|
||||
inputlevel:integer;
|
||||
dimension:integer):integer; external;
|
||||
function initializedevice(deviceclass:integer;
|
||||
devicenum:integer):integer; external;
|
||||
function initializevwsurf(var surfacename:vwsurf; typ:integer
|
||||
):integer; external;
|
||||
function inqcharjust(var chjust:integer):integer; external;
|
||||
function inqcharpath2(var x:real;var y:real):integer; external;
|
||||
function inqcharpath3(var x:real;var y:real;var z:real):integer; external;
|
||||
function inqcharprecision(var chquality:integer):integer; external;
|
||||
function inqcharsize(var width:real;var height:real):integer; external;
|
||||
function inqcharspace(var space:real):integer; external;
|
||||
function inqcharup2(var x:real;var y:real):integer; external;
|
||||
function inqcharup3(var x:real;var y:real;var z:real):integer; external;
|
||||
function inqcolorindices(var surfacename:vwsurf;
|
||||
i1:integer;i2:integer;
|
||||
var r:parr;var g:parr;var b:parr
|
||||
):integer; external;
|
||||
function inqcurrpos2(var x:real;var y:real):integer; external;
|
||||
function inqcurrpos3(var x:real;var y:real;var z:real):integer; external;
|
||||
function inqdetectability(var detect:integer):integer; external;
|
||||
function inqecho(devclass:integer;devnum:integer;
|
||||
var echotype:integer):integer; external;
|
||||
function inqechoposition(devclass:integer;devnum:integer;
|
||||
var x:real;var y:real):integer; external;
|
||||
function inqechosurface(devclass:integer;devnum:integer;
|
||||
var surfacename:vwsurf):integer; external;
|
||||
function inqfillindex(var color:integer):integer; external;
|
||||
function inqfont(var font:integer):integer; external;
|
||||
function inqhighlighting(var highlight:integer):integer; external;
|
||||
function inqimgtransform2(var sx:real; var sy:real;var a:real
|
||||
;var tx:real; var ty:real
|
||||
):integer; external;
|
||||
function inqimgtransform3(var sx:real; var sy:real;var sz:real
|
||||
;var ax:real; var ay:real;var az:real
|
||||
;var tx:real; var ty:real;var tz:real
|
||||
):integer; external;
|
||||
function inqimgxformtype(var segtype:integer):integer; external;
|
||||
function inqimgtranslate2(var tx:real; var ty:real):integer; external;
|
||||
function inqimgtranslate3(var tx:real; var ty:real;var tz:real
|
||||
):integer; external;
|
||||
function inqinvcompmatrix(var iarray:ivarray):integer; external;
|
||||
function inqkeyboard(keynum:integer;var bufsize:integer;var string:cct;
|
||||
var pos:integer):integer; external;
|
||||
function inqlineindex(var color:integer):integer; external;
|
||||
function inqlinestyle(var linestyle:integer):integer; external;
|
||||
function inqlinewidth(var linewidth:real):integer; external;
|
||||
function inqlocator2(locnum:integer;
|
||||
var x:real;var y:real):integer; external;
|
||||
function inqmarkersymbol(var mark:integer):integer; external;
|
||||
function inqndcspace2(var width:real;var height:real):integer; external;
|
||||
function inqndcspace3(var width:real;var height:real;var
|
||||
depth:real):integer; external;
|
||||
function inqopenretainseg(var segname:integer):integer; external;
|
||||
function inqopentempseg(var open:integer):integer; external;
|
||||
function inqpen(var pen:integer):integer; external;
|
||||
function inqpickid(var pick:integer):integer; external;
|
||||
function inqpolyedgestyle(var pestyle:integer):integer; external;
|
||||
function inqpolyintrstyle(var pistyle:integer):integer; external;
|
||||
function inqprimattribs(var defprim:primattr):integer; external;
|
||||
function inqprojection(var ptype:integer; var dx:real; var dy:real;
|
||||
var dz:real):integer; external;
|
||||
function inqrasterop(var rastop:integer):integer; external;
|
||||
function inqretainsegname(arraycnt:integer; var seglist:iarr;
|
||||
var segcnt:integer):integer; external;
|
||||
function inqretainsegsurf(segname:integer; arraycnt:integer; var surflist:vwarr;
|
||||
var surfcnt:integer):integer; external;
|
||||
function inqsegdetectable(segname:integer;var dtable:integer)
|
||||
:integer; external;
|
||||
function inqseghighlight(segname:integer;var highlight:integer)
|
||||
:integer; external;
|
||||
function inqsegimgxform2(segname:integer;var sx:real;var sy:real;
|
||||
var a:real;var tx:real;var ty:real
|
||||
):integer; external;
|
||||
function inqsegimgxform3(segname:integer;var sx:real;var sy:real;
|
||||
var sz:real;var rx:real;var ry:real;
|
||||
var rz:real;var tx:real;var ty:real;var tz:real
|
||||
):integer; external;
|
||||
function inqsegimgxfrmtyp(segname:integer;var segtype:integer)
|
||||
:integer; external;
|
||||
function inqsegimgxlate2(segname:integer;var tx:real;var ty:real)
|
||||
:integer; external;
|
||||
function inqsegimgxlate3(segname:integer;var sx:real;var sy:real;
|
||||
var sz:real):integer; external;
|
||||
function inqsegvisibility(segname:integer;var visible:integer):
|
||||
integer; external;
|
||||
function inqstroke(strokenum:integer;var bufsize:integer;var
|
||||
dist:real;var time:integer):integer; external;
|
||||
function inqtextextent2(var string:cct;var dx:real; var dy:real
|
||||
):integer; external;
|
||||
function inqtextextent3(var string:cct;var dx:real; var dy:real
|
||||
; var dz:real):integer; external;
|
||||
function inqtextindex(var color:integer):integer; external;
|
||||
function inqvaluator(valnum:integer;var init:real;var low:real;var high:real)
|
||||
:integer; external;
|
||||
function inqviewdepth(var fdist:real;var bdist:real)
|
||||
:integer; external;
|
||||
function inqviewplanedist(var vdist:real):integer; external;
|
||||
function inqviewplanenorm(var dx:real; var dy:real;
|
||||
var dz:real):integer; external;
|
||||
function inqviewrefpoint(var rx:real; var ry:real;
|
||||
var rz:real):integer; external;
|
||||
function inqviewup2(var dx:real; var dy:real
|
||||
):integer; external;
|
||||
function inqviewup3(var dx:real; var dy:real;
|
||||
var dz:real):integer; external;
|
||||
function inqvwgcntrlparms(var wclip:integer;var fclip:integer;
|
||||
var bclip:integer;var typ:integer)
|
||||
:integer; external;
|
||||
function inqviewingparams(var viewparm:vwprmtype):integer; external;
|
||||
function inqviewport2(var xmin:real; var xmax:real;var ymin:real;var ymax:real
|
||||
):integer; external;
|
||||
function inqviewport3(var xmin:real; var xmax:real;var ymin:real;var ymax:real
|
||||
;var zmin:real;var zmax:real)
|
||||
:integer; external;
|
||||
function inqvisibility(var visible:integer)
|
||||
:integer; external;
|
||||
function inqwindow(var umin:real; var umax:real;var vmin:real;var vmax:real
|
||||
):integer; external;
|
||||
function inqworldmatrix2(var iarray:ivarray1):integer; external;
|
||||
function inqworldmatrix3(var iarray:ivarray):integer; external;
|
||||
function lineabs2(x:real;y:real):integer; external;
|
||||
function lineabs3(x:real;y:real;z:real):integer; external;
|
||||
function linerel2(x:real;y:real):integer; external;
|
||||
function linerel3(x:real;y:real;z:real):integer; external;
|
||||
function mapndctoworld2(ndx:real; ndy:real;
|
||||
var wldx:real; var wldy:real)
|
||||
:integer; external;
|
||||
function mapndctoworld3(ndx:real; ndy:real; ndz:real;
|
||||
var wldx:real; var wldy:real
|
||||
; var wldz:real)
|
||||
:integer; external;
|
||||
function mapworldtondc2(wldx:real; wldy:real;
|
||||
var ndx:real; var ndy:real)
|
||||
:integer; external;
|
||||
function mapworldtondc3(wldx:real; wldy:real; wldz:real;
|
||||
var ndx:real; var ndy:real
|
||||
; var ndz:real
|
||||
):integer; external;
|
||||
function markerabs2(mx:real;my:real):integer; external;
|
||||
function markerabs3(mx:real; my:real;mz:real):integer; external;
|
||||
function markerrel2(dx:real;dy:real):integer; external;
|
||||
function markerrel3(dx:real; dy:real;dz:real):integer; external;
|
||||
function moveabs2(x:real;y:real):integer; external;
|
||||
function moveabs3(x:real;y:real;z:real):integer; external;
|
||||
function moverel2(x:real;y:real):integer; external;
|
||||
function moverel3(x:real;y:real;z:real):integer; external;
|
||||
function newframe:integer; external;
|
||||
function pasloc(function f:integer):integer; external;
|
||||
function polygonabs2(var xcoor:parr; var ycoor:parr;
|
||||
n:integer):integer; external;
|
||||
function polygonabs3(var xcoor:parr; var ycoor:parr;var zcoor:parr;
|
||||
n:integer):integer; external;
|
||||
function polygonrel2(var xcoor:parr; var ycoor:parr;
|
||||
n:integer):integer; external;
|
||||
function polygonrel3(var xcoor:parr; var ycoor:parr;var zcoor:parr;
|
||||
n:integer):integer; external;
|
||||
function polylineabs2(var xcoor:parr; var ycoor:parr;
|
||||
n:integer):integer; external;
|
||||
function polylineabs3(var xcoor:parr; var ycoor:parr;var zcoor:parr;
|
||||
n:integer):integer; external;
|
||||
function polylinerel2(var xcoor:parr;var ycoor:parr;
|
||||
n:integer):integer; external;
|
||||
function polylinerel3(var xcoor:parr; var ycoor:parr;var zcoor:parr;
|
||||
n:integer):integer; external;
|
||||
function polymarkerabs2(var xcoor:parr; var ycoor:parr;
|
||||
n:integer):integer; external;
|
||||
function polymarkerabs3(var xcoor:parr; var ycoor:parr;var zcoor:parr;
|
||||
n:integer):integer; external;
|
||||
function polymarkerrel2(var xcoor:parr; var ycoor:parr;
|
||||
n:integer):integer; external;
|
||||
function polymarkerrel3(var xcoor:parr; var ycoor:parr;var zcoor:parr;
|
||||
n:integer):integer; external;
|
||||
function printerror(var string:cct;error:integer):integer; external;
|
||||
function putraster(var rptr:rasttyp):integer; external;
|
||||
function puttext(var string:cct):integer; external;
|
||||
function rastertofile(var rptr:rasttyp; var map:cmap; var rasfid:text;
|
||||
n:integer):integer; external;
|
||||
function renameretainseg(segname:integer;newname:integer):integer; external;
|
||||
function reportrecenterr(var error:integer):integer; external;
|
||||
function restoresegment(segname:integer; var fname:cct):integer; external;
|
||||
function savesegment(segname:integer; var fname:cct):integer; external;
|
||||
function selectvwsurf(var surfacename:vwsurf
|
||||
):integer; external;
|
||||
function setbackclip(onoff:integer):integer; external;
|
||||
function setcharjust(chjust:integer):integer; external;
|
||||
function setcharpath2(dx:real; dy:real):integer; external;
|
||||
function setcharpath3(dx:real; dy:real;dz:real):integer; external;
|
||||
function setcharprecision(chquality:integer):integer; external;
|
||||
function setcharsize(chwid:real;chht:real):integer; external;
|
||||
function setcharspace(space:real):integer; external;
|
||||
function setcharup2(dx:real; dy:real):integer; external;
|
||||
function setcharup3(dx:real; dy:real;dz:real):integer; external;
|
||||
function setcoordsystype(typ:integer):integer; external;
|
||||
function setdetectability(detect:integer):integer; external;
|
||||
function setdrag(drag:integer):integer; external;
|
||||
function setecho(devclass:integer;devnum:integer;
|
||||
echotype:integer):integer; external;
|
||||
function setechogroup(devclass:integer;var devarray:iarr;n:integer;
|
||||
echotype:integer):integer; external;
|
||||
function setechoposition(devclass:integer;devnum:integer;
|
||||
x:real;y:real):integer; external;
|
||||
function setechosurface(devclass:integer;devnum:integer;
|
||||
var surfacename:vwsurf):integer; external;
|
||||
function setfillindex(color:integer):integer; external;
|
||||
function setfont(font:integer):integer; external;
|
||||
function setfrontclip(onoff:integer):integer; external;
|
||||
function sethighlighting(highlight:integer):integer; external;
|
||||
function setimgtransform2(sx:real; sy:real;a:real
|
||||
;tx:real; ty:real):integer; external;
|
||||
function setimgtransform3(sx:real; sy:real;sz:real;
|
||||
ax:real; ay:real;az:real;
|
||||
tx:real; ty:real;tz:real)
|
||||
:integer; external;
|
||||
function setimgxformtype(segtype:integer):integer; external;
|
||||
function setimgtranslate2(tx:real; ty:real):integer; external;
|
||||
function setimgtranslate3(tx:real; ty:real;tz:real):integer; external;
|
||||
function setkeyboard(keynum:integer;bufsize:integer;var string:cct;
|
||||
pos:integer):integer; external;
|
||||
function setlightdirect(dx:real; dy:real;dz:real
|
||||
):integer; external;
|
||||
function setlineindex(color:integer):integer; external;
|
||||
function setlinestyle(style:integer):integer; external;
|
||||
function setlinewidth(width:real):integer; external;
|
||||
function setlocator2(locnum:integer;x:real;y:real):integer; external;
|
||||
function setmarkersymbol(mark:integer):integer; external;
|
||||
function setndcspace2(width:real;height:real):integer; external;
|
||||
function setndcspace3(width:real;height:real;depth:real)
|
||||
:integer; external;
|
||||
function setoutputclip(onoff:integer):integer; external;
|
||||
function setpen(pen:integer):integer; external;
|
||||
function setpick(pickid:integer;aperture:real):integer; external;
|
||||
function setpickid(pickid:integer):integer; external;
|
||||
function setpolyedgestyle(pestyle:integer):integer; external;
|
||||
function setpolyintrstyle(pistyle:integer):integer; external;
|
||||
function setprimattribs(var defprim:primattr):integer; external;
|
||||
function setprojection(ptype:integer;dx:real; dy:real;dz:real)
|
||||
:integer; external;
|
||||
function setrasterop(rop:integer):integer; external;
|
||||
function setsegdetectable(segname:integer; detectbl:integer)
|
||||
:integer; external;
|
||||
function setseghighlight(segname:integer; highlight:integer)
|
||||
:integer; external;
|
||||
function setsegimgxform2(segname:integer;sx:real; sy:real;a:real;
|
||||
tx:real;ty:real):integer; external;
|
||||
function setsegimgxform3(segname:integer; sx:real; sy:real;
|
||||
sz:real; rx:real; ry:real; rz:real
|
||||
; tx:real; ty:real; tz:real
|
||||
):integer; external;
|
||||
function setsegimgxlate2(segname:integer;tx:real; ty:real
|
||||
):integer; external;
|
||||
function setsegimgxlate3(segname:integer;tx:real; ty:real;tz:real
|
||||
):integer; external;
|
||||
function setsegvisibility(segname:integer;visible:integer):integer; external;
|
||||
function setshadingparams(amb:real;dif:real;spec:real;flood:real;
|
||||
bump:real;hue:integer;style:integer
|
||||
):integer; external;
|
||||
function setstroke(strokenum:integer;bufsize:integer;
|
||||
dist:real;time:integer)
|
||||
:integer; external;
|
||||
function settextindex(color:integer):integer; external;
|
||||
function setvaluator(valnum:integer;init:real;low:real;high:real)
|
||||
:integer; external;
|
||||
function setvertexindices(var x:iarr;n:integer):integer; external;
|
||||
function setvertexnormals(var xcoor:parr; var ycoor:parr;var zcoor:parr;
|
||||
n:integer):integer; external;
|
||||
function setviewdepth(near:real;far:real):integer; external;
|
||||
function setviewplanedist(dist:real):integer; external;
|
||||
function setviewplanenorm(dx:real; dy:real;dz:real):integer; external;
|
||||
function setviewrefpoint(x:real; y:real;z:real):integer; external;
|
||||
function setviewup2(dx:real; dy:real):integer; external;
|
||||
function setviewup3(dx:real; dy:real;dz:real):integer; external;
|
||||
function setviewingparams(var viewparm:vwprmtype):integer; external;
|
||||
function setviewport2(xmin:real;xmax:real;ymin:real;ymax:real):
|
||||
integer; external;
|
||||
function setviewport3(xmin:real;xmax:real;ymin:real;ymax:real;zmin:real;
|
||||
zmax:real):integer; external;
|
||||
function setvisibility(visibility:integer):integer; external;
|
||||
function setwindow(umin:real;umax:real;vmin:real;vmax:real)
|
||||
:integer; external;
|
||||
function setwindowclip(onoff:integer):integer; external;
|
||||
function setworldmatrix2(var iarray:ivarray1):integer; external;
|
||||
function setworldmatrix3(var iarray:ivarray):integer; external;
|
||||
function setzbuffercut(var surfacename:vwsurf;var x:parr;var z:parr;n:integer)
|
||||
:integer; external;
|
||||
function sizeraster(var surfacename:vwsurf;
|
||||
xmin:real;xmax:real;ymin:real;ymax:real;
|
||||
var rptr:rasttyp):integer; external;
|
||||
function terminatecore:integer; external;
|
||||
function terminatedevice(devclass:integer;devnum:integer):integer; external;
|
||||
function terminatevwsurf(var surfacename:vwsurf):integer; external;
|
||||
121
usr.lib/libcorepas/textmarkpas.c
Normal file
121
usr.lib/libcorepas/textmarkpas.c
Normal file
@@ -0,0 +1,121 @@
|
||||
/*
|
||||
* Copyright (c) 1986, 1987, 1988, 1989 by Sun Microsystems, Inc.
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose and without fee is hereby granted, provided that the above
|
||||
* copyright notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice are retained, and that the name
|
||||
* of Sun Microsystems, Inc., not be used in advertising or publicity
|
||||
* pertaining to this software without specific, written prior permission.
|
||||
* Sun Microsystems, Inc., makes no representations about the suitability
|
||||
* of this software or the interface defined in this software for any
|
||||
* purpose. It is provided "as is" without express or implied warranty.
|
||||
*/
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)textmarkpas.c 1.1 94/10/31 Copyr 1983 Sun Micro";
|
||||
#endif
|
||||
|
||||
/*
|
||||
Copyright (c) 1983 by Sun Microsystems, Inc.
|
||||
*/
|
||||
|
||||
#include "pasarray.h"
|
||||
|
||||
int marker_abs_2();
|
||||
int marker_abs_3();
|
||||
int marker_rel_2();
|
||||
int marker_rel_3();
|
||||
int polymarker_abs_2();
|
||||
int polymarker_abs_3();
|
||||
int polymarker_rel_2();
|
||||
int polymarker_rel_3();
|
||||
int text();
|
||||
|
||||
int markerabs2(mx, my)
|
||||
double mx, my;
|
||||
{
|
||||
return(marker_abs_2(mx, my));
|
||||
}
|
||||
|
||||
int markerabs3(mx, my, mz)
|
||||
double mx, my, mz;
|
||||
{
|
||||
return(marker_abs_3(mx, my, mz));
|
||||
}
|
||||
|
||||
int markerrel2(dx, dy)
|
||||
double dx, dy;
|
||||
{
|
||||
return(marker_rel_2(dx, dy));
|
||||
}
|
||||
|
||||
int markerrel3(dx, dy, dz)
|
||||
double dx, dy, dz;
|
||||
{
|
||||
return(marker_rel_3(dx, dy, dz));
|
||||
}
|
||||
|
||||
int polymarkerabs2(xcoord, ycoord, n)
|
||||
double xcoord[], ycoord[];
|
||||
int n;
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < n; ++i) {
|
||||
xcoort[i] = xcoord[i];
|
||||
ycoort[i] = ycoord[i];
|
||||
}
|
||||
return(polymarker_abs_2(xcoort, ycoort, n));
|
||||
}
|
||||
|
||||
int polymarkerabs3(xcoord, ycoord, zcoord, n)
|
||||
double xcoord[], ycoord[], zcoord[];
|
||||
int n;
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < n; ++i) {
|
||||
xcoort[i] = xcoord[i];
|
||||
ycoort[i] = ycoord[i];
|
||||
zcoort[i] = zcoord[i];
|
||||
}
|
||||
return(polymarker_abs_3(xcoort, ycoort, zcoort, n));
|
||||
}
|
||||
|
||||
int polymarkerrel2(xcoord, ycoord, n)
|
||||
double xcoord[], ycoord[];
|
||||
int n;
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < n; ++i) {
|
||||
xcoort[i] = xcoord[i];
|
||||
ycoort[i] = ycoord[i];
|
||||
}
|
||||
return(polymarker_rel_2(xcoort, ycoort, n));
|
||||
}
|
||||
|
||||
int polymarkerrel3(xcoord, ycoord, zcoord, n)
|
||||
double xcoord[], ycoord[], zcoord[];
|
||||
int n;
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < n; ++i) {
|
||||
xcoort[i] = xcoord[i];
|
||||
ycoort[i] = ycoord[i];
|
||||
zcoort[i] = zcoord[i];
|
||||
}
|
||||
return(polymarker_rel_3(xcoort, ycoort, zcoort, n));
|
||||
}
|
||||
|
||||
int puttext(f77string)
|
||||
char *f77string;
|
||||
{
|
||||
char *sptr;
|
||||
char pasarg[257];
|
||||
int i,strlen;
|
||||
|
||||
strlen = 256;
|
||||
sptr = f77string+256;
|
||||
while ((*--sptr) == ' ') {strlen--;};
|
||||
strncpy (pasarg,f77string,strlen);
|
||||
pasarg[strlen] = '\0';
|
||||
i = text(pasarg);
|
||||
return(i);
|
||||
}
|
||||
93
usr.lib/libcorepas/typedefspas.h
Normal file
93
usr.lib/libcorepas/typedefspas.h
Normal file
@@ -0,0 +1,93 @@
|
||||
/* @(#)typedefspas.h 1.1 94/10/31 SMI */
|
||||
/*
|
||||
* Copyright (c) 1986, 1987, 1988, 1989 by Sun Microsystems, Inc.
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose and without fee is hereby granted, provided that the above
|
||||
* copyright notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice are retained, and that the name
|
||||
* of Sun Microsystems, Inc., not be used in advertising or publicity
|
||||
* pertaining to this software without specific, written prior permission.
|
||||
* Sun Microsystems, Inc., makes no representations about the suitability
|
||||
* of this software or the interface defined in this software for any
|
||||
* purpose. It is provided "as is" without express or implied warranty.
|
||||
*/
|
||||
type iarr = array[1..256] of integer;
|
||||
type parr = array[1..256] of real;
|
||||
type cct = array[1..257] of char;
|
||||
type ivarray = array[1..4,1..4] of real;
|
||||
type ivarray1 = array[1..3,1..3] of real;
|
||||
type pttype = record
|
||||
x,y,z,w:real;
|
||||
end;
|
||||
|
||||
type aspect = record
|
||||
width, height:real;
|
||||
end;
|
||||
|
||||
type primattr = record
|
||||
lineindx: integer;
|
||||
fillindx: integer;
|
||||
textindx: integer;
|
||||
linestyl: integer;
|
||||
polyintstyl: integer;
|
||||
polyedgstyl: integer;
|
||||
linwidth: real;
|
||||
pen: integer;
|
||||
font: integer;
|
||||
charsize: aspect;
|
||||
chrup, chrpath, chrspace: pttype;
|
||||
chjust: integer;
|
||||
chqualty: integer;
|
||||
marker: integer;
|
||||
pickid: integer;
|
||||
rasterop: integer;
|
||||
end;
|
||||
|
||||
type rasttyp = record
|
||||
width: integer;
|
||||
height: integer;
|
||||
depth: integer;
|
||||
bits: integer; {var}
|
||||
end;
|
||||
type cmap = record
|
||||
typ: integer;
|
||||
nbyt: integer;
|
||||
dat :integer; {var}
|
||||
end;
|
||||
|
||||
type windtype = record
|
||||
xmin, xmax, ymin, ymax:real;
|
||||
end;
|
||||
|
||||
type porttype = record
|
||||
xmin,xmax,ymin,ymax,zmin,zmax:real;
|
||||
end;
|
||||
|
||||
|
||||
type vwprmtype = record
|
||||
vwrefpt: array [1..3] of real;
|
||||
vwplnorm: array [1..3] of real;
|
||||
viewdis:real;
|
||||
frontdis:real;
|
||||
backdis:real;
|
||||
projtype:integer;
|
||||
projdir: array [1..3] of real;
|
||||
window:windtype;
|
||||
vwupdir: array [1..3] of real;
|
||||
viewport:porttype;
|
||||
end;
|
||||
type vwsurf = record
|
||||
screenname: array [1..DEVNAMESIZE] of char;
|
||||
windowname: array [1..DEVNAMESIZE] of char;
|
||||
windowfd: integer;
|
||||
dd: integer;
|
||||
instance: integer;
|
||||
cmapsize: integer;
|
||||
cmapname: array [1..DEVNAMESIZE] of char;
|
||||
flags: integer;
|
||||
ptr: integer;
|
||||
end;
|
||||
|
||||
type vsurfst = array[1..DEVNAMESIZE] of char;
|
||||
|
||||
type vwarr = array[1..MAXVSURF] of vwsurf;
|
||||
95
usr.lib/libcorepas/usercorepas.h
Normal file
95
usr.lib/libcorepas/usercorepas.h
Normal file
@@ -0,0 +1,95 @@
|
||||
/* @(#)usercorepas.h 1.1 94/10/31 SMI */
|
||||
/*
|
||||
* Copyright (c) 1986, 1987, 1988, 1989 by Sun Microsystems, Inc.
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose and without fee is hereby granted, provided that the above
|
||||
* copyright notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice are retained, and that the name
|
||||
* of Sun Microsystems, Inc., not be used in advertising or publicity
|
||||
* pertaining to this software without specific, written prior permission.
|
||||
* Sun Microsystems, Inc., makes no representations about the suitability
|
||||
* of this software or the interface defined in this software for any
|
||||
* purpose. It is provided "as is" without express or implied warranty.
|
||||
*/
|
||||
const
|
||||
TRUE=1;
|
||||
FALSE=0;
|
||||
|
||||
{ Charprecision constants }
|
||||
STRING=0;
|
||||
CHARACTER=1;
|
||||
|
||||
{ View surfaces; maximum number of}
|
||||
MAXVSURF=5;
|
||||
|
||||
{ Transform constants}
|
||||
PARALLEL=0;
|
||||
PERSPECTIVE=1;
|
||||
|
||||
{ Image transformation types }
|
||||
NONE=1;
|
||||
XLATE2=2;
|
||||
XFORM2=3;
|
||||
XLATE3=2;
|
||||
XFORM3=3;
|
||||
|
||||
{ Line styles }
|
||||
SOLID =0;
|
||||
DOTTED=1;
|
||||
DASHED=2;
|
||||
DOTDASHED=3;
|
||||
|
||||
{ Polygon shading modes }
|
||||
CONSTANT=0;
|
||||
GOURAUD=1;
|
||||
PHONG=2;
|
||||
|
||||
{ Input device constants }
|
||||
PICK=0;
|
||||
KEYBOARD=1;
|
||||
BUTTON=2;
|
||||
LOCATOR=3;
|
||||
VALUATOR=4;
|
||||
STROKE=5;
|
||||
|
||||
{ Font select constants}
|
||||
ROMAN =0;
|
||||
GREEK =1;
|
||||
SCRIPT=2;
|
||||
OLDENGLISH=3;
|
||||
STICK =4;
|
||||
SYMBOLS=5;
|
||||
|
||||
{ Character justification constants }
|
||||
OFF=0;
|
||||
LEFT=1;
|
||||
CENTER=2;
|
||||
RIGHT=3;
|
||||
|
||||
{ Rasterop selection constants}
|
||||
NORMAL=0;
|
||||
XORROP=1;
|
||||
ORROP=2;
|
||||
|
||||
{ Polygon interior style constants }
|
||||
PLAIN=0;
|
||||
SHADED=1;
|
||||
|
||||
{ Core output levels }
|
||||
BASIC=0;
|
||||
BUFFERED=1;
|
||||
DYNAMICA=2;
|
||||
DYNAMICB=3;
|
||||
DYNAMICC=4;
|
||||
|
||||
{ Core input levels }
|
||||
NOINPUT=0;
|
||||
SYNCHRONOUS=1;
|
||||
COMPLETE=2;
|
||||
|
||||
{ Core dimensions }
|
||||
TWOD=0;
|
||||
THREED=1;
|
||||
|
||||
DEVNAMESIZE = 20;
|
||||
VWSURFNEWFLG = 1;
|
||||
89
usr.lib/libcorepas/view_surfpas.c
Normal file
89
usr.lib/libcorepas/view_surfpas.c
Normal file
@@ -0,0 +1,89 @@
|
||||
/*
|
||||
* Copyright (c) 1986, 1987, 1988, 1989 by Sun Microsystems, Inc.
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose and without fee is hereby granted, provided that the above
|
||||
* copyright notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice are retained, and that the name
|
||||
* of Sun Microsystems, Inc., not be used in advertising or publicity
|
||||
* pertaining to this software without specific, written prior permission.
|
||||
* Sun Microsystems, Inc., makes no representations about the suitability
|
||||
* of this software or the interface defined in this software for any
|
||||
* purpose. It is provided "as is" without express or implied warranty.
|
||||
*/
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)view_surfpas.c 1.1 94/10/31 Copyr 1984 Sun Micro";
|
||||
#endif
|
||||
|
||||
/*
|
||||
Copyright (c) 1983 by Sun Microsystems, Inc.
|
||||
*/
|
||||
|
||||
#define DEVNAMESIZE 20
|
||||
|
||||
typedef struct {
|
||||
char screenname[DEVNAMESIZE];
|
||||
char windowname[DEVNAMESIZE];
|
||||
int fd;
|
||||
int (*dd)();
|
||||
int instance;
|
||||
int cmapsize;
|
||||
char cmapname[DEVNAMESIZE];
|
||||
int flags;
|
||||
char *ptr;
|
||||
} vwsurf;
|
||||
|
||||
int deselect_view_surface();
|
||||
int initialize_view_surface();
|
||||
int select_view_surface();
|
||||
int terminate_view_surface();
|
||||
|
||||
int deselectvwsurf(surfname)
|
||||
vwsurf *surfname;
|
||||
{
|
||||
return(deselect_view_surface(surfname));
|
||||
}
|
||||
|
||||
int initializevwsurf(surfname, flag)
|
||||
vwsurf *surfname;
|
||||
int flag;
|
||||
{
|
||||
char *sptr,*wptr,*cptr;
|
||||
int i,is,iw,ic;
|
||||
|
||||
is = iw = ic = 0;
|
||||
sptr = surfname->screenname;
|
||||
while ((*sptr++) != ' ');
|
||||
*--sptr = '\0';
|
||||
wptr = surfname->windowname;
|
||||
while ((*wptr++) != ' ');
|
||||
*--wptr = '\0';
|
||||
cptr = surfname->cmapname;
|
||||
while ((*cptr++) != ' ');
|
||||
*--cptr = '\0';
|
||||
i = initialize_view_surface(surfname, flag);
|
||||
sptr = surfname->screenname;
|
||||
while ((*sptr++) != '\0') is++;
|
||||
*--sptr = ' ';
|
||||
while (++is < DEVNAMESIZE) *sptr++ = ' ';
|
||||
wptr = surfname->windowname;
|
||||
while ((*wptr++) != '\0') iw++;
|
||||
*--wptr = ' ';
|
||||
while (++iw < DEVNAMESIZE) *wptr++ = ' ';
|
||||
cptr = surfname->cmapname;
|
||||
while ((*cptr++) != '\0') ic++;
|
||||
*--cptr = ' ';
|
||||
while (++ic < DEVNAMESIZE) *cptr++ = ' ';
|
||||
return(i);
|
||||
}
|
||||
|
||||
int selectvwsurf(surfname)
|
||||
vwsurf *surfname;
|
||||
{
|
||||
return(select_view_surface(surfname));
|
||||
}
|
||||
|
||||
int terminatevwsurf(surfname)
|
||||
vwsurf *surfname;
|
||||
{
|
||||
return(terminate_view_surface(surfname));
|
||||
}
|
||||
101
usr.lib/libcorepas/view_transpas.c
Normal file
101
usr.lib/libcorepas/view_transpas.c
Normal file
@@ -0,0 +1,101 @@
|
||||
/*
|
||||
* Copyright (c) 1986, 1987, 1988, 1989 by Sun Microsystems, Inc.
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose and without fee is hereby granted, provided that the above
|
||||
* copyright notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice are retained, and that the name
|
||||
* of Sun Microsystems, Inc., not be used in advertising or publicity
|
||||
* pertaining to this software without specific, written prior permission.
|
||||
* Sun Microsystems, Inc., makes no representations about the suitability
|
||||
* of this software or the interface defined in this software for any
|
||||
* purpose. It is provided "as is" without express or implied warranty.
|
||||
*/
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)view_transpas.c 1.1 94/10/31 Copyr 1983 Sun Micro";
|
||||
#endif
|
||||
|
||||
/*
|
||||
Copyright (c) 1983 by Sun Microsystems, Inc.
|
||||
*/
|
||||
|
||||
int set_back_plane_clipping();
|
||||
int set_coordinate_system_type();
|
||||
int set_front_plane_clipping();
|
||||
int set_output_clipping();
|
||||
int set_window_clipping();
|
||||
int set_world_coordinate_matrix_2();
|
||||
int set_world_coordinate_matrix_3();
|
||||
|
||||
int setbackclip(onoff)
|
||||
int onoff;
|
||||
{
|
||||
return(set_back_plane_clipping(onoff));
|
||||
}
|
||||
|
||||
int setcoordsystype(type)
|
||||
int type;
|
||||
{
|
||||
return(set_coordinate_system_type(type));
|
||||
}
|
||||
|
||||
int setfrontclip(onoff)
|
||||
int onoff;
|
||||
{
|
||||
return(set_front_plane_clipping(onoff));
|
||||
}
|
||||
|
||||
int setoutputclip(onoff)
|
||||
int onoff;
|
||||
{
|
||||
return(set_output_clipping(onoff));
|
||||
}
|
||||
|
||||
int setwindowclip(onoff)
|
||||
int onoff;
|
||||
{
|
||||
return(set_window_clipping(onoff));
|
||||
}
|
||||
|
||||
int setworldmatrix2(f77array)
|
||||
double *f77array;
|
||||
{
|
||||
int i;
|
||||
float dummy[9], *dptr, *fptr,dummy2[9];
|
||||
for (i = 0; i < 9; ++i) {
|
||||
dummy2[i] = f77array[i];
|
||||
}
|
||||
dptr = dummy;
|
||||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
fptr = dummy2 + i;
|
||||
*dptr++ = *fptr;
|
||||
fptr += 3;
|
||||
*dptr++ = *fptr;
|
||||
fptr += 3;
|
||||
*dptr++ = *fptr;
|
||||
}
|
||||
return(set_world_coordinate_matrix_2(dummy));
|
||||
}
|
||||
|
||||
int setworldmatrix3(f77array)
|
||||
double *f77array;
|
||||
{
|
||||
int i;
|
||||
float dummy[16], *dptr, *fptr,dummy2[16];
|
||||
for (i = 0; i < 16; ++i) {
|
||||
dummy2[i] = f77array[i];
|
||||
}
|
||||
dptr = dummy;
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
fptr = dummy2 + i;
|
||||
*dptr++ = *fptr;
|
||||
fptr += 4;
|
||||
*dptr++ = *fptr;
|
||||
fptr += 4;
|
||||
*dptr++ = *fptr;
|
||||
fptr += 4;
|
||||
*dptr++ = *fptr;
|
||||
}
|
||||
return(set_world_coordinate_matrix_3(dummy));
|
||||
}
|
||||
175
usr.lib/libcorepas/xformattpas.c
Normal file
175
usr.lib/libcorepas/xformattpas.c
Normal file
@@ -0,0 +1,175 @@
|
||||
/*
|
||||
* Copyright (c) 1986, 1987, 1988, 1989 by Sun Microsystems, Inc.
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose and without fee is hereby granted, provided that the above
|
||||
* copyright notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice are retained, and that the name
|
||||
* of Sun Microsystems, Inc., not be used in advertising or publicity
|
||||
* pertaining to this software without specific, written prior permission.
|
||||
* Sun Microsystems, Inc., makes no representations about the suitability
|
||||
* of this software or the interface defined in this software for any
|
||||
* purpose. It is provided "as is" without express or implied warranty.
|
||||
*/
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)xformattpas.c 1.1 94/10/31 Copyr 1983 Sun Micro";
|
||||
#endif
|
||||
|
||||
/*
|
||||
Copyright (c) 1983 by Sun Microsystems, Inc.
|
||||
*/
|
||||
|
||||
int set_ndc_space_2();
|
||||
int set_ndc_space_3();
|
||||
int set_projection();
|
||||
int set_view_depth();
|
||||
int set_view_plane_distance();
|
||||
int set_view_plane_normal();
|
||||
int set_view_reference_point();
|
||||
int set_view_up_2();
|
||||
int set_view_up_3();
|
||||
int set_viewing_parameters();
|
||||
int set_viewport_2();
|
||||
int set_viewport_3();
|
||||
int set_window();
|
||||
|
||||
int setndcspace2(width, height)
|
||||
double width, height;
|
||||
{
|
||||
return(set_ndc_space_2(width, height));
|
||||
}
|
||||
|
||||
int setndcspace3(width, height, depth)
|
||||
double width, height, depth;
|
||||
{
|
||||
return(set_ndc_space_3(width, height, depth));
|
||||
}
|
||||
|
||||
int setprojection(projtype, dx, dy, dz)
|
||||
int projtype;
|
||||
double dx, dy, dz;
|
||||
{
|
||||
return(set_projection(projtype, dx, dy, dz));
|
||||
}
|
||||
|
||||
int setviewdepth(near, far)
|
||||
double near, far;
|
||||
{
|
||||
return(set_view_depth(near, far));
|
||||
}
|
||||
|
||||
int setviewplanedist(dist)
|
||||
double dist;
|
||||
{
|
||||
return(set_view_plane_distance(dist));
|
||||
}
|
||||
|
||||
int setviewplanenorm(dx, dy, dz)
|
||||
double dx, dy, dz;
|
||||
{
|
||||
return(set_view_plane_normal(dx, dy, dz));
|
||||
}
|
||||
|
||||
int setviewrefpoint(x, y, z)
|
||||
double x, y, z;
|
||||
{
|
||||
return(set_view_reference_point(x, y, z));
|
||||
}
|
||||
|
||||
int setviewup2(dx, dy)
|
||||
double dx, dy;
|
||||
{
|
||||
return(set_view_up_2(dx, dy));
|
||||
}
|
||||
|
||||
int setviewup3(dx, dy, dz)
|
||||
double dx, dy, dz;
|
||||
{
|
||||
return(set_view_up_3(dx, dy, dz));
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
double p_xmin, p_xmax, p_ymin, p_ymax; } p_windtype;
|
||||
typedef struct {
|
||||
double p_xmin, p_xmax, p_ymin, p_ymax, p_zmin, p_zmax; } p_porttype;
|
||||
|
||||
typedef struct {
|
||||
double p_vwrefpt[3];
|
||||
double p_vwplnorm[3];
|
||||
double p_viewdis;
|
||||
double p_frontdis;
|
||||
double p_backdis;
|
||||
int p_projtype;
|
||||
double p_projdir[3];
|
||||
p_windtype p_window;
|
||||
double p_vwupdir[3];
|
||||
p_porttype p_viewport;
|
||||
} p_vwprmtype;
|
||||
|
||||
typedef struct {
|
||||
float xmin, xmax, ymin, ymax; } windtype;
|
||||
typedef struct {
|
||||
float xmin,xmax,ymin,ymax,zmin,zmax; } porttype;
|
||||
|
||||
typedef struct {
|
||||
float vwrefpt[3];
|
||||
float vwplnorm[3];
|
||||
float viewdis;
|
||||
float frontdis;
|
||||
float backdis;
|
||||
int projtype;
|
||||
float projdir[3];
|
||||
windtype window;
|
||||
float vwupdir[3];
|
||||
porttype viewport;
|
||||
} vwprmtype;
|
||||
|
||||
int setviewingparams(viewparm2)
|
||||
p_vwprmtype *viewparm2;
|
||||
{
|
||||
vwprmtype *viewparm;
|
||||
viewparm->vwrefpt[1] = viewparm2->p_vwrefpt[1];
|
||||
viewparm->vwrefpt[2] = viewparm2->p_vwrefpt[2];
|
||||
viewparm->vwrefpt[3] = viewparm2->p_vwrefpt[3];
|
||||
viewparm->vwplnorm[1] = viewparm2->p_vwplnorm[1];
|
||||
viewparm->vwplnorm[2] = viewparm2->p_vwplnorm[2];
|
||||
viewparm->vwplnorm[3] = viewparm2->p_vwplnorm[3];
|
||||
viewparm->viewdis = viewparm2->p_viewdis;
|
||||
viewparm->frontdis = viewparm2->p_frontdis;
|
||||
viewparm->backdis = viewparm2->p_backdis;
|
||||
viewparm->projtype = viewparm2->p_projtype;
|
||||
viewparm->projdir[1] = viewparm2->p_projdir[1];
|
||||
viewparm->projdir[2] = viewparm2->p_projdir[2];
|
||||
viewparm->projdir[3] = viewparm2->p_projdir[3];
|
||||
viewparm->window.xmin = viewparm2->p_window.p_xmin;
|
||||
viewparm->window.xmax = viewparm2->p_window.p_xmax;
|
||||
viewparm->window.ymin = viewparm2->p_window.p_ymin;
|
||||
viewparm->window.ymax = viewparm2->p_window.p_ymax;
|
||||
viewparm->vwupdir[1] = viewparm2->p_vwupdir[1];
|
||||
viewparm->vwupdir[2] = viewparm2->p_vwupdir[2];
|
||||
viewparm->vwupdir[3] = viewparm2->p_vwupdir[3];
|
||||
viewparm->viewport.xmin = viewparm2->p_viewport.p_xmin;
|
||||
viewparm->viewport.xmax = viewparm2->p_viewport.p_xmin;
|
||||
viewparm->viewport.ymin = viewparm2->p_viewport.p_ymin;
|
||||
viewparm->viewport.ymax = viewparm2->p_viewport.p_ymax;
|
||||
viewparm->viewport.zmin = viewparm2->p_viewport.p_zmin;
|
||||
viewparm->viewport.zmax = viewparm2->p_viewport.p_zmax;
|
||||
return(set_viewing_parameters(viewparm));
|
||||
}
|
||||
|
||||
int setviewport2(xmin, xmax, ymin, ymax)
|
||||
double xmin, xmax, ymin, ymax;
|
||||
{
|
||||
return(set_viewport_2(xmin, xmax, ymin, ymax));
|
||||
}
|
||||
|
||||
int setviewport3(xmin, xmax, ymin, ymax, zmin, zmax)
|
||||
double xmin, xmax, ymin, ymax, zmin, zmax;
|
||||
{
|
||||
return(set_viewport_3(xmin, xmax, ymin, ymax, zmin, zmax));
|
||||
}
|
||||
|
||||
int setwindow(umin, umax, vmin, vmax)
|
||||
double umin, umax, vmin, vmax;
|
||||
{
|
||||
return(set_window(umin, umax, vmin, vmax));
|
||||
}
|
||||
50
usr.lib/libcorepas/zbufferpas.c
Normal file
50
usr.lib/libcorepas/zbufferpas.c
Normal file
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* Copyright (c) 1986, 1987, 1988, 1989 by Sun Microsystems, Inc.
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose and without fee is hereby granted, provided that the above
|
||||
* copyright notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice are retained, and that the name
|
||||
* of Sun Microsystems, Inc., not be used in advertising or publicity
|
||||
* pertaining to this software without specific, written prior permission.
|
||||
* Sun Microsystems, Inc., makes no representations about the suitability
|
||||
* of this software or the interface defined in this software for any
|
||||
* purpose. It is provided "as is" without express or implied warranty.
|
||||
*/
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)zbufferpas.c 1.1 94/10/31 Copyr 1983 Sun Micro";
|
||||
#endif
|
||||
|
||||
/*
|
||||
Copyright (c) 1983 by Sun Microsystems, Inc.
|
||||
*/
|
||||
|
||||
#include "pasarray.h"
|
||||
|
||||
#define DEVNAMESIZE 20
|
||||
|
||||
typedef struct {
|
||||
char screenname[DEVNAMESIZE];
|
||||
char windowname[DEVNAMESIZE];
|
||||
int fd;
|
||||
int (*dd)();
|
||||
int instance;
|
||||
int cmapsize;
|
||||
char cmapname[DEVNAMESIZE];
|
||||
int flags;
|
||||
char *ptr;
|
||||
} vwsurf;
|
||||
|
||||
int set_zbuffer_cut();
|
||||
|
||||
int setzbuffercut(surfname,xlist, zlist, n)
|
||||
vwsurf *surfname;
|
||||
double xlist[], zlist[];
|
||||
int n;
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < n; ++i) {
|
||||
xcoort[i] = xlist[i];
|
||||
zcoort[i] = zlist[i];
|
||||
}
|
||||
return(set_zbuffer_cut(surfname, xcoort, zcoort, n));
|
||||
}
|
||||
Reference in New Issue
Block a user