Blender V2.61 - r43446

FloatValue.h

Go to the documentation of this file.
00001 /*
00002  * FloatValue.h: interface for the CFloatValue 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 _FLOATVALUE_H
00020 #define _FLOATVALUE_H
00021 
00022 #include "Value.h"
00023 
00024 class CFloatValue : public CPropValue 
00025 {
00026     //PLUGIN_DECLARE_SERIAL (CFloatValue,CValue)
00027 public:
00028     CFloatValue();
00029     CFloatValue(float fl);
00030     CFloatValue(float fl,const char *name,AllocationTYPE alloctype=CValue::HEAPVALUE);
00031 
00032     virtual const STR_String & GetText();
00033 
00034     void Configure(CValue* menuvalue);
00035     virtual double GetNumber();
00036     virtual void SetValue(CValue* newval);
00037     float GetFloat();
00038     void SetFloat(float fl);
00039     virtual ~CFloatValue();
00040     virtual CValue* GetReplica();
00041     virtual CValue* Calc(VALUE_OPERATOR op, CValue *val);
00042     virtual CValue* CalcFinal(VALUE_DATA_TYPE dtype, VALUE_OPERATOR op, CValue *val);
00043 #ifdef WITH_PYTHON
00044     virtual PyObject*   ConvertValueToPython();
00045 #endif
00046 
00047 protected:
00048     float m_float;
00049     STR_String* m_pstrRep;
00050 
00051 
00052 #ifdef WITH_CXX_GUARDEDALLOC
00053 public:
00054     void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:CFloatValue"); }
00055     void operator delete( void *mem ) { MEM_freeN(mem); }
00056 #endif
00057 };
00058 
00059 #endif // !defined _FLOATVALUE_H
00060