<commit_before>// -*- Mode: C++; tab-width: 2; -*-
// vi: set ts=2:
//
// $Id: glRenderer.h,v 1.4 2003/09/16 15:18:32 amoll Exp $

#ifndef BALL_VIEW_RENDERING_GLRENDERER_H
#define BALL_VIEW_RENDERING_GLRENDERER_H

#ifndef BALL_VIEW_RENDERING_RENDERER_H
#	include <BALL/VIEW/RENDERING/renderer.h>
#endif

#ifndef BALL_MATHS_QUATERNION_H
# include <BALL/MATHS/quaternion.h>
#endif 

#ifndef BALL_VIEW_DATATYPE_COLORRGBA_H
# include <BALL/VIEW/DATATYPE/colorRGBA.h>
#endif

#include <qgl.h>

namespace BALL
{
// defines the maximal number of GL-objects, which can be selected in picking mode
// a number as big as 100.000 is needed for large molecules, just to be sure we use a million
#define BALL_GLRENDERER_PICKING_NUMBER_OF_MAX_OBJECTS 1000000
	namespace VIEW
	{
		class GLDisplayList;

		/** GLRenderer
		 		Renderer which provides hardware accelerated OPENGL rendering.
				\ingroup ViewRendering
		*/
		class GLRenderer: public Renderer
		{
			public:

			/** WrongModes Exception class.
					This exeption will be thrown if the <b> drawing_precision_</b> or
					<b> drawing_mode_</b> are not allowed. 
					\see         GeneralException			
			*/
			class WrongModes:	public Exception::GeneralException
			{
				public:

				WrongModes(const char* file, int line, int mode, int precision)
					throw();
			};

			/** @name Type Definitions
			*/
			//@{
			
			/// Typedef for OPENGL names
			typedef unsigned int Name;
			
			//@}
			/**	@name	Constructors and Destructors
			*/	
			//@{

			/** Default Constructor.
			*/
			GLRenderer()
				throw();

			/** Destructor
			*/
			virtual ~GLRenderer()
				throw();

			/** Explicit default initialization.
			*/
			virtual void clear()
				throw();

			//@}
			/**	@name	Accessors: inspectors and mutators 
			*/
			//@{		

			///
			void dump(std::ostream& s, Size depth) const
				throw();

			///
			Name getName(const GeometricObject& object)
				throw();

			///
			GeometricObject* getObject(GLRenderer::Name name) const
				throw();

			/** Initialise the display lists.
			 		This method is called by Scene::initializeGL.
			*/
			virtual void init(const Stage& stage)
				throw();

			/// Set the light sources according to the stage
			virtual void setLights()
				throw();

			/** Pick geometric objects
			 		\param x1, y1, x2, y2 the rectangle of the selection
			*/
			void pickObjects1(float x1, float y1, float x2, float y2)
				throw();

			/** Pick geometric objects method2.
			 		Call this method after pickObjects1 and rendering the representations.
					\param objects returns the picked objects
			*/
			void pickObjects2(List<GeometricObject*>& objects, int width, int height)
				throw();

			/**
			 */
			void setSize(float width, float height)
				throw();

			///
			float getXScale() const
				throw() { return x_scale_;}

			///
			float getYScale() const
				throw() { return y_scale_;}

			///
			void updateCamera()
				throw();

			/// Update the background color from the stage
			void updateBackgroundColor()
				throw();

			// Initialise transparent rendering
			void initTransparent(bool special) 
				throw();

			// Initialise solid rendering
			void initSolid()
				throw();
			
			///
			void setTranslationAndRotation(const Vector3& origin, const Quaternion& quaternion)
				throw();

			///
			void addRepresentation(const Representation& rep)
				throw();

			///
			void removeRepresentation(const Representation& rep)
				throw();

			///
			void updateRepresentation(const Representation& rep)
				throw();

			///
			void drawFromDisplayList(const Representation& rep)
				throw();
			
			///
			void setStereoMode(bool on)
				throw();

			///
			bool isInStereoMode() const
				throw() { return stereo_;}

