|
Blender
V2.59
|
00001 /* 00002 * FloatValue.h: interface for the CFloatValue class. 00003 * $Id: FloatValue.h 35063 2011-02-22 10:33:14Z jesterking $ 00004 * Copyright (c) 1996-2000 Erwin Coumans <coockie@acm.org> 00005 * 00006 * Permission to use, copy, modify, distribute and sell this software 00007 * and its documentation for any purpose is hereby granted without fee, 00008 * provided that the above copyright notice appear in all copies and 00009 * that both that copyright notice and this permission notice appear 00010 * in supporting documentation. Erwin Coumans makes no 00011 * representations about the suitability of this software for any 00012 * purpose. It is provided "as is" without express or implied warranty. 00013 * 00014 */ 00015 00020 #if !defined _FLOATVALUE_H 00021 #define _FLOATVALUE_H 00022 00023 #include "Value.h" 00024 00025 class CFloatValue : public CPropValue 00026 { 00027 //PLUGIN_DECLARE_SERIAL (CFloatValue,CValue) 00028 public: 00029 CFloatValue(); 00030 CFloatValue(float fl); 00031 CFloatValue(float fl,const char *name,AllocationTYPE alloctype=CValue::HEAPVALUE); 00032 00033 virtual const STR_String & GetText(); 00034 00035 void Configure(CValue* menuvalue); 00036 virtual double GetNumber(); 00037 virtual void SetValue(CValue* newval); 00038 float GetFloat(); 00039 void SetFloat(float fl); 00040 virtual ~CFloatValue(); 00041 virtual CValue* GetReplica(); 00042 virtual CValue* Calc(VALUE_OPERATOR op, CValue *val); 00043 virtual CValue* CalcFinal(VALUE_DATA_TYPE dtype, VALUE_OPERATOR op, CValue *val); 00044 #ifdef WITH_PYTHON 00045 virtual PyObject* ConvertValueToPython(); 00046 #endif 00047 00048 protected: 00049 float m_float; 00050 STR_String* m_pstrRep; 00051 00052 00053 #ifdef WITH_CXX_GUARDEDALLOC 00054 public: 00055 void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:CFloatValue"); } 00056 void operator delete( void *mem ) { MEM_freeN(mem); } 00057 #endif 00058 }; 00059 00060 #endif // !defined _FLOATVALUE_H 00061