HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SOP_ObjectAppearance.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: SOP_ObjectAppearance.h (SOP Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __SOP_ObjectAppearance__
12 #define __SOP_ObjectAppearance__
13 
14 #include "SOP_API.h"
15 #include <SYS/SYS_AtomicInt.h>
16 #include <UT/UT_Set.h>
17 #include <UT/UT_IntrusivePtr.h>
18 #include <GA/GA_Types.h>
19 #include <GEO/GEO_PackedTypes.h>
21 
22 class UT_StringArray;
23 class UT_TagManager;
24 
26  : public UT_IntrusiveRefCounter<SOP_ObjectAppearance>
27 {
28 public:
30 
32  virtual ~SOP_ObjectAppearance();
33 
34  /// Return \c true if the object is a geometric object, which supports
35  /// per-primitive settings. If \c false, then the first argument to the
36  /// setters and getters is ignored (const char *, and GA_Offset), and the
37  /// PrimList setters will fail.
38  virtual bool isGeometricObject() const = 0;
39 
40  /// Edits are not guaranteed to be applied until this method is called
41  virtual bool applyEdits() = 0;
42 
43  /// Get list of all possible paths for the leaf nodes in the tree.
44  virtual bool getLeafPaths(UT_StringArray &paths) const;
45 
46  /// Return the list of primitives which match the given path
47  virtual GA_Offset getPrimitiveOffset(const char *path) const;
48 
49  /// @{
50  /// Get/Set the viewport visibility for the given primitive.
51  virtual bool visibility(GA_Offset prim,
52  bool &visible) const;
53  virtual bool setVisibility(const char *path,
54  bool visible);
55  virtual bool setVisibility(const PrimList &prims,
56  bool visible);
57  /// @}
58 
59 
60  /// @{
61  /// Get/Set the viewport LOD for the given primitive.
62  virtual bool viewportLOD(GA_Offset prim,
63  GEO_ViewportLOD &lod) const;
64  virtual bool setViewportLOD(const char *path,
65  GEO_ViewportLOD l);
66  virtual bool setViewportLOD(const PrimList &prims,
67  GEO_ViewportLOD l);
68  /// @}
69 
70  /// @{
71  /// Get/Set the material for the given primitive.
72  virtual bool material(GA_Offset prim,
73  std::string &material) const;
74  virtual bool setMaterial(const char *path,
75  const char *material);
76  virtual bool setMaterial(const PrimList &prims,
77  const char *material);
78  /// @}
79 
80  /// @{
81  /// Get/Set the light selection expression for the given primitive.
82  virtual bool lightSelection(GA_Offset prim,
83  std::string &light_selection) const;
84  virtual bool lightSelection(const char *path,
85  std::string &light_selection) const;
86  virtual bool setLightSelection(const char *path,
87  const char *light_selection);
88  virtual bool setLightSelection(const PrimList &prims,
89  const char *light_selection);
90  /// @}
91 
92  /// Add all paths to the @c selected_paths. Each path in the appearance
93  /// which matches the given @c tag should be prefixed by the @c path_head
94  /// before it's added to the set.
95  virtual bool getLightSelection(UT_TagManager &tags,
96  const std::string &path_head,
97  UT_Set<std::string> &selected_paths,
98  const char *tag) const;
99 
100  /// Set light selection for a given tag. This should remove the tag from
101  /// all paths not referenced in the selection list. The @c path_head
102  /// should be ignored from each path in the selection.
103  virtual bool editLightSelection(UT_TagManager &tags,
104  const std::string &path_head,
105  const UT_Set<std::string> &selected_paths,
106  const char *tag);
107 
108 private:
109 };
110 
111 #endif
GLsizei const GLchar *const * string
Definition: glcorearb.h:813
GLsizei const GLchar *const * path
Definition: glcorearb.h:3340
A reference counter base class for use with UT_IntrusivePtr.
GA_Size GA_Offset
Definition: GA_Types.h:617
UT_Set< std::string > PrimList
GEO_ViewportLOD
#define SOP_API
Definition: SOP_API.h:10
GLint lod
Definition: glcorearb.h:2764