			///
			virtual bool render_(const Representation& representation)<commit_msg>removed setTranslationAndRotation<commit_after>// -*- Mode: C++; tab-width: 2; -*-
// vi: set ts=2:
//
// $Id: glRenderer.h,v 1.5 2003/10/24 22:35:19 amoll Exp $

#ifndef BALL_VIEW_RENDERING_GLRENDERER_H
#define BALL_VIEW_RENDERING_GLRENDERER_H

#ifndef BALL_VIEW_RENDERING_RENDERER_H
#	include <BALL/VIEW/RENDERING/renderer.h>
#endif

#ifndef BALL_MATHS_QUATERNION_H
# include <BALL/MATHS/quaternion.h>
#endif 

#ifndef BALL_VIEW_DATATYPE_COLORRGBA_H
# include <BALL/VIEW/DATATYPE/colorRGBA.h>
#endif

#include <qgl.h>

namespace BALL
{
// defines the maximal number of GL-objects, which can be selected in picking mode
// a number as big as 100.000 is needed for large molecules, just to be sure we use a million
#define BALL_GLRENDERER_PICKING_NUMBER_OF_MAX_OBJECTS 1000000
	namespace VIEW
	{
		class GLDisplayList;

		/** GLRenderer
		 		Renderer which provides hardware accelerated OPENGL rendering.
				\ingroup ViewRendering
		*/
		class GLRenderer: public Renderer
		{
			public:

			/** WrongModes Exception class.
					This exeption will be thrown if the <b> drawing_precision_</b> or
					<b> drawing_mode_</b> are not allowed. 
					\see         GeneralException			
			*/
			class WrongModes:	public Exception::GeneralException
			{
				public:

				WrongModes(const char* file, int line, int mode, int precision)
					throw();
			};

			/** @name Type Definitions
			*/
			//@{
			
			/// Typedef for OPENGL names
			typedef unsigned int Name;
			
			//@}
			/**	@name	Constructors and Destructors
			*/	
			//@{

			/** Default Constructor.
			*/
			GLRenderer()
				throw();

			/** Destructor
			*/
			virtual ~GLRenderer()
				throw();

			/** Explicit default initialization.
			*/
			virtual void clear()
				throw();

			//@}
			/**	@name	Accessors: inspectors and mutators 
			*/
			//@{		

			///
			void dump(std::ostream& s, Size depth) const
				throw();

			///
			Name getName(const GeometricObject& object)
				throw();

			///
			GeometricObject* getObject(GLRenderer::Name name) const
				throw();

			/** Initialise the display lists.
			 		This method is called by Scene::initializeGL.
			*/
			virtual void init(const Stage& stage)
				throw();

			/// Set the light sources according to the stage
			virtual void setLights()
				throw();

			/** Pick geometric objects
			 		\param x1, y1, x2, y2 the rectangle of the selection
			*/
			void pickObjects1(float x1, float y1, float x2, float y2)
				throw();

			/** Pick geometric objects method2.
			 		Call this method after pickObjects1 and rendering the representations.
					\param objects returns the picked objects
			*/
			void pickObjects2(List<GeometricObject*>& objects, int width, int height)
				throw();

			/**
			 */
			void setSize(float width, float height)
				throw();

			///
			float getXScale() const
				throw() { return x_scale_;}

			///
			float getYScale() const
				throw() { return y_scale_;}

			///
			void updateCamera()
				throw();

			/// Update the background color from the stage
			void updateBackgroundColor()
				throw();

			// Initialise transparent rendering
			void initTransparent(bool special) 
				throw();

			// Initialise solid rendering
			void initSolid()
				throw();
			
			///
			void addRepresentation(const Representation& rep)
				throw();

			///
			void removeRepresentation(const Representation& rep)
				throw();

			///
			void updateRepresentation(const Representation& rep)
				throw();

			///
			void drawFromDisplayList(const Representation& rep)
				throw();
			
			///
			void setStereoMode(bool on)
				throw();

			///
			bool isInStereoMode() const
				throw() { return stereo_;}

			///
			virtual bool render_(const Representation& representation)
{'fraction_non_alphanumeric': 0.1115702479338843, 'fraction_numerical': 0.011596907491335644, 'mean_word_length': 2.7384155455904335, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '3092754', 'n_tokens_mistral': 3021, 'n_tokens_neox': 2317, 'n_words': 680}