Blender V2.61 - r43446
|
#include <Value.h>
Public Types | |
enum | AllocationTYPE { STACKVALUE = 0, HEAPVALUE = 1 } |
enum | DrawTYPE { STARTFRAME = 0, ENDFRAME = 1, INTERFRAME = 2 } |
Public Member Functions | |
CValue () | |
virtual CValue * | Calc (VALUE_OPERATOR op, CValue *val)=0 |
virtual CValue * | CalcFinal (VALUE_DATA_TYPE dtype, VALUE_OPERATOR op, CValue *val)=0 |
virtual void | SetOwnerExpression (class CExpression *expr) |
void | Execute (const CAction &a) |
int | GetRefCount () |
Reference Counting. | |
CValue * | AddRef () |
int | Release () |
virtual void | SetProperty (const STR_String &name, CValue *ioProperty) |
Property Management. | |
virtual void | SetProperty (const char *name, CValue *ioProperty) |
virtual CValue * | GetProperty (const char *inName) |
virtual CValue * | GetProperty (const STR_String &inName) |
const STR_String & | GetPropertyText (const STR_String &inName) |
float | GetPropertyNumber (const STR_String &inName, float defnumber) |
virtual bool | RemoveProperty (const char *inName) |
virtual vector< STR_String > | GetPropertyNames () |
virtual void | ClearProperties () |
virtual void | SetPropertiesModified (bool inModified) |
virtual bool | IsAnyPropertyModified () |
virtual CValue * | GetProperty (int inIndex) |
virtual int | GetPropertyCount () |
virtual CValue * | FindIdentifier (const STR_String &identifiername) |
virtual void | SetColorOperator (VALUE_OPERATOR op) |
virtual const STR_String & | GetText ()=0 |
virtual double | GetNumber ()=0 |
double * | ZeroVector () |
virtual double * | GetVector3 (bool bGetTransformedVec=false) |
virtual STR_String & | GetName ()=0 |
virtual void | SetName (const char *name)=0 |
virtual void | SetValue (CValue *newval) |
virtual CValue * | GetReplica ()=0 |
virtual void | ProcessReplica () |
STR_String | op2str (VALUE_OPERATOR op) |
void | SetSelected (bool bSelected) |
virtual void | SetModified (bool bModified) |
virtual void | SetAffected (bool bAffected=true) |
void | SetReleaseRequested (bool bReleaseRequested) |
void | SetError (bool err) |
void | SetVisible (bool vis) |
virtual bool | IsModified () |
bool | IsError () |
virtual bool | IsAffected () |
virtual bool | IsSelected () |
bool | IsReleaseRequested () |
virtual bool | IsVisible () |
virtual void | SetCustomFlag1 (bool bCustomFlag) |
virtual bool | IsCustomFlag1 () |
virtual void | SetCustomFlag2 (bool bCustomFlag) |
virtual bool | IsCustomFlag2 () |
Protected Member Functions | |
virtual void | DisableRefCount () |
virtual | ~CValue () |
Baseclass CValue
Together with CExpression, CValue and it's derived classes can be used to parse expressions into a parsetree with error detecting/correcting capabilities also expandible by a CFactory pluginsystem
Base class for all editor functionality, flexible object type that allows calculations and uses reference counting for memory management.
Features:
enum CValue::DrawTYPE |
CValue::~CValue | ( | ) | [protected, virtual] |
Definition at line 113 of file Value.cpp.
References assertd, and ClearProperties().
CValue* CValue::AddRef | ( | ) | [inline] |
Definition at line 259 of file Value.h.
Referenced by SCA_IObject::AddActuator(), KX_Scene::AddAnimatedObject(), SCA_IObject::AddController(), SCA_IScene::AddDebugProperty(), KX_Scene::AddNodeReplicaObject(), KX_Scene::AddReplicaObject(), SCA_IObject::AddSensor(), SCA_TimeEventManager::AddTimeProperty(), bl_ConvertBlenderObject_Single(), BL_ConvertBlenderObjects(), CEmptyValue::CalcFinal(), COperator2Expr::Calculate(), CConstExpr::Calculate(), CIdentifierExpr::CIdentifierExpr(), KX_Scene::DelayedRemoveObject(), KX_Scene::DupliGroupRecurse(), FindIdentifier(), gameobject_from_blenderobject(), SCA_ILogicBrick::GetEvent(), KX_GameObject::GetParent(), CListValue::MergeList(), KX_TouchSensor::NewHandleCollision(), KX_NearSensor::NewHandleCollision(), KX_KetsjiEngine::PostProcessScene(), SCA_PropertySensor::PrecalculateRangeExpression(), SCA_ILogicBrick::RegisterEvent(), KX_GameObject::RemoveParent(), SetProperty(), SCA_ExpressionController::Trigger(), SCA_PropertyActuator::Update(), and walk_children().
virtual CValue* CValue::Calc | ( | VALUE_OPERATOR | op, |
CValue * | val | ||
) | [pure virtual] |
Implemented in CBoolValue, CEmptyValue, CErrorValue, CFloatValue, CIntValue, CListValue, CStringValue, CVectorValue, CVoidValue, SCA_ILogicBrick, and KX_GameObject.
Referenced by SCA_ILogicBrick::Calc(), COperator1Expr::Calculate(), COperator2Expr::Calculate(), and CListValue::CheckEqual().
virtual CValue* CValue::CalcFinal | ( | VALUE_DATA_TYPE | dtype, |
VALUE_OPERATOR | op, | ||
CValue * | val | ||
) | [pure virtual] |
Implemented in CBoolValue, CEmptyValue, CErrorValue, CFloatValue, CIntValue, CListValue, CStringValue, CVectorValue, CVoidValue, SCA_ILogicBrick, and KX_GameObject.
Referenced by CStringValue::Calc(), CIntValue::Calc(), CEmptyValue::Calc(), CBoolValue::Calc(), CFloatValue::Calc(), CErrorValue::Calc(), CVectorValue::Calc(), and SCA_ILogicBrick::CalcFinal().
void CValue::ClearProperties | ( | ) | [virtual] |
void CValue::DisableRefCount | ( | ) | [protected, virtual] |
Definition at line 456 of file Value.cpp.
References assertd, and ValueFlags::RefCountDisabled.
Referenced by CBoolValue::CBoolValue(), CFloatValue::CFloatValue(), CIntValue::CIntValue(), CStringValue::CStringValue(), CVectorValue::CVectorValue(), and CVoidValue::CVoidValue().
void CValue::Execute | ( | const CAction & | a | ) | [inline] |
Definition at line 247 of file Value.h.
References CAction::Execute().
CValue * CValue::FindIdentifier | ( | const STR_String & | identifiername | ) | [virtual] |
Reimplemented in SCA_ExpressionController, and SCA_PropertySensor.
Definition at line 496 of file Value.cpp.
References AddRef(), STR_String::Find(), FindIdentifier(), GetProperty(), STR_String::Left(), STR_String::Length(), NULL, and STR_String::Right().
Referenced by CIdentifierExpr::Calculate(), SCA_PropertySensor::CheckPropertyCondition(), SCA_ExpressionController::FindIdentifier(), FindIdentifier(), SCA_PropertySensor::FindIdentifier(), and SCA_PropertySensor::SCA_PropertySensor().
virtual STR_String& CValue::GetName | ( | ) | [pure virtual] |
virtual double CValue::GetNumber | ( | ) | [pure virtual] |
Implemented in CBoolValue, CEmptyValue, CErrorValue, CFloatValue, CIntValue, CListValue, CStringValue, CVectorValue, CVoidValue, SCA_ILogicBrick, SCA_ISensor, and KX_GameObject.
Referenced by SCA_KeyboardSensor::Evaluate(), CParser::GetFloat(), SCA_ISensor::IsPositiveTrigger(), CBoolValue::SetValue(), CFloatValue::SetValue(), SetValue(), CIntValue::SetValue(), SCA_ExpressionController::Trigger(), BL_ActionActuator::Update(), BL_ShapeActionActuator::Update(), KX_IpoActuator::Update(), and SCA_PropertyActuator::Update().
CValue * CValue::GetProperty | ( | int | inIndex | ) | [virtual] |
CValue * CValue::GetProperty | ( | const char * | inName | ) | [virtual] |
Definition at line 267 of file Value.cpp.
References NULL.
Referenced by KX_Scene::AddNodeReplicaObject(), BL_ConvertTextProperty(), KX_NearSensor::BroadPhaseFilterCollision(), KX_TouchSensor::BroadPhaseSensorFilterCollision(), KX_FontObject::DrawText(), SCA_KeyboardSensor::Evaluate(), FindIdentifier(), GetPropertyNumber(), GetPropertyText(), KX_Scene::LogicBeginFrame(), KX_RaySensor::NeedRayCast(), KX_TouchSensor::NewHandleCollision(), KX_Scene::NewRemoveObject(), KX_RaySensor::RayHit(), KX_ConstraintActuator::RayHit(), SCA_RandomActuator::Update(), SCA_PropertyActuator::Update(), KX_IpoActuator::Update(), BL_ShapeActionActuator::Update(), and BL_ActionActuator::Update().
CValue * CValue::GetProperty | ( | const STR_String & | inName | ) | [virtual] |
int CValue::GetPropertyCount | ( | ) | [virtual] |
Definition at line 425 of file Value.cpp.
Referenced by KX_Scene::AddNodeReplicaObject(), and KX_Scene::NewRemoveObject().
vector< STR_String > CValue::GetPropertyNames | ( | ) | [virtual] |
Definition at line 325 of file Value.cpp.
Referenced by SCA_2DFilterActuator::SCA_2DFilterActuator().
float CValue::GetPropertyNumber | ( | const STR_String & | inName, |
float | defnumber | ||
) |
Definition at line 291 of file Value.cpp.
References GetProperty().
const STR_String & CValue::GetPropertyText | ( | const STR_String & | inName | ) |
Definition at line 280 of file Value.cpp.
References GetProperty().
Referenced by KX_NetworkMessageActuator::Update().
virtual CValue* CValue::GetReplica | ( | ) | [pure virtual] |
Implemented in BL_ActionActuator, BL_ArmatureActuator, BL_ArmatureObject, BL_DeformableGameObject, BL_ShapeActionActuator, CBoolValue, CEmptyValue, CErrorValue, CFloatValue, CIntValue, CListValue, CStringValue, CVectorValue, CVoidValue, SCA_2DFilterActuator, SCA_ActuatorSensor, SCA_AlwaysSensor, SCA_ANDController, SCA_DelaySensor, SCA_ExpressionController, SCA_ISensor, SCA_JoystickSensor, SCA_KeyboardSensor, SCA_MouseSensor, SCA_NANDController, SCA_NORController, SCA_ORController, SCA_PropertyActuator, SCA_PropertySensor, SCA_PythonController, SCA_RandomActuator, SCA_RandomSensor, SCA_XNORController, SCA_XORController, KX_ArmatureSensor, KX_Camera, KX_CameraActuator, KX_ConstraintActuator, KX_FontObject, KX_GameActuator, KX_GameObject, KX_IpoActuator, KX_LightObject, KX_MouseFocusSensor, KX_NavMeshObject, KX_NearSensor, KX_ObjectActuator, KX_ParentActuator, KX_RadarSensor, KX_RaySensor, KX_SCA_AddObjectActuator, KX_SCA_DynamicActuator, KX_SCA_EndObjectActuator, KX_SCA_ReplaceMeshActuator, KX_SceneActuator, KX_SoundActuator, KX_StateActuator, KX_SteeringActuator, KX_TouchSensor, KX_TrackToActuator, KX_VisibilityActuator, KX_NetworkMessageActuator, and KX_NetworkMessageSensor.
Referenced by SCA_IObject::ReParentLogic(), and SCA_PropertyActuator::Update().
virtual const STR_String& CValue::GetText | ( | ) | [pure virtual] |
Implemented in CBoolValue, CEmptyValue, CErrorValue, CFloatValue, CIntValue, CListValue, CStringValue, CVectorValue, CVoidValue, SCA_ILogicBrick, and KX_GameObject.
Referenced by CIntValue::Calc(), CFloatValue::Calc(), CBoolValue::CalcFinal(), CStringValue::CalcFinal(), CFloatValue::CalcFinal(), CVectorValue::CalcFinal(), CIntValue::CalcFinal(), CErrorValue::CalcFinal(), CIfExpr::Calculate(), CListValue::CheckEqual(), SCA_PropertySensor::CheckPropertyCondition(), CListValue::GetText(), SCA_PropertySensor::SCA_PropertySensor(), CStringValue::SetValue(), and SCA_ExpressionController::Trigger().
double * CValue::GetVector3 | ( | bool | bGetTransformedVec = false | ) | [virtual] |
Reimplemented in CEmptyValue, and CVectorValue.
Definition at line 434 of file Value.cpp.
References assertd.
Referenced by CVectorValue::CalcFinal().
virtual bool CValue::IsAffected | ( | ) | [inline, virtual] |
Definition at line 347 of file Value.h.
References ValueFlags::Affected, and ValueFlags::Modified.
Referenced by CConstExpr::NeedsRecalculated().
virtual bool CValue::IsCustomFlag1 | ( | ) | [inline, virtual] |
Definition at line 352 of file Value.h.
References ValueFlags::CustomFlag1.
virtual bool CValue::IsCustomFlag2 | ( | ) | [inline, virtual] |
Definition at line 355 of file Value.h.
References ValueFlags::CustomFlag2.
bool CValue::IsError | ( | ) | [inline] |
Definition at line 346 of file Value.h.
References ValueFlags::Error.
Referenced by SCA_PropertySensor::CheckPropertyCondition(), CParser::GetValue(), SCA_PropertySensor::SCA_PropertySensor(), and SCA_ExpressionController::Trigger().
virtual bool CValue::IsModified | ( | ) | [inline, virtual] |
Reimplemented in CListValue.
Definition at line 345 of file Value.h.
References ValueFlags::Modified.
Referenced by CListValue::IsModified().
bool CValue::IsReleaseRequested | ( | ) | [inline] |
Definition at line 349 of file Value.h.
References ValueFlags::ReleaseRequested.
Referenced by CConstExpr::CheckLink().
virtual bool CValue::IsSelected | ( | ) | [inline, virtual] |
Definition at line 348 of file Value.h.
References ValueFlags::Selected.
virtual bool CValue::IsVisible | ( | ) | [inline, virtual] |
Definition at line 350 of file Value.h.
References ValueFlags::Visible.
STR_String CValue::op2str | ( | VALUE_OPERATOR | op | ) |
Definition at line 146 of file Value.cpp.
References VALUE_ADD_OPERATOR, VALUE_AND_OPERATOR, VALUE_DIV_OPERATOR, VALUE_EQL_OPERATOR, VALUE_MOD_OPERATOR, VALUE_MUL_OPERATOR, VALUE_NEG_OPERATOR, VALUE_NEQ_OPERATOR, VALUE_NOT_OPERATOR, VALUE_OR_OPERATOR, VALUE_POS_OPERATOR, and VALUE_SUB_OPERATOR.
Referenced by CIntValue::Calc(), CBoolValue::Calc(), CFloatValue::Calc(), CErrorValue::Calc(), CBoolValue::CalcFinal(), CStringValue::CalcFinal(), CFloatValue::CalcFinal(), CVectorValue::CalcFinal(), CIntValue::CalcFinal(), and CErrorValue::CalcFinal().
void CValue::ProcessReplica | ( | ) | [virtual] |
Makes sure any internal data owned by this class is deep copied.
Reimplemented from PyObjectPlus.
Reimplemented in BL_ActionActuator, BL_ArmatureActuator, BL_ArmatureObject, BL_DeformableGameObject, BL_ShapeActionActuator, SCA_IActuator, SCA_ISensor, SCA_PropertyActuator, SCA_RandomActuator, SCA_RandomSensor, KX_Camera, KX_CameraActuator, KX_FontObject, KX_GameObject, KX_NavMeshObject, KX_NearSensor, KX_ObjectActuator, KX_ParentActuator, KX_SCA_AddObjectActuator, KX_SceneActuator, KX_SoundActuator, KX_SteeringActuator, KX_TouchSensor, and KX_TrackToActuator.
Definition at line 470 of file Value.cpp.
References NULL, ValueFlags::RefCountDisabled, Release(), SetProperty(), and simple_enum_gen::val.
Referenced by CListValue::GetReplica(), SCA_ANDController::GetReplica(), SCA_NORController::GetReplica(), SCA_XNORController::GetReplica(), SCA_PythonController::GetReplica(), CEmptyValue::GetReplica(), SCA_ORController::GetReplica(), SCA_RandomSensor::GetReplica(), SCA_ExpressionController::GetReplica(), CBoolValue::GetReplica(), CStringValue::GetReplica(), CIntValue::GetReplica(), CVectorValue::GetReplica(), SCA_DelaySensor::GetReplica(), SCA_NANDController::GetReplica(), KX_NetworkMessageSensor::GetReplica(), SCA_AlwaysSensor::GetReplica(), CFloatValue::GetReplica(), SCA_XORController::GetReplica(), and KX_MouseFocusSensor::GetReplica().
int CValue::Release | ( | ) | [inline] |
Definition at line 272 of file Value.h.
Referenced by KX_Scene::AddReplicaObject(), GPC_RenderTools::applyTransform(), KX_BlenderRenderTools::applyTransform(), BL_ConvertActuators(), BL_ConvertBlenderObjects(), BL_ConvertControllers(), BL_ConvertProperties(), BL_ConvertSensors(), BL_ConvertTextProperty(), KX_TouchSensor::BroadPhaseSensorFilterCollision(), SCA_ILogicBrick::Calc(), SCA_ILogicBrick::CalcFinal(), CIfExpr::Calculate(), COperator1Expr::Calculate(), COperator2Expr::Calculate(), CListValue::CheckEqual(), SCA_PropertySensor::CheckPropertyCondition(), ClearProperties(), SCA_ExpressionController::Delete(), SCA_PropertySensor::Delete(), SCA_ILogicBrick::Delete(), KX_Scene::DupliGroupRecurse(), KX_NetworkMessageSensor::Evaluate(), KX_RaySensor::Evaluate(), CParser::GetFloat(), CParser::GetValue(), KX_SCA_AddObjectActuator::InstantAddObject(), KX_SceneReplicationFunc(), KX_TrackToActuator::KX_TrackToActuator(), KX_Scene::LogicEndFrame(), KX_Scene::NewRemoveObject(), SCA_TimeEventManager::NextFrame(), KX_KetsjiEngine::PostProcessScene(), ProcessReplica(), SCA_ILogicBrick::RegisterEvent(), CListValue::ReleaseAndRemoveAll(), SCA_ILogicBrick::RemoveEvent(), RemoveProperty(), SCA_TimeEventManager::RemoveTimeProperty(), KX_Scene::ReplaceMesh(), SCA_PropertySensor::SCA_PropertySensor(), CParser::SetContext(), KX_GameObject::SetParent(), SetProperty(), SCA_ExpressionController::Trigger(), BL_ActionActuator::Update(), KX_ConstraintActuator::Update(), BL_ShapeActionActuator::Update(), KX_IpoActuator::Update(), SCA_PropertyActuator::Update(), SCA_RandomActuator::Update(), BL_SkinDeformer::~BL_SkinDeformer(), CConstExpr::~CConstExpr(), CIdentifierExpr::~CIdentifierExpr(), COperator2Expr::~COperator2Expr(), CParser::~CParser(), ImageRender::~ImageRender(), KX_Scene::~KX_Scene(), KX_TouchSensor::~KX_TouchSensor(), and SCA_DebugProp::~SCA_DebugProp().
bool CValue::RemoveProperty | ( | const char * | inName | ) | [virtual] |
virtual void CValue::SetAffected | ( | bool | bAffected = true | ) | [inline, virtual] |
Definition at line 340 of file Value.h.
References ValueFlags::Affected.
Referenced by CConstExpr::ClearModified().
void CValue::SetColorOperator | ( | VALUE_OPERATOR | op | ) | [virtual] |
Set the wireframe color of this value depending on the CSG operator type <op>
Definition at line 632 of file Value.cpp.
Referenced by CConstExpr::BroadcastOperators().
virtual void CValue::SetCustomFlag1 | ( | bool | bCustomFlag | ) | [inline, virtual] |
Definition at line 351 of file Value.h.
References ValueFlags::CustomFlag1.
Referenced by CVectorValue::CVectorValue().
virtual void CValue::SetCustomFlag2 | ( | bool | bCustomFlag | ) | [inline, virtual] |
Definition at line 354 of file Value.h.
References ValueFlags::CustomFlag2.
void CValue::SetError | ( | bool | err | ) | [inline] |
Definition at line 342 of file Value.h.
References err, and ValueFlags::Error.
Referenced by CErrorValue::CErrorValue().
virtual void CValue::SetModified | ( | bool | bModified | ) | [inline, virtual] |
Reimplemented in CListValue.
Definition at line 339 of file Value.h.
References ValueFlags::Modified.
Referenced by CEmptyValue::CEmptyValue(), CConstExpr::ClearModified(), CFloatValue::SetFloat(), CListValue::SetModified(), CBoolValue::SetValue(), CVectorValue::SetValue(), CFloatValue::SetValue(), CStringValue::SetValue(), CIntValue::SetValue(), and CVectorValue::SetVector().
virtual void CValue::SetName | ( | const char * | name | ) | [pure virtual] |
Implemented in CPropValue, SCA_ILogicBrick, and KX_GameObject.
Referenced by CVectorValue::CalcFinal().
void CValue::SetOwnerExpression | ( | class CExpression * | expr | ) | [virtual] |
Definition at line 627 of file Value.cpp.
Referenced by COperator2Expr::Calculate().
void CValue::SetPropertiesModified | ( | bool | inModified | ) | [virtual] |
void CValue::SetProperty | ( | const STR_String & | name, |
CValue * | ioProperty | ||
) | [virtual] |
Property Management.
Definition at line 210 of file Value.cpp.
References AddRef(), NULL, Release(), and trace.
Referenced by KX_Scene::AddReplicaObject(), BL_ConvertProperties(), BL_ConvertTextProperty(), ProcessReplica(), SCA_PropertyActuator::Update(), KX_IpoActuator::Update(), BL_ShapeActionActuator::Update(), and BL_ActionActuator::Update().
void CValue::SetProperty | ( | const char * | name, |
CValue * | ioProperty | ||
) | [virtual] |
void CValue::SetReleaseRequested | ( | bool | bReleaseRequested | ) | [inline] |
Definition at line 341 of file Value.h.
References ValueFlags::ReleaseRequested.
void CValue::SetSelected | ( | bool | bSelected | ) | [inline] |
Definition at line 338 of file Value.h.
References ValueFlags::Selected.
void CValue::SetValue | ( | CValue * | newval | ) | [virtual] |
Sets the value to this cvalue.
Reimplemented in CBoolValue, CFloatValue, CIntValue, CStringValue, and CVectorValue.
Definition at line 636 of file Value.cpp.
References assertd, and GetNumber().
Referenced by BL_ConvertTextProperty(), SCA_RandomActuator::Update(), SCA_PropertyActuator::Update(), KX_IpoActuator::Update(), BL_ShapeActionActuator::Update(), and BL_ActionActuator::Update().
void CValue::SetVisible | ( | bool | vis | ) | [inline] |
Definition at line 343 of file Value.h.
References ValueFlags::Visible.
double* CValue::ZeroVector | ( | ) | [inline] |
Definition at line 322 of file Value.h.
Referenced by CEmptyValue::GetVector3().