HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GR_PickRender.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: GR_PickRender ( GR Library, C++)
7  *
8  * COMMENTS:
9  * Pure virutal base class for component picking
10  */
11 #ifndef GR_PickRender_h
12 #define GR_PickRender_h
13 
14 class RE_Render;
15 class RE_Geometry;
16 class GR_DisplayOption;
17 class GR_RenderInfo;
18 class GR_GeoRender;
19 
20 #include "GR_API.h"
21 #include "GR_Defines.h"
22 #include "GR_PickRecord.h"
23 #include <UT/UT_VectorTypes.h>
24 #include <UT/UT_UniquePtr.h>
25 #include <RE/RE_Types.h>
26 #include <GU/GU_SelectType.h>
27 
29 {
33 };
34 
36 {
37 public:
39  const GR_DisplayOption *opts,
40  const GR_RenderInfo *info,
41  RE_Geometry *geo,
42  GR_GeoRender *gr_geo = NULL);
43  ~GR_PickRender();
44 
45  // Point picks
46  int renderPoints(int connect_start,
47  int connect_num,
48  RE_PrimType real_prim_type,
49  int real_connect_start,
50  int real_connect_num,
51  GR_PickCompMode id_mode,
52  GR_PickStyle style,
53  bool has_pick_map,
54  GR_SelectMode select_mode,
55  int select_inst,
56  RE_Geometry *pick_buffer);
57 
58  // primitive picks
59  int renderFacePrims(int connect_start,
60  int connect_num,
61  GR_PickCompMode id_mode,
62  GR_PickStyle style,
63  bool has_pick_map,
64  bool wireframe,
65  GR_SelectMode select_mode,
66  int select_inst,
67  RE_Geometry *pick_buffer);
68 
69  int renderLinePrims(int connect_start,
70  int connect_num,
71  GR_PickCompMode id_mode,
72  GR_PickStyle style,
73  bool has_pick_map,
74  bool wireframe,
75  GR_SelectMode select_mode,
76  int select_inst,
77  RE_Geometry *pick_buffer);
78 
79  int renderTetPrims(int connect_start,
80  int connect_num,
81  GR_PickCompMode id_mode,
82  GR_PickStyle style,
83  bool has_pick_map,
84  bool wireframe,
85  GR_SelectMode select_mode,
86  int select_inst,
87  RE_Geometry *pick_buffer);
88 
89  int renderFaceDeformingPrims(int connect_start,
90  int connect_num,
91  GR_PickCompMode id_mode,
92  GR_PickStyle style,
93  bool has_pick_map,
94  bool wireframe,
95  GR_SelectMode select_mode,
96  int select_inst,
97  RE_Geometry *pick_buffer);
98 
99  int renderSubDLinePrims(int connect_start,
100  int connect_num,
101  GR_PickCompMode id_mode,
102  GR_PickStyle style,
103  bool has_pick_map,
104  bool wireframe,
105  GR_SelectMode select_mode,
106  int select_inst,
107  RE_Geometry *pick_buffer,
108  UT_Vector2F lod_parms);
109 
110  // edge picks
111  int renderFaceEdges(int connect_start,
112  int connect_num,
113  GR_PickCompMode point_id_mode,
114  bool midpoints,
115  GR_PickStyle style,
116  bool has_pick_map,
117  GR_SelectMode select_mode,
118  int select_inst,
119  RE_Geometry *pick_buffer);
120  int renderMeshEdges(int connect_start,
121  int connect_num,
122  GR_PickCompMode point_id_mode,
123  bool midpoints,
124  GR_PickStyle style,
125  bool has_pick_map,
126  GR_SelectMode select_mode,
127  int select_inst,
128  RE_Geometry *pick_buffer);
129  int renderLineEdges(int connect_start,
130  int connect_num,
131  GR_PickCompMode point_id_mode,
132  bool midpoints,
133  GR_PickStyle style,
134  bool has_pick_map,
135  bool wireframe,
136  GR_SelectMode select_mode,
137  int select_inst,
138  RE_Geometry *pick_buffer);
139 
140  // vertex picks
141  int renderFaceVertices(int connect_start,
142  int connect_num,
143  GR_PickCompMode id_mode,
144  GR_PickStyle style,
145  bool has_pick_map,
146  GR_SelectMode select_mode,
147  int select_inst,
148  RE_Geometry *pick_buffer);
149 
150  int renderLineVertices(int connect_start,
151  int connect_num,
152  GR_PickCompMode id_mode,
153  GR_PickStyle style,
154  bool has_pick_map,
155  GR_SelectMode select_mode,
156  int select_inst,
157  RE_Geometry *pick_buffer);
158  int renderMeshVertices(int connect_start,
159  int connect_num,
160  GR_PickCompMode id_mode,
161  GR_PickStyle style,
162  bool has_pick_map,
163  GR_SelectMode select_mode,
164  int select_inst,
165  RE_Geometry *pick_buffer);
166  // Breakpoints
167  int renderBreakpoints(int connect_start,
168  int connect_num,
169  GR_PickCompMode id_mode,
170  GR_PickStyle style,
171  bool has_pick_map,
172  bool wireframe,
173  GR_SelectMode select_mode,
174  int select_inst,
175  RE_Geometry *pick_buffer);
176 
177  // Guides
178  int renderGuidePoints(int connect_start,
179  int connect_num,
180  GR_PickCompMode prim_id_mode,
181  GR_PickStyle style,
182  GR_SelectMode select_mode,
183  int select_inst);
184  int renderGuideEdges(int connect_start,
185  int connect_num,
186  GR_PickCompMode prim_id_mode,
187  GR_PickStyle style,
188  GR_SelectMode select_mode,
189  int select_inst);
190 
191  // Normals
192  int renderPointNormals(int connect_start,
193  int connect_num,
194  GR_PickCompMode id_mode,
195  GR_PickStyle style,
196  bool has_pick_map,
197  bool normalize);
198  int renderFaceNormals(int connect_start,
199  int connect_num,
200  GR_PickStyle style,
201  bool has_pick_map);
202 
203  // converts raw ivec4 picks into GL-selection buffer picks, and returns
204  // the number of picks.
205  static int filterPicks(UT_Array<GR_PickRecord> &pick_records,
206  const int32 *raw_picks,
207  int num_raw_picks,
208  int vector_size,
209  const UT_Vector3i &base_id);
210 
211 protected:
212  void pickPointsSingle(int connect_start,
213  int connect_num,
214  RE_PrimType real_prim_type,
215  int real_connect_start,
216  int real_connect_num,
217  GR_PickCompMode id_mode,
218  GR_SelectMode select_mode,
219  int select_inst,
220  bool hide_selected);
221  int pickPointsMulti(int connect_start,
222  int connect_num,
223  GR_PickCompMode id_mode,
224  GR_SelectMode select_mode,
225  int select_inst,
226  RE_Geometry *pick_buffer,
227  bool visible_only);
228  int pickPointsUVVert(int connect_start,
229  int connect_num,
230  GR_PickStyle style,
231  GR_PickCompMode id_mode,
232  GR_SelectMode select_mode,
233  int select_inst,
234  RE_Geometry *pick_buffer);
235 
236  void pickFacesSingle(int connect_start,
237  int connect_num,
238  GR_PickCompMode id_mode,
239  bool wireframe,
240  GR_SelectMode select_mode,
241  int select_inst,
242  bool hide_selected,
243  bool deforming_faces);
244  int pickFacesMulti(int connect_start,
245  int connect_num,
246  GR_PickCompMode id_mode,
247  GR_SelectMode select_mode,
248  int select_inst,
249  RE_Geometry *pick_buffer,
250  bool visible_only,
251  bool has_pick_map,
252  bool wireframe,
253  bool deforming_faces,
254  bool pick_outside);
255 
256  int pickFaceEdgesMulti(int connect_start,
257  int connect_num,
258  GR_PickCompMode point_id_mode,
259  GR_SelectMode select_mode,
260  int select_inst,
261  RE_Geometry *pick_buffer,
262  bool visible_only,
263  bool has_pick_map,
264  bool pick_outside);
265 
266  int pickMeshEdgesMulti(int connect_start,
267  int connect_num,
268  GR_PickCompMode point_id_mode,
269  GR_SelectMode select_mode,
270  int select_inst,
271  RE_Geometry *pick_buffer,
272  bool visible_only,
273  bool contained,
274  bool has_pick_map);
275 
276  void pickFaceVerticesSingle(int connect_start,
277  int connect_num,
278  GR_PickCompMode id_mode,
279  GR_SelectMode select_mode,
280  int select_inst,
281  bool hide_selected);
282  int pickFaceVerticesMulti(int connect_start,
283  int connect_num,
284  GR_PickCompMode id_mode,
285  GR_PickStyle style,
286  GR_SelectMode select_mode,
287  int select_inst,
288  RE_Geometry *pick_buffer);
289 
290  void pickTetPrimSingle(int connect_start,
291  int connect_num,
292  GR_PickCompMode id_mode,
293  bool wireframe,
294  GR_SelectMode select_mode,
295  int select_inst,
296  bool hide_selected);
297  int pickTetPrimMulti(int connect_start,
298  int connect_num,
299  GR_PickCompMode id_mode,
300  GR_SelectMode select_mode,
301  int select_inst,
302  RE_Geometry *pick_buffer,
303  bool visible_only,
304  bool has_pick_map,
305  bool wireframe);
306 
307  bool isInstanced(int &num_inst) const;
308  void drawGeo(int connect_start,
309  int connect_end,
310  GR_SelectMode select_mode,
311  int select_inst);
312 
319 };
320 #endif
RE_Render * r
A collection of vertex arrays defining a geometry object. This class acts as a wrapper around multipl...
Definition: RE_Geometry.h:53
const GR_RenderInfo * info
const GR_DisplayOption * opts
3D Vector class.
GR_PickCompMode
Definition: GR_PickRender.h:28
RE_Geometry * geo
#define GR_API
Definition: GR_API.h:10
int int32
Definition: SYS_Types.h:34
GridType::Ptr normalize(const GridType &grid, bool threaded, InterruptT *interrupt)
Normalize the vectors of the given vector-valued grid.
A smart pointer for unique ownership of dynamically allocated objects.
Definition: UT_UniquePtr.h:47
GLboolean r
Definition: glcorearb.h:1221
UT_UniquePtr< RE_OverrideList > myOverrides
RE_PrimType
Definition: RE_Types.h:191
GR_GeoRender * myGeoRender
GR_SelectMode
Definition: GR_Defines.h:215
GR_PickStyle
Definition: GR_Defines.h:226