queso-0.53.0
Macros | Functions | Variables
ann2fig.cpp File Reference
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <string>
#include <ANN/ANNx.h>
Include dependency graph for ann2fig.cpp:

Go to the source code of this file.

Macros

#define TRANS_X(p)   (offset_x + scale*(p[dim_x]))
 
#define TRANS_Y(p)   (offset_y - scale*(p[dim_y]))
 

Functions

void Error (const char *msg, ANNerr level)
 
void set_slice_val (double val)
 
void getArgs (int argc, char **argv)
 
void writeHeader ()
 
void writePoint (ANNpoint p)
 
void writeBox (const ANNorthRect &r)
 
void writeLine (ANNpoint p0, ANNpoint p1)
 
void writeCaption (const ANNorthRect &bnd_box, char *caption)
 
ANNbool overlap (const ANNorthRect &box)
 
void recReadTree (ANNorthRect &box)
 
void readTree (ANNorthRect &bnd_box)
 
void readANN ()
 
 main (int argc, char **argv)
 

Variables

const int STRING_LEN = 500
 
const int MAX_DIM = 1000
 
const double DEF_SLICE_VAL = 0
 
const char FIG_HEAD [] = {"#FIG 3.1"}
 
const char DUMP_SUFFIX [] = {".dmp"}
 
const char FIG_SUFFIX [] = {".fig"}
 
char file_name [STRING_LEN]
 
char infile_name [STRING_LEN]
 
char outfile_name [STRING_LEN]
 
char caption [STRING_LEN]
 
ofstream ofile
 
ifstream ifile
 
int dim_x = 0
 
int dim_y = 1
 
double slice_val [MAX_DIM]
 
double u_per_in = 1200
 
double in_size = 5
 
double in_low_x = 1
 
double in_low_y = 1
 
double u_size = 6000
 
double u_low_x = 1200
 
double u_low_y = 1200
 
int pt_size = 10
 
int dim
 
int n_pts
 
ANNpointArray pts = NULL
 
double scale
 
double offset_x
 
double offset_y
 

Macro Definition Documentation

#define TRANS_X (   p)    (offset_x + scale*(p[dim_x]))

Definition at line 90 of file ann2fig.cpp.

Referenced by writeBox(), writeCaption(), writeLine(), and writePoint().

#define TRANS_Y (   p)    (offset_y - scale*(p[dim_y]))

Definition at line 91 of file ann2fig.cpp.

Referenced by writeBox(), writeCaption(), writeLine(), and writePoint().

Function Documentation

void Error ( const char *  msg,
ANNerr  level 
)

Definition at line 97 of file ann2fig.cpp.

References ANNabort.

Referenced by doValidation(), generatePts(), getArgs(), main(), readANN(), readPts(), and recReadTree().

98 {
99  if (level == ANNabort) {
100  cerr << "ann2fig: ERROR------->" << msg << "<-------------ERROR\n";
101  exit(1);
102  }
103  else {
104  cerr << "ann2fig: WARNING----->" << msg << "<-------------WARNING\n";
105  }
106 }
Definition: ANNx.h:48
void getArgs ( int  argc,
char **  argv 
)

Definition at line 146 of file ann2fig.cpp.

References ANNabort, ANNfalse, ANNtrue, caption, DEF_SLICE_VAL, dim_x, dim_y, DUMP_SUFFIX, Error(), FIG_SUFFIX, file_name, ifile, in_low_x, in_low_y, in_size, infile_name, MAX_DIM, ofile, outfile_name, pt_size, set_slice_val(), slice_val, u_low_x, u_low_y, u_per_in, and u_size.

Referenced by main().

