Blender V2.61 - r43446
|
00001 /* 00002 * BoolValue.h: interface for the CBoolValue 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 _BOOLVALUE_H 00020 #define _BOOLVALUE_H 00021 00022 #include "Value.h" 00023 00029 class CBoolValue : public CPropValue 00030 { 00031 00032 //PLUGIN_DECLARE_SERIAL(CBoolValue,CValue) 00033 00034 public: 00035 static const STR_String sTrueString; 00036 static const STR_String sFalseString; 00037 00038 CBoolValue(); 00039 CBoolValue(bool inBool); 00040 CBoolValue(bool innie, const char *name, AllocationTYPE alloctype = CValue::HEAPVALUE); 00041 00042 virtual const STR_String& GetText(); 00043 virtual double GetNumber(); 00044 bool GetBool(); 00045 virtual void SetValue(CValue* newval); 00046 00047 virtual CValue* Calc(VALUE_OPERATOR op, CValue *val); 00048 virtual CValue* CalcFinal(VALUE_DATA_TYPE dtype, VALUE_OPERATOR op, CValue *val); 00049 00050 void Configure(CValue* menuvalue); 00051 virtual CValue* GetReplica(); 00052 #ifdef WITH_PYTHON 00053 virtual PyObject* ConvertValueToPython(); 00054 #endif 00055 00056 private: 00057 bool m_bool; 00058 00059 00060 #ifdef WITH_CXX_GUARDEDALLOC 00061 public: 00062 void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:CBoolValue"); } 00063 void operator delete( void *mem ) { MEM_freeN(mem); } 00064 #endif 00065 }; 00066 00067 #endif // !defined _BOOLVALUE_H 00068