HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
VISF_Primitive.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: VISF_Primitive.h (VISF Library, C++)
7  *
8  * COMMENTS:
9  * A subclass of GR_Primitive, the class VISF_Primitive is a wrapper
10  * for geometries generated by visualizers. It control the rendering
11  * these geometries according to the activation state of the associated
12  * visualizer.
13  */
14 
15 #ifndef __VISF_Primitive__
16 #define __VISF_Primitive__
17 
18 #include "VISF_API.h"
19 
20 #include <GUI/GUI_GeoRender.h>
21 #include <GR/GR_Defines.h>
22 #include <GR/GR_Primitive.h>
23 #include <VIS/VIS_Handle.h>
24 
26 {
27 public:
28  VISF_Primitive(const GR_RenderInfo *info,
29  const char *cache_name);
30 
31  ~VISF_Primitive() override;
32 
33 
35  { return GR_BASE_PRIM_VISUALIZE; }
36 
37  const char *className() const override { return "VISF_Primitive"; }
38 
39  virtual void updateVisualizer(RE_RenderContext r,
40  const GT_PrimitiveHandle &primh,
41  const GR_UpdateParms &update_parms) = 0;
42 
43  virtual void renderVisualizer(RE_RenderContext r,
44  GR_RenderMode render_mode,
45  GR_RenderFlags render_flags,
46  GR_DrawParms dp) = 0;
47 
48  virtual int renderVisualizerPick(RE_RenderContext r,
49  const GR_DisplayOption *opt,
50  unsigned int pick_type,
51  GR_PickStyle pick_style,
52  bool has_pick_map) = 0;
53 
54  virtual void renderVisualizerDecoration(RE_RenderContext r,
55  GR_Decoration decor,
56  const GR_DecorationParms &parms) = 0;
57 
58  virtual
59  GR_PrimAcceptResult collectPrimitive(GT_PrimitiveType t, int geo_type,
60  const GT_PrimitiveHandle &gt_prim,
61  const GEO_Primitive *geo_prim,
62  const GR_Primitive *gr_prim);
63 
64  void setVisHandle(VIS_Handle vh);
65 
66 
68  { return myObjectSelected; }
69 
71  { return myOpNode; }
72 
74  { return myDetail; }
75 private:
76  // Treat the following virtuals as final and override those above instead!
77  // TODO: Turn all these virtuals "final" when we have the compiler support.
78 
80  GR_RenderMode render_mode,
82  GR_DrawParms dp) override;
83 
85  const GR_DisplayOption *opt,
86  unsigned int pick_type,
87  GR_PickStyle pick_style,
88  bool has_pick_map) override;
89 
91  GR_Decoration decor,
92  const GR_DecorationParms &p) override;
93 
94 
96  int geo_type,
97  const GT_PrimitiveHandle &ph,
98  const GEO_Primitive *prim) override;
99 
101  const GT_PrimitiveHandle &primh,
102  const GR_UpdateParms &update_parms) override;
103 
104  bool shouldRender(const GR_DisplayOption *opt);
105 
106  VIS_Handle myVisHandle;
107  int myVisSerialNum;
108 
109  // parameters cached from the update parms during update; these can
110  // be queried by the visualizer using the provided accessors.
111 
112  bool myObjectSelected;
113  OP_Node *myOpNode;
114  GU_ConstDetailHandle myDetail;
115 };
116 
117 #endif
#define VISF_API
Definition: VISF_API.h:10
GLbitfield flags
Definition: glcorearb.h:1596
virtual void render(RE_RenderContext r, GR_RenderMode render_mode, GR_RenderFlags flags, GR_DrawParms dp)=0
GT_API const UT_StringHolder cache_name
OP_Node * getOpNode()
GR_Decoration
Definition: GR_Defines.h:151
Temporary container for either a RV_Render and an RE_Render.
set of parameters sent to GR_Primitive::update()
virtual int renderPick(RE_RenderContext r, const GR_DisplayOption *opt, unsigned int pick_type, GR_PickStyle pick_style, bool has_pick_map)=0
GR_RenderMode
Definition: GR_Defines.h:47
GR_BasePrimType
Definition: GR_Defines.h:352
GU_ConstDetailHandle getDetail()
virtual void renderDecoration(RE_RenderContext r, GR_Decoration decor, const GR_DecorationParms &parms)
GR_PrimAcceptResult
Definition: GR_Defines.h:345
GR_RenderFlags
Definition: GR_Defines.h:85
GLdouble t
Definition: glad.h:2397
GR_BasePrimType getBasePrimType() const override
The base primitive type is usually NORMAL unless this is a packed type.
GT_PrimitiveType
virtual GR_PrimAcceptResult acceptPrimitive(GT_PrimitiveType t, int geo_type, const GT_PrimitiveHandle &ph, const GEO_Primitive *prim)=0
const char * className() const override
Return a string version of this class's name.
bool isObjectSelected()
virtual void update(RE_RenderContext r, const GT_PrimitiveHandle &primh, const GR_UpdateParms &p)=0
GLboolean r
Definition: glcorearb.h:1222
GR_PickStyle
Definition: GR_Defines.h:240