147 {
148  int i;
149  int sl_dim; // temp slice dimension
150  double sl_val; // temp slice value
151 
152  set_slice_val(DEF_SLICE_VAL); // set initial slice-values
153 
154  if (argc <= 1) {
155  cerr << "Syntax:\n\
156  ann2fig [-upi scale] [-x low_x] [-y low_y]\n\
157  [-sz size] [-dx dim_x] [-dy dim_y] [-sl dim value]*\n\
158  file\n\
159  \n\
160  where:\n\
161  -upi scale fig units per inch (default = 1200)\n\
162  -x low_x x and y offset of upper left corner (inches)\n\
163  -y low_y ...(default = 1)\n\
164  -sz size maximum side length of figure (in inches)\n\
165  ...(default = 5)\n\
166  -dx dim_x horizontal dimension (default = 0)\n\
167  -dy dim_y vertical dimension (default = 1)\n\
168  -sv value default slice value (default = 0)\n\
169  -sl dim value each such pair defines the value along the\n\
170  ...given dimension at which to slice. This\n\
171  ...may be supplied for each dimension except\n\
172  ...dim_x and dim_y.\n\
173  -ps pointsize size of points in fig units (def = 10)\n\
174  file file (input=file.dmp, output=file.fig)\n";
175  exit(0);
176  }
177 
178  ANNbool fileSeen = ANNfalse; // file argument seen?
179 
180  for (i = 1; i < argc; i++) {
181  if (!strcmp(argv[i], "-upi")) { // process -upi option
182  sscanf(argv[++i], "%lf", &u_per_in);
183  }
184  else if (!strcmp(argv[i], "-x")) { // process -x option
185  sscanf(argv[++i], "%lf", &in_low_x);
186  }
187  else if (!strcmp(argv[i], "-y")) { // process -y option
188  sscanf(argv[++i], "%lf", &in_low_y);
189  }
190  else if (!strcmp(argv[i], "-sz")) { // process -sz option
191  sscanf(argv[++i], "%lf", &in_size);
192  }
193  else if (!strcmp(argv[i], "-dx")) { // process -dx option
194  sscanf(argv[++i], "%d", &dim_x);
195  }
196  else if (!strcmp(argv[i], "-dy")) { // process -dy option
197  sscanf(argv[++i], "%d", &dim_y);
198  }
199  else if (!strcmp(argv[i], "-sv")) { // process -sv option
200  sscanf(argv[++i], "%lf", &sl_val);
201  set_slice_val(sl_val); // set slice values
202  }
203  else if (!strcmp(argv[i], "-sl")) { // process -sl option
204  sscanf(argv[++i], "%d", &sl_dim);
205  if (sl_dim < 0 || sl_dim >= MAX_DIM) {
206  Error("Slice dimension out of bounds", ANNabort);
207  }
208  sscanf(argv[++i], "%lf", &slice_val[sl_dim]);
209  }
210  if (!strcmp(argv[i], "-ps")) { // process -ps option
211  sscanf(argv[++i], "%i", &pt_size);
212  }
213  else { // must be file name
214  fileSeen = ANNtrue;
215  sscanf(argv[i], "%s", file_name);
216  strcpy(infile_name, file_name); // copy to input file name
217  strcat(infile_name, DUMP_SUFFIX);
218  strcpy(outfile_name, file_name); // copy to output file name
219  strcat(outfile_name, FIG_SUFFIX);
220  }
221  }
222 
223  if (!fileSeen) { // no file seen
224  Error("File argument is required", ANNabort);
225  }
226 
227  ifile.open(infile_name, ios::in); // open for reading
228  if (!ifile) {
229  Error("Cannot open input file", ANNabort);
230  }
231  ofile.open(outfile_name, ios::out); // open for writing
232  if (!ofile) {
233  Error("Cannot open output file", ANNabort);
234  }
235 
236  u_low_x = u_per_in * in_low_x; // convert inches to fig units
238  u_size = u_per_in * in_size;
239 
240  strcpy(caption, argv[0]); // copy command line to caption
241  for (i = 1; i < argc; i++) {
242  strcat(caption, " ");
243  strcat(caption, argv[i]);
244  }
245 }
double in_size
Definition: ann2fig.cpp:73
const int MAX_DIM
Definition: ann2fig.cpp:57
ANNbool
Definition: ANN.h:132
char infile_name[STRING_LEN]
Definition: ann2fig.cpp:64
Definition: ANNx.h:48
char outfile_name[STRING_LEN]
Definition: ann2fig.cpp:65
ofstream ofile
Definition: ann2fig.cpp:67
char file_name[STRING_LEN]
Definition: ann2fig.cpp:63
double u_low_x
Definition: ann2fig.cpp:77
double u_size
Definition: ann2fig.cpp:76
const char FIG_SUFFIX[]
Definition: ann2fig.cpp:61
int dim_x
Definition: ann2fig.cpp:69
double u_per_in
Definition: ann2fig.cpp:72
char caption[STRING_LEN]
Definition: ann2fig.cpp:66
void set_slice_val(double val)
Definition: ann2fig.cpp:112
void Error(const char *msg, ANNerr level)
Definition: ann2fig.cpp:97
double slice_val[MAX_DIM]
Definition: ann2fig.cpp:71
int pt_size
Definition: ann2fig.cpp:79
ifstream ifile
Definition: ann2fig.cpp:68
double in_low_x
Definition: ann2fig.cpp:74
Definition: ANN.h:132
const char DUMP_SUFFIX[]
Definition: ann2fig.cpp:60
double u_low_y
Definition: ann2fig.cpp:78
const double DEF_SLICE_VAL
Definition: ann2fig.cpp:58
Definition: ANN.h:132
int dim_y
Definition: ann2fig.cpp:70
double in_low_y
Definition: ann2fig.cpp:75
main ( int  argc,
char **  argv 
)

