15 #ifndef __GUI_DetailLook__
16 #define __GUI_DetailLook__
56 class gui_GeoInstanceInfo;
73 const char *detail_name = NULL,
74 SetDetailMode
mode = REFERENCE_DETAIL);
84 if (myRefCount.relaxedLoad() == 0)
88 virtual const char *className()
const;
94 const char *
getName()
const {
return myDetailName; }
95 void setName(
const char *
name);
103 OP_Node *getShopsRelativeTo()
const;
104 int getVisualizedNodeId()
const;
117 bool show_selections,
129 void updateForRender(
134 const char *view_name,
140 virtual void cleanupAfterRender(
RE_Render *
r);
148 { myMatUpdatePending =
up; }
150 {
return myMatUpdatePending; }
156 void reactivateRetired();
162 void getGeometryRenders(
166 void setSingleGeometryRender(
OP_Node *node);
167 void resetGeometryRender();
173 void clearSelectData();
174 bool hasSelectData()
const;
181 virtual bool isPickable()
const;
186 int & )
const {
return false; }
194 {
return drawLit() && !isWireframeOnly(); }
200 bool hasTransparency()
const;
203 bool hasReflectiveMaterial()
const;
211 virtual int getNumDetailHandles()
const;
214 virtual void appendDOPDataName(
UT_String &str,
int i,
215 bool descriptive)
const;
216 virtual const SIM_Data *getDOPData(
int i)
const;
217 virtual const SIM_RootData *getDOPRootData(
int i)
const;
218 virtual bool getIsDetailTempSelected(
int i)
const;
220 virtual UT_Vector4F getDetailPosition(
int i)
const;
227 void signalNodeSelectionChanged(
int i)
const;
229 virtual void setTempComponentSelection(
233 virtual void releaseAllTempComponentSelections();
236 { myEnableDOPDisplay =
enable; }
238 {
return myEnableDOPDisplay; }
240 { myIsChosenDopnet = ischosen; }
242 {
return myIsChosenDopnet; }
244 bool hasUserSelection()
const;
246 void setLightArray(
RE_Light *lights[],
int nLights = 0);
250 void enableAllLights();
256 {
return myEnabledLights; }
258 static RE_Light *getGlobalHeadlight();
260 void setUseWireColor(
int c);
261 void setWireColor(
const UT_Color &clr);
266 {
return myWireColor; }
271 { myXform = mat; myXformDirty =
true; }
277 void setAllowShadingOpenCurves(
bool val);
279 {
return flag.shade_open_curves; }
281 void setDisplayAsSubdiv(
bool val);
288 if(!flag.overrideDisplay)
290 if(flag.display != display)
291 myDisplaySetDirty=
true;
292 flag.display = display;
299 { flag.shouldPick = picking; }
304 if(flag.templated!=templated)
305 myDisplaySetDirty=
true;
306 flag.templated = templated;
309 {
if(flag.footprinted!=footprint)
310 myDisplaySetDirty=
true;
311 flag.footprinted = footprint; }
313 { myDisplaySetDirty |= (flag.highlighted != highlight);
314 flag.highlighted = highlight; }
316 { flag.xray = xray; }
318 {
if(flag.targetoutput !=target_output)
319 myDisplaySetDirty=
true;
320 flag.targetoutput = target_output; }
321 void setCurrentOutput(
bool current_output);
322 void setDrawLit(
int onoff);
323 void setDrawCookComponentSelection(
bool enable);
325 void setSecondarySelection(
int onoff);
326 void setObjSelection(
bool obj_sel);
327 void setObjCurrent(
bool obj_current);
328 void setObjSelectionHint(
bool obj_sel_hint);
329 virtual void setObjGhost(
bool obj_ghost,
OP_Node *for_node);
331 { flag.wireframeOnly = wireframe_only; }
334 if(flag.active_model != active_model)
336 myDisplaySetDirty =
true;
337 flag.active_model = active_model;
344 static void setUVObject(
OP_Node *
object);
345 bool isUVObject()
const;
347 void setOnionSkinning(
int onion_skin_state);
357 { flag.use_frustum_culling = frust_cull; }
359 {
return flag.use_frustum_culling && !flag.onion_skin
360 && !myLastPointInstanceState &&
361 getUsesGeoRenderInstancing(); }
363 virtual void applyBundleToDisplayedObjects(
OP_Bundle *bdl,
int object_vis_change_count);
369 flag.prevDisplay = flag.display;
370 flag.display = onoff;
371 flag.overrideDisplay =
true;
376 flag.display = flag.prevDisplay;
377 flag.overrideDisplay =
false;
381 bool isDetailDisplayOn()
const;
391 virtual bool isXray()
const {
return flag.xray || flag.geoxray || myIsXRay; }
394 virtual bool isGuide()
const {
return false; }
395 virtual bool useWireColor(
int node_id)
const {
return flag.usewireclr; }
399 {
return flag.drawCookComponentSelection; }
411 {
return myInstanceUseTransform; }
414 {
return flag.needsAlphaPass; }
416 { flag.needsAlphaPass = e; }
426 if(flag.forceHidden != on)
428 myDisplaySetDirty=
true;
429 flag.forceHidden = on;
436 return flag.forceAsUVObject;
440 flag.forceAsUVObject = on;
446 if(flag.castShadows != on)
448 myDisplaySetDirty=
true;
449 flag.castShadows = on;
458 int showGroupColorVersion()
const;
459 void setShowGroupColorVersion(
int version);
463 int use_vertex)
const;
468 void invalidateBBox();
472 { myViewportMask =
mask; }
474 {
return myViewportMask; }
477 int serial,
int serial2,
int id)
485 if(!myDisplaySetDirty)
487 return privGetDisplaySetType();
491 {
return privGetDisplaySetType(); }
498 static void renderQueuedObjectAxes(
RE_Render *
r,
510 ourChosenDopnetPathLen = ourChosenDopnetPath.length();
514 ourChosenDopnetPath = 0;
515 ourChosenDopnetPathLen = 0;
520 return (
const char *) ourChosenDopnetPath;
525 if( ourChosenDopnetPathLen > 0 &&
526 !strncmp(ourChosenDopnetPath, path, ourChosenDopnetPathLen) &&
527 (path[ourChosenDopnetPathLen] ==
':' ||
528 path[ourChosenDopnetPathLen] ==
'\0') )
540 { myObjectLOD =
lod; }
542 void useObjectMaterials(
bool use_obj_mat);
546 { flag.showMaterials = show; }
548 {
return flag.showMaterials; }
550 virtual bool isTimeDependent(
fpreal t);
551 bool areInstancesTimeDependent(
fpreal t);
556 static void setActiveViewport(
const char *
name,
int id);
558 static const char *getActiveViewport();
560 static int getActiveViewportId();
562 static const char *getActiveViewportMatString();
565 static void visibleViewportTypes(
bool view_3d,
bool view_2d);
566 static bool hasVisible3D();
567 static bool hasVisibleUV();
571 static int64 visibleUVAttribSerial();
573 enum { VIEW_3D = 0x1, VIEW_2D = 0x2 };
574 static void visibleViewportBoundaries(
577 UT_Array<std::pair<UT_StringHolder,int> > &uvs);
578 static bool hasVisibleBoundaries();
579 static bool visible3DBoundary();
583 &visibleUVBoundaries();
586 {
return myActiveVisualizers; }
588 {
return myActiveVisualizers.entries(); }
590 { myActiveVisualizers.append(vis_id);
591 myCollectVisPrimitives.append(0); }
594 myActiveVisualizers.clear();
595 myCollectVisPrimitives.clear();
598 {
return myCollectVisPrimitives(i); }
600 { myCollectVisPrimitives(i) = prim; }
603 void checkForErrors();
607 { myRedrawValue = redraw; }
609 {
if(myRedrawValue) myRedrawValue->changed(NULL); }
613 flag.visualizerCheck =
true;
614 flag.needVisualizerSetup =
false;
618 flag.visualizerCheck =
false;
619 flag.needVisualizerSetup = setup;
623 return (flag.needVisualizerSetup ||
624 flag.visualizerCheck);
639 if (!record_viewport && !record_memory)
666 void cacheNodePtrs();
669 void initInstanceTable();
679 void finalizeInstanceTable();
683 bool createObjectInstance(
const char *instance_path,
686 gui_Instance &instance,
691 void removeDeletedGeos();
702 bool show_selections,
726 bool setupPointInstancing(
bool show_selections,
733 void updateInstancingStatus();
737 void freeCachedDetails();
738 void freeDeletedCachedDetails();
740 int getNumOnionSkins()
const;
747 void clearOnionSkins();
749 class GUI_DetailLookFlags
752 GUI_DetailLookFlags()
765 targetoutput =
false;
766 currentoutput =
false;
769 drawCookComponentSelection =
true;
770 needsAlphaPass =
false;
772 secondarySelection =
false;
773 objSelection =
false;
775 objSelectionHint =
false;
777 wireframeOnly =
false;
779 prevShouldPick =
true;
780 overrideDisplay =
false;
781 displayAsSubdiv =
false;
782 shaders_used =
false;
783 active_model =
false;
784 being_deleted =
false;
785 shade_open_curves =
false;
787 onion_skin_deform =
false;
788 use_frustum_culling =
true;
789 errorsChecked =
false;
790 visualizerCheck =
false;
791 needVisualizerSetup =
true;
793 forceAsUVObject =
false;
794 showMaterials =
true;
816 drawCookComponentSelection:1,
819 secondarySelection:1,
835 use_frustum_culling:1,
838 needVisualizerSetup:1,
844 GUI_DetailLookFlags flag;
848 int myShowGroupColorVersion;
871 unsigned int myViewportMask;
872 bool myEnableDOPDisplay;
873 bool myIsChosenDopnet;
874 bool myNullDetailFlag;
876 bool myInitializedFlag;
877 bool myCopyDetailFlag;
880 mutable bool myDisplaySetDirty;
883 fpreal myPrevInstanceFract;
884 int myPrevInstanceLimit;
885 int myInstanceFractSerial;
886 int64 myPointInstanceVersion;
887 int myInstanceXformVersion;
889 int myInstanceObjectID;
890 bool myHasInstancing;
891 bool myHasPointInstancing;
892 bool myInstanceUseTransform;
893 bool myHasTransparentPrimitives;
894 bool myLastPointInstanceState;
895 bool myHasInstanceFile;
900 int64 myOpErrorPosted;
911 bool myCachingDetails;
913 int64 myCacheSopSerial;
915 bool myHasUnlitGeometry;
917 bool myUpdatePending;
918 bool myMatUpdatePending;
920 exint myVisUpdateTime;
923 exint myVisUpdateVersion;
931 myCollectVisPrimitives;
937 class gui_OnionSkinDetail
941 : myDetail(dh), myRender(NULL), myUsedFlag(true)
943 myDetail.addPreserveRequest();
945 ~gui_OnionSkinDetail();
951 typedef std::pair<exint,int64> gui_OnionSkinId;
953 gui_OnionSkins myOnionSkins;
955 class gui_OnionSkinLayer
959 : myDetailID(id), myTime(t), myRender(NULL),
960 myTransform(mat), myIsPreFrame(pre) {}
962 gui_OnionSkinId myDetailID;
970 class CachedDetailPos {
984 void computePosition(
const GU_Detail *detail)
998 return myCacheCount == p.myCacheCount
999 && myUniqueId == p.myUniqueId;
1015 static int ourChosenDopnetPathLen;
1016 static bool ourPickDisplayListUsedFlag;
1028 return myNullDetailFlag ? 0 : 1;
1035 return myCachedObject;
1078 #if UT_ASSERT_LEVEL > 2
static const char * getActiveViewportMatString()
static bool matchesChosenDopnetPath(const char *path)
virtual bool getUsesGeoRenderInstancing() const
int64 getNodeErrorID() const
void setTemplate(bool templated)
virtual const PXL_Raster * getImage(RE_Render *)
const UT_ValArray< RE_Light * > & getLights() const
void setPivot(const UT_Vector3F &pivot)
bool usesFrustumCulling() const
void materialUpdatePending(bool up)
OP_Node * getObject() const
int getVersion(int version)
void setForceAsUVObject(bool on)
virtual bool isObjectList() const
bool getIsChosenDopnet() const
void setNeedsAlphaPass(bool e)
void setCollectVisPrimitive(int i, GR_Primitive *prim)
int numActiveVisualizers() const
void setSnappable(int onoff)
UT_SharedPtr< GUI_GUSelectionProxy > GUI_GUSelectionProxyHandle
void setShowMaterials(bool show)
bool hasInstanceFile() const
bool useInstancerObjTransform() const
void setXform(const UT_Matrix4D &mat)
bool isPointInstanced() const
bool forceAsUVObject() const
void setFootprint(bool footprint)
bool isDetailDisplayOn() const
bool isSymbolicGeometry() const
UT_IntrusivePtr< GUI_DetailLook > GUI_DetailLookPtr
GLsizei const GLchar *const * path
GA_API const UT_StringHolder rot
A collection of vertex arrays defining a geometry object. This class acts as a wrapper around multipl...
void setRedrawValue(UI_Value *redraw)
void setViewSerialNum(int num, int num_2d, int id)
void setForceHidden(bool on)
bool isInitialized() const
bool isFootprinted() const
bool isObjCurrent() const
bool isDrawableLook() const
GLuint const GLchar * name
virtual bool needsOverlayRender()
#define OP_INVALID_NODE_ID
OP_Network * getCreator() const
bool isWireframeOnly() const
GUI_DisplaySetType
Context specific display options for geometry states.
int getVisualizedNodeId() const
void needVisualizerSetup(bool setup)
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
void setHighlight(bool highlight)
void setIsDrawableLook(bool dr)
bool getEnableDOPDisplay() const
void setViewportMask(unsigned mask)
#define UT_ASSERT_MSG(ZZ,...)
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
UT_Matrix4D getXform() const
const char * getFullPath(UT_String &str) const
void setPicking(bool picking)
virtual bool isGuide() const
void setGeometry(bool enable)
UT_Array< GUI_GeoRender * > myStashedGeoRenderShared
bool isSecondarySelection() const
void setCastShadows(bool on)
UT_Vector3T< T > center() const
bool showMaterials() const
bool isUpdatePending() const
const GR_CommonDispOption & common() const
static const UT_Matrix4T< fpreal > & getIdentityMatrix()
bool isMaterialUpdatePending() const
void setObjectLOD(GEO_ViewportLOD lod)
virtual bool isDopGuide() const
UT_Array< GUI_SetupResult > myOnionSkinSetupResults
void setRender(bool render)
RE_Light * getLight(int i) const
bool isHighlighted() const
virtual void resetOverrideUsingSavedValue()
virtual bool hasPickPriority() const
virtual UT_Color getWireColor(int id) const
bool isOnionSkinning() const
virtual int getNumDetailHandles() const
void setTargetOutput(bool target_output)
UT_Map< int, UT_Array< GUI_GroupDataHandle > > mySelectData
UT_SharedPtr< GU_Selection > GU_SelectionHandle
void setEnableDOPDisplay(bool enable)
bool isActiveModel() const
exint getUniqueId() const
GT_API const UT_StringHolder version
virtual bool isXray() const
GUI_DisplaySetType getDisplaySetType() const
UT_Array< GUI_GeoRender * > myGeoRender
GLfloat GLfloat GLfloat GLfloat h
static void setGlobalViewSerial(GUI_DisplayOption &disp, int serial, int serial2, int id)
GR_Primitive * getCollectVisPrimitive(int i)
virtual void setDetailDisplay(bool display)
unsigned int getViewportMask() const
void setActiveModel(bool active_model)
OP_Node * getShopsRelativeTo() const
UT_Vector4T< fpreal32 > UT_Vector4F
void clearActiveVisualizers()
GA_API const UT_StringHolder up
int getBBox(UT_BoundingBox *bbox, const GA_PrimitiveGroup *g=0) const
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.
bool isTargetOutput() const
void setXRayOverride(bool xray)
bool isObjSelectionHint() const
int64 getMetaCacheCount() const
int64 getPrimDecorMask() const
void resetVisualizerCheck()
GA_API const UT_StringHolder pivot
const UT_ValArray< RE_Light * > & getEnabledLights() const
bool drawCookComponentSelection() const
void updatePending(bool up)
static OP_Node * lookupNode(int unique_id, bool include_proxy=false)
void setIsChosenDopnet(bool ischosen)
bool runVisualizerSetup() const
static void setGlobalChosenDopnet(OP_Node *dopnet)
void useFrustumCulling(bool frust_cull)
std::pair< GUI_GeoRender *, bool > gui_CachedInstGeo
bool isOnionSkinDeformation() const
const UT_IntArray & getActiveVisualizers() const
const char * getName() const
PerfMonAutoMatEvent(const GUI_DetailLook &look)
UT_Array< GUI_GeoRender * > myOnionSkinRenders
bool isObjSelection() const
static const char * getGlobalChosenDopnetPath()
void setWireframeOnly(bool wireframe_only)
virtual bool getPickPriority(const GR_PickRecord &pick, int &) const
void setShowAxes(bool show_axes)
bool isCurrentOutput() const
UT_Array< GUI_SetupResult > mySetupResults
void appendActiveVisualizer(int vis_id)
GUI_DisplaySetType updateDisplaySetType()
bool shadeOpenCurves() const