ParticlesShape.h
Go to the documentation of this file.
// This file is a part of the OpenSurgSim project.
// Copyright 2013, SimQuest Solutions Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef SURGSIM_MATH_PARTICLESSHAPE_H
#define SURGSIM_MATH_PARTICLESSHAPE_H
#include <memory>
#include "SurgSim/DataStructures/EmptyData.h"
#include "SurgSim/DataStructures/Vertices.h"
#include "SurgSim/Framework/ObjectFactory.h"
#include "SurgSim/Math/Matrix.h"
#include "SurgSim/Math/Shape.h"
#include "SurgSim/Math/Vector.h"
namespace SurgSim
{
namespace DataStructures
{
class AabbTree;
};
namespace Math
{
SURGSIM_STATIC_REGISTRATION(ParticlesShape);
class ParticlesShape : public Shape, public SurgSim::DataStructures::Vertices<DataStructures::EmptyData>
{
public:
explicit ParticlesShape(double radius = 0.0);
explicit ParticlesShape(const ParticlesShape& other);
template <class V>
explicit ParticlesShape(const SurgSim::DataStructures::Vertices<V>& other);
template <class V>
ParticlesShape& operator=(const Vertices<V>& other);
SURGSIM_CLASSNAME(SurgSim::Math::ParticlesShape);
const std::shared_ptr<const SurgSim::DataStructures::AabbTree> getAabbTree() const;
void setRadius(double radius);
double getRadius() const;
int getType() const override;
double getVolume() const override;
Vector3d getCenter() const override;
Matrix33d getSecondMomentOfVolume() const override;
std::shared_ptr<Shape> getTransformed(const RigidTransform3d& pose) const override;
bool isValid() const override;
bool isTransformable() const override;
const Math::Aabbd& getBoundingBox() const override;
private:
bool doUpdate() override;
std::shared_ptr<SurgSim::DataStructures::AabbTree> m_aabbTree;
double m_radius;
Vector3d m_center;
double m_volume;
Matrix33d m_secondMomentOfVolume;
};
};
};
#include "SurgSim/Math/ParticlesShape-inl.h"
#endif // SURGSIM_MATH_PARTICLESSHAPE_H
SurgSim::Math::ParticlesShape::m_radius
double m_radius
Particles&#39; radius.
Definition: ParticlesShape.h:101
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
Vertices.h
SurgSim::Math::Shape::Vector3d
::SurgSim::Math::Vector3d Vector3d
Definition: Shape.h:68
SurgSim::Math::ParticlesShape::m_volume
double m_volume
Total volume of particles.
Definition: ParticlesShape.h:107
ObjectFactory.h
SurgSim::Math::ParticlesShape::m_secondMomentOfVolume
Matrix33d m_secondMomentOfVolume
Second moment of volume.
Definition: ParticlesShape.h:110
SURGSIM_CLASSNAME
#define SURGSIM_CLASSNAME(ClassName)
Declare the class name of a class with the appropriate function header, do not use quotes...
Definition: Macros.h:21
SurgSim::Math::isValid
bool isValid(float value)
Check if a float value is valid.
Definition: Valid-inl.h:98
SurgSim::Math::Aabbd
Eigen::AlignedBox< double, 3 > Aabbd
Wrapper around the Eigen type.
Definition: Aabb.h:30
ParticlesShape-inl.h
Matrix.h
Definitions of small fixed-size square matrix types.
SurgSim::Math::RigidTransform3d
Eigen::Transform< double, 3, Eigen::Isometry > RigidTransform3d
A 3D rigid (isometric) transform, represented as doubles.
Definition: RigidTransform.h:46
Vector.h
Definitions of small fixed-size vector types.
SurgSim::Math::ParticlesShape::m_center
Vector3d m_center
Volumetric center of particles.
Definition: ParticlesShape.h:104
SurgSim::Math::Shape::Matrix33d
::SurgSim::Math::Matrix33d Matrix33d
Definition: Shape.h:69
SurgSim::Math::ParticlesShape::m_aabbTree
std::shared_ptr< SurgSim::DataStructures::AabbTree > m_aabbTree
The aabb tree of the ParticlesShape.
Definition: ParticlesShape.h:98
Shape.h
SurgSim::DataStructures::Vertices
Base class for mesh structures, handling basic vertex functionality.
Definition: Vertices.h:51
SurgSim::Math::ParticlesShape
Particles Shape: A shape consisting of a group of particles of equal radius.
Definition: ParticlesShape.h:41
SurgSim::Math::Shape
Generic rigid shape class defining a shape.
Definition: Shape.h:65
EmptyData.h