Definition at line 583 of file ann2fig.cpp.

References getArgs(), and readANN().

584 {
585  getArgs(argc, argv); // get input arguments
586  readANN(); // read the dump file
587 }
void readANN()
Definition: ann2fig.cpp:514
void getArgs(int argc, char **argv)
Definition: ann2fig.cpp:146
ANNbool overlap ( const ANNorthRect box)

Definition at line 332 of file ann2fig.cpp.

References ANNfalse, ANNtrue, dim, dim_x, dim_y, ANNorthRect::hi, ANNorthRect::lo, and slice_val.

Referenced by recReadTree().

333 {
334  for (int i = 0; i < dim; i++) {
335  if (i != dim_x && i != dim_y &&
336  (box.lo[i] > slice_val[i] || box.hi[i] < slice_val[i]))
337  return ANNfalse;
338  }
339  return ANNtrue;
340 }
int dim_x
Definition: ann2fig.cpp:69
ANNpoint lo
Definition: ANNx.h:93
double slice_val[MAX_DIM]
Definition: ann2fig.cpp:71
int dim
Definition: ann2fig.cpp:81
Definition: ANN.h:132
ANNpoint hi
Definition: ANNx.h:94
Definition: ANN.h:132
int dim_y
Definition: ann2fig.cpp:70
void readANN ( )

Definition at line 514 of file ann2fig.cpp.

References ANNabort, annAllocPts(), dim, dim_x, dim_y, Error(), ANNorthRect::hi, ifile, ANNorthRect::lo, n_pts, offset_x, offset_y, pts, readTree(), scale, STRING_LEN, u_low_x, u_low_y, u_size, and version.

Referenced by main().

