本文整理汇总了C++中Plane3::classifyPoint方法的典型用法代码示例。如果您正苦于以下问题:C++ Plane3::classifyPoint方法的具体用法?C++ Plane3::classifyPoint怎么用?C++ Plane3::classifyPoint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Plane3
的用法示例。
在下文中一共展示了Plane3::classifyPoint方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: filterParticles
/******************************************************************************
* Performs the actual rejection of particles.
******************************************************************************/
size_t SliceModifier::filterParticles(boost::dynamic_bitset<>& mask, TimePoint time, TimeInterval& validityInterval)
{
// Get the required input properties.
ParticlePropertyObject* const posProperty = expectStandardProperty(ParticleProperty::PositionProperty);
ParticlePropertyObject* const selProperty = applyToSelection() ? inputStandardProperty(ParticleProperty::SelectionProperty) : nullptr;
OVITO_ASSERT(posProperty->size() == mask.size());
OVITO_ASSERT(!selProperty || selProperty->size() == mask.size());
FloatType sliceWidth = 0;
if(_widthCtrl) sliceWidth = _widthCtrl->getFloatValue(time, validityInterval);
sliceWidth *= 0.5;
Plane3 plane = slicingPlane(time, validityInterval);
size_t na = 0;
boost::dynamic_bitset<>::size_type i = 0;
const Point3* p = posProperty->constDataPoint3();
const Point3* p_end = p + posProperty->size();
if(sliceWidth <= 0) {
if(selProperty) {
const int* s = selProperty->constDataInt();
for(; p != p_end; ++p, ++s, ++i) {
if(*s && plane.pointDistance(*p) > 0) {
mask.set(i);
na++;
}
else mask.reset(i);
}
}
else {
for(; p != p_end; ++p, ++i) {
if(plane.pointDistance(*p) > 0) {
mask.set(i);
na++;
}
else mask.reset(i);
}
}
}
else {
bool invert = inverse();
if(selProperty) {
const int* s = selProperty->constDataInt();
for(; p != p_end; ++p, ++s, ++i) {
if(*s && invert == (plane.classifyPoint(*p, sliceWidth) == 0)) {
mask.set(i);
na++;
}
else mask.reset(i);
}
}
else {
for(; p != p_end; ++p, ++i) {
if(invert == (plane.classifyPoint(*p, sliceWidth) == 0)) {
mask.set(i);
na++;
}
else mask.reset(i);
}
}
}
return na;
}