Skip to content

Commit e840875

Browse files
committed
Provide MATLAB scripting friendly extension that enables selection of ForceLocation as an unsigned int.
1 parent 9242a41 commit e840875

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

Bindings/common.i

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,27 @@ namespace OpenSim {
382382
%include <OpenSim/Common/CSVFileAdapter.h>
383383
%include <OpenSim/Common/C3DFileAdapter.h>
384384

385+
%extend OpenSim::C3DFileAdapter {
386+
Tables read(const std::string& fileName, unsigned int wrt) {
387+
C3DFileAdapter::ForceLocation location;
388+
switch(wrt) {
389+
case 0:
390+
location = C3DFileAdapter::ForceLocation::OriginOfForcePlate;
391+
break;
392+
case 1:
393+
location = C3DFileAdapter::ForceLocation::CenterOfPressure;
394+
break;
395+
case 2:
396+
location = C3DFileAdapter::ForceLocation::PointOfWrenchApplication;
397+
break;
398+
default:
399+
throw OpenSim::Exception{
400+
"An invalid C3DFileAdapter::ForceLocation was provided."};
401+
}
402+
return C3DFileAdapter::read(fileName, location);
403+
};
404+
};
405+
385406
namespace OpenSim {
386407
%ignore TableSource_::TableSource_(TableSource_ &&);
387408
}

0 commit comments

Comments
 (0)