515 {
516  int j;
517  char str[STRING_LEN]; // storage for string
518  char version[STRING_LEN]; // storage for version
519  int bkt_size; // bucket size
520 
521  ifile >> str; // input header
522  if (strcmp(str, "#ANN") != 0) { // incorrect header
523  Error("Incorrect header for dump file", ANNabort);
524  }
525  ifile.getline(version, STRING_LEN); // get version (ignore)
526  ifile >> str; // get major heading
527  if (strcmp(str, "points") == 0) { // points section
528  ifile >> dim; // read dimension
529  ifile >> n_pts; // number of points
530  pts = annAllocPts(n_pts, dim); // allocate points
531  for (int i = 0; i < n_pts; i++) { // input point coordinates
532  int idx; // point index
533  ifile >> idx; // input point index
534  if (idx < 0 || idx >= n_pts) {
535  Error("Point index is out of range", ANNabort);
536  }
537  for (j = 0; j < dim; j++) {
538  ifile >> pts[idx][j]; // read point coordinates
539  }
540  }
541  ifile >> str; // get next major heading
542  }
543  if (strcmp(str, "tree") == 0) { // tree section
544  ifile >> dim; // read dimension
545  if (dim_x > dim || dim_y > dim) {
546  Error("Dimensions out of bounds", ANNabort);
547  }
548  ifile >> n_pts; // number of points
549  ifile >> bkt_size; // bucket size (ignored)
550  // read bounding box
551  ANNorthRect bnd_box(dim); // create bounding box
552  for (j = 0; j < dim; j++) {
553  ifile >> bnd_box.lo[j]; // read box low coordinates
554  }
555  for (j = 0; j < dim; j++) {
556  ifile >> bnd_box.hi[j]; // read box high coordinates
557  }
558  // compute scaling factors
559  double box_len_x = bnd_box.hi[dim_x] - bnd_box.lo[dim_x];
560  double box_len_y = bnd_box.hi[dim_y] - bnd_box.lo[dim_y];
561  // longer side determines scale
562  if (box_len_x > box_len_y) scale = u_size/box_len_x;
563  else scale = u_size/box_len_y;
564  // compute offsets
565  offset_x = u_low_x - scale*bnd_box.lo[dim_x];
566  offset_y = u_low_y + scale*bnd_box.hi[dim_y];
567  readTree(bnd_box); // read the tree and process
568  }
569  else if (strcmp(str, "null") == 0) return; // empty tree
570  else {
571  cerr << "Input string: " << str << "\n";
572  Error("Illegal ann format. Expecting section heading", ANNabort);
573  }
574 }
int n_pts
Definition: ann2fig.cpp:82
const int STRING_LEN
Definition: ann2fig.cpp:56
and that you are informed that you can do these things To protect your we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it For if you distribute copies of the whether gratis or for a you must give the recipients all the rights that we gave you You must make sure that receive or can get the source code If you link other code with the you must provide complete object files to the so that they can relink them with the library after making changes to the library and recompiling it And you must show them these terms so they know their rights We protect your rights with a two step which gives you legal permission to distribute and or modify the library To protect each we want to make it very clear that there is no warranty for the free library if the library is modified by someone else and passed the recipients should know that what they have is not the original version
Definition: License.txt:60
ANNpointArray pts
Definition: ann2fig.cpp:83
Definition: ANNx.h:48
double offset_y
Definition: ann2fig.cpp:87
void readTree(ANNorthRect &bnd_box)
Definition: ann2fig.cpp:464
double u_low_x
Definition: ann2fig.cpp:77
double u_size
Definition: ann2fig.cpp:76
double scale
Definition: ann2fig.cpp:85
int dim_x
Definition: ann2fig.cpp:69
void Error(const char *msg, ANNerr level)
Definition: ann2fig.cpp:97
ifstream ifile
Definition: ann2fig.cpp:68
int dim
Definition: ann2fig.cpp:81
DLL_API ANNpointArray annAllocPts(int n, int dim)
Definition: ANN.cpp:117
double u_low_y
Definition: ann2fig.cpp:78
int dim_y
Definition: ann2fig.cpp:70
double offset_x
Definition: ann2fig.cpp:86
void readTree ( ANNorthRect bnd_box)

Definition at line 464 of file ann2fig.cpp.

References caption, recReadTree(), writeBox(), writeCaption(), and writeHeader().

Referenced by readANN().

465 {
466  writeHeader(); // output header
467  writeBox(bnd_box); // draw bounding box
468  writeCaption(bnd_box, caption); // write caption
469  recReadTree(bnd_box); // do it
470 }
void writeBox(const ANNorthRect &r)
Definition: ann2fig.cpp:277
void writeHeader()
Definition: ann2fig.cpp:256
void recReadTree(ANNorthRect &box)
Definition: ann2fig.cpp:377
void writeCaption(const ANNorthRect &bnd_box, char *caption)
Definition: ann2fig.cpp:308
char caption[STRING_LEN]
Definition: ann2fig.cpp:66
void recReadTree ( ANNorthRect box)

Definition at line 377 of file ann2fig.cpp.

References ANNabort, ANNwarn, dim, dim_x, dim_y, Error(), ANNorthRect::hi, ifile, ANNorthRect::lo, n_pts, overlap(), ANNorthHalfSpace::project(), pts, STRING_LEN, writeBox(), writeLine(), and writePoint().

Referenced by readTree().

