An abstract class for specifying the interface for an investigation. More...
#include <PerturbationTool.h>
Public Member Functions | |
PerturbationTool () | |
Default constructor. | |
PerturbationTool (const std::string &aFileName, bool aUpdateFromXMLNode=true, bool aLoadModel=true) | |
virtual | ~PerturbationTool () |
Destructor. | |
PerturbationTool (const PerturbationTool &aObject) | |
Copy constructor. | |
virtual Object * | copy () const |
Virtual copy constructor. | |
PerturbationTool & | operator= (const PerturbationTool &aPerturbationTool) |
Assignment operator. | |
virtual void | updateFromXMLNode () |
Override default implementation by object to intercept and fix the XML node underneath the tool to match current version. | |
virtual bool | run () SWIG_DECLARE_EXCEPTION |
Run the investigation. | |
virtual void | printResults (const std::string &aBaseName, const std::string &aDir="", double aDT=-1.0, const std::string &aExtension=".sto") |
Print the results of the analysis. |
An abstract class for specifying the interface for an investigation.
PerturbationTool::PerturbationTool | ( | ) |
Default constructor.
OpenSim::PerturbationTool::PerturbationTool | ( | const std::string & | aFileName, | |
bool | aUpdateFromXMLNode = true , |
|||
bool | aLoadModel = true | |||
) |
PerturbationTool::~PerturbationTool | ( | ) | [virtual] |
Destructor.
PerturbationTool::PerturbationTool | ( | const PerturbationTool & | aTool | ) |
Copy constructor.
Copy constructors for all Tools only copy the non-XML variable members of the object; that is, the object's DOMnode and XMLDocument are not copied but set to NULL. The reason for this is that for the object and all its derived classes to establish the correct connection to the XML document nodes, the the object would need to reconstruct based on the XML document not the values of the object's member variables.
There are three proper ways to generate an XML document for an Tool:
1) Construction based on XML file (
2) Construction by Tool(const XMLDocument *aDocument). This constructor explictly requests construction based on an XML document. In this way the proper connection between an object's node and the corresponding node within the XML document is established. This constructor is a copy constructor of sorts because all essential Tool member variables should be held within the XML document. The advantage of this style of construction is that nodes within the XML document, such as comments that may not have any associated Tool member variable, are preserved.
3) A call to generateXMLDocument(). This method generates an XML document for the Tool from scratch. Only the essential document nodes are created (that is, nodes that correspond directly to member variables.).
aTool | Object to be copied. |
Object * PerturbationTool::copy | ( | ) | const [virtual] |
Virtual copy constructor.
Reimplemented from OpenSim::ForwardTool.
PerturbationTool & PerturbationTool::operator= | ( | const PerturbationTool & | aTool | ) |
virtual void OpenSim::PerturbationTool::printResults | ( | const std::string & | aBaseName, | |
const std::string & | aDir = "" , |
|||
double | aDT = -1.0 , |
|||
const std::string & | aExtension = ".sto" | |||
) | [virtual] |
Print the results of the analysis.
aFileName | File to which to print the data. | |
aDT | Time interval between results (linear interpolation is used). If not included as an argument or negative, all time steps are printed without interpolation. | |
aExtension | Extension for written files. |
Reimplemented from OpenSim::AbstractTool.
bool PerturbationTool::run | ( | ) | [virtual] |
Run the investigation.
Reimplemented from OpenSim::ForwardTool.
virtual void OpenSim::PerturbationTool::updateFromXMLNode | ( | ) | [inline, virtual] |
Override default implementation by object to intercept and fix the XML node underneath the tool to match current version.
Reimplemented from OpenSim::ForwardTool.