DeformableCollisionRepresentation.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_PHYSICS_DEFORMABLECOLLISIONREPRESENTATION_H
#define SURGSIM_PHYSICS_DEFORMABLECOLLISIONREPRESENTATION_H
#include <memory>
#include <string>
#include "SurgSim/Collision/Representation.h"
#include "SurgSim/Framework/ObjectFactory.h"
namespace SurgSim
{
namespace Math
{
class Shape;
class MeshShape;
}
namespace Physics
{
class DeformableRepresentation;
SURGSIM_STATIC_REGISTRATION(DeformableCollisionRepresentation);
class DeformableCollisionRepresentation : public SurgSim::Collision::Representation
{
public:
explicit DeformableCollisionRepresentation(const std::string& name);
virtual ~DeformableCollisionRepresentation();
SURGSIM_CLASSNAME(SurgSim::Physics::DeformableCollisionRepresentation);
void setShape(std::shared_ptr<SurgSim::Math::Shape> shape);
const std::shared_ptr<SurgSim::Math::Shape> getShape() const override;
void setDeformableRepresentation(std::shared_ptr<SurgSim::Physics::DeformableRepresentation> representation);
const std::shared_ptr<SurgSim::Physics::DeformableRepresentation> getDeformableRepresentation() const;
int getShapeType() const override;
void updateDcdData() override;
void updateCcdData(double interval) override;
void updateShapeData() override;
private:
bool doInitialize() override;
bool doWakeUp() override;
std::shared_ptr<SurgSim::Math::Shape> m_shape, m_previousShape;
std::weak_ptr<SurgSim::Physics::DeformableRepresentation> m_deformable;
};
} // namespace Physics
} // namespace SurgSim
#endif
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
SurgSim::Physics::DeformableCollisionRepresentation::m_shape
std::shared_ptr< SurgSim::Math::Shape > m_shape
Shape used for collision detection.
Definition: DeformableCollisionRepresentation.h:82
ObjectFactory.h
SurgSim::Physics::DeformableCollisionRepresentation
A collision representation that can be attached to a deformable, when this contains a mesh with the s...
Definition: DeformableCollisionRepresentation.h:42
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
Representation.h
SurgSim::Collision::Representation
The type of collision detection.
Definition: Representation.h:60
SurgSim::Physics::DeformableCollisionRepresentation::m_deformable
std::weak_ptr< SurgSim::Physics::DeformableRepresentation > m_deformable
Reference to the deformable driving changes to this mesh.
Definition: DeformableCollisionRepresentation.h:85