本文整理汇总了C++中opensim::Body::getName方法的典型用法代码示例。如果您正苦于以下问题:C++ Body::getName方法的具体用法?C++ Body::getName怎么用?C++ Body::getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类opensim::Body
的用法示例。
在下文中一共展示了Body::getName方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Constraint
PointConstraint::PointConstraint(const OpenSim::Body& body1,
const SimTK::Vec3& locationBody1,
const OpenSim::Body& body2,
const SimTK::Vec3& locationBody2) : Constraint()
{
setNull();
constructProperties();
set_body_1(body1.getName());
set_location_body_1(locationBody1);
set_body_2(body2.getName());
set_location_body_2(locationBody2);
}
示例2: Constraint
WeldConstraint::WeldConstraint(const std::string &name, OpenSim::Body& body1, SimTK::Transform transformInBody1,
OpenSim::Body& body2, SimTK::Transform transformInBody2) : Constraint()
{
constructProperties();
setName(name);
_body1 = &body1;
_body2 = &body2;
set_body_1(body1.getName());
set_body_2(body2.getName());
set_location_body_1(transformInBody1.p());
set_orientation_body_1(transformInBody1.R().convertRotationToBodyFixedXYZ());
set_location_body_2(transformInBody2.p());
set_orientation_body_2(transformInBody2.R().convertRotationToBodyFixedXYZ());
}
示例3: Super
/**
* API constructor.
*/
Joint::Joint(const std::string &name,
const OpenSim::Body& parent,
const SimTK::Vec3& locationInParent, const SimTK::Vec3& orientationInParent,
const OpenSim::Body& child,
const SimTK::Vec3& locationInChild, const SimTK::Vec3& orientationInChild,
bool reverse) : Super()
{
setNull();
constructInfrastructure();
set_location_in_parent(locationInParent);
set_orientation_in_parent(orientationInParent);
set_location_in_child(locationInChild);
set_orientation_in_child(orientationInChild);
set_reverse(reverse);
updConnector<Body>("parent_body").set_connected_to_name(parent.getName());
updConnector<Body>("child_body").set_connected_to_name(child.getName());
setName(name);
}
示例4: writeWrapObjects
/**
* Write a body's wrap objects to a SIMM joint file.
*
* @param aBody reference to the body to write.
* @param aStream the stream (file) to write to.
*/
void SimbodySimmModel::writeWrapObjects(OpenSim::Body& aBody, ofstream& aStream) const
{
int i;
const WrapObjectSet& wrapObjects = aBody.getWrapObjectSet();
for (i = 0; i < wrapObjects.getSize(); i++) {
WrapObject& wo = wrapObjects.get(i);
aStream << "beginwrapobject " << wo.getName() << endl;
aStream << "wraptype " << wo.getWrapTypeName() << endl;
aStream << "segment " << aBody.getName() << endl;
aStream << wo.getDimensionsString() << endl;
if (!wo.getQuadrantNameUseDefault())
aStream << "quadrant " << wo.get_quadrant() << endl;
if (!wo.getActiveUseDefault())
aStream << "active " << (wo.get_active() ? "yes" : "no") << endl;
aStream << "translation " << wo.get_translation()[0] << " " <<
wo.get_translation()[1] << " " << wo.get_translation()[2] << endl;
aStream << "xyz_body_rotation " << wo.get_xyz_body_rotation()[0] * SimTK_RADIAN_TO_DEGREE <<
" " << wo.get_xyz_body_rotation()[1] * SimTK_RADIAN_TO_DEGREE <<
" " << wo.get_xyz_body_rotation()[2] * SimTK_RADIAN_TO_DEGREE << endl;
aStream << "endwrapobject" << endl << endl;
}
}
示例5: createLuxoJr
//.........这里部分代码省略.........
SimTK::Transform pelvis_anterior_shift(
anterior_superior_pelvis_pin_location);
PhysicalOffsetFrame anterior_hip_on_Hlink(
"anterior_hip_on_Hlink",
*leg_Hlink, Transform(superior_Hlink_hinge_location));
PhysicalOffsetFrame anterior_hip_on_pelvis(
"anterior_hip_on_pelvis",
*pelvisBracket, pelvis_anterior_shift);
OpenSim::PinJoint* anteriorHip = new OpenSim::PinJoint("anterior_hip",
anterior_hip_on_Hlink,
anterior_hip_on_pelvis);
anteriorHip->append_frames(anterior_hip_on_Hlink);
anteriorHip->append_frames(anterior_hip_on_pelvis);
// add anterior leg to model
model.addBody(pelvisBracket); model.addJoint(anteriorHip);
// since the previous, anterior knee joint drives the pose of the lower
// 4-bar linkage, set the anterior hip angle such that it's free to satisfy
// constraints that couple it to the 4-bar linkage.
anteriorHip->upd_CoordinateSet()[0]
.set_is_free_to_satisfy_constraints(true);
// Close the loop for the lower, four-bar linkage with a constraint
//------------------------------------------------------------------
// Create and configure point on line constraint
OpenSim::PointOnLineConstraint* posteriorHip =
new OpenSim::PointOnLineConstraint();
posteriorHip->setLineBodyByName(pelvisBracket->getName());
posteriorHip->setLineDirection(Vec3(0.0,0.0,1.0));
posteriorHip->setPointOnLine(inferior_pelvis_pin_location);
posteriorHip->setFollowerBodyByName(posteriorLegBar->getName());
posteriorHip->setPointOnFollower(superior_bar_hinge_location);
// add constraint to model
model.addConstraint(posteriorHip);
// Create chest piece
//-----------------------
OpenSim::Body* chest = new OpenSim::Body("chest_bar", bar_mass,
Vec3(0.0),
Inertia::brick(torso_bar_dimensions/2.0));
chest->attachMeshGeometry("Anterior_torso_bar.obj");
PhysicalOffsetFrame anterior_torso_hinge_on_pelvis(
"anterior_torso_hinge_on_pelvis",
*pelvisBracket, Transform(anterior_superior_pelvis_pin_location) );
PhysicalOffsetFrame anterior_torso_hinge_on_chest(
"anterior_torso_hinge_on_chest",
*chest, Transform(inferior_torso_hinge_location) );
// Attach chest piece to pelvice with pin joint
OpenSim::PinJoint* anteriorTorsoHinge = new OpenSim::PinJoint(
"anterior_torso_hinge",
anterior_torso_hinge_on_pelvis,
anterior_torso_hinge_on_chest);
anteriorTorsoHinge->append_frames(anterior_torso_hinge_on_pelvis);
anteriorTorsoHinge->append_frames(anterior_torso_hinge_on_chest);
示例6: addBody
/**
* Add a body to the SIMM model.
*
* @param aBody The Simbody body that the SimbodySimmBody is based on.
*/
void SimbodySimmModel::addBody(const OpenSim::Body& aBody)
{
SimbodySimmBody* b = new SimbodySimmBody(&aBody, aBody.getName());
_simmBody.append(b);
}