/*! * Make this BoundingVolume contain exactly the \p meshPart. * * The default implementation uses \ref reset */ void BoundingVolume::adjustToMeshPart(const MeshPart* meshPart) { if (getVolumeType() == BV_TYPE_OBB) { adjustToMeshPart(meshPart); } else { reset(meshPart->getVertices()); } }
std::string VolumeViewHelper::volumeInfoString(const VolumeBase* handle) { std::string outString; if (handle && handle->getRepresentation<VolumeRAM>()) { const VolumeRAM* volume = handle->getRepresentation<VolumeRAM>(); std::string filename = getStrippedVolumeName(handle); if(filename.length() > 13) { QString ext = QString::fromStdString(filename); filename.resize(13); filename+="..."; filename+=ext.section('.',-1).toStdString(); } std::string spacing = getVolumeSpacing(handle); std::string dimension = getVolumeDimension(handle); std::string type = getVolumeType(volume); outString+="<style type='text/css'> table {margin-left:0px; margin-top:1px; font-size: 9px;}</style><table><tr><td>"+filename+"</td><td></td></tr><tr><td>type </td><td>" \ +type+"</td></tr><tr><td>dimension </td><td>" \ +dimension+"</td></tr><tr><td>spacing </td><td>" \ +spacing+"</td></tr><tr><td>memSize </td><td>" \ +getVolumeMemorySize(volume)+" bytes</td></tr> </table>"; } else { outString = "<strong>Volume:</strong> no Volume"; } return outString; }
/*! * \brief Tests for intersection with another Aabb * \return TRUE If this Aabb intersects with \p other. Otherwise FALSE. * * TODO: Implement correct/faster collision detection methods for * collisions between different types of bounding volumes. */ bool Aabb::collidesWith(const BoundingVolume& other) const { if (other.getVolumeType() == getVolumeType()) { const BoundingVolume* otherPointer = &other; const Aabb* aabbPointer = static_cast<const Aabb*>(otherPointer); return collidesWithInternal(*aabbPointer); } return collidesWithInternal(Aabb(other.getSurroundingAabbMin(), other.getSurroundingAabbMax())); }