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 * Side Effects Software Inc. 00008 * 477 Richmond Street West 00009 * Toronto, Ontario 00010 * Canada M5V 3E7 00011 * 416-504-9876 00012 * 00013 * NAME: GR_ColorLookupMgr.h (GR library, C++) 00014 * 00015 * COMMENTS: 00016 * 00017 */ 00018 00019 #ifndef __GR_ColorLookupMgr_h__ 00020 #define __GR_ColorLookupMgr_h__ 00021 00022 #include "GR_API.h" 00023 00024 #include <UT/UT_SymbolTable.h> 00025 #include <UT/UT_PtrArray.h> 00026 00027 class GB_Attribute; 00028 class gr_ColorLookupInfo; 00029 00030 class GR_API GR_ColorLookupMgr 00031 { 00032 public: 00033 // A function used to translate an attribute value into a three component 00034 // color. 00035 typedef const float *(*ColorLookupFunc)(const void *data); 00036 00037 // A function used to return an appropriate ColorLookupFunc for the 00038 // given attribute. 00039 typedef ColorLookupFunc (*TypeEntryFunc)(const GB_Attribute *); 00040 00041 GR_ColorLookupMgr(); 00042 ~GR_ColorLookupMgr(); 00043 00044 bool registerType(const char *token, TypeEntryFunc entry_function); 00045 00046 int findType(const char *token) const; 00047 00048 TypeEntryFunc getEntryFunction(int type_index) const; 00049 00050 int getNumTypes() const { return myTypes.entries(); } 00051 const char * getTypeName(int i) const; 00052 00053 private: 00054 UT_SymbolTable myTable; 00055 UT_PtrArray<gr_ColorLookupInfo *> myTypes; 00056 }; 00057 00058 GR_API extern GR_ColorLookupMgr *GRgetColorLookupMgr(); 00059 00060 #endif // __GR_ColorLookupMgr_h__
1.5.9