HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GUI_DetailLook.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: GUI_DetailLook.h ( GUI Library, C++)
7  *
8  * COMMENTS:
9  * A detail look encapsulates all of the data necessary to render a
10  * geometry in a viewport.
11  *
12  * The name is a holdover from when it was derived from UI_Rectangle.
13  */
14 
15 #ifndef __GUI_DetailLook__
16 #define __GUI_DetailLook__
17 
18 #include "GUI_API.h"
19 #include <UT/UT_Assert.h>
20 #include <UT/UT_BoundingBox.h>
21 #include <UT/UT_BoundingSphere.h>
22 #include <UT/UT_Color.h>
23 #include <UT/UT_IntrusivePtr.h>
24 #include <UT/UT_Map.h>
25 #include <UT/UT_Matrix4.h>
26 #include <UT/UT_PerfMonAutoEvent.h>
27 #include <UT/UT_PerfMonTypes.h>
28 #include <UT/UT_String.h>
29 #include <UT/UT_StringHolder.h>
30 #include <UT/UT_UniquePtr.h>
31 #include <UI/UI_Value.h>
32 #include <GEO/GEO_PackedTypes.h>
33 #include <GU/GU_Detail.h>
34 #include <GU/GU_DetailHandle.h>
35 #include <OP/OP_Network.h>
36 #include <RE/RE_RenderContext.h>
37 #include <GR/GR_DisplayOption.h>
38 #include <GR/GR_Light.h>
39 #include <BM/BM_State.h>
40 #include "GUI_DisplayOption.h"
41 #include "GUI_RenderCommon.h"
42 #include "GUI_VisInterface.h"
43 #include "GUI_GroupData.h"
45 
46 #include <utility>
47 
48 class RE_Render;
49 class RE_Light;
50 class RE_Material;
51 class RE_Geometry;
52 class PXL_Raster;
53 class SIM_Data;
54 class SIM_RootData;
55 class GUI_GeoRender;
56 class GU_Detail;
58 class gui_Instance;
59 class gui_GeoInstanceInfo;
61 
63 
65 {
66 public:
67  // This determines if the detail passed to setDetailHandle() is refenced or
68  // copied to a new detail within this look.
70  {
72  REFERENCE_DETAIL
73  };
74 
76  const char *detail_name = NULL,
77  SetDetailMode mode = REFERENCE_DETAIL);
78 
79  void incref()
80  {
81  myRefCount.add(1);
82  }
83  void decref()
84  {
85  myRefCount.add(-1);
86  UT_ASSERT(myRefCount.relaxedLoad() >= 0);
87  if (myRefCount.relaxedLoad() == 0)
88  delete this;
89  }
90 
91  virtual const char *className() const;
92 
93  virtual bool isDopGuide() const { return false; }
94  virtual bool needsOverlayRender() { return false; }
95 
96  const char *getName() const { return myDetailName; }
97  void setName(const char *name);
98 
99  void setInitialized() { myInitializedFlag = true; }
100  bool isInitialized() const { return myInitializedFlag; }
101 
102  // Find out which node our gdp represents, if any:
103  OP_Node *getObject() const; // inline, below
104  OP_Node *getSop() const; // inline, below
105  OP_Node *getShopsRelativeTo() const; // inline, below
106  int getVisualizedNodeId() const; // inline, below
107 
108  // Set to new object/sop pair. returns true if the object or sop was
109  // actually changed.
110  bool setObject(OP_Node *node);
111  bool setSop(OP_Node *node);
112 
113  // New Viewport codepaths
114 
115  // setupForRender() can be called in parallel. setup() methods are expected
116  // to do non-GL work, such as convexing, surfacing, point normal computation
117  virtual GUI_SetupResult setupForRender(
118  const GUI_DisplayOption &opts,
119  bool show_selections,
120  GR_DecorationOverride selmask_dec,
121  GR_DecorationOverride &sel_dec);
122 
124  {
126  for(auto r : mySetupResults)
127  result = GUI_SetupResult(result | r);
128  return result;
129  }
130 
131 
132  // This is a stripped down version of setupForRender() when the viewer is
133  // showing more than 1 viewport. The first viewport rendered does a full
134  // setupForRender(), and subsequent viewports do fastSetupForRender(), since
135  // many things do not change.
136  bool fastSetupForRender(GUI_DisplayOption &opts);
137 
138  // updateForRender() is called in serial. It does all the GL updating based
139  // on the precomputed results in setup().
140  void updateForRender(
142  GUI_DisplayOption &opts,
143  GR_LightList *lights,
144  GR_DecorationOverride selmask_dec,
145  const char *view_name,
146  const GR_FrustumList &view_frustums,
147  bool &needs_alpha,
148  bool normal_update,
149  GR_UpdateReason additional_reasons);
150 
151  void updateForRenderInit(
153  GUI_DisplayOption &opts,
154  GR_LightList *lights,
155  GR_DecorationOverride selmask_dec,
156  const char *view_name,
157  const GR_FrustumList &view_frustums,
158  bool &needs_alpha,
159  bool normal_update,
160  GR_UpdateReason additional_reasons);
161 
162 
163  // updatePrimitivesForRender() is called in parallel for VK, serial
164  // for GL. It does updates the GR_Primitive objects based on the
165  // results of precomputed results in setup().
166  void updateForRenderParallel(
168  GUI_DisplayOption &opts,
169  GR_LightList *lights,
170  GR_DecorationOverride selmask_dec,
171  const char *view_name,
172  const GR_FrustumList &view_frustums,
173  bool &needs_alpha,
174  bool normal_update,
175  GR_UpdateReason additional_reasons);
176 
177  virtual void cleanupAfterRender(RE_RenderContext r);
178 
179  // An update is still pending on this look's geoemtry.
180  void updatePending(bool up) { myUpdatePending = up; }
181  bool isUpdatePending() const { return myUpdatePending; }
182 
183  // The serial part of update is finished, threaded update is still pending
184  void threadedUpdatePending(bool up) { myThreadedUpdatePending = up; }
185  bool isThreadedUpdatePending() const { return myThreadedUpdatePending; }
186 
187  // Materials still need updating on this look (textures).
189  { myMatUpdatePending = up; }
191  { return myMatUpdatePending; }
192 
193  // called when this look is no longer displayed, but kept around for a short
194  // time in case it might be displayed in the future
195  void retire();
196  bool isRetired() const { return myRetiredFlag; };
197  void reactivateRetired();
198 
199  // called when temporarily hidden, such as as display flag off.
200  void hide();
201 
202  // appends the contained geometry objects to 'geos'.
203  void getGeometryRenders(
206  int geo_index = -1);
207  void setSingleGeometryRender(OP_Node *node);
208  void resetGeometryRender();
209 
210  // Set selection data to be displayed with this geometry.
211  const UT_Array<GUI_GroupDataHandle> &getSelectData(int geo_index) const;
212  void addSelectData(GUI_GroupDataHandle select_data,
213  int geo_index);
214  void clearSelectData();
215  bool hasSelectData() const;
216 
217  // This method determines whether this detail look should be rendered
218  // for picking. It only checks if it is potentially pickable, but does
219  // not check if it currently being drawn. This only refers to the component
220  // level picking present in SOPs. For object picking, check the isPickable()
221  // flag on the getObject() node.
222  virtual bool isPickable() const;
223 
224  // Allows for custom pick priorities. 0 is normal, <0 low, >0 higher.
225  virtual bool hasPickPriority() const { return false; }
226  virtual bool getPickPriority(const GR_PickRecord &pick,
227  int & /*priority*/) const { return false; }
228 
229  // This method checks if this detail look is even rendered given the
230  // specified display options.
231  virtual bool isVisible(const GUI_DisplayOption &dopt) const;
232 
233  // Returns true if any of the contained details are lit.
234  bool areAnyLit() const
235  { return drawLit() && !isWireframeOnly(); }
236 
237  // returns true if any of the contained details are unlit.
238  bool areAnyUnlit() const { return myHasUnlitGeometry; }
239 
240  // returns true if any of the contained details have transparency.
241  bool hasTransparency() const;
242 
243  // returns true if any of the materials are reflective.
244  bool hasReflectiveMaterial() const;
245 
246  // returns a bitfield of decorations supported by all the GR_Primitives in
247  // this look.
248  int64 getPrimDecorMask() const { return myDecorMask; }
249 
250  // This look will not free the detail, it is up to the user
251  int setDetailHandle(GU_DetailHandle handle);
252  virtual int getNumDetailHandles() const; // inlined below
253  virtual GU_DetailHandle getDetailHandle(int i) const;
254  virtual UT_Matrix4D getDetailXform(int i) const;
255  virtual void appendDOPDataName(UT_String &str, int i,
256  bool descriptive) const;
257  virtual const SIM_Data *getDOPData(int i) const;
258  virtual const SIM_RootData *getDOPRootData(int i) const;
259  virtual bool getIsDetailTempSelected(int i) const;
260  // Get world space position
261  virtual UT_Vector4F getDetailPosition(int i) const;
262  virtual void getDetailName(UT_String &name, int i) const;
263  virtual void getDetailPath(UT_String &path, int i) const;
264  virtual void getDetailDescriptiveName(UT_String &name,
265  int i) const;
266  virtual void getDetailDescriptivePath(UT_String &path,
267  int i) const;
268  void signalNodeSelectionChanged(int i) const;
269 
270  virtual void setTempComponentSelection(
272  virtual GU_SelectionHandle getTempComponentSelection(int i) const;
273 
274  virtual void releaseAllTempComponentSelections();
275 
276  void setEnableDOPDisplay(bool enable)
277  { myEnableDOPDisplay = enable; }
278  bool getEnableDOPDisplay() const
279  { return myEnableDOPDisplay; }
280  void setIsChosenDopnet(bool ischosen)
281  { myIsChosenDopnet = ischosen; }
282  bool getIsChosenDopnet() const
283  { return myIsChosenDopnet; }
284 
285  bool hasUserSelection() const;
286 
287  void useNewLightInterface(bool i)
288  { myUseNewLightInterface=i;}
289  bool useNewLightInterface() const
290  { return myUseNewLightInterface; }
291  void addObjLight(int obj_light_id);
292  bool hasObjLight(int obj_light_id) const;
293  void removeObjLight(int obj_light_id);
294  void clearObjLights();
295  const UT_Set<int> & activeObjLights() const { return myActiveLights; }
296 
297  // v Old light interface
298  void setLightArray(RE_Light *lights[], int nLights = 0);
299 
300  void setGlobalLightArray(const UT_ValArray<RE_Light *> &lts,
301  bool headlight);
302  void removeLight(RE_Light *light);
303  void enableAllLights();
304 
305  int getNumLights() const { return myLights.entries(); }
306  RE_Light *getLight(int i) const { return myLights(i); }
307  const UT_ValArray<RE_Light *> &getLights() const { return myLights; }
309  { return myEnabledLights; }
310  // ^ end old light interface
311 
312  static RE_Light *getGlobalHeadlight(bool for_solaris=false);
313  static RE_Light *getGlobalDomelight();
314 
315  void setUseWireColor(int c);
316  void setWireColor(const UT_Color &clr);
317  void setOutlineColor(const UT_Vector4F &clr);
318 
319  // The id passed in here may be either a node id or a "guide" id set by
320  // the OP3D_GuideList on each piece of guide geometry.
321  virtual UT_Color getWireColor(int id) const
322  { return myWireColor; }
323 
325  { return myOutlineColor; }
326 
327  // Object Emission color (for Vulkan lights only)
329  { myEmitColor = color; }
330  UT_Vector4F getEmitColor() const { return myEmitColor; }
331 
332  // Methods to manage the view matrix, the user may use any of the
333  // UT_Matrix4 methods to transform the matrix.
334  void setXform(const UT_Matrix4D &mat)
335  { myXform = mat; myXformDirty = true; }
337  { return isObjSolo() ? (myXform*mySoloXform) :myXform; }
339  { myPivot = pivot; }
340 
341  void setAllowShadingOpenCurves(bool val);
342  bool shadeOpenCurves() const
343  { return myFlag.shade_open_curves; }
344 
345  void setDisplayAsSubdiv(bool val);
346 
347  // Methods to handle the look of the detail drawn.
348  void copyFlagsFrom(const GUI_DetailLookPtr &look);
349 
350  virtual void setDetailDisplay(bool display)
351  {
352  if(!myFlag.overrideDisplay)
353  {
354  if(myFlag.display != display)
355  myDisplaySetDirty= true;
356  myFlag.display = display;
357  }
358  }
359 
360  void setGeometry(bool enable) { myFlag.isGeometry = enable; }
361  void setShowAxes(bool show_axes) { myFlag.showAxes = show_axes; }
362  void setPicking(bool picking)
363  { myFlag.shouldPick = picking; }
364 
365  void setRender(bool render) { myFlag.render = render; }
366  void setTemplate(bool templated)
367  {
368  if(myFlag.templated!=templated)
369  myDisplaySetDirty=true;
370  myFlag.templated = templated;
371  }
372  void setFootprint(bool footprint)
373  { if(myFlag.footprinted!=footprint)
374  myDisplaySetDirty=true;
375  myFlag.footprinted = footprint; }
376  void setHighlight(bool highlight)
377  { myDisplaySetDirty |= (myFlag.highlighted != highlight);
378  myFlag.highlighted = highlight; }
379  void setXray(bool xray)
380  { myFlag.xray = xray; }
381  void setTargetOutput(bool target_output)
382  { if(myFlag.targetoutput !=target_output)
383  myDisplaySetDirty=true;
384  myFlag.targetoutput = target_output; }
385  void setCurrentOutput(bool current_output);
386  void setDrawLit(int onoff); // it's a bit more complicated now
387  void setDrawCookComponentSelection(bool enable);
388  void setSnappable(int onoff) { myFlag.snappable = onoff; }
389  void setSecondarySelection(int onoff);
390  void setObjSelection(bool obj_sel);
391  void setObjCurrent(bool obj_current);
392  void setObjSelectionHint(bool obj_sel_hint);
393  virtual void setObjGhost(bool obj_ghost, OP_Node *for_node);
394  void setObjHidden(bool hide) { myFlag.objHide = hide; }
395  bool setObjSolo(bool solo, const UT_Matrix4D *solo_transform=nullptr);
396  void setObjOutput(bool output) { myFlag.objOutput = output; }
397  void setOutputIndex(int index) { myOutputIndex = index; }
398  void setObjTypeMask(unsigned mask) { myObjTypeMask = mask; }
399  void setWireframeOnly(bool wireframe_only)
400  { myFlag.wireframeOnly = wireframe_only; }
401  void setOutline(bool outline)
402  { myFlag.outline = outline; }
404  { myFlag.separateOutline = b; }
405  void setBeautyRender(bool b)
406  { myFlag.beautyRender = b; }
407  void setActiveModel(bool active_model)
408  {
409  if(myFlag.active_model != active_model)
410  {
411  myDisplaySetDirty = true;
412  myFlag.active_model = active_model;
413  }
414  }
415  // Is a DM_Drawable look
416  void setIsDrawableLook(bool dr) { myDrawableFlag = dr; }
417  bool isDrawableLook() const { return myDrawableFlag; }
418 
419  void setIsControlLook(bool c) { myFlag.isControlLook = c; }
420  bool isControlLook() const { return myFlag.isControlLook; }
421 
422  static void setUVObject(OP_Node *object);
423  bool isUVObject() const;
424 
425  void setOnionSkinning(int onion_skin_state);
426  bool isOnionSkinning() const { return myFlag.onion_skin; }
427  bool isOnionSkinDeformation() const { return myFlag.onion_skin_deform;}
428 
429  void onionSkinRender(RE_RenderContext r, GUI_DisplayOption &disp_opt,
430  int nsamples);
431 
432 
433  // Frustum culling is enabled by default.
434  void useFrustumCulling(bool frust_cull)
435  { myFlag.use_frustum_culling = frust_cull; }
436  bool usesFrustumCulling() const
437  { return myFlag.use_frustum_culling && !myFlag.onion_skin
438  && !myLastPointInstanceState &&
439  getUsesGeoRenderInstancing(); }
440 
441  virtual void applyBundleToDisplayedObjects( OP_Bundle *bdl, int object_vis_change_count);
442 
443  // The following methods allow the user to set the display flag while
444  // caching the old value, and resetting it back later.
445  virtual void setDisplaySavingPrevValue(int onoff)
446  {
447  myFlag.prevDisplay = myFlag.display;
448  myFlag.display = onoff;
449  myFlag.overrideDisplay = true;
450  }
451 
453  {
454  myFlag.display = myFlag.prevDisplay;
455  myFlag.overrideDisplay = false;
456  }
457 
458  // this is not the underlying node's display flag state.
459  bool isDetailDisplayOn() const; // inlined below
460  // just the display state alone; use the above for almost everything.
461  bool getDetailDisplay() const { return myFlag.display; }
462 
463  bool getShowAxes() const { return myFlag.showAxes; }
464  bool isGeometry() const { return myFlag.isGeometry; }
465  bool isSymbolicGeometry() const { return myFlag.isSymGeo; }
466  bool isPickingOn() const { return myFlag.shouldPick; }
467  bool isRenderOn() const { return myFlag.render; }
468  bool isTemplated() const { return myFlag.templated; }
469  bool isFootprinted() const { return myFlag.footprinted; }
470  bool isHighlighted() const { return myFlag.highlighted; }
471  virtual bool isXray() const { return myFlag.xray || myFlag.geoxray || myIsXRay; }
472  bool isTargetOutput() const { return myFlag.targetoutput; }
473  bool isCurrentOutput() const { return myFlag.currentoutput; }
474  virtual bool isGuide() const { return false; }
475  virtual bool useWireColor(int node_id) const { return myFlag.usewireclr; }
476  bool drawLit() const { return myFlag.drawLit; }
477  bool displayAsSubdiv() { return myFlag.displayAsSubdiv; }
479  { return myFlag.drawCookComponentSelection; }
480  bool isSnappable() const { return myFlag.snappable; }
481  bool isSecondarySelection() const { return myFlag.secondarySelection; }
482  bool isObjSelection() const { return myFlag.objSelection; }
483  bool isObjCurrent() const { return myFlag.objCurrent; }
484  bool isObjSelectionHint() const { return myFlag.objSelectionHint; }
485  bool isObjGhost() const { return myFlag.objGhost; }
486  bool isObjHidden() const { return myFlag.objHide; }
487  bool isObjSolo() const { return myFlag.objSolo; }
488  bool isObjOutput() const { return myFlag.objOutput; }
489  int getOutputIndex() { return myOutputIndex; }
490  unsigned getObjTypeMask() const { return myObjTypeMask; }
491  bool isWireframeOnly() const { return myFlag.wireframeOnly; }
492  bool isOutline() const { return myFlag.outline; }
493  bool isSeparateOutline() const { return myFlag.separateOutline; }
494  bool isBeautyRender() const { return myFlag.beautyRender; }
495  bool isActiveModel() const { return myFlag.active_model; }
496  bool isPointInstanced() const { return myHasPointInstancing; }
497  bool hasInstanceFile() const { return myHasInstanceFile; }
499  { return myInstanceUseTransform; }
500  OBJ_Node *getInstanceObject() const;
501 
502  bool needsAlphaPass() const
503  { return myFlag.needsAlphaPass; }
504  void setNeedsAlphaPass(bool e)
505  { myFlag.needsAlphaPass = e; }
506 
507  // Flag as a deleted look, so that it can be deleted rather than cached.
508  void setIsDeleted() { myFlag.being_deleted = true; }
509  bool isDeleted() { return myFlag.being_deleted; }
510 
511  // Weak flag that affects only GUI_DetailLook::isVisible()
512  bool forceHidden() const { return myFlag.forceHidden; }
513  void setForceHidden(bool on)
514  {
515  if(myFlag.forceHidden != on)
516  {
517  myDisplaySetDirty= true;
518  myFlag.forceHidden = on;
519  }
520  }
521 
522  // If true, this flag forces GUI_DetailLook to be a UVObject.
523  bool forceAsUVObject() const
524  {
525  return myFlag.forceAsUVObject;
526  }
527  void setForceAsUVObject(bool on)
528  {
529  myFlag.forceAsUVObject = on;
530  }
531 
532  bool castShadows() const { return myFlag.castShadows; }
533  void setCastShadows(bool on)
534  {
535  if(myFlag.castShadows != on)
536  {
537  myDisplaySetDirty= true;
538  myFlag.castShadows = on;
539  }
540  }
541 
542  // Set information about which geometry groups to color.
543  const UT_StringHolder &showGroupMask() const;
544  void setShowGroupMask(const UT_StringHolder &mask);
545  GA_GroupType showGroupType() const;
546  void setShowGroupType(GA_GroupType group_type);
547  int showGroupColorVersion() const;
548  void setShowGroupColorVersion(int version);
549 
550  int getBoundingBox2D(UT_BoundingBox &bbox,
551  const char *name,
552  int use_vertex) const;
553  int getBoundingBox3D(UT_BoundingBox &bbox,
554  const UT_Matrix3R *rot) const;
555 
556  void updateBBox();
557  void invalidateBBox();
558  const UT_BoundingBox &worldBBox();
559 
560  // Viewport type mask (PERSP, TOP, UV, etc)
561  void setViewportMask(unsigned mask)
562  { myViewportMask = mask; }
563  unsigned int getViewportMask() const
564  { return myViewportMask; }
565 
566  // Per-Viewport display. ID is the viewport's unique ID.
567  bool shownInViewport(int viewport_id) const;
568  void showInViewport(int viewport_id);
569  void showInAllViewports();
570 
572  int serial, int serial2, int id)
573  {
574  disp.common().setViewSerialNum(serial, serial2, id);
575  }
576 
577  // return the display set that this object belongs to.
579  {
580  if(!myDisplaySetDirty)
581  return myDisplaySet;
582  return privGetDisplaySetType();
583  }
584 
586  { return privGetDisplaySetType(); }
587 
588 
589  void renderObjectName(RE_RenderContext r,
590  GUI_DisplayOption *dispopt);
591  virtual void renderOrQueueObjectAxes(UT_Vector3FArray &axes,
592  UT_Vector3FArray &pivots);
593  static void renderQueuedObjectAxes(RE_RenderContext r,
594  GUI_DisplayOption *dispopt,
595  const UT_Vector3FArray &axes,
596  const UT_Vector3FArray &pivots);
597 
598  // The global chosen dopnet is set to filter out the drawing of geometry
599  // flagged as originating from this dopnet.
600  static void setGlobalChosenDopnet(OP_Node *dopnet)
601  {
602  if( dopnet )
603  {
605  dopnet->getFullPath(path);
606  ourChosenDopnetPath = path;
607  }
608  else
609  {
610  ourChosenDopnetPath.clear();
611  }
612  }
613  static const char *getGlobalChosenDopnetPath()
614  {
615  return ourChosenDopnetPath.c_str();
616  }
617 
618  static bool matchesChosenDopnetPath(const char *path)
619  {
620  auto len = ourChosenDopnetPath.length();
621  return len
622  && !strncmp(ourChosenDopnetPath, path, len)
623  && (path[len] == ':' || path[len] == '\0');
624  }
625 
626  // Used to assign a temporary ID to the look.
627  void setLookID(int id) { myID = id; }
628  int getLookID() const { return myID; }
629 
630  // Get/Set the object's viewport LOD
631  GEO_ViewportLOD getObjectLOD() const { return myObjectLOD; }
633  { myObjectLOD = lod; }
634 
635  void useObjectMaterials(bool use_obj_mat);
636  bool getAssignedMaterials(UT_Array<OP_Node *> &nodes) const;
637 
638  void setShowMaterials(bool show)
639  { myFlag.showMaterials = show; }
640  bool showMaterials() const
641  { return myFlag.showMaterials; }
642 
643  // Override the default material for this look (otherwise the material is
644  // taken from GUI_MaterialManager::getFactoryMaterial()).
646  { myFactoryMaterialGL = material; }
648  { myFactoryMaterial = material; }
649  RE_MaterialPtr getFactoryMaterialGL(bool lit, bool draw_uv);
651  { return myFactoryMaterialGL || myFactoryMaterial; }
653  { return myFactoryMaterialGL; }
655  { return myFactoryMaterial; }
656 
657  GR_MaterialPtr getFactoryMaterial(bool lit, bool draw_uv);
658  virtual bool isTimeDependent(fpreal t);
659  bool areInstancesTimeDependent(fpreal t);
660  virtual int64 getVersion();
661  void bumpVersion() { myLookVersion++; }
662 
663  /// @{
664  /// Flag the look as time-dependent, even if its source node is not (e.g.
665  /// APEX character scenes). This is reset on each update.
666  bool forceTimeDependent() const { return myFlag.forceTimeDep; }
667  void setForceTimeDependent(bool v) { myFlag.forceTimeDep = v; }
668  /// @}
669 
670  // The name of the actively rendering or updating viewport
671  static void setActiveViewport(const char *name, int id);
672  // viewname (persp1)
673  static const char *getActiveViewport();
674  // viepwort unique id
675  static int getActiveViewportId();
676  // viewname/Material setup
677  static const char *getActiveViewportMatString();
678 
679 
680  static void visibleViewportTypes(bool view_3d, bool view_2d);
681  static bool hasVisible3D();
682  static bool hasVisibleUV();
683 
684  static void visibleUVAttribs(UT_StringArray &attribs);
685  static const UT_StringArray &visibleUVAttribs();
686  static int64 visibleUVAttribSerial();
687 
688  enum { VIEW_3D = 0x1, VIEW_2D = 0x2 }; // for the masks
689  static void visibleViewportBoundaries(
690  bool bound_3d,
691  UT_StringArray &bound_3d_uvs,
692  UT_Array<std::pair<UT_StringHolder,int> > &uvs);
693  static bool hasVisibleBoundaries();
694  static bool visible3DBoundary();
695  static const UT_StringArray &visible3DBoundariesInUV();
696  // uv name, view mask
698  &visibleUVBoundaries();
699 
701  { return myActiveVisualizers; }
703  { return myActiveVisualizers.entries(); }
704  void appendActiveVisualizer(int vis_id)
705  { myActiveVisualizers.append(vis_id);
706  myCollectVisPrimitives.append(0); }
708  {
709  myActiveVisualizers.clear();
710  myCollectVisPrimitives.clear();
711  }
713  { return myCollectVisPrimitives(i); }
715  { myCollectVisPrimitives(i) = prim; }
716 
717  void requireErrorCheck() { myFlag.errorsChecked = false; }
718  void checkForErrors();
719  int64 getNodeErrorID() const { return myOpErrorPosted; }
720 
721  void setRedrawValue(UI_Value *redraw)
722  { myRedrawValue = redraw; }
724  { if(myRedrawValue) myRedrawValue->changed(NULL); }
725 
727  {
728  myFlag.visualizerCheck = true;
729  myFlag.needVisualizerSetup = false;
730  }
731  void needVisualizerSetup(bool setup)
732  {
733  myFlag.visualizerCheck = false;
734  myFlag.needVisualizerSetup = setup;
735  }
736  bool runVisualizerSetup() const
737  {
738  return (myFlag.needVisualizerSetup ||
739  myFlag.visualizerCheck);
740  }
741 
743  { return nullptr; }
745  { return myContextMicroNode.get(); }
747  { myContextMicroNode = std::move(micronode); }
748 
749  void gpuMemoryUsage(exint &used_bytes,
750  exint &ununsed_bytes,
751  exint &pinned_bytes);
752 
753  // Wrapper class to avoid sprintf's when not recording
755  {
756  public:
758  {
759  // Early exit if we're not recording
761  bool record_viewport = perf->isRecordingViewportStats();
762  bool record_memory = perf->isRecordingMemoryStats();
763  if (!record_viewport && !record_memory)
764  return;
765 
766  const char *
768  const char *
769  look_name = look.getName();
770 
771  if (record_viewport)
772  {
773  setTimedEventId_(
775  viewport_name, look_name, UT_PERFMON_3D_VIEWPORT));
776  }
777 
778  if (record_memory)
779  {
780  setMemoryEventId_(
782  viewport_name, look_name, UT_PERFMON_3D_VIEWPORT));
783  }
784  }
785  };
786 
787 protected:
788  ~GUI_DetailLook() override;
789 
790  void cacheNodePtrs();
791 
792  // Multi-object instancing
793  void initInstanceTable();
794  GUI_GeoRender *addInstance(GU_ConstDetailHandle cgdh,
795  const char *name,
796  const UT_Matrix4D &xform,
797  int64 version,
798  int instance_index,
799  int object_id,
800  int inst_object_id,
801  bool is_guide,
802  bool time_dep);
803  void finalizeInstanceTable();
804 
805  using gui_CachedInstGeo = std::pair<GUI_GeoRender *, bool>;
806 
807  bool createObjectInstance(const char *instance_path,
808  int64 base_version,
809  fpreal t,
810  gui_Instance &instance,
811  OBJ_Node *instancer,
813  bool rel_to_sop);
814  void markGeoForRemoval(GUI_GeoRender *gr);
815  void removeDeletedGeos();
816  int64 computeInstanceVersion(const GU_Detail *dtl);
817 
818  // Indicates whether instancing should be implemented using the
819  // GUI_GeoRender instancing capabilities. If false, GUI_GeoRenderShared
820  // objects are used to instance the geometry without true OGL instancing.
821  virtual bool getUsesGeoRenderInstancing() const
822  { return true; }
823 
824  // End multi-object instancing
825  GUI_SetupResult setupAllGeos(const GUI_DisplayOption &disp_opt,
826  bool show_selections,
827  GR_DecorationOverride selmask_dec,
828  GR_DecorationOverride &sel_dec);
829 
830  virtual GUI_GeoRender *getOrCreateGeometryRender(int index);
831 
832  void setXRayOverride(bool xray) { myIsXRay = xray; }
833 
838 
841 
842 private:
843 
844  void generateObjectName(RE_RenderContext r,
845  GUI_DisplayOption *dispopt,
846  UT_String name,
847  int geo_index,
848  GR_DecorFontSize fontsize,
849  RE_Geometry &geo);
850  bool setupPointInstancing(bool show_selections,
851  GR_DecorationOverride selmask_dec,
852  GR_DecorationOverride &select_dec,
853  fpreal instance_fract,
854  int limit);
855  GUI_DisplaySetType privGetDisplaySetType() const;
856 
857  void updateInstancingStatus();
858  GUI_GeoRender * createGeoRender(int index,const char *opt_suffix=NULL);
859  void checkGeoRenders();
860 
861  GUI_GeoRender *checkForDetailCaching(GUI_GeoRender *geo);
862  void freeCachedDetails();
863  void freeDeletedCachedDetails();
864 
865  int getNumOnionSkins() const;
866  const GU_DetailHandle &getOnionSkinDetail(int index) const;
867  GUI_SetupResult processSkins(const GUI_DisplayOption &dopt);
868  void addOnionSkin(OBJ_Node *obj, SOP_Node *sop,
869  fpreal skin_t, fpreal geo_t,
870  bool deforming,
871  bool is_pre_frame);
872  void clearOnionSkins();
873 
874  class GUI_DetailLookFlags
875  {
876  public:
877  GUI_DetailLookFlags()
878  {
879  showAxes = false;
880  render = true;
881  isGeometry = true;
882  isSymGeo = false;
883  shouldPick = true;
884  display = true;
885  templated = false;
886  footprinted = false;
887  highlighted = false;
888  xray = false;
889  geoxray = false;
890  targetoutput = false;
891  currentoutput = false;
892  usewireclr = false;
893  drawLit = true;
894  drawCookComponentSelection = true;
895  needsAlphaPass = false;
896  snappable = true;
897  secondarySelection = false;
898  objSelection = false;
899  objCurrent = false;
900  objSelectionHint = false;
901  objGhost = false;
902  wireframeOnly = false;
903  outline = false;
904  separateOutline = false;
905  beautyRender = true;
906  prevDisplay = true;
907  prevShouldPick = true;
908  overrideDisplay = false;
909  displayAsSubdiv = false;
910  shaders_used = false;
911  active_model = false;
912  being_deleted = false;
913  shade_open_curves = false;
914  onion_skin = false;
915  onion_skin_deform = false;
916  use_frustum_culling = true;
917  errorsChecked = false;
918  visualizerCheck = false;
919  needVisualizerSetup = true;
920  forceHidden = false;
921  forceAsUVObject = false;
922  showMaterials = true;
923  castShadows = true;
924  objHide = false;
925  objSolo = false;
926  objOutput = false;
927  isControlLook = false;
928  forceTimeDep = false;
929  }
930 
931  bool showAxes:1, // draw the axes of the detail
932  isGeometry:1, // renderable
933  isSymGeo:1, // symbolic geo only (no materials)
934  render:1, // render the detail
935  shouldPick:1,
936  display:1, // display the detail
937  templated:1,
938  footprinted:1,
939  highlighted:1, // Node has the highlight flag set
940  xray:1, // display wireframe within other geo
941  geoxray:1, // Xray drawing enabled by an attribute on the geometry.
942  targetoutput:1, // display sop when in view current
943  // mode
944  currentoutput:1, // current sop when in view current
945  // mode and the display flag is on a
946  // different sop.
947  usewireclr:1, // Override default wire color
948  drawLit:1, // In shaded mode, draw shaded
949 drawCookComponentSelection:1, // Draw the GU cook component selection
950  needsAlphaPass:1, // requires a second pass
951  snappable:1, // is the detail snappable
952  secondarySelection:1, // Draw a secondary selection
953  objSelection:1, // object selection
954  objCurrent:1, // object current flag
955  objSelectionHint:1, // hint that object makes good selection
956  objGhost:1, // ghosted object
957  wireframeOnly:1, // draw in wireframe only
958  outline:1, // draw the outline
959  separateOutline:1, // draw the outline separately in a separate pass
960  beautyRender:1, // wether or not to draw in beauty mode
961  prevDisplay:1, // cached value of the previous value of the display flag.
962  prevShouldPick:1, // cached value of the previous value of the pick flag.
963  overrideDisplay:1, // don't allow changes to the display
964  displayAsSubdiv:1, // draw as subdivision.
965  shaders_used:1, // Shaders have been used on the object
966  active_model:1, // Use SOP-level display sets
967  being_deleted:1, // We are in the process of deletion
968  shade_open_curves:1, // Open curves are light-shaded
969  onion_skin:1, // Draw faded images before/after
970  onion_skin_deform:1, // Use deformation onion skinning
971  use_frustum_culling:1, // Frustum culling is allowed
972  errorsChecked:1, // Errors checked after cook
973  visualizerCheck:1, // Check for visualizer setup
974  needVisualizerSetup:1, // Requires visualizer setup
975  forceHidden:1, // Force Hidden flag
976  forceAsUVObject:1, // Force the look to be a uv object.
977  showMaterials:1, // Display look with materials
978  castShadows:1, // The look can cast shadows
979  objSolo:1, // object is solo (hidden obj mode)
980  objHide:1, // Object is temporarily hidden (^)
981  objOutput:1, // output SOP of an Object
982  isControlLook:1, // Look represents a control
983  forceTimeDep:1; // Force look to be time-dependent
984  };
985  GUI_DetailLookFlags myFlag;
986 
987  UT_StringHolder myShowGroupMask;
988  GA_GroupType myShowGroupType;
989  int myShowGroupColorVersion;
990  GU_DetailHandle myDetailHandle;
991  UT_Vector4I myDetailVersion;
992  GUI_GUSelectionProxyHandle myTempComponentSelection;
993  UT_Array<GU_DetailHandle> myOnionSkinDetails;
994 
995  // Override the wireframe display color.
996  UT_Color myWireColor;
997 
998  // Override the outline color.
999  // UT_Vector4F instead of UT_Color since we want RGBA,
1000  // and UT_Color only supports RGB.
1001  UT_Vector4F myOutlineColor;
1002  UT_Vector4F myEmitColor;
1003 
1004  int myObjectID;
1005  int mySopID;
1006  int myOutputIndex;
1007  unsigned myObjTypeMask;
1008  OP_Node *myCachedObject;
1009  OP_Node *myCachedSop;
1010  UT_String myDetailName;
1011  int myID;
1012  GEO_ViewportLOD myObjectLOD;
1013  bool myIsXRay;
1014  bool myIsOnionSkin;
1015  UT_String myInstanceObjectRef;
1016 
1017  bool myUseNewLightInterface;
1018  UT_Set<int> myActiveLights;
1019 
1020  UT_ValArray<RE_Light *> myLights;
1021  UT_ValArray<RE_Light *> myEnabledLights;
1022 
1023  unsigned int myViewportMask;
1024  bool myEnableDOPDisplay;
1025  bool myIsChosenDopnet;
1026  bool myNullDetailFlag;
1027  bool myRetiredFlag;
1028  bool myInitializedFlag;
1029  bool myCopyDetailFlag;
1030 
1031  bool myDrawableFlag;
1032  GU_DetailHandle myDrawableRefHandle;
1033  exint myDrawableRefUniqueId;
1034  exint myDrawableRefMetaCacheCount;
1035 
1036  mutable bool myDisplaySetDirty;
1037  mutable GUI_DisplaySetType myDisplaySet;
1038 
1039  fpreal myPrevInstanceFract;
1040  int myPrevInstanceLimit;
1041  int myInstanceFractSerial;
1042  int64 myPointInstanceVersion;
1043  int myInstanceXformVersion;
1044  fpreal myInstanceTime;
1045  int myInstanceObjectID;
1046  bool myHasInstancing;
1047  bool myHasPointInstancing;
1048  bool myInstanceUseTransform;
1049  bool myHasTransparentPrimitives;
1050  bool myLastPointInstanceState;
1051  bool myHasInstanceFile;
1052  bool myXformDirty;
1053  bool myDetailDirty;
1054  UT_Matrix4D myXform;
1055  UT_Matrix4D mySoloXform;
1056  UT_Vector3F myPivot;
1057  int64 myOpErrorPosted;
1058  int64 myLookVersion;
1059 
1060  // Variable geometry Instancing
1061  UT_Map<int, gui_GeoInstanceInfo *> myDetailTable;
1062  int myGeoCountId;
1063  const GU_Detail *myTempLastDetail;
1064  GUI_GeoRender *myTempLastGeo;
1065 
1066  // Cached details for cached playback (ie cache SOP)
1067  UT_Map<exint, GUI_GeoRender *> myCachedDetailTable;
1068  bool myCachingDetails;
1069  int64 myCacheSopID;
1070  int64 myCacheSopSerial;
1071 
1072  bool myHasUnlitGeometry;
1073  int64 myDecorMask;
1074  bool myUpdatePending;
1075  bool myMatUpdatePending;
1076  bool myThreadedUpdatePending;
1077  RE_MaterialPtr myFactoryMaterialGL;
1078  GR_MaterialPtr myFactoryMaterial;
1079 
1080  exint myVisUpdateTime; // last visualization-triggered
1081  // update time (visualization
1082  // clock measurement)
1083  exint myVisUpdateVersion; // version at the time of last
1084  // visualization-triggered
1085  // update
1086 
1087  UT_IntArray myActiveVisualizers; // unique ids of visualizers
1088  // currently active for look
1089 
1091  myCollectVisPrimitives;
1092 
1093  UT_Array<GUI_GeoRender *> myGeosToRemove;
1094 
1095  UT_BoundingBox myWorldBBox;
1096  UT_UniquePtr<UT_Set<int> > myViewportVisibility;
1097  UT_UniquePtr<DEP_MicroNode> myContextMicroNode;
1098 
1099  class gui_OnionSkinDetail
1100  {
1101  public:
1102  gui_OnionSkinDetail(const GU_DetailHandle &dh)
1103  : myDetail(dh), myRender(NULL), myUsedFlag(true)
1104  {
1105  myDetail.addPreserveRequest();
1106  }
1107  ~gui_OnionSkinDetail();
1108 
1109  GU_DetailHandle myDetail;
1110  GUI_GeoRender *myRender;
1111  bool myUsedFlag;
1112  };
1113  typedef std::pair<exint,int64> gui_OnionSkinId;
1114  typedef UT_Map<gui_OnionSkinId, gui_OnionSkinDetail *> gui_OnionSkins;
1115  gui_OnionSkins myOnionSkins;
1116 
1117  class gui_OnionSkinLayer
1118  {
1119  public:
1120  gui_OnionSkinLayer(gui_OnionSkinId id, fpreal t, const UT_Matrix4D &mat, bool pre)
1121  : myDetailID(id), myTime(t), myRender(NULL),
1122  myTransform(mat), myIsPreFrame(pre) {}
1123 
1124  gui_OnionSkinId myDetailID;
1125  fpreal myTime;
1126  GUI_GeoRender *myRender;
1127  UT_Matrix4D myTransform;
1128  bool myIsPreFrame;
1129  };
1130  UT_Array<gui_OnionSkinLayer *> myOnionSkinLayers;
1131 
1132  class CachedDetailPos {
1133  public:
1134  CachedDetailPos()
1135  : myPos(0,0,0,1)
1136  , myCacheCount(-1)
1137  , myUniqueId(-1)
1138  {}
1139 
1140  CachedDetailPos(const GU_Detail *detail)
1141  {
1142  myCacheCount = detail ? detail->getMetaCacheCount() : -1;
1143  myUniqueId = detail ? detail->getUniqueId() : -1;
1144  }
1145 
1146  void computePosition(const GU_Detail *detail)
1147  {
1148  if(detail)
1149  {
1150  UT_BoundingBox bbox;
1151  detail->getBBox(bbox, UT_Matrix4R::getIdentityMatrix());
1152 
1153  UT_Vector3 point3 = bbox.center();
1154  myPos = UT_Vector4F(point3.x(), point3.y(), point3.z(), 1.0);
1155  }
1156  }
1157 
1158  bool operator==(const CachedDetailPos& p)
1159  {
1160  return myCacheCount == p.myCacheCount
1161  && myUniqueId == p.myUniqueId;
1162  }
1163 
1164  const UT_Vector4F& position() { return myPos; }
1165 
1166  private:
1167  UT_Vector4F myPos;
1168  int myCacheCount;
1169  int myUniqueId;
1170  };
1171  // mutable because these are cached positions
1172  mutable UT_ValArray<CachedDetailPos> myDetailPositions;
1173 
1174  static UT_StringHolder ourChosenDopnetPath;
1175 
1176  UI_Value *myRedrawValue;
1177  SYS_AtomicInt32 myRefCount;
1178 };
1179 
1180 static inline void intrusive_ptr_add_ref(GUI_DetailLook *d) { d->incref(); }
1181 static inline void intrusive_ptr_release(GUI_DetailLook *d) { d->decref(); }
1182 
1183 inline int
1185 {
1186  return myNullDetailFlag ? 0 : 1;
1187 }
1188 
1189 inline OP_Node *
1191 {
1192  if(myCachedObject)
1193  return myCachedObject;
1194  if(myObjectID != OP_INVALID_NODE_ID)
1195  return OP_Node::lookupNode(myObjectID);
1196  return NULL;
1197 }
1198 
1199 inline OP_Node *
1201 {
1202  if(myCachedSop)
1203  return myCachedSop;
1204  if(mySopID != OP_INVALID_NODE_ID)
1205  return OP_Node::lookupNode(mySopID);
1206  return NULL;
1207 }
1208 
1209 inline OP_Node *
1211 {
1212  OP_Node *node = getObject();
1213  if(!node)
1214  {
1215  node = getSop();
1216  if(node)
1217  return node->getCreator();
1218  }
1219  return node;
1220 }
1221 
1222 inline int
1224 {
1226  return mySopID;
1227  else
1228  return myObjectID;
1229 }
1230 
1231 inline bool
1233 {
1234  if((myFlag.display || myFlag.objOutput) && !myFlag.objHide)
1235  {
1236 #if UT_ASSERT_LEVEL > 2
1237  if((myObjectID == OP_INVALID_NODE_ID || OP_Node::lookupNode(myObjectID))
1238  && (mySopID == OP_INVALID_NODE_ID || OP_Node::lookupNode(mySopID)))
1239  return true;
1240  UT_ASSERT_MSG(!"Stale GUI_DetailLook: ", myDetailName);
1241 #else
1242  return true;
1243 #endif
1244  }
1245  return false;
1246 }
1247 
1248 inline bool
1249 GUI_DetailLook::setObjSolo(bool solo, const UT_Matrix4D *solo_transform)
1250 {
1251  bool changed = false;
1252  if(myFlag.objSolo != solo)
1253  changed = true;
1254 
1255  myFlag.objSolo = solo;
1256  UT_Matrix4D mat;
1257  if(solo && solo_transform)
1258  mat = *solo_transform;
1259  else
1260  mat.identity();
1261 
1262  if(mat != mySoloXform)
1263  {
1264  mySoloXform = mat;
1265  changed = true;
1266  }
1267 
1268  if(changed)
1269  myXformDirty = true;
1270 
1271  return changed;
1272 }
1273 
1274 
1275 // UTformat support.
1276 GUI_API size_t format(char *buffer, size_t buffer_size, const GUI_DetailLook &v);
1277 
1278 
1279 #endif
static const char * getActiveViewportMatString()
static bool matchesChosenDopnetPath(const char *path)
virtual bool getUsesGeoRenderInstancing() const
int64 getNodeErrorID() const
void setTemplate(bool templated)
void setXray(bool xray)
const UT_ValArray< RE_Light * > & getLights() const
void setPivot(const UT_Vector3F &pivot)
bool usesFrustumCulling() const
void materialUpdatePending(bool up)
bool areAnyLit() const
UT_Vector4F getEmitColor() const
OP_Node * getObject() const
bool isControlLook() const
bool getDetailDisplay() const
int getVersion(int version)
Definition: ImfVersion.h:99
bool castShadows() const
bool isSeparateOutline() const
void threadedUpdatePending(bool up)
void setForceAsUVObject(bool on)
bool getIsChosenDopnet() const
void useNewLightInterface(bool i)
Unsorted map container.
Definition: UT_Map.h:109
bool isTemplated() const
void setNeedsAlphaPass(bool e)
void setCollectVisPrimitive(int i, GR_Primitive *prim)
UT_API UT_Performance * UTgetPerformance(bool create=true)
GR_DecorationOverride
Definition: GR_Defines.h:221
int numActiveVisualizers() const
void setSnappable(int onoff)
bool getBBox(UT_BoundingBox *bbox, const GA_PrimitiveGroup *g=nullptr) const
UT_SharedPtr< GUI_GUSelectionProxy > GUI_GUSelectionProxyHandle
void setShowMaterials(bool show)
bool hasFactoryMaterialOverride()
bool setObjSolo(bool solo, const UT_Matrix4D *solo_transform=nullptr)
bool hasInstanceFile() const
bool useInstancerObjTransform() const
const GLdouble * v
Definition: glcorearb.h:837
void setXform(const UT_Matrix4D &mat)
void setFactoryMaterialOverride(GR_MaterialPtr material)
bool isPointInstanced() const
void setObjTypeMask(unsigned mask)
bool forceAsUVObject() const
void setFootprint(bool footprint)
void setOutline(bool outline)
bool isDetailDisplayOn() const
bool drawLit() const
bool isSymbolicGeometry() const
UT_IntrusivePtr< GUI_DetailLook > GUI_DetailLookPtr
GLsizei const GLchar *const * path
Definition: glcorearb.h:3341
GA_API const UT_StringHolder rot
A collection of vertex arrays defining a geometry object. This class acts as a wrapper around multipl...
Definition: RE_Geometry.h:52
void setRedrawValue(UI_Value *redraw)
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector3.h:667
int64 exint
Definition: SYS_Types.h:125
void setViewSerialNum(int num, int num_2d, int id)
void setForceHidden(bool on)
int startTimedViewportDrawEvent(const char *viewport_name, const char *draw_event_name, UT_PerfMonViewportType viewport_type, bool is_gpu_draw=false)
bool isInitialized() const
bool isFootprinted() const
bool isObjCurrent() const
bool isDrawableLook() const
UT_Vector4F getOutlineColor() const
bool displayAsSubdiv()
**But if you need a result
Definition: thread.h:622
virtual bool needsOverlayRender()
#define OP_INVALID_NODE_ID
Definition: OP_ItemId.h:24
OP_Network * getCreator() const
void requireErrorCheck()
GLuint buffer
Definition: glcorearb.h:660
bool isObjHidden() const
bool isWireframeOnly() const
GUI_DisplaySetType
Context specific display options for geometry states.
const UT_Set< int > & activeObjLights() const
Temporary container for either a RV_Render and an RE_Render.
int getVisualizedNodeId() const
void needVisualizerSetup(bool setup)
bool forceTimeDependent() const
bool isRecordingMemoryStats() const
Return true if Houdini is recording memory stats.
virtual void setDisplaySavingPrevValue(int onoff)
virtual bool useWireColor(int node_id) const
IFDmantra you can see code vm_image_mplay_direction endcode When SOHO starts a render
Definition: HDK_Image.dox:266
bool isSnappable() const
void setHighlight(bool highlight)
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
Definition: UT_UniquePtr.h:39
void setIsDrawableLook(bool dr)
void setLookID(int id)
bool getEnableDOPDisplay() const
void setViewportMask(unsigned mask)
#define UT_ASSERT_MSG(ZZ,...)
Definition: UT_Assert.h:159
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
UT_Matrix4D getXform() const
bool isThreadedUpdatePending() const
RE_MaterialPtr getFactoryMaterialOverrideGL()
bool isObjSolo() const
bool getShowAxes() const
virtual const PXL_Raster * getImage(RE_RenderContext)
const char * getFullPath(UT_String &str) const
Definition: PRM_ParmOwner.h:54
void setPicking(bool picking)
virtual bool isGuide() const
bool isRecordingViewportStats() const
Return true if Houdini is recording viewport draw stats.
OP_Node * getSop() const
void setGeometry(bool enable)
UT_Array< GUI_GeoRender * > myStashedGeoRenderShared
int getLookID() const
bool isBeautyRender() const
bool isSecondarySelection() const
void setCastShadows(bool on)
bool isObjGhost() const
UT_Vector3T< T > center() const
bool showMaterials() const
#define GUI_API
Definition: GUI_API.h:10
void setIsControlLook(bool c)
bool isUpdatePending() const
const GR_CommonDispOption & common() const
static const UT_Matrix4T< fpreal > & getIdentityMatrix()
bool isMaterialUpdatePending() const
unsigned getObjTypeMask() const
void setObjectLOD(GEO_ViewportLOD lod)
GR_MaterialPtr getFactoryMaterialOverride()
virtual bool isDopGuide() const
UT_Array< GUI_SetupResult > myOnionSkinSetupResults
void setRender(bool render)
GLint GLuint mask
Definition: glcorearb.h:124
RE_Light * getLight(int i) const
GR_DecorFontSize
Definition: GR_Defines.h:202
bool isHighlighted() const
virtual void resetOverrideUsingSavedValue()
GR_UpdateReason
Definition: GR_Defines.h:314
long long int64
Definition: SYS_Types.h:116
GUI_SetupResult
virtual bool hasPickPriority() const
GLuint id
Definition: glcorearb.h:655
void identity()
Set the matrix to identity.
Definition: UT_Matrix4.h:1124
virtual UT_Color getWireColor(int id) const
bool isOnionSkinning() const
GLuint const GLchar * name
Definition: glcorearb.h:786
void setContextMicroNode(UT_UniquePtr< DEP_MicroNode > &&micronode)
virtual int getNumDetailHandles() const
bool isPickingOn() const
void setBeautyRender(bool b)
GLboolean GLboolean GLboolean b
Definition: glcorearb.h:1222
void setTargetOutput(bool target_output)
bool isRenderOn() const
UT_Map< int, UT_Array< GUI_GroupDataHandle > > mySelectData
bool isGeometry() const
UT_SharedPtr< GU_Selection > GU_SelectionHandle
void setEnableDOPDisplay(bool enable)
bool isActiveModel() const
GLdouble t
Definition: glad.h:2397
exint getUniqueId() const
Definition: GA_Detail.h:117
GLenum mode
Definition: glcorearb.h:99
GT_API const UT_StringHolder version
void setSeparateOutline(bool b)
virtual bool isXray() const
DEP_MicroNode * contextMicroNode()
GUI_DisplaySetType getDisplaySetType() const
UT_Array< GUI_GeoRender * > myGeoRender
GLfloat GLfloat GLfloat GLfloat h
Definition: glcorearb.h:2002
static void setGlobalViewSerial(GUI_DisplayOption &disp, int serial, int serial2, int id)
GR_Primitive * getCollectVisPrimitive(int i)
bool isRetired() const
bool isOutline() const
virtual void setDetailDisplay(bool display)
unsigned int getViewportMask() const
bool useNewLightInterface() const
void setActiveModel(bool active_model)
OP_Node * getShopsRelativeTo() const
UT_Vector4T< fpreal32 > UT_Vector4F
GLuint color
Definition: glcorearb.h:1261
GEO_ViewportLOD
void clearActiveVisualizers()
fpreal64 fpreal
Definition: SYS_Types.h:278
bool needsAlphaPass() const
GEO_ViewportLOD getObjectLOD() const
GUI_API size_t format(char *buffer, size_t buffer_size, const GUI_DetailLook &v)
GA_GroupType
An ordinal enum for the different types of groups in GA.
Definition: GA_Types.h:161
GLuint index
Definition: glcorearb.h:786
bool isTargetOutput() const
SIM_API const UT_StringHolder position
void setXRayOverride(bool xray)
GLuint GLfloat * val
Definition: glcorearb.h:1608
bool isObjSelectionHint() const
void setFactoryMaterialOverride(RE_MaterialPtr material)
GR_LightingPass
Definition: GR_Defines.h:148
int64 getMetaCacheCount() const
Definition: GA_Detail.h:2390
int64 getPrimDecorMask() const
void resetVisualizerCheck()
GA_API const UT_StringHolder pivot
void setOutputIndex(int index)
const UT_ValArray< RE_Light * > & getEnabledLights() const
void setInitialized()
bool drawCookComponentSelection() const
void updatePending(bool up)
static OP_Node * lookupNode(int unique_id, bool include_proxy=false)
Definition: OP_Node.h:734
void setIsChosenDopnet(bool ischosen)
bool runVisualizerSetup() const
void setEmitColor(const UT_Vector4F &color)
static void setGlobalChosenDopnet(OP_Node *dopnet)
void useFrustumCulling(bool frust_cull)
bool forceHidden() const
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
std::pair< GUI_GeoRender *, bool > gui_CachedInstGeo
bool isOnionSkinDeformation() const
const UT_IntArray & getActiveVisualizers() const
GLboolean r
Definition: glcorearb.h:1222
bool areAnyUnlit() const
const char * getName() const
PerfMonAutoMatEvent(const GUI_DetailLook &look)
UT_Array< GUI_GeoRender * > myOnionSkinRenders
GUI_SetupResult getUpdateReason()
bool isObjOutput() const
bool isObjSelection() const
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector3.h:665
static const char * getGlobalChosenDopnetPath()
void setWireframeOnly(bool wireframe_only)
virtual bool getPickPriority(const GR_PickRecord &pick, int &) const
void setForceTimeDependent(bool v)
void setShowAxes(bool show_axes)
void setObjHidden(bool hide)
bool isCurrentOutput() const
GLint lod
Definition: glcorearb.h:2765
UT_Array< GUI_SetupResult > mySetupResults
int getNumLights() const
void appendActiveVisualizer(int vis_id)
GUI_DisplaySetType updateDisplaySetType()
void setObjOutput(bool output)
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector3.h:663
int startMemoryViewportDrawEvent(const char *viewport_name, const char *draw_event_name, UT_PerfMonViewportType viewport_type, bool is_gpu_draw=false)
bool shadeOpenCurves() const