#include <MobilizedBody.h>
To use it, create a class that extends MobilizedBody::Custom::Implementation. You can then create an instance of it and pass it to the MobilizedBody::Custom constructor:
MobilizedBody::Custom myMobilizedBody(new MyMobilizedBodyImplementation(args));
Alternatively, you can also create a new Handle class which is a subclass of MobilizedBody::Custom and which creates the Implementation itself in its constructors.
class MyMobilizedBody : public MobilizedBody::Custom { public: MyMobilizedBody(args) : MobilizedBody::Custom(new MyForceImplementation(args)) { } }
This allows an end user to simply write
MyMobilizedBody(args);
and not worry about implementation classes or creating objects on the heap. If you do this, your MobilizedBody::Custom subclass must not have any data members or virtual methods. If it does, it will not work correctly. Instead, store all data in the Implementation subclass.
Public Member Functions | |
Custom (MobilizedBody &parent, Implementation *implementation, const Body &body) | |
Custom (MobilizedBody &parent, Implementation *implementation, const Transform &inbFrame, const Body &body, const Transform &outbFrame) | |
SimTK_INSERT_DERIVED_HANDLE_DECLARATIONS (Custom, CustomImpl, MobilizedBody) | |
Protected Member Functions | |
const Implementation & | getImplementation () const |
Implementation & | updImplementation () |
Classes | |
class | Implementation |
Custom | ( | MobilizedBody & | parent, | |
Implementation * | implementation, | |||
const Body & | body | |||
) | [explicit] |
Custom | ( | MobilizedBody & | parent, | |
Implementation * | implementation, | |||
const Transform & | inbFrame, | |||
const Body & | body, | |||
const Transform & | outbFrame | |||
) | [explicit] |
SimTK_INSERT_DERIVED_HANDLE_DECLARATIONS | ( | Custom | , | |
CustomImpl | , | |||
MobilizedBody | ||||
) |
const Implementation& getImplementation | ( | ) | const [protected] |
Implementation& updImplementation | ( | ) | [protected] |