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 class RV_VKBuffer;
21 
22 #include "GR_API.h"
23 #include "GR_Defines.h"
24 #include "GR_GeoRender.h"
25 #include "GR_PickRecord.h"
26 
27 #include <UT/UT_VectorTypes.h>
28 #include <UT/UT_UniquePtr.h>
29 #include <RE/RE_Types.h>
30 #include <GU/GU_SelectType.h>
31 
32 // --------------------------------------------------------------------------
33 
34 // Buffer used by GR_PickRender to store results of pick render
36 {
37 public:
38  virtual bool setSize(RE_RenderContext r,
39  int buffer_size,
40  int vector_size = 1,
41  bool inconclusive_stream_too = false) = 0;
42 
43  virtual bool getPickData(RE_RenderContext r,
44  int npicks,
45  const UT_Span<int32> &out_data) = 0;
46 
47  virtual int getVectorSize() const = 0;
48  virtual int getLength() const = 0;
49 
50  virtual GR_GeoRender::RenderType getRenderType() const = 0;
51 
52  virtual RE_Geometry* getOGLBuffer() = 0;
53 
54  virtual RV_VKBuffer* getVKBuffer() = 0;
55 
56  GR_PickBuffer() = default;
57 
58  GR_PickBuffer(const GR_PickBuffer&) = delete;
59  GR_PickBuffer(GR_PickBuffer&&) = delete;
60 
61  virtual ~GR_PickBuffer();
62 
63 private:
64  UT_UniquePtr<RE_Geometry> myOGLBuffer;
65 };
66 
67 // --------------------------------------------------------------------------
68 
70 {
71 public:
72  GR_PickRender() = default;
73  virtual ~GR_PickRender() = default;
74 
75  GR_PickRender(const GR_PickRender&) = delete;
76  GR_PickRender& operator=(const GR_PickRender&) = delete;
77 
78  GR_PickRender(GR_PickRender&&) = delete;
80 
81  // Fetch geometry data
82  virtual GR_GeoRender::RenderType getRenderType() const = 0;
83 
84  virtual bool isInstanced(int &num_inst) const = 0;
85 
86  virtual int getNumPoints() const = 0;
87 
88  virtual int getNumRenderPrims(int start_group, int end_group = -1) const = 0;
89 
90  virtual bool hasPointIDAttrib() const = 0;
91 
92  virtual bool hasPrimIDAttrib() const = 0;
93 
94  virtual bool hasVertIDAttrib() const = 0;
95 
96  virtual bool hasInstIDAttrib() const = 0;
97 
98  // Point picks
99  virtual int renderPoints(int connect_start,
100  int connect_num,
101  RE_PrimType real_prim_type,
102  int real_connect_start,
103  int real_connect_num,
104  GR_PickCompMode id_mode,
105  GR_PickStyle style,
106  bool has_pick_map,
107  GR_SelectMode select_mode,
108  int select_inst,
109  GR_PickBuffer *pick_buffer) = 0;
110 
111  // primitive picks
112  virtual int renderFacePrims(int connect_start,
113  int connect_num,
114  GR_PickCompMode id_mode,
115  GR_PickStyle style,
116  bool has_pick_map,
117  bool wireframe,
118  GR_SelectMode select_mode,
119  int select_inst,
120  GR_PickBuffer *pick_buffer) = 0;
121 
122  virtual int renderLinePrims(int connect_start,
123  int connect_num,
124  GR_PickCompMode id_mode,
125  GR_PickStyle style,
126  bool has_pick_map,
127  bool wireframe,
128  GR_SelectMode select_mode,
129  int select_inst,
130  GR_PickBuffer *pick_buffer) = 0;
131 
132  virtual int renderTetPrims(int connect_start,
133  int connect_num,
134  GR_PickCompMode id_mode,
135  GR_PickStyle style,
136  bool has_pick_map,
137  bool wireframe,
138  GR_SelectMode select_mode,
139  int select_inst,
140  GR_PickBuffer *pick_buffer) = 0;
141 
142  virtual int renderFaceDeformingPrims(int connect_start,
143  int connect_num,
144  GR_PickCompMode id_mode,
145  GR_PickStyle style,
146  bool has_pick_map,
147  bool wireframe,
148  GR_SelectMode select_mode,
149  int select_inst,
150  GR_PickBuffer *pick_buffer) = 0;
151 
152  virtual int renderSubDLinePrims(int connect_start,
153  int connect_num,
154  GR_PickCompMode id_mode,
155  GR_PickStyle style,
156  bool has_pick_map,
157  bool wireframe,
158  GR_SelectMode select_mode,
159  int select_inst,
160  GR_PickBuffer *pick_buffer,
161  UT_Vector2F lod_parms) = 0;
162 
163  // edge picks
164  virtual int renderFaceEdges(int connect_start,
165  int connect_num,
166  GR_PickCompMode point_id_mode,
167  bool midpoints,
168  GR_PickStyle style,
169  bool has_pick_map,
170  GR_SelectMode select_mode,
171  int select_inst,
172  GR_PickBuffer *pick_buffer) = 0;
173  virtual int renderMeshEdges(int connect_start,
174  int connect_num,
175  GR_PickCompMode point_id_mode,
176  bool midpoints,
177  GR_PickStyle style,
178  bool has_pick_map,
179  GR_SelectMode select_mode,
180  int select_inst,
181  GR_PickBuffer *pick_buffer) = 0;
182  virtual int renderLineEdges(int connect_start,
183  int connect_num,
184  GR_PickCompMode point_id_mode,
185  bool midpoints,
186  GR_PickStyle style,
187  bool has_pick_map,
188  bool wireframe,
189  GR_SelectMode select_mode,
190  int select_inst,
191  GR_PickBuffer *pick_buffer) = 0;
192 
193  // vertex picks
194  virtual int renderFaceVertices(int connect_start,
195  int connect_num,
196  GR_PickCompMode id_mode,
197  GR_PickStyle style,
198  bool has_pick_map,
199  GR_SelectMode select_mode,
200  int select_inst,
201  GR_PickBuffer *pick_buffer) = 0;
202 
203  virtual int renderLineVertices(int connect_start,
204  int connect_num,
205  GR_PickCompMode id_mode,
206  GR_PickStyle style,
207  bool has_pick_map,
208  GR_SelectMode select_mode,
209  int select_inst,
210  GR_PickBuffer *pick_buffer) = 0;
211  virtual int renderMeshVertices(int connect_start,
212  int connect_num,
213  GR_PickCompMode id_mode,
214  GR_PickStyle style,
215  bool has_pick_map,
216  GR_SelectMode select_mode,
217  int select_inst,
218  GR_PickBuffer *pick_buffer) = 0;
219  // Breakpoints
220  virtual int renderBreakpoints(int connect_start,
221  int connect_num,
222  GR_PickCompMode id_mode,
223  GR_PickStyle style,
224  bool has_pick_map,
225  bool wireframe,
226  GR_SelectMode select_mode,
227  int select_inst,
228  GR_PickBuffer *pick_buffer) = 0;
229 
230  // Guides
231  virtual int renderGuidePoints(int connect_start,
232  int connect_num,
233  GR_PickCompMode prim_id_mode,
234  GR_PickStyle style,
235  GR_SelectMode select_mode,
236  int select_inst) = 0;
237  virtual int renderGuideEdges(int connect_start,
238  int connect_num,
239  GR_PickCompMode prim_id_mode,
240  GR_PickStyle style,
241  GR_SelectMode select_mode,
242  int select_inst) = 0;
243 
244  // Normals
245  virtual int renderPointNormals(int connect_start,
246  int connect_num,
247  GR_PickCompMode id_mode,
248  GR_PickStyle style,
249  bool has_pick_map,
250  bool normalize) = 0;
251  virtual int renderFaceNormals(int connect_start,
252  int connect_num,
253  GR_PickStyle style,
254  bool has_pick_map) = 0;
255 
256  // converts raw ivec4 picks into GL-selection buffer picks, and returns
257  // the number of picks.
258  static int filterPicks(UT_Array<GR_PickRecord> &pick_records,
259  const int32 *raw_picks,
260  int num_raw_picks,
261  int vector_size,
262  const UT_Vector3i &base_id);
263 };
264 
265 // --------------------------------------------------------------------------
266 
268 {
269 public:
270  bool setSize(RE_RenderContext r, int buffer_size,
271  int vector_size = 1,
272  bool inconclusive_stream_too = false) override;
273 
275  int npicks,
276  const UT_Span<int32> &out_data) override;
277 
278  int getVectorSize() const override;
279  int getLength() const override;
280 
281  virtual GR_GeoRender::RenderType getRenderType() const override
282  {
283  return GR_GeoRender::OPENGL;
284  }
285 
286  virtual RE_Geometry* getOGLBuffer() override
287  {
288  return myOGLBuffer.get();
289  };
290 
291  virtual RV_VKBuffer* getVKBuffer() override
292  {
293  return nullptr;
294  };
295 
296  GR_PickBufferGL() = default;
297 
298  GR_PickBufferGL(const GR_PickBufferGL&) = delete;
299  GR_PickBufferGL(GR_PickBufferGL&&) = delete;
300 
301  ~GR_PickBufferGL() override;
302 
303 private:
304  UT_UniquePtr<RE_Geometry> myOGLBuffer;
305 };
306 
307 // --------------------------------------------------------------------------
308 
310 {
311 public:
313  const GR_DisplayOption *opts,
314  const GR_RenderInfo *info,
315  RE_Geometry *geo,
316  GR_GeoRender *gr_geo = NULL);
317  ~GR_PickRenderGL() override;
318 
319  // Fetch geometry data
320  GR_GeoRender::RenderType getRenderType() const override;
321 
322  bool isInstanced(int &num_inst) const override;
323 
324  int getNumPoints() const override;
325 
326  int getNumRenderPrims(int start_group, int end_group = -1) const override;
327 
328  bool hasPointIDAttrib() const override;
329 
330  bool hasPrimIDAttrib() const override;
331 
332  bool hasVertIDAttrib() const override;
333 
334  bool hasInstIDAttrib() const override;
335 
336  // Point picks
337  int renderPoints(int connect_start,
338  int connect_num,
339  RE_PrimType real_prim_type,
340  int real_connect_start,
341  int real_connect_num,
342  GR_PickCompMode id_mode,
343  GR_PickStyle style,
344  bool has_pick_map,
345  GR_SelectMode select_mode,
346  int select_inst,
347  GR_PickBuffer *pick_buffer) override;
348 
349  // primitive picks
350  int renderFacePrims(int connect_start,
351  int connect_num,
352  GR_PickCompMode id_mode,
353  GR_PickStyle style,
354  bool has_pick_map,
355  bool wireframe,
356  GR_SelectMode select_mode,
357  int select_inst,
358  GR_PickBuffer *pick_buffer) override;
359 
360  int renderLinePrims(int connect_start,
361  int connect_num,
362  GR_PickCompMode id_mode,
363  GR_PickStyle style,
364  bool has_pick_map,
365  bool wireframe,
366  GR_SelectMode select_mode,
367  int select_inst,
368  GR_PickBuffer *pick_buffer) override;
369 
370  int renderTetPrims(int connect_start,
371  int connect_num,
372  GR_PickCompMode id_mode,
373  GR_PickStyle style,
374  bool has_pick_map,
375  bool wireframe,
376  GR_SelectMode select_mode,
377  int select_inst,
378  GR_PickBuffer *pick_buffer) override;
379 
380  int renderFaceDeformingPrims(int connect_start,
381  int connect_num,
382  GR_PickCompMode id_mode,
383  GR_PickStyle style,
384  bool has_pick_map,
385  bool wireframe,
386  GR_SelectMode select_mode,
387  int select_inst,
388  GR_PickBuffer *pick_buffer) override;
389 
390  int renderSubDLinePrims(int connect_start,
391  int connect_num,
392  GR_PickCompMode id_mode,
393  GR_PickStyle style,
394  bool has_pick_map,
395  bool wireframe,
396  GR_SelectMode select_mode,
397  int select_inst,
398  GR_PickBuffer *pick_buffer,
399  UT_Vector2F lod_parms) override;
400 
401  // edge picks
402  int renderFaceEdges(int connect_start,
403  int connect_num,
404  GR_PickCompMode point_id_mode,
405  bool midpoints,
406  GR_PickStyle style,
407  bool has_pick_map,
408  GR_SelectMode select_mode,
409  int select_inst,
410  GR_PickBuffer *pick_buffer) override;
411  int renderMeshEdges(int connect_start,
412  int connect_num,
413  GR_PickCompMode point_id_mode,
414  bool midpoints,
415  GR_PickStyle style,
416  bool has_pick_map,
417  GR_SelectMode select_mode,
418  int select_inst,
419  GR_PickBuffer *pick_buffer) override;
420  int renderLineEdges(int connect_start,
421  int connect_num,
422  GR_PickCompMode point_id_mode,
423  bool midpoints,
424  GR_PickStyle style,
425  bool has_pick_map,
426  bool wireframe,
427  GR_SelectMode select_mode,
428  int select_inst,
429  GR_PickBuffer *pick_buffer) override;
430 
431  // vertex picks
432  int renderFaceVertices(int connect_start,
433  int connect_num,
434  GR_PickCompMode id_mode,
435  GR_PickStyle style,
436  bool has_pick_map,
437  GR_SelectMode select_mode,
438  int select_inst,
439  GR_PickBuffer *pick_buffer) override;
440 
441  int renderLineVertices(int connect_start,
442  int connect_num,
443  GR_PickCompMode id_mode,
444  GR_PickStyle style,
445  bool has_pick_map,
446  GR_SelectMode select_mode,
447  int select_inst,
448  GR_PickBuffer *pick_buffer) override;
449  int renderMeshVertices(int connect_start,
450  int connect_num,
451  GR_PickCompMode id_mode,
452  GR_PickStyle style,
453  bool has_pick_map,
454  GR_SelectMode select_mode,
455  int select_inst,
456  GR_PickBuffer *pick_buffer) override;
457  // Breakpoints
458  int renderBreakpoints(int connect_start,
459  int connect_num,
460  GR_PickCompMode id_mode,
461  GR_PickStyle style,
462  bool has_pick_map,
463  bool wireframe,
464  GR_SelectMode select_mode,
465  int select_inst,
466  GR_PickBuffer *pick_buffer) override;
467 
468  // Guides
469  int renderGuidePoints(int connect_start,
470  int connect_num,
471  GR_PickCompMode prim_id_mode,
472  GR_PickStyle style,
473  GR_SelectMode select_mode,
474  int select_inst) override;
475  int renderGuideEdges(int connect_start,
476  int connect_num,
477  GR_PickCompMode prim_id_mode,
478  GR_PickStyle style,
479  GR_SelectMode select_mode,
480  int select_inst) override;
481 
482  // Normals
483  int renderPointNormals(int connect_start,
484  int connect_num,
485  GR_PickCompMode id_mode,
486  GR_PickStyle style,
487  bool has_pick_map,
488  bool normalize) override;
489  int renderFaceNormals(int connect_start,
490  int connect_num,
491  GR_PickStyle style,
492  bool has_pick_map) override;
493 protected:
494  void pickPointsSingle(int connect_start,
495  int connect_num,
496  RE_PrimType real_prim_type,
497  int real_connect_start,
498  int real_connect_num,
499  GR_PickCompMode id_mode,
500  GR_SelectMode select_mode,
501  int select_inst,
502  bool hide_selected);
503  int pickPointsMulti(int connect_start,
504  int connect_num,
505  GR_PickCompMode id_mode,
506  GR_SelectMode select_mode,
507  int select_inst,
508  GR_PickBuffer *pick_buffer,
509  bool visible_only);
510  int pickPointsUVVert(int connect_start,
511  int connect_num,
512  GR_PickStyle style,
513  GR_PickCompMode id_mode,
514  GR_SelectMode select_mode,
515  int select_inst,
516  GR_PickBuffer *pick_buffer);
517 
518  void pickFacesSingle(int connect_start,
519  int connect_num,
520  GR_PickCompMode id_mode,
521  GR_PickStyle style,
522  bool wireframe,
523  GR_SelectMode select_mode,
524  int select_inst,
525  bool hide_selected,
526  bool deforming_faces);
527  int pickFacesMulti(int connect_start,
528  int connect_num,
529  GR_PickCompMode id_mode,
530  GR_SelectMode select_mode,
531  int select_inst,
532  GR_PickBuffer *pick_buffer,
533  bool visible_only,
534  bool has_pick_map,
535  bool wireframe,
536  bool deforming_faces,
537  bool pick_outside);
538 
539  int pickFaceEdgesMulti(int connect_start,
540  int connect_num,
541  GR_PickCompMode point_id_mode,
542  GR_SelectMode select_mode,
543  int select_inst,
544  GR_PickBuffer *pick_buffer,
545  bool visible_only,
546  bool has_pick_map,
547  bool pick_outside);
548 
549  int pickMeshEdgesMulti(int connect_start,
550  int connect_num,
551  GR_PickCompMode point_id_mode,
552  GR_SelectMode select_mode,
553  int select_inst,
554  GR_PickBuffer *pick_buffer,
555  bool visible_only,
556  bool contained,
557  bool has_pick_map);
558 
559  void pickFaceVerticesSingle(int connect_start,
560  int connect_num,
561  GR_PickCompMode id_mode,
562  GR_SelectMode select_mode,
563  int select_inst,
564  bool hide_selected);
565  int pickFaceVerticesMulti(int connect_start,
566  int connect_num,
567  GR_PickCompMode id_mode,
568  GR_PickStyle style,
569  GR_SelectMode select_mode,
570  int select_inst,
571  GR_PickBuffer *pick_buffer);
572 
573  void pickTetPrimSingle(int connect_start,
574  int connect_num,
575  GR_PickCompMode id_mode,
576  bool wireframe,
577  GR_SelectMode select_mode,
578  int select_inst,
579  bool hide_selected);
580  int pickTetPrimMulti(int connect_start,
581  int connect_num,
582  GR_PickCompMode id_mode,
583  GR_SelectMode select_mode,
584  int select_inst,
585  GR_PickBuffer *pick_buffer,
586  bool visible_only,
587  bool has_pick_map,
588  bool wireframe);
589 
590  void drawGeo(int connect_start,
591  int connect_num,
592  GR_SelectMode select_mode,
593  int select_inst);
594 
601 };
602 
603 #ifdef USE_VULKAN
604 
605 class RV_Geometry;
606 class RV_VKBuffer;
607 
608 // --------------------------------------------------------------------------
609 
610 class GR_PickBufferVK : public GR_PickBuffer
611 {
612 public:
613  bool setSize(RE_RenderContext r, int buffer_size,
614  int vector_size = 1,
615  bool inconclusive_stream_too = false) override;
616 
618  int npicks,
619  const UT_Span<int32> &out_data) override;
620 
621  int getVectorSize() const override;
622  int getLength() const override;
623 
624  GR_GeoRender::RenderType getRenderType() const override
625  {
626  return GR_GeoRender::VULKAN;
627  }
628 
629  RE_Geometry* getOGLBuffer() override
630  {
631  return nullptr;
632  }
633 
634  RV_VKBuffer* getVKBuffer() override
635  {
636  return myVkBuffer.get();
637  };
638 
639  void setNumPicks(exint n) { myNumPicks = n; }
640  exint getNumPicks() const { return myNumPicks; }
641 
642  GR_PickBufferVK();
643 
644  GR_PickBufferVK(const GR_PickBuffer&) = delete;
645  GR_PickBufferVK(GR_PickBuffer&&) = delete;
646 
647  ~GR_PickBufferVK() override;
648 
649 private:
650  UT_UniquePtr<RV_VKBuffer> myVkBuffer;
651  exint myEntries = 0;
652  exint myNumPicks = 0;
653 };
654 
655 // --------------------------------------------------------------------------
656 
657 class GR_API GR_PickRenderVK : public GR_PickRender
658 {
659 public:
660  GR_PickRenderVK(RV_Render *r,
661  GR_Uniforms *u,
662  const GR_DisplayOption *opts,
663  const GR_RenderInfo *info,
664  RV_Geometry *geo,
665  GR_GeoRender *gr_geo = NULL);
666  ~GR_PickRenderVK() override;
667 
668  // Fetch geometry data
669  GR_GeoRender::RenderType getRenderType() const override;
670 
671  bool isInstanced(int &num_inst) const override;
672 
673  int getNumPoints() const override;
674 
675  int getNumRenderPrims(int start_group, int end_group = -1) const override;
676 
677  bool hasPointIDAttrib() const override;
678 
679  bool hasPrimIDAttrib() const override;
680 
681  bool hasVertIDAttrib() const override;
682 
683  bool hasInstIDAttrib() const override;
684 
685  // Point picks
686  int renderPoints(int connect_start,
687  int connect_num,
688  RE_PrimType real_prim_type,
689  int real_connect_start,
690  int real_connect_num,
691  GR_PickCompMode id_mode,
692  GR_PickStyle style,
693  bool has_pick_map,
694  GR_SelectMode select_mode,
695  int select_inst,
696  GR_PickBuffer *pick_buffer) override;
697 
698  // primitive picks
699  int renderFacePrims(int connect_start,
700  int connect_num,
701  GR_PickCompMode id_mode,
702  GR_PickStyle style,
703  bool has_pick_map,
704  bool wireframe,
705  GR_SelectMode select_mode,
706  int select_inst,
707  GR_PickBuffer *pick_buffer) override;
708 
709  int renderLinePrims(int connect_start,
710  int connect_num,
711  GR_PickCompMode id_mode,
712  GR_PickStyle style,
713  bool has_pick_map,
714  bool wireframe,
715  GR_SelectMode select_mode,
716  int select_inst,
717  GR_PickBuffer *pick_buffer) override;
718 
719  int renderTetPrims(int connect_start,
720  int connect_num,
721  GR_PickCompMode id_mode,
722  GR_PickStyle style,
723  bool has_pick_map,
724  bool wireframe,
725  GR_SelectMode select_mode,
726  int select_inst,
727  GR_PickBuffer *pick_buffer) override;
728 
729  int renderFaceDeformingPrims(int connect_start,
730  int connect_num,
731  GR_PickCompMode id_mode,
732  GR_PickStyle style,
733  bool has_pick_map,
734  bool wireframe,
735  GR_SelectMode select_mode,
736  int select_inst,
737  GR_PickBuffer *pick_buffer) override;
738  int renderFaceDeformingPrims(int connect_start,
739  int connect_num,
740  int instance_group,
741  GR_PickCompMode id_mode,
742  GR_PickStyle style,
743  bool has_pick_map,
744  bool wireframe,
745  GR_SelectMode select_mode,
746  int select_inst,
747  GR_PickBuffer *pick_buffer);
748 
749  int renderSubDLinePrims(int connect_start,
750  int connect_num,
751  GR_PickCompMode id_mode,
752  GR_PickStyle style,
753  bool has_pick_map,
754  bool wireframe,
755  GR_SelectMode select_mode,
756  int select_inst,
757  GR_PickBuffer *pick_buffer,
758  UT_Vector2F lod_parms) override;
759 
760  // edge picks
761  int renderFaceEdges(int connect_start,
762  int connect_num,
763  GR_PickCompMode point_id_mode,
764  bool midpoints,
765  GR_PickStyle style,
766  bool has_pick_map,
767  GR_SelectMode select_mode,
768  int select_inst,
769  GR_PickBuffer *pick_buffer) override;
770  int renderMeshEdges(int connect_start,
771  int connect_num,
772  GR_PickCompMode point_id_mode,
773  bool midpoints,
774  GR_PickStyle style,
775  bool has_pick_map,
776  GR_SelectMode select_mode,
777  int select_inst,
778  GR_PickBuffer *pick_buffer) override;
779  int renderLineEdges(int connect_start,
780  int connect_num,
781  GR_PickCompMode point_id_mode,
782  bool midpoints,
783  GR_PickStyle style,
784  bool has_pick_map,
785  bool wireframe,
786  GR_SelectMode select_mode,
787  int select_inst,
788  GR_PickBuffer *pick_buffer) override;
789 
790  // vertex picks
791  int renderFaceVertices(int connect_start,
792  int connect_num,
793  GR_PickCompMode id_mode,
794  GR_PickStyle style,
795  bool has_pick_map,
796  GR_SelectMode select_mode,
797  int select_inst,
798  GR_PickBuffer *pick_buffer) override;
799 
800  int renderLineVertices(int connect_start,
801  int connect_num,
802  GR_PickCompMode id_mode,
803  GR_PickStyle style,
804  bool has_pick_map,
805  GR_SelectMode select_mode,
806  int select_inst,
807  GR_PickBuffer *pick_buffer) override;
808  int renderMeshVertices(int connect_start,
809  int connect_num,
810  GR_PickCompMode id_mode,
811  GR_PickStyle style,
812  bool has_pick_map,
813  GR_SelectMode select_mode,
814  int select_inst,
815  GR_PickBuffer *pick_buffer) override;
816  // Breakpoints
817  int renderBreakpoints(int connect_start,
818  int connect_num,
819  GR_PickCompMode id_mode,
820  GR_PickStyle style,
821  bool has_pick_map,
822  bool wireframe,
823  GR_SelectMode select_mode,
824  int select_inst,
825  GR_PickBuffer *pick_buffer) override;
826 
827  // Guides
828  int renderGuidePoints(int connect_start,
829  int connect_num,
830  GR_PickCompMode prim_id_mode,
831  GR_PickStyle style,
832  GR_SelectMode select_mode,
833  int select_inst) override;
834  int renderGuideEdges(int connect_start,
835  int connect_num,
836  GR_PickCompMode prim_id_mode,
837  GR_PickStyle style,
838  GR_SelectMode select_mode,
839  int select_inst) override;
840 
841  // Normals
842  int renderPointNormals(int connect_start,
843  int connect_num,
844  GR_PickCompMode id_mode,
845  GR_PickStyle style,
846  bool has_pick_map,
847  bool normalize) override;
848  int renderFaceNormals(int connect_start,
849  int connect_num,
850  GR_PickStyle style,
851  bool has_pick_map) override;
852 
853 
854  static bool initShaders(RV_Instance* ri);
855  static void cleanupShaders();
856 protected:
857 
858  int pickFacesImpl(int connect_start,
859  int connect_num,
860  int instance_group,
861  GR_PickCompMode id_mode,
862  GR_PickStyle style,
863  bool has_pick_map,
864  bool wireframe,
865  GR_SelectMode select_mode,
866  int select_inst,
867  GR_PickBuffer *pick_buffer,
868  bool is_deforming);
869 
870  // Matches definition in `glH_PickInfo.blk`
871  struct PickInfo
872  {
873  int use_varying_id = 0;
874  int hide_selected = 0;
875  int pick_outside = 0;
876  int checkDepth = 0;
877  int pick_front_face = 0;
878  int pick_back_face = 0;
879  int avoid_edges = 0;
880  float vertex_offset = 0.f;
881  };
882 
883  int drawGeo(int connect_start,
884  int connect_num,
885  int inst_group,
886  GR_SelectMode select_mode,
887  int select_inst,
888  unsigned int pick_mode,
889  const PickInfo& pick_params,
890  GR_PickBuffer *pick_buffer = nullptr);
891 
892 
893 
894  RV_Render *myR;
895  GR_Uniforms *myU;
896  const GR_DisplayOption *myOpts;
897  const GR_RenderInfo *myInfo;
898  RV_Geometry *myGeo;
899  GR_GeoRender *myGeoRender;
900  UT_UniquePtr<RV_OverrideList> myOverrides;
901 
902 };
903 #endif
904 
905 #endif
GR_PickBuffer()=default
int int32
Definition: SYS_Types.h:39
virtual bool setSize(RE_RenderContext r, int buffer_size, int vector_size=1, bool inconclusive_stream_too=false)=0
virtual bool isInstanced(int &num_inst) const =0
virtual RV_VKBuffer * getVKBuffer()=0
virtual int getNumPoints() const =0
virtual int getNumRenderPrims(int start_group, int end_group=-1) const =0
virtual bool hasPrimIDAttrib() const =0
A collection of vertex arrays defining a geometry object. This class acts as a wrapper around multipl...
Definition: RE_Geometry.h:53
int64 exint
Definition: SYS_Types.h:125
Object that represents drawable geometry. This object holds vertex, instancing and index buffers for ...
Definition: RV_Geometry.h:165
GR_PickBufferGL()=default
virtual int getVectorSize() const =0
UT_UniquePtr< RE_OverrideList > myOverrides
Temporary container for either a RV_Render and an RE_Render.
virtual bool getPickData(RE_RenderContext r, int npicks, const UT_Span< int32 > &out_data)=0
bool setSize(RE_RenderContext r, int buffer_size, int vector_size=1, bool inconclusive_stream_too=false) override
virtual int renderLineVertices(int connect_start, int connect_num, GR_PickCompMode id_mode, GR_PickStyle style, bool has_pick_map, GR_SelectMode select_mode, int select_inst, GR_PickBuffer *pick_buffer)=0
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
Definition: UT_UniquePtr.h:39
bool getPickData(RE_RenderContext r, int npicks, const UT_Span< int32 > &out_data) override
virtual int renderFaceDeformingPrims(int connect_start, int connect_num, GR_PickCompMode id_mode, GR_PickStyle style, bool has_pick_map, bool wireframe, GR_SelectMode select_mode, int select_inst, GR_PickBuffer *pick_buffer)=0
int getVectorSize() const override
GLdouble n
Definition: glcorearb.h:2008
virtual GR_GeoRender::RenderType getRenderType() const override
virtual bool hasVertIDAttrib() const =0
virtual int renderLinePrims(int connect_start, int connect_num, GR_PickCompMode id_mode, GR_PickStyle style, bool has_pick_map, bool wireframe, GR_SelectMode select_mode, int select_inst, GR_PickBuffer *pick_buffer)=0
virtual ~GR_PickBuffer()
virtual bool hasPointIDAttrib() const =0
virtual int renderFaceNormals(int connect_start, int connect_num, GR_PickStyle style, bool has_pick_map)=0
#define GR_API
Definition: GR_API.h:10
const GR_DisplayOption * opts
virtual int renderFaceVertices(int connect_start, int connect_num, GR_PickCompMode id_mode, GR_PickStyle style, bool has_pick_map, GR_SelectMode select_mode, int select_inst, GR_PickBuffer *pick_buffer)=0
virtual int renderPoints(int connect_start, int connect_num, RE_PrimType real_prim_type, int real_connect_start, int real_connect_num, GR_PickCompMode id_mode, GR_PickStyle style, bool has_pick_map, GR_SelectMode select_mode, int select_inst, GR_PickBuffer *pick_buffer)=0
virtual int renderGuidePoints(int connect_start, int connect_num, GR_PickCompMode prim_id_mode, GR_PickStyle style, GR_SelectMode select_mode, int select_inst)=0
virtual RE_Geometry * getOGLBuffer() override
virtual RV_VKBuffer * getVKBuffer() override
virtual GR_GeoRender::RenderType getRenderType() const =0
Handle to the main interface of Vulkan.
Definition: RV_Instance.h:38
RE_Render * r
virtual int getLength() const =0
virtual GR_GeoRender::RenderType getRenderType() const =0
GR_GeoRender * myGeoRender
virtual int renderMeshEdges(int connect_start, int connect_num, GR_PickCompMode point_id_mode, bool midpoints, GR_PickStyle style, bool has_pick_map, GR_SelectMode select_mode, int select_inst, GR_PickBuffer *pick_buffer)=0
virtual int renderPointNormals(int connect_start, int connect_num, GR_PickCompMode id_mode, GR_PickStyle style, bool has_pick_map, bool normalize)=0
RE_Geometry * geo
virtual int renderSubDLinePrims(int connect_start, int connect_num, GR_PickCompMode id_mode, GR_PickStyle style, bool has_pick_map, bool wireframe, GR_SelectMode select_mode, int select_inst, GR_PickBuffer *pick_buffer, UT_Vector2F lod_parms)=0
GR_PickCompMode
Definition: GR_PickRecord.h:52
virtual int renderBreakpoints(int connect_start, int connect_num, GR_PickCompMode id_mode, GR_PickStyle style, bool has_pick_map, bool wireframe, GR_SelectMode select_mode, int select_inst, GR_PickBuffer *pick_buffer)=0
virtual int renderMeshVertices(int connect_start, int connect_num, GR_PickCompMode id_mode, GR_PickStyle style, bool has_pick_map, GR_SelectMode select_mode, int select_inst, GR_PickBuffer *pick_buffer)=0
virtual RE_Geometry * getOGLBuffer()=0
LeafData & operator=(const LeafData &)=delete
virtual int renderLineEdges(int connect_start, int connect_num, GR_PickCompMode point_id_mode, bool midpoints, GR_PickStyle style, bool has_pick_map, bool wireframe, GR_SelectMode select_mode, int select_inst, GR_PickBuffer *pick_buffer)=0
~GR_PickBufferGL() override
virtual bool hasInstIDAttrib() const =0
virtual int renderGuideEdges(int connect_start, int connect_num, GR_PickCompMode prim_id_mode, GR_PickStyle style, GR_SelectMode select_mode, int select_inst)=0
virtual int renderTetPrims(int connect_start, int connect_num, GR_PickCompMode id_mode, GR_PickStyle style, bool has_pick_map, bool wireframe, GR_SelectMode select_mode, int select_inst, GR_PickBuffer *pick_buffer)=0
const GR_RenderInfo * info
GLboolean r
Definition: glcorearb.h:1222
A vulkan buffer object.
Definition: RV_VKBuffer.h:81
virtual int renderFaceEdges(int connect_start, int connect_num, GR_PickCompMode point_id_mode, bool midpoints, GR_PickStyle style, bool has_pick_map, GR_SelectMode select_mode, int select_inst, GR_PickBuffer *pick_buffer)=0
RE_PrimType
Definition: RE_Types.h:193
virtual int renderFacePrims(int connect_start, int connect_num, GR_PickCompMode id_mode, GR_PickStyle style, bool has_pick_map, bool wireframe, GR_SelectMode select_mode, int select_inst, GR_PickBuffer *pick_buffer)=0
constexpr T normalize(UT_FixedVector< T, D > &a) noexcept
int getLength() const override
GR_SelectMode
Definition: GR_Defines.h:241
GR_PickStyle
Definition: GR_Defines.h:252