378 {
379  char tag[STRING_LEN]; // tag (leaf, split, shrink)
380  int n_pts; // number of points in leaf
381  int idx; // point index
382  int cd; // cut dimension
383  ANNcoord cv; // cut value
384  ANNcoord lb; // low bound
385  ANNcoord hb; // high bound
386  int n_bnds; // number of bounding sides
387  int sd; // which side
388 
389  ifile >> tag; // input node tag
390  if (strcmp(tag, "leaf") == 0) { // leaf node
391 
392  ifile >> n_pts; // input number of points
393  // check for overlap
394  if (dim == 2 || overlap(box)) {
395  for (int i = 0; i < n_pts; i++) { // yes, write the points
396  ifile >> idx;
397  writePoint(pts[idx]);
398  }
399  }
400  else { // input but ignore points
401  for (int i = 0; i < n_pts; i++) {
402  ifile >> idx;
403  }
404  }
405  }
406  else if (strcmp(tag, "split") == 0) { // splitting node
407 
408  ifile >> cd >> cv >> lb >> hb;
409  if (lb != box.lo[cd] || hb != box.hi[cd]) {
410  Error("Bounding box coordinates are fishy", ANNwarn);
411  }
412 
413  ANNcoord lv = box.lo[cd]; // save bounds for cutting dim
414  ANNcoord hv = box.hi[cd];
415 
416  //--------------------------------------------------------------
417  // The following code is rather fragile so modify at your
418  // own risk. We first decrease the high-end of the bounding
419  // box down to the cutting plane and then read the left subtree.
420  // Then we increase the low-end of the bounding box up to the
421  // cutting plane (thus collapsing the bounding box to a d-1
422  // dimensional hyperrectangle). Then we draw the projection of
423  // its diagonal if it crosses the slicing plane. This will have
424  // the effect of drawing its intersection on the slicing plane.
425  // Then we restore the high-end of the bounding box and read
426  // the right subtree. Finally we restore the low-end of the
427  // bounding box, before returning.
428  //--------------------------------------------------------------
429  box.hi[cd] = cv; // decrease high bounds
430  recReadTree(box); // read left subtree
431  // check for overlap
432  box.lo[cd] = cv; // increase low bounds
433  if (dim == 2 || overlap(box)) { // check for overlap
434  if (cd == dim_x || cd == dim_y) { // cut through slice plane
435  writeLine(box.lo, box.hi); // draw cutting line
436  }
437  }
438  box.hi[cd] = hv; // restore high bounds
439 
440  recReadTree(box); // read right subtree
441  box.lo[cd] = lv; // restore low bounds
442  }
443  else if (strcmp(tag, "shrink") == 0) { // splitting node
444 
445  ANNorthRect inner(dim, box); // copy bounding box
446  ifile >> n_bnds; // number of bounding sides
447  for (int i = 0; i < n_bnds; i++) {
448  ifile >> cd >> cv >> sd; // input bounding halfspace
449  ANNorthHalfSpace hs(cd, cv, sd); // create orthogonal halfspace
450  hs.project(inner.lo); // intersect by projecting
451  hs.project(inner.hi);
452  }
453  if (dim == 2 || overlap(inner)) {
454  writeBox(inner); // draw inner rectangle
455  }
456  recReadTree(inner); // read inner subtree
457  recReadTree(box); // read outer subtree
458  }
459  else {
460  Error("Illegal node type in dump file", ANNabort);
461  }
462 }
void writeBox(const ANNorthRect &r)
Definition: ann2fig.cpp:277
int n_pts
Definition: ann2fig.cpp:82
void recReadTree(ANNorthRect &box)
Definition: ann2fig.cpp:377
const int STRING_LEN
Definition: ann2fig.cpp:56
ANNpointArray pts
Definition: ann2fig.cpp:83
Definition: ANNx.h:48
double ANNcoord
Definition: ANN.h:158
Definition: ANNx.h:48
void writePoint(ANNpoint p)
Definition: ann2fig.cpp:265
ANNbool overlap(const ANNorthRect &box)
Definition: ann2fig.cpp:332
int dim_x
Definition: ann2fig.cpp:69
ANNpoint lo
Definition: ANNx.h:93
void Error(const char *msg, ANNerr level)
Definition: ann2fig.cpp:97
ifstream ifile
Definition: ann2fig.cpp:68
int dim
Definition: ann2fig.cpp:81
ANNpoint hi
Definition: ANNx.h:94
void writeLine(ANNpoint p0, ANNpoint p1)
Definition: ann2fig.cpp:294
int dim_y
Definition: ann2fig.cpp:70
void set_slice_val ( double  val)

Definition at line 112 of file ann2fig.cpp.

