<commit_before>// This file is a part of the OpenSurgSim project.
// Copyright 2012-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.

#include "SurgSim/Math/Vector.h"
#include "SurgSim/Graphics/Actor.h"
#include "SurgSim/Graphics/Camera.h"
#include "SurgSim/Graphics/Group.h"
#include "SurgSim/Graphics/Manager.h"
#include "SurgSim/Graphics/View.h"
#include "SurgSim/Graphics/ViewElement.h"

/// Manager class for testing
class MockManager : public SurgSim::Graphics::Manager
{
public:
	/// Constructor
	/// \post m_numUpdates and m_sumDt are initialized to 0
	MockManager() : SurgSim::Graphics::Manager(),
		m_numUpdates(0),
		m_sumDt(0.0)
	{
	}

	/// Returns the number of times the manager has been updated
	int getNumUpdates() const
	{
		return m_numUpdates;
	}
	/// Returns the sum of the dt that the manager has been updated with
	double getSumDt() const
	{
		return m_sumDt;
	}

private:
	/// Updates the manager.
	/// \param	dt	The time in seconds of the preceding timestep.
	/// \post	m_numUpdates is incremented and dt is added to m_sumDt
	virtual bool doUpdate(double dt)
	{
		if (Manager::doUpdate(dt))
		{
			++m_numUpdates;
			m_sumDt += dt;
			return true;
		}
		else
		{
			return false;
		}
	}

	/// Number of times the manager has been updated
	int m_numUpdates;
	/// Sum of the dt that the manager has been updated with
	double m_sumDt;
};

/// Actor class for testing
class MockActor : public SurgSim::Graphics::Actor
{
public:
	/// Constructor
	/// \param	name	Name of the actor
	/// \post m_numUpdates and m_sumDt are initialized to 0
	/// \post m_transform is set to identity
	explicit MockActor(const std::string& name) : SurgSim::Graphics::Actor(name),
		m_numUpdates(0),
		m_sumDt(0.0),
		m_isInitialized(false),
		m_isAwoken(false),
		m_isVisible(true)
	{
		m_transform.setIdentity();
	}

	/// Sets whether the actor is currently visible
	/// \param	visible	True for visible, false for invisible
	virtual void setVisible(bool visible)
	{
		m_isVisible = visible;
	}

	/// Gets whether the actor is currently visible
	/// \return	visible	True for visible, false for invisible
	virtual bool isVisible() const
	{
		return m_isVisible;
	}

	/// Returns the number of times the actor has been updated
	int getNumUpdates() const
	{
		return m_numUpdates;
	}
	/// Returns the sum of the dt that the actor has been updated with
	double getSumDt() const
	{
		return m_sumDt;<commit_msg>Reorder initialization list in MockActor to fix build warnings on linux.<commit_after>// This file is a part of the OpenSurgSim project.
// Copyright 2012-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.

#include "SurgSim/Math/Vector.h"
#include "SurgSim/Graphics/Actor.h"
#include "SurgSim/Graphics/Camera.h"
#include "SurgSim/Graphics/Group.h"
#include "SurgSim/Graphics/Manager.h"
#include "SurgSim/Graphics/View.h"
#include "SurgSim/Graphics/ViewElement.h"

/// Manager class for testing
class MockManager : public SurgSim::Graphics::Manager
{
public:
	/// Constructor
	/// \post m_numUpdates and m_sumDt are initialized to 0
	MockManager() : SurgSim::Graphics::Manager(),
		m_numUpdates(0),
		m_sumDt(0.0)
	{
	}

	/// Returns the number of times the manager has been updated
	int getNumUpdates() const
	{
		return m_numUpdates;
	}
	/// Returns the sum of the dt that the manager has been updated with
	double getSumDt() const
	{
		return m_sumDt;
	}

private:
	/// Updates the manager.
	/// \param	dt	The time in seconds of the preceding timestep.
	/// \post	m_numUpdates is incremented and dt is added to m_sumDt
	virtual bool doUpdate(double dt)
	{
		if (Manager::doUpdate(dt))
		{
			++m_numUpdates;
			m_sumDt += dt;
			return true;
		}
		else
		{
			return false;
		}
	}

	/// Number of times the manager has been updated
	int m_numUpdates;
	/// Sum of the dt that the manager has been updated with
	double m_sumDt;
};

/// Actor class for testing
class MockActor : public SurgSim::Graphics::Actor
{
public:
	/// Constructor
	/// \param	name	Name of the actor
	/// \post m_numUpdates and m_sumDt are initialized to 0
	/// \post m_transform is set to identity
	explicit MockActor(const std::string& name) : SurgSim::Graphics::Actor(name),
		m_isVisible(true),
		m_numUpdates(0),
		m_sumDt(0.0),
		m_isInitialized(false),
		m_isAwoken(false)
	{
		m_transform.setIdentity();
	}

	/// Sets whether the actor is currently visible
	/// \param	visible	True for visible, false for invisible
	virtual void setVisible(bool visible)
	{
		m_isVisible = visible;
	}

	/// Gets whether the actor is currently visible
	/// \return	visible	True for visible, false for invisible
	virtual bool isVisible() const
	{
		return m_isVisible;
	}

	/// Returns the number of times the actor has been updated
	int getNumUpdates() const
	{
		return m_numUpdates;
	}
	/// Returns the sum of the dt that the actor has been updated with
	double getSumDt() const
	{
		return m_sumDt;
{'fraction_non_alphanumeric': 0.10075693860386879, 'fraction_numerical': 0.00672834314550042, 'mean_word_length': 3.5045454545454544, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6946748', 'n_tokens_mistral': 1986, 'n_tokens_neox': 1893, 'n_words': 687}