Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
-
li haoran
- Posts: 8
- Joined: Mon Apr 16, 2018 12:59 am
Post
by li haoran » Mon Aug 13, 2018 7:00 pm
Hello everyone!
I want to use the applyForceToPoint() function in the OpenSim::Force class. First I override the virtual functions clone() and getConcreteClassName() in the Force class. However, when I instantiate the object, the program reports an error saying that clone() and getConcreteClassName() are not overridden. Here is the partial code:
Code: Select all
class TugOfWarAddForce :public OpenSim::Force {
OpenSim_DECLARE_ABSTRACT_OBJECT(TugOfWarAddForce, OpenSim::Force);
public:
Object * clone()
{}
const std::string& getConcreteClassName()
{}
...
};
int main()
{
....
TugOfWarAddForce MyForce = new TugOfWarAddForce();
...
}
Tags:
-
Thomas Uchida
- Posts: 1793
- Joined: Wed May 16, 2012 11:40 am
Post
by Thomas Uchida » Mon Aug 13, 2018 8:50 pm
I want to use the applyForceToPoint() function in the OpenSim::Force class.
OpenSim::Force is an abstract class and thus cannot be instantiated. Perhaps you can use a class that derives from Force (see the inheritance diagram here:
https://simtk.org/api_docs/opensim/api_ ... Force.html). There may also be some examples you could look at, depending on what you're trying to do.