BRL-CAD
brep_debug.h
Go to the documentation of this file.
1 /* B R E P _ D E B U G . H
2  * BRL-CAD
3  *
4  * Copyright (c) 2007-2014 United States Government as represented by
5  * the U.S. Army Research Laboratory.
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public License
9  * version 2.1 as published by the Free Software Foundation.
10  *
11  * This library is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this file; see the file named COPYING for more
18  * information.
19  */
20 /** @addtogroup g_ */
21 /** @{ */
22 /** @file brep_debug.h
23  *
24  * brep debugging utilities
25  *
26  */
27 
28 #ifndef LIBRT_PRIMITIVES_BREP_BREP_DEBUG_H
29 #define LIBRT_PRIMITIVES_BREP_BREP_DEBUG_H
30 
31 #include "common.h"
32 
33 #include <vector>
34 #include <list>
35 #include <iostream>
36 #include <algorithm>
37 #include <set>
38 #include <utility>
39 
40 #include "vmath.h"
41 
42 #include "brep.h"
43 #include "dvec.h"
44 
45 #include "raytrace.h"
46 #include "rtgeom.h"
47 
48 #define fastf_t double
49 
50 #ifdef __cplusplus
51 extern "C" {
52 #endif
53 
54 #ifdef __cplusplus
55 }
56 #endif
57 
58 using namespace brlcad;
59 
60 #include "plot3.h"
61 
62 #define BLUEVIOLET 138, 43, 226
63 #define CADETBLUE 95, 159, 159
64 #define CORNFLOWERBLUE 66, 66, 111
65 #define LIGHTBLUE 173, 216, 230
66 #define DARKGREEN 0, 100, 0
67 #define KHAKI 189, 183, 107
68 #define FORESTGREEN 34, 139, 34
69 #define LIMEGREEN 124, 252, 0
70 #define PALEGREEN 152, 251, 152
71 #define DARKORANGE 255, 140, 0
72 #define DARKSALMON 233, 150, 122
73 #define LIGHTCORAL 240, 128, 128
74 #define PEACH 255, 218, 185
75 #define DEEPPINK 255, 20, 147
76 #define HOTPINK 255, 105, 180
77 #define INDIANRED 205, 92, 92
78 #define DARKVIOLET 148, 0, 211
79 #define MAROON 139, 28, 98
80 #define GOLDENROD 218, 165, 32
81 #define DARKGOLDENROD 184, 134, 11
82 #define LIGHTGOLDENROD 238, 221, 130
83 #define DARKYELLOW 155, 155, 52
84 #define LIGHTYELLOW 255, 255, 224
85 #define PURERED 255, 0, 0
86 #define GREEN 0, 255, 0
87 #define BLUE 0, 0, 255
88 #define YELLOW 255, 255, 0
89 #define MAGENTA 255, 0, 255
90 #define CYAN 0, 255, 255
91 #define BLACK 0, 0, 0
92 #define WHITE 255, 255, 255
93 
94 extern FILE* brep_plot_file(const char *pname = NULL);
95 
96 #define M_COLOR_PLOT(c) pl_color(brep_plot_file(), c)
97 #define COLOR_PLOT(r, g, b) pl_color(brep_plot_file(), (r), (g), (b))
98 #define M_PT_PLOT(p) { \
99  point_t pp, ppp; \
100  vect_t grow; \
101  VSETALL(grow, 0.01); \
102  VADD2(pp, p, grow); \
103  VSUB2(ppp, p, grow); \
104  pdv_3box(brep_plot_file(), pp, ppp); \
105  }
106 #define PT_PLOT(p) { \
107  point_t pp; \
108  VSCALE(pp, p, 1.001); \
109  pdv_3box(brep_plot_file(), p, pp); \
110  }
111 #define LINE_PLOT(p1, p2) pdv_3move(brep_plot_file(), p1); pdv_3line(brep_plot_file(), p1, p2)
112 #define BB_PLOT(p1, p2) pdv_3box(brep_plot_file(), p1, p2)
113 
114 
115 void plotsurfaceleafs(SurfaceTree* surf);
116 void plotleaf3d(BBNode* bb,double within_distance_tol = BREP_EDGE_MISS_TOLERANCE);
117 void plotleafuv(BBNode* bb);
118 void plottrim(ON_BrepFace &face, struct bn_vlblock *vbp);
119 void plottrim(const ON_Curve &curve, double from, double to);
120 void plottrim(ON_Curve &curve);
121 
122 int brep_translate_scv(ON_Brep *brep, int surface_index, int i, int j, fastf_t dx, fastf_t dy, fastf_t dz);
123 
124 #endif
125 /** @} */
126 
127 /*
128  * Local Variables:
129  * mode: C++
130  * tab-width: 8
131  * c-basic-offset: 4
132  * indent-tabs-mode: t
133  * c-file-style: "stroustrup"
134  * End:
135  * ex: shiftwidth=4 tabstop=8
136  */
int brep_translate_scv(ON_Brep *brep, int surface_index, int i, int j, fastf_t dx, fastf_t dy, fastf_t dz)
Header file for the BRL-CAD common definitions.
void plotleaf3d(BBNode *bb, double within_distance_tol)
Definition: brep_debug.cpp:255
void plottrim(ON_BrepFace &face, struct bn_vlblock *vbp)
FILE * brep_plot_file(const char *pname)
Definition: brep_debug.cpp:84
void plotleafuv(BBNode *bb)
Definition: brep_debug.cpp:315
void plotsurfaceleafs(SurfaceTree *surf)
Definition: brep_debug.cpp:128
double fastf_t
Definition: defines.h:300