Ran script to remove trailing spaces and tabs

This commit is contained in:
Robert Osfield 2012-03-21 17:36:20 +00:00
parent 1e35f8975d
commit 14a563dc9f
1495 changed files with 21873 additions and 21873 deletions

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenThreads library, Copyright (C) 2002 - 2007 The Open Thread Group
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -15,7 +15,7 @@
//
// Barrier - C++ barrier class
// ~~~~~~~
//
//
#ifndef _OPENTHREADS_BARRIER_
#define _OPENTHREADS_BARRIER_
@ -66,12 +66,12 @@ public:
/**
* Return the number of threads currently blocked in the barrier,
* Return -1 if error.
*/
*/
virtual int numThreadsCurrentlyBlocked();
void invalidate();
private:
/**

View File

@ -22,10 +22,10 @@
namespace OpenThreads {
/** Block is a block that can be used to halt a thread that is waiting another thread to release it.*/
class Block
class Block
{
public:
Block():
_released(false) {}
@ -75,7 +75,7 @@ class Block
ScopedLock<OpenThreads::Mutex> mutlock(_mut);
_released = false;
}
inline void set(bool doRelease)
{
if (doRelease!=_released)
@ -97,10 +97,10 @@ class Block
};
/** BlockCount is a block that can be used to halt a thread that is waiting for a specified number of operations to be completed.*/
class BlockCount
class BlockCount
{
public:
BlockCount(unsigned int blockCount):
_blockCount(blockCount),
_currentCount(0) {}
@ -132,7 +132,7 @@ class BlockCount
if (_currentCount)
_cond.wait(&_mut);
}
inline void reset()
{
OpenThreads::ScopedLock<OpenThreads::Mutex> mutlock(_mut);
@ -154,9 +154,9 @@ class BlockCount
}
inline void setBlockCount(unsigned int blockCount) { _blockCount = blockCount; }
inline unsigned int getBlockCount() const { return _blockCount; }
inline unsigned int getCurrentCount() const { return _currentCount; }
protected:
@ -167,7 +167,7 @@ class BlockCount
unsigned int _currentCount;
private:
BlockCount(const BlockCount&) {}
};

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenThreads library, Copyright (C) 2002 - 2007 The Open Thread Group
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenThreads library, Copyright (C) 2002 - 2007 The Open Thread Group
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -25,13 +25,13 @@
#define OPENTHREAD_EXPORT_DIRECTIVE __declspec(dllexport)
#else
#define OPENTHREAD_EXPORT_DIRECTIVE __declspec(dllimport)
#if 0 // Commented out for now
#ifdef _MSC_VER
#ifdef _DEBUG
#pragma comment(lib ,"OpenThreadsWin32d")
#else
#else
#pragma comment(lib, "OpenThreadsWin32")
#endif
#endif

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenThreads library, Copyright (C) 2002 - 2007 The Open Thread Group
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenThreads - Copyright (C) 1998-2007 Robert Osfield
/* -*-c++-*- OpenThreads - Copyright (C) 1998-2007 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -22,12 +22,12 @@ namespace OpenThreads {
class ReadWriteMutex
{
public:
ReadWriteMutex():
_readCount(0) {}
virtual ~ReadWriteMutex() {}
virtual int readLock()
{
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_readCountMutex);
@ -65,31 +65,31 @@ class ReadWriteMutex
{
return _readWriteMutex.unlock();
}
protected:
ReadWriteMutex(const ReadWriteMutex&) {}
ReadWriteMutex& operator = (const ReadWriteMutex&) { return *(this); }
#if 0
ReentrantMutex _readWriteMutex;
ReentrantMutex _readWriteMutex;
ReentrantMutex _readCountMutex;
#else
OpenThreads::Mutex _readWriteMutex;
OpenThreads::Mutex _readWriteMutex;
OpenThreads::Mutex _readCountMutex;
#endif
#endif
unsigned int _readCount;
};
class ScopedReadLock
{
public:
ScopedReadLock(ReadWriteMutex& mutex):_mutex(mutex) { _mutex.readLock(); }
~ScopedReadLock() { _mutex.readUnlock(); }
protected:
protected:
ReadWriteMutex& _mutex;
ScopedReadLock& operator = (const ScopedReadLock&) { return *this; }
@ -99,11 +99,11 @@ class ScopedReadLock
class ScopedWriteLock
{
public:
ScopedWriteLock(ReadWriteMutex& mutex):_mutex(mutex) { _mutex.writeLock(); }
~ScopedWriteLock() { _mutex.writeUnlock(); }
protected:
protected:
ReadWriteMutex& _mutex;
ScopedWriteLock& operator = (const ScopedWriteLock&) { return *this; }

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenThreads - Copyright (C) 1998-2007 Robert Osfield
/* -*-c++-*- OpenThreads - Copyright (C) 1998-2007 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenThreads library, Copyright (C) 2002 - 2007 The Open Thread Group
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -15,7 +15,7 @@
//
// ScopedLock and ReverseScopedLock templates
// ~~~~~~~
//
//
#ifndef _ScopedLock_
#define _ScopedLock_

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenThreads library, Copyright (C) 2002 - 2007 The Open Thread Group
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -29,7 +29,7 @@ namespace OpenThreads {
/**
* Get the number of processors.
*
* Note, systems where no support exists for querrying the number of processors, 1 is returned.
* Note, systems where no support exists for querrying the number of processors, 1 is returned.
*
*/
extern OPENTHREAD_EXPORT_DIRECTIVE int GetNumberOfProcessors();
@ -37,7 +37,7 @@ extern OPENTHREAD_EXPORT_DIRECTIVE int GetNumberOfProcessors();
/**
* Set the processor affinity of current thread.
*
* Note, systems where no support exists no affinity will be set, and -1 will be returned.
* Note, systems where no support exists no affinity will be set, and -1 will be returned.
*
*/
extern OPENTHREAD_EXPORT_DIRECTIVE int SetProcessorAffinityOfCurrentThread(unsigned int cpunum);
@ -372,7 +372,7 @@ private:
* Implementation-specific data
*/
void * _prvData;
/**
* Master thread's priority, set by Thread::Init.
*/

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -23,11 +23,11 @@
namespace osg {
/** Encapsulates OpenGL glAlphaFunc.
*/
*/
class OSG_EXPORT AlphaFunc : public StateAttribute
{
public :
enum ComparisonFunction {
NEVER = GL_NEVER,
LESS = GL_LESS,
@ -41,7 +41,7 @@ class OSG_EXPORT AlphaFunc : public StateAttribute
AlphaFunc();
AlphaFunc(ComparisonFunction func,float ref):
_comparisonFunc(func),
_referenceValue(ref) {}
@ -51,9 +51,9 @@ class OSG_EXPORT AlphaFunc : public StateAttribute
StateAttribute(af,copyop),
_comparisonFunc(af._comparisonFunc),
_referenceValue(af._referenceValue) {}
META_StateAttribute(osg, AlphaFunc,ALPHAFUNC);
/** Return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs. */
virtual int compare(const StateAttribute& sa) const
{
@ -79,17 +79,17 @@ class OSG_EXPORT AlphaFunc : public StateAttribute
_comparisonFunc = func;
_referenceValue = ref;
}
inline void setFunction(ComparisonFunction func) { _comparisonFunc=func; }
inline ComparisonFunction getFunction() const { return _comparisonFunc; }
inline void setReferenceValue(float value) { _referenceValue=value; }
inline float getReferenceValue() const { return _referenceValue; }
virtual void apply(State& state) const;
protected:
virtual ~AlphaFunc();
ComparisonFunction _comparisonFunc;

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -33,7 +33,7 @@ namespace osg {
class OSG_EXPORT AnimationPath : public virtual osg::Object
{
public:
AnimationPath():_loopMode(LOOP) {}
AnimationPath(const AnimationPath& ap, const CopyOp& copyop=CopyOp::SHALLOW_COPY):
@ -63,7 +63,7 @@ class OSG_EXPORT AnimationPath : public virtual osg::Object
_position(position),
_rotation(rotation),
_scale(scale) {}
void setPosition(const osg::Vec3d& position) { _position = position; }
const osg::Vec3d& getPosition() const { return _position; }
@ -80,7 +80,7 @@ class OSG_EXPORT AnimationPath : public virtual osg::Object
_rotation.slerp(ratio,first._rotation,second._rotation);
_scale = first._scale*one_minus_ratio + second._scale*ratio;
}
inline void interpolate(double ratio,const ControlPoint& first, const ControlPoint& second)
{
double one_minus_ratio = 1.0f-ratio;
@ -124,7 +124,7 @@ class OSG_EXPORT AnimationPath : public virtual osg::Object
osg::Vec3d _scale;
};
/** Given a specific time, return the transformation matrix for a point. */
bool getMatrix(double time,Matrixf& matrix) const
@ -152,7 +152,7 @@ class OSG_EXPORT AnimationPath : public virtual osg::Object
cp.getInverse(matrix);
return true;
}
bool getInverse(double time,Matrixd& matrix) const
{
ControlPoint cp;
@ -163,36 +163,36 @@ class OSG_EXPORT AnimationPath : public virtual osg::Object
/** Given a specific time, return the local ControlPoint frame for a point. */
virtual bool getInterpolatedControlPoint(double time,ControlPoint& controlPoint) const;
/** Insert a control point into the AnimationPath.*/
void insert(double time,const ControlPoint& controlPoint);
double getFirstTime() const { if (!_timeControlPointMap.empty()) return _timeControlPointMap.begin()->first; else return 0.0;}
double getLastTime() const { if (!_timeControlPointMap.empty()) return _timeControlPointMap.rbegin()->first; else return 0.0;}
double getPeriod() const { return getLastTime()-getFirstTime();}
enum LoopMode
{
SWING,
LOOP,
NO_LOOPING
};
void setLoopMode(LoopMode lm) { _loopMode = lm; }
LoopMode getLoopMode() const { return _loopMode; }
typedef std::map<double,ControlPoint> TimeControlPointMap;
void setTimeControlPointMap(TimeControlPointMap& tcpm) { _timeControlPointMap=tcpm; }
TimeControlPointMap& getTimeControlPointMap() { return _timeControlPointMap; }
const TimeControlPointMap& getTimeControlPointMap() const { return _timeControlPointMap; }
bool empty() const { return _timeControlPointMap.empty(); }
void clear() { _timeControlPointMap.clear(); }
/** Read the animation path from a flat ASCII file stream. */
@ -205,7 +205,7 @@ class OSG_EXPORT AnimationPath : public virtual osg::Object
void write(TimeControlPointMap::const_iterator itr, std::ostream& out) const;
protected:
virtual ~AnimationPath() {}
TimeControlPointMap _timeControlPointMap;
@ -240,7 +240,7 @@ class OSG_EXPORT AnimationPathCallback : public NodeCallback
_pause(apc._pause),
_pauseTime(apc._pauseTime) {}
META_Object(osg,AnimationPathCallback);
/** Construct an AnimationPathCallback with a specified animation path.*/
@ -257,8 +257,8 @@ class OSG_EXPORT AnimationPathCallback : public NodeCallback
/** Construct an AnimationPathCallback and automatically create an animation path to produce a rotation about a point.*/
AnimationPathCallback(const osg::Vec3d& pivot,const osg::Vec3d& axis,float angularVelocity);
void setAnimationPath(AnimationPath* path) { _animationPath = path; }
AnimationPath* getAnimationPath() { return _animationPath.get(); }
const AnimationPath* getAnimationPath() const { return _animationPath.get(); }
@ -271,7 +271,7 @@ class OSG_EXPORT AnimationPathCallback : public NodeCallback
void setTimeOffset(double offset) { _timeOffset = offset; }
double getTimeOffset() const { return _timeOffset; }
void setTimeMultiplier(double multiplier) { _timeMultiplier = multiplier; }
double getTimeMultiplier() const { return _timeMultiplier; }
@ -288,7 +288,7 @@ class OSG_EXPORT AnimationPathCallback : public NodeCallback
/** Implements the callback. */
virtual void operator()(Node* node, NodeVisitor* nv);
void update(osg::Node& node);
public:
@ -304,7 +304,7 @@ class OSG_EXPORT AnimationPathCallback : public NodeCallback
double _pauseTime;
protected:
~AnimationPathCallback(){}
};

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -25,7 +25,7 @@ namespace osg {
class OSG_EXPORT ApplicationUsage : public osg::Referenced
{
public:
static ApplicationUsage* instance();
ApplicationUsage() {}
@ -33,7 +33,7 @@ class OSG_EXPORT ApplicationUsage : public osg::Referenced
ApplicationUsage(const std::string& commandLineUsage);
typedef std::map<std::string,std::string> UsageMap;
/** The ApplicationName is often displayed when logging errors, and frequently incorporated into the Description (below). */
void setApplicationName(const std::string& name) { _applicationName = name; }
@ -52,15 +52,15 @@ class OSG_EXPORT ApplicationUsage : public osg::Referenced
KEYBOARD_MOUSE_BINDING = 0x4,
HELP_ALL = KEYBOARD_MOUSE_BINDING|ENVIRONMENTAL_VARIABLE|COMMAND_LINE_OPTION
};
void addUsageExplanation(Type type,const std::string& option,const std::string& explanation);
void setCommandLineUsage(const std::string& explanation) { _commandLineUsage=explanation; }
const std::string& getCommandLineUsage() const { return _commandLineUsage; }
void addCommandLineOption(const std::string& option,const std::string& explanation, const std::string &defaultValue = "");
void setCommandLineOptions(const UsageMap& usageMap) { _commandLineOptions=usageMap; }
const UsageMap& getCommandLineOptions() const { return _commandLineOptions; }
@ -69,7 +69,7 @@ class OSG_EXPORT ApplicationUsage : public osg::Referenced
void addEnvironmentalVariable(const std::string& option,const std::string& explanation, const std::string& defaultValue = "");
void setEnvironmentalVariables(const UsageMap& usageMap) { _environmentalVariables=usageMap; }
const UsageMap& getEnvironmentalVariables() const { return _environmentalVariables; }
@ -86,13 +86,13 @@ class OSG_EXPORT ApplicationUsage : public osg::Referenced
void getFormattedString(std::string& str, const UsageMap& um,unsigned int widthOfOutput=80,bool showDefaults=false,const UsageMap& ud=UsageMap());
void write(std::ostream& output,const UsageMap& um,unsigned int widthOfOutput=80,bool showDefaults=false,const UsageMap& ud=UsageMap());
void write(std::ostream& output,unsigned int type=COMMAND_LINE_OPTION, unsigned int widthOfOutput=80,bool showDefaults=false);
void writeEnvironmentSettings(std::ostream& output);
protected:
virtual ~ApplicationUsage() {}
std::string _applicationName;
@ -103,11 +103,11 @@ class OSG_EXPORT ApplicationUsage : public osg::Referenced
UsageMap _keyboardMouse;
UsageMap _environmentalVariablesDefaults;
UsageMap _commandLineOptionsDefaults;
};
class ApplicationUsageProxy
{
{
public:
/** register an explanation of commandline/environmentvariable/keyboard mouse usage.*/

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -40,7 +40,7 @@ class OSG_EXPORT ArgumentParser
UNSIGNED_INT_PARAMETER,
STRING_PARAMETER
};
union ValueUnion
{
bool* _bool;
@ -54,13 +54,13 @@ class OSG_EXPORT ArgumentParser
Parameter(bool& value) { _type = BOOL_PARAMETER; _value._bool = &value; }
Parameter(float& value) { _type = FLOAT_PARAMETER; _value._float = &value; }
Parameter(double& value) { _type = DOUBLE_PARAMETER; _value._double = &value; }
Parameter(int& value) { _type = INT_PARAMETER; _value._int = &value; }
Parameter(unsigned int& value) { _type = UNSIGNED_INT_PARAMETER; _value._uint = &value; }
Parameter(std::string& value) { _type = STRING_PARAMETER; _value._string = &value; }
Parameter(const Parameter& param) { _type = param._type; _value = param._value; }
@ -71,7 +71,7 @@ class OSG_EXPORT ArgumentParser
bool assign(const char* str);
protected:
ParameterType _type;
ValueUnion _value;
};
@ -79,11 +79,11 @@ class OSG_EXPORT ArgumentParser
/** Return true if the specified string is an option in the form
* -option or --option. */
static bool isOption(const char* str);
/** Return true if string is non-NULL and not an option in the form
* -option or --option. */
static bool isString(const char* str);
/** Return true if specified parameter is a number. */
static bool isNumber(const char* str);
@ -120,20 +120,20 @@ class OSG_EXPORT ArgumentParser
/** Return true if the specified parameter is an option in the form of
* -option or --option. */
bool isOption(int pos) const;
/** Return true if the specified parameter is a string not in
* the form of an option. */
bool isString(int pos) const;
/** Return true if the specified parameter is a number. */
bool isNumber(int pos) const;
bool containsOptions() const;
/** Remove one or more arguments from the argv argument list,
* and decrement the argc respectively. */
void remove(int pos,int num=1);
/** Return true if the specified argument matches the given string. */
bool match(int pos, const std::string& str) const;
@ -180,32 +180,32 @@ class OSG_EXPORT ArgumentParser
/** For each remaining option, report it as unrecognized. */
void reportRemainingOptionsAsUnrecognized(ErrorSeverity severity=BENIGN);
/** Return the error message, if any has occurred. */
ErrorMessageMap& getErrorMessageMap() { return _errorMessageMap; }
/** Return the error message, if any has occurred. */
const ErrorMessageMap& getErrorMessageMap() const { return _errorMessageMap; }
/** Write error messages to the given ostream, if at or above the given severity. */
void writeErrorMessages(std::ostream& output,ErrorSeverity sevrity=BENIGN);
/** This convenience method handles help requests on the command line.
* Return the type(s) of help requested. The return value of this
* function is suitable for passing into getApplicationUsage()->write().
* If ApplicationUsage::NO_HELP is returned then no help commandline option
* If ApplicationUsage::NO_HELP is returned then no help commandline option
* was found on the command line. */
ApplicationUsage::Type readHelpType();
protected:
int* _argc;
char** _argv;
ErrorMessageMap _errorMessageMap;
ref_ptr<ApplicationUsage> _usage;
};
}

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -48,7 +48,7 @@ class OSG_EXPORT Array : public BufferData
{
public:
enum Type
{
ArrayType = 0,
@ -73,7 +73,7 @@ class OSG_EXPORT Array : public BufferData
Vec2dArrayType = 19,
Vec3dArrayType = 20,
Vec4dArrayType = 21,
MatrixArrayType = 22
MatrixArrayType = 22
};
Array(Type arrayType=ArrayType,GLint dataSize=0,GLenum dataType=0):
@ -144,28 +144,28 @@ class TemplateArray : public Array, public MixinVector<T>
Array(ta,copyop),
MixinVector<T>(ta) {}
TemplateArray(unsigned int no) :
TemplateArray(unsigned int no) :
Array(ARRAYTYPE,DataSize,DataType),
MixinVector<T>(no) {}
TemplateArray(unsigned int no,const T* ptr) :
TemplateArray(unsigned int no,const T* ptr) :
Array(ARRAYTYPE,DataSize,DataType),
MixinVector<T>(ptr,ptr+no) {}
template <class InputIterator>
TemplateArray(InputIterator first,InputIterator last) :
TemplateArray(InputIterator first,InputIterator last) :
Array(ARRAYTYPE,DataSize,DataType),
MixinVector<T>(first,last) {}
MixinVector<T>(first,last) {}
TemplateArray& operator = (const TemplateArray& array)
{
if (this==&array) return *this;
this->assign(array.begin(),array.end());
return *this;
}
}
virtual Object* cloneType() const { return new TemplateArray(); }
virtual Object* clone(const CopyOp& copyop) const { return new TemplateArray(*this,copyop); }
virtual Object* clone(const CopyOp& copyop) const { return new TemplateArray(*this,copyop); }
inline virtual void accept(ArrayVisitor& av);
inline virtual void accept(ConstArrayVisitor& av) const;
@ -195,7 +195,7 @@ class TemplateArray : public Array, public MixinVector<T>
typedef T ElementDataType; // expose T
protected:
virtual ~TemplateArray() {}
};
@ -230,28 +230,28 @@ class TemplateIndexArray : public IndexArray, public MixinVector<T>
IndexArray(ta,copyop),
MixinVector<T>(ta) {}
TemplateIndexArray(unsigned int no) :
TemplateIndexArray(unsigned int no) :
IndexArray(ARRAYTYPE,DataSize,DataType),
MixinVector<T>(no) {}
TemplateIndexArray(unsigned int no,T* ptr) :
TemplateIndexArray(unsigned int no,T* ptr) :
IndexArray(ARRAYTYPE,DataSize,DataType),
MixinVector<T>(ptr,ptr+no) {}
template <class InputIterator>
TemplateIndexArray(InputIterator first,InputIterator last) :
TemplateIndexArray(InputIterator first,InputIterator last) :
IndexArray(ARRAYTYPE,DataSize,DataType),
MixinVector<T>(first,last) {}
MixinVector<T>(first,last) {}
TemplateIndexArray& operator = (const TemplateIndexArray& array)
{
if (this==&array) return *this;
this->assign(array.begin(),array.end());
return *this;
}
}
virtual Object* cloneType() const { return new TemplateIndexArray(); }
virtual Object* clone(const CopyOp& copyop) const { return new TemplateIndexArray(*this,copyop); }
virtual Object* clone(const CopyOp& copyop) const { return new TemplateIndexArray(*this,copyop); }
inline virtual void accept(ArrayVisitor& av);
inline virtual void accept(ConstArrayVisitor& av) const;
@ -323,7 +323,7 @@ class ArrayVisitor
public:
ArrayVisitor() {}
virtual ~ArrayVisitor() {}
virtual void apply(Array&) {}
virtual void apply(ByteArray&) {}
virtual void apply(ShortArray&) {}
@ -337,12 +337,12 @@ class ArrayVisitor
virtual void apply(Vec2Array&) {}
virtual void apply(Vec3Array&) {}
virtual void apply(Vec4Array&) {}
virtual void apply(Vec4ubArray&) {}
virtual void apply(Vec2bArray&) {}
virtual void apply(Vec3bArray&) {}
virtual void apply(Vec4bArray&) {}
virtual void apply(Vec2bArray&) {}
virtual void apply(Vec3bArray&) {}
virtual void apply(Vec4bArray&) {}
virtual void apply(Vec2sArray&) {}
virtual void apply(Vec3sArray&) {}
@ -351,7 +351,7 @@ class ArrayVisitor
virtual void apply(Vec2dArray&) {}
virtual void apply(Vec3dArray&) {}
virtual void apply(Vec4dArray&) {}
virtual void apply(MatrixfArray&) {}
};
@ -360,7 +360,7 @@ class ConstArrayVisitor
public:
ConstArrayVisitor() {}
virtual ~ConstArrayVisitor() {}
virtual void apply(const Array&) {}
virtual void apply(const ByteArray&) {}
virtual void apply(const ShortArray&) {}
@ -377,9 +377,9 @@ class ConstArrayVisitor
virtual void apply(const Vec4ubArray&) {}
virtual void apply(const Vec2bArray&) {}
virtual void apply(const Vec3bArray&) {}
virtual void apply(const Vec4bArray&) {}
virtual void apply(const Vec2bArray&) {}
virtual void apply(const Vec3bArray&) {}
virtual void apply(const Vec4bArray&) {}
virtual void apply(const Vec2sArray&) {}
virtual void apply(const Vec3sArray&) {}
@ -388,7 +388,7 @@ class ConstArrayVisitor
virtual void apply(const Vec2dArray&) {}
virtual void apply(const Vec3dArray&) {}
virtual void apply(const Vec4dArray&) {}
virtual void apply(const MatrixfArray&) {}
};
@ -398,7 +398,7 @@ class ValueVisitor
public:
ValueVisitor() {}
virtual ~ValueVisitor() {}
virtual void apply(GLbyte&) {}
virtual void apply(GLshort&) {}
virtual void apply(GLint&) {}
@ -407,17 +407,17 @@ class ValueVisitor
virtual void apply(GLuint&) {}
virtual void apply(GLfloat&) {}
virtual void apply(GLdouble&) {}
virtual void apply(Vec2&) {}
virtual void apply(Vec3&) {}
virtual void apply(Vec4&) {}
virtual void apply(Vec4ub&) {}
virtual void apply(Vec2b&) {}
virtual void apply(Vec3b&) {}
virtual void apply(Vec4b&) {}
virtual void apply(Vec2b&) {}
virtual void apply(Vec3b&) {}
virtual void apply(Vec4b&) {}
virtual void apply(Vec2s&) {}
virtual void apply(Vec3s&) {}
@ -426,7 +426,7 @@ class ValueVisitor
virtual void apply(Vec2d&) {}
virtual void apply(Vec3d&) {}
virtual void apply(Vec4d&) {}
virtual void apply(Matrixf&) {}
};
@ -435,7 +435,7 @@ class ConstValueVisitor
public:
ConstValueVisitor() {}
virtual ~ConstValueVisitor() {}
virtual void apply(const GLbyte&) {}
virtual void apply(const GLshort&) {}
virtual void apply(const GLint&) {}
@ -453,16 +453,16 @@ class ConstValueVisitor
virtual void apply(const Vec2b&) {}
virtual void apply(const Vec3b&) {}
virtual void apply(const Vec4b&) {}
virtual void apply(const Vec4b&) {}
virtual void apply(const Vec2s&) {}
virtual void apply(const Vec3s&) {}
virtual void apply(const Vec4s&) {}
virtual void apply(const Vec2d&) {}
virtual void apply(const Vec3d&) {}
virtual void apply(const Vec4d&) {}
virtual void apply(const Matrixf&) {}
};

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -63,9 +63,9 @@ class OSG_EXPORT AudioStream : public osg::Object
virtual const char* className() const { return "AudioStream"; }
virtual void setAudioSink(osg::AudioSink* audio_sink) = 0;
virtual void consumeAudioBuffer(void * const buffer, const size_t size) = 0;
virtual int audioFrequency() const = 0;
virtual int audioNbChannels() const = 0;

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -34,7 +34,7 @@ class OSG_EXPORT Billboard : public Geode
};
Billboard();
/** Copy constructor using CopyOp to manage deep vs shallow copy. */
Billboard(const Billboard&,const CopyOp& copyop=CopyOp::SHALLOW_COPY);
@ -64,13 +64,13 @@ class OSG_EXPORT Billboard : public Geode
/** Type definition for pivot point position list. */
typedef std::vector<Vec3> PositionList;
/** Set the list of pivot point positions. */
inline void setPositionList(PositionList& pl) { _positionList=pl; }
/** Get the list of pivot point positions. */
inline PositionList& getPositionList() { return _positionList; }
/** Get a const list of pivot point positions. */
inline const PositionList& getPositionList() const { return _positionList; }
@ -93,7 +93,7 @@ class OSG_EXPORT Billboard : public Geode
* remove its pivot point position. and return true.
* Otherwise, return false. */
virtual bool removeDrawable( Drawable *gset );
bool computeMatrix(Matrix& modelview, const Vec3& eye_local, const Vec3& pos_local) const;
@ -118,7 +118,7 @@ class OSG_EXPORT Billboard : public Geode
Vec3 _normal;
Matrix _rotateNormalToZAxis;
PositionList _positionList;
// used internally as cache of which what _axis is aligned to help
// decide which method of rotation to use.
int _cachedMode;

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -29,16 +29,16 @@ class OSG_EXPORT BlendColor : public StateAttribute
public :
BlendColor();
BlendColor(const osg::Vec4& constantColor);
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
BlendColor(const BlendColor& trans,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
StateAttribute(trans,copyop),
_constantColor(trans._constantColor) {}
META_StateAttribute(osg, BlendColor,BLENDCOLOR);
/** Return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs. */
virtual int compare(const StateAttribute& sa) const
{
@ -71,34 +71,34 @@ class OSG_EXPORT BlendColor : public StateAttribute
/** Encapsulates queries of extension availability, obtains extension
* function pointers, and provides convenience wrappers for
* calling extension functions. */
* calling extension functions. */
class OSG_EXPORT Extensions : public osg::Referenced
{
public:
Extensions(unsigned int contextID);
Extensions(const Extensions& rhs);
void lowestCommonDenominator(const Extensions& rhs);
void setupGLExtensions(unsigned int contextID);
void setBlendColorSupported(bool flag) { _isBlendColorSupported=flag; }
bool isBlendColorSupported() const { return _isBlendColorSupported; }
void glBlendColor(GLclampf red , GLclampf green , GLclampf blue , GLclampf alpha) const;
protected:
~Extensions() {}
typedef void (GL_APIENTRY * GLBlendColorProc) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
bool _isBlendColorSupported;
GLBlendColorProc _glBlendColor;
};
/** Returns the Extensions object for the given context.
* If createIfNotInitalized is true and the Extensions object doesn't
* exist, getExtensions() creates it on the given context.

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -53,7 +53,7 @@ class OSG_EXPORT BlendEquation : public StateAttribute
};
BlendEquation();
BlendEquation(Equation equation);
BlendEquation(Equation equationRGB, Equation equationAlpha);
@ -65,7 +65,7 @@ class OSG_EXPORT BlendEquation : public StateAttribute
_equationAlpha(trans._equationAlpha){}
META_StateAttribute(osg, BlendEquation,BLENDEQUATION);
/** Return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs. */
virtual int compare(const StateAttribute& sa) const
{
@ -99,30 +99,30 @@ class OSG_EXPORT BlendEquation : public StateAttribute
virtual void apply(State& state) const;
/** Encapsulates queries of extension availability, obtains extension
* function pointers, and provides convenience wrappers for
* calling extension functions. */
* calling extension functions. */
class OSG_EXPORT Extensions : public osg::Referenced
{
public:
Extensions(unsigned int contextID);
Extensions(const Extensions& rhs);
void lowestCommonDenominator(const Extensions& rhs);
void setupGLExtensions(unsigned int contextID);
bool isBlendEquationSupported() const { return _isBlendEquationSupported; }
bool isBlendEquationSeparateSupported() const { return _isBlendEquationSeparateSupported; }
bool isSGIXMinMaxSupported() const { return _isSGIXMinMaxSupported; }
bool isLogicOpSupported() const { return _isLogicOpSupported; }
void glBlendEquation(GLenum mode) const;
void glBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha) const;
protected:
~Extensions() {}
typedef void (GL_APIENTRY * GLBlendEquationProc)(GLenum mode);
typedef void (GL_APIENTRY * GLBlendEquationSeparateProc)(GLenum modeRGB, GLenum modeAlpha);
@ -130,11 +130,11 @@ class OSG_EXPORT BlendEquation : public StateAttribute
bool _isBlendEquationSeparateSupported;
bool _isSGIXMinMaxSupported;
bool _isLogicOpSupported;
GLBlendEquationProc _glBlendEquation;
GLBlendEquationSeparateProc _glBlendEquationSeparate;
};
/** Returns the Extensions object for the given context.
* If createIfNotInitalized is true and the Extensions object doesn't
* exist, getExtensions() creates it on the given context.

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -68,7 +68,7 @@ class OSG_EXPORT BlendFunc : public StateAttribute
public :
BlendFunc();
BlendFunc(GLenum source, GLenum destination);
BlendFunc(GLenum source, GLenum destination, GLenum source_alpha, GLenum destination_alpha);
@ -81,7 +81,7 @@ class OSG_EXPORT BlendFunc : public StateAttribute
_destination_factor_alpha(trans._destination_factor_alpha) {}
META_StateAttribute(osg, BlendFunc,BLENDFUNC);
/** Return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs. */
virtual int compare(const StateAttribute& sa) const
{
@ -146,7 +146,7 @@ class OSG_EXPORT BlendFunc : public StateAttribute
void setSourceAlpha(GLenum source) { _source_factor_alpha = source; }
inline GLenum getSourceAlpha() const { return _source_factor_alpha; }
void setDestination(GLenum destination) { _destination_factor = _destination_factor_alpha = destination; }
inline GLenum getDestination() const { return _destination_factor; }
@ -159,7 +159,7 @@ class OSG_EXPORT BlendFunc : public StateAttribute
virtual void apply(State& state) const;
/** Encapsulates queries of extension availability, obtains extension
* function pointers, and provides convenience wrappers for
* calling extension functions. */
* calling extension functions. */
class OSG_EXPORT Extensions : public osg::Referenced
{
public:

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -35,7 +35,7 @@ class BoundingBoxImpl
public:
typedef VT vec_type;
typedef typename VT::value_type value_type;
/** Minimum extent. (Smallest X, Y, and Z values of all coordinates.) */
vec_type _min;
/** Maximum extent. (Greatest X, Y, and Z values of all coordinates.) */
@ -50,7 +50,7 @@ class BoundingBoxImpl
-FLT_MAX,
-FLT_MAX)
{}
/** Creates a bounding box initialized to the given extents. */
inline BoundingBoxImpl(value_type xmin, value_type ymin, value_type zmin,
value_type xmax, value_type ymax, value_type zmax) :
@ -58,7 +58,7 @@ class BoundingBoxImpl
_max(xmax,ymax,zmax) {}
/** Creates a bounding box initialized to the given extents. */
inline BoundingBoxImpl(const vec_type& min,const vec_type& max) :
inline BoundingBoxImpl(const vec_type& min,const vec_type& max) :
_min(min),
_max(max) {}
@ -72,8 +72,8 @@ class BoundingBoxImpl
-FLT_MAX,
-FLT_MAX);
}
/** Returns true if the bounding box extents are valid, false otherwise. */
/** Returns true if the bounding box extents are valid, false otherwise. */
inline bool valid() const
{
return _max.x()>=_min.x() && _max.y()>=_min.y() && _max.z()>=_min.z();
@ -97,19 +97,19 @@ class BoundingBoxImpl
inline value_type& xMin() { return _min.x(); }
inline value_type xMin() const { return _min.x(); }
inline value_type& yMin() { return _min.y(); }
inline value_type yMin() const { return _min.y(); }
inline value_type& zMin() { return _min.z(); }
inline value_type zMin() const { return _min.z(); }
inline value_type& xMax() { return _max.x(); }
inline value_type xMax() const { return _max.x(); }
inline value_type& yMax() { return _max.y(); }
inline value_type yMax() const { return _max.y(); }
inline value_type& zMax() { return _max.z(); }
inline value_type zMax() const { return _max.z(); }
@ -202,7 +202,7 @@ class BoundingBoxImpl
if(sh._center.z()-sh._radius<_min.z()) _min.z() = sh._center.z()-sh._radius;
if(sh._center.z()+sh._radius>_max.z()) _max.z() = sh._center.z()+sh._radius;
}
/** Returns the intersection of this bounding box and the specified bounding box. */
BoundingBoxImpl intersect(const BoundingBoxImpl& bb) const
@ -222,7 +222,7 @@ class BoundingBoxImpl
/** Returns true if this bounding box contains the specified coordinate. */
inline bool contains(const vec_type& v) const
{
return valid() &&
return valid() &&
(v.x()>=_min.x() && v.x()<=_max.x()) &&
(v.y()>=_min.y() && v.y()<=_max.y()) &&
(v.z()>=_min.z() && v.z()<=_max.z());

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -35,14 +35,14 @@ class BoundingSphereImpl
{
public:
typedef VT vec_type;
typedef typename VT::value_type value_type;
typedef typename VT::value_type value_type;
vec_type _center;
value_type _radius;
/** Construct a default bounding sphere with radius to -1.0f, representing an invalid/unset bounding sphere.*/
/** Construct a default bounding sphere with radius to -1.0f, representing an invalid/unset bounding sphere.*/
BoundingSphereImpl() : _center(0.0,0.0,0.0),_radius(-1.0) {}
/** Creates a bounding sphere initialized to the given extents. */
BoundingSphereImpl(const vec_type& center, value_type radius) : _center(center),_radius(radius) {}
@ -63,7 +63,7 @@ class BoundingSphereImpl
* otherwise. */
inline bool valid() const { return _radius>=0.0; }
/** Set the bounding sphere to the given center/radius using floats. */
/** Set the bounding sphere to the given center/radius using floats. */
inline void set(const vec_type& center,value_type radius)
{
_center = center;
@ -72,7 +72,7 @@ class BoundingSphereImpl
/** Returns the center of the bounding sphere. */
inline vec_type& center() { return _center; }
/** Returns the const center of the bounding sphere. */
inline const vec_type& center() const { return _center; }
@ -80,7 +80,7 @@ class BoundingSphereImpl
inline value_type& radius() { return _radius; }
/** Returns the const radius of the bounding sphere. */
inline value_type radius() const { return _radius; }
/** Returns the squared length of the radius. Note, For performance
* reasons, the calling method is responsible for checking to make
* sure the sphere is valid. */
@ -130,7 +130,7 @@ class BoundingSphereImpl
return valid() && bs.valid() &&
((_center - bs._center).length2() <= (_radius + bs._radius)*(_radius + bs._radius));
}
};
@ -187,26 +187,26 @@ void BoundingSphereImpl<VT>::expandBy(const BoundingSphereImpl& sh)
return;
}
// Calculate d == The distance between the sphere centers
// Calculate d == The distance between the sphere centers
double d = ( _center - sh.center() ).length();
// New sphere is already inside this one
if ( d + sh.radius() <= _radius )
if ( d + sh.radius() <= _radius )
{
return;
}
// New sphere completely contains this one
if ( d + _radius <= sh.radius() )
// New sphere completely contains this one
if ( d + _radius <= sh.radius() )
{
_center = sh._center;
_radius = sh._radius;
return;
}
// Build a new sphere that completely contains the other two:
//
// The center point lies halfway along the line between the furthest
@ -243,7 +243,7 @@ void BoundingSphereImpl<VT>::expandRadiusBy(const BoundingSphereImpl& sh)
}
}
template<typename VT>
template<typename VT>
void BoundingSphereImpl<VT>::expandBy(const BoundingBoxImpl<VT>& bb)
{
if (bb.valid())
@ -260,10 +260,10 @@ void BoundingSphereImpl<VT>::expandBy(const BoundingBoxImpl<VT>& bb)
v += _center; // move to absolute position.
newbb.expandBy(v); // add it into the new bounding box.
}
_center = newbb.center();
_radius = newbb.radius();
}
else
{
@ -299,7 +299,7 @@ typedef BoundingSphereImpl<Vec3d> BoundingSphered;
#ifdef OSG_USE_FLOAT_BOUNDINGSPHERE
typedef BoundingSpheref BoundingSphere;
#else
typedef BoundingSphered BoundingSphere;
typedef BoundingSphered BoundingSphere;
#endif
}

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -64,7 +64,7 @@ inline void clampBetweenRange(T& value,const T minValue,const T maxValue,const c
notify(WARN) << "Warning: "<<valueName<<" of "<<value<<" is above permitted maximum, clampping to "<<maxValue<<"."<< std::endl;
value = maxValue;
}
}
/** If value[i] is greater than or equal to minValue do nothing - legal value,
@ -112,7 +112,7 @@ inline void clampArrayElementBetweenRange(A& value,unsigned int i,const T minVal
notify(WARN) << "Warning: "<<valueName<<"["<<i<<"] of "<<value[i]<<" is above permitted maximum, clampping to "<<maxValue<<"."<< std::endl;
value[i] = maxValue;
}
}
/** For each element of value[] in the range (first,last), if the element is
@ -145,7 +145,7 @@ template <typename A, typename T>
inline void clampArrayElementsBetweenRange(A& value,unsigned int first,unsigned int last,const T minValue,const T maxValue,const char* valueName)
{
for(unsigned int i=first;i<=last;++i)
clampArrayElementBetweenRange(value,i,minValue,maxValue,valueName);
clampArrayElementBetweenRange(value,i,minValue,maxValue,valueName);
}

View File

@ -1,14 +1,14 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
* Copyright (C) 2010 Tim Moore
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -45,7 +45,7 @@ class OSG_EXPORT BufferIndexBinding : public StateAttribute
// the State class. Using the index target, we can seperately
// track the bindings for many different index targets.
virtual unsigned getMember() const { return static_cast<unsigned int>(_index); }
GLenum getTarget() const { return _target; }
/** Get the index target.
*/

