Blender V2.61 - r43446
|
00001 /* 00002 * IntValue.h: interface for the CIntValue class. 00003 * Copyright (c) 1996-2000 Erwin Coumans <coockie@acm.org> 00004 * 00005 * Permission to use, copy, modify, distribute and sell this software 00006 * and its documentation for any purpose is hereby granted without fee, 00007 * provided that the above copyright notice appear in all copies and 00008 * that both that copyright notice and this permission notice appear 00009 * in supporting documentation. Erwin Coumans makes no 00010 * representations about the suitability of this software for any 00011 * purpose. It is provided "as is" without express or implied warranty. 00012 * 00013 */ 00014 00019 #if !defined _INTVALUE_H 00020 #define _INTVALUE_H 00021 00022 00023 #include "Value.h" 00024 00025 typedef long long cInt; 00026 00027 class CIntValue : public CPropValue 00028 { 00029 //PLUGIN_DECLARE_SERIAL (CIntValue,CValue) 00030 00031 public: 00032 virtual const STR_String& GetText(); 00033 virtual double GetNumber(); 00034 00035 cInt GetInt(); 00036 CIntValue(); 00037 CIntValue(cInt innie); 00038 CIntValue(cInt innie, 00039 const char *name, 00040 AllocationTYPE alloctype=CValue::HEAPVALUE); 00041 00042 virtual CValue* Calc(VALUE_OPERATOR op, 00043 CValue *val); 00044 00045 virtual CValue* CalcFinal(VALUE_DATA_TYPE dtype, 00046 VALUE_OPERATOR op, 00047 CValue *val); 00048 00049 virtual void SetValue(CValue* newval); 00050 00051 void Configure(CValue* menuvalue); 00052 void AddConfigurationData(CValue* menuvalue); 00053 virtual CValue* GetReplica(); 00054 00055 #ifdef WITH_PYTHON 00056 virtual PyObject* ConvertValueToPython(); 00057 #endif 00058 00059 protected: 00060 virtual ~CIntValue(); 00061 00062 private: 00063 cInt m_int; 00064 STR_String* m_pstrRep; 00065 00066 00067 #ifdef WITH_CXX_GUARDEDALLOC 00068 public: 00069 void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:CIntValue"); } 00070 void operator delete( void *mem ) { MEM_freeN(mem); } 00071 #endif 00072 }; 00073 00074 #endif // !defined _INTVALUE_H 00075