Public Member Functions
StaticSource Class Reference

## Detailed Description

The StaticSource object represents a constant value stored as an AnimationSourceItem. When instantiated, the parameter value takes on the value of the StaticSource. A static pose is a kind of a StaticSource.

This object can be one of the AnimationSourceItem objects in an ActionSource.

See also:
  AnimationSourceItem::GetSource, AnimationSourceItem::SetAsStatic, ActionSource::AddSourceItem

Since:
  4.0

Example:
  This example illustrates creating a source and accessing the source items contained in it.

            using namespace XSI;

            Application app;
            Model root = app.GetActiveSceneRoot();

            X3DObject myCube;
            root.AddGeometry( L"Cube", L"MeshSurface", L"", myCube );

            // Create the first animation source
            CValueArray args(9);
            CValue      outArg;
            args[0] = root;
            args[1] = L"cube.kine.local.posx,cube.kine.local.posy,cube.kine.local.posz";
            args[3] = L"StoredStaticPose";
            args[4] = true;
            args[7] = false;
            args[8] = false;
            app.ExecuteCommand( L"StoreAction", args, outArg );

            ActionSource mySource(outArg);
            CRefArray aSourceItems = mySource.GetItems();

            for ( LONG i=0; i<aSourceItems.GetCount(); ++i ) {
                AnimationSourceItem currItem(aSourceItems[i]);
                app.LogMessage( L" The animated target is " + currItem.GetTarget() );
                app.LogMessage( L" The type of animation is " + currItem.GetType() );

                // In this case it's a static value you can switch on type.
                StaticSource myVal = currItem.GetSource();
                app.LogMessage( L" The value is " + myVal.GetValue().GetAsText() );
            }

`#include <xsi_staticsource.h>`

Inheritance diagram for StaticSource:
[legend]

List of all members.

## Public Member Functions
| StaticSource ()
| ~StaticSource ()
| StaticSource (const CRef &in_ref)
| StaticSource (const StaticSource &in_obj)
bool | IsA (siClassID in_ClassID) const
siClassID | GetClassID () const
StaticSource & | operator= (const StaticSource &in_obj)
StaticSource & | operator= (const CRef &in_ref)
CValue | GetValue () const
CStatus | PutValue (const CValue &in_val)

## Constructor & Destructor Documentation

StaticSource | ( |  | ) |

Default constructor.

~StaticSource | ( |  | ) |

Default destructor.

StaticSource | ( | const CRef & | in_ref | ) |

Constructor.

Parameters:

  in_ref | constant reference object.

StaticSource | ( | const StaticSource & | in_obj | ) |

Copy constructor.

Parameters:

  in_obj | constant class object.

## Member Function Documentation

bool IsA | ( | siClassID | in_ClassID | ) | const`[virtual]`

Returns true if a given class type is compatible with this API class.

Parameters:

  in_ClassID | class type.

Returns:
  true if the class is compatible, false otherwise.

Reimplemented from SIObject.

siClassID GetClassID | ( |  | ) | const`[virtual]`

Returns the type of the API class.

Returns:
  The class type.

Reimplemented from SIObject.

StaticSource& operator= | ( | const StaticSource & | in_obj | ) |

Creates an object from another object. The newly created object is set to empty if the input object is not compatible.

Parameters:

  in_obj | constant class object.

Returns:
  The new StaticSource object.

StaticSource& operator= | ( | const CRef & | in_ref | ) |

Creates an object from a reference object. The newly created object is set to empty if the input reference object is not compatible.

Parameters:

  in_ref | constant class object.

Returns:
  The new StaticSource object.

Reimplemented from SIObject.

CValue GetValue | ( |  | ) | const

Returns a value which is used as a constant value for the corresponding AnimationSourceItem.

Returns:
  Constant value for an animation source.

CStatus PutValue | ( | const CValue & | in_val | ) |

Sets a value which is used as a constant value for the corresponding AnimationSourceItem.

Parameters:

  in_val | New value for this animation SourceItem.

Returns:
  CStatus::OK success
  CStatus::Fail failure

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

- xsi_staticsource.h