Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

open-axiom repository from github

24005 views
1
/*
2
Copyright (C) 1991-2002, The Numerical Algorithms Group Ltd.
3
All rights reserved.
4
Copyright (C) 2007-2008, Gabriel Dos Reis.
5
all rights reserved.
6
7
Redistribution and use in source and binary forms, with or without
8
modification, are permitted provided that the following conditions are
9
met:
10
11
- Redistributions of source code must retain the above copyright
12
notice, this list of conditions and the following disclaimer.
13
14
- Redistributions in binary form must reproduce the above copyright
15
notice, this list of conditions and the following disclaimer in
16
the documentation and/or other materials provided with the
17
distribution.
18
19
- Neither the name of The Numerical Algorithms Group Ltd. nor the
20
names of its contributors may be used to endorse or promote products
21
derived from this software without specific prior written permission.
22
23
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
24
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
25
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
26
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
27
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
28
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
29
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
30
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
31
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
32
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
33
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34
*/
35
36
#define _VIEWALONE_C
37
#include "openaxiom-c-macros.h"
38
39
#include <stdlib.h>
40
#include "viewAlone.h"
41
42
#include "all_alone.H1"
43
44
/************* global variables **************/
45
46
viewManager viewP; /* note that in viewman, this is called viewports */
47
48
/* 3D stuff */
49
view3DStruct doView3D;
50
51
/* 2D stuff */
52
view2DStruct doView2D;
53
graphStruct graphArray[maxGraphs];
54
graphStateStruct graphStateArray[maxGraphs];
55
56
/* tube stuff */
57
tubeModel doViewTube;
58
59
int viewType;
60
int filedes,ack;
61
62
char errorStr[80];
63
64
65
int viewOkay = 0;
66
int viewError = -1;
67
68
FILE *viewFile;
69
char filename[256];
70
char pathname[256];
71
72
/************* main program **************/
73
74
int main (int argc,char *argv[])
75
{
76
printf("viewAlone called with argc=%d\n",argc);
77
printf("viewAlone called with argv[1]=%s\n",argv[0]);
78
printf("viewAlone called with argv[2]=%s\n",argv[1]);
79
/******** Open files and Figure out the viewport type ********/
80
81
sprintf(filename,"%s%s",argv[1],".VIEW/data");
82
if((viewFile = fopen(filename,"r")) == NULL ) {
83
84
sprintf(filename,"%s%s",argv[1],"/data");
85
if((viewFile = fopen(filename,"r")) == NULL ){
86
fprintf(stderr,"Error: Cannot find the file %s%s or %s%s\n",
87
argv[1],".VIEW/data",argv[1],"/data");
88
exit(-1);
89
}
90
sprintf(pathname,"%s",argv[1]);
91
}
92
else{
93
sprintf(pathname,"%s%s",argv[1],".VIEW");
94
}
95
fscanf(viewFile,"%d\n",&viewType);
96
printf("filename = %s\n",filename);
97
printf("viewType = %d\n",viewType);
98
switch (viewType) {
99
100
case view3DType:
101
case viewTubeType:
102
printf("calling spoonView3D\n");
103
spoonView3D(viewType);
104
break;
105
106
case view2DType:
107
printf("calling spoonView2D\n");
108
spoonView2D();
109
break;
110
111
} /* switch */
112
printf("The first number in the file, %d, called the viewType, not a valid value. It must be a number in the range of [1..4]\n",viewType);
113
return(0);
114
}
115
116