OpenClonk
C4ValueProviderR Class Reference

#include <C4MeshAnimation.h>

Inheritance diagram for C4ValueProviderR:
[legend]
Collaboration diagram for C4ValueProviderR:
[legend]

Public Member Functions

 C4ValueProviderR ()
 
 C4ValueProviderR (C4Object *object, C4Real begin, C4Real end)
 
bool Execute () override
 
void CompileFunc (StdCompiler *pComp) override
 
void DenumeratePointers () override
 
void ClearPointers (C4Object *pObj) override
 

Static Public Member Functions

static const IDBaseLookup (const char *name)
 
static const IDBaseLookup (const std::type_info &type)
 

Public Attributes

C4Real Value
 

Detailed Description

Definition at line 114 of file C4MeshAnimation.h.

Constructor & Destructor Documentation

◆ C4ValueProviderR() [1/2]

C4ValueProviderR::C4ValueProviderR ( )
inline

Definition at line 117 of file C4MeshAnimation.h.

117 : Object(nullptr), Begin(Fix0), End(Fix0) {}
const C4Real Fix0
Definition: C4Real.h:312

◆ C4ValueProviderR() [2/2]

C4ValueProviderR::C4ValueProviderR ( C4Object object,
C4Real  begin,
C4Real  end 
)

Definition at line 304 of file C4MeshAnimation.cpp.

304  :
305  Object(object), Begin(begin), End(end)
306 {
307  Execute();
308 }
bool Execute() override

References Execute().

Here is the call graph for this function:

Member Function Documentation

◆ ClearPointers()

void C4ValueProviderR::ClearPointers ( C4Object pObj)
inlineoverridevirtual

Reimplemented from StdMeshInstance::SerializableValueProvider.

Definition at line 123 of file C4MeshAnimation.h.

123 { if(Object == pObj) Object = nullptr; }

◆ CompileFunc()

void C4ValueProviderR::CompileFunc ( StdCompiler pComp)
overridevirtual

Reimplemented from StdMeshInstance::SerializableValueProvider.

Definition at line 322 of file C4MeshAnimation.cpp.

323 {
325  pComp->Separator();
326  pComp->Value(Object);
327  pComp->Separator();
328  pComp->Value(Begin);
329  pComp->Separator();
330  pComp->Value(End);
331 }
void CompileFunc(C4Real &rValue, StdCompiler *pComp)
Definition: C4Real.cpp:9033
virtual bool Separator(Sep eSep=SEP_SEP)
Definition: StdCompiler.h:119
void Value(const T &rStruct)
Definition: StdCompiler.h:161

References CompileFunc(), StdCompiler::Separator(), and StdCompiler::Value().

Here is the call graph for this function:

◆ DenumeratePointers()

void C4ValueProviderR::DenumeratePointers ( )
inlineoverridevirtual

Reimplemented from StdMeshInstance::SerializableValueProvider.

Definition at line 122 of file C4MeshAnimation.h.

122 { Object.DenumeratePointers(); }
void DenumeratePointers()
Definition: C4ObjectPtr.cpp:49

References C4ObjectPtr::DenumeratePointers().

Here is the call graph for this function:

◆ Execute()

bool C4ValueProviderR::Execute ( )
overridevirtual

Implements StdMeshInstanceValueProvider.

Definition at line 310 of file C4MeshAnimation.cpp.

311 {
312  // Object might have been removed
313  if(!Object) return false;
314 
315  C4Real r = Object->fix_r;
316  if(r < 0) r += 360;
317 
318  Value = Begin + (End - Begin) * r / 360;
319  return true;
320 }
Definition: C4Real.h:59
C4Real fix_r
Definition: C4Object.h:123

References C4Object::fix_r, and StdMeshInstanceValueProvider::Value.

Referenced by C4ValueProviderR().

Here is the caller graph for this function:

◆ Lookup() [1/2]

static const IDBase* StdMeshInstance::SerializableValueProvider::Lookup ( const char *  name)
inlinestaticinherited

Definition at line 460 of file StdMesh.h.

461  {
462  if(!IDs) return nullptr;
463  for(auto & ID : *IDs)
464  if(strcmp(ID->name, name) == 0)
465  return ID;
466  return nullptr;
467  }

References StdMeshInstance::SerializableValueProvider::IDBase::name.

◆ Lookup() [2/2]

static const IDBase* StdMeshInstance::SerializableValueProvider::Lookup ( const std::type_info &  type)
inlinestaticinherited

Definition at line 469 of file StdMesh.h.

470  {
471  if(!IDs) return nullptr;
472  for(auto & ID : *IDs)
473  if(ID->type == type)
474  return ID;
475  return nullptr;
476  }

References StdMeshInstance::SerializableValueProvider::IDBase::type.

Member Data Documentation

◆ Value


The documentation for this class was generated from the following files: