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