-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlibexample.c
56 lines (40 loc) · 1.69 KB
/
libexample.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/* This file is part of COVISE.
You can use it under the terms of the GNU Lesser General Public License
version 2.1 or later, see lgpl-2.1.txt.
* License: LGPL 2+ */
#include "covWriteFiles.h"
#include <stdio.h>
int main()
{
int pl[] = { 0, 4 };
int cl[] = { 0, 2, 3, 1, 5, 7, 6, 4 };
float x[] = { -1., -1., -1., -1., 1., 1., 1., 1. };
float y[] = { -1., -1., 1., 1., -1., -1., 1., 1. };
float z[] = { -1., 1., -1., 1., -1., 1., -1., 1. };
float normalsx[] = { 1., 1., 1., 1., -1., -1., -1., -1. };
float normalsy[] = { 1., 1., -1., -1., 1., 1., -1., -1. };
float normalsz[] = { 1., -1., 1., -1., 1., -1., 1., -1. };
int colors[] = { 65535, -65281, -671078401, -16318209, 65535, -3473153, -16318209, -65281 };
char *ANames[] = { "vertexOrder", "Session", NULL };
char *AValues[] = { "2", "FileLibTest" };
int outD;
outD = covOpenOutFile("polygon.covise");
covWriteGeometryBegin(outD, 1, 1, 0);
covWriteSetBegin(outD, 1);
covWritePOLYGN(outD, 2, pl, 8, cl, 8, x, y, z, ANames, AValues, COUNT_ATTR);
/* attributes of the set */
covWriteSetEnd(outD, NULL, NULL, COUNT_ATTR);
covWriteSetBegin(outD, 1);
/* colors of geometry */
covWriteRGBADT(outD, 8, colors, NULL, NULL, COUNT_ATTR);
/* attributes of the set */
covWriteSetEnd(outD, NULL, NULL, COUNT_ATTR);
covWriteSetBegin(outD, 1);
/* normals of geometry */
covWriteUSTVDT(outD, 8, normalsx, normalsy, normalsz, NULL, NULL, COUNT_ATTR);
/* attributes of the set */
covWriteSetEnd(outD, NULL, NULL, COUNT_ATTR);
/* attributes of the geometry container */
covWriteGeometryEnd(outD, NULL, NULL, COUNT_ATTR);
covCloseOutFile(outD);
}