References MAX_DIM, and slice_val.

Referenced by getArgs().

113 {
114  for (int i = 0; i < MAX_DIM; i++) {
115  slice_val[i] = val;
116  }
117 }
const int MAX_DIM
Definition: ann2fig.cpp:57
double slice_val[MAX_DIM]
Definition: ann2fig.cpp:71
void writeBox ( const ANNorthRect r)

Definition at line 277 of file ann2fig.cpp.

References ANNorthRect::hi, ANNorthRect::lo, ofile, TRANS_X, and TRANS_Y.

Referenced by readTree(), and recReadTree().

278 {
279  // unfilled box object
280  ofile << "2 2 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 5\n";
281 
282  int p0_x = (int) TRANS_X(r.lo); // transform endpoints
283  int p0_y = (int) TRANS_Y(r.lo);
284  int p1_x = (int) TRANS_X(r.hi);
285  int p1_y = (int) TRANS_Y(r.hi);
286  ofile << "\t"
287  << p0_x << " " << p0_y << " " // write vertices
288  << p1_x << " " << p0_y << " "
289  << p1_x << " " << p1_y << " "
290  << p0_x << " " << p1_y << " "
291  << p0_x << " " << p0_y << "\n";
292 }
ofstream ofile
Definition: ann2fig.cpp:67
#define TRANS_X(p)
Definition: ann2fig.cpp:90
#define TRANS_Y(p)
Definition: ann2fig.cpp:91
ANNpoint lo
Definition: ANNx.h:93
ANNpoint hi
Definition: ANNx.h:94
void writeCaption ( const ANNorthRect bnd_box,
char *  caption 
)

Definition at line 308 of file ann2fig.cpp.

References ANNorthRect::lo, ofile, TRANS_X, TRANS_Y, and u_per_in.

Referenced by readTree().

311 {
312  if (!strcmp(caption, "\0")) return; // null string?
313  int px = (int) TRANS_X(bnd_box.lo); // put .5 in. lower left
314  int py = (int) (TRANS_Y(bnd_box.lo) + 0.50 * u_per_in);
315  ofile << "4 0 -1 0 0 0 20 0.0000 4 255 2000 ";
316  ofile << px << " " << py << " " << caption << "\\001\n";
317 }
ofstream ofile
Definition: ann2fig.cpp:67
#define TRANS_X(p)
Definition: ann2fig.cpp:90
#define TRANS_Y(p)
Definition: ann2fig.cpp:91
double u_per_in
Definition: ann2fig.cpp:72
char caption[STRING_LEN]
Definition: ann2fig.cpp:66
ANNpoint lo
Definition: ANNx.h:93
void writeHeader ( )

Definition at line 256 of file ann2fig.cpp.

References FIG_HEAD, ofile, and u_per_in.

Referenced by readTree().

257 {
258  ofile << FIG_HEAD << "\n" // fig file header
259  << "Portrait\n"
260  << "Center\n"
261  << "Inches\n"
262  << (int) u_per_in << " 2\n";
263 }
ofstream ofile
Definition: ann2fig.cpp:67
double u_per_in
Definition: ann2fig.cpp:72
const char FIG_HEAD[]
Definition: ann2fig.cpp:59
void writeLine ( ANNpoint  p0,
ANNpoint  p1 
)

Definition at line 294 of file ann2fig.cpp.

References ofile, TRANS_X, and TRANS_Y.

Referenced by recReadTree().

295 {
296  // unfilled line object
297  ofile << "2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2\n";
298 
299  int p0_x = (int) TRANS_X(p0); // transform endpoints
300  int p0_y = (int) TRANS_Y(p0);
301  int p1_x = (int) TRANS_X(p1);
302  int p1_y = (int) TRANS_Y(p1);
303  ofile << "\t"
304  << p0_x << " " << p0_y << " " // write vertices
305  << p1_x << " " << p1_y << "\n";
306 }
ofstream ofile
Definition: ann2fig.cpp:67
#define TRANS_X(p)
Definition: ann2fig.cpp:90
#define TRANS_Y(p)
Definition: ann2fig.cpp:91
void writePoint ( ANNpoint  p)

Definition at line 265 of file ann2fig.cpp.

References ofile, pt_size, TRANS_X, and TRANS_Y.

