ConstraintComponent.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_CONSTRAINTCOMPONENT_H
#define SURGSIM_PHYSICS_CONSTRAINTCOMPONENT_H
#include <memory>
#include <string>
#include "SurgSim/Framework/Component.h"
namespace SurgSim
{
namespace Physics
{
class Constraint;
class ConstraintComponent : public SurgSim::Framework::Component
{
public:
explicit ConstraintComponent(const std::string& name);
virtual ~ConstraintComponent();
void setConstraint(std::shared_ptr<Constraint> constraint);
std::shared_ptr<Constraint> getConstraint() const;
protected:
std::shared_ptr<Constraint> m_constraint;
bool doInitialize() override;
bool doWakeUp() override;
};
}; // namespace SurgSim
}; // namespace Physics
#endif // SURGSIM_PHYSICS_CONSTRAINTCOMPONENT_H
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
SurgSim::Physics::ConstraintComponent::~ConstraintComponent
virtual ~ConstraintComponent()
Destructor.
Definition: ConstraintComponent.cpp:27
SurgSim::Physics::ConstraintComponent::doInitialize
bool doInitialize() override
Initialize the component.
Definition: ConstraintComponent.cpp:41
Component.h
SurgSim::Framework::Component
Component is the main interface class to pass information to the system managers each will decide whe...
Definition: Component.h:42
SurgSim::Physics::ConstraintComponent::m_constraint
std::shared_ptr< Constraint > m_constraint
The stored constraint.
Definition: ConstraintComponent.h:52
SurgSim::Physics::ConstraintComponent
Component class for inserting constraints between physics representations into the scene...
Definition: ConstraintComponent.h:32
SurgSim::Physics::ConstraintComponent::getConstraint
std::shared_ptr< Constraint > getConstraint() const
Get the constraint associated with this component.
Definition: ConstraintComponent.cpp:36
SurgSim::Physics::ConstraintComponent::ConstraintComponent
ConstraintComponent(const std::string &name)
Constructor.
Definition: ConstraintComponent.cpp:23
SurgSim::Physics::ConstraintComponent::doWakeUp
bool doWakeUp() override
Wakeup the component.
Definition: ConstraintComponent.cpp:46
SurgSim::Physics::ConstraintComponent::setConstraint
void setConstraint(std::shared_ptr< Constraint > constraint)
Set the constraint associated with this component.
Definition: ConstraintComponent.cpp:31