MULTIBODY SIMULATION SOFTWARE - API documentation

chrono::ChFunction_Sequence Class Reference

#include <CHfunction.h>

Inheritance diagram for chrono::ChFunction_Sequence:

Inheritance graph
[legend]
Collaboration diagram for chrono::ChFunction_Sequence:

Collaboration graph
[legend]

List of all members.

Public Member Functions

void Copy (ChFunction_Sequence *source)
ChFunctionnew_Duplicate ()
int Get_Type ()
void Set_start (double m_start)
double Get_start ()
ChList< ChFseqNode > * Get_list ()
void Setup ()
int InsertFunct (ChFunction *myfx, double duration, double weight, bool c0, bool c1, bool c2, int position)
int KillFunct (int position)
ChFunctionGetNthFunction (int position)
ChFseqNodeGetNthNode (int position)
double GetNthDuration (int position)
double Get_y (double x)
double Get_y_dx (double x)
double Get_y_dxdx (double x)
double Get_weight (double x)
void Extimate_x_range (double &xmin, double &xmax)
int MakeOptVariableTree (ChList< chjs_propdata > *mtree)
int HandleNumber ()
int HandleAccess (int handle_id, double mx, double my, bool set_mode)
void StreamOUT (ChStreamOutAscii &mstream)
void StreamIN (ChStreamInBinary &mstream)
void StreamOUT (ChStreamOutBinary &mstream)


Detailed Description

SEQUENCE FUNCTION: y = sequence_of_functions(f1(y), f2(y), f3(y)) All other function types can be inserted into this. This function is very important because very complex motion laws can be created by sequencing many basic ChFunctions.

Member Function Documentation

int chrono::ChFunction_Sequence::Get_Type (  )  [virtual]

Each class inherited from the ChFunction class must return an unique integer identifier with the virtual function Get_type(). This is useful for run-time downcasting etc.

Reimplemented from chrono::ChFunction.

void chrono::ChFunction_Sequence::Set_start ( double  m_start  ) 

The sequence of functions starts at this x value.

ChList<ChFseqNode>* chrono::ChFunction_Sequence::Get_list (  ) 

Access the list of the sub-functions.

void chrono::ChFunction_Sequence::Setup (  ) 

Scans all the seq.of functions and setup the timings and continuity offsets, to satisfy all constraints. This must be called whenever a new function is inserted, or its timing and continuity constraints are changed.

int chrono::ChFunction_Sequence::InsertFunct ( ChFunction myfx,
double  duration,
double  weight,
bool  c0,
bool  c1,
bool  c2,
int  position 
)

Insert function after the fx with defined "position" index in list.

int chrono::ChFunction_Sequence::KillFunct ( int  position  ) 

Remove and deletes function with defined "position", and returns TRUE.

If position = -1 removes tail (end).

ChFunction * chrono::ChFunction_Sequence::GetNthFunction ( int  position  ) 

Returns the ChFunction with given "position".

ChFseqNode * chrono::ChFunction_Sequence::GetNthNode ( int  position  ) 

As above, but returns the function node (containing function pointer, function duration, continuity flags with previous node, etc.)

double chrono::ChFunction_Sequence::GetNthDuration ( int  position  ) 

As above, but returning duration. (return value is reference, so it can be also changed later, but remember Setup() for the ChFunction_Sequence after you modified this return value by reference ***TO DO***). If no function, returns 0.

double chrono::ChFunction_Sequence::Get_y ( double  x  )  [virtual]

Returns the y value of the function, at position x. (For this base class, it will be a constant value y=C).

Reimplemented from chrono::ChFunction.

double chrono::ChFunction_Sequence::Get_y_dx ( double  x  )  [virtual]

Returns the dy/dx derivative of the function, at position x. Note that inherited classes may also avoid overriding this method, because this base method already provide a general-purpose numerical differentiation to get dy/dx only from the Get_y() function. (however, if the analytical derivative is known, it may better to implement a custom method).

Reimplemented from chrono::ChFunction.

double chrono::ChFunction_Sequence::Get_y_dxdx ( double  x  )  [virtual]

Returns the ddy/dxdx double derivative of the function, at position x. Note that inherited classes may also avoid overriding this method, because this base method already provide a general-purpose numerical differentiation to get ddy/dxdx only from the Get_y() function. (however, if the analytical derivative is known, it may be better to implement a custom method).

Reimplemented from chrono::ChFunction.

double chrono::ChFunction_Sequence::Get_weight ( double  x  )  [virtual]

Returns the weight of the function (useful for applications where you need to mix different weighted ChFunctions)

Reimplemented from chrono::ChFunction.

void chrono::ChFunction_Sequence::Extimate_x_range ( double &  xmin,
double &  xmax 
) [virtual]

These functions can be used to implement automatic zooming on the most representative range of function (if GUI is implemented)

Reimplemented from chrono::ChFunction.

int chrono::ChFunction_Sequence::HandleNumber (  )  [virtual]

If the function has some handles (mouse-sensible markers on screen), implement these functions:

Reimplemented from chrono::ChFunction.

int chrono::ChFunction_Sequence::HandleAccess ( int  handle_id,
double  mx,
double  my,
bool  set_mode 
) [virtual]

Gets the x and y position of handle, given identifier. If set mode, x and y values are stored. Return false if handle not found.

Reimplemented from chrono::ChFunction.

void chrono::ChFunction_Sequence::StreamOUT ( ChStreamOutAscii mstream  )  [virtual]

Method to allow serialization of transient data in ascii, as a readable item, for example "chrono::GetLog() << myobject;"

Reimplemented from chrono::ChFunction.

void chrono::ChFunction_Sequence::StreamIN ( ChStreamInBinary mstream  )  [virtual]

Method to allow deserializing a persistent binary archive (ex: a file) into transient data.

Reimplemented from chrono::ChFunction.

void chrono::ChFunction_Sequence::StreamOUT ( ChStreamOutBinary mstream  )  [virtual]

Method to allow serializing transient data into a persistent binary archive (ex: a file).

Reimplemented from chrono::ChFunction.


CHRONO::ENGINE
C++ library for multibody simulation, (C) Alessandro Tasora
This API documentation has been generated on 17 Jul 2009 by Doxygen