HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DM_Drawable.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:
7  *
8  * COMMENTS:
9  *
10  */
11 
12 #ifndef DM_Drawable_H
13 #define DM_Drawable_H
14 
15 #include "DM_API.h"
16 #include <GU/GU_Detail.h>
17 #include <GU/GU_DetailHandle.h>
18 #include <UT/UT_UniquePtr.h>
19 #include <GUI/GUI_DetailLook.h>
20 #include <RE/RE_Material.h>
21 
22 class UT_Color;
23 class DM_SceneManager;
24 class DM_Viewport;
25 class GUI_DetailLook;
26 class SOP_Node;
27 class DM_DrawableMonitor;
28 
30 {
31 public:
32  DM_Drawable(DM_SceneManager &scene_manager, const char *name, const char *label, GU_Detail* detail=nullptr);
33  ~DM_Drawable();
34 
35  void enable(bool flag);
36  bool enabled() const;
37  void show(bool flag);
38  bool visible() const;
39 
40  // restrict visibility of this look to certain viewports (one or more)
41  void setVisibleInViewport(const DM_Viewport &vport);
42  void setVisibleInAllViewports();
43  bool isVisibleInViewport(const DM_Viewport &vport) const;
44 
45  UT_Matrix4D transform() const;
46  void setTransform(UT_DMatrix4 const & xform);
47 
48  void setXray(bool value);
49  bool isXray() const;
50  void setShowMaterials(bool value);
51  bool isShowMaterials() const;
52  void setWireframeMode(bool value);
53  bool wireframeMode() const;
54  void setWireframeColor(UT_Color const& color);
55  bool isCastShadows() const;
56  void setCastShadows(bool value);
57  bool isDrawOutline() const;
58  void setDrawOutline(bool value);
59  void setOutlineColor(UT_Vector4F const& color);
60  bool isSeparateOutline() const;
61  void setSeparateOutline(bool value);
62  UT_Vector4F getOutlineColor() const;
63  bool isOutlineOnly() const;
64  void setOutlineOnly(bool value);
65  void setMaterial(RE_MaterialPtr material);
66 
67  const char* name() const;
68  const char* label() const;
69  void setLabel(char const * label);
70  GU_Detail* detail();
71  GU_Detail const* detail() const;
72  void acquireDetail( GU_DetailHandle const & gdh );
73 
74  GU_ConstDetailHandle detailHandle() const;
75 
76  void setSopNode(SOP_Node* node);
77  SOP_Node* sopNode() const;
78 
79  GUI_DetailLook *look() const;
80 
81  void unregister();
82 
83 private:
84  DM_SceneManager& mySceneManager;
85  GU_DetailHandle myDetailHandle;
86  GUI_DetailLookPtr myDetailLook;
87  int mySopNodeId = -1;
88  UT_StringHolder myLabel;
89  UT_WeakPtr<DM_DrawableMonitor> myDrawableMonitor;
90 };
91 
92 #endif // DM_Drawable_H
93 
GLuint GLsizei const GLchar * label
Definition: glcorearb.h:2545
GLenum GLenum GLsizei const GLuint GLboolean enabled
Definition: glcorearb.h:2539
#define DM_API
Definition: DM_API.h:10
GLuint const GLchar * name
Definition: glcorearb.h:786
GA_API const UT_StringHolder transform
GLuint color
Definition: glcorearb.h:1261
Definition: core.h:1131
std::weak_ptr< T > UT_WeakPtr
Definition: UT_SharedPtr.h:49