<commit_before>// 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_ACTOR_H
#define SURGSIM_PHYSICS_ACTOR_H

#include <SurgSim\Math\Vector.h>

#include <SurgSim\Framework\Representation.h>

#include <string>

namespace SurgSim
{

namespace Physics
{

class ActorState;

/// The Actor class defines the base class for all physics objects
class Actor : public SurgSim::Framework::Representation
{
public:
	/// Constructor
	/// \param name The actor's name
	explicit Actor(const std::string& name)
		: Representation(name), m_numDof(0)
	{
		Actor::resetState();
	};

	/// Destructor
	virtual ~Actor()
	{
	};

	/// Called to reset the actor to its initial/default state
	/// The actor is being active with gravity enabled, set to (0 -9.81 0)
	virtual void resetState()
	{
		setIsActive(true);
		setIsGravityEnabled(true);
		setGravity(SurgSim::Math::Vector3d(0, -9.81, 0));
	};

	/// Called to reset the actor parameters to their initial/default values
	virtual void resetParameters()
	{
	};

	/// Query the object number of degrees of freedom
	/// \return The number of degrees of freedom
	unsigned int getNumDof() const
	{
		return m_numDof;
	};

	/// Set active flag for this Actor
	/// \param isActive True if the Actor is being activated, False otherwise
	virtual void setIsActive(bool isActive)
	{
		m_isActive = isActive;
	};

	/// Query if this object is active in the scene.
	/// \return true if active, false if not.
	bool isActive() const
	{
		return m_isActive;
	};

	/// Set the gravity enable flag
	/// \param isGravityEnabled True if gravity enabled, false if not.
	virtual void setIsGravityEnabled(bool isGravityEnabled)
	{
		m_isGravityEnabled = isGravityEnabled;
	};

	/// Get the gravity enable flag
	/// \return true if gravity enabled, false if not.
	bool isGravityEnabled() const
	{
		return m_isGravityEnabled;
	};

	/// Set gravity vector
	/// \param gravity The gravity vector (direction and magnitude)
	virtual void setGravity(const SurgSim::Math::Vector3d& gravity)
	{
		m_gravity = gravity;
	};

	/// Get gravity vector
	/// \return The gravity vector (direction and magnitude)
	///         No matter what the gravity enabled flag is
	const SurgSim::Math::Vector3d& getGravity() const
	{
		return m_gravity;
	};

	/// Called before the scene does its physics update, lets the actor
	/// do some preprocessing
	/// \param dt The time in seconds that the update call will advance the scene
	virtual void beforeUpdate(double dt)
	{
	};

	/// Update the actor state to the current time step
	/// \param dt The time in seconds that the update call will advance the scene
	virtual void update(double dt)
	{
	};

	/// Called after the scene update has concluded.
	/// \param dt The time in seconds of the preceding timestep
	virtual void afterUpdate(double dt)
	{
	};

protected:
	/// Set the number of degrees of freedom
	/// \param numDof The number of degrees of freedom
	/// protected so that nobody can change the number of DOF, except daughter classes
	void setNumDof(unsigned int numDof)
	{
		m_numDof = numDof;
	};

private:
	/// NO copy constructor
	Actor(const Actor& a)
		: Representation(std::string(""))
	{
	};
	
	/// NO assignement operator
	Actor& operator =(const Actor &a)
	{
	};
<commit_msg>Minor fixes (lines too long), last clean up<commit_after>// 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_ACTOR_H
#define SURGSIM_PHYSICS_ACTOR_H

#include <string>

#include <SurgSim\Math\Vector.h>
#include <SurgSim\Framework\Representation.h>

namespace SurgSim
{

namespace Physics
{

/// The Actor class defines the base class for all physics objects
class Actor : public SurgSim::Framework::Representation
{
public:
	/// Constructor
	/// \param name The actor's name
	explicit Actor(const std::string& name)
		: Representation(name), m_numDof(0)
	{
		Actor::resetState();
	};

	/// Destructor
	virtual ~Actor()
	{
	};

	/// Called to reset the actor to its initial/default state
	/// The actor is being active with gravity enabled, set to (0 -9.81 0)
	virtual void resetState()
	{
		setIsActive(true);
		setIsGravityEnabled(true);
		setGravity(SurgSim::Math::Vector3d(0, -9.81, 0));
	};

	/// Called to reset the actor parameters to their initial/default values
	virtual void resetParameters()
	{
	};

	/// Query the object number of degrees of freedom
	/// \return The number of degrees of freedom
	unsigned int getNumDof() const
	{
		return m_numDof;
	};

	/// Set active flag for this Actor
	/// \param isActive True if the Actor is being activated, False otherwise
	virtual void setIsActive(bool isActive)
	{
		m_isActive = isActive;
	};

	/// Query if this object is active in the scene.
	/// \return true if active, false if not.
	bool isActive() const
	{
		return m_isActive;
	};

	/// Set the gravity enable flag
	/// \param isGravityEnabled True if gravity enabled, false if not.
	virtual void setIsGravityEnabled(bool isGravityEnabled)
	{
		m_isGravityEnabled = isGravityEnabled;
	};

	/// Get the gravity enable flag
	/// \return true if gravity enabled, false if not.
	bool isGravityEnabled() const
	{
		return m_isGravityEnabled;
	};

	/// Set gravity vector
	/// \param gravity The gravity vector (direction and magnitude)
	virtual void setGravity(const SurgSim::Math::Vector3d& gravity)
	{
		m_gravity = gravity;
	};

	/// Get gravity vector
	/// \return The gravity vector (direction and magnitude)
	///         No matter what the gravity enabled flag is
	const SurgSim::Math::Vector3d& getGravity() const
	{
		return m_gravity;
	};

	/// Called before the scene does its physics update, lets the actor
	/// do some preprocessing
	/// \param dt The time step (in seconds)
	virtual void beforeUpdate(double dt)
	{
	};

	/// Update the actor state to the current time step
	/// \param dt The time step (in seconds)
	virtual void update(double dt)
	{
	};

	/// Called after the scene update has concluded.
	/// \param dt The time step (in seconds)
	virtual void afterUpdate(double dt)
	{
	};

protected:
	/// Set the number of degrees of freedom
	/// \param numDof The number of degrees of freedom
	/// \note protected so that nobody can change the number of DOF
	/// \note except daughter classes
	void setNumDof(unsigned int numDof)
	{
		m_numDof = numDof;
	};

private:
	/// NO copy constructor
	Actor(const Actor& a)
		: Representation(std::string(""))
	{
	};
	
	/// NO assignement operator
	Actor& operator =(const Actor &a)
	{
	};

{'fraction_non_alphanumeric': 0.10061574741255076, 'fraction_numerical': 0.005764443862177388, 'mean_word_length': 3.3823191733639493, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2736926', 'n_tokens_mistral': 2388, 'n_tokens_neox': 2270, 'n_words': 910}