Blender V2.61 - r43446

EmptyValue.cpp

Go to the documentation of this file.
00001 
00005 // EmptyValue.cpp: implementation of the CEmptyValue class.
00006 /*
00007  * Copyright (c) 1996-2000 Erwin Coumans <coockie@acm.org>
00008  *
00009  * Permission to use, copy, modify, distribute and sell this software
00010  * and its documentation for any purpose is hereby granted without fee,
00011  * provided that the above copyright notice appear in all copies and
00012  * that both that copyright notice and this permission notice appear
00013  * in supporting documentation.  Erwin Coumans makes no
00014  * representations about the suitability of this software for any
00015  * purpose.  It is provided "as is" without express or implied warranty.
00016  *
00017  */
00018 
00019 #include "EmptyValue.h"
00020 #include "IntValue.h"
00021 #include "FloatValue.h"
00022 #include "StringValue.h"
00023 #include "ErrorValue.h"
00024 #include "ListValue.h"
00025 #include "VoidValue.h"
00026 
00028 // Construction/Destruction
00030 
00031 CEmptyValue::CEmptyValue()
00032 /*
00033 pre:
00034 effect: constructs a new CEmptyValue
00035 */
00036 {
00037     SetModified(false);
00038 }
00039 
00040 
00041 
00042 CEmptyValue::~CEmptyValue()
00043 /*
00044 pre:
00045 effect: deletes the object
00046 */
00047 {
00048 
00049 }
00050 
00051 
00052 
00053 CValue * CEmptyValue::Calc(VALUE_OPERATOR op, CValue * val)
00054 /*
00055 pre:
00056 ret: a new object containing the result of applying operator op to this
00057 object and val
00058 */
00059 {
00060     return val->CalcFinal(VALUE_EMPTY_TYPE, op, this);
00061     
00062 }
00063 
00064 
00065 
00066 CValue * CEmptyValue::CalcFinal(VALUE_DATA_TYPE dtype, VALUE_OPERATOR op, CValue * val)
00067 /*
00068 pre: the type of val is dtype
00069 ret: a new object containing the result of applying operator op to val and
00070 this object
00071 */
00072 {
00073     return val->AddRef();
00074 }
00075 
00076 
00077 
00078 double CEmptyValue::GetNumber()
00079 {
00080     return 0;
00081 }
00082 
00083 
00084 
00085 CListValue* CEmptyValue::GetPolySoup()
00086 {
00087     CListValue* soup = new CListValue();
00088     //don't add any poly, while it's an empty value
00089     return soup;
00090 }
00091 
00092 
00093 
00094 bool CEmptyValue::IsInside(CValue* testpoint,bool bBorderInclude)
00095 {
00096     // empty space is solid, so always inside
00097     return true;
00098 }
00099 
00100 
00101 
00102 double* CEmptyValue::GetVector3(bool bGetTransformedVec)
00103 { 
00104     assertd(false); // don't get vector from me
00105     return ZeroVector();
00106 }
00107 
00108 
00109 
00110 static STR_String emptyString = STR_String("");
00111 
00112 
00113 const STR_String & CEmptyValue::GetText()
00114 {
00115     return emptyString;
00116 }
00117 
00118 
00119 
00120 CValue* CEmptyValue::GetReplica()
00121 { 
00122     CEmptyValue* replica = new CEmptyValue(*this);
00123     replica->ProcessReplica();
00124     return replica;
00125 }
00126