HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
VIS_Handle.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: VIS_Handle.h ( GR Library, C++)
7  *
8  * COMMENTS:
9  * A VIS_Mount specifies the location, scopy and other local settings of
10  * a visualizer.
11  */
12 
13 #ifndef __VIS_Handle__
14 #define __VIS_Handle__
15 
16 #include "VIS_API.h"
17 #include "VIS_Defines.h"
18 #include "VIS_Mount.h"
19 #include <SYS/SYS_Hash.h>
20 
21 class PRM_ParmList;
22 class VIS_Visualizer;
23 class VIS_Handle;
24 
26 
27 
29 {
30 public:
31  VIS_Handle(int unique_id = -1) :
32  myUniqueId(unique_id)
33  {}
34 
35  bool isValid()
36  { return getMount(); }
37 
38  inline bool operator==(const VIS_Handle vh) const
39  { return myUniqueId == vh.myUniqueId; }
40 
41  inline bool operator!=(const VIS_Handle vh) const
42  { return myUniqueId != vh.myUniqueId; }
43 
44 
45  /// Returns a the mount's unique id (this doesn't change if the
46  /// mounted visualizer is substituted).
47  int getUniqueId() const;
48 
49  /// Returns the type id of the mounted visualizer.
50  int getTypeId();
51 
52  /// returns the parameter list of the mounted visualizer.
53  PRM_ParmList *getParmList();
54 
55  /// Returns the mounted visualizer.
56  VIS_Visualizer *getVisualizer();
57 
58  /// Returns the serial number of the mounted visualizer.
59  int getSerialNum();
60 
61  /// Returns the table ref of the VIS_Tables that owns the mount.
62  VIS_TableRef getTableRef() const;
63 
64  /// Returns the index of the viuslaizer in the owning VIS_Table.
65  int getIndex() const;
66  const char *getName() const;
67  const char *getLabel() const;
68  const char *getIcon() const;
69 
70  bool isActiveWhenUnselected() const;
71  bool isActiveWhenSelected() const;
72  bool isActiveWhenGhosted() const;
73  bool isActiveWhenDisplayed() const;
74  bool isActiveWhenCurrent() const;
75  bool isActiveWhenTemplated() const;
76 
77  bool showInToolbar() const;
78 
79  VIS_VisualizerScope getScope() const;
80  inline VIS_Mount *getMount() const
81  { return VIS_Mount::lookupHandleMount(*this); }
82 private:
83 
84  int myUniqueId;
85 };
86 
87 inline size_t hash_value(const VIS_Handle &vh)
88 {
89  return SYShash(vh.getUniqueId());
90 }
91 
92 #define VIS_INVALID_HANDLE VIS_Handle(-1)
93 
94 
95 #endif
VIS_Mount * getMount() const
Definition: VIS_Handle.h:80
int getUniqueId() const
VIS_VisualizerScope
Definition: VIS_Defines.h:169
VIS_Handle(int unique_id=-1)
Definition: VIS_Handle.h:31
bool operator==(const VIS_Handle vh) const
Definition: VIS_Handle.h:38
size_t hash_value(const VIS_Handle &vh)
Definition: VIS_Handle.h:87
bool isValid()
Definition: VIS_Handle.h:35
PXL_API const char * getName(const ColorSpace *space)
Return the name of the color space.
bool operator!=(const VIS_Handle vh) const
Definition: VIS_Handle.h:41
#define VIS_API
Definition: VIS_API.h:10
VIS_API VIS_Mount * VISlookupHandleMount(VIS_Handle vh)
static VIS_Mount * lookupHandleMount(VIS_Handle vh)