当前位置: 首页>>代码示例>>C++>>正文


C++ BoundingBox::empty方法代码示例

本文整理汇总了C++中BoundingBox::empty方法的典型用法代码示例。如果您正苦于以下问题:C++ BoundingBox::empty方法的具体用法?C++ BoundingBox::empty怎么用?C++ BoundingBox::empty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BoundingBox的用法示例。


在下文中一共展示了BoundingBox::empty方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: expandBy

void BoundingBox::expandBy(const BoundingBox& bbox)
{
    if(!bbox.empty()){
        if(bbox.min().x() < min_.x()){
            min_.x() = bbox.min().x();
        }
        if(bbox.max().x() > max_.x()){
            max_.x() = bbox.max().x();
        }
        if(bbox.min().y() < min_.y()){
            min_.y() = bbox.min().y();
        }
        if(bbox.max().y() > max_.y()){
            max_.y() = bbox.max().y();
        }
        if(bbox.min().z() < min_.z()){
            min_.z() = bbox.min().z();
        }
        if(bbox.max().z() > max_.z()){
            max_.z() = bbox.max().z();
        }
        if(empty_){
            empty_ = (min_.x() >= max_.x()) && (min_.y() >= max_.y()) && (min_.z() >= max_.z());
        }
    }
}
开发者ID:arntanguy,项目名称:choreonoid,代码行数:26,代码来源:BoundingBox.cpp

示例2: intersects

 /** Test if @a box intersects this bounding box. */
 bool intersects(const BoundingBox& box) const {
   if (empty() || box.empty())
     return false;
   for (unsigned i = 0; i != DIM; ++i)
     if (box.min_[i] > max_[i] || box.max_[i] < min_[i])
       return false;
   return true;
 }
开发者ID:kgourgou,项目名称:fmmtl,代码行数:9,代码来源:BoundingBox.hpp

示例3: is_valid

 /** Helper method to determine if this Iterator is valid. */
 bool is_valid() const {
   if (s_ == nullptr || bb_.empty())
     return false;
   if (code_ >= s_->mc_.code(bb_.max())+1)
     return false;
   if (loc_ >= s_->c2t_[code_].size())
     return false;
   return bb_.contains(s_->t2p_(s_->c2t_[code_][loc_]));
 }
开发者ID:ae2212,项目名称:CS207,代码行数:10,代码来源:SpaceSearcher.hpp

示例4: adjustSize

void PositionDragger::adjustSize(const BoundingBox& bb)
{
    if(!bb.empty()){
        Vector3 s = bb.size() / 2.0;
        std::sort(s.data(), s.data() + 3);
        double a = Vector2(s[0], s[1]).norm() * 1.1;
        double r = std::max(a, s[2] * 1.2);
        setRadius(r);
    }
}
开发者ID:arntanguy,项目名称:choreonoid,代码行数:10,代码来源:SceneDragger.cpp

示例5: fix

 /** Helper method to advance this Iterator until it reaches a valid
  * position or end().
  */
 void fix() {
   assert(s_ != nullptr && !bb_.empty());
   if (code_ >= s_->mc_.code(bb_.max())+1) {
     // Make equal to end() and return.
     code_ = s_->mc_.code(bb_.max())+1;
     loc_ = 0;
     return;
   }
   if (loc_ >= s_->c2t_[code_].size() ||
       !bb_.contains(s_->t2p_(s_->c2t_[code_][loc_]))) {
     operator++();
   }
 }
开发者ID:ae2212,项目名称:CS207,代码行数:16,代码来源:SpaceSearcher.hpp

示例6: attachPositionDragger

void MeshShapeItemImpl::attachPositionDragger()
{
    positionDragger = new ModelEditDragger;
    positionDragger->sigDragStarted().connect(boost::bind(&MeshShapeItemImpl::onDraggerStarted, this));
    positionDragger->sigPositionDragged().connect(boost::bind(&MeshShapeItemImpl::onDraggerDragged, this));
    BoundingBox bb = sceneLink->untransformedBoundingBox();
    if (bb.empty()) {
        positionDragger->setRadius(0.1);
    } else {
        positionDragger->adjustSize(sceneLink->untransformedBoundingBox());
    }
    sceneLink->addChild(positionDragger);
    sceneLink->notifyUpdate();
    self->notifyUpdate();
}
开发者ID:fkanehiro,项目名称:choreonoid-editor,代码行数:15,代码来源:MeshShapeItem.cpp

示例7:

BoundingBoxf::BoundingBoxf(const BoundingBox& org)
{
    min_ = org.min().cast<Vector3f::Scalar>();
    max_ = org.max().cast<Vector3f::Scalar>();
    empty_ = org.empty();
}
开发者ID:arntanguy,项目名称:choreonoid,代码行数:6,代码来源:BoundingBox.cpp

示例8: intersects

 /** Test if @a box intersects this bounding box. */
 bool intersects(const BoundingBox& box) const {
   return !empty() && !box.empty()
     && box.min_.x <= max_.x && box.max_.x >= min_.x
     && box.min_.y <= max_.y && box.max_.y >= min_.y
     && box.min_.z <= max_.z && box.max_.z >= min_.z;
 }
开发者ID:JMTing,项目名称:CS207,代码行数:7,代码来源:BoundingBox.hpp

示例9: contains

 /** Test if @a box is entirely within this bounding box.
  *
  * Returns false if @a box.empty(). */
 bool contains(const BoundingBox& box) const {
   return !box.empty() && contains(box.min()) && contains(box.max());
 }
开发者ID:JMTing,项目名称:CS207,代码行数:6,代码来源:BoundingBox.hpp

示例10: end

 /** Method to return an iterator pointing to "one past"
  * the last item in a given BoundingBox.
  */
 iterator end(const BoundingBox& bb) const {
   assert(!bb.empty());
   return Iterator(this, bb, mc_.code(bb.max())+1, 0);
 }
开发者ID:ae2212,项目名称:CS207,代码行数:7,代码来源:SpaceSearcher.hpp

示例11: begin

 /** Method to return an iterator pointing to the first item
  * in a given BoundingBox.
  */
 iterator begin(const BoundingBox& bb) const {
   assert(!bb.empty());
   return Iterator(this, bb, mc_.code(bb.min()), 0);
 }
开发者ID:ae2212,项目名称:CS207,代码行数:7,代码来源:SpaceSearcher.hpp


注:本文中的BoundingBox::empty方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。