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