View File

@ -4,7 +4,7 @@
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@ -27,7 +27,7 @@
#if (defined(GL_VERSION_ES_CM_1_0) && GL_VERSION_ES_CM_1_0 > 0) || \
(defined(GL_VERSION_ES_CM_1_1) && GL_VERSION_ES_CM_1_1 > 0)
#define OPENGLES_1_1_FOUND 1
#define OPENGLES_1_1_FOUND 1
#endif
@ -50,10 +50,10 @@
#ifndef GL_ARB_vertex_buffer_object
#define GL_ARB_vertex_buffer_object
typedef GLintptr GLintptrARB;
typedef GLsizeiptr GLsizeiptrARB;
#define GL_ARRAY_BUFFER_ARB 0x8892
#define GL_ELEMENT_ARRAY_BUFFER_ARB 0x8893
#define GL_ARRAY_BUFFER_BINDING_ARB 0x8894
@ -114,7 +114,7 @@
#define GL_PIXEL_UNPACK_BUFFER_BINDING_ARB 0x88EF
#endif
namespace osg
namespace osg
{
class State;
@ -226,7 +226,7 @@ class OSG_EXPORT GLBufferObject : public Referenced
inline void bindBuffer();
inline void unbindBuffer()
{
{
_extensions->glBindBuffer(_profile._target,0);
}
@ -321,9 +321,9 @@ class OSG_EXPORT GLBufferObject : public Referenced
};
/** Function to call to get the extension of a specified context.
* If the Extension object for that context has not yet been created
* If the Extension object for that context has not yet been created
* and the 'createIfNotInitalized' flag been set to false then returns NULL.
* If 'createIfNotInitalized' is true then the Extensions object is
* If 'createIfNotInitalized' is true then the Extensions object is
* automatically created. However, in this case the extension object is
* only created with the graphics context associated with ContextID..*/
static Extensions* getExtensions(unsigned int contextID,bool createIfNotInitalized);
@ -723,7 +723,7 @@ class OSG_EXPORT ElementBufferObject : public BufferObject
ElementBufferObject(const ElementBufferObject& pbo,const CopyOp& copyop=CopyOp::SHALLOW_COPY);
META_Object(osg,ElementBufferObject);
unsigned int addDrawElements(osg::DrawElements* PrimitiveSet);
void removeDrawElements(osg::DrawElements* PrimitiveSet);
@ -732,7 +732,7 @@ class OSG_EXPORT ElementBufferObject : public BufferObject
const DrawElements* getDrawElements(unsigned int i) const;
protected:
virtual ~ElementBufferObject();
};
@ -756,7 +756,7 @@ class OSG_EXPORT PixelBufferObject : public BufferObject
bool isPBOSupported(unsigned int contextID) const { return _glBufferObjects[contextID]->isPBOSupported(); }
protected:
virtual ~PixelBufferObject();
};
@ -777,7 +777,7 @@ class OSG_EXPORT PixelDataBufferObject : public BufferObject
//! Set new size of the buffer object. This will reallocate the memory on the next compile
inline void setDataSize(unsigned int size) { _profile._size = size; dirty(); }
//! Get data size of the used buffer
//! Get data size of the used buffer
inline unsigned int getDataSize() const { return _profile._size; }
//! Compile the buffer (reallocate the memory if buffer is dirty)
@ -789,7 +789,7 @@ class OSG_EXPORT PixelDataBufferObject : public BufferObject
//! Bind the buffer in write mode, which means following OpenGL instructions will write data into the buffer (note: GL_PIXEL_PACK_BUFFER_ARB)
virtual void bindBufferInWriteMode(State& state);
//! Unbind the buffer
//! Unbind the buffer
virtual void unbindBuffer(unsigned int contextID) const;
/** Resize any per context GLObject buffers to specified size. */
@ -814,9 +814,9 @@ class OSG_EXPORT PixelDataBufferObject : public BufferObject
virtual ~PixelDataBufferObject();
typedef osg::buffered_value<unsigned int> ModeList;
mutable ModeList _mode;
};
class OSG_EXPORT UniformBufferObject : public BufferObject

View File

