aboutsummaryrefslogtreecommitdiff
path: root/src/graph/view3D
diff options
context:
space:
mode:
Diffstat (limited to 'src/graph/view3D')
-rw-r--r--src/graph/view3D/header.h7
-rw-r--r--src/graph/view3D/lighting3d.c20
-rw-r--r--src/graph/view3D/process3d.c4
-rw-r--r--src/graph/view3D/smoothShade3d.c2
-rw-r--r--src/graph/view3D/static.h22
-rw-r--r--src/graph/view3D/volume3d.c11
-rw-r--r--src/graph/view3D/write3d.c42
7 files changed, 50 insertions, 58 deletions
diff --git a/src/graph/view3D/header.h b/src/graph/view3D/header.h
index 53dd24ab..e029f12b 100644
--- a/src/graph/view3D/header.h
+++ b/src/graph/view3D/header.h
@@ -134,19 +134,12 @@
/*** colors ***/
/******************************/
-#define totalHuesConst 27
-
-#define hueEnd 360
-
-#undef hueStep
-#define hueStep (hueEnd/totalHuesConst)
#define black BlackPixel(dsply,scrn)
#define white WhitePixel(dsply,scrn)
#define numPlanes 1
#define numColors 10
#define startColor 0
-#define maxColors (DisplayCells(dsply,scrn)-1)
#define maxPlanes (DefaultVisual((dpy),(scr))->bits_per_rgb)
/**********************************/
diff --git a/src/graph/view3D/lighting3d.c b/src/graph/view3D/lighting3d.c
index 666c708c..5d0b5489 100644
--- a/src/graph/view3D/lighting3d.c
+++ b/src/graph/view3D/lighting3d.c
@@ -79,6 +79,26 @@
#define arrowHead (control->buttonQueue[lightTranslucent].buttonX + 5)
static viewTriple point0 = {0,0,0};
+static float labels[basicScreen][7] = {
+ {105,0,4,106,0,3,labelColor}, /* script x label - 4 segments */
+ {106,0,3,112,0,10,labelColor},
+ {112,0,10,114,0,9,labelColor},
+ {106,0,10,113,0,3,labelColor},
+ {0,106,9,0,107,10,labelColor}, /* script y label - 7 segments */
+ {0,107,10,0,107,6,labelColor},
+ {0,107,6,0,113,5,labelColor},
+ {0,113,10,0,113,-3,labelColor},
+ {0,113,-3,0,111,-5,labelColor},
+ {0,111,-5,0,110,-1,labelColor},
+ {0,110,-1,0,114,3,labelColor},
+ {0,5,114,0,6,115,labelColor}, /* script z label - 8 segments */
+ {0,6,115,0,11,116,labelColor},
+ {0,11,116,0,12,113,labelColor},
+ {0,12,113,0,10,111,labelColor},
+ {0,10,111,0,11,110,labelColor},
+ {0,11,110,0,11,103,labelColor},
+ {0,11,103,0,9,102,labelColor},
+ {0,9,102,0,9,105,labelColor}};
/***************************
* int makeLightingPanel() *
diff --git a/src/graph/view3D/process3d.c b/src/graph/view3D/process3d.c
index 5c5e7d68..f5adbf9e 100644
--- a/src/graph/view3D/process3d.c
+++ b/src/graph/view3D/process3d.c
@@ -856,7 +856,7 @@ processEvents(void)
XEvent *event, tempEvent;
Window whichWindow;
buttonStruct *controlButton;
- mouseCoord mouseXY, linearMouseXY;
+ mouseCoord mouseXY = {0.0, 0.0}, linearMouseXY = {0.0, 0.0};
int someInt, mouseW4, mouseH4;
int toggleReady =yes;
int checkButton = no;
@@ -939,7 +939,7 @@ processEvents(void)
switch(((XEvent *)event)->type) {
case ClientMessage:
- if (event->xclient.data.l[0] == wm_delete_window) {
+ if ((Atom)event->xclient.data.l[0] == wm_delete_window) {
goodbye(-1);
}
else {
diff --git a/src/graph/view3D/smoothShade3d.c b/src/graph/view3D/smoothShade3d.c
index 5d09a4ed..b794f210 100644
--- a/src/graph/view3D/smoothShade3d.c
+++ b/src/graph/view3D/smoothShade3d.c
@@ -753,7 +753,7 @@ showAxesLabels(int dFlag)
else GSetForeground(GC9991,psBlack,dFlag);
/* axes label for X */
- if ((int)axesZ[0][0] >= (int)axesZ[0][2]) {
+ if ((int)axesZ[0][0] >= (int)axesZ[0][1]) {
if (axesXY[0][2] < axesXY[0][0]) xcoord2 = axesXY[0][2]-5;
else xcoord2 = axesXY[0][2] + 5;
if (axesXY[0][3] < axesXY[0][1]) ycoord2 = axesXY[0][3]-5;
diff --git a/src/graph/view3D/static.h b/src/graph/view3D/static.h
index 201f272b..8175c642 100644
--- a/src/graph/view3D/static.h
+++ b/src/graph/view3D/static.h
@@ -40,24 +40,4 @@ static float axes[3][6] = {{-117,0,0,117,0,0}, /* x axis */
{0,-117,0,0,117,0}, /* y axis */
{0,0,-117,0,0,117}}; /* z axis */
-/* text labels are currently used */
-static float labels[basicScreen][7] = {
- {105,0,4,106,0,3,labelColor}, /* script x label - 4 segments */
- {106,0,3,112,0,10,labelColor},
- {112,0,10,114,0,9,labelColor},
- {106,0,10,113,0,3,labelColor},
- {0,106,9,0,107,10,labelColor}, /* script y label - 7 segments */
- {0,107,10,0,107,6,labelColor},
- {0,107,6,0,113,5,labelColor},
- {0,113,10,0,113,-3,labelColor},
- {0,113,-3,0,111,-5,labelColor},
- {0,111,-5,0,110,-1,labelColor},
- {0,110,-1,0,114,3,labelColor},
- {0,5,114,0,6,115,labelColor}, /* script z label - 8 segments */
- {0,6,115,0,11,116,labelColor},
- {0,11,116,0,12,113,labelColor},
- {0,12,113,0,10,111,labelColor},
- {0,10,111,0,11,110,labelColor},
- {0,11,110,0,11,103,labelColor},
- {0,11,103,0,9,102,labelColor},
- {0,9,102,0,9,105,labelColor}};
+
diff --git a/src/graph/view3D/volume3d.c b/src/graph/view3D/volume3d.c
index 348a39d6..87bce529 100644
--- a/src/graph/view3D/volume3d.c
+++ b/src/graph/view3D/volume3d.c
@@ -698,7 +698,7 @@ void
drawVolumePanel (void)
{
- int i,strlength;
+ size_t i,strlength;
/* Draw some lines for volume panel. */
@@ -733,13 +733,16 @@ drawVolumePanel (void)
100,100,Xoption);
- for (i=0; i<strlen(clipMess); i++)
+ strlength = strlen(clipMess);
+ for (i=0; i<strlength; i++)
GDrawString(trashGC,volumeWindow,clipMessX,clipMessY + i*clipMessDy,
&(clipMess[i]),1,Xoption);
- for (i=0; i<strlen(eyeMess1); i++)
+ strlength = strlen(eyeMess1);
+ for (i=0; i<strlength; i++)
GDrawString(trashGC,volumeWindow,eyeMess1X,eyeMess1Y + i*eyeMess1Dy,
&(eyeMess1[i]),1,Xoption);
- for (i=0; i<strlen(eyeMess2); i++)
+ strlength = strlen(eyeMess2);
+ for (i=0; i<strlength; i++)
GDrawString(trashGC,volumeWindow,eyeMess2X,eyeMess2Y + i*eyeMess2Dy,
&(eyeMess2[i]),1,Xoption);
diff --git a/src/graph/view3D/write3d.c b/src/graph/view3D/write3d.c
index 724fe5cc..7eeaf15b 100644
--- a/src/graph/view3D/write3d.c
+++ b/src/graph/view3D/write3d.c
@@ -51,7 +51,7 @@
#include "all_3d.H1"
/* upper limit as to how many kinds of files could be written (numBits-1) */
-#define numBits (8*sizeof(int))
+#define numBits ((int)(8*sizeof(int)))
#define StellarColors 9
int
@@ -64,25 +64,21 @@ writeViewport (int thingsToWrite)
viewTriple *aPt;
XWindowAttributes vwInfo;
FILE *viewDataFile;
- char viewDirName[80], viewDataFilename[80],
- viewBitmapFilename[80], viewPixmapFilename[80],
- command[80];
+ char buf[1024];
XGetWindowAttributes(dsply,viewport->titleWindow,&vwInfo);
- sprintf(viewDirName,"%s%s",filename,".VIEW");
- sprintf(command,"%s%s%s","rm -r ",viewDirName," > /dev/null 2>&1");
- system(command);
- sprintf(command,"%s%s%s","mkdir ",viewDirName," > /dev/null 2>&1");
- system(command);
- if (0) {
- fprintf(stderr," Error: Cannot create %s\n",viewDirName);
+ sprintf(buf, "rm -f %s.VIEW", filename);
+ system(buf);
+ sprintf(buf, "mkdir %s.VIEW", filename);
+ if (system(buf)) {
+ fprintf(stderr," Error: Cannot create %s.VIEW\n", filename);
return(-1);
} else {
/*** Create the data file ***/
- sprintf(viewDataFilename,"%s%s",viewDirName,"/data");
- if ((viewDataFile = fopen(viewDataFilename,"w")) == NULL) {
- fprintf(stderr," Error: Cannot create %s\n",viewDataFilename);
+ sprintf(buf,"%s.VIEW/data", filename);
+ if ((viewDataFile = fopen(buf,"w")) == NULL) {
+ fprintf(stderr," Error: Cannot create %s\n", buf);
perror("fopen");
return(-1);
} else {
@@ -140,18 +136,18 @@ writeViewport (int thingsToWrite)
switch (ii) {
case Bitmap:
/*** Create the pixmap (bitmaps need leaf name) ***/
- sprintf(viewBitmapFilename,"%s%s%s",viewDirName,"/","image.bm");
+ sprintf(buf,"%s.VIEW/image.bm", filename);
XGetWindowAttributes(dsply,viewport->viewWindow,&vwInfo);
- XWriteBitmapFile(dsply,viewBitmapFilename,
+ XWriteBitmapFile(dsply,buf,
viewport->titleWindow,vwInfo.width,
vwInfo.height+vwInfo.border_width+20,-1,-1);
break;
case Pixmap:
/*** Create the pixmap (bitmaps need leaf name) ***/
- sprintf(viewPixmapFilename,"%s%s%s",viewDirName,"/","image.xpm");
+ sprintf(buf,"%s.VIEW/image.xpm", filename);
XGetWindowAttributes(dsply,viewport->viewWindow,&vwInfo);
- write_pixmap_file(dsply,scrn,viewPixmapFilename,
+ write_pixmap_file(dsply,scrn,buf,
viewport->titleWindow,0,0,vwInfo.width,
vwInfo.height+titleHeight);
break;
@@ -159,7 +155,7 @@ writeViewport (int thingsToWrite)
case Image:
/*** Create the image (bitmaps need leaf name) ***/
writeImage = yes;
- sprintf(viewPixmapFilename,"%s%s%s",viewDirName,"/","image.xpm");
+ sprintf(buf,"%s.VIEW/image.xpm", filename);
XResizeWindow(dsply,viewport->titleWindow,300,300+titleHeight);
XResizeWindow(dsply,viewport->viewWindow,300,300);
viewport->hueTop = totalHues-1; viewport->hueOffset = 0;
@@ -174,7 +170,7 @@ writeViewport (int thingsToWrite)
drawViewport(Xoption);
writeTitle();
XGetWindowAttributes(dsply,viewport->viewWindow,&vwInfo);
- write_pixmap_file(dsply,scrn,viewPixmapFilename,
+ write_pixmap_file(dsply,scrn,buf,
viewport->titleWindow,0,0,vwInfo.width,
vwInfo.height+titleHeight);
viewport->monoOn = 1;
@@ -182,8 +178,8 @@ writeViewport (int thingsToWrite)
firstTime = 1;
drawViewport(Xoption);
writeTitle();
- sprintf(viewBitmapFilename,"%s%s%s",viewDirName,"/","image.bm");
- XWriteBitmapFile(dsply,viewBitmapFilename,
+ sprintf(buf,"%s.VIEW/image.bm", filename);
+ XWriteBitmapFile(dsply,buf,
viewport->titleWindow,vwInfo.width,
vwInfo.height+vwInfo.border_width+20,-1,-1);
@@ -192,7 +188,7 @@ writeViewport (int thingsToWrite)
case Postscript:
/*** Create postscript output for viewport (in axiom3D.ps) ***/
- sprintf(PSfilename,"%s%s",viewDirName,"/axiom3D.ps");
+ sprintf(PSfilename,"%s.VIEW/axiom3D.ps", filename);
if (PSInit(viewport->viewWindow,viewport->titleWindow) == psError)
return(-1);
drawViewport(PSoption); /* write new script file in /tmp */