#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/mman.h>
#include <string.h>
#include <math.h>
#include "vrml303.h"
#include "zlib/zlib.h"
#include "gzio_compress.h"
Include dependency graph for vrml303.c:
Go to the source code of this file.
Defines | |
#define | D(x) |
#define | MD1(x) |
#define | MD2(x) |
#define | MD(x) |
#define | MYMAXINT 0x7fffffff |
#define | EDGEFRACTMAX 16384 |
#define | LINEWIDTH2BREAK 80 |
#define | MAXCOLORS 32 |
Functions | |
char * | indentString (int n, int inc) |
void | initPseudoColor (const char *options) |
char * | pseudoColorStr (char *cs, int value) |
int | fillEdgesArray (int level, int x0, int y0, int x1, int y1, int vert[MAX_VERTEX_Y][MAX_VERTEX_X], short edArr[MAX_VERTEX_Y+1][MAX_VERTEX_X+1][2]) |
int | findStartEdge (int *edgeNum, int x0, int y0, int x1, int y1, short edArr[MAX_VERTEX_Y+1][MAX_VERTEX_X+1][2]) |
int | findNextEdge (int *edgeNum, int x0, int y0, int x1, int y1, short edArr[MAX_VERTEX_Y+1][MAX_VERTEX_X+1][2]) |
int | exportIsolineCoord (int closed, int scaleX, int scaleY, int dcm, int indent, const char *frmt, int *edgeNumS, int x0, int y0, int x1, int y1, short edArr[MAX_VERTEX_Y+1][MAX_VERTEX_X+1][2]) |
int | exportIsolineNode (int level, int scaleX, int scaleY, int dcm, int indent, const char *charZ, const char *Appearance, int x0, int y0, int x1, int y1, int vert[MAX_VERTEX_Y][MAX_VERTEX_X], short edArr[MAX_VERTEX_Y+1][MAX_VERTEX_X+1][2]) |
void | exportVRMLStart (int level) |
void | exportVRMLViewpoints (int width, int height, int elev) |
int | initVertexArray (const char *dmaFileName, int width, int height, int maxpixel, int decimate_x, int decimate_y, int vert[MAX_VERTEX_Y][MAX_VERTEX_X]) |
void | exportFacesAppearance (const char *aname, const char *mname, double transparency) |
void | exportIsolinesAppearance (const char *prefix, int numLev) |
void | exportCoordinateSet (const char *name, int width, int height, int elev, int scale_X, int scale_Y, int dcp, int indent, int vert[MAX_VERTEX_Y][MAX_VERTEX_X]) |
void | exportColorSet (const char *name, int width, int height, int indent, int vert[MAX_VERTEX_Y][MAX_VERTEX_X]) |
void | exportSwitchStart (const char *name, const char *suffics, int *ind) |
void | exportSwitchEnd (int *ind) |
void | exportTransformStart (const char *name, const char *suffics, int *ind) |
void | exportTransformEnd (int *ind) |
void | exportIFSStart (const char *app, const char *coord, const char *color, int *ind) |
void | exportILSStart (const char *app, const char *coord, const char *color, int *ind) |
void | exportIFLSEnd (int *ind) |
void | exportTopFaces (int x0, int y0, int x1, int y1, int rowLen, const char *app, const char *coord, const char *color, int *ind) |
void | exportBottomFaces (int x0, int y0, int x1, int y1, int rowLen, const char *app, const char *coord, const char *color, int *ind) |
void | exportSideFaces (int x0, int y0, int x1, int y1, int rowLen, const char *app, const char *coord, const char *color, int wallNum, int *ind) |
void | exportTopEdges (int x0, int y0, int x1, int y1, int rowLen, const char *coord, const char *color, int *ind) |
void | exportBottomEdges (int x0, int y0, int x1, int y1, int rowLen, const char *coord, const char *color, int *ind) |
void | exportSideEdges (int x0, int y0, int x1, int y1, int rowLen, const char *coord, const char *color, int wallNum, int *ind) |
int | export_vrml (const char *dmaFileName, int width, int height, int maxpixel, int decimate_x, int decimate_y, int blocks_x, int blocks_y, int indent, int dcp, int nIsolines, int genFlatIso, int genElevIso, const char *colors, int compressionLevel) |
Variables | |
int | nextEdgeTable [][2][3][4] |
char | indentS [] = " " |
struct { | |
int numcolors | |
int coeff | |
int red [MAXCOLORS] | |
int green [MAXCOLORS] | |
int blue [MAXCOLORS] | |
} | colorTab |
gzFile | gzfile |
#define EDGEFRACTMAX 16384 |
Definition at line 46 of file vrml303.c.
Referenced by exportIsolineCoord(), fillEdgesArray(), and findNextEdge().
#define LINEWIDTH2BREAK 80 |
Definition at line 47 of file vrml303.c.
Referenced by exportIsolineNode(), exportSideFaces(), and exportTopEdges().
#define MAXCOLORS 32 |
#define MD1 | ( | x | ) |
Definition at line 29 of file vrml303.c.
Referenced by camSeqStart(), camSeqStartClip(), camSeqStop(), ccam_DMA_ioctl(), exportIsolineCoord(), exportIsolineNode(), fillEdgesArray(), findNextEdge(), programSensor(), set_gamma(), and X313_dma_update().
#define MD2 | ( | x | ) |
Definition at line 33 of file vrml303.c.
Referenced by exportVRMLStart(), programSensor(), and X313_dma_update().
#define MYMAXINT 0x7fffffff |
Definition at line 45 of file vrml303.c.
Referenced by export_vrml(), exportCoordinateSet(), exportIsolinesAppearance(), initPseudoColor(), and initVertexArray().
int export_vrml | ( | const char * | dmaFileName, | |
int | width, | |||
int | height, | |||
int | maxpixel, | |||
int | decimate_x, | |||
int | decimate_y, | |||
int | blocks_x, | |||
int | blocks_y, | |||
int | indent, | |||
int | dcp, | |||
int | nIsolines, | |||
int | genFlatIso, | |||
int | genElevIso, | |||
const char * | colors, | |||
int | compressionLevel | |||
) |
Definition at line 1342 of file vrml303.c.
References exportBottomEdges(), exportBottomFaces(), exportColorSet(), exportCoordinateSet(), exportFacesAppearance(), exportIsolineNode(), exportIsolinesAppearance(), exportSideEdges(), exportSideFaces(), exportSwitchEnd(), exportSwitchStart(), exportTopEdges(), exportTopFaces(), exportTransformEnd(), exportTransformStart(), exportVRMLStart(), exportVRMLViewpoints(), gzclose(), gzfile, gzprintf(), initPseudoColor(), initVertexArray(), MAX_VERTEX_X, MAX_VERTEX_Y, MD, MYMAXINT, s, and stderr.
Referenced by processImage().
void exportBottomEdges | ( | int | x0, | |
int | y0, | |||
int | x1, | |||
int | y1, | |||
int | rowLen, | |||
const char * | coord, | |||
const char * | color, | |||
int * | ind | |||
) |
Definition at line 1283 of file vrml303.c.
References exportIFLSEnd(), exportILSStart(), gzfile, gzprintf(), and indentString().
Referenced by export_vrml().
void exportBottomFaces | ( | int | x0, | |
int | y0, | |||
int | x1, | |||
int | y1, | |||
int | rowLen, | |||
const char * | app, | |||
const char * | coord, | |||
const char * | color, | |||
int * | ind | |||
) |
Definition at line 1176 of file vrml303.c.
References exportIFLSEnd(), exportIFSStart(), gzfile, gzprintf(), and indentString().
Referenced by export_vrml().
void exportColorSet | ( | const char * | name, | |
int | width, | |||
int | height, | |||
int | indent, | |||
int | vert[MAX_VERTEX_Y][MAX_VERTEX_X] | |||
) |
Definition at line 1033 of file vrml303.c.
References gzfile, gzprintf(), indentString(), pseudoColorStr(), and x.
Referenced by export_vrml().
void exportCoordinateSet | ( | const char * | name, | |
int | width, | |||
int | height, | |||
int | elev, | |||
int | scale_X, | |||
int | scale_Y, | |||
int | dcp, | |||
int | indent, | |||
int | vert[MAX_VERTEX_Y][MAX_VERTEX_X] | |||
) |
Definition at line 1000 of file vrml303.c.
References gzfile, gzprintf(), indentString(), MYMAXINT, and x.
Referenced by export_vrml().
void exportFacesAppearance | ( | const char * | aname, | |
const char * | mname, | |||
double | transparency | |||
) |
Definition at line 982 of file vrml303.c.
References gzfile, and gzprintf().
Referenced by export_vrml().
void exportIFLSEnd | ( | int * | ind | ) |
Definition at line 1125 of file vrml303.c.
References gzfile, gzprintf(), and indentString().
Referenced by exportBottomEdges(), exportBottomFaces(), exportSideEdges(), exportSideFaces(), exportTopEdges(), and exportTopFaces().
void exportIFSStart | ( | const char * | app, | |
const char * | coord, | |||
const char * | color, | |||
int * | ind | |||
) |
Definition at line 1089 of file vrml303.c.
References gzfile, gzprintf(), and indentString().
Referenced by exportBottomFaces(), exportSideFaces(), and exportTopFaces().
void exportILSStart | ( | const char * | app, | |
const char * | coord, | |||
const char * | color, | |||
int * | ind | |||
) |
Definition at line 1110 of file vrml303.c.
References gzfile, gzprintf(), and indentString().
Referenced by exportBottomEdges(), exportSideEdges(), and exportTopEdges().
int exportIsolineCoord | ( | int | closed, | |
int | scaleX, | |||
int | scaleY, | |||
int | dcm, | |||
int | indent, | |||
const char * | frmt, | |||
int * | edgeNumS, | |||
int | x0, | |||
int | y0, | |||
int | x1, | |||
int | y1, | |||
short | edArr[MAX_VERTEX_Y+1][MAX_VERTEX_X+1][2] | |||
) |
Definition at line 649 of file vrml303.c.
References EDGEFRACTMAX, findNextEdge(), gzfile, gzprintf(), indentString(), MD1, memcpy(), stderr, and x.
Referenced by exportIsolineNode().
int exportIsolineNode | ( | int | level, | |
int | scaleX, | |||
int | scaleY, | |||
int | dcm, | |||
int | indent, | |||
const char * | charZ, | |||
const char * | Appearance, | |||
int | x0, | |||
int | y0, | |||
int | x1, | |||
int | y1, | |||
int | vert[MAX_VERTEX_Y][MAX_VERTEX_X], | |||
short | edArr[MAX_VERTEX_Y+1][MAX_VERTEX_X+1][2] | |||
) |
Definition at line 725 of file vrml303.c.
References exportIsolineCoord(), fillEdgesArray(), findStartEdge(), gzfile, gzprintf(), indentString(), LINEWIDTH2BREAK, MD1, and stderr.
Referenced by export_vrml().
void exportIsolinesAppearance | ( | const char * | prefix, | |
int | numLev | |||
) |
Definition at line 990 of file vrml303.c.
References gzfile, gzprintf(), MYMAXINT, and pseudoColorStr().
Referenced by export_vrml().
void exportSideEdges | ( | int | x0, | |
int | y0, | |||
int | x1, | |||
int | y1, | |||
int | rowLen, | |||
const char * | coord, | |||
const char * | color, | |||
int | wallNum, | |||
int * | ind | |||
) |
Definition at line 1299 of file vrml303.c.
References exportIFLSEnd(), exportILSStart(), gzfile, gzprintf(), and indentString().
Referenced by export_vrml().
void exportSideFaces | ( | int | x0, | |
int | y0, | |||
int | x1, | |||
int | y1, | |||
int | rowLen, | |||
const char * | app, | |||
const char * | coord, | |||
const char * | color, | |||
int | wallNum, | |||
int * | ind | |||
) |
Definition at line 1193 of file vrml303.c.
References exportIFLSEnd(), exportIFSStart(), gzfile, gzprintf(), indentString(), and LINEWIDTH2BREAK.
Referenced by export_vrml().
void exportSwitchEnd | ( | int * | ind | ) |
Definition at line 1062 of file vrml303.c.
References gzfile, gzprintf(), and indentString().
Referenced by export_vrml().
void exportSwitchStart | ( | const char * | name, | |
const char * | suffics, | |||
int * | ind | |||
) |
Definition at line 1053 of file vrml303.c.
References gzfile, gzprintf(), and indentString().
Referenced by export_vrml().
void exportTopEdges | ( | int | x0, | |
int | y0, | |||
int | x1, | |||
int | y1, | |||
int | rowLen, | |||
const char * | coord, | |||
const char * | color, | |||
int * | ind | |||
) |
Definition at line 1248 of file vrml303.c.
References exportIFLSEnd(), exportILSStart(), gzfile, gzprintf(), indentString(), LINEWIDTH2BREAK, and x.
Referenced by export_vrml().
void exportTopFaces | ( | int | x0, | |
int | y0, | |||
int | x1, | |||
int | y1, | |||
int | rowLen, | |||
const char * | app, | |||
const char * | coord, | |||
const char * | color, | |||
int * | ind | |||
) |
Definition at line 1134 of file vrml303.c.
References exportIFLSEnd(), exportIFSStart(), gzfile, gzprintf(), indentString(), and x.
Referenced by export_vrml().
void exportTransformEnd | ( | int * | ind | ) |
Definition at line 1081 of file vrml303.c.
References gzfile, gzprintf(), and indentString().
Referenced by export_vrml().
void exportTransformStart | ( | const char * | name, | |
const char * | suffics, | |||
int * | ind | |||
) |
Definition at line 1069 of file vrml303.c.
References gzfile, gzprintf(), and indentString().
Referenced by export_vrml().
void exportVRMLStart | ( | int | level | ) |
Definition at line 804 of file vrml303.c.
References gz_useFile(), gzfile, gzprintf(), MD2, mode, stderr, and stdout.
Referenced by export_vrml().
Definition at line 830 of file vrml303.c.
References gzfile, and gzprintf().
Referenced by export_vrml().
int fillEdgesArray | ( | int | level, | |
int | x0, | |||
int | y0, | |||
int | x1, | |||
int | y1, | |||
int | vert[MAX_VERTEX_Y][MAX_VERTEX_X], | |||
short | edArr[MAX_VERTEX_Y+1][MAX_VERTEX_X+1][2] | |||
) |
Definition at line 364 of file vrml303.c.
References EDGEFRACTMAX, MAX_VERTEX_Y, MD1, memset(), stderr, and x.
Referenced by exportIsolineNode().
int findNextEdge | ( | int * | edgeNum, | |
int | x0, | |||
int | y0, | |||
int | x1, | |||
int | y1, | |||
short | edArr[MAX_VERTEX_Y+1][MAX_VERTEX_X+1][2] | |||
) |
Definition at line 586 of file vrml303.c.
References EDGEFRACTMAX, MD1, nextEdgeTable, and stderr.
Referenced by exportIsolineCoord().
Definition at line 355 of file vrml303.c.
References indentS.
Referenced by exportBottomEdges(), exportBottomFaces(), exportColorSet(), exportCoordinateSet(), exportIFLSEnd(), exportIFSStart(), exportILSStart(), exportIsolineCoord(), exportIsolineNode(), exportSideEdges(), exportSideFaces(), exportSwitchEnd(), exportSwitchStart(), exportTopEdges(), exportTopFaces(), exportTransformEnd(), and exportTransformStart().
void initPseudoColor | ( | const char * | options | ) |
Definition at line 257 of file vrml303.c.
References colorTab, MAXCOLORS, MYMAXINT, pseudoColorStr(), and stderr.
Referenced by export_vrml().
int initVertexArray | ( | const char * | dmaFileName, | |
int | width, | |||
int | height, | |||
int | maxpixel, | |||
int | decimate_x, | |||
int | decimate_y, | |||
int | vert[MAX_VERTEX_Y][MAX_VERTEX_X] | |||
) |
Definition at line 876 of file vrml303.c.
References MAP_OPTIONS, MAX_IMAGE_HEIGHT, MAX_IMAGE_WIDTH, MAX_VERTEX_Y, MD, memset(), MYMAXINT, stderr, and x.
Referenced by export_vrml().
char * pseudoColorStr | ( | char * | cs, | |
int | value | |||
) |
Definition at line 330 of file vrml303.c.
References colorTab.
Referenced by exportColorSet(), exportIsolinesAppearance(), and initPseudoColor().
struct { ... } colorTab |
Referenced by initPseudoColor(), and pseudoColorStr().
gzFile gzfile |
Definition at line 228 of file vrml303.c.
Referenced by export_vrml(), exportBottomEdges(), exportBottomFaces(), exportColorSet(), exportCoordinateSet(), exportFacesAppearance(), exportIFLSEnd(), exportIFSStart(), exportILSStart(), exportIsolineCoord(), exportIsolineNode(), exportIsolinesAppearance(), exportSideEdges(), exportSideFaces(), exportSwitchEnd(), exportSwitchStart(), exportTopEdges(), exportTopFaces(), exportTransformEnd(), exportTransformStart(), exportVRMLStart(), and exportVRMLViewpoints().
char indentS[] = " " |
int nextEdgeTable[][2][3][4] |
Initial value:
{ { { { 0, 1, 1, 0}, { 1, 0, 0, 0}, { 0, 0, 1, 1}}, { {-1, 0, 1, 1}, {-1, 0, 0, 1}, {-1, 1, 1, 0}}}, { { { 0, 0, 0, 1}, { 0, 1, 1, 0}, { 1, 0, 0, 0}}, { { 1,-1, 0, 0}, { 0,-1, 1, 1}, { 0,-1, 0, 1}}}}
Definition at line 198 of file vrml303.c.
Referenced by findNextEdge().