00001 /* 00002 * PROPRIETARY INFORMATION. This software is proprietary to 00003 * Side Effects Software Inc., and is not to be reproduced, 00004 * transmitted, or disclosed in any way without written permission. 00005 * 00006 * Produced by: 00007 * Edward Lam 00008 * Side Effects 00009 * 477 Richmond Street West 00010 * Toronto, Ontario 00011 * Canada M5V 3E7 00012 * 416-504-9876 00013 * 00014 * NAME: SIM_Options.h (C++, Utility Library) 00015 * 00016 * COMMENTS: Subclass of UT_Options to provide some special functionality 00017 * used by the SIM library. 00018 * 00019 */ 00020 00021 #ifndef _SIM_OPTIONS_H_ 00022 #define _SIM_OPTIONS_H_ 00023 00024 #include "SIM_API.h" 00025 #include <UT/UT_DMatrix4.h> 00026 #include <OP/OP_Options.h> 00027 00028 class GEO_Point; 00029 class GB_Attribute; 00030 class SIM_OptionsUser; 00031 00032 /// This class stores a set of name/value pairs. Each value can be one of 00033 /// several different data types. No automatic conversion between data types 00034 /// is provided, so accessing existing data requires knowledge of both the 00035 /// data name and the data type. 00036 class SIM_API SIM_Options : public OP_Options 00037 { 00038 public: 00039 explicit SIM_Options(); 00040 explicit SIM_Options(SIM_OptionsUser *owner); 00041 virtual ~SIM_Options(); 00042 00043 /// Sets an option based on a geometric point and an attribute. 00044 /// This utility function relieves the programmer from worrying 00045 /// about the data type of the attribute and mapping it to the 00046 /// matching SIM_Options data type. 00047 void setOptionFromPointAttribute(const GEO_Point &pt, 00048 const GB_Attribute &attr, 00049 int attroffset); 00050 00051 const SIM_Options &operator=(const SIM_Options &src); 00052 00053 protected: 00054 /// This function is called whenever data is added, removed, or changed. 00055 /// If the name parameter is null, then multiple pieces of data were 00056 /// changed simultaneously (probably through a load or assignment 00057 /// operation). This function just calls SIM_OptionsUser::optionChanged() 00058 /// on each user of this data. 00059 virtual void optionChanged(const char *name); 00060 00061 private: 00062 explicit SIM_Options(const SIM_Options &src); 00063 00064 SIM_OptionsUser *myOwner; 00065 }; 00066 00067 #endif 00068
1.5.9