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 #include <GR/GR_Material.h>
22 
23 class UT_Color;
24 class DM_SceneManager;
25 class DM_Viewport;
26 class GUI_DetailLook;
27 class SOP_Node;
28 class DM_DrawableMonitor;
29 
31 {
32 public:
33  DM_Drawable(DM_SceneManager &scene_manager, const char *name, const char *label, GU_Detail* detail=nullptr);
34  ~DM_Drawable();
35 
36  void enable(bool flag);
37  bool enabled() const;
38  void show(bool flag);
39  bool visible() const;
40 
41  // restrict visibility of this look to certain viewports (one or more)
42  void setVisibleInViewport(const DM_Viewport &vport);
43  void setVisibleInAllViewports();
44  bool isVisibleInViewport(const DM_Viewport &vport) const;
45 
46  UT_Matrix4D transform() const;
47  void setTransform(UT_DMatrix4 const & xform);
48 
49  void setXray(bool value);
50  bool isXray() const;
51  void setShowMaterials(bool value);
52  bool isShowMaterials() const;
53  void setWireframeMode(bool value);
54  bool wireframeMode() const;
55  void setWireframeColor(UT_Color const& color);
56  UT_Color wireframeColor() const;
57  void setUseWireframeColor(bool value);
58  bool useWireframeColor() const;
59  bool isCastShadows() const;
60  void setCastShadows(bool value);
61  bool isDrawOutline() const;
62  void setDrawOutline(bool value);
63  void setOutlineColor(UT_Vector4F const& color);
64  bool isSeparateOutline() const;
65  void setSeparateOutline(bool value);
66  UT_Vector4F getOutlineColor() const;
67  bool isOutlineOnly() const;
68  void setOutlineOnly(bool value);
69  void setMaterial(RE_MaterialPtr material);
70  void setMaterial(GR_MaterialPtr material);
71 
72  void setIsControl(bool is_control);
73  bool isControl() const;
74 
75  const char* name() const;
76  const char* label() const;
77  void setLabel(char const * label);
78  GU_Detail* detail();
79  GU_Detail const* detail() const;
80  void acquireDetail( GU_DetailHandle const & gdh );
81 
82  GU_ConstDetailHandle detailHandle() const;
83 
84  void setSopNode(SOP_Node* node);
85  SOP_Node* sopNode() const;
86 
87  GUI_DetailLook *look() const;
88 
89  void unregister();
90 
91 private:
92  DM_SceneManager& mySceneManager;
93  GU_DetailHandle myDetailHandle;
94  GUI_DetailLookPtr myDetailLook;
95  int mySopNodeId = -1;
96  UT_StringHolder myLabel;
97  UT_WeakPtr<DM_DrawableMonitor> myDrawableMonitor;
98 };
99 
100 #endif // DM_Drawable_H
101 
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