HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SIM_Options.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: SIM_Options.h (C++, Utility Library)
7  *
8  * COMMENTS: Subclass of UT_Options to provide some special functionality
9  * used by the SIM library.
10  *
11  */
12 
13 #ifndef _SIM_OPTIONS_H_
14 #define _SIM_OPTIONS_H_
15 
16 #include "SIM_API.h"
17 #include <GA/GA_Types.h>
18 #include <OP/OP_Options.h>
19 
20 class GA_Attribute;
21 class SIM_OptionsUser;
22 
23 /// This class stores a set of name/value pairs. Each value can be one of
24 /// several different data types. No automatic conversion between data types
25 /// is provided, so accessing existing data requires knowledge of both the
26 /// data name and the data type.
28 {
29 public:
30  explicit SIM_Options();
31  explicit SIM_Options(SIM_OptionsUser *owner);
32  ~SIM_Options() override;
33 
34  /// Sets an option based on a geometric point and an attribute.
35  /// This utility function relieves the programmer from worrying
36  /// about the data type of the attribute and mapping it to the
37  /// matching SIM_Options data type.
38  void setOptionFromPointAttribute(GA_Offset ptoff,
39  const GA_Attribute *attrib);
40 
41  const SIM_Options &operator=(const SIM_Options &src);
42 
43 protected:
44  /// This function is called whenever data is added, removed, or changed.
45  /// If the name parameter is null, then multiple pieces of data were
46  /// changed simultaneously (probably through a load or assignment
47  /// operation). This function just calls SIM_OptionsUser::optionChanged()
48  /// on each user of this data.
49  void optionChanged(const char *name) override;
50 
51 private:
52  explicit SIM_Options(const SIM_Options &src);
53 
54  SIM_OptionsUser *myOwner;
55 };
56 
57 #endif
58 
Definition of a geometry attribute.
Definition: GA_Attribute.h:198
GA_Size GA_Offset
Definition: GA_Types.h:646
GLuint const GLchar * name
Definition: glcorearb.h:786
#define SIM_API
Definition: SIM_API.h:12
const OP_Options & operator=(const UT_Options &src)
Set one OP_Options equal to another.
void optionChanged(const char *name) override
GLenum src
Definition: glcorearb.h:1793