Ejemplo n.º 1
0
//==============================================================================
void VoxelGridShape::updateOccupancy(
    const Eigen::Vector3d& point, bool occupied)
{
  mOctree->updateNode(toPoint3d(point), occupied);

  incrementVersion();
}
Ejemplo n.º 2
0
//==============================================================================
void VoxelGridShape::updateOccupancy(
    const Eigen::Vector3d& from, const Eigen::Vector3d& to)
{
  mOctree->insertRay(toPoint3d(from), toPoint3d(to));

  incrementVersion();
}
Ejemplo n.º 3
0
void MetaFile::mknod( const std::string& path ) //, mode_t type, mode_t mode )
{
    // insert the entry if the file is in fact new
    m_sql << "INSERT OR IGNORE INTO entries ("
                "path, "
                "subscribed "
                ") VALUES ("
                << "'" << path << "', "
                << 0    <<
                ")";

    // update subscription to the file
    m_sql << "UPDATE entries SET subscribed=1 WHERE path='"
          << path << "'";

    // set the initial version of the file
    m_sql << "INSERT OR IGNORE INTO version ("
                "path, "
                "client, "
                "version "
                ") VALUES ("
                << "'" << path << "', "
                << 0 << ", "
                << 0 <<
                ")";

    incrementVersion();
}
Ejemplo n.º 4
0
//==============================================================================
void CapsuleShape::setHeight(double height)
{
  assert(0.0 < height);
  mHeight = height;
  mIsBoundingBoxDirty = true;
  mIsVolumeDirty = true;

  incrementVersion();
}
Ejemplo n.º 5
0
//==============================================================================
void CylinderShape::setHeight(double _height)
{
  assert(0.0 < _height);
  mHeight = _height;
  mIsBoundingBoxDirty = true;
  mIsVolumeDirty = true;

  incrementVersion();
}
Ejemplo n.º 6
0
//==============================================================================
void CapsuleShape::setRadius(double radius)
{
  assert(0.0 < radius);
  mRadius = radius;
  mIsBoundingBoxDirty = true;
  mIsVolumeDirty = true;

  incrementVersion();
}
Ejemplo n.º 7
0
//==============================================================================
void CylinderShape::setRadius(double _radius)
{
  assert(0.0 < _radius);
  mRadius = _radius;
  mIsBoundingBoxDirty = true;
  mIsVolumeDirty = true;

  incrementVersion();
}
Ejemplo n.º 8
0
//==============================================================================
void VoxelGridShape::updateOccupancy(
    const octomap::Pointcloud& pointCloud,
    const Eigen::Vector3d& sensorOrigin,
    const Eigen::Isometry3d& relativeTo)
{
  mOctree->insertPointCloud(
      pointCloud, toPoint3d(sensorOrigin), toPose6d(relativeTo));

  incrementVersion();
}
Ejemplo n.º 9
0
//==============================================================================
void VoxelGridShape::updateOccupancy(
    const octomap::Pointcloud& pointCloud,
    const Eigen::Vector3d& sensorOrigin,
    const Frame* relativeTo)
{
  if (relativeTo == Frame::World())
  {
    mOctree->insertPointCloud(pointCloud, toPoint3d(sensorOrigin));
    incrementVersion();
  }
  else
  {
    updateOccupancy(pointCloud, sensorOrigin, relativeTo->getWorldTransform());
  }
}
Ejemplo n.º 10
0
//==============================================================================
void VoxelGridShape::setOctree(fcl_shared_ptr<octomap::OcTree> octree)
{
  if (!octree)
  {
    dtwarn
        << "[VoxelGridShape] Attempting to assign null octree. Ignoring this "
        << "query.\n";
    return;
  }

  if (octree == mOctree)
    return;

  mOctree = std::move(octree);

  mIsBoundingBoxDirty = true;
  mIsVolumeDirty = true;

  incrementVersion();
}
Ejemplo n.º 11
0
//==============================================================================
void PlaneShape::setOffset(double _offset)
{
  mOffset = _offset;

  incrementVersion();
}
Ejemplo n.º 12
0
//==============================================================================
void PlaneShape::setNormal(const Eigen::Vector3d& _normal)
{
  mNormal = _normal.normalized();

  incrementVersion();
}
Ejemplo n.º 13
0
//==============================================================================
void ArrowShape::configureArrow(const Eigen::Vector3d& _tail,
                                const Eigen::Vector3d& _head,
                                const Properties& _properties)
{
  mTail = _tail;
  mHead = _head;
  mProperties = _properties;

  mProperties.mHeadLengthScale =
      std::max(0.0, std::min(1.0, mProperties.mHeadLengthScale));
  mProperties.mMinHeadLength = std::max(0.0, mProperties.mMinHeadLength);
  mProperties.mMaxHeadLength = std::max(0.0, mProperties.mMaxHeadLength);
  mProperties.mHeadRadiusScale = std::max(1.0, mProperties.mHeadRadiusScale);

  double length = (mTail-mHead).norm();

  double minHeadLength =
      std::min(mProperties.mMinHeadLength,
               mProperties.mDoubleArrow? length/2.0 : length);
  double maxHeadLength =
      std::min(mProperties.mMaxHeadLength,
               mProperties.mDoubleArrow? length/2.0 : length);

  double headLength = mProperties.mHeadLengthScale*length;
  headLength = std::min(maxHeadLength, std::max(minHeadLength, headLength));

  // construct the tail
  if(mProperties.mDoubleArrow)
  {
    constructArrowTip(mMesh->mMeshes[0], headLength, 0, mProperties);
  }
  else
  {
    constructArrowTip(mMesh->mMeshes[0], 0, 0, mProperties);
  }

  // construct the main body
  if(mProperties.mDoubleArrow)
  {
    constructArrowBody(mMesh->mMeshes[1], headLength, length-headLength,
        mProperties);
  }
  else
  {
    constructArrowBody(mMesh->mMeshes[1], 0, length-headLength, mProperties);
  }

  // construct the head
  constructArrowTip(mMesh->mMeshes[2], length-headLength, length, mProperties);

  Eigen::Isometry3d tf(Eigen::Isometry3d::Identity());
  tf.translation() = mTail;
  Eigen::Vector3d v = mHead - mTail;
  Eigen::Vector3d z = Eigen::Vector3d::UnitZ();

  if(v.norm() > 0)
  {
    v.normalize();
    Eigen::Vector3d axis = z.cross(v);
    if(axis.norm() > 0)
      axis.normalize();
    else
      axis = Eigen::Vector3d::UnitY(); // Any vector in the X/Y plane can be used
    tf.rotate(Eigen::AngleAxisd(acos(z.dot(v)), axis));
  }

  aiNode* node = mMesh->mRootNode;
  for(std::size_t i=0; i<4; ++i)
    for(std::size_t j=0; j<4; ++j)
      node->mTransformation[i][j] = tf(i,j);

  mIsBoundingBoxDirty = true;
  mIsVolumeDirty = true;

  incrementVersion();
}
Ejemplo n.º 14
0
void Mesh::setTexCoords(const std::vector<glm::vec2>& texCoords) {
	_texCoords = texCoords;
	incrementVersion();
}
Ejemplo n.º 15
0
void Mesh::setNormals(const std::vector<glm::vec3>& normals)
{
	_normals = normals;
	_hasNormals = true;
	incrementVersion();
}
Ejemplo n.º 16
0
void Mesh::setVertices(const std::vector<glm::vec3>& vertices) {
	_vertices = vertices;
	calculateNormals();
	calculateBoundingBox();
	incrementVersion();
}
Ejemplo n.º 17
0
void Rt::Value::Uuid::generate() {
    uuid_generate(value);
    incrementVersion();
    notify(this);
}
Ejemplo n.º 18
0
void MetaFile::unlink( const std::string& path )
{
    m_sql << "DELETE FROM entries WHERE path='" << path << "'";
    m_sql << "DELETE FROM version WHERE path='" << path << "'";
    incrementVersion();
}
Ejemplo n.º 19
0
void MetaFile::incrementVersion()
{
    incrementVersion( m_subpath );
}
Ejemplo n.º 20
0
void CompositeScene::addScene(SceneRef scene) {
    _scenes.push_back(scene);
    calculateBoundingBox();
    incrementVersion();
}
Ejemplo n.º 21
0
void CompositeScene::clear() {
    _scenes.clear();
    incrementVersion();
}
Ejemplo n.º 22
0
void Mesh::setIndices(const std::vector<unsigned int>& indices) {
	_indices = indices;
	incrementVersion();
}
Ejemplo n.º 23
0
void Mesh::setTexture(TextureRef texture) {
	_texture = texture;
	incrementVersion();
}
Ejemplo n.º 24
0
void Rt::Value::Uuid::set(Rt::uuid value) {
    uuid_copy(this->value, value);
    incrementVersion();
    notify(this);
}