Referenced by recReadTree().

266 {
267  // filled black point object
268  ofile << "1 3 0 1 -1 7 0 0 0 0.000 1 0.0000 ";
269  int cent_x = (int) TRANS_X(p); // transform center coords
270  int cent_y = (int) TRANS_Y(p);
271  ofile << cent_x << " " << cent_y << " " // write center, radius, bounds
272  << pt_size << " " << pt_size << " "
273  << cent_x << " " << cent_y << " "
274  << cent_x + pt_size << " " << cent_y + pt_size << "\n";
275 }
ofstream ofile
Definition: ann2fig.cpp:67
#define TRANS_X(p)
Definition: ann2fig.cpp:90
#define TRANS_Y(p)
Definition: ann2fig.cpp:91
int pt_size
Definition: ann2fig.cpp:79

Variable Documentation

char caption[STRING_LEN]

Definition at line 66 of file ann2fig.cpp.

Referenced by getArgs(), and readTree().

const double DEF_SLICE_VAL = 0

Definition at line 58 of file ann2fig.cpp.

Referenced by getArgs().

int dim
int dim_x = 0

Definition at line 69 of file ann2fig.cpp.

Referenced by getArgs(), overlap(), readANN(), and recReadTree().

int dim_y = 1

Definition at line 70 of file ann2fig.cpp.

Referenced by getArgs(), overlap(), readANN(), and recReadTree().

const char DUMP_SUFFIX[] = {".dmp"}

Definition at line 60 of file ann2fig.cpp.

Referenced by getArgs().

const char FIG_HEAD[] = {"#FIG 3.1"}

Definition at line 59 of file ann2fig.cpp.

Referenced by writeHeader().

const char FIG_SUFFIX[] = {".fig"}

Definition at line 61 of file ann2fig.cpp.

Referenced by getArgs().

char file_name[STRING_LEN]

Definition at line 63 of file ann2fig.cpp.

Referenced by getArgs().

ifstream ifile

Definition at line 68 of file ann2fig.cpp.

Referenced by getArgs(), readANN(), and recReadTree().

double in_low_x = 1

Definition at line 74 of file ann2fig.cpp.

Referenced by getArgs().

double in_low_y = 1

Definition at line 75 of file ann2fig.cpp.

Referenced by getArgs().

double in_size = 5

Definition at line 73 of file ann2fig.cpp.

Referenced by getArgs().

char infile_name[STRING_LEN]

Definition at line 64 of file ann2fig.cpp.

Referenced by getArgs().

const int MAX_DIM = 1000

Definition at line 57 of file ann2fig.cpp.

Referenced by getArgs(), and set_slice_val().

int n_pts
double offset_x

Definition at line 86 of file ann2fig.cpp.

Referenced by readANN().

double offset_y

Definition at line 87 of file ann2fig.cpp.

Referenced by readANN().

ofstream ofile

Definition at line 67 of file ann2fig.cpp.

Referenced by getArgs(), writeBox(), writeCaption(), writeHeader(), writeLine(), and writePoint().

char outfile_name[STRING_LEN]

Definition at line 65 of file ann2fig.cpp.

Referenced by getArgs().

int pt_size = 10

Definition at line 79 of file ann2fig.cpp.

Referenced by getArgs(), and writePoint().

ANNpointArray pts = NULL
double scale
double slice_val[MAX_DIM]

Definition at line 71 of file ann2fig.cpp.

Referenced by getArgs(), overlap(), and set_slice_val().

const int STRING_LEN = 500

Definition at line 56 of file ann2fig.cpp.

Referenced by annReadDump(), annReadTree(), main(), readANN(), and recReadTree().

double u_low_x = 1200

Definition at line 77 of file ann2fig.cpp.

Referenced by getArgs(), and readANN().

double u_low_y = 1200

Definition at line 78 of file ann2fig.cpp.

Referenced by getArgs(), and readANN().

double u_per_in = 1200

Definition at line 72 of file ann2fig.cpp.

Referenced by getArgs(), writeCaption(), and writeHeader().

double u_size = 6000

Definition at line 76 of file ann2fig.cpp.

Referenced by getArgs(), and readANN().


Generated on Thu Jun 11 2015 13:52:33 for queso-0.53.0 by  doxygen 1.8.5