Welcome to mirror list, hosted at ThFree Co, Russian Federation.

EmptyValue.cpp « Expressions « gameengine « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 25c0b6af5d7c2c553890d2b2277ad55ef61297bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127

// EmptyValue.cpp: implementation of the CEmptyValue class.
/*
 * Copyright (c) 1996-2000 Erwin Coumans <coockie@acm.org>
 *
 * Permission to use, copy, modify, distribute and sell this software
 * and its documentation for any purpose is hereby granted without fee,
 * provided that the above copyright notice appear in all copies and
 * that both that copyright notice and this permission notice appear
 * in supporting documentation.  Erwin Coumans makes no
 * representations about the suitability of this software for any
 * purpose.  It is provided "as is" without express or implied warranty.
 *
 */




#include "EmptyValue.h"
#include "IntValue.h"
#include "FloatValue.h"
#include "StringValue.h"
#include "ErrorValue.h"
#include "ListValue.h"
#include "VoidValue.h"


//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CEmptyValue::CEmptyValue()
/*
pre:
effect: constructs a new CEmptyValue
*/
{
	SetModified(false);
}



CEmptyValue::~CEmptyValue()
/*
pre:
effect: deletes the object
*/
{

}



CValue * CEmptyValue::Calc(VALUE_OPERATOR op, CValue * val)
/*
pre:
ret: a new object containing the result of applying operator op to this
object and val
*/
{
	return val->CalcFinal(VALUE_EMPTY_TYPE, op, this);
	
}



CValue * CEmptyValue::CalcFinal(VALUE_DATA_TYPE dtype, VALUE_OPERATOR op, CValue * val)
/*
pre: the type of val is dtype
ret: a new object containing the result of applying operator op to val and
this object
*/
{
	return val->AddRef();
}



float CEmptyValue::GetNumber()
{
	return 0;
}



CListValue* CEmptyValue::GetPolySoup()
{
	CListValue* soup = new CListValue();
	//don't add any poly, while it's an empty value
	return soup;
}



bool CEmptyValue::IsInside(CValue* testpoint,bool bBorderInclude)
{
	// empty space is solid, so always inside
	return true;
}



double*	CEmptyValue::GetVector3(bool bGetTransformedVec)
{ 
	assertd(false); // don't get vector from me
	return ZeroVector();
}



static STR_String emptyString = STR_String("");


const STR_String & CEmptyValue::GetText()
{
	return emptyString;
}



CValue* CEmptyValue::GetReplica()
{ 
	CEmptyValue* replica = new CEmptyValue(*this);
	CValue::AddDataToReplica(replica);
	return replica;
}