@ -58,7 +58,7 @@ class OSG_EXPORT Camera : public Transform, public CullSettings
const View* getView() const { return _view; }
/** Set the Stats object used for collect various frame related
/** Set the Stats object used for collect various frame related
* timing and scene graph stats. */
void setStats(osg::Stats* stats) { _stats = stats; }
@ -69,7 +69,7 @@ class OSG_EXPORT Camera : public Transform, public CullSettings
const osg::Stats* getStats() const { return _stats.get(); }
/** Set whether this camera allows events to be generated by the
/** Set whether this camera allows events to be generated by the
* associated graphics window to be associated with this camera. */
void setAllowEventFocus(bool focus) { _allowEventFocus = focus; }
@ -421,14 +421,14 @@ class OSG_EXPORT Camera : public Transform, public CullSettings
Camera defaults are USE_DISPLAY_SETTINGS_MASK which means that by default
Camera chooses to substitue buffer attachments as defined by DisplaySettings.
Usually DisplaySettings implicit buffer attachment selection defaults to: DEPTH and COLOR
Usually DisplaySettings implicit buffer attachment selection defaults to: DEPTH and COLOR
for both primary (Render) FBO and seconday Multisample (Resolve) FBO
ie: IMPLICT_DEPTH_BUFFER_ATTACHMENT | IMPLICIT_COLOR_BUFFER_ATTACHMENT
If these masks are not changed and user did not attach depth buffer and/or color buffer
If these masks are not changed and user did not attach depth buffer and/or color buffer
to Camera, then OSG implicitly substitues these buffers.
By default it does not implicitly allocate a stencil buffer.
Use implicti buffer attachment masks to override default behavior:
Use implicti buffer attachment masks to override default behavior:
to turn off DEPTH or COLOR buffer substitution or to enforce STENCIL buffer substitution.
Note that both values are ignored if not using FBO.
@ -460,13 +460,13 @@ class OSG_EXPORT Camera : public Transform, public CullSettings
_implicitBufferAttachmentResolveMask = implicitBufferAttachmentResolveMask;
}
/**
Get mask selecting implict buffer attachments for Camera primary FBO
/**
Get mask selecting implict buffer attachments for Camera primary FBO
if effectiveMask parameter is set, method follows USE_DISPLAY_SETTINGS_MASK dependence and returns effective mask
if effectiveMask parameter is reset, method returns nominal mask set by the Camera
*/
ImplicitBufferAttachmentMask getImplicitBufferAttachmentRenderMask(bool effectiveMask = false) const
{
{
if( effectiveMask && _implicitBufferAttachmentRenderMask == USE_DISPLAY_SETTINGS_MASK )
{
const DisplaySettings * ds = _displaySettings.valid() ? _displaySettings.get() : DisplaySettings::instance().get();
@ -478,13 +478,13 @@ class OSG_EXPORT Camera : public Transform, public CullSettings
}
}
/**
Get mask selecting implict buffer attachments for Camera secondary MULTISAMPLE FBO
/**
Get mask selecting implict buffer attachments for Camera secondary MULTISAMPLE FBO
if effectiveMask parameter is set, method follows USE_DISPLAY_SETTINGS_MASK dependence and returns effective mask
if effectiveMask parameter is reset, method returns nominal mask set by the Camera
*/
ImplicitBufferAttachmentMask getImplicitBufferAttachmentResolveMask(bool effectiveMask = false) const
{
{
if( effectiveMask && _implicitBufferAttachmentResolveMask == USE_DISPLAY_SETTINGS_MASK )
{
const DisplaySettings * ds = _displaySettings.valid() ? _displaySettings.get() : DisplaySettings::instance().get();

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -38,7 +38,7 @@ class OSG_EXPORT CameraView : public Transform
_fieldOfView(pat._fieldOfView),
_fieldOfViewMode(pat._fieldOfViewMode),
_focalLength(pat._focalLength) {}
META_Node(osg, CameraView);
@ -62,7 +62,7 @@ class OSG_EXPORT CameraView : public Transform
/** Get the field of view.*/
inline double getFieldOfView() const { return _fieldOfView; }
enum FieldOfViewMode
{
UNCONSTRAINED,
@ -83,14 +83,14 @@ class OSG_EXPORT CameraView : public Transform
/** Get the focal length of the camera.*/
inline double getFocalLength() const { return _focalLength; }
virtual bool computeLocalToWorldMatrix(Matrix& matrix,NodeVisitor* nv) const;
virtual bool computeWorldToLocalMatrix(Matrix& matrix,NodeVisitor* nv) const;
protected :
virtual ~CameraView() {}
Vec3d _position;

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -44,7 +44,7 @@ class OSG_EXPORT ClampColor : public StateAttribute
public :
ClampColor();
ClampColor(GLenum vertexMode, GLenum fragmentMode, GLenum readMode);
/** Copy constructor using CopyOp to manage deep vs shallow copy. */
@ -55,7 +55,7 @@ class OSG_EXPORT ClampColor : public StateAttribute
_clampReadColor(rhs._clampReadColor) {}
META_StateAttribute(osg, ClampColor,CLAMPCOLOR);
/** Return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs. */
virtual int compare(const StateAttribute& sa) const
{
@ -80,37 +80,37 @@ class OSG_EXPORT ClampColor : public StateAttribute
void setClampReadColor(GLenum mode) { _clampReadColor = mode; }
GLenum getClampReadColor() const { return _clampReadColor; }
virtual void apply(State& state) const;
/** Encapsulates queries of extension availability, obtains extension
* function pointers, and provides convenience wrappers for
* calling extension functions. */
* calling extension functions. */
class OSG_EXPORT Extensions : public osg::Referenced
{
public:
Extensions(unsigned int contextID);
Extensions(const Extensions& rhs);
void lowestCommonDenominator(const Extensions& rhs);
void setupGLExtensions(unsigned int contextID);
void setClampColorSupported(bool flag) { _isClampColorSupported=flag; }
bool isClampColorSupported() const { return _isClampColorSupported; }
void glClampColor(GLenum target, GLenum mode) const;
protected:
~Extensions() {}
typedef void (GL_APIENTRY * GLClampColorProc) (GLenum target, GLenum mode);
bool _isClampColorSupported;
GLClampColorProc _glClampColor;
};
/** Returns the Extensions object for the given context.
* If createIfNotInitalized is true and the Extensions object doesn't
* exist, getExtensions() creates it on the given context.

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -30,14 +30,14 @@ namespace osg {
class OSG_EXPORT ClearNode : public Group
{
public :
ClearNode();
ClearNode(const ClearNode& cs, const CopyOp& copyop=CopyOp::SHALLOW_COPY):
Group(cs,copyop),
_requiresClear(cs._requiresClear),
_clearColor(cs._clearColor),
_clearMask(cs._clearMask) {}
_clearMask(cs._clearMask) {}
META_Node(osg, ClearNode);
@ -53,7 +53,7 @@ class OSG_EXPORT ClearNode : public Group
/** Returns the clear color. */
inline const Vec4& getClearColor() const { return _clearColor; }
/** Set the clear mask used in glClear(..).
* Defaults to GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT. */
inline void setClearMask(GLbitfield mask) { _clearMask = mask; }
@ -62,9 +62,9 @@ class OSG_EXPORT ClearNode : public Group
inline GLbitfield getClearMask() const { return _clearMask; }
protected :
virtual ~ClearNode() {}
bool _requiresClear;
Vec4 _clearColor;
GLbitfield _clearMask;

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -33,13 +33,13 @@ class OSG_EXPORT ClipNode : public Group
ClipNode(const ClipNode& es, const CopyOp& copyop=CopyOp::SHALLOW_COPY);
META_Node(osg, ClipNode);
enum ReferenceFrame
{
RELATIVE_RF,
ABSOLUTE_RF
};
/** Set the ClipNode's ReferenceFrame, either to be relative to its
* parent reference frame, or relative to an absolute coordinate
* frame. RELATIVE_RF is the default.
@ -52,7 +52,7 @@ class OSG_EXPORT ClipNode : public Group
* absolute ClipNode at the top of the scene.
*/
void setReferenceFrame(ReferenceFrame rf);
ReferenceFrame getReferenceFrame() const { return _referenceFrame; }
@ -104,7 +104,7 @@ class OSG_EXPORT ClipNode : public Group
StateAttribute::GLModeValue _value;
ClipPlaneList _planes;
ReferenceFrame _referenceFrame;
};

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -51,14 +51,14 @@ class OSG_EXPORT ClipPlane : public StateAttribute
_clipPlane[3]=cp._clipPlane[3];
_clipPlaneNum=cp._clipPlaneNum;
}
virtual osg::Object* cloneType() const { return new ClipPlane( _clipPlaneNum ); }
virtual osg::Object* clone(const osg::CopyOp& copyop) const { return new ClipPlane(*this,copyop); }
virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast<const ClipPlane *>(obj)!=NULL; }
virtual const char* libraryName() const { return "osg"; }
virtual const char* className() const { return "ClipPlane"; }
virtual Type getType() const { return CLIPPLANE; }
/** Return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs. */
virtual int compare(const StateAttribute& sa) const
{
@ -86,7 +86,7 @@ class OSG_EXPORT ClipPlane : public StateAttribute
/** Set the clip plane with the given Plane. */
void setClipPlane(const Plane& plane)
void setClipPlane(const Plane& plane)
{
_clipPlane.set(plane[0],plane[1],plane[2],plane[3]);
}
@ -114,9 +114,9 @@ class OSG_EXPORT ClipPlane : public StateAttribute
virtual void apply(State& state) const;
protected :
virtual ~ClipPlane();
Vec4d _clipPlane;
unsigned int _clipPlaneNum;

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -36,7 +36,7 @@ class OSG_EXPORT ClusterCullingCallback : public Drawable::CullCallback, public
/** Computes the control point, normal, and deviation from the
* given drawable contents. */
void computeFrom(const osg::Drawable* drawable);
/** Transform the ClusterCullingCallback's positional members to a new coordinate frame.*/
void transform(const osg::Matrixd& matrix);

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -39,7 +39,7 @@ class OSG_EXPORT CollectOccludersVisitor : public osg::NodeVisitor, public osg::
virtual float getDistanceToEyePoint(const Vec3& pos, bool withLODScale) const;
virtual float getDistanceToViewPoint(const Vec3& pos, bool withLODScale) const;
virtual float getDistanceFromEyePoint(const Vec3& pos, bool withLODScale) const;
virtual void apply(osg::Node&);
@ -81,7 +81,7 @@ class OSG_EXPORT CollectOccludersVisitor : public osg::NodeVisitor, public osg::
/** Prevents unwanted copy operator. */
CollectOccludersVisitor& operator = (const CollectOccludersVisitor&) { return *this; }
inline void handle_cull_callbacks_and_traverse(osg::Node& node)
{
/*osg::NodeCallback* callback = node.getCullCallback();

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -20,12 +20,12 @@
namespace osg {
/** Encapsulates OpenGL glColorMaskFunc/Op/Mask functions.
*/
*/
class OSG_EXPORT ColorMask : public StateAttribute
{
public :
ColorMask();
ColorMask(bool red,bool green,bool blue,bool alpha):
@ -33,7 +33,7 @@ class OSG_EXPORT ColorMask : public StateAttribute
_green(green),
_blue(blue),
_alpha(alpha) {}
/** Copy constructor using CopyOp to manage deep vs shallow copy. */
ColorMask(const ColorMask& cm,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
@ -42,9 +42,9 @@ class OSG_EXPORT ColorMask : public StateAttribute
_green(cm._green),
_blue(cm._blue),
_alpha(cm._alpha) {}
META_StateAttribute(osg, ColorMask, COLORMASK);
/** Return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs. */
virtual int compare(const StateAttribute& sa) const
{
@ -67,9 +67,9 @@ class OSG_EXPORT ColorMask : public StateAttribute
_green = green;
_blue = blue;
_alpha = alpha;
}
inline void setRedMask(bool mask) { _red=mask; }
inline bool getRedMask() const { return _red; }
@ -78,14 +78,14 @@ class OSG_EXPORT ColorMask : public StateAttribute
inline void setBlueMask(bool mask) { _blue=mask; }
inline bool getBlueMask() const { return _blue; }
inline void setAlphaMask(bool mask) { _alpha=mask; }
inline bool getAlphaMask() const { return _alpha; }
virtual void apply(State& state) const;
protected:
virtual ~ColorMask();
bool _red;

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -23,7 +23,7 @@ namespace osg {
class OSG_EXPORT ColorMatrix : public StateAttribute
{
public :
ColorMatrix();
/** Copy constructor using CopyOp to manage deep vs shallow copy. */
@ -32,7 +32,7 @@ class OSG_EXPORT ColorMatrix : public StateAttribute
_matrix(cm._matrix) {}
META_StateAttribute(osg, ColorMatrix, COLORMATRIX);
/** Return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs. */
virtual int compare(const StateAttribute& sa) const
{

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -25,31 +25,31 @@ class OSG_EXPORT ComputeBoundsVisitor : public osg::NodeVisitor
public:
ComputeBoundsVisitor(TraversalMode traversalMode = TRAVERSE_ALL_CHILDREN);
META_NodeVisitor("osg","ComputeBoundsVisitor")
virtual void reset();
osg::BoundingBox& getBoundingBox() { return _bb; }
void getPolytope(osg::Polytope& polytope, float margin=0.1) const;
void getBase(osg::Polytope& polytope, float margin=0.1) const;
void apply(osg::Node& node);
void apply(osg::Transform& transform);
void apply(osg::Geode& geode);
inline void pushMatrix(osg::Matrix& matrix) { _matrixStack.push_back(matrix); }
inline void popMatrix() { _matrixStack.pop_back(); }
void applyDrawable(osg::Drawable* drawable);
protected:
typedef std::vector<osg::Matrix> MatrixStack;
MatrixStack _matrixStack;

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -32,25 +32,25 @@ class OSG_EXPORT ConvexPlanarOccluder : public Object
Object(cpo,copyop),
_occluder(cpo._occluder),
_holeList(cpo._holeList) {}
META_Object(osg,ConvexPlanarOccluder);
void setOccluder(const ConvexPlanarPolygon& cpp) { _occluder = cpp; }
ConvexPlanarPolygon& getOccluder() { return _occluder; }
const ConvexPlanarPolygon& getOccluder() const { return _occluder; }
typedef std::vector<ConvexPlanarPolygon> HoleList;
void addHole(const ConvexPlanarPolygon& cpp) { _holeList.push_back(cpp); }
void setHoleList(const HoleList& holeList) { _holeList=holeList; }
HoleList& getHoleList() { return _holeList; }
const HoleList& getHoleList() const { return _holeList; }
protected:
@ -64,4 +64,4 @@ class OSG_EXPORT ConvexPlanarOccluder : public Object
} // end of namespace
#endif
#endif

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -27,17 +27,17 @@ class OSG_EXPORT ConvexPlanarPolygon
public:
ConvexPlanarPolygon();
typedef std::vector<osg::Vec3> VertexList;
void add(const Vec3& v) { _vertexList.push_back(v); }
void setVertexList(const VertexList& vertexList) { _vertexList=vertexList; }
VertexList& getVertexList() { return _vertexList; }
const VertexList& getVertexList() const { return _vertexList; }
protected:
VertexList _vertexList;
@ -46,4 +46,4 @@ class OSG_EXPORT ConvexPlanarPolygon
} // end of namespace
#endif
#endif

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -24,7 +24,7 @@ const double WGS_84_RADIUS_EQUATOR = 6378137.0;
const double WGS_84_RADIUS_POLAR = 6356752.3142;
/** EllipsoidModel encapsulates the ellipsoid used to model astronomical bodies,
* such as sun, planets, moon etc.
* such as sun, planets, moon etc.
* All distance quantities (i.e. heights + radius) are in meters,
* and latitude and longitude are in radians.*/
class EllipsoidModel : public Object
@ -87,7 +87,7 @@ class EllipsoidModel : public Object
};
/** CoordinateFrame encapsulates the orientation of east, north and up.*/
/** CoordinateFrame encapsulates the orientation of east, north and up.*/
typedef Matrixd CoordinateFrame;
/** CoordinateSystem encapsulate the coordinate system that is associated with objects in a scene.
@ -102,45 +102,45 @@ class OSG_EXPORT CoordinateSystemNode : public Group
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
CoordinateSystemNode(const CoordinateSystemNode&,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY);
META_Node(osg,CoordinateSystemNode);
/** Set the coordinate system node up by copying the format, coordinate system string, and ellipsoid model of another coordinate system node.*/
void set(const CoordinateSystemNode& csn);
/** Set the coordinate system format string. Typical values would be WKT, PROJ4, USGS etc.*/
void setFormat(const std::string& format) { _format = format; }
/** Get the coordinate system format string.*/
const std::string& getFormat() const { return _format; }
/** Set the CoordinateSystem reference string, should be stored in a form consistent with the Format.*/
void setCoordinateSystem(const std::string& cs) { _cs = cs; }
/** Get the CoordinateSystem reference string.*/
const std::string& getCoordinateSystem() const { return _cs; }
/** Set EllipsoidModel to describe the model used to map lat, long and height into geocentric XYZ and back. */
void setEllipsoidModel(EllipsoidModel* ellipsode) { _ellipsoidModel = ellipsode; }
/** Get the EllipsoidModel.*/
EllipsoidModel* getEllipsoidModel() { return _ellipsoidModel.get(); }
/** Get the const EllipsoidModel.*/
const EllipsoidModel* getEllipsoidModel() const { return _ellipsoidModel.get(); }
/** Compute the local coordinate frame for specified point.*/
CoordinateFrame computeLocalCoordinateFrame(const Vec3d& position) const;
/** Compute the local up-vector for specified point.*/
osg::Vec3d computeLocalUpVector(const Vec3d& position) const;
protected:
virtual ~CoordinateSystemNode() {}
std::string _format;
std::string _cs;
ref_ptr<EllipsoidModel> _ellipsoidModel;

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -40,7 +40,7 @@ class OSG_EXPORT CopyOp
{
public:
enum Options
{
SHALLOW_COPY = 0,
@ -84,7 +84,7 @@ class OSG_EXPORT CopyOp
virtual StateAttributeCallback* operator() (const StateAttributeCallback* stateattributecallback) const;
protected:
CopyFlags _flags;
};

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -20,17 +20,17 @@
namespace osg {
/** Class to globally enable/disable OpenGL's polygon culling mode.
*/
*/
class OSG_EXPORT CullFace : public StateAttribute
{
public :
enum Mode {
FRONT = GL_FRONT,
BACK = GL_BACK,
FRONT_AND_BACK = GL_FRONT_AND_BACK
};
CullFace(Mode mode=BACK):
_mode(mode) {}
@ -40,7 +40,7 @@ class OSG_EXPORT CullFace : public StateAttribute
_mode(cf._mode) {}
META_StateAttribute(osg, CullFace, CULLFACE);
/** return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.*/
virtual int compare(const StateAttribute& sa) const
{
@ -63,13 +63,13 @@ class OSG_EXPORT CullFace : public StateAttribute
inline void setMode(Mode mode) { _mode = mode; }
inline Mode getMode() const { return _mode; }
virtual void apply(State& state) const;
protected:
virtual ~CullFace();
Mode _mode;
};

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -44,7 +44,7 @@ class OSG_EXPORT CullSettings
CullSettings(const CullSettings& cs);
virtual ~CullSettings() {}
CullSettings& operator = (const CullSettings& settings)
{
if (this==&settings) return *this;
@ -55,7 +55,7 @@ class OSG_EXPORT CullSettings
virtual void setDefaults();
enum VariablesMask
{
COMPUTE_NEAR_FAR_MODE = (0x1 << 0),
@ -89,7 +89,7 @@ class OSG_EXPORT CullSettings
/** Get the inheritance mask used in inheritCullSettings to control which variables get overwritten by the passed in CullSettings object.*/
InheritanceMask getInheritanceMask() const { return _inheritanceMask; }
/** Set the local cull settings values from specified CullSettings object.*/
void setCullSettings(const CullSettings& settings);
@ -111,7 +111,7 @@ class OSG_EXPORT CullSettings
DISABLE_ASSOCIATED_INHERITANCE_MASK_BIT,
DO_NOT_MODIFY_INHERITANCE_MASK
};
void setInheritanceMaskActionOnAttributeSetting(InheritanceMaskActionOnAttributeSetting action) { _inheritanceMaskActionOnAttributeSetting = action; }
InheritanceMaskActionOnAttributeSetting getInheritanceMaskActionOnAttributeSetting() const { return _inheritanceMaskActionOnAttributeSetting; }
@ -165,8 +165,8 @@ class OSG_EXPORT CullSettings
COMPUTE_NEAR_USING_PRIMITIVES
};
void setComputeNearFarMode(ComputeNearFarMode cnfm) { _computeNearFar=cnfm; applyMaskAction(COMPUTE_NEAR_FAR_MODE); }
ComputeNearFarMode getComputeNearFarMode() const { return _computeNearFar;}
void setComputeNearFarMode(ComputeNearFarMode cnfm) { _computeNearFar=cnfm; applyMaskAction(COMPUTE_NEAR_FAR_MODE); }
ComputeNearFarMode getComputeNearFarMode() const { return _computeNearFar;}
void setNearFarRatio(double ratio) { _nearFarRatio = ratio; applyMaskAction(NEAR_FAR_RATIO); }
double getNearFarRatio() const { return _nearFarRatio; }
@ -192,12 +192,12 @@ class OSG_EXPORT CullSettings
SHADOW_OCCLUSION_CULLING|
CLUSTER_CULLING
};
typedef int CullingMode;
/** Set the culling mode for the CullVisitor to use.*/
void setCullingMode(CullingMode mode) { _cullingMode = mode; applyMaskAction(CULLING_MODE); }
/** Returns the current CullingMode.*/
CullingMode getCullingMode() const { return _cullingMode; }
@ -213,7 +213,7 @@ class OSG_EXPORT CullSettings
/** Set the LOD bias for the CullVisitor to use.*/
void setLODScale(float scale) { _LODScale = scale; applyMaskAction(LOD_SCALE); }
/** Get the LOD bias.*/
float getLODScale() const { return _LODScale; }
@ -234,7 +234,7 @@ class OSG_EXPORT CullSettings
virtual bool clampProjectionMatrixImplementation(osg::Matrixf& projection, double& znear, double& zfar) const = 0;
virtual bool clampProjectionMatrixImplementation(osg::Matrixd& projection, double& znear, double& zfar) const = 0;
};
/** set the ClampProjectionMatrixCallback.*/
void setClampProjectionMatrixCallback(ClampProjectionMatrixCallback* cpmc) { _clampProjectionMatrixCallback = cpmc; applyMaskAction(CLAMP_PROJECTION_MATRIX_CALLBACK); }
/** get the non const ClampProjectionMatrixCallback.*/
@ -261,12 +261,12 @@ class OSG_EXPORT CullSettings
bool _impostorActive;
bool _depthSortImpostorSprites;
float _impostorPixelErrorThreshold;
int _numFramesToKeepImpostorSprites;
int _numFramesToKeepImpostorSprites;
Node::NodeMask _cullMask;
Node::NodeMask _cullMaskLeft;
Node::NodeMask _cullMaskRight;
};

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -28,17 +28,17 @@ class OSG_EXPORT CullStack : public osg::CullSettings
{
public:
CullStack();
CullStack(const CullStack& cs);
~CullStack();
typedef std::vector<ShadowVolumeOccluder> OccluderList;
void reset();
void pushCullingSet();
void popCullingSet();
@ -63,7 +63,7 @@ class OSG_EXPORT CullStack : public osg::CullSettings
{
return getCurrentCullingSet().pixelSize(v,radius);
}
/** Compute the pixel size of the bounding sphere.*/
float pixelSize(const BoundingSphere& bs) const
{
@ -75,7 +75,7 @@ class OSG_EXPORT CullStack : public osg::CullSettings
{
return getCurrentCullingSet().clampedPixelSize(v,radius);
}
/** Compute the pixel size of the bounding sphere. fabs()ed to always be positive. */
float clampedPixelSize(const BoundingSphere& bs) const
{
@ -101,12 +101,12 @@ class OSG_EXPORT CullStack : public osg::CullSettings
{
return bb.valid() && getCurrentCullingSet().isCulled(bb);
}
inline bool isCulled(const BoundingSphere& bs)
{
return getCurrentCullingSet().isCulled(bs);
}
inline bool isCulled(const osg::Node& node)
{
return node.isCullingActive() && getCurrentCullingSet().isCulled(node.getBound());
@ -116,30 +116,30 @@ class OSG_EXPORT CullStack : public osg::CullSettings
{
getCurrentCullingSet().pushCurrentMask();
}
inline void popCurrentMask()
{
getCurrentCullingSet().popCurrentMask();
}
typedef std::vector< CullingSet > CullingStack;
inline CullingStack& getClipSpaceCullingStack() { return _clipspaceCullingStack; }
inline CullingStack& getProjectionCullingStack() { return _projectionCullingStack; }
inline CullingStack& getModelViewCullingStack() { return _modelviewCullingStack; }
inline CullingSet& getCurrentCullingSet() { return *_back_modelviewCullingStack; }
inline const CullingSet& getCurrentCullingSet() const { return *_back_modelviewCullingStack; }
inline osg::Viewport* getViewport();
inline osg::RefMatrix* getModelViewMatrix();
inline osg::RefMatrix* getProjectionMatrix();
inline osg::Matrix getWindowMatrix();
inline const osg::RefMatrix* getMVPW();
inline const osg::Vec3& getReferenceViewPoint() const { return _referenceViewPoints.back(); }
inline void pushReferenceViewPoint(const osg::Vec3& viewPoint) { _referenceViewPoints.push_back(viewPoint); }
inline void popReferenceViewPoint() { _referenceViewPoints.pop_back(); }
@ -159,10 +159,10 @@ class OSG_EXPORT CullStack : public osg::CullSettings
const osg::Matrix& matrix = *_modelviewStack.back();
return osg::Vec3(-matrix(0,2),-matrix(1,2),-matrix(2,2));
}
protected:
// base set of shadow volume occluder to use in culling.
ShadowVolumeOccluderList _occluderList;
@ -175,7 +175,7 @@ class OSG_EXPORT CullStack : public osg::CullSettings
typedef fast_back_stack<ref_ptr<Viewport> > ViewportStack;
ViewportStack _viewportStack;
typedef fast_back_stack<Vec3> EyePointStack;
EyePointStack _referenceViewPoints;
EyePointStack _eyePointStack;
@ -195,14 +195,14 @@ class OSG_EXPORT CullStack : public osg::CullSettings
unsigned int _bbCornerFar;
ref_ptr<osg::RefMatrix> _identity;
typedef std::vector< osg::ref_ptr<osg::RefMatrix> > MatrixList;
MatrixList _reuseMatrixList;
unsigned int _currentReuseMatrixIndex;
inline osg::RefMatrix* createOrReuseMatrix(const osg::Matrix& value);
};
inline osg::Viewport* CullStack::getViewport()
@ -275,7 +275,7 @@ inline const osg::RefMatrix* CullStack::getMVPW()
inline RefMatrix* CullStack::createOrReuseMatrix(const osg::Matrix& value)
{
// skip of any already reused matrix.
while (_currentReuseMatrixIndex<_reuseMatrixList.size() &&
while (_currentReuseMatrixIndex<_reuseMatrixList.size() &&
_reuseMatrixList[_currentReuseMatrixIndex]->referenceCount()>1)
{
++_currentReuseMatrixIndex;
@ -299,4 +299,4 @@ inline RefMatrix* CullStack::createOrReuseMatrix(const osg::Matrix& value)
} // end of namespace
#endif
#endif

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -32,8 +32,8 @@ class OSG_EXPORT CullingSet : public Referenced
public:
typedef std::pair< osg::ref_ptr<osg::StateSet>, osg::Polytope > StateFrustumPair;
typedef std::vector< StateFrustumPair > StateFrustumList;
typedef std::vector< StateFrustumPair > StateFrustumList;
CullingSet();
CullingSet(const CullingSet& cs):
@ -63,18 +63,18 @@ class OSG_EXPORT CullingSet : public Referenced
itr->transformProvidingInverse(matrix);
}
}
CullingSet& operator = (const CullingSet& cs)
{
if (this==&cs) return *this;
_mask = cs._mask;
_frustum = cs._frustum;
_stateFrustumList = cs._stateFrustumList;
_occluderList = cs._occluderList;
_pixelSizeVector = cs._pixelSizeVector;
_smallFeatureCullingPixelSize = cs._smallFeatureCullingPixelSize;
return *this;
}
@ -88,7 +88,7 @@ class OSG_EXPORT CullingSet : public Referenced
_pixelSizeVector = cs._pixelSizeVector;
_smallFeatureCullingPixelSize = cs._smallFeatureCullingPixelSize;
}
inline void set(const CullingSet& cs,const Matrix& matrix, const Vec4& pixelSizeVector)
{
_mask = cs._mask;
@ -99,9 +99,9 @@ class OSG_EXPORT CullingSet : public Referenced
//_frustum = cs._frustum;
//_frustum.transformProvidingInverse(matrix);
_frustum.setAndTransformProvidingInverse(cs._frustum,matrix);
for(StateFrustumList::iterator sitr=_stateFrustumList.begin();
sitr!=_stateFrustumList.end();
++sitr)
@ -115,9 +115,9 @@ class OSG_EXPORT CullingSet : public Referenced
{
oitr->transformProvidingInverse(matrix);
}
}
typedef std::vector<ShadowVolumeOccluder> OccluderList;
typedef int Mask;
@ -147,10 +147,10 @@ class OSG_EXPORT CullingSet : public Referenced
void setFrustum(Polytope& cv) { _frustum = cv; }
Polytope& getFrustum() { return _frustum; }
const Polytope& getFrustum() const { return _frustum; }
const Polytope& getFrustum() const { return _frustum; }
void addStateFrustum(StateSet* stateset, Polytope& polytope) { _stateFrustumList.push_back(StateFrustumPair(stateset,polytope)); }
void getStateFrustumList(StateFrustumList& sfl) { _stateFrustumList = sfl; }
StateFrustumList& getStateFrustumList() { return _stateFrustumList; }
@ -164,12 +164,12 @@ class OSG_EXPORT CullingSet : public Referenced
/** Threshold at which small features are culled.
\param value Boulding volume size in screen space. Default is 2.0. */
void setSmallFeatureCullingPixelSize(float value) { _smallFeatureCullingPixelSize=value; }
float& getSmallFeatureCullingPixelSize() { return _smallFeatureCullingPixelSize; }
float getSmallFeatureCullingPixelSize() const { return _smallFeatureCullingPixelSize; }
/** Compute the pixel of an object at position v, with specified radius.*/
float pixelSize(const Vec3& v,float radius) const { return radius/(v*_pixelSizeVector); }
@ -190,7 +190,7 @@ class OSG_EXPORT CullingSet : public Referenced
// is it outside the view frustum...
if (!_frustum.contains(vertices)) return true;
}
if (_mask&SMALL_FEATURE_CULLING)
{
}
@ -208,10 +208,10 @@ class OSG_EXPORT CullingSet : public Referenced
}
}
}
return false;
}
inline bool isCulled(const BoundingBox& bb)
{
if (_mask&VIEW_FRUSTUM_CULLING)
@ -219,7 +219,7 @@ class OSG_EXPORT CullingSet : public Referenced
// is it outside the view frustum...
if (!_frustum.contains(bb)) return true;
}
if (_mask&SMALL_FEATURE_CULLING)
{
}
@ -237,10 +237,10 @@ class OSG_EXPORT CullingSet : public Referenced
}
}
}
return false;
}
inline bool isCulled(const BoundingSphere& bs)
{
if (_mask&VIEW_FRUSTUM_CULLING)
@ -248,7 +248,7 @@ class OSG_EXPORT CullingSet : public Referenced
// is it outside the view frustum...
if (!_frustum.contains(bs)) return true;
}
if (_mask&SMALL_FEATURE_CULLING)
{
if (((bs.center()*_pixelSizeVector)*_smallFeatureCullingPixelSize)>bs.radius()) return true;
@ -267,14 +267,14 @@ class OSG_EXPORT CullingSet : public Referenced
}
}
}
#endif
#endif
return false;
}
inline void pushCurrentMask()
{
_frustum.pushCurrentMask();
if (!_stateFrustumList.empty())
{
for(StateFrustumList::iterator itr=_stateFrustumList.begin();
@ -298,7 +298,7 @@ class OSG_EXPORT CullingSet : public Referenced
}
#endif
}
inline void popCurrentMask()
{
_frustum.popCurrentMask();
@ -325,23 +325,23 @@ class OSG_EXPORT CullingSet : public Referenced
}
#endif
}
void disableAndPushOccludersCurrentMask(NodePath& nodePath);
void popOccludersCurrentMask(NodePath& nodePath);
static osg::Vec4 computePixelSizeVector(const Viewport& W, const Matrix& P, const Matrix& M);
virtual ~CullingSet();
protected:
Mask _mask;
Polytope _frustum;
StateFrustumList _stateFrustumList;
OccluderList _occluderList;
StateFrustumList _stateFrustumList;
OccluderList _occluderList;
Vec4 _pixelSizeVector;
float _smallFeatureCullingPixelSize;
@ -349,4 +349,4 @@ class OSG_EXPORT CullingSet : public Referenced
} // end of namespace
#endif
#endif

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -26,7 +26,7 @@ namespace osg {
* objects unintentionally.
* Note, the DeleteHandler cannot itself be reference counted, otherwise it
* would be responsible for deleting itself!
* An static auto_ptr<> is used internally in Referenced.cpp to manage the
* An static auto_ptr<> is used internally in Referenced.cpp to manage the
* DeleteHandler's memory.*/
class OSG_EXPORT DeleteHandler
{
@ -43,7 +43,7 @@ class OSG_EXPORT DeleteHandler
* When set to zero objects are deleted immediately, by set to 1 there are kept around for an extra frame etc.
* The ability to retain objects for several frames is useful to prevent premature deletion when objects
* are still be used the graphics threads that are using double buffering of rendering data structures with
* non ref_ptr<> pointers to scene graph elements.*/
* non ref_ptr<> pointers to scene graph elements.*/
void setNumFramesToRetainObjects(unsigned int numberOfFramesToRetainObjects) { _numFramesToRetainObjects = numberOfFramesToRetainObjects; }
unsigned int getNumFramesToRetainObjects() const { return _numFramesToRetainObjects; }
@ -63,8 +63,8 @@ class OSG_EXPORT DeleteHandler
* Note, this should only be called if there are no threads running with non ref_ptr<> pointers, such as graphics threads.*/
virtual void flushAll();
/** Request the deletion of an object.
* Depending on users implementation of DeleteHandler, the delete of the object may occur
/** Request the deletion of an object.
* Depending on users implementation of DeleteHandler, the delete of the object may occur
* straight away or be delayed until doDelete is called.
* The default implementation does a delete straight away.*/
virtual void requestDelete(const osg::Referenced* object);

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -19,12 +19,12 @@
namespace osg {
/** Encapsulate OpenGL glDepthFunc/Mask/Range functions.
*/
*/
class OSG_EXPORT Depth : public StateAttribute
{
public :
enum Function
{
NEVER = GL_NEVER,
@ -39,7 +39,7 @@ class OSG_EXPORT Depth : public StateAttribute
Depth(Function func=LESS,double zNear=0.0, double zFar=1.0,bool writeMask=true);
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
Depth(const Depth& dp,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
StateAttribute(dp,copyop),
@ -47,10 +47,10 @@ class OSG_EXPORT Depth : public StateAttribute
_zNear(dp._zNear),
_zFar(dp._zFar),
_depthWriteMask(dp._depthWriteMask) {}
META_StateAttribute(osg, Depth, DEPTH);
/** return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.*/
virtual int compare(const StateAttribute& sa) const
{
@ -73,9 +73,9 @@ class OSG_EXPORT Depth : public StateAttribute
return true;
}
inline void setFunction(Function func) { _func = func; }
inline void setFunction(Function func) { _func = func; }
inline Function getFunction() const { return _func; }
inline void setRange(double zNear, double zFar)
{
@ -85,22 +85,22 @@ class OSG_EXPORT Depth : public StateAttribute
inline void setZNear(double zNear) { _zNear=zNear; }
inline double getZNear() const { return _zNear; }
inline void setZFar(double zFar) { _zFar=zFar; }
inline double getZFar() const { return _zFar; }
inline void setWriteMask(bool mask) { _depthWriteMask = mask; }
inline void setWriteMask(bool mask) { _depthWriteMask = mask; }
inline bool getWriteMask() const { return _depthWriteMask; }
virtual void apply(State& state) const;
protected:
virtual ~Depth();
Function _func;
double _zNear;
double _zFar;

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -42,7 +42,7 @@ class OSG_EXPORT DisplaySettings : public osg::Referenced
setDefaults();
readEnvironmentalVariables();
}
DisplaySettings(ArgumentParser& arguments):
Referenced(true)
{
@ -52,23 +52,23 @@ class OSG_EXPORT DisplaySettings : public osg::Referenced
}
DisplaySettings(const DisplaySettings& vs);
DisplaySettings& operator = (const DisplaySettings& vs);
void setDisplaySettings(const DisplaySettings& vs);
void merge(const DisplaySettings& vs);
void setDefaults();
/** read the environmental variables.*/
void readEnvironmentalVariables();
/** read the commandline arguments.*/
void readCommandLine(ArgumentParser& arguments);
enum DisplayType
{
MONITOR,
@ -78,7 +78,7 @@ class OSG_EXPORT DisplaySettings : public osg::Referenced
};
void setDisplayType(DisplayType type) { _displayType = type; }
DisplayType getDisplayType() const { return _displayType; }
@ -97,7 +97,7 @@ class OSG_EXPORT DisplaySettings : public osg::Referenced
VERTICAL_INTERLACE,
CHECKERBOARD
};
void setStereoMode(StereoMode mode) { _stereoMode = mode; }
StereoMode getStereoMode() const { return _stereoMode; }
@ -109,7 +109,7 @@ class OSG_EXPORT DisplaySettings : public osg::Referenced
LEFT_EYE_LEFT_VIEWPORT,
LEFT_EYE_RIGHT_VIEWPORT
};
void setSplitStereoHorizontalEyeMapping(SplitStereoHorizontalEyeMapping m) { _splitStereoHorizontalEyeMapping = m; }
SplitStereoHorizontalEyeMapping getSplitStereoHorizontalEyeMapping() const { return _splitStereoHorizontalEyeMapping; }
@ -177,13 +177,13 @@ class OSG_EXPORT DisplaySettings : public osg::Referenced
void setNumMultiSamples(unsigned int samples) { _numMultiSamples = samples; }
unsigned int getNumMultiSamples() const { return _numMultiSamples; }
bool getMultiSamples() const { return _numMultiSamples!=0; }
void setCompileContextsHint(bool useCompileContexts) { _compileContextsHint = useCompileContexts; }
bool getCompileContextsHint() const { return _compileContextsHint; }
void setSerializeDrawDispatch(bool serializeDrawDispatch) { _serializeDrawDispatch = serializeDrawDispatch; }
bool getSerializeDrawDispatch() const { return _serializeDrawDispatch; }
/** Set the hint for the total number of threads in the DatbasePager set up, inclusive of the number of http dedicated threads.*/
void setNumOfDatabaseThreadsHint(unsigned int numThreads) { _numDatabaseThreadsHint = numThreads; }
@ -195,7 +195,7 @@ class OSG_EXPORT DisplaySettings : public osg::Referenced
/** Get the hint for number of threads in the DatbasePager dedicated to reading http requests.*/
unsigned int getNumOfHttpDatabaseThreadsHint() const { return _numHttpDatabaseThreadsHint; }
void setApplication(const std::string& application) { _application = application; }
const std::string& getApplication() { return _application; }
@ -206,11 +206,11 @@ class OSG_EXPORT DisplaySettings : public osg::Referenced
void setMaxBufferObjectPoolSize(unsigned int size) { _maxBufferObjectPoolSize = size; }
unsigned int getMaxBufferObjectPoolSize() const { return _maxBufferObjectPoolSize; }
/**
Methods used to set and get defaults for Cameras implicit buffer attachments.
For more info: See description of Camera::setImplicitBufferAttachment method
/**
Methods used to set and get defaults for Cameras implicit buffer attachments.
For more info: See description of Camera::setImplicitBufferAttachment method
DisplaySettings implicit buffer attachment selection defaults to: DEPTH and COLOR
DisplaySettings implicit buffer attachment selection defaults to: DEPTH and COLOR
for both primary (Render) FBO and seconday Multisample (Resolve) FBO
ie: IMPLICT_DEPTH_BUFFER_ATTACHMENT | IMPLICIT_COLOR_BUFFER_ATTACHMENT
**/
@ -249,11 +249,11 @@ class OSG_EXPORT DisplaySettings : public osg::Referenced
enum SwapMethod
{
SWAP_DEFAULT, // Leave swap method at default returned by choose Pixel Format.
SWAP_EXCHANGE, // Flip front / back buffer.
SWAP_COPY, // Copy back to front buffer.
SWAP_EXCHANGE, // Flip front / back buffer.
SWAP_COPY, // Copy back to front buffer.
SWAP_UNDEFINED // Move back to front buffer leaving contents of back buffer undefined.
};
/** Select preferred swap method */
void setSwapMethod( SwapMethod swapMethod ) { _swapMethod = swapMethod; }
@ -271,7 +271,7 @@ class OSG_EXPORT DisplaySettings : public osg::Referenced
/** Get the hint of the flags to use in when creating graphic contexts.*/
unsigned int getGLContextFlags() const { return _glContextFlags; }
/** Set the hint of the profile mask to use in when creating graphic contexts.*/
void setGLContextProfileMask(unsigned int mask) { _glContextProfileMask = mask; }
@ -279,7 +279,7 @@ class OSG_EXPORT DisplaySettings : public osg::Referenced
unsigned int getGLContextProfileMask() const { return _glContextProfileMask; }
protected:
virtual ~DisplaySettings();
@ -296,7 +296,7 @@ class OSG_EXPORT DisplaySettings : public osg::Referenced
SplitStereoVerticalEyeMapping _splitStereoVerticalEyeMapping;
int _splitStereoVerticalSeparation;
bool _splitStereoAutoAdjustAspectRatio;
bool _doubleBuffer;
bool _RGB;
bool _depthBuffer;
@ -308,15 +308,15 @@ class OSG_EXPORT DisplaySettings : public osg::Referenced
unsigned int _minimumNumberAccumAlphaBits;
unsigned int _maxNumOfGraphicsContexts;
unsigned int _numMultiSamples;
bool _compileContextsHint;
bool _serializeDrawDispatch;
unsigned int _numDatabaseThreadsHint;
unsigned int _numHttpDatabaseThreadsHint;
std::string _application;
unsigned int _maxTexturePoolSize;
@ -324,7 +324,7 @@ class OSG_EXPORT DisplaySettings : public osg::Referenced
ImplicitBufferAttachmentMask _implicitBufferAttachmentRenderMask;
ImplicitBufferAttachmentMask _implicitBufferAttachmentResolveMask;
std::string _glContextVersion;
unsigned int _glContextFlags;
unsigned int _glContextProfileMask;

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -30,27 +30,27 @@ class OSG_EXPORT DrawPixels : public Drawable
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
DrawPixels(const DrawPixels& drawimage,const CopyOp& copyop=CopyOp::SHALLOW_COPY);
virtual Object* cloneType() const { return new DrawPixels(); }
virtual Object* clone(const CopyOp& copyop) const { return new DrawPixels(*this,copyop); }
virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast<const DrawPixels*>(obj)!=NULL; }
virtual const char* libraryName() const { return "osg"; }
virtual const char* className() const { return "DrawPixels"; }
void setPosition(const osg::Vec3& position);
osg::Vec3& getPosition() { return _position; }
const osg::Vec3& getPosition() const { return _position; }
void setImage(osg::Image* image) { _image = image; }
osg::Image* getImage() { return _image.get(); }
const osg::Image* getImage() const { return _image.get(); }
void setUseSubImage(bool useSubImage) { _useSubImage=useSubImage; }
bool getUseSubImage() const { return _useSubImage; }
@ -60,7 +60,7 @@ class OSG_EXPORT DrawPixels : public Drawable
virtual void drawImplementation(RenderInfo& renderInfo) const;
virtual BoundingBox computeBound() const;
protected:
DrawPixels& operator = (const DrawPixels&) { return *this;}
@ -69,10 +69,10 @@ class OSG_EXPORT DrawPixels : public Drawable
Vec3 _position;
ref_ptr<Image> _image;
bool _useSubImage;
unsigned int _offsetX, _offsetY, _width, _height;
};
}

View File

@ -4,7 +4,7 @@
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@ -122,7 +122,7 @@ class OSG_EXPORT Drawable : public Object
* Equivalent to dynamic_cast<Geometry*>(this).*/
virtual Geometry* asGeometry() { return 0; }
/** Convert 'const this' into a const Geometry pointer if Drawable is a Geometry, otherwise return 0.
/** Convert 'const this' into a const Geometry pointer if Drawable is a Geometry, otherwise return 0.
* Equivalent to dynamic_cast<const Geometry*>(this).*/
virtual const Geometry* asGeometry() const { return 0; }
@ -199,11 +199,11 @@ class OSG_EXPORT Drawable : public Object
if(!_boundingBoxComputed)
{
_boundingBox = _initialBound;
if (_computeBoundCallback.valid())
if (_computeBoundCallback.valid())
_boundingBox.expandBy(_computeBoundCallback->computeBound(*this));
else
_boundingBox.expandBy(computeBound());
_boundingBoxComputed = true;
}
return _boundingBox;
@ -274,7 +274,7 @@ class OSG_EXPORT Drawable : public Object
/** Return OpenGL display list for specified contextID. */
inline GLuint& getDisplayList(unsigned int contextID) const { return _globjList[contextID]; }
/** When set to true, ignore the setUseDisplayList() settings, and hints to the drawImplementation
/** When set to true, ignore the setUseDisplayList() settings, and hints to the drawImplementation
method to use OpenGL vertex buffer objects for rendering.*/
virtual void setUseVertexBufferObjects(bool flag);
@ -425,7 +425,7 @@ class OSG_EXPORT Drawable : public Object
/** drawImplementation(RenderInfo&) is a pure virtual method for the actual implementation of OpenGL drawing calls, such as vertex arrays and primitives, that
* must be implemented in concrete subclasses of the Drawable base class, examples include osg::Geometry and osg::ShapeDrawable.
* drawImplementation(RenderInfo&) is called from the draw(RenderInfo&) method, with the draw method handling management of OpenGL display lists,
* and drawImplementation(RenderInfo&) handling the actual drawing itself.
* and drawImplementation(RenderInfo&) handling the actual drawing itself.
* @param renderInfo The osg::RenderInfo object that encapsulates the current rendering information including the osg::State OpenGL state for the current graphics context. */
virtual void drawImplementation(RenderInfo& renderInfo) const = 0;
@ -800,9 +800,9 @@ class OSG_EXPORT Drawable : public Object
};
/** Function to call to get the extension of a specified context.
* If the Extension object for that context has not yet been created
* If the Extension object for that context has not yet been created
* and the 'createIfNotInitalized' flag been set to false then returns NULL.
* If 'createIfNotInitalized' is true then the Extensions object is
* If 'createIfNotInitalized' is true then the Extensions object is
* automatically created. However, in this case the extension object is
* only created with the graphics context associated with ContextID..*/
static Extensions* getExtensions(unsigned int contextID,bool createIfNotInitalized);

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -35,9 +35,9 @@ inline Endian getCpuByteOrder()
if (u.is_it_really_1 == 1)
return BigEndian;
else
else
return LittleEndian;
}
}
inline void swapBytes( char* in, unsigned int size )
{

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -20,7 +20,7 @@
// well placed for compatibility with future versions.
#define USE_DEPRECATED_API
// disable VisualStudio warnings
// disable VisualStudio warnings
#if defined(_MSC_VER) && defined(OSG_DISABLE_MSVC_WARNINGS)
#pragma warning( disable : 4244 )
#pragma warning( disable : 4251 )

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -48,7 +48,7 @@
namespace osg {
/** Fog - encapsulates OpenGL fog state. */
/** Fog - encapsulates OpenGL fog state. */
class OSG_EXPORT Fog : public StateAttribute
{
public :
@ -67,7 +67,7 @@ class OSG_EXPORT Fog : public StateAttribute
_useRadialFog(fog._useRadialFog) {}
META_StateAttribute(osg, Fog,FOG);
/** return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.*/
virtual int compare(const StateAttribute& sa) const
{
@ -113,16 +113,16 @@ class OSG_EXPORT Fog : public StateAttribute
inline void setColor( const Vec4 &color ) { _color = color; }
inline const Vec4& getColor() const { return _color; }
inline void setUseRadialFog( bool useRadialFog ) { _useRadialFog = useRadialFog; }
inline bool getUseRadialFog() const { return _useRadialFog; }
enum FogCoordinateSource
{
FOG_COORDINATE = GL_FOG_COORDINATE,
FRAGMENT_DEPTH = GL_FRAGMENT_DEPTH
};
inline void setFogCoordinateSource(GLint source) { _fogCoordinateSource = source; }
inline GLint getFogCoordinateSource() const { return _fogCoordinateSource; }

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -150,14 +150,14 @@ class OSG_EXPORT FragmentProgram : public StateAttribute
return _fragmentProgramIDList[contextID];
}
/** Set the fragment program using a C style string.*/
inline void setFragmentProgram( const char* program )
{
_fragmentProgram = program;
inline void setFragmentProgram( const char* program )
{
_fragmentProgram = program;
dirtyFragmentProgramObject();
}
/** Set the fragment program using C++ style string.*/
inline void setFragmentProgram( const std::string& program )
{
@ -204,7 +204,7 @@ class OSG_EXPORT FragmentProgram : public StateAttribute
/** Force a recompile on next apply() of associated OpenGL vertex program objects.*/
void dirtyFragmentProgramObject();
void dirtyFragmentProgramObject();
/** use deleteFragmentProgramObject instead of glDeletePrograms to allow
* OpenGL Fragment Program objects to be cached until they can be deleted
@ -235,17 +235,17 @@ class OSG_EXPORT FragmentProgram : public StateAttribute
virtual void releaseGLObjects(State* state=0) const;
/** Extensions class which encapsulates the querying of extensions and
* associated function pointers, and provide convenience wrappers to
* check for the extensions or use the associated functions.*/
* associated function pointers, and provide convenience wrappers to
* check for the extensions or use the associated functions.*/
class OSG_EXPORT Extensions : public osg::Referenced
{
public:
Extensions(unsigned int contextID);
Extensions(const Extensions& rhs);
void lowestCommonDenominator(const Extensions& rhs);
void setupGLExtensions(unsigned int contextID);
void setFragmentProgramSupported(bool flag) { _isFragmentProgramSupported=flag; }
@ -254,19 +254,19 @@ class OSG_EXPORT FragmentProgram : public StateAttribute
void glBindProgram(GLenum target, GLuint id) const;
void glGenPrograms(GLsizei n, GLuint *programs) const;
void glDeletePrograms(GLsizei n, GLuint *programs) const;
void glProgramString(GLenum target, GLenum format, GLsizei len, const void *string) const;
void glProgramString(GLenum target, GLenum format, GLsizei len, const void *string) const;
void glProgramLocalParameter4fv(GLenum target, GLuint index, const GLfloat *params) const;
protected:
~Extensions() {}
bool _isFragmentProgramSupported;
typedef void (GL_APIENTRY * BindProgramProc) (GLenum target, GLuint id);
typedef void (GL_APIENTRY * GenProgramsProc) (GLsizei n, GLuint *programs);
typedef void (GL_APIENTRY * DeleteProgramsProc) (GLsizei n, GLuint *programs);
typedef void (GL_APIENTRY * ProgramStringProc) (GLenum target, GLenum format, GLsizei len, const void *string);
typedef void (GL_APIENTRY * ProgramStringProc) (GLenum target, GLenum format, GLsizei len, const void *string);
typedef void (GL_APIENTRY * ProgramLocalParameter4fvProc) (GLenum target, GLuint index, const GLfloat *params);
BindProgramProc _glBindProgram;
@ -275,11 +275,11 @@ class OSG_EXPORT FragmentProgram : public StateAttribute
ProgramStringProc _glProgramString;
ProgramLocalParameter4fvProc _glProgramLocalParameter4fv;
};
/** Function to call to get the extension of a specified context.
* If the Extension object for that context has not yet been created and the
* If the Extension object for that context has not yet been created and the
* 'createIfNotInitalized' flag has been set to false then returns NULL.
* If 'createIfNotInitalized' is true then the Extensions object is
* If 'createIfNotInitalized' is true then the Extensions object is
* automatically created. However, in this case the extension object will
* only be created with the graphics context associated with ContextID..*/
static Extensions* getExtensions(unsigned int contextID,bool createIfNotInitalized);

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -166,7 +166,7 @@ namespace osg
TglBindRenderbuffer* glBindRenderbuffer;
TglGenRenderbuffers* glGenRenderbuffers;
TglDeleteRenderbuffers* glDeleteRenderbuffers;
TglDeleteRenderbuffers* glDeleteRenderbuffers;
TglRenderbufferStorage* glRenderbufferStorage;
TglRenderbufferStorageMultisample* glRenderbufferStorageMultisample;
TglRenderbufferStorageMultisampleCoverageNV* glRenderbufferStorageMultisampleCoverageNV;
@ -376,10 +376,10 @@ namespace osg
explicit FrameBufferAttachment(TextureCubeMap* target, unsigned int face, unsigned int level = 0);
explicit FrameBufferAttachment(TextureRectangle* target);
explicit FrameBufferAttachment(Camera::Attachment& attachment);
~FrameBufferAttachment();
FrameBufferAttachment&operator = (const FrameBufferAttachment& copy);
FrameBufferAttachment&operator = (const FrameBufferAttachment& copy);
bool isMultisample() const;
void createRequiredTexturesAndApplyGenerateMipMap(State& state, const FBOExtensions* ext) const;
@ -412,7 +412,7 @@ namespace osg
public:
typedef std::map<Camera::BufferComponent, FrameBufferAttachment> AttachmentMap;
typedef std::vector<GLenum> MultipleRenderingTargets;
typedef Camera::BufferComponent BufferComponent;
FrameBufferObject();
@ -421,19 +421,19 @@ namespace osg
META_StateAttribute(osg, FrameBufferObject, (StateAttribute::Type)0x101010/*FrameBufferObject*/);
inline const AttachmentMap& getAttachmentMap() const;
void setAttachment(BufferComponent attachment_point, const FrameBufferAttachment &attachment);
inline const FrameBufferAttachment& getAttachment(BufferComponent attachment_point) const;
inline bool hasAttachment(BufferComponent attachment_point) const;
inline bool hasMultipleRenderingTargets() const { return !_drawBuffers.empty(); }
inline const MultipleRenderingTargets& getMultipleRenderingTargets() const { return _drawBuffers; }
bool isMultisample() const;
int compare(const StateAttribute &sa) const;
void apply(State &state) const;
enum BindTarget
@ -472,12 +472,12 @@ namespace osg
FrameBufferObject& operator = (const FrameBufferObject&) { return *this; }
void updateDrawBuffers();
inline void dirtyAll();
GLenum convertBufferComponentToGLenum(BufferComponent attachment_point) const;
private:
private:
AttachmentMap _attachments;
// Buffers passed to glDrawBuffers when using multiple render targets.
@ -486,7 +486,7 @@ namespace osg
mutable buffered_value<int> _dirtyAttachmentList;
mutable buffered_value<int> _unsupported;
mutable buffered_value<GLuint> _fboID;
};
// INLINE METHODS

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -30,43 +30,43 @@ namespace osg
* time of specific frame, used to synchronize operations on the scene graph
* and other machines when using a graphics cluster. Note the calendar
* time can be an artificial simulation time or capture the real time
* of day etc.*/
* of day etc.*/
class OSG_EXPORT FrameStamp : public Referenced
{
public:
FrameStamp();
FrameStamp(const FrameStamp& fs);
FrameStamp& operator = (const FrameStamp& fs);
void setFrameNumber(unsigned int fnum) { _frameNumber = fnum; }
unsigned int getFrameNumber() const { return _frameNumber; }
void setReferenceTime(double refTime) { _referenceTime = refTime; }
double getReferenceTime() const { return _referenceTime; }
void setSimulationTime(double refTime) { _simulationTime = refTime; }
double getSimulationTime() const { return _simulationTime; }
void setCalendarTime(const tm& calendarTime);
void getCalendarTime(tm& calendarTime) const;
// keep public to allow it to be permit allocation which is
// keep public to allow it to be permit allocation which is
// not on the heap used osgcluster
virtual ~FrameStamp();
protected:
// note no dynamic memory is used so that data can be passed
// via a simple memory copy or within a data packet across
// the network.
unsigned int _frameNumber;
double _referenceTime;
double _simulationTime;
double _simulationTime;
// member variables of time.h's tm structure, copied here to
// ensure that all data is not dynamic. The tm structure itself
// is not completely consistent between implementations, which
@ -81,8 +81,8 @@ class OSG_EXPORT FrameStamp : public Referenced
int tm_wday; /* Day of week. [0-6] */
int tm_yday; /* Days in year. [0-365] */
int tm_isdst; /* DST. [-1/0/1]*/
};
}

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -20,16 +20,16 @@
namespace osg {
/** Class to specify the orientation of front-facing polygons.
*/
*/
class OSG_EXPORT FrontFace : public StateAttribute
{
public :
enum Mode {
CLOCKWISE = GL_CW,
COUNTER_CLOCKWISE = GL_CCW
};
FrontFace(Mode face=COUNTER_CLOCKWISE);
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
@ -38,7 +38,7 @@ class OSG_EXPORT FrontFace : public StateAttribute
_mode(ff._mode) {}
META_StateAttribute(osg, FrontFace, FRONTFACE);
/** return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.*/
virtual int compare(const StateAttribute& sa) const
{
@ -51,16 +51,16 @@ class OSG_EXPORT FrontFace : public StateAttribute
return 0; // passed all the above comparison macros, must be equal.
}
inline void setMode(Mode mode) { _mode = mode; }
inline Mode getMode() const { return _mode; }
virtual void apply(State& state) const;
protected:
virtual ~FrontFace();
Mode _mode;
};

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -42,7 +42,7 @@
#ifndef WIN32
// Required for compatibility with glext.h sytle function definitions of
// Required for compatibility with glext.h sytle function definitions of
// OpenGL extensions, such as in src/osg/Point.cpp.
#ifndef APIENTRY
#define APIENTRY
@ -56,7 +56,7 @@
#define GLUT_APIENTRY_DEFINED
#define APIENTRY __stdcall
#endif
// XXX This is from Win32's <windef.h>
// XXX This is from Win32's <windef.h>
#ifndef CALLBACK
#define CALLBACK __stdcall
#endif
@ -64,9 +64,9 @@
#else // ! __CYGWIN__
// Under Windows avoid including <windows.h>
// to avoid name space pollution, but Win32's <GL/gl.h>
// needs APIENTRY and WINGDIAPI defined properly.
// XXX This is from Win32's <windef.h>
// to avoid name space pollution, but Win32's <GL/gl.h>
// needs APIENTRY and WINGDIAPI defined properly.
// XXX This is from Win32's <windef.h>
#ifndef APIENTRY
#define GLUT_APIENTRY_DEFINED
#if (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED)
@ -77,7 +77,7 @@
#endif
#endif
// XXX This is from Win32's <windef.h>
// XXX This is from Win32's <windef.h>
#ifndef CALLBACK
#if (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED)
#define CALLBACK __stdcall
@ -88,13 +88,13 @@
#endif // __CYGWIN__
// XXX This is from Win32's <wingdi.h> and <winnt.h>
// XXX This is from Win32's <wingdi.h> and <winnt.h>
#ifndef WINGDIAPI
#define GLUT_WINGDIAPI_DEFINED
#define DECLSPEC_IMPORT __declspec(dllimport)
#define WINGDIAPI DECLSPEC_IMPORT
#endif
// XXX This is from Win32's <ctype.h>
#if !defined(_WCHAR_T_DEFINED) && !(defined(__GNUC__)&&((__GNUC__ == 3)||(__GNUC__ == 4)))
typedef unsigned short wchar_t;
@ -189,31 +189,31 @@
#ifdef OSG_GL1_AVAILABLE
#define OSG_GL1_FEATURES true
#else
#else
#define OSG_GL1_FEATURES false
#endif
#ifdef OSG_GL2_AVAILABLE
#define OSG_GL2_FEATURES true
#else
#else
#define OSG_GL2_FEATURES false
#endif
#ifdef OSG_GL3_AVAILABLE
#define OSG_GL3_FEATURES true
#else
#else
#define OSG_GL3_FEATURES false
#endif
#ifdef OSG_GLES1_AVAILABLE
#define OSG_GLES1_FEATURES true
#else
#else
#define OSG_GLES1_FEATURES false
#endif
#ifdef OSG_GLES2_AVAILABLE
#define OSG_GLES2_FEATURES true
#else
#else
#define OSG_GLES2_FEATURES false
#endif

View File

@ -1,14 +1,14 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
* Copyright (C) 2003-2005 3Dlabs Inc. Ltd.
* Copyright (C) 2004-2005 Nathan Cournia
* Copyright (C) 2007 Art Tevs
* Copyright (C) 2008 Zebra Imaging
* Copyright (C) 2010 VIRES Simulationstechnologie GmbH
*
* This application is open source and may be redistributed and/or modified
* This application is open source and may be redistributed and/or modified
* freely and without restriction, both in commercial and non commercial
* applications, as long as this copyright notice is maintained.
*
*
* This application is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
@ -535,80 +535,80 @@ class OSG_EXPORT GL2Extensions : public osg::Referenced
typedef void (GL_APIENTRY * GetProgramivProc)(GLuint program, GLenum pname, GLint *params);
typedef void (GL_APIENTRY * GetObjectParameterivARBProc)(GLuint program, GLenum pname, GLint *params);
typedef void (GL_APIENTRY * GetProgramInfoLogProc)(GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
typedef void (GL_APIENTRY * GetInfoLogARBProc)(GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
typedef void (GL_APIENTRY * GetShaderivProc)(GLuint shader, GLenum pname, GLint *params);
typedef void (GL_APIENTRY * GetShaderInfoLogProc)(GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
typedef void (GL_APIENTRY * GetShaderSourceProc)(GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source);
typedef GLint (GL_APIENTRY * GetUniformLocationProc)(GLuint program, const GLchar *name);
typedef void (GL_APIENTRY * GetUniformfvProc)(GLuint program, GLint location, GLfloat *params);
typedef void (GL_APIENTRY * GetUniformivProc)(GLuint program, GLint location, GLint *params);
typedef void (GL_APIENTRY * GetVertexAttribdvProc)(GLuint index, GLenum pname, GLdouble *params);
typedef void (GL_APIENTRY * GetVertexAttribfvProc)(GLuint index, GLenum pname, GLfloat *params);
typedef void (GL_APIENTRY * GetVertexAttribivProc)(GLuint index, GLenum pname, GLint *params);
typedef void (GL_APIENTRY * GetVertexAttribPointervProc)(GLuint index, GLenum pname, GLvoid* *pointer);
typedef GLboolean (GL_APIENTRY * IsProgramProc)(GLuint program);
typedef GLboolean (GL_APIENTRY * IsShaderProc)(GLuint shader);
typedef void (GL_APIENTRY * LinkProgramProc)(GLuint program);
typedef void (GL_APIENTRY * GetInfoLogARBProc)(GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
typedef void (GL_APIENTRY * GetShaderivProc)(GLuint shader, GLenum pname, GLint *params);
typedef void (GL_APIENTRY * GetShaderInfoLogProc)(GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
typedef void (GL_APIENTRY * GetShaderSourceProc)(GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source);
typedef GLint (GL_APIENTRY * GetUniformLocationProc)(GLuint program, const GLchar *name);
typedef void (GL_APIENTRY * GetUniformfvProc)(GLuint program, GLint location, GLfloat *params);
typedef void (GL_APIENTRY * GetUniformivProc)(GLuint program, GLint location, GLint *params);
typedef void (GL_APIENTRY * GetVertexAttribdvProc)(GLuint index, GLenum pname, GLdouble *params);
typedef void (GL_APIENTRY * GetVertexAttribfvProc)(GLuint index, GLenum pname, GLfloat *params);
typedef void (GL_APIENTRY * GetVertexAttribivProc)(GLuint index, GLenum pname, GLint *params);
typedef void (GL_APIENTRY * GetVertexAttribPointervProc)(GLuint index, GLenum pname, GLvoid* *pointer);
typedef GLboolean (GL_APIENTRY * IsProgramProc)(GLuint program);
typedef GLboolean (GL_APIENTRY * IsShaderProc)(GLuint shader);
typedef void (GL_APIENTRY * LinkProgramProc)(GLuint program);
typedef void (GL_APIENTRY * ShaderSourceProc)(GLuint shader, GLsizei count, const GLchar* *string, const GLint *length);
typedef void (GL_APIENTRY * UseProgramProc)(GLuint program);
typedef void (GL_APIENTRY * Uniform1fProc)(GLint location, GLfloat v0);
typedef void (GL_APIENTRY * Uniform2fProc)(GLint location, GLfloat v0, GLfloat v1);
typedef void (GL_APIENTRY * Uniform3fProc)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
typedef void (GL_APIENTRY * Uniform4fProc)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
typedef void (GL_APIENTRY * Uniform1iProc)(GLint location, GLint v0);
typedef void (GL_APIENTRY * Uniform2iProc)(GLint location, GLint v0, GLint v1);
typedef void (GL_APIENTRY * Uniform3iProc)(GLint location, GLint v0, GLint v1, GLint v2);
typedef void (GL_APIENTRY * Uniform4iProc)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
typedef void (GL_APIENTRY * Uniform1fvProc)(GLint location, GLsizei count, const GLfloat *value);
typedef void (GL_APIENTRY * Uniform2fvProc)(GLint location, GLsizei count, const GLfloat *value);
typedef void (GL_APIENTRY * Uniform3fvProc)(GLint location, GLsizei count, const GLfloat *value);
typedef void (GL_APIENTRY * Uniform4fvProc)(GLint location, GLsizei count, const GLfloat *value);
typedef void (GL_APIENTRY * Uniform1ivProc)(GLint location, GLsizei count, const GLint *value);
typedef void (GL_APIENTRY * Uniform2ivProc)(GLint location, GLsizei count, const GLint *value);
typedef void (GL_APIENTRY * Uniform3ivProc)(GLint location, GLsizei count, const GLint *value);
typedef void (GL_APIENTRY * Uniform4ivProc)(GLint location, GLsizei count, const GLint *value);
typedef void (GL_APIENTRY * UseProgramProc)(GLuint program);
typedef void (GL_APIENTRY * Uniform1fProc)(GLint location, GLfloat v0);
typedef void (GL_APIENTRY * Uniform2fProc)(GLint location, GLfloat v0, GLfloat v1);
typedef void (GL_APIENTRY * Uniform3fProc)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
typedef void (GL_APIENTRY * Uniform4fProc)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
typedef void (GL_APIENTRY * Uniform1iProc)(GLint location, GLint v0);
typedef void (GL_APIENTRY * Uniform2iProc)(GLint location, GLint v0, GLint v1);
typedef void (GL_APIENTRY * Uniform3iProc)(GLint location, GLint v0, GLint v1, GLint v2);
typedef void (GL_APIENTRY * Uniform4iProc)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
typedef void (GL_APIENTRY * Uniform1fvProc)(GLint location, GLsizei count, const GLfloat *value);
typedef void (GL_APIENTRY * Uniform2fvProc)(GLint location, GLsizei count, const GLfloat *value);
typedef void (GL_APIENTRY * Uniform3fvProc)(GLint location, GLsizei count, const GLfloat *value);
typedef void (GL_APIENTRY * Uniform4fvProc)(GLint location, GLsizei count, const GLfloat *value);
typedef void (GL_APIENTRY * Uniform1ivProc)(GLint location, GLsizei count, const GLint *value);
typedef void (GL_APIENTRY * Uniform2ivProc)(GLint location, GLsizei count, const GLint *value);
typedef void (GL_APIENTRY * Uniform3ivProc)(GLint location, GLsizei count, const GLint *value);
typedef void (GL_APIENTRY * Uniform4ivProc)(GLint location, GLsizei count, const GLint *value);
typedef void (GL_APIENTRY * UniformMatrix2fvProc)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
typedef void (GL_APIENTRY * UniformMatrix3fvProc)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
typedef void (GL_APIENTRY * UniformMatrix4fvProc)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
typedef void (GL_APIENTRY * ValidateProgramProc)(GLuint program);
typedef void (GL_APIENTRY * VertexAttrib1dProc)(GLuint index, GLdouble x);
typedef void (GL_APIENTRY * VertexAttrib1dvProc)(GLuint index, const GLdouble *v);
typedef void (GL_APIENTRY * VertexAttrib1fProc)(GLuint index, GLfloat x);
typedef void (GL_APIENTRY * VertexAttrib1fvProc)(GLuint index, const GLfloat *v);
typedef void (GL_APIENTRY * VertexAttrib1sProc)(GLuint index, GLshort x);
typedef void (GL_APIENTRY * VertexAttrib1svProc)(GLuint index, const GLshort *v);
typedef void (GL_APIENTRY * VertexAttrib2dProc)(GLuint index, GLdouble x, GLdouble y);
typedef void (GL_APIENTRY * VertexAttrib2dvProc)(GLuint index, const GLdouble *v);
typedef void (GL_APIENTRY * VertexAttrib2fProc)(GLuint index, GLfloat x, GLfloat y);
typedef void (GL_APIENTRY * VertexAttrib2fvProc)(GLuint index, const GLfloat *v);
typedef void (GL_APIENTRY * VertexAttrib2sProc)(GLuint index, GLshort x, GLshort y);
typedef void (GL_APIENTRY * VertexAttrib2svProc)(GLuint index, const GLshort *v);
typedef void (GL_APIENTRY * VertexAttrib3dProc)(GLuint index, GLdouble x, GLdouble y, GLdouble z);
typedef void (GL_APIENTRY * VertexAttrib3dvProc)(GLuint index, const GLdouble *v);
typedef void (GL_APIENTRY * VertexAttrib3fProc)(GLuint index, GLfloat x, GLfloat y, GLfloat z);
typedef void (GL_APIENTRY * VertexAttrib3fvProc)(GLuint index, const GLfloat *v);
typedef void (GL_APIENTRY * VertexAttrib3sProc)(GLuint index, GLshort x, GLshort y, GLshort z);
typedef void (GL_APIENTRY * VertexAttrib3svProc)(GLuint index, const GLshort *v);
typedef void (GL_APIENTRY * VertexAttrib4NbvProc)(GLuint index, const GLbyte *v);
typedef void (GL_APIENTRY * VertexAttrib4NivProc)(GLuint index, const GLint *v);
typedef void (GL_APIENTRY * VertexAttrib4NsvProc)(GLuint index, const GLshort *v);
typedef void (GL_APIENTRY * VertexAttrib4NubProc)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
typedef void (GL_APIENTRY * VertexAttrib4NubvProc)(GLuint index, const GLubyte *v);
typedef void (GL_APIENTRY * VertexAttrib4NuivProc)(GLuint index, const GLuint *v);
typedef void (GL_APIENTRY * VertexAttrib4NusvProc)(GLuint index, const GLushort *v);
typedef void (GL_APIENTRY * VertexAttrib4bvProc)(GLuint index, const GLbyte *v);
typedef void (GL_APIENTRY * VertexAttrib4dProc)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
typedef void (GL_APIENTRY * VertexAttrib4dvProc)(GLuint index, const GLdouble *v);
typedef void (GL_APIENTRY * VertexAttrib4fProc)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
typedef void (GL_APIENTRY * VertexAttrib4fvProc)(GLuint index, const GLfloat *v);
typedef void (GL_APIENTRY * VertexAttrib4ivProc)(GLuint index, const GLint *v);
typedef void (GL_APIENTRY * VertexAttrib4sProc)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
typedef void (GL_APIENTRY * VertexAttrib4svProc)(GLuint index, const GLshort *v);
typedef void (GL_APIENTRY * VertexAttrib4ubvProc)(GLuint index, const GLubyte *v);
typedef void (GL_APIENTRY * VertexAttrib4uivProc)(GLuint index, const GLuint *v);
typedef void (GL_APIENTRY * VertexAttrib4usvProc)(GLuint index, const GLushort *v);
typedef void (GL_APIENTRY * UniformMatrix4fvProc)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
typedef void (GL_APIENTRY * ValidateProgramProc)(GLuint program);
typedef void (GL_APIENTRY * VertexAttrib1dProc)(GLuint index, GLdouble x);
typedef void (GL_APIENTRY * VertexAttrib1dvProc)(GLuint index, const GLdouble *v);
typedef void (GL_APIENTRY * VertexAttrib1fProc)(GLuint index, GLfloat x);
typedef void (GL_APIENTRY * VertexAttrib1fvProc)(GLuint index, const GLfloat *v);
typedef void (GL_APIENTRY * VertexAttrib1sProc)(GLuint index, GLshort x);
typedef void (GL_APIENTRY * VertexAttrib1svProc)(GLuint index, const GLshort *v);
typedef void (GL_APIENTRY * VertexAttrib2dProc)(GLuint index, GLdouble x, GLdouble y);
typedef void (GL_APIENTRY * VertexAttrib2dvProc)(GLuint index, const GLdouble *v);
typedef void (GL_APIENTRY * VertexAttrib2fProc)(GLuint index, GLfloat x, GLfloat y);
typedef void (GL_APIENTRY * VertexAttrib2fvProc)(GLuint index, const GLfloat *v);
typedef void (GL_APIENTRY * VertexAttrib2sProc)(GLuint index, GLshort x, GLshort y);
typedef void (GL_APIENTRY * VertexAttrib2svProc)(GLuint index, const GLshort *v);
typedef void (GL_APIENTRY * VertexAttrib3dProc)(GLuint index, GLdouble x, GLdouble y, GLdouble z);
typedef void (GL_APIENTRY * VertexAttrib3dvProc)(GLuint index, const GLdouble *v);
typedef void (GL_APIENTRY * VertexAttrib3fProc)(GLuint index, GLfloat x, GLfloat y, GLfloat z);
typedef void (GL_APIENTRY * VertexAttrib3fvProc)(GLuint index, const GLfloat *v);
typedef void (GL_APIENTRY * VertexAttrib3sProc)(GLuint index, GLshort x, GLshort y, GLshort z);
typedef void (GL_APIENTRY * VertexAttrib3svProc)(GLuint index, const GLshort *v);
typedef void (GL_APIENTRY * VertexAttrib4NbvProc)(GLuint index, const GLbyte *v);
typedef void (GL_APIENTRY * VertexAttrib4NivProc)(GLuint index, const GLint *v);
typedef void (GL_APIENTRY * VertexAttrib4NsvProc)(GLuint index, const GLshort *v);
typedef void (GL_APIENTRY * VertexAttrib4NubProc)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
typedef void (GL_APIENTRY * VertexAttrib4NubvProc)(GLuint index, const GLubyte *v);
typedef void (GL_APIENTRY * VertexAttrib4NuivProc)(GLuint index, const GLuint *v);
typedef void (GL_APIENTRY * VertexAttrib4NusvProc)(GLuint index, const GLushort *v);
typedef void (GL_APIENTRY * VertexAttrib4bvProc)(GLuint index, const GLbyte *v);
typedef void (GL_APIENTRY * VertexAttrib4dProc)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
typedef void (GL_APIENTRY * VertexAttrib4dvProc)(GLuint index, const GLdouble *v);
typedef void (GL_APIENTRY * VertexAttrib4fProc)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
typedef void (GL_APIENTRY * VertexAttrib4fvProc)(GLuint index, const GLfloat *v);
typedef void (GL_APIENTRY * VertexAttrib4ivProc)(GLuint index, const GLint *v);
typedef void (GL_APIENTRY * VertexAttrib4sProc)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
typedef void (GL_APIENTRY * VertexAttrib4svProc)(GLuint index, const GLshort *v);
typedef void (GL_APIENTRY * VertexAttrib4ubvProc)(GLuint index, const GLubyte *v);
typedef void (GL_APIENTRY * VertexAttrib4uivProc)(GLuint index, const GLuint *v);
typedef void (GL_APIENTRY * VertexAttrib4usvProc)(GLuint index, const GLushort *v);
typedef void (GL_APIENTRY * VertexAttribPointerProc)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);
typedef void (GL_APIENTRY * UniformMatrix2x3fvProc)( GLint location, GLsizei count, GLboolean transpose, const GLfloat* value );
typedef void (GL_APIENTRY * UniformMatrix2x3fvProc)( GLint location, GLsizei count, GLboolean transpose, const GLfloat* value );
typedef void (GL_APIENTRY * UniformMatrix3x2fvProc)( GLint location, GLsizei count, GLboolean transpose, const GLfloat* value );
typedef void (GL_APIENTRY * UniformMatrix2x4fvProc)( GLint location, GLsizei count, GLboolean transpose, const GLfloat* value );
typedef void (GL_APIENTRY * UniformMatrix4x2fvProc)( GLint location, GLsizei count, GLboolean transpose, const GLfloat* value );
@ -642,7 +642,7 @@ class OSG_EXPORT GL2Extensions : public osg::Referenced
typedef void (GL_APIENTRY * GetProgramBinaryProc)(GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary);
typedef void (GL_APIENTRY * ProgramBinaryProc)(GLuint program, GLenum binaryFormat, const GLvoid *binary, GLsizei length);
BlendEquationSeparateProc _glBlendEquationSeparate;
BlendEquationSeparateProc _glBlendEquationSeparate;
DrawBuffersProc _glDrawBuffers;
StencilOpSeparateProc _glStencilOpSeparate;
StencilFuncSeparateProc _glStencilFuncSeparate;

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -49,7 +49,7 @@ extern OSG_EXPORT bool isGLExtensionOrVersionSupported(unsigned int contextID, c
* Note, glGLExtensionFuncPtr is declared inline so that the code
* is compiled locally to the calling code. This should get by Windows'
* dumb implementation of having different GL function ptr's for each
* library when linked to it.
* library when linked to it.
*/
extern OSG_EXPORT void* getGLExtensionFuncPtr(const char *funcName);
@ -109,12 +109,12 @@ bool setGLExtensionFuncPtr(T& t, const char* str1)
if (data)
{
memcpy(&t, &data, sizeof(T));
return true;
return true;
}
else
{
t = 0;
return false;
return false;
}
}
@ -125,12 +125,12 @@ bool setGLExtensionFuncPtr(T& t, const char* str1, const char* str2)
if (data)
{
memcpy(&t, &data, sizeof(T));
return true;
return true;
}
else
{
t = 0;
return false;
return false;
}
}
@ -141,12 +141,12 @@ bool setGLExtensionFuncPtr(T& t, const char* str1, const char* str2, const char*
if (data)
{
memcpy(&t, &data, sizeof(T));
return true;
return true;
}
else
{
t = 0;
return false;
return false;
}
}

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/

View File

@ -40,7 +40,7 @@ class OSG_EXPORT Geode : public Node
virtual Geode* asGeode() { return this; }
virtual const Geode* asGeode() const { return this; }
/** Add a \c Drawable to the \c Geode.
* If \c drawable is not \c NULL and is not contained in the \c Geode
* then increment its reference count, add it to the drawables list and

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -32,9 +32,9 @@ class OSG_EXPORT Geometry : public Drawable
/** Copy constructor using CopyOp to manage deep vs shallow copy. */
Geometry(const Geometry& geometry,const CopyOp& copyop=CopyOp::SHALLOW_COPY);
virtual Object* cloneType() const { return new Geometry(); }
virtual Object* clone(const CopyOp& copyop) const { return new Geometry(*this,copyop); }
virtual Object* clone(const CopyOp& copyop) const { return new Geometry(*this,copyop); }
virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast<const Geometry*>(obj)!=NULL; }
virtual const char* libraryName() const { return "osg"; }
virtual const char* className() const { return "Geometry"; }
@ -52,13 +52,13 @@ class OSG_EXPORT Geometry : public Drawable
BIND_PER_PRIMITIVE,
BIND_PER_VERTEX
};
struct OSG_EXPORT ArrayData
{
ArrayData():
binding(BIND_OFF),
normalize(GL_FALSE) {}
ArrayData(const ArrayData& data,const CopyOp& copyop=CopyOp::SHALLOW_COPY);
ArrayData(Array* a, AttributeBinding b, GLboolean n = GL_FALSE):
@ -81,21 +81,21 @@ class OSG_EXPORT Geometry : public Drawable
normalize = rhs.normalize;
return *this;
}
inline bool empty() const { return !array.valid(); }
inline bool empty() const { return !array.valid(); }
ref_ptr<Array> array;
ref_ptr<IndexArray> indices;
AttributeBinding binding;
GLboolean normalize;
};
struct OSG_EXPORT Vec3ArrayData
{
Vec3ArrayData():
binding(BIND_OFF),
normalize(GL_FALSE) {}
Vec3ArrayData(const Vec3ArrayData& data,const CopyOp& copyop=CopyOp::SHALLOW_COPY);
Vec3ArrayData(Vec3Array* a, AttributeBinding b, GLboolean n = GL_FALSE):
@ -119,7 +119,7 @@ class OSG_EXPORT Geometry : public Drawable
return *this;
}
inline bool empty() const { return !array.valid(); }
inline bool empty() const { return !array.valid(); }
ref_ptr<Vec3Array> array;
ref_ptr<IndexArray> indices;
@ -127,13 +127,13 @@ class OSG_EXPORT Geometry : public Drawable
GLboolean normalize;
};
/** Static ArrayData which is returned from getTexCoordData(i) const and getVertexAttribData(i) const
/** Static ArrayData which is returned from getTexCoordData(i) const and getVertexAttribData(i) const
* when i is out of range.
*/
static const ArrayData s_InvalidArrayData;
typedef std::vector< ArrayData > ArrayDataList;
void setVertexArray(Array* array);
Array* getVertexArray() { return _vertexData.array.get(); }
@ -142,7 +142,7 @@ class OSG_EXPORT Geometry : public Drawable
void setVertexData(const ArrayData& arrayData);
ArrayData& getVertexData() { return _vertexData; }
const ArrayData& getVertexData() const { return _vertexData; }
void setNormalBinding(AttributeBinding ab);
AttributeBinding getNormalBinding() const { return _normalData.binding; }
@ -189,7 +189,7 @@ class OSG_EXPORT Geometry : public Drawable
void setFogCoordData(const ArrayData& arrayData);
ArrayData& getFogCoordData() { return _fogCoordData; }
const ArrayData& getFogCoordData() const { return _fogCoordData; }
void setTexCoordArray(unsigned int unit,Array*);
Array* getTexCoordArray(unsigned int unit);
@ -228,23 +228,23 @@ class OSG_EXPORT Geometry : public Drawable
typedef std::vector< ref_ptr<PrimitiveSet> > PrimitiveSetList;
void setPrimitiveSetList(const PrimitiveSetList& primitives);
PrimitiveSetList& getPrimitiveSetList() { return _primitives; }
const PrimitiveSetList& getPrimitiveSetList() const { return _primitives; }
unsigned int getNumPrimitiveSets() const { return static_cast<unsigned int>(_primitives.size()); }
PrimitiveSet* getPrimitiveSet(unsigned int pos) { return _primitives[pos].get(); }
const PrimitiveSet* getPrimitiveSet(unsigned int pos) const { return _primitives[pos].get(); }
/** Add a primitive set to the geometry. */
bool addPrimitiveSet(PrimitiveSet* primitiveset);
/** Set a primitive set to the specified position in geometry's primitive set list. */
bool setPrimitiveSet(unsigned int i,PrimitiveSet* primitiveset);
/** Insert a primitive set to the specified position in geometry's primitive set list. */
bool insertPrimitiveSet(unsigned int i,PrimitiveSet* primitiveset);
/** Remove primitive set(s) from the specified position in geometry's primitive set list. */
bool removePrimitiveSet(unsigned int i,unsigned int numElementsToRemove=1);
@ -260,7 +260,7 @@ class OSG_EXPORT Geometry : public Drawable
void setVertexIndices(IndexArray* array);
IndexArray* getVertexIndices() { return _vertexData.indices.get(); }
const IndexArray* getVertexIndices() const { return _vertexData.indices.get(); }
/** deprecated - forces OpenGL slow path, just kept for backwards compatibility.*/
void setNormalIndices(IndexArray* array);
IndexArray* getNormalIndices() { return _normalData.indices.get(); }
@ -294,7 +294,7 @@ class OSG_EXPORT Geometry : public Drawable
/** When set to true, ignore the setUseDisplayList() settings, and hints to the drawImplementation
/** When set to true, ignore the setUseDisplayList() settings, and hints to the drawImplementation
method to use OpenGL vertex buffer objects for rendering.*/
virtual void setUseVertexBufferObjects(bool flag);
@ -358,9 +358,9 @@ class OSG_EXPORT Geometry : public Drawable
bool containsSharedArrays() const;
void duplicateSharedArrays();
void computeInternalOptimizedGeometry();
@ -418,16 +418,16 @@ class OSG_EXPORT Geometry : public Drawable
Geometry& operator = (const Geometry&) { return *this;}
virtual ~Geometry();
bool verifyBindings(const ArrayData& arrayData) const;
bool verifyBindings(const Vec3ArrayData& arrayData) const;
void computeCorrectBindingsAndArraySizes(ArrayData& arrayData,const char* arrayName);
void computeCorrectBindingsAndArraySizes(Vec3ArrayData& arrayData,const char* arrayName);
void addVertexBufferObjectIfRequired(osg::Array* array);
void addElementBufferObjectIfRequired(osg::PrimitiveSet* primitiveSet);
PrimitiveSetList _primitives;
ArrayData _vertexData;

View File

@ -29,7 +29,7 @@ class Camera;
class OSG_EXPORT GraphicsContext : public Object
{
public:
struct OSG_EXPORT ScreenIdentifier
{
ScreenIdentifier();
@ -37,16 +37,16 @@ class OSG_EXPORT GraphicsContext : public Object
ScreenIdentifier(int in_screenNum);
ScreenIdentifier(const std::string& in_hostName,int in_displayNum, int in_screenNum);
/** Return the display name in the form hostName::displayNum:screenNum. */
/** Return the display name in the form hostName::displayNum:screenNum. */
std::string displayName() const;
/** Read the DISPLAY environmental variable, and set the ScreenIdentifier accordingly.
* Note, if either of displayNum or screenNum are not defined then -1 is set respectively to
* signify that this parameter has not been set. When parameters are undefined one can call
* call setUndefinedScreenDetailsToDefaultScreen() after readDISPLAY() to ensure valid values. */
void readDISPLAY();
/** Set the screenIndentifier from the displayName string.
* Note, if either of displayNum or screenNum are not defined then -1 is set to
* signify that this parameter has not been set. When parameters are undefined one can call
@ -64,23 +64,23 @@ class OSG_EXPORT GraphicsContext : public Object
int displayNum;
int screenNum;
};
/** GraphicsContext Traits object provides the specification of what type of graphics context is required.*/
struct OSG_EXPORT Traits : public osg::Referenced, public ScreenIdentifier
{
Traits(DisplaySettings* ds=0);
// graphics context original and size
int x;
int y;
int width;
int height;
// window decoration and behaviour
std::string windowName;
bool windowDecoration;
bool supportsResize;
// buffer depths, 0 equals off.
unsigned int red;
unsigned int blue;
@ -104,10 +104,10 @@ class OSG_EXPORT GraphicsContext : public Object
unsigned int level;
unsigned int face;
unsigned int mipMapGeneration;
// V-sync
bool vsync;
// Swap Group
bool swapGroupEnabled;
GLuint swapGroup;
@ -115,7 +115,7 @@ class OSG_EXPORT GraphicsContext : public Object
// use multithreaded OpenGL-engine (OS X only)
bool useMultiThreadedOpenGLEngine;
// enable cursor
bool useCursor;
@ -126,15 +126,15 @@ class OSG_EXPORT GraphicsContext : public Object
/** return true if glContextVersion is set in the form major.minor, and assign the appropriate major and minor values to the associated parameters.*/
bool getContextVersion(unsigned int& major, unsigned int& minor) const;
// shared context
GraphicsContext* sharedContext;
osg::ref_ptr<osg::Referenced> inheritedWindowData;
// ask the GraphicsWindow implementation to set the pixel format of an inherited window
bool setInheritedWindowPixelFormat;
// X11 hint whether to override the window managers window size/position redirection
bool overrideRedirect;
@ -177,7 +177,7 @@ class OSG_EXPORT GraphicsContext : public Object
virtual void enumerateScreenSettings(const ScreenIdentifier& screenIdentifier, ScreenSettingsList & resolutionList) = 0;
virtual GraphicsContext* createGraphicsContext(Traits* traits) = 0;
virtual ~WindowingSystemInterface() {}
@ -207,17 +207,17 @@ class OSG_EXPORT GraphicsContext : public Object
return setScreenSettings(screenIdentifier, settings);
}
};
/** Set the query the windowing system for screens and create graphics context - this functor should be supplied by the windows toolkit. */
static void setWindowingSystemInterface(WindowingSystemInterface* wsInterface);
/** Get the WindowingSystemInterface*/
static WindowingSystemInterface* getWindowingSystemInterface();
/** Create a graphics context for a specified set of traits.*/
static GraphicsContext* createGraphicsContext(Traits* traits);
/** Create a contextID for a new graphics context, this contextID is used to set up the osg::State associate with context.
* Automatically increments the usage count of the contextID to 1.*/
static unsigned int createNewContextID();
@ -230,29 +230,29 @@ class OSG_EXPORT GraphicsContext : public Object
/** Decrement the usage count associate with a contextID. Once the contextID goes to 0 the contextID is then free to be reused.*/
static void decrementContextIDUsageCount(unsigned int contextID);
typedef std::vector<GraphicsContext*> GraphicsContexts;
/** Get all the registered graphics contexts.*/
static GraphicsContexts getAllRegisteredGraphicsContexts();
/** Get all the registered graphics contexts associated with a specific contextID.*/
static GraphicsContexts getRegisteredGraphicsContexts(unsigned int contextID);
/** Get the GraphicsContext for doing background compilation for GraphicsContexts associated with specified contextID.*/
static void setCompileContext(unsigned int contextID, GraphicsContext* gc);
/** Get existing or create a new GraphicsContext to do background compilation for GraphicsContexts associated with specified contextID.*/
static GraphicsContext* getOrCreateCompileContext(unsigned int contextID);
/** Get the GraphicsContext for doing background compilation for GraphicsContexts associated with specified contextID.*/
static GraphicsContext* getCompileContext(unsigned int contextID);
public:
/** Add operation to end of OperationQueue.*/
void add(Operation* operation);
/** Remove operation from OperationQueue.*/
void remove(Operation* operation);
@ -266,7 +266,7 @@ class OSG_EXPORT GraphicsContext : public Object
virtual void runOperations();
typedef std::list< ref_ptr<Operation> > GraphicsOperationQueue;
/** Get the operations queue, not you must use the OperationsMutex when accessing the queue.*/
GraphicsOperationQueue& getOperationsQueue() { return _operations; }
@ -281,7 +281,7 @@ class OSG_EXPORT GraphicsContext : public Object
public:
/** Get the traits of the GraphicsContext.*/
inline const Traits* getTraits() const { return _traits.get(); }
@ -291,10 +291,10 @@ class OSG_EXPORT GraphicsContext : public Object
/** Set the State object which tracks the current OpenGL state for this graphics context.*/
inline void setState(State* state) { _state = state; }
/** Get the State object which tracks the current OpenGL state for this graphics context.*/
inline State* getState() { return _state.get(); }
/** Get the const State object which tracks the current OpenGL state for this graphics context.*/
inline const State* getState() const { return _state.get(); }
@ -304,7 +304,7 @@ class OSG_EXPORT GraphicsContext : public Object
/** Returns the clear color. */
inline const Vec4& getClearColor() const { return _clearColor; }
/** Set the clear mask used in glClear(..).
* Defaults to 0 - so no clear is done by default by the GraphicsContext, instead the Cameras attached to the GraphicsContext will do the clear.
* GraphicsContext::setClearMask() is useful for when the Camera Viewports don't cover the whole context, so the context will fill in the gaps. */
@ -312,13 +312,13 @@ class OSG_EXPORT GraphicsContext : public Object
/** Get the clear mask.*/
inline GLbitfield getClearMask() const { return _clearMask; }
/** Do an OpenGL clear of the full graphics context/window.
* Note, must only be called from a thread with this context current.*/
virtual void clear();
double getTimeSinceLastClear() const { return osg::Timer::instance()->delta_s(_lastClearTick, osg::Timer::instance()->tick()); }
/** Realize the GraphicsContext.*/
bool realize();
@ -338,19 +338,19 @@ class OSG_EXPORT GraphicsContext : public Object
/** Make this graphics context current.
* Implemented by calling makeCurrentImplementation().
* Implemented by calling makeCurrentImplementation().
* Returns true on success. */
bool makeCurrent();
/** Make this graphics context current with specified read context.
* Implemented by calling makeContextCurrentImplementation().
* Returns true on success. */
bool makeContextCurrent(GraphicsContext* readContext);
/** Release the graphics context.
* Returns true on success. */
bool releaseContext();
/** Return true if the current thread has this OpenGL graphics context.*/
inline bool isCurrent() const { return _threadOfLastMakeCurrent == OpenThreads::Thread::CurrentThread(); }
@ -372,7 +372,7 @@ class OSG_EXPORT GraphicsContext : public Object
const GraphicsThread* getGraphicsThread() const { return _graphicsThread.get(); }
/** Realize the GraphicsContext implementation,
/** Realize the GraphicsContext implementation,
* Pure virtual - must be implemented by concrete implementations of GraphicsContext. */
virtual bool realizeImplementation() = 0;
@ -387,7 +387,7 @@ class OSG_EXPORT GraphicsContext : public Object
/** Make this graphics context current implementation.
* Pure virtual - must be implemented by concrete implementations of GraphicsContext. */
virtual bool makeCurrentImplementation() = 0;
/** Make this graphics context current with specified read context implementation.
* Pure virtual - must be implemented by concrete implementations of GraphicsContext. */
virtual bool makeContextCurrentImplementation(GraphicsContext* readContext) = 0;
@ -407,7 +407,7 @@ class OSG_EXPORT GraphicsContext : public Object
* GraphicsContext::swapBuffersImplementation(), allowing
* developers to provide custom behavior for swap.
* The callback must call
* GraphicsContext::swapBuffersImplementation() */
* GraphicsContext::swapBuffersImplementation() */
void setSwapCallback(SwapCallback* rc) { _swapCallback = rc; }
/** Get the swap callback which overrides the GraphicsContext::swapBuffersImplementation().*/
@ -467,10 +467,10 @@ class OSG_EXPORT GraphicsContext : public Object
/** Get the the const list of cameras associated with this graphics context.*/
const Cameras& getCameras() const { return _cameras; }
/** set the default FBO-id, this id will be used when the rendering-backend is finished with RTT FBOs */
void setDefaultFboId(GLuint i) { _defaultFboId = i; }
GLuint getDefaultFboId() const { return _defaultFboId; }
public:
@ -480,7 +480,7 @@ class OSG_EXPORT GraphicsContext : public Object
virtual const char* className() const { return "GraphicsContext"; }
protected:
GraphicsContext();
GraphicsContext(const GraphicsContext&, const osg::CopyOp&);
@ -498,31 +498,31 @@ class OSG_EXPORT GraphicsContext : public Object
void addCamera(osg::Camera* camera);
void removeCamera(osg::Camera* camera);
Cameras _cameras;
friend class osg::Camera;
ref_ptr<Traits> _traits;
ref_ptr<Traits> _traits;
ref_ptr<State> _state;
Vec4 _clearColor;
GLbitfield _clearMask;
OpenThreads::Thread* _threadOfLastMakeCurrent;
OpenThreads::Mutex _operationsMutex;
osg::ref_ptr<osg::RefBlock> _operationsBlock;
GraphicsOperationQueue _operations;
osg::ref_ptr<Operation> _currentOperation;
ref_ptr<GraphicsThread> _graphicsThread;
ref_ptr<ResizedCallback> _resizedCallback;
ref_ptr<SwapCallback> _swapCallback;
Timer_t _lastClearTick;
GLuint _defaultFboId;
};

View File

@ -25,10 +25,10 @@ class GraphicsContext;
class OSG_EXPORT GraphicsThread : public osg::OperationThread
{
public:
GraphicsThread();
/** Run does the graphics thread run loop.*/
/** Run does the graphics thread run loop.*/
virtual void run();
};
@ -72,11 +72,11 @@ struct OSG_EXPORT BarrierOperation : public Operation, public OpenThreads::Barri
virtual void release();
virtual void operator () (Object* object);
PreBlockOp _preBlockOp;
};
/** ReleaseContext_Block_MakeCurrentOperation releases the context for another thread to acquire,
/** ReleaseContext_Block_MakeCurrentOperation releases the context for another thread to acquire,
* then blocks waiting for context to be released, once the block is release the context is re-acquired.*/
struct OSG_EXPORT ReleaseContext_Block_MakeCurrentOperation : public GraphicsOperation, public RefBlock
{
@ -103,7 +103,7 @@ struct OSG_EXPORT FlushDeletedGLObjectsOperation : public GraphicsOperation
FlushDeletedGLObjectsOperation(double availableTime, bool keep=false);
virtual void operator () (GraphicsContext*);
double _availableTime;
};
@ -113,17 +113,17 @@ public:
RunOperations():
osg::GraphicsOperation("RunOperation",true) {}
virtual void operator () (osg::GraphicsContext* context);
};
class OSG_EXPORT EndOfDynamicDrawBlock : public OpenThreads::BlockCount, public osg::State::DynamicObjectRenderingCompletedCallback
{
public:
EndOfDynamicDrawBlock(unsigned int);
void completed(osg::State* state);
protected:

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -31,7 +31,7 @@ class OSG_EXPORT Group : public Node
Group();
/** Copy constructor using CopyOp to manage deep vs shallow copy. */
Group(const Group&,const CopyOp& copyop=CopyOp::SHALLOW_COPY);
@ -53,13 +53,13 @@ class OSG_EXPORT Group : public Node
/** Insert Node to Group at specific location.
* The new child node is inserted into the child list
* before the node at the specified index. No nodes
* are removed from the group with this operation.
* are removed from the group with this operation.
*/
virtual bool insertChild( unsigned int index, Node *child );
/** Remove Node from Group.
* If Node is contained in Group then remove it from the child
* list, decrement its reference count, and dirty the
* list, decrement its reference count, and dirty the
* bounding sphere to force it to recompute on next getBound() and
* return true for success. If Node is not found then return false
* and do not change the reference count of the Node.
@ -74,7 +74,7 @@ class OSG_EXPORT Group : public Node
/** Remove Node from Group.
* If Node is contained in Group then remove it from the child
* list, decrement its reference count, and dirty the
* list, decrement its reference count, and dirty the
* bounding sphere to force it to recompute on next getBound() and
* return true for success. If Node is not found then return false
* and do not change the reference count of the Node.
@ -104,7 +104,7 @@ class OSG_EXPORT Group : public Node
* When Set can be successful applied, the algorithm is : decrement the reference count origNode and increment the
* reference count of newNode, and dirty the bounding sphere
* to force it to recompute on next getBound() and return true.
* If origNode is not found then return false and do not
* If origNode is not found then return false and do not
* add newNode. If newNode is NULL then return false and do
* not remove origNode. Also returns false if newChild is a Scene node.
*/
@ -119,7 +119,7 @@ class OSG_EXPORT Group : public Node
/** Return true if node is contained within Group. */
inline bool containsNode( const Node* node ) const
{
for (NodeList::const_iterator itr=_children.begin();
itr!=_children.end();
++itr)
@ -154,7 +154,7 @@ class OSG_EXPORT Group : public Node
virtual void releaseGLObjects(osg::State* = 0) const;
virtual BoundingSphere computeBound() const;
protected:
virtual ~Group();

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -53,16 +53,16 @@ public:
// compare each parameter in turn against the rhs.
COMPARE_StateAttribute_Parameter(_target)
COMPARE_StateAttribute_Parameter(_mode)
return 0;
}
/** Return the member identifier within the attribute's class type. Used for light number/clip plane number etc.*/
virtual unsigned int getMember() const { return static_cast<unsigned int>(_target); }
void setTarget(GLenum target);
inline GLenum getTarget() const { return _target; }
inline void setMode(GLenum mode) { _mode = mode; }
inline GLenum getMode() const { return _mode; }
@ -70,7 +70,7 @@ public:
protected:
GLenum _target;
GLenum _mode;
};

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -93,7 +93,7 @@
#endif
#ifndef GL_OES_compressed_ETC1_RGB8_texture
#define GL_ETC1_RGB8_OES 0x8D64
#define GL_ETC1_RGB8_OES 0x8D64
#endif
namespace osg {
@ -108,7 +108,7 @@ class OSG_EXPORT Image : public BufferData
public :
Image();
/** Copy constructor using CopyOp to manage deep vs shallow copy. */
Image(const Image& image,const CopyOp& copyop=CopyOp::SHALLOW_COPY);
@ -129,22 +129,22 @@ class OSG_EXPORT Image : public BufferData
void setFileName(const std::string& fileName);
inline const std::string& getFileName() const { return _fileName; }
enum WriteHint {
NO_PREFERENCE,
STORE_INLINE,
EXTERNAL_FILE
};
void setWriteHint(WriteHint writeHint) { _writeHint = writeHint; }
WriteHint getWriteHint() const { return _writeHint; }
enum AllocationMode {
NO_DELETE,
USE_NEW_DELETE,
USE_MALLOC_FREE
};
/** Set the method used for deleting data once it goes out of scope. */
void setAllocationMode(AllocationMode mode) { _allocationMode = mode; }
@ -156,8 +156,8 @@ class OSG_EXPORT Image : public BufferData
virtual void allocateImage(int s,int t,int r,
GLenum pixelFormat,GLenum type,
int packing=1);
/** Set the image dimensions, format and data. */
virtual void setImage(int s,int t,int r,
GLint internalTextureformat,
@ -165,13 +165,13 @@ class OSG_EXPORT Image : public BufferData
unsigned char* data,
AllocationMode mode,
int packing=1, int rowLength=0);
/** Read pixels from current frame buffer at specified position and size, using glReadPixels.
* Create memory for storage if required, reuse existing pixel coords if possible.
*/
virtual void readPixels(int x,int y,int width,int height,
GLenum pixelFormat,GLenum type);
/** Read the contents of the current bound texture, handling compressed pixelFormats if present.
* Create memory for storage if required, reuse existing pixel coords if possible.
@ -195,44 +195,44 @@ class OSG_EXPORT Image : public BufferData
virtual void copySubImage(int s_offset, int t_offset, int r_offset, const osg::Image* source);
enum Origin
enum Origin
{
BOTTOM_LEFT,
TOP_LEFT
};
/** Set the origin of the image.
* The default value is BOTTOM_LEFT and is consistent with OpenGL.
* TOP_LEFT is used for imagery that follows standard Imagery convention, such as movies,
* and hasn't been flipped yet. For such images one much flip the t axis of the tex coords.
* to handle this origin position. */
void setOrigin(Origin origin) { _origin = origin; }
/** Get the origin of the image.*/
Origin getOrigin() const { return _origin; }
/** Width of image. */
inline int s() const { return _s; }
/** Height of image. */
inline int t() const { return _t; }
/** Depth of image. */
inline int r() const { return _r; }
void setRowLength(int length);
inline int getRowLength() const { return _rowLength; }
void setInternalTextureFormat(GLint internalFormat);
inline GLint getInternalTextureFormat() const { return _internalTextureFormat; }
void setPixelFormat(GLenum pixelFormat);
inline GLenum getPixelFormat() const { return _pixelFormat; }
void setDataType(GLenum dataType);
inline GLenum getDataType() const { return _dataType; }
inline GLenum getDataType() const { return _dataType; }
void setPacking(unsigned int packing) { _packing = packing; }
inline unsigned int getPacking() const { return _packing; }
@ -244,7 +244,7 @@ class OSG_EXPORT Image : public BufferData
/** Get the pixel aspect ratio.*/
inline float getPixelAspectRatio() const { return _pixelAspectRatio; }
/** Return the number of bits required for each pixel. */
inline unsigned int getPixelSizeInBits() const { return computePixelSizeInBits(_pixelFormat,_dataType); }
@ -257,8 +257,8 @@ class OSG_EXPORT Image : public BufferData
/** Return the number of bytes each image (_s*_t) of pixels occupies. */
inline unsigned int getImageSizeInBytes() const { return getRowSizeInBytes()*_t; }
/** Return the number of bytes between each successive image.
/** Return the number of bytes between each successive image.
* Note, getImageSizeInBytes() will only equal getImageStepInBytes() when isDataContiguous() return true. */
inline unsigned int getImageStepInBytes() const { return getRowStepInBytes()*_t; }
@ -275,7 +275,7 @@ class OSG_EXPORT Image : public BufferData
* Note, data in successive rows may not be contiguous, isDataContiguous() return false then you should
* take care to access the data per row rather than treating the whole data as a single block. */
inline unsigned char* data() { return _data; }
/** Raw const image data.
* Note, data in successive rows may not be contiguous, isDataContiguous() return false then you should
* take care to access the data per row rather than treating the whole data as a single block. */
@ -286,7 +286,7 @@ class OSG_EXPORT Image : public BufferData
if (!_data) return NULL;
return _data+(column*getPixelSizeInBits())/8+row*getRowStepInBytes()+image*getImageSizeInBytes();
}
inline const unsigned char* data(int column, int row=0,int image=0) const
{
if (!_data) return NULL;
@ -318,9 +318,9 @@ class OSG_EXPORT Image : public BufferData
protected:
void assign();
const osg::Image* _image;
int _rowNum;
int _imageNum;
@ -341,7 +341,7 @@ class OSG_EXPORT Image : public BufferData
/** Flip the image horizontally, around s dimension. */
void flipHorizontal();
/** Flip the image vertically, around t dimension. */
void flipVertical();
@ -378,7 +378,7 @@ class OSG_EXPORT Image : public BufferData
/** Send offsets into data. It is assumed that first mipmap offset (index 0) is 0.*/
inline void setMipmapLevels(const MipmapDataType& mipmapDataVector) { _mipmapData = mipmapDataVector; }
inline const MipmapDataType& getMipmapLevels() const { return _mipmapData; }
inline unsigned int getMipmapOffset(unsigned int mipmapLevel) const
@ -389,7 +389,7 @@ class OSG_EXPORT Image : public BufferData
return _mipmapData[mipmapLevel-1];
return 0;
};
inline unsigned char* getMipmapData(unsigned int mipmapLevel)
{
return _data+getMipmapOffset(mipmapLevel);
@ -406,7 +406,7 @@ class OSG_EXPORT Image : public BufferData
/** Return true if this image is translucent - i.e. it has alpha values that are less 1.0 (when normalized). */
virtual bool isImageTranslucent() const;
/** Set the optional PixelBufferObject used to map the image memory efficiently to graphics memory. */
/** Set the optional PixelBufferObject used to map the image memory efficiently to graphics memory. */
void setPixelBufferObject(PixelBufferObject* buffer) { setBufferObject(buffer); }
/** Get the PixelBufferObject.*/
@ -464,13 +464,13 @@ class OSG_EXPORT Image : public BufferData
AllocationMode _allocationMode;
unsigned char* _data;
void deallocateData();
void setData(unsigned char* data,AllocationMode allocationMode);
MipmapDataType _mipmapData;
ref_ptr<PixelBufferObject> _bufferObject;
};

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -44,13 +44,13 @@ class OSG_EXPORT ImageSequence : public ImageStream
virtual void setReferenceTime(double t) { _referenceTime = t; }
virtual double getReferenceTime() const { return _referenceTime; }
virtual void setTimeMultiplier(double tm) { _timeMultiplier = tm; }
virtual double getTimeMultiplier() const { return _timeMultiplier; }
typedef std::vector< osg::ref_ptr<osg::Image> > Images;
typedef std::vector< std::string > FileNames;
virtual void seek(double time);
virtual void play();
@ -58,33 +58,33 @@ class OSG_EXPORT ImageSequence : public ImageStream
virtual void pause();
virtual void rewind();
enum Mode
{
PRE_LOAD_ALL_IMAGES,
PAGE_AND_RETAIN_IMAGES,
PAGE_AND_DISCARD_USED_IMAGES
};
void setMode(Mode mode);
Mode getMode() const { return _mode; }
void setLength(double length);
virtual double getLength() const { return _length; }
void addImageFile(const std::string& fileName);
void setImageFile(unsigned int pos, const std::string& fileName);
std::string getImageFile(unsigned int pos) const;
unsigned int getNumImageFiles() const { return _fileNames.size(); }
FileNames& getFileNames() { return _fileNames; }
const FileNames& getFileNames() const { return _fileNames; }
void addImage(osg::Image* image);
void setImage(int s,int t,int r,
GLint internalTextureformat,
GLenum pixelFormat,GLenum type,
@ -95,7 +95,7 @@ class OSG_EXPORT ImageSequence : public ImageStream
void setImage(unsigned int pos, osg::Image* image);
Image* getImage(unsigned int pos);
const Image* getImage(unsigned int pos) const;
unsigned int getNumImages() const { return _images.size(); }
Images& getImages() { return _images; }
@ -110,11 +110,11 @@ class OSG_EXPORT ImageSequence : public ImageStream
protected:
virtual ~ImageSequence() {}
virtual void applyLoopingMode();
void setImageToChild(const osg::Image* image);
void computeTimePerImage();
int imageIndex(double time);
@ -132,17 +132,17 @@ class OSG_EXPORT ImageSequence : public ImageStream
FileNames _fileNames;
Images _images;
typedef std::set< std::string > FilesRequested;
FilesRequested _filesRequested;
int _previousAppliedImageIndex;
bool _seekTimeSet;
double _seekTime;
};

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -46,7 +46,7 @@ class OSG_EXPORT ImageStream : public Image
PAUSED,
REWINDING
};
virtual void seek(double /*time*/) {}
virtual void play() { _status=PLAYING; }
@ -54,39 +54,39 @@ class OSG_EXPORT ImageStream : public Image
virtual void pause() { _status=PAUSED; }
virtual void rewind() { _status=REWINDING; }
virtual void quit(bool /*waitForThreadToExit*/ = true) {}
StreamStatus getStatus() { return _status; }
enum LoopingMode
{
NO_LOOPING,
LOOPING
};
void setLoopingMode(LoopingMode mode)
{
if (_loopingMode == mode) return;
_loopingMode = mode;
applyLoopingMode();
}
LoopingMode getLoopingMode() const { return _loopingMode; }
virtual double getCreationTime() const { return HUGE_VAL; }
virtual double getLength() const { return 0.0; }
virtual double getFrameRate() const { return 0.0; }
virtual double getFrameRate() const { return 0.0; }
virtual double getCurrentTime() const { return 0.0; }
virtual void setReferenceTime(double) {}
virtual double getReferenceTime() const { return 0.0; }
virtual void setTimeMultiplier(double) {}
virtual double getTimeMultiplier() const { return 0.0; }
virtual void setVolume(float) {}
virtual float getVolume() const { return 0.0f; }
@ -94,7 +94,7 @@ class OSG_EXPORT ImageStream : public Image
void setAudioStreams(const AudioStreams& asl) { _audioStreams = asl; }
AudioStreams& getAudioStreams() { return _audioStreams; }
const AudioStreams& getAudioStreams() const { return _audioStreams; }
protected:
virtual void applyLoopingMode() {}
@ -103,7 +103,7 @@ class OSG_EXPORT ImageStream : public Image
StreamStatus _status;
LoopingMode _loopingMode;
AudioStreams _audioStreams;
};

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -20,7 +20,7 @@
namespace osg {
template <typename T, class O>
template <typename T, class O>
void _readRow(unsigned int num, GLenum pixelFormat, const T* data,float scale, O& operation)
{
switch(pixelFormat)
@ -35,7 +35,7 @@ void _readRow(unsigned int num, GLenum pixelFormat, const T* data,float scale, O
}
}
template <class O>
template <class O>
void readRow(unsigned int num, GLenum pixelFormat, GLenum dataType, const unsigned char* data, O& operation)
{
switch(dataType)
@ -50,11 +50,11 @@ void readRow(unsigned int num, GLenum pixelFormat, GLenum dataType, const unsign
}
}
template <class O>
template <class O>
void readImage(const osg::Image* image, O& operation)
{
if (!image) return;
for(int r=0;r<image->r();++r)
{
for(int t=0;t<image->t();++t)
@ -67,15 +67,15 @@ void readImage(const osg::Image* image, O& operation)
// example ModifyOperator
// struct ModifyOperator
// {
// inline void luminance(float& l) const {}
// inline void alpha(float& a) const {}
// inline void luminance_alpha(float& l,float& a) const {}
// inline void luminance(float& l) const {}
// inline void alpha(float& a) const {}
// inline void luminance_alpha(float& l,float& a) const {}
// inline void rgb(float& r,float& g,float& b) const {}
// inline void rgba(float& r,float& g,float& b,float& a) const {}
// };
template <typename T, class M>
template <typename T, class M>
void _modifyRow(unsigned int num, GLenum pixelFormat, T* data,float scale, const M& operation)
{
float inv_scale = 1.0f/scale;
@ -91,7 +91,7 @@ void _modifyRow(unsigned int num, GLenum pixelFormat, T* data,float scale, const
}
}
template <class M>
template <class M>
void modifyRow(unsigned int num, GLenum pixelFormat, GLenum dataType, unsigned char* data, const M& operation)
{
switch(dataType)
@ -106,11 +106,11 @@ void modifyRow(unsigned int num, GLenum pixelFormat, GLenum dataType, unsigned c
}
}
template <class M>
template <class M>
void modifyImage(osg::Image* image, const M& operation)
{
if (!image) return;
for(int r=0;r<image->r();++r)
{
for(int t=0;t<image->t();++t)

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -23,31 +23,31 @@ namespace osg
{
/** Implementation of a kdtree for Geometry leaves, to enable fast intersection tests.*/
class OSG_EXPORT KdTree : public osg::Shape
class OSG_EXPORT KdTree : public osg::Shape
{
public:
KdTree();
KdTree(const KdTree& rhs, const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY);
META_Shape(osg, KdTree)
struct OSG_EXPORT BuildOptions
{
BuildOptions();
unsigned int _numVerticesProcessed;
unsigned int _targetNumTrianglesPerLeaf;
unsigned int _maxNumLevels;
};
/** Build the kdtree from the specified source geometry object.
* retun true on success. */
* retun true on success. */
virtual bool build(BuildOptions& buildOptions, osg::Geometry* geometry);
struct LineSegmentIntersection
{
LineSegmentIntersection():
@ -77,11 +77,11 @@ class OSG_EXPORT KdTree : public osg::Shape
float r2;
unsigned int primitiveIndex;
};
};
typedef std::vector<LineSegmentIntersection> LineSegmentIntersections;
/** compute the intersection of a line segment and the kdtree, return true if an intersection has been found.*/
virtual bool intersect(const osg::Vec3d& start, const osg::Vec3d& end, LineSegmentIntersections& intersections) const;
@ -100,15 +100,15 @@ class OSG_EXPORT KdTree : public osg::Shape
osg::BoundingBox bb;
value_type first;
value_type first;
value_type second;
};
struct Triangle
{
Triangle():
p0(0),p1(0),p2(0) {}
Triangle(unsigned int ip0, unsigned int ip1, unsigned int ip2):
p0(ip0), p1(ip1), p2(ip2) {}
@ -131,14 +131,14 @@ class OSG_EXPORT KdTree : public osg::Shape
int addNode(const KdNode& node)
{
int num = static_cast<int>(_kdNodes.size());
_kdNodes.push_back(node);
int num = static_cast<int>(_kdNodes.size());
_kdNodes.push_back(node);
return num;
}
KdNode& getNode(int nodeNum) { return _kdNodes[nodeNum]; }
const KdNode& getNode(int nodeNum) const { return _kdNodes[nodeNum]; }
KdNodeList& getNodes() { return _kdNodes; }
const KdNodeList& getNodes() const { return _kdNodes; }
@ -170,9 +170,9 @@ class OSG_EXPORT KdTree : public osg::Shape
class OSG_EXPORT KdTreeBuilder : public osg::NodeVisitor
{
public:
KdTreeBuilder();
KdTreeBuilder(const KdTreeBuilder& rhs);
META_NodeVisitor("osg","KdTreeBuilder")
@ -180,17 +180,17 @@ class OSG_EXPORT KdTreeBuilder : public osg::NodeVisitor
virtual KdTreeBuilder* clone() { return new KdTreeBuilder(*this); }
void apply(osg::Geode& geode);
KdTree::BuildOptions _buildOptions;
osg::ref_ptr<osg::KdTree> _kdTreePrototype;
protected:
virtual ~KdTreeBuilder() {}
};
}

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -35,7 +35,7 @@ namespace osg {
class OSG_EXPORT LOD : public Group
{
public :
LOD();
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
@ -47,7 +47,7 @@ class OSG_EXPORT LOD : public Group
typedef osg::BoundingSphere::value_type value_type;
virtual void traverse(NodeVisitor& nv);
virtual bool addChild(Node *child);
virtual bool addChild(Node *child, float min, float max);
@ -56,7 +56,7 @@ class OSG_EXPORT LOD : public Group
typedef std::pair<float,float> MinMaxPair;
typedef std::vector<MinMaxPair> RangeList;
/** Modes which control how the center of object should be determined when computing which child is active.*/
enum CenterMode
{
@ -71,18 +71,18 @@ class OSG_EXPORT LOD : public Group
/** Get how the center of object should be determined when computing which child is active.*/
CenterMode getCenterMode() const { return _centerMode; }
/** Sets the object-space point which defines the center of the osg::LOD.
/** Sets the object-space point which defines the center of the osg::LOD.
center is affected by any transforms in the hierarchy above the osg::LOD.*/
inline void setCenter(const vec_type& center) { if (_centerMode!=UNION_OF_BOUNDING_SPHERE_AND_USER_DEFINED) { _centerMode=USER_DEFINED_CENTER; } _userDefinedCenter = center; }
/** return the LOD center point. */
inline const vec_type& getCenter() const { if ((_centerMode==USER_DEFINED_CENTER)||(_centerMode==UNION_OF_BOUNDING_SPHERE_AND_USER_DEFINED)) return _userDefinedCenter; else return getBound().center(); }
/** Set the object-space reference radius of the volume enclosed by the LOD.
/** Set the object-space reference radius of the volume enclosed by the LOD.
* Used to determine the bounding sphere of the LOD in the absence of any children.*/
inline void setRadius(value_type radius) { _radius = radius; }
/** Get the object-space radius of the volume enclosed by the LOD.*/
inline value_type getRadius() const { return _radius; }
@ -92,7 +92,7 @@ class OSG_EXPORT LOD : public Group
DISTANCE_FROM_EYE_POINT,
PIXEL_SIZE_ON_SCREEN
};
/** Set how the range values should be interpreted when computing which child is active.*/
void setRangeMode(RangeMode mode) { _rangeMode = mode; }
@ -103,14 +103,14 @@ class OSG_EXPORT LOD : public Group
/** Sets the min and max visible ranges of range of specific child.
Values are floating point distance specified in local objects coordinates.*/
void setRange(unsigned int childNo, float min,float max);
/** returns the min visible range for specified child.*/
inline float getMinRange(unsigned int childNo) const { return _rangeList[childNo].first; }
/** returns the max visible range for specified child.*/
inline float getMaxRange(unsigned int childNo) const { return _rangeList[childNo].second; }
/** returns the number of ranges currently set.
/** returns the number of ranges currently set.
* An LOD which has been fully set up will have getNumChildren()==getNumRanges(). */
inline unsigned int getNumRanges() const { return _rangeList.size(); }

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -58,7 +58,7 @@ class OSG_EXPORT Light : public StateAttribute
_quadratic_attenuation(light._quadratic_attenuation),
_spot_exponent(light._spot_exponent),
_spot_cutoff(light._spot_cutoff) {}
virtual osg::Object* cloneType() const { return new Light(_lightnum); }
virtual osg::Object* clone(const osg::CopyOp& copyop) const { return new Light(*this,copyop); }
virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast<const Light *>(obj)!=NULL; }
@ -96,12 +96,12 @@ class OSG_EXPORT Light : public StateAttribute
usage.usesMode(GL_LIGHT0+_lightnum);
return true;
}
/** Set which OpenGL light to operate on. */
void setLightNum(int num);
/** Get which OpenGL light this osg::Light operates on. */
int getLightNum() const { return _lightnum; }
@ -123,16 +123,16 @@ class OSG_EXPORT Light : public StateAttribute
/** Get the specular component of the light. */
inline const Vec4& getSpecular() const { return _specular; }
/** Set the position of the light. */
/** Set the position of the light. */
inline void setPosition( const Vec4& position ) { _position = position; }
/** Get the position of the light. */
/** Get the position of the light. */
inline const Vec4& getPosition() const { return _position; }
/** Set the direction of the light. */
/** Set the direction of the light. */
inline void setDirection( const Vec3& direction ) { _direction = direction; }
/** Get the direction of the light. */
/** Get the direction of the light. */
inline const Vec3& getDirection() const { return _direction; }
/** Set the constant attenuation of the light. */
@ -174,7 +174,7 @@ class OSG_EXPORT Light : public StateAttribute
virtual void apply(State& state) const;
protected :
virtual ~Light();
/** Initialize the light's settings with some decent defaults. */

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -62,7 +62,7 @@ class OSG_EXPORT LightModel : public StateAttribute
SEPARATE_SPECULAR_COLOR,
SINGLE_COLOR
};
void setColorControl(ColorControl cc) { _colorControl = cc; }
inline ColorControl getColorControl() const { return _colorControl; }

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2004 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2004 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -24,7 +24,7 @@ namespace osg {
class OSG_EXPORT LightSource : public Group
{
public:
LightSource();
/** Copy constructor using CopyOp to manage deep vs shallow copy. */
@ -42,7 +42,7 @@ class OSG_EXPORT LightSource : public Group
RELATIVE_RF,
ABSOLUTE_RF
};
/** Set the light sources's ReferenceFrame, either to be relative to its
* parent reference frame, or relative to an absolute coordinate
* frame. RELATIVE_RF is the default.
@ -55,7 +55,7 @@ class OSG_EXPORT LightSource : public Group
* absolute light source at the top of the scene.
*/
void setReferenceFrame(ReferenceFrame rf);
ReferenceFrame getReferenceFrame() const { return _referenceFrame; }
/** Set the attached light. */

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2004 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2004 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -35,7 +35,7 @@ class OSG_EXPORT LineSegment : public Referenced
LineSegment& operator = (const LineSegment& seg) { _s = seg._s; _e = seg._e; return *this; }
inline void set(const vec_type& s,const vec_type& e) { _s=s; _e=e; }
inline vec_type& start() { return _s; }
inline const vec_type& start() const { return _s; }
@ -64,7 +64,7 @@ class OSG_EXPORT LineSegment : public Referenced
* intersection ratio.
*/
bool intersect(const BoundingSphere& bs,float& r1,float& r2) const;
/** return true if segment intersects BoundingSphere and return the
* intersection ratio.
*/
@ -89,7 +89,7 @@ class OSG_EXPORT LineSegment : public Referenced
protected:
virtual ~LineSegment();
static bool intersectAndClip(vec_type& s,vec_type& e,const BoundingBox& bb);
vec_type _s;

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2004 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2004 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -53,7 +53,7 @@ class OSG_EXPORT LineStipple : public StateAttribute
return 0; // passed all the above comparison macros, must be equal.
}
virtual bool getModeUsage(StateAttribute::ModeUsage& usage) const
{
usage.usesMode(GL_LINE_STIPPLE);

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2004 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2004 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -29,9 +29,9 @@ class OSG_EXPORT LineWidth : public StateAttribute
LineWidth(const LineWidth& lw,const CopyOp& copyop=CopyOp::SHALLOW_COPY) :
StateAttribute(lw,copyop),
_width(lw._width) {}
META_StateAttribute(osg, LineWidth, LINEWIDTH);
/** return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs. */
virtual int compare(const StateAttribute& sa) const
{
@ -46,7 +46,7 @@ class OSG_EXPORT LineWidth : public StateAttribute
}
void setWidth(float width);
inline float getWidth() const { return _width; }
virtual void apply(State& state) const;

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -62,7 +62,7 @@ class OSG_EXPORT LogicOp : public StateAttribute
};
LogicOp();
LogicOp(Opcode opcode);
/** Copy constructor using CopyOp to manage deep vs shallow copy. */
@ -71,7 +71,7 @@ class OSG_EXPORT LogicOp : public StateAttribute
_opcode(trans._opcode){}
META_StateAttribute(osg, LogicOp,LOGICOP);
/** Return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs. */
virtual int compare(const StateAttribute& sa) const
{
@ -98,7 +98,7 @@ class OSG_EXPORT LogicOp : public StateAttribute
}
inline Opcode getOpcode() const { return _opcode; }
virtual void apply(State& state) const;
protected :

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2004 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2004 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -33,7 +33,7 @@ class OSG_EXPORT Material : public StateAttribute
public :
Material();
/** Copy constructor using CopyOp to manage deep vs shallow copy. */
Material(const Material& mat,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
StateAttribute(mat,copyop),
@ -55,7 +55,7 @@ class OSG_EXPORT Material : public StateAttribute
_shininessBack(mat._shininessBack) {}
META_StateAttribute(osg, Material, MATERIAL);
/** return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs. */
virtual int compare(const StateAttribute& sa) const
{
@ -108,7 +108,7 @@ class OSG_EXPORT Material : public StateAttribute
SPECULAR = GL_SPECULAR,
EMISSION = GL_EMISSION,
AMBIENT_AND_DIFFUSE = GL_AMBIENT_AND_DIFFUSE,
OFF
OFF
};
inline void setColorMode(ColorMode mode) { _colorMode = mode; }
@ -122,27 +122,27 @@ class OSG_EXPORT Material : public StateAttribute
const Vec4& getDiffuse(Face face) const;
inline bool getDiffuseFrontAndBack() const { return _diffuseFrontAndBack; }
/** Set specular value of specified face(s) of the material,
/** Set specular value of specified face(s) of the material,
* valid specular[0..3] range is 0.0 to 1.0.
*/
void setSpecular( Face face, const Vec4& specular );
/** Get the specular value for specified face. */
const Vec4& getSpecular(Face face) const;
/** Return whether specular values are equal for front and back faces
* or not.
*/
inline bool getSpecularFrontAndBack() const { return _specularFrontAndBack; }
/** Set emission value of specified face(s) of the material,
/** Set emission value of specified face(s) of the material,
* valid emission[0..3] range is 0.0 to 1.0.
*/
void setEmission( Face face, const Vec4& emission );
/** Get the emission value for specified face. */
const Vec4& getEmission(Face face) const;
/** Return whether emission values are equal for front and back faces
* or not.
*/
@ -152,15 +152,15 @@ class OSG_EXPORT Material : public StateAttribute
* valid shininess range is 0.0 to 128.0.
*/
void setShininess(Face face, float shininess );
/** Get the shininess value for specified face. */
float getShininess(Face face) const;
/** Return whether shininess values are equal for front and back faces
* or not.
*/
inline bool getShininessFrontAndBack() const { return _shininessFrontAndBack; }
/** Set the alpha value of ambient, diffuse, specular and emission
* colors of specified face, to 1-transparency.
* Valid transparency range is 0.0 to 1.0.

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2004 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2004 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -21,8 +21,8 @@
//certain math functions were not defined until 10.2
//so this code checks the version so it can add in workarounds for older versions.
#ifdef __APPLE__
// Using std::isnan will work for OS X, but use of <cmath>
// and std:: are not necessarily portible with other systems so
// Using std::isnan will work for OS X, but use of <cmath>
// and std:: are not necessarily portible with other systems so
// the include of <cmath> is isolated here.
#include <cmath>
#include <AvailabilityMacros.h>
@ -33,7 +33,7 @@
// pre-10.2 support is not intended and we need not define APPLE_PRE_10_2.
// The reason for this extra check is that if the user relies on default
// settings, MAC_OS_X_VERSION_MIN_REQUIRED will be set to 1010 and hit
// this code path, but this is probably not what they want if using gcc 4+.
// this code path, but this is probably not what they want if using gcc 4+.
#if (__GNUC__ < 4)
#define APPLE_PRE_10_2
#endif
@ -41,7 +41,7 @@
#if (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_6)
#define APPLE_PRE_10_6
#endif
#endif
#endif
@ -82,7 +82,7 @@
#ifndef sqrtf
inline float sqrtf(float value) { return static_cast<float>(sqrt(value)); }
#endif
#ifndef fabsf
inline float fabsf(float value) { return static_cast<float>(fabs(value)); }
#endif

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -42,16 +42,16 @@ class OSG_EXPORT MatrixTransform : public Transform
/** Set the transform's matrix.*/
void setMatrix(const Matrix& mat) { _matrix = mat; _inverseDirty=true; dirtyBound(); }
/** Get the matrix. */
inline const Matrix& getMatrix() const { return _matrix; }
/** pre multiply the transform's matrix.*/
void preMult(const Matrix& mat) { _matrix.preMult(mat); _inverseDirty=true; dirtyBound(); }
/** post multiply the transform's matrix.*/
void postMult(const Matrix& mat) { _matrix.postMult(mat); _inverseDirty=true; dirtyBound(); }
/** Get the inverse matrix. */
inline const Matrix& getInverseMatrix() const
{
@ -69,9 +69,9 @@ class OSG_EXPORT MatrixTransform : public Transform
protected :
virtual ~MatrixTransform();
Matrix _matrix;
mutable Matrix _inverse;
mutable bool _inverseDirty;

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2004 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2004 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -26,7 +26,7 @@ class Matrixf;
class OSG_EXPORT Matrixd
{
public:
typedef double value_type;
typedef float other_value_type;
@ -65,7 +65,7 @@ class OSG_EXPORT Matrixd
set(rhs.ptr());
return *this;
}
Matrixd& operator = (const Matrixf& other);
inline void set(const Matrixd& rhs) { set(rhs.ptr()); }
@ -77,7 +77,7 @@ class OSG_EXPORT Matrixd
value_type* local_ptr = (value_type*)_mat;
for(int i=0;i<16;++i) local_ptr[i]=(value_type)ptr[i];
}
inline void set(double const * const ptr)
{
value_type* local_ptr = (value_type*)_mat;
@ -88,7 +88,7 @@ class OSG_EXPORT Matrixd
value_type a10, value_type a11, value_type a12,value_type a13,
value_type a20, value_type a21, value_type a22,value_type a23,
value_type a30, value_type a31, value_type a32,value_type a33);
value_type * ptr() { return (value_type*)_mat; }
const value_type * ptr() const { return (const value_type *)_mat; }
@ -101,39 +101,39 @@ class OSG_EXPORT Matrixd
}
void makeIdentity();
void makeScale( const Vec3f& );
void makeScale( const Vec3d& );
void makeScale( value_type, value_type, value_type );
void makeTranslate( const Vec3f& );
void makeTranslate( const Vec3d& );
void makeTranslate( value_type, value_type, value_type );
void makeRotate( const Vec3f& from, const Vec3f& to );
void makeRotate( const Vec3d& from, const Vec3d& to );
void makeRotate( value_type angle, const Vec3f& axis );
void makeRotate( value_type angle, const Vec3d& axis );
void makeRotate( value_type angle, value_type x, value_type y, value_type z );
void makeRotate( const Quat& );
void makeRotate( value_type angle1, const Vec3f& axis1,
void makeRotate( value_type angle1, const Vec3f& axis1,
value_type angle2, const Vec3f& axis2,
value_type angle3, const Vec3f& axis3);
void makeRotate( value_type angle1, const Vec3d& axis1,
void makeRotate( value_type angle1, const Vec3d& axis1,
value_type angle2, const Vec3d& axis2,
value_type angle3, const Vec3d& axis3);
/** decompose the matrix into translation, rotation, scale and scale orientation.*/
/** decompose the matrix into translation, rotation, scale and scale orientation.*/
void decompose( osg::Vec3f& translation,
osg::Quat& rotation,
osg::Vec3f& scale,
osg::Quat& rotation,
osg::Vec3f& scale,
osg::Quat& so ) const;
/** decompose the matrix into translation, rotation, scale and scale orientation.*/
/** decompose the matrix into translation, rotation, scale and scale orientation.*/
void decompose( osg::Vec3d& translation,
osg::Quat& rotation,
osg::Vec3d& scale,
osg::Quat& rotation,
osg::Vec3d& scale,
osg::Quat& so ) const;
@ -242,8 +242,8 @@ class OSG_EXPORT Matrixd
/** full 4x4 matrix invert. */
bool invert_4x4( const Matrixd& rhs);
/** ortho-normalize the 3x3 rotation & scale matrix */
void orthoNormalize(const Matrixd& rhs);
/** ortho-normalize the 3x3 rotation & scale matrix */
void orthoNormalize(const Matrixd& rhs);
// basic utility functions to create new matrices
inline static Matrixd identity( void );
@ -258,15 +258,15 @@ class OSG_EXPORT Matrixd
inline static Matrixd rotate( value_type angle, value_type x, value_type y, value_type z);
inline static Matrixd rotate( value_type angle, const Vec3f& axis);
inline static Matrixd rotate( value_type angle, const Vec3d& axis);
inline static Matrixd rotate( value_type angle1, const Vec3f& axis1,
inline static Matrixd rotate( value_type angle1, const Vec3f& axis1,
value_type angle2, const Vec3f& axis2,
value_type angle3, const Vec3f& axis3);
inline static Matrixd rotate( value_type angle1, const Vec3d& axis1,
inline static Matrixd rotate( value_type angle1, const Vec3d& axis1,
value_type angle2, const Vec3d& axis2,
value_type angle3, const Vec3d& axis3);
inline static Matrixd rotate( const Quat& quat);
inline static Matrixd inverse( const Matrixd& matrix);
inline static Matrixd orthoNormal(const Matrixd& matrix);
inline static Matrixd orthoNormal(const Matrixd& matrix);
/** Create an orthographic projection matrix.
* See glOrtho for further details.
*/
@ -336,16 +336,16 @@ class OSG_EXPORT Matrixd
void setTrans( value_type tx, value_type ty, value_type tz );
void setTrans( const Vec3f& v );
void setTrans( const Vec3d& v );
inline Vec3d getTrans() const { return Vec3d(_mat[3][0],_mat[3][1],_mat[3][2]); }
inline Vec3d getTrans() const { return Vec3d(_mat[3][0],_mat[3][1],_mat[3][2]); }
inline Vec3d getScale() const {
Vec3d x_vec(_mat[0][0],_mat[1][0],_mat[2][0]);
Vec3d y_vec(_mat[0][1],_mat[1][1],_mat[2][1]);
Vec3d z_vec(_mat[0][2],_mat[1][2],_mat[2][2]);
return Vec3d(x_vec.length(), y_vec.length(), z_vec.length());
Vec3d x_vec(_mat[0][0],_mat[1][0],_mat[2][0]);
Vec3d y_vec(_mat[0][1],_mat[1][1],_mat[2][1]);
Vec3d z_vec(_mat[0][2],_mat[1][2],_mat[2][2]);
return Vec3d(x_vec.length(), y_vec.length(), z_vec.length());
}
/** apply a 3x3 transform of v*M[0..2,0..2]. */
inline static Vec3f transform3x3(const Vec3f& v,const Matrixd& m);
@ -382,12 +382,12 @@ class OSG_EXPORT Matrixd
/** Optimized version of postMult(rotate(q)); */
inline void postMultRotate( const Quat& q );
inline void operator *= ( const Matrixd& other )
inline void operator *= ( const Matrixd& other )
{ if( this == &other ) {
Matrixd temp(other);
postMult( temp );
}
else postMult( other );
else postMult( other );
}
inline Matrixd operator * ( const Matrixd &m ) const
@ -405,7 +405,7 @@ class OSG_EXPORT Matrixd
class RefMatrixd : public Object, public Matrixd
{
public:
RefMatrixd():Object(false), Matrixd() {}
RefMatrixd( const Matrixd& other) : Object(false), Matrixd(other) {}
RefMatrixd( const Matrixf& other) : Object(false), Matrixd(other) {}
@ -415,21 +415,21 @@ class RefMatrixd : public Object, public Matrixd
Matrixd::value_type a10, Matrixd::value_type a11, Matrixd::value_type a12, Matrixd::value_type a13,
Matrixd::value_type a20, Matrixd::value_type a21, Matrixd::value_type a22, Matrixd::value_type a23,
Matrixd::value_type a30, Matrixd::value_type a31, Matrixd::value_type a32, Matrixd::value_type a33):
Object(false),
Object(false),
Matrixd(a00, a01, a02, a03,
a10, a11, a12, a13,
a20, a21, a22, a23,
a30, a31, a32, a33) {}
virtual Object* cloneType() const { return new RefMatrixd(); }
virtual Object* cloneType() const { return new RefMatrixd(); }
virtual Object* clone(const CopyOp&) const { return new RefMatrixd(*this); }
virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast<const RefMatrixd*>(obj)!=NULL; }
virtual const char* libraryName() const { return "osg"; }
virtual const char* className() const { return "Matrix"; }
protected:
virtual ~RefMatrixd() {}
};
@ -498,7 +498,7 @@ inline Matrixd Matrixd::rotate(value_type angle, const Vec3d& axis )
m.makeRotate(angle,axis);
return m;
}
inline Matrixd Matrixd::rotate( value_type angle1, const Vec3f& axis1,
inline Matrixd Matrixd::rotate( value_type angle1, const Vec3f& axis1,
value_type angle2, const Vec3f& axis2,
value_type angle3, const Vec3f& axis3)
{
@ -506,7 +506,7 @@ inline Matrixd Matrixd::rotate( value_type angle1, const Vec3f& axis1,
m.makeRotate(angle1,axis1,angle2,axis2,angle3,axis3);
return m;
}
inline Matrixd Matrixd::rotate( value_type angle1, const Vec3d& axis1,
inline Matrixd Matrixd::rotate( value_type angle1, const Vec3d& axis1,
value_type angle2, const Vec3d& axis2,
value_type angle3, const Vec3d& axis3)
{
@ -538,7 +538,7 @@ inline Matrixd Matrixd::orthoNormal(const Matrixd& matrix)
{
Matrixd m;
m.orthoNormalize(matrix);
return m;
return m;
}
inline Matrixd Matrixd::ortho(double left, double right,

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2004 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2004 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -26,7 +26,7 @@ class Matrixf;
class OSG_EXPORT Matrixf
{
public:
typedef float value_type;
typedef double other_value_type;
@ -65,7 +65,7 @@ class OSG_EXPORT Matrixf
set(rhs.ptr());
return *this;
}
Matrixf& operator = (const Matrixd& other);
inline void set(const Matrixf& rhs) { set(rhs.ptr()); }
@ -77,7 +77,7 @@ class OSG_EXPORT Matrixf
value_type* local_ptr = (value_type*)_mat;
for(int i=0;i<16;++i) local_ptr[i]=(value_type)ptr[i];
}
inline void set(double const * const ptr)
{
value_type* local_ptr = (value_type*)_mat;
@ -88,7 +88,7 @@ class OSG_EXPORT Matrixf
value_type a10, value_type a11, value_type a12,value_type a13,
value_type a20, value_type a21, value_type a22,value_type a23,
value_type a30, value_type a31, value_type a32,value_type a33);
value_type * ptr() { return (value_type*)_mat; }
const value_type * ptr() const { return (const value_type *)_mat; }
@ -101,39 +101,39 @@ class OSG_EXPORT Matrixf
}
void makeIdentity();
void makeScale( const Vec3f& );
void makeScale( const Vec3d& );
void makeScale( value_type, value_type, value_type );
void makeTranslate( const Vec3f& );
void makeTranslate( const Vec3d& );
void makeTranslate( value_type, value_type, value_type );
void makeRotate( const Vec3f& from, const Vec3f& to );
void makeRotate( const Vec3d& from, const Vec3d& to );
void makeRotate( value_type angle, const Vec3f& axis );
void makeRotate( value_type angle, const Vec3d& axis );
void makeRotate( value_type angle, value_type x, value_type y, value_type z );
void makeRotate( const Quat& );
void makeRotate( value_type angle1, const Vec3f& axis1,
void makeRotate( value_type angle1, const Vec3f& axis1,
value_type angle2, const Vec3f& axis2,
value_type angle3, const Vec3f& axis3);
void makeRotate( value_type angle1, const Vec3d& axis1,
void makeRotate( value_type angle1, const Vec3d& axis1,
value_type angle2, const Vec3d& axis2,
value_type angle3, const Vec3d& axis3);
/** decompose the matrix into translation, rotation, scale and scale orientation.*/
/** decompose the matrix into translation, rotation, scale and scale orientation.*/
void decompose( osg::Vec3f& translation,
osg::Quat& rotation,
osg::Vec3f& scale,
osg::Quat& rotation,
osg::Vec3f& scale,
osg::Quat& so ) const;
/** decompose the matrix into translation, rotation, scale and scale orientation.*/
/** decompose the matrix into translation, rotation, scale and scale orientation.*/
void decompose( osg::Vec3d& translation,
osg::Quat& rotation,
osg::Vec3d& scale,
osg::Quat& rotation,
osg::Vec3d& scale,
osg::Quat& so ) const;
@ -242,8 +242,8 @@ class OSG_EXPORT Matrixf
/** full 4x4 matrix invert. */
bool invert_4x4( const Matrixf& rhs);
/** ortho-normalize the 3x3 rotation & scale matrix */
void orthoNormalize(const Matrixf& rhs);
/** ortho-normalize the 3x3 rotation & scale matrix */
void orthoNormalize(const Matrixf& rhs);
//basic utility functions to create new matrices
inline static Matrixf identity( void );
@ -258,16 +258,16 @@ class OSG_EXPORT Matrixf
inline static Matrixf rotate( value_type angle, value_type x, value_type y, value_type z);
inline static Matrixf rotate( value_type angle, const Vec3f& axis);
inline static Matrixf rotate( value_type angle, const Vec3d& axis);
inline static Matrixf rotate( value_type angle1, const Vec3f& axis1,
inline static Matrixf rotate( value_type angle1, const Vec3f& axis1,
value_type angle2, const Vec3f& axis2,
value_type angle3, const Vec3f& axis3);
inline static Matrixf rotate( value_type angle1, const Vec3d& axis1,
inline static Matrixf rotate( value_type angle1, const Vec3d& axis1,
value_type angle2, const Vec3d& axis2,
value_type angle3, const Vec3d& axis3);
inline static Matrixf rotate( const Quat& quat);
inline static Matrixf inverse( const Matrixf& matrix);
inline static Matrixf orthoNormal(const Matrixf& matrix);
inline static Matrixf orthoNormal(const Matrixf& matrix);
/** Create an orthographic projection matrix.
* See glOrtho for further details.
*/
@ -338,16 +338,16 @@ class OSG_EXPORT Matrixf
void setTrans( value_type tx, value_type ty, value_type tz );
void setTrans( const Vec3f& v );
void setTrans( const Vec3d& v );
inline Vec3d getTrans() const { return Vec3d(_mat[3][0],_mat[3][1],_mat[3][2]); }
inline Vec3d getTrans() const { return Vec3d(_mat[3][0],_mat[3][1],_mat[3][2]); }
inline Vec3d getScale() const {
Vec3d x_vec(_mat[0][0],_mat[1][0],_mat[2][0]);
Vec3d y_vec(_mat[0][1],_mat[1][1],_mat[2][1]);
Vec3d z_vec(_mat[0][2],_mat[1][2],_mat[2][2]);
return Vec3d(x_vec.length(), y_vec.length(), z_vec.length());
Vec3d x_vec(_mat[0][0],_mat[1][0],_mat[2][0]);
Vec3d y_vec(_mat[0][1],_mat[1][1],_mat[2][1]);
Vec3d z_vec(_mat[0][2],_mat[1][2],_mat[2][2]);
return Vec3d(x_vec.length(), y_vec.length(), z_vec.length());
}
/** apply a 3x3 transform of v*M[0..2,0..2]. */
inline static Vec3f transform3x3(const Vec3f& v,const Matrixf& m);
@ -384,12 +384,12 @@ class OSG_EXPORT Matrixf
/** Optimized version of postMult(rotate(q)); */
inline void postMultRotate( const Quat& q );
inline void operator *= ( const Matrixf& other )
inline void operator *= ( const Matrixf& other )
{ if( this == &other ) {
Matrixf temp(other);
postMult( temp );
}
else postMult( other );
else postMult( other );
}
inline Matrixf operator * ( const Matrixf &m ) const
@ -429,7 +429,7 @@ class OSG_EXPORT Matrixf
_mat[3][2]*=rhs;
_mat[3][3]*=rhs;
return *this;
}
}
/** Divide by scalar. */
inline Matrixf operator / (value_type rhs) const
@ -461,7 +461,7 @@ class OSG_EXPORT Matrixf
_mat[3][2]/=rhs;
_mat[3][3]/=rhs;
return *this;
}
}
/** Binary vector add. */
inline Matrixf operator + (const Matrixf& rhs) const
@ -482,7 +482,7 @@ class OSG_EXPORT Matrixf
_mat[3][0] + rhs._mat[3][0],
_mat[3][1] + rhs._mat[3][1],
_mat[3][2] + rhs._mat[3][2],
_mat[3][3] + rhs._mat[3][3]);
_mat[3][3] + rhs._mat[3][3]);
}
/** Unary vector add. Slightly more efficient because no temporary
@ -507,7 +507,7 @@ class OSG_EXPORT Matrixf
_mat[3][2] += rhs._mat[3][2];
_mat[3][3] += rhs._mat[3][3];
return *this;
}
}
protected:
value_type _mat[4][4];
@ -517,7 +517,7 @@ class OSG_EXPORT Matrixf
class RefMatrixf : public Object, public Matrixf
{
public:
RefMatrixf():Object(false), Matrixf() {}
RefMatrixf( const Matrixf& other) : Object(false), Matrixf(other) {}
RefMatrixf( const Matrixd& other) : Object(false), Matrixf(other) {}
@ -527,21 +527,21 @@ class RefMatrixf : public Object, public Matrixf
Matrixf::value_type a10, Matrixf::value_type a11, Matrixf::value_type a12, Matrixf::value_type a13,
Matrixf::value_type a20, Matrixf::value_type a21, Matrixf::value_type a22, Matrixf::value_type a23,
Matrixf::value_type a30, Matrixf::value_type a31, Matrixf::value_type a32, Matrixf::value_type a33):
Object(false),
Object(false),
Matrixf(a00, a01, a02, a03,
a10, a11, a12, a13,
a20, a21, a22, a23,
a30, a31, a32, a33) {}
virtual Object* cloneType() const { return new RefMatrixf(); }
virtual Object* cloneType() const { return new RefMatrixf(); }
virtual Object* clone(const CopyOp&) const { return new RefMatrixf(*this); }
virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast<const RefMatrixf*>(obj)!=NULL; }
virtual const char* libraryName() const { return "osg"; }
virtual const char* className() const { return "Matrix"; }
protected:
virtual ~RefMatrixf() {}
};
@ -610,7 +610,7 @@ inline Matrixf Matrixf::rotate(value_type angle, const Vec3d& axis )
m.makeRotate(angle,axis);
return m;
}
inline Matrixf Matrixf::rotate( value_type angle1, const Vec3f& axis1,
inline Matrixf Matrixf::rotate( value_type angle1, const Vec3f& axis1,
value_type angle2, const Vec3f& axis2,
value_type angle3, const Vec3f& axis3)
{
@ -618,7 +618,7 @@ inline Matrixf Matrixf::rotate( value_type angle1, const Vec3f& axis1,
m.makeRotate(angle1,axis1,angle2,axis2,angle3,axis3);
return m;
}
inline Matrixf Matrixf::rotate( value_type angle1, const Vec3d& axis1,
inline Matrixf Matrixf::rotate( value_type angle1, const Vec3d& axis1,
value_type angle2, const Vec3d& axis2,
value_type angle3, const Vec3d& axis3)
{
@ -650,7 +650,7 @@ inline Matrixf Matrixf::orthoNormal(const Matrixf& matrix)
{
Matrixf m;
m.orthoNormalize(matrix);
return m;
return m;
}
inline Matrixf Matrixf::ortho(double left, double right,

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -84,7 +84,7 @@ public:
void clear() { _impl.clear(); }
void resize(size_type new_size, const value_type& fill_value = value_type()) { _impl.resize(new_size, fill_value); }
void reserve(size_type new_capacity) { _impl.reserve(new_capacity); }
void swap(vector_type& other) { _impl.swap(other); }
void swap(MixinVector& other) { _impl.swap(other._impl); }

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -45,13 +45,13 @@ class OSG_EXPORT Multisample : public StateAttribute
enum Mode
{
FASTEST = GL_FASTEST,
FASTEST = GL_FASTEST,
NICEST = GL_NICEST,
DONT_CARE = GL_DONT_CARE
DONT_CARE = GL_DONT_CARE
};
Multisample();
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
Multisample(const Multisample& trans,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
StateAttribute(trans,copyop),
@ -60,7 +60,7 @@ class OSG_EXPORT Multisample : public StateAttribute
_mode(trans._mode) {}
META_StateAttribute(osg, Multisample,MULTISAMPLE);
/** return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.*/
virtual int compare(const StateAttribute& sa) const
{
@ -76,14 +76,14 @@ class OSG_EXPORT Multisample : public StateAttribute
return 0; // passed all the above comparison macros, must be equal.
}
void setSampleCoverage(float coverage, bool invert)
void setSampleCoverage(float coverage, bool invert)
{
_coverage = coverage;
_coverage = coverage;
_invert = invert;
}
inline void setCoverage(float coverage) { _coverage=coverage; }
inline float getCoverage() const { return _coverage; }
inline void setInvert(bool invert) { _invert=invert; }
inline bool getInvert() const { return _invert; }
@ -94,42 +94,42 @@ class OSG_EXPORT Multisample : public StateAttribute
/** Extensions class which encapsulates the querying of extensions and
* associated function pointers, and provide convenience wrappers to
* check for the extensions or use the associated functions.*/
* associated function pointers, and provide convenience wrappers to
* check for the extensions or use the associated functions.*/
class OSG_EXPORT Extensions : public osg::Referenced
{
public:
Extensions(unsigned int contextID);
Extensions(const Extensions& rhs);
void lowestCommonDenominator(const Extensions& rhs);
void setupGLExtensions(unsigned int contextID);
void setMultisampleSupported(bool flag) { _isMultisampleSupported=flag; }
void setMultisampleFilterHintSupported(bool flag) { _isMultisampleFilterHintSupported=flag; }
bool isMultisampleSupported() const { return _isMultisampleSupported; }
bool isMultisampleFilterHintSupported() const { return _isMultisampleFilterHintSupported; }
void glSampleCoverage(GLclampf value, GLboolean invert) const;
protected:
~Extensions() {}
bool _isMultisampleSupported;
bool _isMultisampleFilterHintSupported;
typedef void (GL_APIENTRY * GLSampleCoverageProc) (GLclampf value, GLboolean invert);
GLSampleCoverageProc _glSampleCoverage;
};
/** Function to call to get the extension of a specified context.
* If the Extension object for that context has not yet been created
* If the Extension object for that context has not yet been created
* and the 'createIfNotInitalized' flag been set to false then returns NULL.
* If 'createIfNotInitalized' is true then the Extensions object is
* If 'createIfNotInitalized' is true then the Extensions object is
* automatically created. However, in this case the extension object will
* only be created with the graphics context associated with ContextID..*/
static Extensions* getExtensions(unsigned int contextID,bool createIfNotInitalized);

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -59,7 +59,7 @@ typedef std::vector< Matrix > MatrixList;
virtual const char* className() const { return #name; } \
virtual const char* libraryName() const { return #library; } \
virtual void accept(osg::NodeVisitor& nv) { if (nv.validNodeMask(*this)) { nv.pushOntoNodePath(this); nv.apply(*this); nv.popFromNodePath(); } } \
/** Base class for all internal nodes in the scene graph.
Provides interface for most common node operations (Composite Pattern).
@ -69,7 +69,7 @@ class OSG_EXPORT Node : public Object
public:
/** Construct a node.
Initialize the parent list to empty, node name to "" and
Initialize the parent list to empty, node name to "" and
bounding sphere dirty flag to true.*/
Node();
@ -145,7 +145,7 @@ class OSG_EXPORT Node : public Object
/** Traverse upwards : calls parents' accept method with NodeVisitor.*/
virtual void ascend(NodeVisitor& nv);
/** Traverse downwards : calls children's accept method with NodeVisitor.*/
virtual void traverse(NodeVisitor& /*nv*/) {}
virtual void traverse(NodeVisitor& /*nv*/) {}
/** A vector of osg::Group pointers which is used to store the parent(s) of node.*/
typedef std::vector<Group*> ParentList;
@ -153,7 +153,7 @@ class OSG_EXPORT Node : public Object
/** Get the parent list of node. */
inline const ParentList& getParents() const { return _parents; }
/** Get the a copy of parent list of node. A copy is returned to
/** Get the a copy of parent list of node. A copy is returned to
* prevent modification of the parent list.*/
inline ParentList getParents() { return _parents; }
@ -179,7 +179,7 @@ class OSG_EXPORT Node : public Object
/** Get the list of matrices that transform this node from local coordinates to world coordinates.
* The optional Node* haltTraversalAtNode allows the user to prevent traversal beyond a specifed node. */
MatrixList getWorldMatrices(const osg::Node* haltTraversalAtNode=0) const;
/** Set update node callback, called during update traversal. */
void setUpdateCallback(NodeCallback* nc);
@ -285,7 +285,7 @@ class OSG_EXPORT Node : public Object
/** Get the number of Children of this node which are or have OccluderNode's.*/
inline unsigned int getNumChildrenWithOccluderNodes() const { return _numChildrenWithOccluderNodes; }
/** return true if this node is an OccluderNode or the subgraph below this node are OccluderNodes.*/
bool containsOccluderNodes() const;
@ -353,7 +353,7 @@ class OSG_EXPORT Node : public Object
/** Add a description string to the node.*/
void addDescription(const std::string& desc);
/** Set the initial bounding volume to use when computing the overall bounding volume.*/
void setInitialBound(const osg::BoundingSphere& bsphere) { _initialBound = bsphere; dirtyBound(); }
@ -372,11 +372,11 @@ class OSG_EXPORT Node : public Object
if(!_boundingSphereComputed)
{
_boundingSphere = _initialBound;
if (_computeBoundCallback.valid())
if (_computeBoundCallback.valid())
_boundingSphere.expandBy(_computeBoundCallback->computeBound(*this));
else
_boundingSphere.expandBy(computeBound());
_boundingSphereComputed = true;
}
return _boundingSphere;
@ -458,10 +458,10 @@ class OSG_EXPORT Node : public Object
ref_ptr<NodeCallback> _cullCallback;
bool _cullingActive;
unsigned int _numChildrenWithCullingDisabled;
unsigned int _numChildrenWithCullingDisabled;
void setNumChildrenWithCullingDisabled(unsigned int num);
unsigned int _numChildrenWithOccluderNodes;
unsigned int _numChildrenWithOccluderNodes;
void setNumChildrenWithOccluderNodes(unsigned int num);
NodeMask _nodeMask;

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -25,33 +25,33 @@ class NodeVisitor;
class OSG_EXPORT NodeCallback : public virtual Object {
public :
NodeCallback(){}
NodeCallback(const NodeCallback& nc,const CopyOp&):
_nestedCallback(nc._nestedCallback) {}
META_Object(osg,NodeCallback);
/** Callback method called by the NodeVisitor when visiting a node.*/
virtual void operator()(Node* node, NodeVisitor* nv)
{
{
// note, callback is responsible for scenegraph traversal so
// they must call traverse(node,nv) to ensure that the
// scene graph subtree (and associated callbacks) are traversed.
traverse(node,nv);
}
/** Call any nested callbacks and then traverse the scene graph. */
void traverse(Node* node,NodeVisitor* nv);
void setNestedCallback(NodeCallback* nc) { _nestedCallback = nc; }
NodeCallback* getNestedCallback() { return _nestedCallback.get(); }
const NodeCallback* getNestedCallback() const { return _nestedCallback.get(); }
inline void addNestedCallback(NodeCallback* nc)
{
if (nc)
@ -67,7 +67,7 @@ class OSG_EXPORT NodeCallback : public virtual Object {
}
}
}
inline void removeNestedCallback(NodeCallback* nc)
{
if (nc)
@ -82,13 +82,13 @@ class OSG_EXPORT NodeCallback : public virtual Object {
}
}
}
public:
ref_ptr<NodeCallback> _nestedCallback;
protected:
virtual ~NodeCallback() {}
};

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -49,7 +49,7 @@ const unsigned int UNINITIALIZED_FRAME_NUMBER=0xffffffff;
virtual const char* className() const { return #name; }
/** Visitor for type safe operations on osg::Nodes.
Based on GOF's Visitor pattern. The NodeVisitor
Based on GOF's Visitor pattern. The NodeVisitor
is useful for developing type safe operations to nodes
in the scene graph (as per Visitor pattern), and adds to this
support for optional scene graph traversal to allow
@ -61,7 +61,7 @@ const unsigned int UNINITIALIZED_FRAME_NUMBER=0xffffffff;
apply directly. So use root->accept(myVisitor); instead of
myVisitor.apply(*root). The later method will bypass the double
dispatch and the appropriate NodeVisitor::apply(..) method will
not be called. */
not be called. */
class OSG_EXPORT NodeVisitor : public virtual Referenced
{
public:
@ -73,7 +73,7 @@ class OSG_EXPORT NodeVisitor : public virtual Referenced
TRAVERSE_ALL_CHILDREN,
TRAVERSE_ACTIVE_CHILDREN
};
enum VisitorType
{
NODE_VISITOR = 0,
@ -84,11 +84,11 @@ class OSG_EXPORT NodeVisitor : public virtual Referenced
};
NodeVisitor(TraversalMode tm=TRAVERSE_NONE);
NodeVisitor(VisitorType type,TraversalMode tm=TRAVERSE_NONE);
virtual ~NodeVisitor();
/** return the library name/namespapce of the visitor's. Should be defined by derived classes.*/
virtual const char* libraryName() const { return "osg"; }
@ -96,7 +96,7 @@ class OSG_EXPORT NodeVisitor : public virtual Referenced
virtual const char* className() const { return "NodeVisitor"; }
/** Method to call to reset visitor. Useful if your visitor accumulates
state during a traversal, and you plan to reuse the visitor.
state during a traversal, and you plan to reuse the visitor.
To flush that state for the next traversal: call reset() prior
to each traversal.*/
virtual void reset() {}
@ -106,19 +106,19 @@ class OSG_EXPORT NodeVisitor : public virtual Referenced
* traversal of the scene, typically used in the Node::traverse() method
* to select which behaviour to use for different types of traversal/visitors.*/
inline void setVisitorType(VisitorType type) { _visitorType = type; }
/** Get the VisitorType.*/
inline VisitorType getVisitorType() const { return _visitorType; }
/** Set the traversal number. Typically used to denote the frame count.*/
inline void setTraversalNumber(unsigned int fn) { _traversalNumber = fn; }
/** Get the traversal number. Typically used to denote the frame count.*/
inline unsigned int getTraversalNumber() const { return _traversalNumber; }
/** Set the FrameStamp that this traversal is associated with.*/
inline void setFrameStamp(FrameStamp* fs) { _frameStamp = fs; }
/** Get the FrameStamp that this traversal is associated with.*/
inline const FrameStamp* getFrameStamp() const { return _frameStamp.get(); }
@ -138,7 +138,7 @@ class OSG_EXPORT NodeVisitor : public virtual Referenced
inline Node::NodeMask getTraversalMask() const { return _traversalMask; }
/** Set the NodeMaskOverride mask.
* Used in validNodeMask() to determine whether to operate on a node or its
* Used in validNodeMask() to determine whether to operate on a node or its
* subgraph, by OR'ing NodeVisitor::_nodeMaskOverride with the Node's own Node::_nodeMask.
* Typically used to force on nodes which may have
* been switched off by their own Node::_nodeMask.*/
@ -146,7 +146,7 @@ class OSG_EXPORT NodeVisitor : public virtual Referenced
/** Get the NodeMaskOverride mask.*/
inline Node::NodeMask getNodeMaskOverride() const { return _nodeMaskOverride; }
/** Method to called by Node and its subclass' Node::accept() method, if the result is true
* it is used to cull operations of nodes and their subgraphs.
* Return true if the result of a bit wise and of the NodeVisitor::_traversalMask
@ -158,33 +158,33 @@ class OSG_EXPORT NodeVisitor : public virtual Referenced
return (getTraversalMask() & (getNodeMaskOverride() | node.getNodeMask()))!=0;
}
/** Set the traversal mode for Node::traverse() to use when
/** Set the traversal mode for Node::traverse() to use when
deciding which children of a node to traverse. If a
NodeVisitor has been attached via setTraverseVisitor()
and the new mode is not TRAVERSE_VISITOR then the attached
visitor is detached. Default mode is TRAVERSE_NONE.*/
inline void setTraversalMode(TraversalMode mode) { _traversalMode = mode; }
/** Get the traversal mode.*/
inline TraversalMode getTraversalMode() const { return _traversalMode; }
/**
* Set user data, data must be subclassed from Referenced to allow
* automatic memory handling. If your own data isn't directly
* automatic memory handling. If your own data isn't directly
* subclassed from Referenced then create an adapter object
* which points to your own objects and handles the memory addressing.
*/
inline void setUserData(Referenced* obj) { _userData = obj; }
/** Get user data.*/
inline Referenced* getUserData() { return _userData.get(); }
/** Get const user data.*/
inline const Referenced* getUserData() const { return _userData.get(); }
/** Method for handling traversal of a nodes.
If you intend to use the visitor for actively traversing
If you intend to use the visitor for actively traversing
the scene graph then make sure the accept() methods call
this method unless they handle traversal directly.*/
inline void traverse(Node& node)
@ -192,22 +192,22 @@ class OSG_EXPORT NodeVisitor : public virtual Referenced
if (_traversalMode==TRAVERSE_PARENTS) node.ascend(*this);
else if (_traversalMode!=TRAVERSE_NONE) node.traverse(*this);
}
/** Method called by osg::Node::accept() method before
* a call to the NodeVisitor::apply(..). The back of the list will,
* therefore, be the current node being visited inside the apply(..),
* and the rest of the list will be the parental sequence of nodes
* and the rest of the list will be the parental sequence of nodes
* from the top most node applied down the graph to the current node.
* Note, the user does not typically call pushNodeOnPath() as it
* will be called automatically by the Node::accept() method.*/
inline void pushOntoNodePath(Node* node) { if (_traversalMode!=TRAVERSE_PARENTS) _nodePath.push_back(node); else _nodePath.insert(_nodePath.begin(),node); }
/** Method called by osg::Node::accept() method after
* a call to NodeVisitor::apply(..).
* Note, the user does not typically call popFromNodePath() as it
* will be called automatically by the Node::accept() method.*/
inline void popFromNodePath() { if (_traversalMode!=TRAVERSE_PARENTS) _nodePath.pop_back(); else _nodePath.erase(_nodePath.begin()); }
/** Get the non const NodePath from the top most node applied down
* to the current Node being visited.*/
NodePath& getNodePath() { return _nodePath; }
@ -215,7 +215,7 @@ class OSG_EXPORT NodeVisitor : public virtual Referenced
/** Get the const NodePath from the top most node applied down
* to the current Node being visited.*/
const NodePath& getNodePath() const { return _nodePath; }
/** Get the eye point in local coordinates.
* Note, not all NodeVisitor implement this method, it is mainly cull visitors which will implement.*/
virtual osg::Vec3 getEyePoint() const { return Vec3(0.0f,0.0f,0.0f); }
@ -238,13 +238,13 @@ class OSG_EXPORT NodeVisitor : public virtual Referenced
* Note, not all NodeVisitor implement this method, it is mainly cull visitors which will implement.
* If the getDistanceToViewPoint(pos) is not implemented then a default value of 0.0 is returned.*/
virtual float getDistanceToViewPoint(const Vec3& /*pos*/, bool /*useLODScale*/) const { return 0.0f; }
virtual void apply(Node& node);
virtual void apply(Geode& node);
virtual void apply(Billboard& node);
virtual void apply(Group& node);
virtual void apply(ProxyNode& node);
@ -300,23 +300,23 @@ class OSG_EXPORT NodeVisitor : public virtual Referenced
class ImageRequestHandler : public osg::Referenced
{
public:
ImageRequestHandler():
Referenced(true) {}
virtual double getPreLoadTime() const = 0;
virtual osg::Image* readImageFile(const std::string& fileName) = 0;
virtual void requestImageFile(const std::string& fileName,osg::Object* attachmentPoint, int attachmentIndex, double timeToMergeBy, const FrameStamp* framestamp) = 0;
protected:
virtual ~ImageRequestHandler() {}
};
/** Set the handler for image requests.*/
void setImageRequestHandler(ImageRequestHandler* handler) { _imageRequestHandler = handler; }
/** Get the handler for image requests.*/
ImageRequestHandler* getImageRequestHandler() { return _imageRequestHandler.get(); }
@ -329,13 +329,13 @@ class OSG_EXPORT NodeVisitor : public virtual Referenced
VisitorType _visitorType;
unsigned int _traversalNumber;
ref_ptr<FrameStamp> _frameStamp;
TraversalMode _traversalMode;
Node::NodeMask _traversalMask;
Node::NodeMask _nodeMaskOverride;
NodePath _nodePath;
ref_ptr<Referenced> _userData;
@ -346,7 +346,7 @@ class OSG_EXPORT NodeVisitor : public virtual Referenced
};
/** Convenience functor for assisting visiting of arrays of osg::Node's.*/
/** Convenience functor for assisting visiting of arrays of osg::Node's.*/
class NodeAcceptOp
{
public:

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -57,7 +57,7 @@ extern OSG_EXPORT bool initNotifyLevel();
/** notify messaging function for providing fatal through to verbose
* debugging messages. Level of messages sent to the console can
* be controlled by setting the NotifyLevel either within your
* be controlled by setting the NotifyLevel either within your
* application or via the an environmental variable i.e.
* - setenv OSGNOTIFYLEVEL DEBUG (for tsh)
* - export OSGNOTIFYLEVEL=DEBUG (for bourne shell)
@ -66,10 +66,10 @@ extern OSG_EXPORT bool initNotifyLevel();
* All tell the osg to redirect all debugging and more important messages
* to the notification stream (useful for debugging) setting ALWAYS will force
* all messages to be absorbed, which might be appropriate for final
* applications. Default NotifyLevel is NOTICE. Check the enum
* applications. Default NotifyLevel is NOTICE. Check the enum
* #NotifySeverity for full range of possibilities. To use the notify
* with your code simply use the notify function as a normal file
* stream (like std::cout) i.e
* stream (like std::cout) i.e
* @code
* osg::notify(osg::DEBUG) << "Hello Bugs!" << std::endl;
* @endcode
@ -88,15 +88,15 @@ inline std::ostream& notify(void) { return notify(osg::INFO); }
#define OSG_DEBUG OSG_NOTIFY(osg::DEBUG_INFO)
#define OSG_DEBUG_FP OSG_NOTIFY(osg::DEBUG_FP)
/** Handler processing output of notification stream. It acts as a sink to
* notification messages. It is called when notification stream needs to be
/** Handler processing output of notification stream. It acts as a sink to
* notification messages. It is called when notification stream needs to be
* synchronized (i.e. after osg::notify() << std::endl).
* StandardNotifyHandler is used by default, it writes notifications to stderr
* StandardNotifyHandler is used by default, it writes notifications to stderr
* (severity <= WARN) or stdout (severity > WARN).
* Notifications can be redirected to other sinks such as GUI widgets or
* Notifications can be redirected to other sinks such as GUI widgets or
* windows debugger (WinDebugNotifyHandler) with custom handlers.
* Use setNotifyHandler to set custom handler.
* Note that osg notification API is not thread safe although notification
* Note that osg notification API is not thread safe although notification
* handler is called from many threads. When incorporating handlers into GUI
* widgets you must take care of thread safety on your own.
* @see setNotifyHandler
@ -128,7 +128,7 @@ public:
#if defined(WIN32) && !defined(__CYGWIN__)
/** Redirects notification stream to windows debugger with use of
/** Redirects notification stream to windows debugger with use of
* OuputDebugString functions.
* @see setNotifyHandler
*/

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -32,8 +32,8 @@ class UserDataContainer;
#define ADDQUOTES(def) _ADDQUOTES(def)
/** META_Object macro define the standard clone, isSameKindAs and className methods.
* Use when subclassing from Object to make it more convenient to define
* the standard pure virtual clone, isSameKindAs and className methods
* Use when subclassing from Object to make it more convenient to define
* the standard pure virtual clone, isSameKindAs and className methods
* which are required for all Object subclasses.*/
#define META_Object(library,name) \
virtual osg::Object* cloneType() const { return new name (); } \
@ -42,7 +42,7 @@ class UserDataContainer;
virtual const char* libraryName() const { return #library; }\
virtual const char* className() const { return #name; }
/** Base class/standard interface for objects which require IO support,
/** Base class/standard interface for objects which require IO support,
cloning and reference counting.
Based on GOF Composite, Prototype and Template Method patterns.
*/
@ -106,7 +106,7 @@ class OSG_EXPORT Object : public Referenced
STATIC,
UNSPECIFIED
};
/** Set the data variance of this object.
* Can be set to either STATIC for values that do not change over the lifetime of the object,
* or DYNAMIC for values that vary over the lifetime of the object. The DataVariance value
@ -116,7 +116,7 @@ class OSG_EXPORT Object : public Referenced
/** Get the data variance of this object.*/
inline DataVariance getDataVariance() const { return _dataVariance; }
/** Compute the DataVariance based on an assessment of callback etc.*/
virtual void computeDataVariance() {}
@ -137,7 +137,7 @@ class OSG_EXPORT Object : public Referenced
/**
* Set user data, data must be subclassed from Referenced to allow
* automatic memory handling. If your own data isn't directly
* automatic memory handling. If your own data isn't directly
* subclassed from Referenced then create an adapter object
* which points to your own object and handles the memory addressing.
*/
@ -148,7 +148,7 @@ class OSG_EXPORT Object : public Referenced
/** Get const user data.*/
virtual const Referenced* getUserData() const;
/** Convinience method that casts the named UserObject to osg::TemplateValueObject<T> and gets the value.
@ -162,7 +162,7 @@ class OSG_EXPORT Object : public Referenced
template<typename T>
void setUserValue(const std::string& name, const T& value);
/** Resize any per context GLObject buffers to specified size. */
virtual void resizeGLObjectBuffers(unsigned int /*maxSize*/) {}
@ -182,7 +182,7 @@ class OSG_EXPORT Object : public Referenced
forcing all nodes to be created on the heap i.e Node* node
= new Node().*/
virtual ~Object();
std::string _name;
DataVariance _dataVariance;
@ -261,7 +261,7 @@ T* cloneType(const T* t)
return 0;
}
}
}
#endif

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -26,31 +26,31 @@ namespace osg {
class OSG_EXPORT OccluderNode : public Group
{
public :
OccluderNode();
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
OccluderNode(const OccluderNode&,const CopyOp& copyop=CopyOp::SHALLOW_COPY);
META_Node(osg, OccluderNode);
/** Attach a ConvexPlanarOccluder to an OccluderNode.*/
/** Attach a ConvexPlanarOccluder to an OccluderNode.*/
void setOccluder(ConvexPlanarOccluder* occluder) { _occluder = occluder; }
/** Get the ConvexPlanarOccluder* attached to a OccluderNode. */
ConvexPlanarOccluder* getOccluder() { return _occluder.get(); }
/** Get the const ConvexPlanarOccluder* attached to a OccluderNode.*/
/** Get the const ConvexPlanarOccluder* attached to a OccluderNode.*/
const ConvexPlanarOccluder* getOccluder() const { return _occluder.get(); }
/** Overrides Group's computeBound.*/
virtual BoundingSphere computeBound() const;
protected :
virtual ~OccluderNode() {}
ref_ptr<ConvexPlanarOccluder> _occluder;
};

View File

@ -1,14 +1,14 @@
//
// Copyright (C) 2007 Skew Matrix Software LLC (http://www.skew-matrix.com)
//
// This library is open source and may be redistributed and/or modified under
// the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
// This library is open source and may be redistributed and/or modified under
// the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
// (at your option) any later version. The full license is in LICENSE file
// included with this distribution, and on the openscenegraph.org website.
//
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// OpenSceneGraph Public License for more details.
//
@ -75,11 +75,11 @@ public:
unsigned int getNumPixels( const osg::Camera* cam );
virtual void releaseGLObjects( osg::State* state = 0 ) const;
static void deleteQueryObject( unsigned int contextID, GLuint handle );
static void flushDeletedQueryObjects( unsigned int contextID, double currentTime, double& availableTime );
static void discardDeletedQueryObjects( unsigned int contextID );
protected:
typedef std::map< const osg::Camera*, TestResult > ResultMap;
mutable ResultMap _results;
@ -107,8 +107,8 @@ public:
virtual osg::BoundingSphere computeBound() const;
virtual void releaseGLObjects( osg::State* state = 0 ) const;
// When disabled, OQN doesn't perform occlusion queries, and simply
// renders its children.
void setQueriesEnabled( bool enable=true );
@ -153,8 +153,8 @@ public:
// For statistics gathering, e.g., by a NodeVisitor.
bool getPassed() const;
// These methods are public so that osgUtil::CullVisitor can access them.
// Not intended for application use.
virtual bool getPassed( const osg::Camera* camera, osg::NodeVisitor& nv );

View File

@ -63,20 +63,20 @@ class Operation : virtual public Referenced
/** Get the human readable name of the operation.*/
const std::string& getName() const { return _name; }
/** Set whether the operation should be kept once its been applied.*/
/** Set whether the operation should be kept once its been applied.*/
void setKeep(bool keep) { _keep = keep; }
/** Get whether the operation should be kept once its been applied.*/
/** Get whether the operation should be kept once its been applied.*/
bool getKeep() const { return _keep; }
/** if this operation is a barrier then release it.*/
virtual void release() {}
/** Do the actual task of this operation.*/
/** Do the actual task of this operation.*/
virtual void operator () (Object*) = 0;
protected:
Operation():
Referenced(true),
_keep(false) {}
@ -97,23 +97,23 @@ class OperationThread;
class OSG_EXPORT OperationQueue : public Referenced
{
public:
OperationQueue();
/** Get the next operation from the operation queue.
* Return null ref_ptr<> if no operations are left in queue. */
/** Get the next operation from the operation queue.
* Return null ref_ptr<> if no operations are left in queue. */
osg::ref_ptr<Operation> getNextOperation(bool blockIfEmpty = false);
/** Return true if the operation queue is empty. */
bool empty();
/** Return the num of pending operations that are sitting in the OperationQueue.*/
unsigned int getNumOperationsInQueue();
/** Add operation to end of OperationQueue, this will be
/** Add operation to end of OperationQueue, this will be
* executed by the operation thread once this operation gets to the head of the queue.*/
void add(Operation* operation);
/** Remove operation from OperationQueue.*/
void remove(Operation* operation);
@ -122,18 +122,18 @@ class OSG_EXPORT OperationQueue : public Referenced
/** Remove all operations from OperationQueue.*/
void removeAllOperations();
/** Run the operations. */
void runOperations(Object* callingObject=0);
/** Call release on all operations. */
void releaseAllOperations();
void releaseAllOperations();
/** Release operations block that is used to block threads that are waiting on an empty operations queue.*/
void releaseOperationsBlock();
typedef std::set<OperationThread*> OperationThreads;
/** Get the set of OperationThreads that are sharing this OperationQueue. */
const OperationThreads& getOperationThreads() const { return _operationThreads; }
@ -142,10 +142,10 @@ class OSG_EXPORT OperationQueue : public Referenced
virtual ~OperationQueue();
friend class OperationThread;
void addOperationThread(OperationThread* thread);
void removeOperationThread(OperationThread* thread);
typedef std::list< osg::ref_ptr<Operation> > Operations;
OpenThreads::Mutex _operationsMutex;
@ -165,7 +165,7 @@ class OSG_EXPORT OperationThread : public Referenced, public OpenThreads::Thread
void setParent(Object* parent) { _parent = parent; }
Object* getParent() { return _parent.get(); }
const Object* getParent() const { return _parent.get(); }
@ -178,11 +178,11 @@ class OSG_EXPORT OperationThread : public Referenced, public OpenThreads::Thread
/** Get the const OperationQueue. */
const OperationQueue* getOperationQueue() const { return _operationQueue.get(); }
/** Add operation to end of OperationQueue, this will be
/** Add operation to end of OperationQueue, this will be
* executed by the graphics thread once this operation gets to the head of the queue.*/
void add(Operation* operation);
/** Remove operation from OperationQueue.*/
void remove(Operation* operation);
@ -192,24 +192,24 @@ class OSG_EXPORT OperationThread : public Referenced, public OpenThreads::Thread
/** Remove all operations from OperationQueue.*/
void removeAllOperations();
/** Get the operation currently being run.*/
osg::ref_ptr<Operation> getCurrentOperation() { return _currentOperation; }
/** Run does the opertion thread run loop.*/
virtual void run();
void setDone(bool done);
bool getDone() const { return _done; }
/** Cancel this graphics thread.*/
/** Cancel this graphics thread.*/
virtual int cancel();
protected:
virtual ~OperationThread();
observer_ptr<Object> _parent;
bool _done;

View File

@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@ -23,18 +23,18 @@ namespace osg {
class OSG_EXPORT PagedLOD : public LOD
{
public :
PagedLOD();
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
PagedLOD(const PagedLOD&,const CopyOp& copyop=CopyOp::SHALLOW_COPY);
META_Node(osg, PagedLOD);
virtual void traverse(NodeVisitor& nv);
virtual bool addChild(Node *child);
virtual bool addChild(Node *child, float min, float max);
@ -60,7 +60,7 @@ class OSG_EXPORT PagedLOD : public LOD
/** Get the database path used to prepend to children's filenames.*/
inline const std::string& getDatabasePath() const { return _databasePath; }
struct OSG_EXPORT PerRangeData
{
PerRangeData();
@ -79,7 +79,7 @@ class OSG_EXPORT PagedLOD : public LOD
};
typedef std::vector<PerRangeData> PerRangeDataList;
void setFileName(unsigned int childNo, const std::string& filename) { expandPerRangeDataTo(childNo); _perRangeDataList[childNo]._filename=filename; }
const std::string& getFileName(unsigned int childNo) const { return _perRangeDataList[childNo]._filename; }
unsigned int getNumFileNames() const { return _perRangeDataList.size(); }
@ -113,18 +113,18 @@ class OSG_EXPORT PagedLOD : public LOD
unsigned int getNumFrameNumbers() const { return _perRangeDataList.size(); }
/** Return the DatabaseRequest object used by the DatabasePager to keep track of file load requests
/** Return the DatabaseRequest object used by the DatabasePager to keep track of file load requests
* being carried on behalf of the DatabasePager.
* Note, in normal OSG usage you should not set this value yourself, as this will be managed by
* Note, in normal OSG usage you should not set this value yourself, as this will be managed by
* the osgDB::DatabasePager.*/
osg::ref_ptr<osg::Referenced>& getDatabaseRequest(unsigned int childNo) { return _perRangeDataList[childNo]._databaseRequest; }
/** Return the const DatabaseRequest object.*/
/** Return the const DatabaseRequest object.*/
const osg::ref_ptr<osg::Referenced>& getDatabaseRequest(unsigned int childNo) const { return _perRangeDataList[childNo]._databaseRequest; }
/** Set the frame number of the last time that this PageLOD node was traversed.
* Note, this frame number is automatically set by the traverse() method for all traversals (update, cull etc.).
* Note, this frame number is automatically set by the traverse() method for all traversals (update, cull etc.).
*/
inline void setFrameNumberOfLastTraversal(unsigned int frameNumber) { _frameNumberOfLastTraversal=frameNumber; }
@ -150,11 +150,11 @@ class OSG_EXPORT PagedLOD : public LOD
* this allows the children to be deleted later at the caller's discretion.
* Return true if children are removed, false otherwise. */
virtual bool removeExpiredChildren(double expiryTime, unsigned int expiryFrame, NodeList& removedChildren);
protected :
virtual ~PagedLOD();
void expandPerRangeDataTo(unsigned int pos);
ref_ptr<Referenced> _databaseOptions;

Some files were not shown because too many files have changed in this diff Show More