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