ParticlesCollisionRepresentation.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_PARTICLES_PARTICLESCOLLISIONREPRESENTATION_H
#define SURGSIM_PARTICLES_PARTICLESCOLLISIONREPRESENTATION_H
#include <memory>
#include <string>
#include "SurgSim/Collision/Representation.h"
#include "SurgSim/Framework/ObjectFactory.h"
namespace SurgSim
{
namespace Math
{
class Shape;
class ParticlesShape;
};
namespace Particles
{
class Representation;
SURGSIM_STATIC_REGISTRATION(ParticlesCollisionRepresentation);
class ParticlesCollisionRepresentation : public SurgSim::Collision::Representation
{
public:
explicit ParticlesCollisionRepresentation(const std::string& name);
virtual ~ParticlesCollisionRepresentation();
SURGSIM_CLASSNAME(SurgSim::Particles::ParticlesCollisionRepresentation);
const std::shared_ptr<SurgSim::Math::Shape> getShape() const override;
int getShapeType() const override;
void updateShapeData() override;
void setParticleRepresentation(std::shared_ptr<SurgSim::Particles::Representation> representation);
const std::shared_ptr<SurgSim::Particles::Representation> getParticleRepresentation() const;
void setParticleRadius(double radius);
double getParticleRadius() const;
private:
bool doInitialize() override;
bool doWakeUp() override;
std::shared_ptr<SurgSim::Math::ParticlesShape> m_shape;
std::weak_ptr<SurgSim::Particles::Representation> m_particleRepresentation;
};
};
};
#endif // SURGSIM_PARTICLES_PARTICLESCOLLISIONREPRESENTATION_H
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
SurgSim::Particles::ParticlesCollisionRepresentation
A Collision Representation that can be attached to a Particle Representation.
Definition: ParticlesCollisionRepresentation.h:43
ObjectFactory.h
SurgSim::Particles::Particles
DataStructures::Vertices< ParticleData > Particles
Definition: Particles.h:53
SurgSim::Particles::ParticlesCollisionRepresentation::m_shape
std::shared_ptr< SurgSim::Math::ParticlesShape > m_shape
Shape used for collision detection.
Definition: ParticlesCollisionRepresentation.h:84
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::Particles::ParticlesCollisionRepresentation::m_particleRepresentation
std::weak_ptr< SurgSim::Particles::Representation > m_particleRepresentation
Reference to the particle representation driving changes to this collision representation.
Definition: ParticlesCollisionRepresentation.h:87
Representation.h
SurgSim::Collision::Representation
The type of collision detection.
Definition: Representation.h:60