HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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  GR_PickStyle style,
240  bool wireframe,
241  GR_SelectMode select_mode,
242  int select_inst,
243  bool hide_selected,
244  bool deforming_faces);
245  int pickFacesMulti(int connect_start,
246  int connect_num,
247  GR_PickCompMode id_mode,
248  GR_SelectMode select_mode,
249  int select_inst,
250  RE_Geometry *pick_buffer,
251  bool visible_only,
252  bool has_pick_map,
253  bool wireframe,
254  bool deforming_faces,
255  bool pick_outside);
256 
257  int pickFaceEdgesMulti(int connect_start,
258  int connect_num,
259  GR_PickCompMode point_id_mode,
260  GR_SelectMode select_mode,
261  int select_inst,
262  RE_Geometry *pick_buffer,
263  bool visible_only,
264  bool has_pick_map,
265  bool pick_outside);
266 
267  int pickMeshEdgesMulti(int connect_start,
268  int connect_num,
269  GR_PickCompMode point_id_mode,
270  GR_SelectMode select_mode,
271  int select_inst,
272  RE_Geometry *pick_buffer,
273  bool visible_only,
274  bool contained,
275  bool has_pick_map);
276 
277  void pickFaceVerticesSingle(int connect_start,
278  int connect_num,
279  GR_PickCompMode id_mode,
280  GR_SelectMode select_mode,
281  int select_inst,
282  bool hide_selected);
283  int pickFaceVerticesMulti(int connect_start,
284  int connect_num,
285  GR_PickCompMode id_mode,
286  GR_PickStyle style,
287  GR_SelectMode select_mode,
288  int select_inst,
289  RE_Geometry *pick_buffer);
290 
291  void pickTetPrimSingle(int connect_start,
292  int connect_num,
293  GR_PickCompMode id_mode,
294  bool wireframe,
295  GR_SelectMode select_mode,
296  int select_inst,
297  bool hide_selected);
298  int pickTetPrimMulti(int connect_start,
299  int connect_num,
300  GR_PickCompMode id_mode,
301  GR_SelectMode select_mode,
302  int select_inst,
303  RE_Geometry *pick_buffer,
304  bool visible_only,
305  bool has_pick_map,
306  bool wireframe);
307 
308  bool isInstanced(int &num_inst) const;
309  void drawGeo(int connect_start,
310  int connect_end,
311  GR_SelectMode select_mode,
312  int select_inst);
313 
320 };
321 #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:35
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:193
GR_GeoRender * myGeoRender
GR_SelectMode
Definition: GR_Defines.h:217
GR_PickStyle
Definition: GR_Defines.h:228