Blender  V2.59
IntValue.h
Go to the documentation of this file.
00001 /*
00002  * IntValue.h: interface for the CIntValue class.
00003  * $Id: IntValue.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 _INTVALUE_H
00021 #define _INTVALUE_H
00022 
00023 
00024 #include "Value.h"
00025 
00026 typedef long long cInt; 
00027 
00028 class CIntValue : public CPropValue  
00029 {
00030         //PLUGIN_DECLARE_SERIAL (CIntValue,CValue)
00031 
00032 public:
00033         virtual const STR_String& GetText();
00034         virtual double                  GetNumber();
00035         
00036         cInt GetInt();
00037         CIntValue();
00038         CIntValue(cInt innie);
00039         CIntValue(cInt innie,
00040                           const char *name,
00041                           AllocationTYPE alloctype=CValue::HEAPVALUE);
00042         
00043         virtual CValue* Calc(VALUE_OPERATOR op,
00044                                                  CValue *val);
00045 
00046         virtual CValue* CalcFinal(VALUE_DATA_TYPE dtype,
00047                                                           VALUE_OPERATOR op,
00048                                                           CValue *val);
00049 
00050         virtual void    SetValue(CValue* newval);
00051 
00052         void                    Configure(CValue* menuvalue);
00053         void                    AddConfigurationData(CValue* menuvalue);
00054         virtual CValue* GetReplica();
00055 
00056 #ifdef WITH_PYTHON
00057         virtual PyObject*       ConvertValueToPython();
00058 #endif
00059 
00060 protected:
00061         virtual                 ~CIntValue();
00062 
00063 private:
00064         cInt                    m_int;
00065         STR_String*             m_pstrRep;
00066 
00067 
00068 #ifdef WITH_CXX_GUARDEDALLOC
00069 public:
00070         void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:CIntValue"); }
00071         void operator delete( void *mem ) { MEM_freeN(mem); }
00072 #endif
00073 };
00074 
00075 #endif // !defined _INTVALUE_H
00076