本文整理汇总了C++中ParticleIndexes::empty方法的典型用法代码示例。如果您正苦于以下问题:C++ ParticleIndexes::empty方法的具体用法?C++ ParticleIndexes::empty怎么用?C++ ParticleIndexes::empty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParticleIndexes
的用法示例。
在下文中一共展示了ParticleIndexes::empty方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: link_particle
void HierarchyLoadXYZs::link_particle(
RMF::NodeConstHandle n, Model *m, ParticleIndex p,
const ParticleIndexes &rigid_bodies) {
if (!ip_factory_.get_is(n)) return;
if (rigid_bodies.empty()) {
global_.push_back(std::make_pair(n.get_id(), p));
} else {
if (rigid_bodies.back() == p) return;
if (core::NonRigidMember::get_is_setup(m, p)) {
local_.push_back(std::make_pair(n.get_id(), p));
} else if (n.get_has_value(rb_index_key_)
&& core::RigidMember::get_is_setup(m, p)) {
// backwards compat: need to read coordinates of rigid members in order
// to set the reference frame of the rigid body later
global_.push_back(std::make_pair(n.get_id(), p));
}
}
}
示例2: setup_particle
void HierarchyLoadXYZs::setup_particle(
RMF::NodeConstHandle n, Model *m, ParticleIndex p,
const ParticleIndexes &rigid_bodies) {
if (!ip_factory_.get_is(n)) return;
if (!core::XYZ::get_is_setup(m, p)) core::XYZ::setup_particle(m, p);
/* If there is a rigid body parent set up, add this particle as a child
(unless it's an old-style rigid body, in which case this has been
done already) */
if (!rigid_bodies.empty()
&& !(rigid_bodies.size()==1 && rigid_bodies.back() == p)
&& !n.get_has_value(rb_index_key_)) {
core::RigidBody rb(m, rigid_bodies.back());
/* For nested rigid bodies, this XYZ particle is *also* the rigid body.
So don't make ourselves our own child - add to the parent rigid body
instead. */
if (rigid_bodies.back() == p) {
IMP_INTERNAL_CHECK(rigid_bodies.size() >= 2,
"Nested rigid body " << m->get_particle_name(p)
<< " but could not find parent rigid body");
rb = core::RigidBody(m, rigid_bodies[rigid_bodies.size() - 2]);
}
rb.add_member(p);
if (reference_frame_factory_.get_is(n)
&& !reference_frame_factory_.get_is_static(n)) {
IMP_LOG_VERBOSE("Member particle " << m->get_particle_name(p)
<< " is not static and is also a rigid body"
<< std::endl);
rb.set_is_rigid_member(p, false);
} else if (!ip_factory_.get_is_static(n)) {
IMP_LOG_VERBOSE("Member particle " << m->get_particle_name(p)
<< " is not static" << std::endl);
rb.set_is_rigid_member(p, false);
} else {
IMP_LOG_VERBOSE("Member particle " << m->get_particle_name(p)
<< " is static" << std::endl);
rb.set_is_rigid_member(p, true);
core::RigidBodyMember(m, p)
.set_internal_coordinates(get_coordinates(n, ip_factory_));
}
}
link_particle(n, m, p, rigid_bodies);
}