diff --git a/INSTALL b/INSTALL new file mode 100644 index 000000000..763b1592d --- /dev/null +++ b/INSTALL @@ -0,0 +1,238 @@ +The following is a very basic intro of how to get the OSG going under Linux, +FreeBSD, IRIX, Windows and Mac. Each intro mentions OpenSceneGraph-Data, it is +recommended that you also download it alongside this source distribution. + +The scene graph depends upon Standard C++, STL and OpenGL so you need a C++ +compiler up to the task and OpenGL or Mesa installed. The viewer depends upon +GLUT which you'll need to download and install from the GLUT website. The +OSG has it own native ascii file format, and .rgb image reader inbuilt which +allows you read the example data with any dependencies other than C++, STL and +OpenGL. + +The OSG also has a set of plug-ins which support non-native 3d database and +image formats, several have no dependencies on external libraries (flt,3ds,obj, +lwo,dw, tga & pic), while others (pfb,jpeg,gif,tiff) require other libraries +to be installed to compile them. If you don't already have them installed then +don't worry, you'll still be able to use the OSG. The core osg library and +viewer has been designed to load the plug-ins at run-time only and if they +are required to load a specific data set. If you don't need them for your +datasets then it won't matter that you haven't been able to compile +all the plug-ins. A full list of dependencies and where to download the +required libraries are listed in the index.html. + +If you're coming across the OSG for the first time and want to get started +quickly, go right ahead and follow the compilation instructions. You can +always later download the libraries which the plug-ins require if you +eventually need them. + +If you haven't already checked it out, for a list of distribution contents, +contacts and links to documentation check out index.html. + + +Environmental settings under Unix: +--------------------------------- + + These enviromental settings are useful to help develop with an + entirely local copy of the osg. However, once you've done a + make install you can make do without all of these, although + OSGFILEPATH is still useful as the osgDB library uses it for + picking locating datafiles. + + Add the following to your .cshrc : + + setenv OSGHOME + setenv OSGDATA + setenv OSGFILEPATH ./:${OSGDATA}:${OSGDATA}/Images: + setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:${OSGHOME}/lib + setenv PATH ${PATH}:${OSGHOME}/bin + + Or the following if you're using a sh compatible shell : + + export OSGHOME= + export OSGDATA= + export OSGFILEPATH=./:${OSGDATA}:${OSGDATA}/Images: + export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${OSGHOME}/lib + export PATH=${PATH}:${OSGHOME}/bin + +Compiling under Linux : +----------------------- + + To compile, from the OSG root directory, type: + + make + + Note, make should automatically detect linux and copy the + Make/makerules.linux and Make/makedefs.linux over the + default Make/makerules and Make/makedefs. If autodetection + does not work type 'make linux'. + + And if you wish to install the OSG to /usr/include/ & + /usr/lib then su root, and type: + + make install + + or + + make instlinks + + To get full details of make options, type: + + make help + + +Compiling under FreeBSD : +------------------------- + + To compile, from the OSG root directory, type : + + make freebsd + + And if you wish to install the OSG to /usr/include/ & + /usr/lib then su root, and type: + + make install + + or + + make instlinks + + To get full details of make options, type: + + make help + + +Compiling under IRIX : +---------------------- + + When setting up environmental variables, specified above, + LD_LIBRARY_PATH should of course be replaced by LD_LIBRARYN32_PATH. + + Since the OSG uses Standard C++ features such as STL it is important + to have an up to date version of the MIPSPro compilers. The library + has been tested under MIPSPro7.3 & MIPSPro7.2.1, and *may* compile + under previous versions but has yet to be tested. It is recommended + to use MIPSPro7.3.1.1m. + + To compile, from the OSG root directory, type : + + make + + Note, make should automatically detect IRIX and copy the + Make/makerules.irix.std and Make/makedefs.irix.std over the + default Make/makerules and Make/makedefs. If autodetection + does not work type 'make irix' for MIPSPro7.3 or 'make irix.old' + for MIPSPro7.2.1 and before. + + And if you wish to install the OSG to /usr/include/ & + /usr/lib then su root, and type: + + make install + + or + + make instlinks + + To get full details of make options, type: + + make help + + +Compiling under Windows : +------------------------- + + The Microsoft Visual C++ 6.0 workspace file is VisualStudio.dsw located + in the VisualStudio\ below the OSG this root directory. The OSG will + compile with the basic VisualC++6.0, but its recommended that you use + Service Pack 4 to fix MS compiler bugs which affect the OSG. + + The OSG is composed of a number of libraries and executables, to get + running you'll need at least to compile osg,osgUtil,osgDB,osgGLUT, + dot_osg and sgv. The rest of the libraries and executables are + optional and can be compiled if you need them. It may well be simplest + to do a batch build of all the libraries and executables in the + distribution, some of the plug-ins which support non native file + formats may not compile due to dependencies on other libraries (such + as libpng), you can ignore these compilation errors unless you need + to load the related file types. + + To execute the viewer the file path for the .dll's and .exe, both compiled + into the OSG's bin directory, need to be setup, such as by adding the PATH + to your autoexec.bat, its also useful to add the OSGFILEPATH to your + autoexec.bat to help the location of datafiles. For example : + + SET OSGFILEPATH=D:\OpenSceneGraph-Data;D:\OpenSceneGraph-Data\Images + SET PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;C:\Oglsdk\lib;D:\osg-0.8.40\bin; + + To help compilation of the image reader plugins, various image libraries + have been zipped up for your convienice, your find these on the OSG + release download directory. + +Compiling under Mac : +--------------------- + + The Microwerks Codewarrior workspace files can be found under the + Microwerks directory. Further details to be fleshed out since + Mac port is in its early stages and is not uptodate with the + current release. To get it compiling you will have to use these + Codewarrior files as a starting place. If you get it running and + have time to maintian the port please email robert@openscenegraph.org. + + +Running the demos +----------------- + + To run the viewer demo type (you made need to type rehash first under Unix) : + + sgv dumptruck.osg + sgv cow.osg + sgv e-s-bike.osg + + sgv lz.rgb + + sgv Spinnercar.flt + sgv Alley.3ds + sgv town_ogl_pfi.pfb + + Other run other demos type + + osgcube + + or + + hangglide + hangglide master.flt + + or + + osgreflect cow.osg + + or + + osgconv Alley.3ds Alley.osg + + or + + osgtexture lz.rgb tree.rgb + + or + + osgimpostor cow.osg + + or + + osgviews glider.osg + + + (Note: the file is picked up by checking the directories pointed to + by $OSGFILEPATH) + + +Plug-in dependencies +-------------------- + + You may have compile errors if you don't have all the required libraries, + especially for the plugins. As long as the core libraries osg, osgUtl, + osgGLUT and sgv have compiled you won't have any problems running the osg + itself but may not be able to use some non-native data formats. To get + the problematic plugins working you may need to download support libraries + such as libtiff, libjpeg etc. For further details see index.html. diff --git a/Make/makedefs.freebsd b/Make/makedefs.freebsd new file mode 100644 index 000000000..38326133b --- /dev/null +++ b/Make/makedefs.freebsd @@ -0,0 +1,61 @@ +MAKEDIR = $(OSGHOME)/Make +INSTRULES = $(MAKEDIR)/instrules +MAKEDEPEND = Makedepend +OBJS = $(C++FILES:.cpp=.o) $(CFILES:.c=.o) $(YACCFILES:.y=.o) $(LEXFILES:.l=.o) + +DEPFILES = $(OBJS:.o=.d) + + +C++ = g++ +YFLAGS = -d +LCINCS += -I/usr/local/include -I/usr/X11R6/include +LC++INCS += ${LCINCS} +CFLAGS = -O2 -W -Wall $(LCINCS) +C++FLAGS = ${CFLAGS} +CPPFLAGS = ${CFLAGS} + +FREEBSD_LOCALLIBS = -L/usr/local/lib -rpath /usr/local/lib + +LDFLAGS = -O2 -W -Wall -pthread -L/usr/local/lib -L/usr/X11R6/lib + +DYNAMICLIBRARYLIB = +PFLIBS = +GLUTLIB = -lglut + +# +# TARGET_DIRS are directories that would not exist on the system except +# for the presence of OpenSceneGraph. 'make instclean' removes these +# directories +# +TARGET_DIRS = \ + /usr/include/osg \ + /usr/include/osgDB \ + /usr/include/osgGLUT \ + /usr/include/osgUtil \ + /usr/share/OpenSceneGraph\ + /usr/share/OpenSceneGraph/data\ + /usr/share/OpenSceneGraph/data/Images\ + /usr/share/OpenSceneGraph/data/Test\ + /usr/lib/osgPlugins\ + + +TARGET_BIN = /usr/bin +TARGET_LIB = /usr/lib +TARGET_INCLUDE = /usr/include +TARGET_DATA = /usr/share/OpenSceneGraph/data + +# +# This definitions are necessary for IRIX. The following statement +# does not work for smake using a sh: +# +# for variable in $(LIST); do ...; done +# +# .. if $(LIST) is a NULL variable. So we have to define 0 length +# strings and check for them inside the for loop +# + +TARGET_LIB_FILES = "" +TARGET_BIN_FILES = "" +TARGET_INCLUDE_FILES = "" +TARGET_DATA_FILES = "" +TARGET_LOADER_FILES = "" diff --git a/Make/makerules.freebsd b/Make/makerules.freebsd new file mode 100644 index 000000000..d5c9e4a62 --- /dev/null +++ b/Make/makerules.freebsd @@ -0,0 +1,56 @@ + +all : $(MAKEDEPEND) $(TARGET) $(LIB) + +$(TARGET) : $(OBJS) + $(C++) $(LDFLAGS) $(OBJS) $(LIBS) -o $@ + +$(LIB) : $(OBJS) + $(C++) $(LDFLAGS) -shared $(OBJS) $(LIBS) -o $@ + +clean : + rm -f $(OBJS) core $(TARGET) $(MAKEDEPEND) + touch $(MAKEDEPEND) + +clobber : clean + rm -f $(TARGET) a.out $(LIB) + +to_unix : + for f in *.cpp ; do to_unix $$f $$f; done + for f in *.h ; do to_unix $$f $$f; done + +# force it +depend : + $(C++) $(C++FLAGS) -M $(C++FILES) $(CFILES) > $(MAKEDEPEND) + +$(MAKEDEPEND) : $(C++FILES) $(CFILES) + $(C++) $(C++FLAGS) -M $(C++FILES) $(CFILES) > $(MAKEDEPEND) + +%.o : %.cpp + $(C++) $(C++FLAGS) -c $*.cpp -o $*.o + +%.o : %.c + $(C++) $(C++FLAGS) -c $*.c -o $*.o + +docs: + [ "$(TARGET_BASENAME)" != "" ] && \ + mkdir -p ../../doc/doc++/$(TARGET_BASENAME) && \ + doc++ -d ../../doc/doc++/$(TARGET_BASENAME) -H -A ../../include/$(TARGET_BASENAME)/* && \ + echo $(TARGET_BASENAME) HTML documentation created in ../../doc/doc++/$(TARGET_BASENAME) + +install : home + @ $(MAKE) __install + +instlinks : home + @ $(MAKE) __instlinks + +instclean : home + @ $(MAKE) __instclean + + +home : + @ [ -n "$(OSGHOME)" ] || (echo ; echo "-------------> Please define OSGHOME"; echo) + @ [ -n "$(OSGHOME)" ] && echo > /dev/null; + +sinclude $(INSTRULES) + +include $(MAKEDEPEND) diff --git a/doc/OpenSceneGraphBanner_Distribution.jpg b/doc/OpenSceneGraphBanner_Distribution.jpg new file mode 100644 index 000000000..af1a555e4 Binary files /dev/null and b/doc/OpenSceneGraphBanner_Distribution.jpg differ diff --git a/doc/doc++/osg/AlphaFunc.html b/doc/doc++/osg/AlphaFunc.html new file mode 100644 index 000000000..7bc5d8e17 --- /dev/null +++ b/doc/doc++/osg/AlphaFunc.html @@ -0,0 +1,212 @@ + + + + + class SG_EXPORT osg::AlphaFunc + + + + +

class SG_EXPORT osg::AlphaFunc

Encapsulte OpenGL glAlphaFunc
+
+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Methods

+[more] AlphaFunc() +
+[more]virtual bool isSameKindAs(const Object* obj) const +
+[more]virtual Object* clone() const +
+[more]virtual const char* className() const +
+[more]virtual const Type getType() const +
+[more]virtual void setStateSetModes(StateSet& ds, const GLModeValue value) const +
+[more]inline void setFunction(const ComparisonFunction func, const float ref) +
+[more]inline const ComparisonFunction getFunction() const +
+[more]inline const float getReferenceValue() const +
+[more]virtual void apply(State& state) const +

+ +

+

Public Members

+[more]enum ComparisonFunction +

+ +

+

Protected Fields

+[more]ComparisonFunction _comparisonFunc +
+[more]float _referenceValue +

+ +

+

Protected Methods

+[more]virtual ~AlphaFunc() +

+ +
+

Inherited from StateAttribute:

+
+

+

Public Methods

+ovirtual void compile(State&) const +

+ +

+

Public Members

+otypedef GLenum GLMode +
+otypedef unsigned int GLModeValue +
+otypedef unsigned int OverrideValue +
+oenum Values +
+oenum Type +

+ +
+

Inherited from Object:

+
+
+

Inherited from Referenced:

+
+

+

Public Methods

+oinline Referenced& operator = (Referenced&) +
+oinline void ref() const +
+oinline void unref() const +
+oinline const int referenceCount() const +

+ +

+

Protected Fields

+omutable int _refCount +

+ +
+ + +
+

Documentation

+
Encapsulte OpenGL glAlphaFunc
+
+ + + +
o AlphaFunc() +

+ + +

ovirtual bool isSameKindAs(const Object* obj) const +

+ + +

ovirtual Object* clone() const +

+ + +

ovirtual const char* className() const +

+ + +

ovirtual const Type getType() const +

+ + +

ovirtual void setStateSetModes(StateSet& ds, const GLModeValue value) const +

+ + +

oenum ComparisonFunction +

+ + + +
o NEVER +

+ + +

o LESS +

+ + +

o EQUAL +

+ + +

o LEQUAL +

+ + +

o GREATER +

+ + +

o NOTEQUAL +

+ + +

o GEQUAL +

+ + +

o ALWAYS +

+ + + +
oinline void setFunction(const ComparisonFunction func, const float ref) +

+ + +

oinline const ComparisonFunction getFunction() const +

+ + +

oinline const float getReferenceValue() const +

+ + +

ovirtual void apply(State& state) const +

+ + +

ovirtual ~AlphaFunc() +

+ + +

oComparisonFunction _comparisonFunc +

+ + +

ofloat _referenceValue +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/Billboard.html b/doc/doc++/osg/Billboard.html new file mode 100644 index 000000000..8eb677351 --- /dev/null +++ b/doc/doc++/osg/Billboard.html @@ -0,0 +1,389 @@ + + + + + class SG_EXPORT osg::Billboard + + + + +

class SG_EXPORT osg::Billboard

Billboard - a Geode which orientates its child osg::Drawable's to face the eye point.
+
+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Methods

+[more] Billboard() +
+[more]virtual Object* clone() const +
+[more]virtual bool isSameKindAs(const Object* obj) const +
+[more]virtual const char* className() const +
+[more]virtual void accept(NodeVisitor& nv) +
+[more]inline void setAxis(const Vec3& axis) +
Set the axis about which all the billboard's drawable rotate. +
+[more]inline const Vec3& getAxis() const +
Get the axis about which all the billboard's drawable rotate. +
+[more]inline void setMode(const Mode mode) +
Set the billboard rotation mode. +
+[more]inline const Mode getMode() const +
Get the billboard rotation mode. +
+[more]inline void setPos(int i, const Vec3& pos) +
Set the position of specified drawable. +
+[more]inline const Vec3& getPos(int i) const +
Get the position of specified drawable. +
+[more]inline PositionList& getPositionList() +
Get the PostionList from the billboard +
+[more]inline const PositionList& getPositionList() const +
Get a const PostionList from the billboard +
+[more]virtual const bool addDrawable( Drawable* gset ) +
Add Drawable to Billboard with default position(0,0,0); If gset not NULL and is not contained in Billboard then increment its reference count, and dirty the bounding box to cause it to recompute on next getBound() and return true for success. +
+[more]virtual const bool addDrawable(Drawable* gset, const Vec3& pos) +
Add Drawable to Geode at position pos. +
+[more]virtual const bool removeDrawable( Drawable* gset ) +
Remove Drawable and associated position from Billboard. +
+[more]void calcRotation(const Vec3& eye_local, const Vec3& pos_local, Matrix& mat) const +
+[more]void calcTransform(const Vec3& eye_local, const Vec3& pos_local, Matrix& mat) const +

+ +

+

Public Members

+[more]enum Mode +
+[more]typedef std::vector<Vec3> PositionList +
PositionList represents a list of pivot points for each drawable +

+ +

+

Protected Fields

+[more]Mode _mode +
+[more]Vec3 _axis +
+[more]PositionList _positionList +

+ +

+

Protected Methods

+[more]virtual ~Billboard() +
+[more]virtual const bool computeBound() const +

+ +
+

Inherited from Geode:

+
+

+

Public Methods

+ovirtual const bool replaceDrawable( Drawable* origDraw, Drawable* newDraw ) +
+oinline const int getNumDrawables() const +
+oinline Drawable* getDrawable( const int i ) +
+oinline const Drawable* getDrawable( const int i ) const +
+oinline const bool containsDrawable(const Drawable* gset) const +
+oinline DrawableList::iterator findDrawable(const Drawable* gset) +
+oinline DrawableList::const_iterator findDrawable(const Drawable* gset) const +
+ovoid compileDrawables(State& state) +

+ +

+

Protected Fields

+oDrawableList _drawables +

+ +
+

Inherited from Node:

+
+

+

Public Methods

+ovirtual void ascend(NodeVisitor& nv) +
+ovirtual void traverse(NodeVisitor& ) +
+oinline void setName( const std::string& name ) +
+oinline void setName( const char* name ) +
+oinline const std::string& getName() const +
+oinline const ParentList& getParents() const +
+oinline Group* getParent(const int i) +
+oinline const Group* getParent(const int i) const +
+oinline const int getNumParents() const +
+oinline void setUserData(void* data, MemoryAdapter* ma=0L) +
+oinline void* getUserData() +
+oinline const void* getUserData() const +
+oinline MemoryAdapter* getMemoryAdapter() +
+oinline const MemoryAdapter* getMemoryAdapter() const +
+oinline void setNodeMask(const NodeMask nm) +
+oinline const NodeMask getNodeMask() const +
+oinline const DescriptionList& getDescriptions() const +
+oinline DescriptionList& getDescriptions() +
+oinline const std::string& getDescription(const int i) const +
+oinline std::string& getDescription(const int i) +
+oinline const int getNumDescriptions() const +
+ovoid addDescription(const std::string& desc) +
+oinline void setStateSet(osg::StateSet* dstate) +
+oinline osg::StateSet* getStateSet() +
+oinline const osg::StateSet* getStateSet() const +
+oinline const BoundingSphere& getBound() const +
+ovoid dirtyBound() +

+ +

+

Public Members

+otypedef std::vector<Group*> ParentList +
+otypedef std::vector<std::string> DescriptionList +

+ +

+

Protected Fields

+omutable BoundingSphere _bsphere +
+omutable bool _bsphere_computed +
+ostd::string _name +
+oParentList _parents +
+ovoid* _userData +
+oref_ptr<MemoryAdapter> _memoryAdapter +
+oNodeMask _nodeMask +
+oDescriptionList _descriptions +
+oref_ptr<StateSet> _dstate +

+ +
+

Inherited from Object:

+
+
+

Inherited from Referenced:

+
+

+

Public Methods

+oinline Referenced& operator = (Referenced&) +
+oinline void ref() const +
+oinline void unref() const +
+oinline const int referenceCount() const +

+ +

+

Protected Fields

+omutable int _refCount +

+ +
+ + +
+

Documentation

+
Billboard - a Geode which orientates its child osg::Drawable's to face +the eye point. +Typical uses are for trees, or particle explosions.
+
+ + + +
oenum Mode +

+ + + +
o AXIAL_ROT +

+ + +

o POINT_ROT_EYE +

+ + +

o POINT_ROT_WORLD +

+ + + +
o Billboard() +

+ + +

ovirtual Object* clone() const +

+ + +

ovirtual bool isSameKindAs(const Object* obj) const +

+ + +

ovirtual const char* className() const +

+ + +

ovirtual void accept(NodeVisitor& nv) +

+ + +

oinline void setAxis(const Vec3& axis) +
Set the axis about which all the billboard's drawable rotate. +

+ + +

oinline const Vec3& getAxis() const +
Get the axis about which all the billboard's drawable rotate. +

+ + +

oinline void setMode(const Mode mode) +
Set the billboard rotation mode. +

+ + +

oinline const Mode getMode() const +
Get the billboard rotation mode. +

+ + +

oinline void setPos(int i, const Vec3& pos) +
Set the position of specified drawable. +

+ + +

oinline const Vec3& getPos(int i) const +
Get the position of specified drawable. +

+ + +

otypedef std::vector<Vec3> PositionList +
PositionList represents a list of pivot points for each drawable +

+ + +

oinline PositionList& getPositionList() +
Get the PostionList from the billboard +

+ + +

oinline const PositionList& getPositionList() const +
Get a const PostionList from the billboard +

+ + +

ovirtual const bool addDrawable( Drawable* gset ) +
Add Drawable to Billboard with default position(0,0,0); +If gset not NULL and is not contained in Billboard then increment its +reference count, and dirty the bounding box to cause it to recompute on +next getBound() and return true for success. Otherwise return false. +

+ + +

ovirtual const bool addDrawable(Drawable* gset, const Vec3& pos) +
Add Drawable to Geode at position pos. +If gset not NULL and is not contained in Billboard then increment its +reference count, and dirty the bounding box to cause it to recompute on +next getBound() and return true for success. Otherwise return false. +

+ + +

ovirtual const bool removeDrawable( Drawable* gset ) +
Remove Drawable and associated position from Billboard. +If gset is contained in Billboard then remove it from the geoset +list and decrement its reference count, and dirty the +bounding box to cause it to recompute on next getBound() and +return true for success. If gset is not found then return false +and do not the reference count of gset is left unchanged. +

+ + +

ovoid calcRotation(const Vec3& eye_local, const Vec3& pos_local, Matrix& mat) const +

+ + +

ovoid calcTransform(const Vec3& eye_local, const Vec3& pos_local, Matrix& mat) const +

+ + +

ovirtual ~Billboard() +

+ + +

ovirtual const bool computeBound() const +

+ + +

oMode _mode +

+ + +

oVec3 _axis +

+ + +

oPositionList _positionList +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/BoundingBox.html b/doc/doc++/osg/BoundingBox.html new file mode 100644 index 000000000..836956615 --- /dev/null +++ b/doc/doc++/osg/BoundingBox.html @@ -0,0 +1,224 @@ + + + + + class SG_EXPORT osg::BoundingBox + + + + +

class SG_EXPORT osg::BoundingBox

General purpose axis-aligned bounding box class for enclosing objects/vertices.
+
+ +
+

+

Public Fields

+[more]Vec3 _min +
The corner with the smallest values for each coordinate of the bounding box +
+[more]Vec3 _max +
The corner with the largest values for each coordinate of the bounding box +

+ +

+

Public Methods

+[more] BoundingBox() +
construct to invalid values to represent an unset bounding box +
+[more]inline void init() +
initialize to invalid values to represent an unset bounding box +
+[more]inline const bool isValid() const +
return true if the bounding box contains valid values, false if the bounding box is effectively unset/empty +
+[more]inline float& xMin() +
+[more]inline const float xMin() const +
+[more]inline float& yMin() +
+[more]inline const float yMin() const +
+[more]inline float& zMin() +
+[more]inline const float zMin() const +
+[more]inline float& xMax() +
+[more]inline const float xMax() const +
+[more]inline float& yMax() +
+[more]inline const float yMax() const +
+[more]inline float& zMax() +
+[more]inline const float zMax() const +
+[more]inline const Vec3 center() const +
Calculate and return the center of the bounding box +
+[more]inline const float radius() const +
Calculate and return the radius of the bounding box +
+[more]inline const float radius2() const +
Calculate and return the radius squared of the bounding box. +
+[more]inline const Vec3 corner(unsigned int pos) const +
return the corner of the bounding box. +
+[more]void expandBy(const Vec3& v) +
If the vertex is outwith the box expand to ecompass vertex. +
+[more]void expandBy(const BoundingBox& bb) +
If incomming box is outwith the box expand to ecompass incomming box. +
+[more]void expandBy(const BoundingSphere& sh) +
If incomming sphere is outwith the box expand to ecompass incomming sphere. +
+[more]inline const bool contains(const Vec3& v) const +
return true is vertex v is within the box +

+ +
+ + +
+

Documentation

+
General purpose axis-aligned bounding box class for enclosing objects/vertices. +Used to bounding the leaf objects in the scene, +i.e. osg::GeoSet's to assist in view frustum culling etc.
+
+ + + +
oVec3 _min +
The corner with the smallest values for each coordinate of the +bounding box +

+ + +

oVec3 _max +
The corner with the largest values for each coordinate of the +bounding box +

+ + +

o BoundingBox() +
construct to invalid values to represent an unset bounding box +

+ + +

oinline void init() +
initialize to invalid values to represent an unset bounding box +

+ + +

oinline const bool isValid() const +
return true if the bounding box contains valid values, +false if the bounding box is effectively unset/empty +

+ + +

oinline float& xMin() +

+ + +

oinline const float xMin() const +

+ + +

oinline float& yMin() +

+ + +

oinline const float yMin() const +

+ + +

oinline float& zMin() +

+ + +

oinline const float zMin() const +

+ + +

oinline float& xMax() +

+ + +

oinline const float xMax() const +

+ + +

oinline float& yMax() +

+ + +

oinline const float yMax() const +

+ + +

oinline float& zMax() +

+ + +

oinline const float zMax() const +

+ + +

oinline const Vec3 center() const +
Calculate and return the center of the bounding box +

+ + +

oinline const float radius() const +
Calculate and return the radius of the bounding box +

+ + +

oinline const float radius2() const +
Calculate and return the radius squared of the bounding box. +Note, radius2() is faster to calculate than radius(). +

+ + +

oinline const Vec3 corner(unsigned int pos) const +
return the corner of the bounding box. +Position (pos) is specfied by a number between 0 and 7, +the first bit toggles between x min and x max, second +bit toggles between y min and y max, third bit toggles +between z min and z max. +

+ + +

ovoid expandBy(const Vec3& v) +
If the vertex is outwith the box expand to ecompass vertex. +If this box is empty then move set this box's min max to vertex. +

+ + +

ovoid expandBy(const BoundingBox& bb) +
If incomming box is outwith the box expand to ecompass incomming box. +If this box is empty then move set this box to incomming box. +

+ + +

ovoid expandBy(const BoundingSphere& sh) +
If incomming sphere is outwith the box expand to ecompass incomming sphere. +If this box is empty then move set this box to encompass the sphere. +

+ + +

oinline const bool contains(const Vec3& v) const +
return true is vertex v is within the box +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/BoundingSphere.html b/doc/doc++/osg/BoundingSphere.html new file mode 100644 index 000000000..b120caac2 --- /dev/null +++ b/doc/doc++/osg/BoundingSphere.html @@ -0,0 +1,177 @@ + + + + + class SG_EXPORT osg::BoundingSphere + + + + +

class SG_EXPORT osg::BoundingSphere

General purpose bounding sphere class for enclosing nodes/objects/vertices.
+
+ +
+

+

Public Fields

+[more]Vec3 _center +
+[more]float _radius +

+ +

+

Public Methods

+[more] BoundingSphere() +
construct to invalid values to represent an unset bounding sphere +
+[more]inline void init() +
initialize to invalid values to represent an unset bounding sphere +
+[more]inline const bool isValid() const +
return true if the bounding sphere contains valid values, false if the bounding sphere is effectively unset +
+[more]inline Vec3& center() +
return the center of the bounding sphere +
+[more]inline const Vec3& center() const +
return the const center of the bounding sphere +
+[more]inline float& radius() +
return the radius of the bounding sphere +
+[more]inline const float radius() const +
return the const radius of the bounding sphere +
+[more]inline const float radius2() const +
return the radius squared. +
+[more]void expandBy(const Vec3& v) +
If the vertex is outwith the sphere expand to ecompass vertex. +
+[more]void expandRadiusBy(const Vec3& v) +
If the vertex is outwith the sphere expand radius to ecompass vertex. +
+[more]void expandBy(const BoundingSphere& sh) +
If incomming sphere is outwith the sphere expand to ecompass incomming sphere. +
+[more]void expandRadiusBy(const BoundingSphere& sh) +
If incomming sphere is outwith the sphere expand radius to ecompass incomming sphere. +
+[more]inline const bool contains(const Vec3& v) const +
return true is vertex v is within the sphere +
+[more]inline const bool intersects( const BoundingSphere& bs ) const +
return true if bounding sphere's intersect each other +

+ +
+ + +
+

Documentation

+
General purpose bounding sphere class for enclosing nodes/objects/vertices. +Used to bound internal osg::Node's in the scene, +to assist in view frustrum culling etc. Similar in function to BoundingBox +but is quicker for evaluating culling, but generally encloses a greater volume +than a BoundingBox so will not cull so aggressively.
+
+ + + +
oVec3 _center +

+ + +

ofloat _radius +

+ + +

o BoundingSphere() +
construct to invalid values to represent an unset bounding sphere +

+ + +

oinline void init() +
initialize to invalid values to represent an unset bounding sphere +

+ + +

oinline const bool isValid() const +
return true if the bounding sphere contains valid values, +false if the bounding sphere is effectively unset +

+ + +

oinline Vec3& center() +
return the center of the bounding sphere +

+ + +

oinline const Vec3& center() const +
return the const center of the bounding sphere +

+ + +

oinline float& radius() +
return the radius of the bounding sphere +

+ + +

oinline const float radius() const +
return the const radius of the bounding sphere +

+ + +

oinline const float radius2() const +
return the radius squared. +Note, for performance reasons, assumes the calling method has ensured +that the sphere is valid before calling radius2(), i.e. has _radius>=0.0, +as it does not check th validity of sphere and will eroneously return a positive value. +

+ + +

ovoid expandBy(const Vec3& v) +
If the vertex is outwith the sphere expand to ecompass vertex. +Calculates the combination of movement of center and radius which +minimizes the radius increase. If this sphere is empty then +move the centrer to v and set radius to 0. +

+ + +

ovoid expandRadiusBy(const Vec3& v) +
If the vertex is outwith the sphere expand radius to ecompass vertex. +Unlike update, does not move the center, just increasing the radius. +If this sphere is empty then move the centrer to v and set radius to 0 +

+ + +

ovoid expandBy(const BoundingSphere& sh) +
If incomming sphere is outwith the sphere expand to ecompass incomming sphere. +calculates the combination of movement of center and radius which +minimizes the radius increase. If this sphere is empty then +move the centrer to v and set radius to 0. +

+ + +

ovoid expandRadiusBy(const BoundingSphere& sh) +
If incomming sphere is outwith the sphere expand radius to ecompass incomming sphere. +Unlike update, does not move the center, just increasing the radius. +If this sphere is empty then move the centrer to v and set radius to 0. +

+ + +

oinline const bool contains(const Vec3& v) const +
return true is vertex v is within the sphere +

+ + +

oinline const bool intersects( const BoundingSphere& bs ) const +
return true if bounding sphere's intersect each other +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/Camera.html b/doc/doc++/osg/Camera.html new file mode 100644 index 000000000..d00130a37 --- /dev/null +++ b/doc/doc++/osg/Camera.html @@ -0,0 +1,706 @@ + + + + + class SG_EXPORT osg::Camera + + + + +

class SG_EXPORT osg::Camera

Camera class for encapsulating the view position and orientation and projection (lens) used.
+
+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Methods

+[more] Camera() +
+[more]virtual ~Camera() +
+[more]const ProjectionType getProjectionType() const +
Get the projection type set by setOtho,setOtho2D,setFrustum, and set perspective methods +
+[more]void setOrtho(const double left, const double right, const double bottom, const double top, const double zNear, const double zFar) +
Set a orthographics projection. +
+[more]void setOrtho2D(const double left, const double right, const double bottom, const double top) +
Set a 2D orthographics projection. +
+[more]void setFrustum(const double left, const double right, const double bottom, const double top, const double zNear, const double zFar) +
Set a perspective projection. +
+[more]void setPerspective(const double fovy, const double aspectRatio, const double zNear, const double zFar) +
Set a sysmetical perspective projection, See gluPerspective for further details. +
+[more]void setNearFar(const double zNear, const double zFar) +
Set the near and far clipping planes +
+[more]void adjustAspectRatio(const double newAspectRatio, const AdjustAxis aa = ADJUST_HORIZONTAL) +
Adjust the clipping planes to account for a new window aspcect ratio. +
+[more]const double left() const +
+[more]const double right() const +
+[more]const double top() const +
+[more]const double bottom() const +
+[more]const double zNear() const +
+[more]const double zFar() const +
+[more]const double calc_fovy() const +
Calculate and return the equivilant fovx for the current project setting. +
+[more]const double calc_fovx() const +
Calculate and return the equivilant fovy for the current project setting. +
+[more]const double calc_aspectRatio() const +
Calculate and return the projection aspect ratio. +
+[more]const Matrix& getProjectionMatrix() const +
+[more]const LookAtType getLookAtType() const +
+[more]void home() +
hardwired home view for now, looking straight down the Z axis at the origin, with 'up' being the y axis +
+[more]void setView(const Vec3& eyePoint, const Vec3& lookPoint, const Vec3& upVector) +
Set the View, the up vector should be orthogonal to the look vector. +
+[more]void setLookAt(const Vec3& eye, const Vec3& center, const Vec3& up) +
set the position and orientaion of the camera, using the same convention as gluLookAt +
+[more]void setLookAt(const double eyeX, const double eyeY, const double eyeZ, const double centerX, const double centerY, const double centerZ, const double upX, const double upY, const double upZ) +
set the position and orientaion of the camera, using the same convention as gluLookAt +
+[more]void transformLookAt(const Matrix& matrix) +
post multiple the existing eye point and orientation by matrix. +
+[more]void ensureOrthogonalUpVector() +
+[more]inline const Vec3& getEyePoint() const +
get the eye point. +
+[more]inline const Vec3& getCenterPoint() const +
get the center point. +
+[more]inline const Vec3& getUpVector() const +
get the up vector +
+[more]const Vec3 getLookVector() const +
calculate look vector +
+[more]const Vec3 getSideVector() const +
calculate side vector +
+[more]inline const float getFocalLength() const +
get focal distance +
+[more]void attachTransform(const TransformMode mode, Matrix* modelTransform=0) +
Attach a transform matrix which is applied after the camera look at. +
+[more]void dirtyTransform() +
must be called after you modify an attachedTransform. +
+[more]Matrix* getTransform(const TransformMode mode) +
+[more]const Matrix* getTransform(const TransformMode mode) const +
+[more]const Vec3 getEyePoint_Model() const +
+[more]const Vec3 getCenterPoint_Model() const +
+[more]const Vec3 getLookVector_Model() const +
+[more]const Vec3 getUpVector_Model() const +
+[more]const Vec3 getSideVector_Model() const +
+[more]const Matrix& getModelViewMatrix() const +
Get the ModelView matrix. +
+[more]void setUseNearClippingPlane(const bool use) +
+[more]const bool getUseNearClippingPlane() const +
+[more]void setUseFarClippingPlane(const bool use) +
+[more]const bool getUseFarClippingPlane() const +
+[more]const ClippingVolume& getClippingVolume() const +
get the view frustum clipping in model coordinates +
+[more]const bool project(const Vec3& obj, const int* viewport, Vec3& win) const +
Map object coordinates into windows coordinates. +
+[more]const bool unproject(const Vec3& win, const int* viewport, Vec3& obj) const +
Map window coordinates into object coordinates. +

+ +

+

Public Members

+[more]enum ProjectionType +
Range of projection types. +
+[more]enum AdjustAxis +
Use in combination with adjustAspectRatio, to control the change in frustum clipping planes to account for changes in windows aspect ratio, +
+[more]enum LookAtType +
+[more]enum TransformMode +

+ +

+

Protected Fields

+[more]ProjectionType _projectionType +
+[more]double _left +
+[more]double _right +
+[more]double _bottom +
+[more]double _top +
+[more]double _zNear +
+[more]double _zFar +
+[more]LookAtType _lookAtType +
+[more]Vec3 _eye +
+[more]Vec3 _center +
+[more]Vec3 _up +
+[more]double _focalLength +
+[more]TransformMode _attachedTransformMode +
+[more]ref_ptr<Matrix> _eyeToModelTransform +
+[more]ref_ptr<Matrix> _modelToEyeTransform +
+[more]bool _useNearClippingPlane +
+[more]bool _useFarClippingPlane +
+[more]mutable bool _dirty +
+[more]mutable ref_ptr<Matrix> _projectionMatrix +
+[more]mutable ref_ptr<Matrix> _modelViewMatrix +
+[more]mutable ClippingVolume _clippingVolume +
+[more]mutable ref_ptr<Matrix> _MP +
+[more]mutable ref_ptr<Matrix> _inverseMP +

+ +

+

Protected Methods

+[more] Camera(const Camera&) +
+[more]Camera& operator=(const Camera&) +
+[more]void calculateMatricesAndClippingVolume() const +

+ +
+

Inherited from Referenced:

+
+

+

Public Methods

+oinline Referenced& operator = (Referenced&) +
+oinline void ref() const +
+oinline void unref() const +
+oinline const int referenceCount() const +

+ +

+

Protected Fields

+omutable int _refCount +

+ +
+ + +
+

Documentation

+
Camera class for encapsulating the view position and orientation and +projection (lens) used. Creates a projection and modelview matrices +which can be used to set OpenGL's PROJECTION and MODELVIEW matrices +represectively.
+
+ + + +
o Camera() +

+ + +

ovirtual ~Camera() +

+ + +

oenum ProjectionType +
Range of projection types. +OTHO2D is a special case of OTHO where the near and far planes +are equal to -1 and 1 respectively. +PRESPECTIVE is a special case of FRUSTUM where the left & right +and bottom and top and symetrical. +

+ + + +
o ORTHO +

+ + +

o ORTHO2D +

+ + +

o FRUSTUM +

+ + +

o PERSPECTIVE +

+ + + +
oconst ProjectionType getProjectionType() const +
Get the projection type set by setOtho,setOtho2D,setFrustum, +and set perspective methods +

+ + +

ovoid setOrtho(const double left, const double right, const double bottom, const double top, const double zNear, const double zFar) +
Set a orthographics projection. See glOrtho for further details. +

+ + +

ovoid setOrtho2D(const double left, const double right, const double bottom, const double top) +
Set a 2D orthographics projection. See gluOrtho2D for further details. +

+ + +

ovoid setFrustum(const double left, const double right, const double bottom, const double top, const double zNear, const double zFar) +
Set a perspective projection. See glFrustum for further details. +

+ + +

ovoid setPerspective(const double fovy, const double aspectRatio, const double zNear, const double zFar) +
Set a sysmetical perspective projection, See gluPerspective for further details. +Aspect ratio is defined as width/height. +

+ + +

ovoid setNearFar(const double zNear, const double zFar) +
Set the near and far clipping planes +

+ + +

oenum AdjustAxis +
Use in combination with adjustAspectRatio, to control +the change in frustum clipping planes to account for +changes in windows aspect ratio, +

+ + + +
o ADJUST_VERTICAL +

+ + +

o ADJUST_HORIZONTAL +

+ + + +
ovoid adjustAspectRatio(const double newAspectRatio, const AdjustAxis aa = ADJUST_HORIZONTAL) +
Adjust the clipping planes to account for a new window aspcect ratio. +Typicall used after resizeing a window. Aspect ratio is defined as +width/height. +

+ + +

oconst double left() const +

+ + +

oconst double right() const +

+ + +

oconst double top() const +

+ + +

oconst double bottom() const +

+ + +

oconst double zNear() const +

+ + +

oconst double zFar() const +

+ + +

oconst double calc_fovy() const +
Calculate and return the equivilant fovx for the current project setting. +This value is only valid for when a symetric persepctive projection exists. +i.e. getProjectionType()==PERSPECTIVE. +

+ + +

oconst double calc_fovx() const +
Calculate and return the equivilant fovy for the current project setting. +This value is only valid for when a symetric persepctive projection exists. +i.e. getProjectionType()==PERSPECTIVE. +

+ + +

oconst double calc_aspectRatio() const +
Calculate and return the projection aspect ratio. +Aspect ratio is defined as width/height. +

+ + +

oconst Matrix& getProjectionMatrix() const +

+ + +

oenum LookAtType +

+ + + +
o USE_HOME_POSITON +

+ + +

o USE_EYE_AND_QUATERNION +

+ + +

o USE_EYE_CENTER_AND_UP +

+ + + +
oconst LookAtType getLookAtType() const +

+ + +

ovoid home() +
+hardwired home view for now, looking straight down the +Z axis at the origin, with 'up' being the y axis +

+ + +

ovoid setView(const Vec3& eyePoint, const Vec3& lookPoint, const Vec3& upVector) +
+Set the View, the up vector should be orthogonal to the look vector. +setView is now mapped to setLookAt(eye,center,up), and is only +kept for backwards compatibility. +

+ + +

ovoid setLookAt(const Vec3& eye, const Vec3& center, const Vec3& up) +
set the position and orientaion of the camera, using the same convention as +gluLookAt +

+ + +

ovoid setLookAt(const double eyeX, const double eyeY, const double eyeZ, const double centerX, const double centerY, const double centerZ, const double upX, const double upY, const double upZ) +
set the position and orientaion of the camera, using the same convention as +gluLookAt +

+ + +

ovoid transformLookAt(const Matrix& matrix) +
post multiple the existing eye point and orientation by matrix. +note, does not affect any ModelTransforms that are applied. +

+ + +

ovoid ensureOrthogonalUpVector() +

+ + +

oinline const Vec3& getEyePoint() const +
get the eye point. +

+ + +

oinline const Vec3& getCenterPoint() const +
get the center point. +

+ + +

oinline const Vec3& getUpVector() const +
get the up vector +

+ + +

oconst Vec3 getLookVector() const +
calculate look vector +

+ + +

oconst Vec3 getSideVector() const +
calculate side vector +

+ + +

oinline const float getFocalLength() const +
get focal distance +

+ + +

oenum TransformMode +

+ + + +
o EYE_TO_MODEL +

+ + +

o MODEL_TO_EYE +

+ + +

o NO_ATTACHED_TRANSFORM +

+ + + +
ovoid attachTransform(const TransformMode mode, Matrix* modelTransform=0) +
Attach a transform matrix which is applied after the camera look at. +The attached matrix can work in two ways, either as transform of the eye +into the model coordinates - EYE_TO_MODEL, or as a transform of the +model to the eye - MODEL_TO_EYE. The former is equivilant to attaching +a camera internal to the scene graph. The later is equivilant to adding +a osg::Transform at root of the scene to move the scene to the eye point. +Typical used in conjunction with the LookAt position set to home, +in which case it is simply treated as a model view matrix. +If the same behaviour as IRIS Performer's setViewMat is desired +then set the LookAt to be (0,0,0),(0,1,0),(0,0,1) since Performer's +default direction is along the y axis, unlike OpenGL and the default OSG. +If modelTransfor is NULL then do not use any model transform - just use the +basic LookAt values. +note: Camera internals maintains the both EYE_TO_MODEL and MODEL_TO_EYE +internally and ensures that they are the inverse of one another. However, +if you modify the attached transform then you must call dirtyTransform, to +allow the OSG to update matrices accordingly. +

+ + +

ovoid dirtyTransform() +
must be called after you modify an attachedTransform. +

+ + +

oMatrix* getTransform(const TransformMode mode) +

+ + +

oconst Matrix* getTransform(const TransformMode mode) const +

+ + +

oconst Vec3 getEyePoint_Model() const +

+ + +

oconst Vec3 getCenterPoint_Model() const +

+ + +

oconst Vec3 getLookVector_Model() const +

+ + +

oconst Vec3 getUpVector_Model() const +

+ + +

oconst Vec3 getSideVector_Model() const +

+ + +

oconst Matrix& getModelViewMatrix() const +
Get the ModelView matrix. +If a ModelTransform is supplied then the ModelView matrix is +created by multipling the current LookAt by ModelTransform. +Otherwise it is simply created by using the current LookAt, +equivialent to using gluLookAt. +

+ + +

ovoid setUseNearClippingPlane(const bool use) +

+ + +

oconst bool getUseNearClippingPlane() const +

+ + +

ovoid setUseFarClippingPlane(const bool use) +

+ + +

oconst bool getUseFarClippingPlane() const +

+ + +

oconst ClippingVolume& getClippingVolume() const +
get the view frustum clipping in model coordinates +

+ + +

oconst bool project(const Vec3& obj, const int* viewport, Vec3& win) const +
Map object coordinates into windows coordinates. +Equivilant to gluProject(...). +

+ + +

oconst bool unproject(const Vec3& win, const int* viewport, Vec3& obj) const +
Map window coordinates into object coordinates. +Equivilant to gluUnProject(...). +

+ + +

o Camera(const Camera&) +

+ + +

oCamera& operator=(const Camera&) +

+ + +

oProjectionType _projectionType +

+ + +

odouble _left +

+ + +

odouble _right +

+ + +

odouble _bottom +

+ + +

odouble _top +

+ + +

odouble _zNear +

+ + +

odouble _zFar +

+ + +

oLookAtType _lookAtType +

+ + +

oVec3 _eye +

+ + +

oVec3 _center +

+ + +

oVec3 _up +

+ + +

odouble _focalLength +

+ + +

oTransformMode _attachedTransformMode +

+ + +

oref_ptr<Matrix> _eyeToModelTransform +

+ + +

oref_ptr<Matrix> _modelToEyeTransform +

+ + +

obool _useNearClippingPlane +

+ + +

obool _useFarClippingPlane +

+ + +

omutable bool _dirty +

+ + +

omutable ref_ptr<Matrix> _projectionMatrix +

+ + +

omutable ref_ptr<Matrix> _modelViewMatrix +

+ + +

omutable ClippingVolume _clippingVolume +

+ + +

omutable ref_ptr<Matrix> _MP +

+ + +

omutable ref_ptr<Matrix> _inverseMP +

+ + +

ovoid calculateMatricesAndClippingVolume() const +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/ClassGraph.class b/doc/doc++/osg/ClassGraph.class new file mode 100644 index 000000000..c6a7b6c79 Binary files /dev/null and b/doc/doc++/osg/ClassGraph.class differ diff --git a/doc/doc++/osg/ClassGraphPanel.class b/doc/doc++/osg/ClassGraphPanel.class new file mode 100644 index 000000000..94b21b47a Binary files /dev/null and b/doc/doc++/osg/ClassGraphPanel.class differ diff --git a/doc/doc++/osg/ClassLayout.class b/doc/doc++/osg/ClassLayout.class new file mode 100644 index 000000000..77fb9fa28 Binary files /dev/null and b/doc/doc++/osg/ClassLayout.class differ diff --git a/doc/doc++/osg/ClipPlane.html b/doc/doc++/osg/ClipPlane.html new file mode 100644 index 000000000..33b5421d9 --- /dev/null +++ b/doc/doc++/osg/ClipPlane.html @@ -0,0 +1,223 @@ + + + + + class SG_EXPORT osg::ClipPlane + + + + +

class SG_EXPORT osg::ClipPlane

ClipPlane state class which encapsulates OpenGL glClipPlane() functionality
+
+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Methods

+[more] ClipPlane() +
+[more]virtual Object* clone() const +
return a shallow copy of a node, with Object* return type +
+[more]virtual bool isSameKindAs(const Object* obj) const +
return true if this and obj are of the same kind of object +
+[more]virtual const char* className() const +
return the name of the node's class type +
+[more]virtual const Type getType() const +
+[more]virtual void setStateSetModes(StateSet& ds, const GLModeValue value) const +
+[more]void setClipPlane(const Vec4& plane) +
Set the clip plane, using a Vec4 to define plane. +
+[more]void setClipPlane(const Plane& plane) +
Set the clip plane, using a Plane to define plane. +
+[more]void setClipPlane(const double* plane) +
Set the clip plane, using a double[4] to define plane. +
+[more]void getClipPlane(Vec4& plane) const +
Get the clip plane, values entered into a Vec4 passed to the getClipPlane. +
+[more]void getClipPlane(Plane& plane) const +
Get the clip plane, values entered into a Plane passed to the getClipPlane. +
+[more]void getClipPlane(double* plane) const +
Get the clip plane, values entered into a double[4] passed to the getClipPlane. +
+[more]void setClipPlaneNum(const unsigned int num) +
Set the clip plane number. +
+[more]const unsigned int getClipPlaneNum() const +
Get the clip plane number. +
+[more]virtual void apply(State& state) const +
Apply the clip plane's state to the OpenGL state machine. +

+ +

+

Protected Fields

+[more]double* _clipPlane +
+[more]unsigned int _clipPlaneNum +

+ +

+

Protected Methods

+[more]virtual ~ClipPlane() +

+ +
+

Inherited from StateAttribute:

+
+

+

Public Methods

+ovirtual void compile(State&) const +

+ +

+

Public Members

+otypedef GLenum GLMode +
+otypedef unsigned int GLModeValue +
+otypedef unsigned int OverrideValue +
+oenum Values +
+oenum Type +

+ +
+

Inherited from Object:

+
+
+

Inherited from Referenced:

+
+

+

Public Methods

+oinline Referenced& operator = (Referenced&) +
+oinline void ref() const +
+oinline void unref() const +
+oinline const int referenceCount() const +

+ +

+

Protected Fields

+omutable int _refCount +

+ +
+ + +
+

Documentation

+
ClipPlane state class which encapsulates OpenGL glClipPlane() functionality
+
+ + + +
o ClipPlane() +

+ + +

ovirtual Object* clone() const +
return a shallow copy of a node, with Object* return type +

+ + +

ovirtual bool isSameKindAs(const Object* obj) const +
return true if this and obj are of the same kind of object +

+ + +

ovirtual const char* className() const +
return the name of the node's class type +

+ + +

ovirtual const Type getType() const +

+ + +

ovirtual void setStateSetModes(StateSet& ds, const GLModeValue value) const +

+ + +

ovoid setClipPlane(const Vec4& plane) +
Set the clip plane, using a Vec4 to define plane. +

+ + +

ovoid setClipPlane(const Plane& plane) +
Set the clip plane, using a Plane to define plane. +

+ + +

ovoid setClipPlane(const double* plane) +
Set the clip plane, using a double[4] to define plane. +

+ + +

ovoid getClipPlane(Vec4& plane) const +
Get the clip plane, values entered into a Vec4 passed to the getClipPlane. +

+ + +

ovoid getClipPlane(Plane& plane) const +
Get the clip plane, values entered into a Plane passed to the getClipPlane. +

+ + +

ovoid getClipPlane(double* plane) const +
Get the clip plane, values entered into a double[4] passed to the getClipPlane. +

+ + +

ovoid setClipPlaneNum(const unsigned int num) +
Set the clip plane number. +

+ + +

oconst unsigned int getClipPlaneNum() const +
Get the clip plane number. +

+ + +

ovirtual void apply(State& state) const +
Apply the clip plane's state to the OpenGL state machine. +

+ + +

ovirtual ~ClipPlane() +

+ + +

odouble* _clipPlane +

+ + +

ounsigned int _clipPlaneNum +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/ClippingVolume.html b/doc/doc++/osg/ClippingVolume.html new file mode 100644 index 000000000..4ab30379d --- /dev/null +++ b/doc/doc++/osg/ClippingVolume.html @@ -0,0 +1,189 @@ + + + + + class SG_EXPORT osg::ClippingVolume + + + + +

class SG_EXPORT osg::ClippingVolume

A ClippingVolume class for represecting convex clipping volumes made up
+
+ +
+

+

Public Methods

+[more]typedef std::vector<osg::Plane>inline PlaneList ClippingVolume() +
+[more]inline ClippingVolume(const ClippingVolume& cv) +
+[more]inline ClippingVolume(const PlaneList& pl) +
+[more]inline ~ClippingVolume() +
+[more]inline void clear() +
+[more]inline ClippingVolume& operator = (const ClippingVolume& cv) +
+[more]inline void set(const ClippingVolume& cs) +
+[more]inline void set(const PlaneList& pl) +
+[more]inline void add(const osg::Plane& pl) +
+[more]inline PlaneList& getPlaneList() +
+[more]inline const PlaneList& getPlaneList() const +
+[more]inline void setupMask() +
+[more]inline const bool contains(const osg::Vec3& v) const +
Check whether a vertex is contained with clipping set +
+[more]inline const bool contains(const osg::BoundingSphere& bs, unsigned int& mask) const +
Check whether any part of a bounding sphere is contained within clipping set. +
+[more]inline const bool contains(const osg::BoundingSphere& bs) const +
Check whether any part of a bounding sphere is contained within clipping set +
+[more]inline const bool contains(const osg::BoundingBox& bb, unsigned int& mask) const +
Check whether any part of a bounding box is contained within clipping set. +
+[more]inline const bool contains(const osg::BoundingBox& bb) const +
Check whether any part of a bounding box is contained within clipping set +
+[more]inline void transform(const osg::Matrix& matrix) +
Transform the clipping set by matrix. +
+[more]inline void transformProvidingInverse(const osg::Matrix& matrix) +
Transform the clipping set by provide a pre inverted matrix. +

+ +

+

Protected Fields

+[more]unsigned int _localMask +
+[more]PlaneList _planeList +

+ +
+ + +
+

Documentation

+
A ClippingVolume class for represecting convex clipping volumes made up
+
+ + + +
otypedef std::vector<osg::Plane>inline PlaneList ClippingVolume() +

+ + +

oinline ClippingVolume(const ClippingVolume& cv) +

+ + +

oinline ClippingVolume(const PlaneList& pl) +

+ + +

oinline ~ClippingVolume() +

+ + +

oinline void clear() +

+ + +

oinline ClippingVolume& operator = (const ClippingVolume& cv) +

+ + +

oinline void set(const ClippingVolume& cs) +

+ + +

oinline void set(const PlaneList& pl) +

+ + +

oinline void add(const osg::Plane& pl) +

+ + +

oinline PlaneList& getPlaneList() +

+ + +

oinline const PlaneList& getPlaneList() const +

+ + +

oinline void setupMask() +

+ + +

oinline const bool contains(const osg::Vec3& v) const +
Check whether a vertex is contained with clipping set +

+ + +

oinline const bool contains(const osg::BoundingSphere& bs, unsigned int& mask) const +
Check whether any part of a bounding sphere is contained within clipping set. +Using a mask to determine which planes should be used for the check, and +modifying the mask to turn off planes which wouldn't contribute to clipping +of any internal objects. This feature is used in osgUtil::CullVisitor +to prevent redundent plane checking. +

+ + +

oinline const bool contains(const osg::BoundingSphere& bs) const +
Check whether any part of a bounding sphere is contained within clipping set +

+ + +

oinline const bool contains(const osg::BoundingBox& bb, unsigned int& mask) const +
Check whether any part of a bounding box is contained within clipping set. +Using a mask to determine which planes should be used for the check, and +modifying the mask to turn off planes which wouldn't contribute to clipping +of any internal objects. This feature is used in osgUtil::CullVisitor +to prevent redundent plane checking. +

+ + +

oinline const bool contains(const osg::BoundingBox& bb) const +
Check whether any part of a bounding box is contained within clipping set +

+ + +

oinline void transform(const osg::Matrix& matrix) +
Transform the clipping set by matrix. Note, this operations carries out +the calculation of the inverse of the matrix since to transforms +planes must be multiplied my the inverse transposed. This +make this operation expensive. If the inverse has been already +calculated elsewhere then use transformProvidingInverse() instead. +See http://www.worldserver.com/turk/computergraphics/NormalTransformations.pdf +

+ + +

oinline void transformProvidingInverse(const osg::Matrix& matrix) +
Transform the clipping set by provide a pre inverted matrix. +see transform for details. +

+ + +

ounsigned int _localMask +

+ + +

oPlaneList _planeList +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/ColorMask.html b/doc/doc++/osg/ColorMask.html new file mode 100644 index 000000000..0ee21e77f --- /dev/null +++ b/doc/doc++/osg/ColorMask.html @@ -0,0 +1,189 @@ + + + + + class SG_EXPORT osg::ColorMask + + + + +

class SG_EXPORT osg::ColorMask

Encapsulte OpenGL glColorMaskFunc/Op/Mask functions
+
+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Methods

+[more] ColorMask() +
+[more]virtual bool isSameKindAs(const Object* obj) const +
+[more]virtual Object* clone() const +
+[more]virtual const char* className() const +
+[more]virtual const Type getType() const +
+[more]inline void setMask(bool red, bool green, bool blue, bool alpha) +
+[more]inline const bool getRedMask() const +
+[more]inline const bool getGreenMask() const +
+[more]inline const bool getBlueMask() const +
+[more]inline const bool getAlphaMask() const +
+[more]virtual void apply(State& state) const +

+ +

+

Protected Fields

+[more]bool _red +
+[more]bool _green +
+[more]bool _blue +
+[more]bool _alpha +

+ +

+

Protected Methods

+[more]virtual ~ColorMask() +

+ +
+

Inherited from StateAttribute:

+
+

+

Public Methods

+ovirtual void setStateSetModes(StateSet&, const GLModeValue) const +
+ovirtual void compile(State&) const +

+ +

+

Public Members

+otypedef GLenum GLMode +
+otypedef unsigned int GLModeValue +
+otypedef unsigned int OverrideValue +
+oenum Values +
+oenum Type +

+ +
+

Inherited from Object:

+
+
+

Inherited from Referenced:

+
+

+

Public Methods

+oinline Referenced& operator = (Referenced&) +
+oinline void ref() const +
+oinline void unref() const +
+oinline const int referenceCount() const +

+ +

+

Protected Fields

+omutable int _refCount +

+ +
+ + +
+

Documentation

+
Encapsulte OpenGL glColorMaskFunc/Op/Mask functions
+
+ + + +
o ColorMask() +

+ + +

ovirtual bool isSameKindAs(const Object* obj) const +

+ + +

ovirtual Object* clone() const +

+ + +

ovirtual const char* className() const +

+ + +

ovirtual const Type getType() const +

+ + +

oinline void setMask(bool red, bool green, bool blue, bool alpha) +

+ + +

oinline const bool getRedMask() const +

+ + +

oinline const bool getGreenMask() const +

+ + +

oinline const bool getBlueMask() const +

+ + +

oinline const bool getAlphaMask() const +

+ + +

ovirtual void apply(State& state) const +

+ + +

ovirtual ~ColorMask() +

+ + +

obool _red +

+ + +

obool _green +

+ + +

obool _blue +

+ + +

obool _alpha +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/CullFace.html b/doc/doc++/osg/CullFace.html new file mode 100644 index 000000000..b98d9b15c --- /dev/null +++ b/doc/doc++/osg/CullFace.html @@ -0,0 +1,180 @@ + + + + + class SG_EXPORT osg::CullFace + + + + +

class SG_EXPORT osg::CullFace

Class to globally enable/disable OpenGL's polygon culling mode=
+
+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Methods

+[more] CullFace() +
+[more]virtual bool isSameKindAs(const Object* obj) const +
+[more]virtual Object* clone() const +
+[more]virtual const char* className() const +
+[more]virtual const Type getType() const +
+[more]virtual void setStateSetModes(StateSet& ds, const GLModeValue value) const +
+[more]inline void setMode(const Mode mode) +
+[more]inline const Mode getMode() const +
+[more]virtual void apply(State& state) const +

+ +

+

Public Members

+[more]enum Mode +

+ +

+

Protected Fields

+[more]Mode _mode +

+ +

+

Protected Methods

+[more]virtual ~CullFace() +

+ +
+

Inherited from StateAttribute:

+
+

+

Public Methods

+ovirtual void compile(State&) const +

+ +

+

Public Members

+otypedef GLenum GLMode +
+otypedef unsigned int GLModeValue +
+otypedef unsigned int OverrideValue +
+oenum Values +
+oenum Type +

+ +
+

Inherited from Object:

+
+
+

Inherited from Referenced:

+
+

+

Public Methods

+oinline Referenced& operator = (Referenced&) +
+oinline void ref() const +
+oinline void unref() const +
+oinline const int referenceCount() const +

+ +

+

Protected Fields

+omutable int _refCount +

+ +
+ + +
+

Documentation

+
Class to globally enable/disable OpenGL's polygon culling mode=
+
+ + + +
o CullFace() +

+ + +

ovirtual bool isSameKindAs(const Object* obj) const +

+ + +

ovirtual Object* clone() const +

+ + +

ovirtual const char* className() const +

+ + +

ovirtual const Type getType() const +

+ + +

ovirtual void setStateSetModes(StateSet& ds, const GLModeValue value) const +

+ + +

oenum Mode +

+ + + +
o FRONT +

+ + +

o BACK +

+ + +

o FRONT_AND_BACK +

+ + + +
oinline void setMode(const Mode mode) +

+ + +

oinline const Mode getMode() const +

+ + +

ovirtual void apply(State& state) const +

+ + +

ovirtual ~CullFace() +

+ + +

oMode _mode +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/Depth.html b/doc/doc++/osg/Depth.html new file mode 100644 index 000000000..478b3d6c1 --- /dev/null +++ b/doc/doc++/osg/Depth.html @@ -0,0 +1,248 @@ + + + + + class SG_EXPORT osg::Depth + + + + +

class SG_EXPORT osg::Depth

Encapsulte OpenGL glDepthFunc/Mask/Range functions
+
+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Methods

+[more] Depth() +
+[more]virtual bool isSameKindAs(const Object* obj) const +
+[more]virtual Object* clone() const +
+[more]virtual const char* className() const +
+[more]virtual const Type getType() const +
+[more]virtual void setStateSetModes(StateSet& ds, const GLModeValue value) const +
+[more]inline void setFunction(const Function func) +
+[more]inline const Function getFunction() const +
+[more]inline void setWriteMask(const bool mask) +
+[more]inline const bool getWriteMask() const +
+[more]inline void setRange(const double zNear, const double zFar) +
+[more]inline const double getZNear() const +
+[more]inline const double getZFar() const +
+[more]virtual void apply(State& state) const +

+ +

+

Public Members

+[more]enum Function +

+ +

+

Protected Fields

+[more]Function _func +
+[more]bool _depthWriteMask +
+[more]double _zNear +
+[more]double _zFar +

+ +

+

Protected Methods

+[more]virtual ~Depth() +

+ +
+

Inherited from StateAttribute:

+
+

+

Public Methods

+ovirtual void compile(State&) const +

+ +

+

Public Members

+otypedef GLenum GLMode +
+otypedef unsigned int GLModeValue +
+otypedef unsigned int OverrideValue +
+oenum Values +
+oenum Type +

+ +
+

Inherited from Object:

+
+
+

Inherited from Referenced:

+
+

+

Public Methods

+oinline Referenced& operator = (Referenced&) +
+oinline void ref() const +
+oinline void unref() const +
+oinline const int referenceCount() const +

+ +

+

Protected Fields

+omutable int _refCount +

+ +
+ + +
+

Documentation

+
Encapsulte OpenGL glDepthFunc/Mask/Range functions
+
+ + + +
o Depth() +

+ + +

ovirtual bool isSameKindAs(const Object* obj) const +

+ + +

ovirtual Object* clone() const +

+ + +

ovirtual const char* className() const +

+ + +

ovirtual const Type getType() const +

+ + +

ovirtual void setStateSetModes(StateSet& ds, const GLModeValue value) const +

+ + +

oenum Function +

+ + + +
o NEVER +

+ + +

o LESS +

+ + +

o EQUAL +

+ + +

o LEQUAL +

+ + +

o GREATER +

+ + +

o NOTEQUAL +

+ + +

o GEQUAL +

+ + +

o ALWAYS +

+ + + +
oinline void setFunction(const Function func) +

+ + +

oinline const Function getFunction() const +

+ + +

oinline void setWriteMask(const bool mask) +

+ + +

oinline const bool getWriteMask() const +

+ + +

oinline void setRange(const double zNear, const double zFar) +

+ + +

oinline const double getZNear() const +

+ + +

oinline const double getZFar() const +

+ + +

ovirtual void apply(State& state) const +

+ + +

ovirtual ~Depth() +

+ + +

oFunction _func +

+ + +

obool _depthWriteMask +

+ + +

odouble _zNear +

+ + +

odouble _zFar +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/Drawable.html b/doc/doc++/osg/Drawable.html new file mode 100644 index 000000000..58d49f657 --- /dev/null +++ b/doc/doc++/osg/Drawable.html @@ -0,0 +1,312 @@ + + + + + class SG_EXPORT osg::Drawable + + + + +

class SG_EXPORT osg::Drawable

Pure virtual base class for drawable Geomtery.
+
+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Methods

+[more] Drawable() +
+[more]virtual bool isSameKindAs(const Object* obj) const +
+[more]virtual const char* className() const +
+[more]inline void setStateSet(StateSet* state) +
Set the StateSet attached to the Drawable. +
+[more]inline StateSet* getStateSet() +
Get the attached StateSet +
+[more]inline const StateSet* getStateSet() const +
Get the attached const StateSet +
+[more]void setSupportsDisplayList(const bool flag) +
Set the drawable to it can or cannot be used inconjunction with OpenGL display lists. +
+[more]inline const bool getSupportsDisplayList() const +
Get whether display lists are supportd for this drawable instance +
+[more]void setUseDisplayList(const bool flag) +
When set to true, force the draw method to use OpenGL Display List for rendering. +
+[more]inline const bool getUseDisplayList() const +
Return whether OpenGL display lists are being used for rendering +
+[more]void dirtyDisplayList() +
Force a recompile on next draw() of any OpenGL display list associated with this geoset +
+[more]inline void dirtyBound() +
+[more]inline const BoundingBox& getBound() const +
get bounding box of geoset. +
+[more]inline void draw(State& state) +
draw OpenGL primitives. +
+[more]void compile(State& state) +
Immediately compile this drawable into an OpenGL Display List. +
+[more]virtual void drawImmediateMode(State& state) = 0 +
draw directly ignoring an OpenGL display list which could be attached. +
+[more]static void deleteDisplayList(uint contextID, uint globj) +
use deleteDisplayList instead of glDeleteList to allow OpenGL display list to cached until they can be deleted by the OpenGL context in which they were created, specified by contextID +
+[more]static void flushDeletedDisplayLists(uint contextID) +
flush all the cached display list which need to be deleted in the OpenGL context related to contextID +

+ +

+

Protected Fields

+[more]ref_ptr<StateSet> _dstate +
+[more]bool _supportsDisplayList +
+[more]bool _useDisplayList +
+[more]mutable BoundingBox _bbox +
+[more]mutable bool _bbox_computed +

+ +

+

Protected Methods

+[more] Drawable(const Drawable&) +
+[more]Drawable& operator = (const Drawable&) +
+[more]virtual ~Drawable() +
+[more]virtual const bool computeBound() const = 0 +
compute the bounding box of the drawable. +

+ +

+

Protected Members

+[more]typedef std::vector<uint> GLObjectList mutable GLObjectList _globjList +
+[more]typedef std::map<uint,std::set<uint> >static DeletedDisplayListCache DeletedDisplayListCache s_deletedDisplayListCache +

+ +
+

Inherited from Object:

+
+

+

Public Methods

+ovirtual Object* clone() const +

+ +
+

Inherited from Referenced:

+
+

+

Public Methods

+oinline void ref() const +
+oinline void unref() const +
+oinline const int referenceCount() const +

+ +

+

Protected Fields

+omutable int _refCount +

+ +
+ + +
+

Documentation

+
Pure virtual base class for drawable Geomtery. Contains no drawing primitives +directly, these are provided by subclasses such as GeoSet. State attributes +for a Drawable are maintained in StateSet which the Drawable maintains +a referenced counted pointer to. Both Drawable's and StateSet's can +be shared for optimal memory usage and graphics performance.
+
+ + + +
o Drawable() +

+ + +

ovirtual bool isSameKindAs(const Object* obj) const +

+ + +

ovirtual const char* className() const +

+ + +

oinline void setStateSet(StateSet* state) +
Set the StateSet attached to the Drawable. +Previously attached StateSet are automatically unreferenced on +assignment of a new drawstate. +

+ + +

oinline StateSet* getStateSet() +
Get the attached StateSet +

+ + +

oinline const StateSet* getStateSet() const +
Get the attached const StateSet +

+ + +

ovoid setSupportsDisplayList(const bool flag) +
Set the drawable to it can or cannot be used inconjunction with OpenGL +display lists. With set to true, calls to Drawable::setUseDisplayList, +whereas when set to false, no display lists can be created and calls +to setUseDisplayList are ignored, and a warning is produced. The later +is typically used to guard against the switching on of display lists +on objects with dynamic internal data such as continuous Level of Detail +algorithms. +

+ + +

oinline const bool getSupportsDisplayList() const +
Get whether display lists are supportd for this drawable instance +

+ + +

ovoid setUseDisplayList(const bool flag) +
When set to true, force the draw method to use OpenGL Display List for rendering. +If false rendering directly. If the display list has not been already +compile the next call to draw will automatically create the display list. +

+ + +

oinline const bool getUseDisplayList() const +
Return whether OpenGL display lists are being used for rendering +

+ + +

ovoid dirtyDisplayList() +
Force a recompile on next draw() of any OpenGL display list associated with this geoset +

+ + +

oinline void dirtyBound() +

+ + +

oinline const BoundingBox& getBound() const +
get bounding box of geoset. +Note, now made virtual to make it possible to implement user-drawn +objects albeit so what crudely, to be improved later. +

+ + +

oinline void draw(State& state) +
draw OpenGL primitives. +If the drawable has _useDisplayList set to true then use an OpenGL display +list, automatically compiling one if required. +Otherwise call drawImmediateMode(). +Note, draw method should not be overriden in subclasses as it +manages the optional display list. +

+ + +

ovoid compile(State& state) +
Immediately compile this drawable into an OpenGL Display List. +Note, operation is ignored if _useDisplayList to false. +

+ + +

ovirtual void drawImmediateMode(State& state) = 0 +
draw directly ignoring an OpenGL display list which could be attached. +This is the internal draw method which does the drawing itself, +and is the method to override when deriving from Drawable. +

+ + +

ostatic void deleteDisplayList(uint contextID, uint globj) +
use deleteDisplayList instead of glDeleteList to allow +OpenGL display list to cached until they can be deleted +by the OpenGL context in which they were created, specified +by contextID +

+ + +

ostatic void flushDeletedDisplayLists(uint contextID) +
flush all the cached display list which need to be deleted +in the OpenGL context related to contextID +

+ + +

o Drawable(const Drawable&) +

+ + +

oDrawable& operator = (const Drawable&) +

+ + +

ovirtual ~Drawable() +

+ + +

ovirtual const bool computeBound() const = 0 +
compute the bounding box of the drawable. Method must be +implementated by subclasses. +

+ + +

oref_ptr<StateSet> _dstate +

+ + +

obool _supportsDisplayList +

+ + +

obool _useDisplayList +

+ + +

otypedef std::vector<uint> GLObjectList mutable GLObjectList _globjList +

+ + +

omutable BoundingBox _bbox +

+ + +

omutable bool _bbox_computed +

+ + +

otypedef std::map<uint,std::set<uint> >static DeletedDisplayListCache DeletedDisplayListCache s_deletedDisplayListCache +

+
+
Direct child classes: +
ImpostorSprite
+GeoSet
+
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/Fog.html b/doc/doc++/osg/Fog.html new file mode 100644 index 000000000..349d1f617 --- /dev/null +++ b/doc/doc++/osg/Fog.html @@ -0,0 +1,252 @@ + + + + + class SG_EXPORT osg::Fog + + + + +

class SG_EXPORT osg::Fog

Fog - encapsulates OpenGL fog state.
+
+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Methods

+[more] Fog() +
+[more]virtual Object* clone() const +
+[more]virtual bool isSameKindAs(const Object* obj) const +
+[more]virtual const char* className() const +
+[more]virtual const Type getType() const +
+[more]virtual void setStateSetModes(StateSet& ds, const GLModeValue value) const +
+[more]inline void setMode( const Mode mode ) +
+[more]inline Mode getMode() const +
+[more]inline void setDensity( const float density ) +
+[more]inline const float getDensity() const +
+[more]inline void setStart( const float start ) +
+[more]inline const float getStart() const +
+[more]inline void setEnd( const float end ) +
+[more]inline const float getEnd() const +
+[more]inline void setColor( const Vec4 &color ) +
+[more]inline const Vec4& getColor() const +
+[more]virtual void apply(State& state) const +

+ +

+

Public Members

+[more]enum Mode +

+ +

+

Protected Fields

+[more]Mode _mode +
+[more]float _density +
+[more]float _start +
+[more]float _end +
+[more]Vec4 _color +

+ +

+

Protected Methods

+[more]virtual ~Fog() +

+ +
+

Inherited from StateAttribute:

+
+

+

Public Methods

+ovirtual void compile(State&) const +

+ +

+

Public Members

+otypedef GLenum GLMode +
+otypedef unsigned int GLModeValue +
+otypedef unsigned int OverrideValue +
+oenum Values +
+oenum Type +

+ +
+

Inherited from Object:

+
+
+

Inherited from Referenced:

+
+

+

Public Methods

+oinline Referenced& operator = (Referenced&) +
+oinline void ref() const +
+oinline void unref() const +
+oinline const int referenceCount() const +

+ +

+

Protected Fields

+omutable int _refCount +

+ +
+ + +
+

Documentation

+
Fog - encapsulates OpenGL fog state.
+
+ + + +
o Fog() +

+ + +

ovirtual Object* clone() const +

+ + +

ovirtual bool isSameKindAs(const Object* obj) const +

+ + +

ovirtual const char* className() const +

+ + +

ovirtual const Type getType() const +

+ + +

ovirtual void setStateSetModes(StateSet& ds, const GLModeValue value) const +

+ + +

oenum Mode +

+ + + +
o LINEAR +

+ + +

o EXP +

+ + +

o EXP2 +

+ + + +
oinline void setMode( const Mode mode ) +

+ + +

oinline Mode getMode() const +

+ + +

oinline void setDensity( const float density ) +

+ + +

oinline const float getDensity() const +

+ + +

oinline void setStart( const float start ) +

+ + +

oinline const float getStart() const +

+ + +

oinline void setEnd( const float end ) +

+ + +

oinline const float getEnd() const +

+ + +

oinline void setColor( const Vec4 &color ) +

+ + +

oinline const Vec4& getColor() const +

+ + +

ovirtual void apply(State& state) const +

+ + +

ovirtual ~Fog() +

+ + +

oMode _mode +

+ + +

ofloat _density +

+ + +

ofloat _start +

+ + +

ofloat _end +

+ + +

oVec4 _color +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/FrontFace.html b/doc/doc++/osg/FrontFace.html new file mode 100644 index 000000000..838238b06 --- /dev/null +++ b/doc/doc++/osg/FrontFace.html @@ -0,0 +1,172 @@ + + + + + class SG_EXPORT osg::FrontFace + + + + +

class SG_EXPORT osg::FrontFace

Class to specifies the orientation of front-facing polygons
+
+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Methods

+[more] FrontFace() +
+[more]virtual bool isSameKindAs(const Object* obj) const +
+[more]virtual Object* clone() const +
+[more]virtual const char* className() const +
+[more]virtual const Type getType() const +
+[more]inline void setMode(const Mode mode) +
+[more]inline const Mode getMode() const +
+[more]virtual void apply(State& state) const +

+ +

+

Public Members

+[more]enum Mode +

+ +

+

Protected Fields

+[more]Mode _mode +

+ +

+

Protected Methods

+[more]virtual ~FrontFace() +

+ +
+

Inherited from StateAttribute:

+
+

+

Public Methods

+ovirtual void setStateSetModes(StateSet&, const GLModeValue) const +
+ovirtual void compile(State&) const +

+ +

+

Public Members

+otypedef GLenum GLMode +
+otypedef unsigned int GLModeValue +
+otypedef unsigned int OverrideValue +
+oenum Values +
+oenum Type +

+ +
+

Inherited from Object:

+
+
+

Inherited from Referenced:

+
+

+

Public Methods

+oinline Referenced& operator = (Referenced&) +
+oinline void ref() const +
+oinline void unref() const +
+oinline const int referenceCount() const +

+ +

+

Protected Fields

+omutable int _refCount +

+ +
+ + +
+

Documentation

+
Class to specifies the orientation of front-facing polygons
+
+ + + +
o FrontFace() +

+ + +

ovirtual bool isSameKindAs(const Object* obj) const +

+ + +

ovirtual Object* clone() const +

+ + +

ovirtual const char* className() const +

+ + +

ovirtual const Type getType() const +

+ + +

oenum Mode +

+ + + +
o CLOCKWISE +

+ + +

o COUNTER_CLOCKWISE +

+ + + +
oinline void setMode(const Mode mode) +

+ + +

oinline const Mode getMode() const +

+ + +

ovirtual void apply(State& state) const +

+ + +

ovirtual ~FrontFace() +

+ + +

oMode _mode +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/General.html b/doc/doc++/osg/General.html new file mode 100644 index 000000000..49865c489 --- /dev/null +++ b/doc/doc++/osg/General.html @@ -0,0 +1,283 @@ + + + + + General Bits + + + + +
+
+ +o#define +OSG_ALPHAFUNC
+ +o#define +OSG_BILLBOARD
+ +o#define +OSG_BOUNDINGBOX
+ +o#define +OSG_BOUNDINGSPHERE
+ +o#define +OSG_BOUNDSCHECKING
+ +o#define +OSG_CAMERA
+ +o#define +OSG_CLIPPINGVOLUME
+ +o#define +OSG_CLIPPLANE
+ +o#define +OSG_COLORMASK
+ +o#define +OSG_CULLFACE
+ +o#define +OSG_DEPTH
+ +o#define +OSG_DRAWABLE
+ +o#define +OSG_EXPORT
+ +o#define +SG_EXPORT(dllexport)
+ +o#define +SG_EXPORT(dllimport)
+ +o#define +SG_EXPORT
+ +o#define +NULL
+ +o#define +NULL((void *)
+ +o#define +OSG_FOG
+ +o#define +OSG_FRONTFACE
+ +o#define +OSG_GEODE
+ +o#define +OSG_GEOSET
+ +o#define +OSG_GL
+ +o#define +WIN32_LEAN_AND_MEAN
+ +o#define +GLUT_APIENTRY_DEFINED
+ +o#define +APIENTRY
+ +o#define +CALLBACK
+ +o#define +GLUT_WINGDIAPI_DEFINED
+ +o#define +WINGDIAPI(dllimport)
+ +o#define +OSG_GLEXTENSIONS
+ +o#define +OSG_GROUP
+ +o#define +OSG_IMAGE
+ +o#define +OSG_IMPOSTOR
+ +o#define +OSG_ImpostorSprite
+ +o#define +OSG_LIGHT
+ +o#define +OSG_LIGHTSOURCE
+ +o#define +OSG_LINESEGMENT
+ +o#define +OSG_LOD
+ +o#define +OSG_MATERIAL
+ +o#define +OSG_MATRIX
+ +o#define +OSG_MEMORYADAPTER
+ +o#define +OSG_MEM_PTR
+ +o#define +OSG_NODE
+ +o#define +OSG_NODEVISITOR
+ +o#define +OSG_NOTIFY
+ +o#define +OSG_OBJECT
+ +o#define +OSG_PLANE
+ +o#define +OSG_POINT
+ +o#define +OSG_POLYGONMODE
+ +o#define +OSG_POLYGONOFFSET
+ +o#define +OSG_QUAT
+ +o#define +OSG_REFERENCED
+ +o#define +OSG_REF_PTR
+ +o#define +OSG_STATE
+ +o#define +OSG_STATEATTRIBUTE
+ +o#define +OSG_STATESET
+ +o#define +OSG_STENCIL
+ +o#define +OSG_SWITCH
+ +o#define +OSG_TEXENV
+ +o#define +OSG_TEXGEN
+ +o#define +OSG_TEXMAT
+ +o#define +OSG_TEXTURE
+ +o#define +GL_TEXTURE_MAX_ANISOTROPY_EXT(GLenum)
+ +o#define +GL_COMPRESSED_ALPHA_ARB
+ +o#define +GL_COMPRESSED_LUMINANCE_ARB
+ +o#define +GL_COMPRESSED_LUMINANCE_ALPHA_ARB
+ +o#define +GL_COMPRESSED_INTENSITY_ARB
+ +o#define +GL_COMPRESSED_RGB_ARB
+ +o#define +GL_COMPRESSED_RGBA_ARB
+ +o#define +GL_TEXTURE_COMPRESSION_HINT_ARB
+ +o#define +GL_TEXTURE_IMAGE_SIZE_ARB
+ +o#define +GL_TEXTURE_COMPRESSED_ARB
+ +o#define +GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB
+ +o#define +GL_COMPRESSED_TEXTURE_FORMATS_ARB
+ +o#define +GL_COMPRESSED_RGB_S3TC_DXT1_EXT
+ +o#define +GL_COMPRESSED_RGBA_S3TC_DXT1_EXT
+ +o#define +GL_COMPRESSED_RGBA_S3TC_DXT3_EXT
+ +o#define +GL_COMPRESSED_RGBA_S3TC_DXT5_EXT
+ +o#define +GL_MIRRORED_REPEAT_IBM
+ +o#define +GL_GENERATE_MIPMAP_SGIS(GLenum)
+ +o#define +GL_GENERATE_MIPMAP_HINT_SGIS
+ +o#define +OSG_TIMER
+ +o#define +OSG_TRANSFORM
+ +o#define +OSG_TRANSPARENCY
+ +o#define +OSG_TYPES
+ +o#define +OSG_VEC2
+ +o#define +OSG_VEC3
+ +o#define +OSG_VEC4
+ +o#define +OSG_VERSION
+

Alphabetic index Hierarchy of classes


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/GeoSet.html b/doc/doc++/osg/GeoSet.html new file mode 100644 index 000000000..ca65a2c6a --- /dev/null +++ b/doc/doc++/osg/GeoSet.html @@ -0,0 +1,1096 @@ + + + + + class SG_EXPORT osg::GeoSet + + + + +

class SG_EXPORT osg::GeoSet

Encapsulates OpenGL drawing primitives, geometry and optional binding of normal, color and texture coordinates.
+
+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Methods

+[more] GeoSet() +
+[more]virtual Object* clone() const +
+[more]virtual bool isSameKindAs(const Object* obj) const +
+[more]virtual const char* className() const +
+[more]inline void setNumPrims( const int n ) +
+[more]inline const int getNumPrims() const +
+[more]void setPrimType( const PrimitiveType type ) +
+[more]inline const PrimitiveType getPrimType() const +
+[more]inline void setPrimLengths( int* lens ) +
+[more]inline int* getPrimLengths() +
+[more]inline const int* getPrimLengths() const +
+[more]void computeNumVerts() +
+[more]inline const int getNumCoords() const +
get the number of coords required by the defined primitives. +
+[more]inline Vec3* getCoords() +
get a pointer to Vec3 coord array. +
+[more]inline const Vec3* getCoords() const +
get a const pointer to Vec3 coord array. +
+[more]inline const int getNumCoordIndices() const +
get the number of indices required by the defined primitives. +
+[more]inline IndexPointer& getCoordIndices() +
get the coord index array. +
+[more]inline const IndexPointer& getCoordIndices() const +
get the const coord index array. +
+[more]void setCoords( Vec3* cp ) +
set the coords (ie the geometry) of the geoset +
+[more]void setCoords( Vec3* cp, ushort* ci ) +
set the coords (ie the geometry) and ushort indices of the geoset. +
+[more]void setCoords( Vec3* cp, uint* ci ) +
set the coords (ie the geometry) and uint indices of the geoset. +
+[more]void setCoords( Vec3* cp, IndexPointer& ip ) +
set the coords (ie the geometry) and indices of the geoset +
+[more]inline const int getNumNormals() const +
get the number of normals required by the defined primitives and normals binding +
+[more]inline Vec3* getNormals() +
get a pointer to Vec3 normal array. +
+[more]inline const Vec3* getNormals() const +
get a const pointer to Vec3 normal array. +
+[more]inline int getNumNormalIndices() const +
get the number of normal indices required by the defined primitives and normals binding +
+[more]inline IndexPointer& getNormalIndices() +
get the normal index array. +
+[more]inline const IndexPointer& getNormalIndices() const +
get the const normal index array. +
+[more]void setNormals( Vec3* np ) +
set the normals of the geoset +
+[more]void setNormals( Vec3* np, ushort* ni ) +
set the normals and normal indices of the geoset +
+[more]void setNormals( Vec3* np, uint* ni ) +
set the normals and normal indices of the geoset +
+[more]void setNormals( Vec3* np, IndexPointer& ip ) +
set the normals and normal indices of the geoset +
+[more]void setNormalBinding( const BindingType binding ) +
set the normals binding to the vertices/primitives/overall +
+[more]inline const BindingType getNormalBinding() const +
+[more]inline const int getNumColors() const +
get the number of colors required by the defined primitives and color binding +
+[more]inline Vec4* getColors() +
get a pointer to Vec4 color array. +
+[more]inline const Vec4* getColors() const +
get a pointer to Vec4 color array. +
+[more]inline int getNumColorIndices() const +
get the number of colors indices required by the defined primitives and color binding +
+[more]inline IndexPointer& getColorIndices() +
get the color index array. +
+[more]inline const IndexPointer& getColorIndices() const +
get the const color index array. +
+[more]void setColors( Vec4* cp ) +
set the colors of the geoset +
+[more]void setColors( Vec4* cp, ushort* li ) +
set the colors and color indices of the geoset +
+[more]void setColors( Vec4* cp, uint* li ) +
set the colors and color indices of the geoset +
+[more]void setColors( Vec4* cp, IndexPointer& ip ) +
set the colors and color indices of the geoset +
+[more]void setColorBinding( BindingType binding ) +
set the color binding to the vertices/primitives/overall +
+[more]inline BindingType getColorBinding() const +
+[more]inline const int getNumTextureCoords() const +
get the number of texture coords required by the defined primitives and textures binding +
+[more]inline Vec2* getTextureCoords() +
get a pointer to Vec4 color array. +
+[more]inline const Vec2* getTextureCoords() const +
get a pointer to Vec4 color array. +
+[more]inline const int getNumTextureIndices() const +
get the number of texture coord indices required by the defined primitives and texture binding +
+[more]inline IndexPointer& getTextureIndices() +
get the texture index array. +
+[more]inline const IndexPointer& getTextureIndices() const +
get the texture index array. +
+[more]void setTextureCoords( Vec2* tc ) +
set the texture coords of the geoset +
+[more]void setTextureCoords( Vec2* tc, ushort* ti ) +
set the texture coords and texture coord indices of the geoset +
+[more]void setTextureCoords( Vec2* tc, uint* ti ) +
set the texture coords and texture coord indices of the geoset +
+[more]void setTextureCoords( Vec2* tc, IndexPointer& ip ) +
set the texture coords and texture indices of the geoset +
+[more]void setTextureBinding( const BindingType binding ) +
set the texture coord binding to the vertices/primitives/overall +
+[more]inline const BindingType getTextureBinding() const +
+[more]inline const int getNumInterleavedCoords() const +
get the number of texture coords required by the defined primitives and textures binding +
+[more]inline void* getInterleavedArray() +
get a pointer to interleaved float array. +
+[more]inline const void* getInterleavedArray() const +
get a const pointer to interleaved float array. +
+[more]inline const int getNumIterleavedIndices() const +
get the number of texture coord indices required by the defined primitives and texture binding +
+[more]inline IndexPointer& getInterleavedIndices() +
get the texture index array. +
+[more]inline const IndexPointer& getInterleavedIndices() const +
get the interleaved index array. +
+[more]inline const InterleaveArrayType getInterleavedFromat() const +
get the interleaved array storage format. +
+[more]void setInterleavedArray( const InterleaveArrayType format, float* ia ) +
set the interleaved arrays of the geoset +
+[more]void setInterleavedArray( const InterleaveArrayType format, float* ia, ushort* iai ) +
+[more]void setInterleavedArray( const InterleaveArrayType format, float* ia, uint* iai ) +
+[more]void setInterleavedArray( const InterleaveArrayType format, float* ia, IndexPointer& iai ) +
+[more]virtual void drawImmediateMode(State& state) +
draw geoset directly ignoring an OpenGL display list which could be attached. +
+[more]const bool check() const +

+ +

+

Public Members

+[more]enum PrimitiveType +
+[more]enum BindingType +
+[more]enum InterleaveArrayType +
+[more]struct IndexPointer +

+ +

+

Protected Fields

+[more]int _numprims +
+[more]PrimitiveType _primtype +
+[more]int _needprimlen +
+[more]unsigned int _oglprimtype +
+[more]int* _primLengths +
+[more]unsigned char _primlength +
+[more]unsigned char _flat_shaded_skip +
+[more]int _numcoords +
+[more]Vec3* _coords +
+[more]IndexPointer _cindex +
+[more]BindingType _normal_binding +
+[more]int _numnormals +
+[more]Vec3* _normals +
+[more]IndexPointer _nindex +
+[more]BindingType _color_binding +
+[more]int _numcolors +
+[more]Vec4* _colors +
+[more]IndexPointer _colindex +
+[more]BindingType _texture_binding +
+[more]int _numtcoords +
+[more]Vec2* _tcoords +
+[more]IndexPointer _tindex +
+[more]void* _iarray +
+[more]IndexPointer _iaindex +
+[more]InterleaveArrayType _iaformat +
+[more]unsigned int _ogliaformat +
+[more]int _fast_path +

+ +

+

Protected Methods

+[more] GeoSet(const GeoSet&) +
+[more]GeoSet& operator = (const GeoSet&) +
+[more]virtual ~GeoSet() +
+[more]virtual const bool computeBound() const +
+[more]void set_fast_path( void ) +
+[more]void draw_fast_path( void ) +
+[more]void draw_alternate_path( void ) +

+ +
+

Inherited from Drawable:

+
+

+

Public Methods

+oinline void setStateSet(StateSet* state) +
+oinline StateSet* getStateSet() +
+oinline const StateSet* getStateSet() const +
+ovoid setSupportsDisplayList(const bool flag) +
+oinline const bool getSupportsDisplayList() const +
+ovoid setUseDisplayList(const bool flag) +
+oinline const bool getUseDisplayList() const +
+ovoid dirtyDisplayList() +
+oinline void dirtyBound() +
+oinline const BoundingBox& getBound() const +
+oinline void draw(State& state) +
+ovoid compile(State& state) +
+ostatic void deleteDisplayList(uint contextID, uint globj) +
+ostatic void flushDeletedDisplayLists(uint contextID) +

+ +

+

Protected Fields

+oref_ptr<StateSet> _dstate +
+obool _supportsDisplayList +
+obool _useDisplayList +
+omutable BoundingBox _bbox +
+omutable bool _bbox_computed +

+ +

+

Protected Members

+otypedef std::vector<uint> GLObjectList mutable GLObjectList _globjList +
+otypedef std::map<uint,std::set<uint> >static DeletedDisplayListCache DeletedDisplayListCache s_deletedDisplayListCache +

+ +
+

Inherited from Object:

+
+
+

Inherited from Referenced:

+
+

+

Public Methods

+oinline void ref() const +
+oinline void unref() const +
+oinline const int referenceCount() const +

+ +

+

Protected Fields

+omutable int _refCount +

+ +
+ + +
+

Documentation

+
Encapsulates OpenGL drawing primitives, geometry and +optional binding of normal, color and texture coordinates. Used +for representing the visible objects in the scene. State attributes +for a GeoSet are maintained in StateSet which the GeoSet maintains +a referenced counted pointer to. Both GeoSet's and StateSet's can +be shared for optimal memory usage and graphics performance.
+
+ + + +
oenum PrimitiveType +

+ + + +
o NO_TYPE +

+ + +

o POINTS +

+ + +

o LINES +

+ + +

o LINE_STRIP +

+ + +

o FLAT_LINE_STRIP +

+ + +

o LINE_LOOP +

+ + +

o TRIANGLES +

+ + +

o TRIANGLE_STRIP +

+ + +

o FLAT_TRIANGLE_STRIP +

+ + +

o TRIANGLE_FAN +

+ + +

o FLAT_TRIANGLE_FAN +

+ + +

o QUADS +

+ + +

o QUAD_STRIP +

+ + +

o POLYGON +

+ + + +
oenum BindingType +

+ + + +
o BIND_OFF +

+ + +

o BIND_OVERALL +

+ + +

o BIND_PERPRIM +

+ + +

o BIND_PERVERTEX +

+ + +

o BIND_DEFAULT +

+ + + +
oenum InterleaveArrayType +

+ + + +
o IA_OFF +

+ + +

o IA_V2F +

+ + +

o IA_V3F +

+ + +

o IA_C4UB_V2F +

+ + +

o IA_C4UB_V3F +

+ + +

o IA_C3F_V3F +

+ + +

o IA_N3F_V3F +

+ + +

o IA_C4F_N3F_V3F +

+ + +

o IA_T2F_V3F +

+ + +

o IA_T4F_V4F +

+ + +

o IA_T2F_C4UB_V3F +

+ + +

o IA_T2F_C3F_V3F +

+ + +

o IA_T2F_N3F_V3F +

+ + +

o IA_T2F_C4F_N3F_V3F +

+ + +

o IA_T4F_C4F_N3F_V4F +

+ + + +
ostruct IndexPointer +

+ + + +
ouint _size +

+ + +

obool _is_ushort +

+ + +

ounion +

+ + + +
oushort* _ushort +

+ + +

ouint* _uint +

+ + + +
o IndexPointer() +

+ + +

oinline const bool operator == (const IndexPointer& ip) const +

+ + +

oinline const bool valid() const +

+ + +

oinline const bool null() const +

+ + +

oinline void setToNull() +

+ + +

oinline void set(uint size, ushort* data) +

+ + +

ovoid set(const uint size, uint* data) +

+ + +

oinline const uint maxIndex() const +

+ + +

oinline const uint operator [] (const uint pos) const +

+ + + +
o GeoSet() +

+ + +

ovirtual Object* clone() const +

+ + +

ovirtual bool isSameKindAs(const Object* obj) const +

+ + +

ovirtual const char* className() const +

+ + +

oinline void setNumPrims( const int n ) +

+ + +

oinline const int getNumPrims() const +

+ + +

ovoid setPrimType( const PrimitiveType type ) +

+ + +

oinline const PrimitiveType getPrimType() const +

+ + +

oinline void setPrimLengths( int* lens ) +

+ + +

oinline int* getPrimLengths() +

+ + +

oinline const int* getPrimLengths() const +

+ + +

ovoid computeNumVerts() +

+ + +

oinline const int getNumCoords() const +
get the number of coords required by the defined primitives. +

+ + +

oinline Vec3* getCoords() +
get a pointer to Vec3 coord array. +

+ + +

oinline const Vec3* getCoords() const +
get a const pointer to Vec3 coord array. +

+ + +

oinline const int getNumCoordIndices() const +
get the number of indices required by the defined primitives. +

+ + +

oinline IndexPointer& getCoordIndices() +
get the coord index array. +

+ + +

oinline const IndexPointer& getCoordIndices() const +
get the const coord index array. +

+ + +

ovoid setCoords( Vec3* cp ) +
set the coords (ie the geometry) of the geoset +

+ + +

ovoid setCoords( Vec3* cp, ushort* ci ) +
set the coords (ie the geometry) and ushort indices of the geoset. +To reduce memory footprint and bandwidth for small datasets it is +recommended the ushort undices are used instead of unit indices. +

+ + +

ovoid setCoords( Vec3* cp, uint* ci ) +
set the coords (ie the geometry) and uint indices of the geoset. +Unless your data set exceeds 65536 indices prefer ushort indices +over uint indices, only use this unit indices version if neccessary. +

+ + +

ovoid setCoords( Vec3* cp, IndexPointer& ip ) +
set the coords (ie the geometry) and indices of the geoset +

+ + +

oinline const int getNumNormals() const +
get the number of normals required by the defined primitives and normals binding +

+ + +

oinline Vec3* getNormals() +
get a pointer to Vec3 normal array. +

+ + +

oinline const Vec3* getNormals() const +
get a const pointer to Vec3 normal array. +

+ + +

oinline int getNumNormalIndices() const +
get the number of normal indices required by the defined primitives and normals binding +

+ + +

oinline IndexPointer& getNormalIndices() +
get the normal index array. +

+ + +

oinline const IndexPointer& getNormalIndices() const +
get the const normal index array. +

+ + +

ovoid setNormals( Vec3* np ) +
set the normals of the geoset +

+ + +

ovoid setNormals( Vec3* np, ushort* ni ) +
set the normals and normal indices of the geoset +

+ + +

ovoid setNormals( Vec3* np, uint* ni ) +
set the normals and normal indices of the geoset +

+ + +

ovoid setNormals( Vec3* np, IndexPointer& ip ) +
set the normals and normal indices of the geoset +

+ + +

ovoid setNormalBinding( const BindingType binding ) +
set the normals binding to the vertices/primitives/overall +

+ + +

oinline const BindingType getNormalBinding() const +

+ + +

oinline const int getNumColors() const +
get the number of colors required by the defined primitives and color binding +

+ + +

oinline Vec4* getColors() +
get a pointer to Vec4 color array. +

+ + +

oinline const Vec4* getColors() const +
get a pointer to Vec4 color array. +

+ + +

oinline int getNumColorIndices() const +
get the number of colors indices required by the defined primitives and color binding +

+ + +

oinline IndexPointer& getColorIndices() +
get the color index array. +

+ + +

oinline const IndexPointer& getColorIndices() const +
get the const color index array. +

+ + +

ovoid setColors( Vec4* cp ) +
set the colors of the geoset +

+ + +

ovoid setColors( Vec4* cp, ushort* li ) +
set the colors and color indices of the geoset +

+ + +

ovoid setColors( Vec4* cp, uint* li ) +
set the colors and color indices of the geoset +

+ + +

ovoid setColors( Vec4* cp, IndexPointer& ip ) +
set the colors and color indices of the geoset +

+ + +

ovoid setColorBinding( BindingType binding ) +
set the color binding to the vertices/primitives/overall +

+ + +

oinline BindingType getColorBinding() const +

+ + +

oinline const int getNumTextureCoords() const +
get the number of texture coords required by the defined primitives and textures binding +

+ + +

oinline Vec2* getTextureCoords() +
get a pointer to Vec4 color array. +

+ + +

oinline const Vec2* getTextureCoords() const +
get a pointer to Vec4 color array. +

+ + +

oinline const int getNumTextureIndices() const +
get the number of texture coord indices required by the defined primitives and texture binding +

+ + +

oinline IndexPointer& getTextureIndices() +
get the texture index array. +

+ + +

oinline const IndexPointer& getTextureIndices() const +
get the texture index array. +

+ + +

ovoid setTextureCoords( Vec2* tc ) +
set the texture coords of the geoset +

+ + +

ovoid setTextureCoords( Vec2* tc, ushort* ti ) +
set the texture coords and texture coord indices of the geoset +

+ + +

ovoid setTextureCoords( Vec2* tc, uint* ti ) +
set the texture coords and texture coord indices of the geoset +

+ + +

ovoid setTextureCoords( Vec2* tc, IndexPointer& ip ) +
set the texture coords and texture indices of the geoset +

+ + +

ovoid setTextureBinding( const BindingType binding ) +
set the texture coord binding to the vertices/primitives/overall +

+ + +

oinline const BindingType getTextureBinding() const +

+ + +

oinline const int getNumInterleavedCoords() const +
get the number of texture coords required by the defined primitives and textures binding +

+ + +

oinline void* getInterleavedArray() +
get a pointer to interleaved float array. +

+ + +

oinline const void* getInterleavedArray() const +
get a const pointer to interleaved float array. +

+ + +

oinline const int getNumIterleavedIndices() const +
get the number of texture coord indices required by the defined primitives and texture binding +

+ + +

oinline IndexPointer& getInterleavedIndices() +
get the texture index array. +

+ + +

oinline const IndexPointer& getInterleavedIndices() const +
get the interleaved index array. +

+ + +

oinline const InterleaveArrayType getInterleavedFromat() const +
get the interleaved array storage format. +

+ + +

ovoid setInterleavedArray( const InterleaveArrayType format, float* ia ) +
set the interleaved arrays of the geoset +

+ + +

ovoid setInterleavedArray( const InterleaveArrayType format, float* ia, ushort* iai ) +

+ + +

ovoid setInterleavedArray( const InterleaveArrayType format, float* ia, uint* iai ) +

+ + +

ovoid setInterleavedArray( const InterleaveArrayType format, float* ia, IndexPointer& iai ) +

+ + +

ovirtual void drawImmediateMode(State& state) +
draw geoset directly ignoring an OpenGL display list which could be attached. +This is the internal draw method which does the drawing itself, +and is the method to override when deriving from GeoSet for user-drawn objects. +

+ + +

oconst bool check() const +

+ + +

o GeoSet(const GeoSet&) +

+ + +

oGeoSet& operator = (const GeoSet&) +

+ + +

ovirtual ~GeoSet() +

+ + +

ovirtual const bool computeBound() const +

+ + +

oint _numprims +

+ + +

oPrimitiveType _primtype +

+ + +

oint _needprimlen +

+ + +

ounsigned int _oglprimtype +

+ + +

oint* _primLengths +

+ + +

ounsigned char _primlength +

+ + +

ounsigned char _flat_shaded_skip +

+ + +

oint _numcoords +

+ + +

oVec3* _coords +

+ + +

oIndexPointer _cindex +

+ + +

oBindingType _normal_binding +

+ + +

oint _numnormals +

+ + +

oVec3* _normals +

+ + +

oIndexPointer _nindex +

+ + +

oBindingType _color_binding +

+ + +

oint _numcolors +

+ + +

oVec4* _colors +

+ + +

oIndexPointer _colindex +

+ + +

oBindingType _texture_binding +

+ + +

oint _numtcoords +

+ + +

oVec2* _tcoords +

+ + +

oIndexPointer _tindex +

+ + +

ovoid* _iarray +

+ + +

oIndexPointer _iaindex +

+ + +

oInterleaveArrayType _iaformat +

+ + +

ounsigned int _ogliaformat +

+ + +

oint _fast_path +

+ + +

ovoid set_fast_path( void ) +

+ + +

ovoid draw_fast_path( void ) +

+ + +

ovoid draw_alternate_path( void ) +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/Geode.html b/doc/doc++/osg/Geode.html new file mode 100644 index 000000000..7e145500f --- /dev/null +++ b/doc/doc++/osg/Geode.html @@ -0,0 +1,305 @@ + + + + + class SG_EXPORT osg::Geode + + + + +

class SG_EXPORT osg::Geode

Leaf Node for grouping Drawables
+
+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Methods

+[more]typedef std::vector< ref_ptr<Drawable> > DrawableList Geode() +
+[more]virtual Object* clone() const +
+[more]virtual bool isSameKindAs(const Object* obj) const +
+[more]virtual const char* className() const +
+[more]virtual void accept(NodeVisitor& nv) +
+[more]virtual const bool addDrawable( Drawable* drawable ) +
Add Drawable to Geode. +
+[more]virtual const bool removeDrawable( Drawable* drawable ) +
Remove Drawable from Geode. +
+[more]virtual const bool replaceDrawable( Drawable* origDraw, Drawable* newDraw ) +
Replace specified Drawable with another Drawable. +
+[more]inline const int getNumDrawables() const +
return the number of geoset's +
+[more]inline Drawable* getDrawable( const int i ) +
return geoset at position i +
+[more]inline const Drawable* getDrawable( const int i ) const +
return geoset at position i +
+[more]inline const bool containsDrawable(const Drawable* gset) const +
return true is geoset is contained within Geode +
+[more]inline DrawableList::iterator findDrawable(const Drawable* gset) +
return the iterator postion for specified Drawable. +
+[more]inline DrawableList::const_iterator findDrawable(const Drawable* gset) const +
return the const_iterator postion for specified Drawable. +
+[more]void compileDrawables(State& state) +
complile OpenGL Display List for each geoset +

+ +

+

Protected Fields

+[more]DrawableList _drawables +

+ +

+

Protected Methods

+[more]virtual ~Geode() +
+[more]virtual const bool computeBound() const +

+ +
+

Inherited from Node:

+
+

+

Public Methods

+ovirtual void ascend(NodeVisitor& nv) +
+ovirtual void traverse(NodeVisitor& ) +
+oinline void setName( const std::string& name ) +
+oinline void setName( const char* name ) +
+oinline const std::string& getName() const +
+oinline const ParentList& getParents() const +
+oinline Group* getParent(const int i) +
+oinline const Group* getParent(const int i) const +
+oinline const int getNumParents() const +
+oinline void setUserData(void* data, MemoryAdapter* ma=0L) +
+oinline void* getUserData() +
+oinline const void* getUserData() const +
+oinline MemoryAdapter* getMemoryAdapter() +
+oinline const MemoryAdapter* getMemoryAdapter() const +
+oinline void setNodeMask(const NodeMask nm) +
+oinline const NodeMask getNodeMask() const +
+oinline const DescriptionList& getDescriptions() const +
+oinline DescriptionList& getDescriptions() +
+oinline const std::string& getDescription(const int i) const +
+oinline std::string& getDescription(const int i) +
+oinline const int getNumDescriptions() const +
+ovoid addDescription(const std::string& desc) +
+oinline void setStateSet(osg::StateSet* dstate) +
+oinline osg::StateSet* getStateSet() +
+oinline const osg::StateSet* getStateSet() const +
+oinline const BoundingSphere& getBound() const +
+ovoid dirtyBound() +

+ +

+

Public Members

+otypedef std::vector<Group*> ParentList +
+otypedef std::vector<std::string> DescriptionList +

+ +

+

Protected Fields

+omutable BoundingSphere _bsphere +
+omutable bool _bsphere_computed +
+ostd::string _name +
+oParentList _parents +
+ovoid* _userData +
+oref_ptr<MemoryAdapter> _memoryAdapter +
+oNodeMask _nodeMask +
+oDescriptionList _descriptions +
+oref_ptr<StateSet> _dstate +

+ +
+

Inherited from Object:

+
+
+

Inherited from Referenced:

+
+

+

Public Methods

+oinline Referenced& operator = (Referenced&) +
+oinline void ref() const +
+oinline void unref() const +
+oinline const int referenceCount() const +

+ +

+

Protected Fields

+omutable int _refCount +

+ +
+ + +
+

Documentation

+
Leaf Node for grouping Drawables
+
+ + + +
otypedef std::vector< ref_ptr<Drawable> > DrawableList Geode() +

+ + +

ovirtual Object* clone() const +

+ + +

ovirtual bool isSameKindAs(const Object* obj) const +

+ + +

ovirtual const char* className() const +

+ + +

ovirtual void accept(NodeVisitor& nv) +

+ + +

ovirtual const bool addDrawable( Drawable* drawable ) +
Add Drawable to Geode. +If gset is not NULL and is not contained in Geode then increment its +reference count, add it to the drawables list and dirty the bounding +sphere to force it to recompute on next getBound() and return true for success. +Otherwise return false. +

+ + +

ovirtual const bool removeDrawable( Drawable* drawable ) +
Remove Drawable from Geode. +If gset is contained in Geode then remove it from the geoset +list and decrement its reference count, and dirty the +bounding sphere to force it to recompute on next getBound() and +return true for success. If gset is not found then return false +and do not change the reference count of gset. +

+ + +

ovirtual const bool replaceDrawable( Drawable* origDraw, Drawable* newDraw ) +
Replace specified Drawable with another Drawable. +Decrement the reference count origGSet and increments the +reference count of newGset, and dirty the bounding sphere +to force it to recompute on next getBound() and returns true. +If origDrawable is not found then return false and do not +add newGset. If newGset is NULL then return false and do +not remove origGset. +

+ + +

oinline const int getNumDrawables() const +
return the number of geoset's +

+ + +

oinline Drawable* getDrawable( const int i ) +
return geoset at position i +

+ + +

oinline const Drawable* getDrawable( const int i ) const +
return geoset at position i +

+ + +

oinline const bool containsDrawable(const Drawable* gset) const +
return true is geoset is contained within Geode +

+ + +

oinline DrawableList::iterator findDrawable(const Drawable* gset) +
return the iterator postion for specified Drawable. +return _geoset.end() if gset not is contained in Geode. +

+ + +

oinline DrawableList::const_iterator findDrawable(const Drawable* gset) const +
return the const_iterator postion for specified Drawable. +return _geoset.end() if gset not is contained in Geode. +

+ + +

ovoid compileDrawables(State& state) +
complile OpenGL Display List for each geoset +

+ + +

ovirtual ~Geode() +

+ + +

ovirtual const bool computeBound() const +

+ + +

oDrawableList _drawables +

+
+
Direct child classes: +
Billboard
+
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/Group.html b/doc/doc++/osg/Group.html new file mode 100644 index 000000000..eda54fe27 --- /dev/null +++ b/doc/doc++/osg/Group.html @@ -0,0 +1,305 @@ + + + + + class SG_EXPORT osg::Group + + + + +

class SG_EXPORT osg::Group

General group node which maintains a list of children.
+
+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Methods

+[more]typedef std::vector<ref_ptr<Node> > ChildList Group() +
+[more]virtual Object* clone() const +
+[more]virtual bool isSameKindAs(const Object* obj) const +
+[more]virtual const char* className() const +
+[more]virtual void accept(NodeVisitor& nv) +
+[more]virtual void traverse(NodeVisitor& nv) +
+[more]virtual bool addChild( Node* child ) +
Add Node to Group. +
+[more]virtual bool removeChild( Node* child ) +
Remove Node from Group. +
+[more]virtual bool replaceChild( Node* origChild, Node* newChild ) +
Replace specified Node with another Node. +
+[more]inline const int getNumChildren() const +
return the number of chilren nodes +
+[more]inline Node* getChild( const int i ) +
return child node at position i +
+[more]inline const Node* getChild( const int i ) const +
return child node at position i +
+[more]inline bool containsNode( const Node* node ) const +
return true if node is contained within Group +
+[more]inline ChildList::iterator findNode( const Node* node ) +
return the iterator postion for specified Node. +
+[more]inline ChildList::const_iterator findNode( const Node* node ) const +
return the const_iterator postion for specified Node. +

+ +

+

Protected Fields

+[more]ChildList _children +

+ +

+

Protected Methods

+[more]virtual ~Group() +
+[more]virtual const bool computeBound() const +

+ +
+

Inherited from Node:

+
+

+

Public Methods

+ovirtual void ascend(NodeVisitor& nv) +
+oinline void setName( const std::string& name ) +
+oinline void setName( const char* name ) +
+oinline const std::string& getName() const +
+oinline const ParentList& getParents() const +
+oinline Group* getParent(const int i) +
+oinline const Group* getParent(const int i) const +
+oinline const int getNumParents() const +
+oinline void setUserData(void* data, MemoryAdapter* ma=0L) +
+oinline void* getUserData() +
+oinline const void* getUserData() const +
+oinline MemoryAdapter* getMemoryAdapter() +
+oinline const MemoryAdapter* getMemoryAdapter() const +
+oinline void setNodeMask(const NodeMask nm) +
+oinline const NodeMask getNodeMask() const +
+oinline const DescriptionList& getDescriptions() const +
+oinline DescriptionList& getDescriptions() +
+oinline const std::string& getDescription(const int i) const +
+oinline std::string& getDescription(const int i) +
+oinline const int getNumDescriptions() const +
+ovoid addDescription(const std::string& desc) +
+oinline void setStateSet(osg::StateSet* dstate) +
+oinline osg::StateSet* getStateSet() +
+oinline const osg::StateSet* getStateSet() const +
+oinline const BoundingSphere& getBound() const +
+ovoid dirtyBound() +

+ +

+

Public Members

+otypedef std::vector<Group*> ParentList +
+otypedef std::vector<std::string> DescriptionList +

+ +

+

Protected Fields

+omutable BoundingSphere _bsphere +
+omutable bool _bsphere_computed +
+ostd::string _name +
+oParentList _parents +
+ovoid* _userData +
+oref_ptr<MemoryAdapter> _memoryAdapter +
+oNodeMask _nodeMask +
+oDescriptionList _descriptions +
+oref_ptr<StateSet> _dstate +

+ +
+

Inherited from Object:

+
+
+

Inherited from Referenced:

+
+

+

Public Methods

+oinline Referenced& operator = (Referenced&) +
+oinline void ref() const +
+oinline void unref() const +
+oinline const int referenceCount() const +

+ +

+

Protected Fields

+omutable int _refCount +

+ +
+ + +
+

Documentation

+
General group node which maintains a list of children. +Children are reference counted. This allows children to be shared +with memory management handled automatically via osg::Referenced.
+
+ + + +
otypedef std::vector<ref_ptr<Node> > ChildList Group() +

+ + +

ovirtual Object* clone() const +

+ + +

ovirtual bool isSameKindAs(const Object* obj) const +

+ + +

ovirtual const char* className() const +

+ + +

ovirtual void accept(NodeVisitor& nv) +

+ + +

ovirtual void traverse(NodeVisitor& nv) +

+ + +

ovirtual bool addChild( Node* child ) +
Add Node to Group. +If node is not NULL and is not contained in Group then increment its +reference count, add it to the child list and dirty the bounding +sphere to force it to recompute on next getBound() and return true for success. +Otherwise return false. Scene nodes can't be added as child nodes. +

+ + +

ovirtual bool removeChild( 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 +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. +

+ + +

ovirtual bool replaceChild( Node* origChild, Node* newChild ) +
Replace specified Node with another Node. +Decrement the reference count origNode and increments the +reference count of newNode, and dirty the bounding sphere +to force it to recompute on next getBound() and returns true. +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. +

+ + +

oinline const int getNumChildren() const +
return the number of chilren nodes +

+ + +

oinline Node* getChild( const int i ) +
return child node at position i +

+ + +

oinline const Node* getChild( const int i ) const +
return child node at position i +

+ + +

oinline bool containsNode( const Node* node ) const +
return true if node is contained within Group +

+ + +

oinline ChildList::iterator findNode( const Node* node ) +
return the iterator postion for specified Node. +return _chilren.end() if node is not contained in Group. +

+ + +

oinline ChildList::const_iterator findNode( const Node* node ) const +
return the const_iterator postion for specified Node. +return _chilren.end() if node is not contained in Group. +

+ + +

ovirtual ~Group() +

+ + +

ovirtual const bool computeBound() const +

+ + +

oChildList _children +

+
+
Direct child classes: +
Transform
+Switch
+LOD
+
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/HIER.html b/doc/doc++/osg/HIER.html new file mode 100644 index 000000000..d2d32ec45 --- /dev/null +++ b/doc/doc++/osg/HIER.html @@ -0,0 +1,85 @@ + + + + + Hierarchy of Classes + + + +

Hierarchy of Classes

+ +

Alphabetic index


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/HIERjava.html b/doc/doc++/osg/HIERjava.html new file mode 100644 index 000000000..de72c0d70 --- /dev/null +++ b/doc/doc++/osg/HIERjava.html @@ -0,0 +1,100 @@ + + + + + Hierarchy of Classes + + + +

Hierarchy of classes

+
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ alphabetic index


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/Image.html b/doc/doc++/osg/Image.html new file mode 100644 index 000000000..eb4b79b36 --- /dev/null +++ b/doc/doc++/osg/Image.html @@ -0,0 +1,274 @@ + + + + + class SG_EXPORT osg::Image + + + + +

class SG_EXPORT osg::Image

Image class for encapsulating the storage texture image data
+
+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Methods

+[more] Image() +
+[more]virtual Object* clone() const +
+[more]virtual bool isSameKindAs(const Object* obj) const +
+[more]virtual const char* className() const +
+[more]inline const std::string& getFileName() const +
+[more]void setFileName(const std::string& fileName) +
+[more]void setImage(const int s, const int t, const int r, const int internalFormat, const unsigned int pixelFormat, const unsigned int dataType, unsigned char* data, const int packing=-1) +
set the image data and format. +
+[more]inline const int s() const +
Width of image +
+[more]inline const int t() const +
Height of image +
+[more]inline const int r() const +
Depth of image +
+[more]inline const int internalFormat() const +
+[more]inline const unsigned int pixelFormat() const +
+[more]inline const unsigned int dataType() const +
+[more]inline const unsigned int packing() const +
+[more]inline unsigned char* data() +
raw image data +
+[more]inline const unsigned char* data() const +
raw const image data +
+[more]void scaleImage(const int s, const int t, const int r) +
Scale image to specified size. +
+[more]void ensureDimensionsArePowerOfTwo() +
Ensure image dimensions are a power of two. +
+[more]inline const unsigned int getModifiedTag() const +
Get modified tag value. +

+ +

+

Protected Fields

+[more]std::string _fileName +
+[more]int _s +
+[more]int _t +
+[more]int _r +
+[more]int _internalFormat +
+[more]unsigned int _pixelFormat +
+[more]unsigned int _dataType +
+[more]unsigned int _packing +
+[more]unsigned char* _data +
+[more]unsigned int _modifiedTag +

+ +

+

Protected Methods

+[more]virtual ~Image() +

+ +
+

Inherited from Object:

+
+
+

Inherited from Referenced:

+
+

+

Public Methods

+oinline Referenced& operator = (Referenced&) +
+oinline void ref() const +
+oinline void unref() const +
+oinline const int referenceCount() const +

+ +

+

Protected Fields

+omutable int _refCount +

+ +
+ + +
+

Documentation

+
Image class for encapsulating the storage texture image data
+
+ + + +
o Image() +

+ + +

ovirtual Object* clone() const +

+ + +

ovirtual bool isSameKindAs(const Object* obj) const +

+ + +

ovirtual const char* className() const +

+ + +

oinline const std::string& getFileName() const +

+ + +

ovoid setFileName(const std::string& fileName) +

+ + +

ovoid setImage(const int s, const int t, const int r, const int internalFormat, const unsigned int pixelFormat, const unsigned int dataType, unsigned char* data, const int packing=-1) +
set the image data and format. +note, when the packing value is negative (the default is -1) this method assumes +a _packing width of 1 if the width is not a multiple of 4, +otherwise automatically sets to _packing to 4. If a postive +value of packing is supplied than _packing is simply set to that value. +

+ + +

oinline const int s() const +
Width of image +

+ + +

oinline const int t() const +
Height of image +

+ + +

oinline const int r() const +
Depth of image +

+ + +

oinline const int internalFormat() const +

+ + +

oinline const unsigned int pixelFormat() const +

+ + +

oinline const unsigned int dataType() const +

+ + +

oinline const unsigned int packing() const +

+ + +

oinline unsigned char* data() +
raw image data +

+ + +

oinline const unsigned char* data() const +
raw const image data +

+ + +

ovoid scaleImage(const int s, const int t, const int r) +
Scale image to specified size. +

+ + +

ovoid ensureDimensionsArePowerOfTwo() +
Ensure image dimensions are a power of two. +Mip Mapped texture require the image dimensions to be +power of two. +

+ + +

oinline const unsigned int getModifiedTag() const +
Get modified tag value. +

+ + +

ovirtual ~Image() +

+ + +

ostd::string _fileName +

+ + +

oint _s +

+ + +

oint _t +

+ + +

oint _r +

+ + +

oint _internalFormat +

+ + +

ounsigned int _pixelFormat +

+ + +

ounsigned int _dataType +

+ + +

ounsigned int _packing +

+ + +

ounsigned char* _data +

+ + +

ounsigned int _modifiedTag +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/Impostor.html b/doc/doc++/osg/Impostor.html new file mode 100644 index 000000000..185a3aeb7 --- /dev/null +++ b/doc/doc++/osg/Impostor.html @@ -0,0 +1,370 @@ + + + + + class SG_EXPORT osg::Impostor + + + + +

class SG_EXPORT osg::Impostor

Impostor - is a form of Level Of Detail group node which allows both switching between children depending on distance from eye point and image caching.
+
+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Methods

+[more] Impostor() +
+[more]virtual Object* clone() const +
+[more]virtual bool isSameKindAs(const Object* obj) const +
+[more]virtual const char* className() const +
+[more]virtual void accept(NodeVisitor& nv) +
+[more]inline void setImpostorThreshold(float distance) +
Set the Impostor threshold distance. +
+[more]inline void setImpostorThresholdToBound(float ratio=1.0f) +
Set the Impostor threshold distance relative to the node's bounding sphere's radius +
+[more]inline const float getImpostorThreshold() const +
+[more]inline const float getImpostorThreshold2() const +
+[more]ImpostorSprite* findBestImpostorSprite(const osg::Vec3& currLocalEyePoint) +
Find the ImposterSprite which fits the current eye point best +
+[more]void addImpostorSprite(ImpostorSprite* is) +
Add an ImpostorSprite to the Impostor +
+[more]inline ImpostorSpriteList& getImpostorSpriteList() +
Get the list of ImpostorSprites attached to this Impostor +
+[more]inline const ImpostorSpriteList& getImpostorSpriteList() const +
Get a const list of ImpostorSprites attached to this const Impostor +

+ +

+

Protected Fields

+[more]ImpostorSpriteList _impostorSpriteList +
+[more]float _impostorThreshold +

+ +

+

Protected Methods

+[more]virtual ~Impostor() +
+[more]virtual const bool computeBound() const +

+ +
+

Inherited from LOD:

+
+

+

Public Methods

+ovirtual void traverse(NodeVisitor& nv) +
+ovoid setRange(const unsigned int index, const float range) +
+oinline const float getRange(const unsigned int index) const +
+oinline const int getNumRanges() const +
+oinline void setCenter(const Vec3 &center) +
+oinline const Vec3& getCenter() const +
+oconst int evaluate(const Vec3& eye_local, const float bias=1.0f) const +

+ +

+

Protected Fields

+oRangeList _rangeList2 +
+oVec3 _center +

+ +

+

Protected Members

+otypedef std::vector<float> RangeList RangeList _rangeList +

+ +
+

Inherited from Group:

+
+

+

Public Methods

+ovirtual bool addChild( Node* child ) +
+ovirtual bool removeChild( Node* child ) +
+ovirtual bool replaceChild( Node* origChild, Node* newChild ) +
+oinline const int getNumChildren() const +
+oinline Node* getChild( const int i ) +
+oinline const Node* getChild( const int i ) const +
+oinline bool containsNode( const Node* node ) const +
+oinline ChildList::iterator findNode( const Node* node ) +
+oinline ChildList::const_iterator findNode( const Node* node ) const +

+ +

+

Protected Fields

+oChildList _children +

+ +
+

Inherited from Node:

+
+

+

Public Methods

+ovirtual void ascend(NodeVisitor& nv) +
+oinline void setName( const std::string& name ) +
+oinline void setName( const char* name ) +
+oinline const std::string& getName() const +
+oinline const ParentList& getParents() const +
+oinline Group* getParent(const int i) +
+oinline const Group* getParent(const int i) const +
+oinline const int getNumParents() const +
+oinline void setUserData(void* data, MemoryAdapter* ma=0L) +
+oinline void* getUserData() +
+oinline const void* getUserData() const +
+oinline MemoryAdapter* getMemoryAdapter() +
+oinline const MemoryAdapter* getMemoryAdapter() const +
+oinline void setNodeMask(const NodeMask nm) +
+oinline const NodeMask getNodeMask() const +
+oinline const DescriptionList& getDescriptions() const +
+oinline DescriptionList& getDescriptions() +
+oinline const std::string& getDescription(const int i) const +
+oinline std::string& getDescription(const int i) +
+oinline const int getNumDescriptions() const +
+ovoid addDescription(const std::string& desc) +
+oinline void setStateSet(osg::StateSet* dstate) +
+oinline osg::StateSet* getStateSet() +
+oinline const osg::StateSet* getStateSet() const +
+oinline const BoundingSphere& getBound() const +
+ovoid dirtyBound() +

+ +

+

Public Members

+otypedef std::vector<Group*> ParentList +
+otypedef std::vector<std::string> DescriptionList +

+ +

+

Protected Fields

+omutable BoundingSphere _bsphere +
+omutable bool _bsphere_computed +
+ostd::string _name +
+oParentList _parents +
+ovoid* _userData +
+oref_ptr<MemoryAdapter> _memoryAdapter +
+oNodeMask _nodeMask +
+oDescriptionList _descriptions +
+oref_ptr<StateSet> _dstate +

+ +
+

Inherited from Object:

+
+
+

Inherited from Referenced:

+
+

+

Public Methods

+oinline Referenced& operator = (Referenced&) +
+oinline void ref() const +
+oinline void unref() const +
+oinline const int referenceCount() const +

+ +

+

Protected Fields

+omutable int _refCount +

+ +
+ + +
+

Documentation

+
Impostor - is a form of Level Of Detail group node which allows both switching +between children depending on distance from eye point and image caching. + +

The principle behind Imposters is that they cache an image of real geometry and then the image is drawn +in subsequent frames instead of the real geometry. Its a bit like a +Billboard *but* is updated at runtime and w.r.t view point. By drawing +just the texture mapped quad you can cut down scene complexity and +improve performance. + +

For more details have a look at: + +

http://grail.cs.washington.edu/projects/hic/ + +

The OSG doesn't implement exactly the same technique as above, but its +should be a good starting place. The OSG's impostors are much less +intrusive since you don't need to restructure your whole scene to use +them. + +

All you need to do to use Impostors is to set up the visible +range values for each LOD child of the Impostor, as per osg::LOD, +and set an Impostor threshold to tell the renderer at what distance +the Impsotor's image caching should cut in. The osg::CullVisitor +automatically handles all the setting of pre-rendering stages to +calculate the required ImpostorSprites (which encapsulates the image +cache and quad), and updates them as the view point changes. If you +use osg::SceneView/CullVisitor all the complexity of supporting +Impostor will be nicely hidden away. + +

TODO: +Various improvements are planned for the Impostor- +1) Estimation of how many frames an ImpostorSprite will be reused, if +it won't be used more often than a minimum threshold then do not create +ImpostorSprite - use the real geometry. +2) Sharing of texture memory between ImpostorSprites. +3) Simple 3D geometry for ImpostorSprite's rather than Billboarding. +4) Shrinking of the ImpostorSprite size to more closely fit the underlying +geometry.

+
+ + + +
o Impostor() +

+ + +

ovirtual Object* clone() const +

+ + +

ovirtual bool isSameKindAs(const Object* obj) const +

+ + +

ovirtual const char* className() const +

+ + +

ovirtual void accept(NodeVisitor& nv) +

+ + +

oinline void setImpostorThreshold(float distance) +
Set the Impostor threshold distance. +For eye points further than this threshold the Imposter is used if appropriate, +otherwise the LOD children as chosen as per a standard LOD node. +

+ + +

oinline void setImpostorThresholdToBound(float ratio=1.0f) +
Set the Impostor threshold distance relative to the node's bounding +sphere's radius +

+ + +

oinline const float getImpostorThreshold() const +

+ + +

oinline const float getImpostorThreshold2() const +

+ + +

oImpostorSprite* findBestImpostorSprite(const osg::Vec3& currLocalEyePoint) +
Find the ImposterSprite which fits the current eye point best +

+ + +

ovoid addImpostorSprite(ImpostorSprite* is) +
Add an ImpostorSprite to the Impostor +

+ + +

oinline ImpostorSpriteList& getImpostorSpriteList() +
Get the list of ImpostorSprites attached to this Impostor +

+ + +

oinline const ImpostorSpriteList& getImpostorSpriteList() const +
Get a const list of ImpostorSprites attached to this const Impostor +

+ + +

ovirtual ~Impostor() +

+ + +

ovirtual const bool computeBound() const +

+ + +

oImpostorSpriteList _impostorSpriteList +

+ + +

ofloat _impostorThreshold +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/ImpostorSprite.html b/doc/doc++/osg/ImpostorSprite.html new file mode 100644 index 000000000..b8330859a --- /dev/null +++ b/doc/doc++/osg/ImpostorSprite.html @@ -0,0 +1,410 @@ + + + + + class SG_EXPORT osg::ImpostorSprite + + + + +

class SG_EXPORT osg::ImpostorSprite

An ImposterSprite is a textured quad which is rendered in place a 3D geometry.
+
+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Methods

+[more] ImpostorSprite() +
+[more]virtual Object* clone() const +
+[more]virtual bool isSameKindAs(const Object* obj) const +
+[more]virtual const char* className() const +
+[more]void setParent(Impostor* parent) +
Set the parent, which must be an Impostor. +
+[more]Impostor* getParent() +
Get the parent, which is an Impostor. +
+[more]const Impostor* getParent() const +
Get the const parent, which is an Impostor. +
+[more]inline void setStoredLocalEyePoint(const Vec3& v) +
Set the eye point for when the ImpsotorSprite was snapped +
+[more]inline const Vec3& getStoredLocalEyePoint() const +
Get the eye point for when the ImpsotorSprite was snapped +
+[more]inline void setLastFrameUsed(const int frameNumber) +
Set the frame number for when the ImpostorSprite was last used in rendering +
+[more]inline int getLastFrameUsed() const +
Get the frame number for when the ImpostorSprite was last used in rendering +
+[more]inline Vec3* getCoords() +
Get the coordinates of the corners of the quad. +
+[more]inline const Vec3* getCoords() const +
Get the const coordinates of the corners of the quad +
+[more]inline Vec2* getTexCoords() +
Get the texture coordinates of the corners of the quad. +
+[more]inline const Vec2* getTexCoords() const +
Get the const texture coordinates of the corners of the quad +
+[more]inline Vec3* getControlCoords() +
Get the control coordinates of the corners of the quad. +
+[more]inline const Vec3* getControlCoords() const +
Get the const control coordinates of the corners of the quad +
+[more]const float calcPixelError(const Camera& camera, const int* viewport, const osg::Matrix* matrix) const +
calculate the pixel error value for current camera position and object position +
+[more]void setTexture(Texture* tex, int s, int t) +
+[more]Texture* getTexture() +
+[more]const Texture* getTexture() const +
+[more]const int s() const +
+[more]const int t() const +
+[more]virtual void drawImmediateMode(State& state) +
draw ImpostorSprite directly. +

+ +

+

Protected Fields

+[more]Impostor* _parent +
+[more]ImpostorSpriteManager* _ism +
+[more]ImpostorSprite* _previous +
+[more]ImpostorSprite* _next +
+[more]int _lastFrameUsed +
+[more]Vec3 _storedLocalEyePoint +
+[more]Vec3 _coords[4] +
+[more]Vec2 _texcoords[4] +
+[more]Vec3 _controlcoords[4] +
+[more]Texture* _texture +
+[more]int _s +
+[more]int _t +

+ +

+

Protected Methods

+[more] ImpostorSprite(const ImpostorSprite&) +
+[more]ImpostorSprite& operator = (const ImpostorSprite&) +
+[more]virtual ~ImpostorSprite() +
+[more]virtual const bool computeBound() const +

+ +
+

Inherited from Drawable:

+
+

+

Public Methods

+oinline void setStateSet(StateSet* state) +
+oinline StateSet* getStateSet() +
+oinline const StateSet* getStateSet() const +
+ovoid setSupportsDisplayList(const bool flag) +
+oinline const bool getSupportsDisplayList() const +
+ovoid setUseDisplayList(const bool flag) +
+oinline const bool getUseDisplayList() const +
+ovoid dirtyDisplayList() +
+oinline void dirtyBound() +
+oinline const BoundingBox& getBound() const +
+oinline void draw(State& state) +
+ovoid compile(State& state) +
+ostatic void deleteDisplayList(uint contextID, uint globj) +
+ostatic void flushDeletedDisplayLists(uint contextID) +

+ +

+

Protected Fields

+oref_ptr<StateSet> _dstate +
+obool _supportsDisplayList +
+obool _useDisplayList +
+omutable BoundingBox _bbox +
+omutable bool _bbox_computed +

+ +

+

Protected Members

+otypedef std::vector<uint> GLObjectList mutable GLObjectList _globjList +
+otypedef std::map<uint,std::set<uint> >static DeletedDisplayListCache DeletedDisplayListCache s_deletedDisplayListCache +

+ +
+

Inherited from Object:

+
+
+

Inherited from Referenced:

+
+

+

Public Methods

+oinline void ref() const +
+oinline void unref() const +
+oinline const int referenceCount() const +

+ +

+

Protected Fields

+omutable int _refCount +

+ +
+ + +
+

Documentation

+
An ImposterSprite is a textured quad which is rendered in place a +3D geometry. The ImposterSprite is generated by rendering the original +3D geometry to a texture as an image cache. The ImpostorSprite is +automatiacally generatated by the osgUtil::CullVisitor so it not +necessary to deal with it directly.
+
+ + + +
o ImpostorSprite() +

+ + +

ovirtual Object* clone() const +

+ + +

ovirtual bool isSameKindAs(const Object* obj) const +

+ + +

ovirtual const char* className() const +

+ + +

ovoid setParent(Impostor* parent) +
Set the parent, which must be an Impostor. +Unlike conventional Drawables, ImpostorSprite's can only ever have +one parent. +

+ + +

oImpostor* getParent() +
Get the parent, which is an Impostor. +

+ + +

oconst Impostor* getParent() const +
Get the const parent, which is an Impostor. +

+ + +

oinline void setStoredLocalEyePoint(const Vec3& v) +
Set the eye point for when the ImpsotorSprite was snapped +

+ + +

oinline const Vec3& getStoredLocalEyePoint() const +
Get the eye point for when the ImpsotorSprite was snapped +

+ + +

oinline void setLastFrameUsed(const int frameNumber) +
Set the frame number for when the ImpostorSprite was last used in rendering +

+ + +

oinline int getLastFrameUsed() const +
Get the frame number for when the ImpostorSprite was last used in rendering +

+ + +

oinline Vec3* getCoords() +
Get the coordinates of the corners of the quad. +Stored in the order, [0] - top_left, [1] - bottom_left, [2] - bottom_right, [3] - top_left. +

+ + +

oinline const Vec3* getCoords() const +
Get the const coordinates of the corners of the quad +

+ + +

oinline Vec2* getTexCoords() +
Get the texture coordinates of the corners of the quad. +Stored in the order, [0] - top_left, [1] - bottom_left, [2] - bottom_right, [3] - top_left. +

+ + +

oinline const Vec2* getTexCoords() const +
Get the const texture coordinates of the corners of the quad +

+ + +

oinline Vec3* getControlCoords() +
Get the control coordinates of the corners of the quad. +The control coordinates are the cornders of the quad projected +out onto the front face of bounding box which enclosed the impostor +geometry when it was pre-rendered into the impostor sprite's texture. +At the point of creation/or update of the impostor sprite the control +coords will lie ontop of the coorners of the quad in screen space - with a pixel error +or zero. Once the camera moves relative to the impostor sprite the +control coords will nolonger lie ontop of the corners of the quad in +screen space - a pixel error will have accumulated. This pixel error +can then be used to dertermine whether the impostor needs to be updated. +Stored in the order, [0] - top_left, [1] - bottom_left, [2] - bottom_right, [3] - top_left. +

+ + +

oinline const Vec3* getControlCoords() const +
Get the const control coordinates of the corners of the quad +

+ + +

oconst float calcPixelError(const Camera& camera, const int* viewport, const osg::Matrix* matrix) const +
calculate the pixel error value for current camera position and object position +

+ + +

ovoid setTexture(Texture* tex, int s, int t) +

+ + +

oTexture* getTexture() +

+ + +

oconst Texture* getTexture() const +

+ + +

oconst int s() const +

+ + +

oconst int t() const +

+ + +

ovirtual void drawImmediateMode(State& state) +
draw ImpostorSprite directly. +

+ + +

o ImpostorSprite(const ImpostorSprite&) +

+ + +

oImpostorSprite& operator = (const ImpostorSprite&) +

+ + +

ovirtual ~ImpostorSprite() +

+ + +

ovirtual const bool computeBound() const +

+ + +

oImpostor* _parent +

+ + +

oImpostorSpriteManager* _ism +

+ + +

oImpostorSprite* _previous +

+ + +

oImpostorSprite* _next +

+ + +

oint _lastFrameUsed +

+ + +

oVec3 _storedLocalEyePoint +

+ + +

oVec3 _coords[4] +

+ + +

oVec2 _texcoords[4] +

+ + +

oVec3 _controlcoords[4] +

+ + +

oTexture* _texture +

+ + +

oint _s +

+ + +

oint _t +

+ +
This class has no child classes.
+ +
Friends:
ImpostorSpriteManager

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/ImpostorSpriteManager.html b/doc/doc++/osg/ImpostorSpriteManager.html new file mode 100644 index 000000000..8511adf75 --- /dev/null +++ b/doc/doc++/osg/ImpostorSpriteManager.html @@ -0,0 +1,127 @@ + + + + + class SG_EXPORT osg::ImpostorSpriteManager + + + + +

class SG_EXPORT osg::ImpostorSpriteManager

Helper class for managing the reuse of ImpostorSprite resources
+
+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Methods

+[more] ImpostorSpriteManager() +
+[more]const bool empty() const +
+[more]ImpostorSprite* first() +
+[more]ImpostorSprite* last() +
+[more]void push_back(ImpostorSprite* is) +
+[more]void remove(ImpostorSprite* is) +
+[more]ImpostorSprite* createOrReuseImpostorSprite(int s, int t, int frameNumber) +

+ +

+

Protected Fields

+[more]ImpostorSprite* _first +
+[more]ImpostorSprite* _last +

+ +

+

Protected Methods

+[more] ~ImpostorSpriteManager() +

+ +
+

Inherited from Referenced:

+
+

+

Public Methods

+oinline Referenced& operator = (Referenced&) +
+oinline void ref() const +
+oinline void unref() const +
+oinline const int referenceCount() const +

+ +

+

Protected Fields

+omutable int _refCount +

+ +
+ + +
+

Documentation

+
Helper class for managing the reuse of ImpostorSprite resources
+
+ + + +
o ImpostorSpriteManager() +

+ + +

oconst bool empty() const +

+ + +

oImpostorSprite* first() +

+ + +

oImpostorSprite* last() +

+ + +

ovoid push_back(ImpostorSprite* is) +

+ + +

ovoid remove(ImpostorSprite* is) +

+ + +

oImpostorSprite* createOrReuseImpostorSprite(int s, int t, int frameNumber) +

+ + +

o ~ImpostorSpriteManager() +

+ + +

oImpostorSprite* _first +

+ + +

oImpostorSprite* _last +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/LOD.html b/doc/doc++/osg/LOD.html new file mode 100644 index 000000000..c93c284a8 --- /dev/null +++ b/doc/doc++/osg/LOD.html @@ -0,0 +1,314 @@ + + + + + class SG_EXPORT osg::LOD + + + + +

class SG_EXPORT osg::LOD

LOD - Level Of Detail group node which allows switching between children depending on distance from eye point.
+
+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Methods

+[more] LOD() +
+[more]virtual Object* clone() const +
+[more]virtual bool isSameKindAs(const Object* obj) const +
+[more]virtual const char* className() const +
+[more]virtual void accept(NodeVisitor& nv) +
+[more]virtual void traverse(NodeVisitor& nv) +
+[more]void setRange(const unsigned int index, const float range) +
Sets the value of range list element index to range which is a floating point distance specified in world coordinates. +
+[more]inline const float getRange(const unsigned int index) const +
returns the range for specified index +
+[more]inline const int getNumRanges() const +
returns the number of ranges currently set +
+[more]inline void setCenter(const Vec3 &center) +
Sets the object-space point which defines the center of the osg::LOD. +
+[more]inline const Vec3& getCenter() const +
return the LOD center point. +
+[more]const int evaluate(const Vec3& eye_local, const float bias=1.0f) const +
return the child to traverse. +

+ +

+

Protected Fields

+[more]RangeList _rangeList2 +
+[more]Vec3 _center +

+ +

+

Protected Methods

+[more]virtual ~LOD() +

+ +

+

Protected Members

+[more]typedef std::vector<float> RangeList RangeList _rangeList +

+ +
+

Inherited from Group:

+
+

+

Public Methods

+ovirtual bool addChild( Node* child ) +
+ovirtual bool removeChild( Node* child ) +
+ovirtual bool replaceChild( Node* origChild, Node* newChild ) +
+oinline const int getNumChildren() const +
+oinline Node* getChild( const int i ) +
+oinline const Node* getChild( const int i ) const +
+oinline bool containsNode( const Node* node ) const +
+oinline ChildList::iterator findNode( const Node* node ) +
+oinline ChildList::const_iterator findNode( const Node* node ) const +

+ +

+

Protected Fields

+oChildList _children +

+ +

+

Protected Methods

+ovirtual const bool computeBound() const +

+ +
+

Inherited from Node:

+
+

+

Public Methods

+ovirtual void ascend(NodeVisitor& nv) +
+oinline void setName( const std::string& name ) +
+oinline void setName( const char* name ) +
+oinline const std::string& getName() const +
+oinline const ParentList& getParents() const +
+oinline Group* getParent(const int i) +
+oinline const Group* getParent(const int i) const +
+oinline const int getNumParents() const +
+oinline void setUserData(void* data, MemoryAdapter* ma=0L) +
+oinline void* getUserData() +
+oinline const void* getUserData() const +
+oinline MemoryAdapter* getMemoryAdapter() +
+oinline const MemoryAdapter* getMemoryAdapter() const +
+oinline void setNodeMask(const NodeMask nm) +
+oinline const NodeMask getNodeMask() const +
+oinline const DescriptionList& getDescriptions() const +
+oinline DescriptionList& getDescriptions() +
+oinline const std::string& getDescription(const int i) const +
+oinline std::string& getDescription(const int i) +
+oinline const int getNumDescriptions() const +
+ovoid addDescription(const std::string& desc) +
+oinline void setStateSet(osg::StateSet* dstate) +
+oinline osg::StateSet* getStateSet() +
+oinline const osg::StateSet* getStateSet() const +
+oinline const BoundingSphere& getBound() const +
+ovoid dirtyBound() +

+ +

+

Public Members

+otypedef std::vector<Group*> ParentList +
+otypedef std::vector<std::string> DescriptionList +

+ +

+

Protected Fields

+omutable BoundingSphere _bsphere +
+omutable bool _bsphere_computed +
+ostd::string _name +
+oParentList _parents +
+ovoid* _userData +
+oref_ptr<MemoryAdapter> _memoryAdapter +
+oNodeMask _nodeMask +
+oDescriptionList _descriptions +
+oref_ptr<StateSet> _dstate +

+ +
+

Inherited from Object:

+
+
+

Inherited from Referenced:

+
+

+

Public Methods

+oinline Referenced& operator = (Referenced&) +
+oinline void ref() const +
+oinline void unref() const +
+oinline const int referenceCount() const +

+ +

+

Protected Fields

+omutable int _refCount +

+ +
+ + +
+

Documentation

+
LOD - Level Of Detail group node which allows switching between children +depending on distance from eye point. +Typical uses are for load balancing - objects further away from +the eye point are rendered at a lower level of detail, and at times +of high stress on the graphics pipeline lower levels of detail can +also be chosen.
+
+ + + +
o LOD() +

+ + +

ovirtual Object* clone() const +

+ + +

ovirtual bool isSameKindAs(const Object* obj) const +

+ + +

ovirtual const char* className() const +

+ + +

ovirtual void accept(NodeVisitor& nv) +

+ + +

ovirtual void traverse(NodeVisitor& nv) +

+ + +

ovoid setRange(const unsigned int index, const float range) +
Sets the value of range list element index to range which +is a floating point distance specified in world coordinates. +Range list automatically expands to accomodate values beyond +the current getNumRanges(). +

+ + +

oinline const float getRange(const unsigned int index) const +
returns the range for specified index +

+ + +

oinline const int getNumRanges() const +
returns the number of ranges currently set +

+ + +

oinline void setCenter(const Vec3 &center) +
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. +

+ + +

oinline const Vec3& getCenter() const +
return the LOD center point. +

+ + +

oconst int evaluate(const Vec3& eye_local, const float bias=1.0f) const +
return the child to traverse. +Selected by the distance between the eye point in local +coordinates and the LOD center, mutliplied by the bias. +

+ + +

ovirtual ~LOD() +

+ + +

otypedef std::vector<float> RangeList RangeList _rangeList +

+ + +

oRangeList _rangeList2 +

+ + +

oVec3 _center +

+
+
Direct child classes: +
Impostor
+
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/Light.html b/doc/doc++/osg/Light.html new file mode 100644 index 000000000..dcf4fbd08 --- /dev/null +++ b/doc/doc++/osg/Light.html @@ -0,0 +1,423 @@ + + + + + class SG_EXPORT osg::Light + + + + +

class SG_EXPORT osg::Light

Light state class which encapsulates OpenGL glLight() functionality
+
+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Methods

+[more] Light() +
+[more]virtual Object* clone() const +
return a shallow copy of a node, with Object* return type +
+[more]virtual bool isSameKindAs(const Object* obj) const +
return true if this and obj are of the same kind of object +
+[more]virtual const char* className() const +
return the name of the node's class type +
+[more]virtual const Type getType() const +
+[more]virtual void setStateSetModes(StateSet& ds, const GLModeValue value) const +
+[more]inline void on() +
Turn the light on. +
+[more]inline void off() +
Turn the light off. +
+[more]virtual void apply(State& state) const +
Apply the light's state to the OpenGL state machine. +
+[more]inline void setAmbient( const Vec4& ambient ) +
Set the ambient component of the light. +
+[more]inline const Vec4& getAmbient() const +
Get the ambient component of the light. +
+[more]inline void setDiffuse( const Vec4& diffuse ) +
Set the diffuse component of the light. +
+[more]inline const Vec4& getDiffuse() const +
Get the diffuse component of the light. +
+[more]inline void setSpecular( const Vec4& specular ) +
Set the specular component of the light. +
+[more]inline const Vec4& getSpecular() const +
Get the specular component of the light. +
+[more]inline void setPosition( const Vec4& position ) +
Set the position of the light. +
+[more]inline const Vec4& getPosition() const +
Get the position of the light. +
+[more]inline void setDirection( const Vec3& direction ) +
Set the direction of the light. +
+[more]inline const Vec3& getDirection() const +
Get the direction of the light. +
+[more]inline void setConstantAttenuation( const float constant_attenuation ) +
Set the constant attenuation of the light. +
+[more]inline const float getConstantAttenuation() const +
Get the constant attenuation of the light. +
+[more]inline void setLinearAttenuation( const float linear_attenuation ) +
Set the linear attenuation of the light. +
+[more]inline const float getLinearAttenuation() const +
Get the linear attenuation of the light. +
+[more]inline void setQuadraticAttenuation( const float quadratic_attenuation ) +
Set the quadratic attenuation of the light. +
+[more]inline const float getQuadraticAttenuation() const +
Get the quadratic attenuation of the light. +
+[more]inline void setSpotExponent( const float spot_exponent ) +
Set the spot exponent of the light. +
+[more]inline const float getSpotExponent() const +
Get the spot exponent of the light. +
+[more]inline void setSpotCutoff( const float spot_cutoff ) +
Set the spot cutoff of the light. +
+[more]inline const float getSpotCutoff() const +
Get the spot cutoff of the light. +
+[more]void captureLightState() +
Capture the lighting settings of the current OpenGL state and store them in this object +

+ +

+

Protected Fields

+[more]int _lightnum +
+[more]bool _on +
+[more]Vec4 _ambient +
+[more]Vec4 _diffuse +
+[more]Vec4 _specular +
+[more]Vec4 _position +
+[more]Vec3 _direction +
+[more]float _constant_attenuation +
+[more]float _linear_attenuation +
+[more]float _quadratic_attenuation +
+[more]float _spot_exponent +
+[more]float _spot_cutoff +
+[more]static int _currentLightNum +

+ +

+

Protected Methods

+[more]virtual ~Light() +
+[more]void init() +
Initialize the light's settings with some decent defaults. +

+ +
+

Inherited from StateAttribute:

+
+

+

Public Methods

+ovirtual void compile(State&) const +

+ +

+

Public Members

+otypedef GLenum GLMode +
+otypedef unsigned int GLModeValue +
+otypedef unsigned int OverrideValue +
+oenum Values +
+oenum Type +

+ +
+

Inherited from Object:

+
+
+

Inherited from Referenced:

+
+

+

Public Methods

+oinline Referenced& operator = (Referenced&) +
+oinline void ref() const +
+oinline void unref() const +
+oinline const int referenceCount() const +

+ +

+

Protected Fields

+omutable int _refCount +

+ +
+ + +
+

Documentation

+
Light state class which encapsulates OpenGL glLight() functionality
+
+ + + +
o Light() +

+ + +

ovirtual Object* clone() const +
return a shallow copy of a node, with Object* return type +

+ + +

ovirtual bool isSameKindAs(const Object* obj) const +
return true if this and obj are of the same kind of object +

+ + +

ovirtual const char* className() const +
return the name of the node's class type +

+ + +

ovirtual const Type getType() const +

+ + +

ovirtual void setStateSetModes(StateSet& ds, const GLModeValue value) const +

+ + +

oinline void on() +
+Turn the light on. +Calling this method doesn't directly affect OpenGL's lighting mode. +

+ + +

oinline void off() +
+Turn the light off. +Calling this method doesn't directly affect OpenGL's lighting mode. +

+ + +

ovirtual void apply(State& state) const +
Apply the light's state to the OpenGL state machine. +

+ + +

oinline void setAmbient( const Vec4& ambient ) +
Set the ambient component of the light. +

+ + +

oinline const Vec4& getAmbient() const +
Get the ambient component of the light. +

+ + +

oinline void setDiffuse( const Vec4& diffuse ) +
Set the diffuse component of the light. +

+ + +

oinline const Vec4& getDiffuse() const +
Get the diffuse component of the light. +

+ + +

oinline void setSpecular( const Vec4& specular ) +
Set the specular component of the light. +

+ + +

oinline const Vec4& getSpecular() const +
Get the specular component of the light. +

+ + +

oinline void setPosition( const Vec4& position ) +
Set the position of the light. +

+ + +

oinline const Vec4& getPosition() const +
Get the position of the light. +

+ + +

oinline void setDirection( const Vec3& direction ) +
Set the direction of the light. +

+ + +

oinline const Vec3& getDirection() const +
Get the direction of the light. +

+ + +

oinline void setConstantAttenuation( const float constant_attenuation ) +
Set the constant attenuation of the light. +

+ + +

oinline const float getConstantAttenuation() const +
Get the constant attenuation of the light. +

+ + +

oinline void setLinearAttenuation( const float linear_attenuation ) +
Set the linear attenuation of the light. +

+ + +

oinline const float getLinearAttenuation() const +
Get the linear attenuation of the light. +

+ + +

oinline void setQuadraticAttenuation( const float quadratic_attenuation ) +
Set the quadratic attenuation of the light. +

+ + +

oinline const float getQuadraticAttenuation() const +
Get the quadratic attenuation of the light. +

+ + +

oinline void setSpotExponent( const float spot_exponent ) +
Set the spot exponent of the light. +

+ + +

oinline const float getSpotExponent() const +
Get the spot exponent of the light. +

+ + +

oinline void setSpotCutoff( const float spot_cutoff ) +
Set the spot cutoff of the light. +

+ + +

oinline const float getSpotCutoff() const +
Get the spot cutoff of the light. +

+ + +

ovoid captureLightState() +
+Capture the lighting settings of the current OpenGL state +and store them in this object +

+ + +

ovirtual ~Light() +

+ + +

ovoid init() +
Initialize the light's settings with some decent defaults. +

+ + +

oint _lightnum +

+ + +

obool _on +

+ + +

oVec4 _ambient +

+ + +

oVec4 _diffuse +

+ + +

oVec4 _specular +

+ + +

oVec4 _position +

+ + +

oVec3 _direction +

+ + +

ofloat _constant_attenuation +

+ + +

ofloat _linear_attenuation +

+ + +

ofloat _quadratic_attenuation +

+ + +

ofloat _spot_exponent +

+ + +

ofloat _spot_cutoff +

+ + +

ostatic int _currentLightNum +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/LightSource.html b/doc/doc++/osg/LightSource.html new file mode 100644 index 000000000..1b919e11c --- /dev/null +++ b/doc/doc++/osg/LightSource.html @@ -0,0 +1,230 @@ + + + + + class SG_EXPORT osg::LightSource + + + + +

class SG_EXPORT osg::LightSource

Leaf Node for defining a light in the scene
+
+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Methods

+[more] LightSource() +
+[more]virtual Object* clone() const +
+[more]virtual bool isSameKindAs(const Object* obj) const +
+[more]virtual const char* className() const +
+[more]virtual void accept(NodeVisitor& nv) +
+[more]inline void setLight(Light* light) +
Set the attached light +
+[more]inline Light* getLight() +
Get the attached light +
+[more]inline const Light* getLight() const +
Get the const attached light +

+ +

+

Protected Fields

+[more]ref_ptr<Light> _light +

+ +

+

Protected Methods

+[more]virtual ~LightSource() +
+[more]virtual const bool computeBound() const +

+ +
+

Inherited from Node:

+
+

+

Public Methods

+ovirtual void ascend(NodeVisitor& nv) +
+ovirtual void traverse(NodeVisitor& ) +
+oinline void setName( const std::string& name ) +
+oinline void setName( const char* name ) +
+oinline const std::string& getName() const +
+oinline const ParentList& getParents() const +
+oinline Group* getParent(const int i) +
+oinline const Group* getParent(const int i) const +
+oinline const int getNumParents() const +
+oinline void setUserData(void* data, MemoryAdapter* ma=0L) +
+oinline void* getUserData() +
+oinline const void* getUserData() const +
+oinline MemoryAdapter* getMemoryAdapter() +
+oinline const MemoryAdapter* getMemoryAdapter() const +
+oinline void setNodeMask(const NodeMask nm) +
+oinline const NodeMask getNodeMask() const +
+oinline const DescriptionList& getDescriptions() const +
+oinline DescriptionList& getDescriptions() +
+oinline const std::string& getDescription(const int i) const +
+oinline std::string& getDescription(const int i) +
+oinline const int getNumDescriptions() const +
+ovoid addDescription(const std::string& desc) +
+oinline void setStateSet(osg::StateSet* dstate) +
+oinline osg::StateSet* getStateSet() +
+oinline const osg::StateSet* getStateSet() const +
+oinline const BoundingSphere& getBound() const +
+ovoid dirtyBound() +

+ +

+

Public Members

+otypedef std::vector<Group*> ParentList +
+otypedef std::vector<std::string> DescriptionList +

+ +

+

Protected Fields

+omutable BoundingSphere _bsphere +
+omutable bool _bsphere_computed +
+ostd::string _name +
+oParentList _parents +
+ovoid* _userData +
+oref_ptr<MemoryAdapter> _memoryAdapter +
+oNodeMask _nodeMask +
+oDescriptionList _descriptions +
+oref_ptr<StateSet> _dstate +

+ +
+

Inherited from Object:

+
+
+

Inherited from Referenced:

+
+

+

Public Methods

+oinline Referenced& operator = (Referenced&) +
+oinline void ref() const +
+oinline void unref() const +
+oinline const int referenceCount() const +

+ +

+

Protected Fields

+omutable int _refCount +

+ +
+ + +
+

Documentation

+
Leaf Node for defining a light in the scene
+
+ + + +
o LightSource() +

+ + +

ovirtual Object* clone() const +

+ + +

ovirtual bool isSameKindAs(const Object* obj) const +

+ + +

ovirtual const char* className() const +

+ + +

ovirtual void accept(NodeVisitor& nv) +

+ + +

oinline void setLight(Light* light) +
Set the attached light +

+ + +

oinline Light* getLight() +
Get the attached light +

+ + +

oinline const Light* getLight() const +
Get the const attached light +

+ + +

ovirtual ~LightSource() +

+ + +

ovirtual const bool computeBound() const +

+ + +

oref_ptr<Light> _light +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/LineSegment.html b/doc/doc++/osg/LineSegment.html new file mode 100644 index 000000000..7751fca5a --- /dev/null +++ b/doc/doc++/osg/LineSegment.html @@ -0,0 +1,199 @@ + + + + + class SG_EXPORT osg::LineSegment + + + + +

class SG_EXPORT osg::LineSegment

LineSegmentment class for representing a line segment
+
+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Methods

+[more] LineSegment() +
+[more] LineSegment(const LineSegment& seg) +
+[more] LineSegment(const Vec3& s, const Vec3& e) +
+[more]virtual ~LineSegment() +
+[more]LineSegment& operator = (const LineSegment& seg) +
+[more]inline void set(const Vec3& s, const Vec3& e) +
+[more]inline Vec3& start() +
+[more]inline const Vec3& start() const +
+[more]inline Vec3& end() +
+[more]inline const Vec3& end() const +
+[more]const bool intersect(const BoundingBox& bb) const +
return true if segment intersects BoundingBox +
+[more]const bool intersect(const BoundingBox& bb, float& r1, float& r2) const +
return true if segment intersects BoundingSphere and return the intersection ratio's +
+[more]const bool intersect(const BoundingSphere& bs) const +
return true if segment intersects BoundingSphere +
+[more]const bool intersect(const BoundingSphere& bs, float& r1, float& r2) const +
return true if segment intersects BoundingSphere and return the intersection ratio's +
+[more]const bool intersect(const Vec3& v1, const Vec3& v2, const Vec3& v3, float& r) +
return true if segment intersects triangle and set ratio long segment. +
+[more]inline void mult(const LineSegment& seg, const Matrix& m) +
post multiply a segment by matrix +
+[more]inline void mult(const Matrix& m, const LineSegment& seg) +
pre multiply a segment by matrix +

+ +

+

Protected Fields

+[more]Vec3 _s +
+[more]Vec3 _e +

+ +

+

Protected Methods

+[more]static const bool intersectAndClip(Vec3& s, Vec3& e, const BoundingBox& bb) +

+ +
+

Inherited from Referenced:

+
+

+

Public Methods

+oinline void ref() const +
+oinline void unref() const +
+oinline const int referenceCount() const +

+ +

+

Protected Fields

+omutable int _refCount +

+ +
+ + +
+

Documentation

+
LineSegmentment class for representing a line segment
+
+ + + +
o LineSegment() +

+ + +

o LineSegment(const LineSegment& seg) +

+ + +

o LineSegment(const Vec3& s, const Vec3& e) +

+ + +

ovirtual ~LineSegment() +

+ + +

oLineSegment& operator = (const LineSegment& seg) +

+ + +

oinline void set(const Vec3& s, const Vec3& e) +

+ + +

oinline Vec3& start() +

+ + +

oinline const Vec3& start() const +

+ + +

oinline Vec3& end() +

+ + +

oinline const Vec3& end() const +

+ + +

oconst bool intersect(const BoundingBox& bb) const +
return true if segment intersects BoundingBox +

+ + +

oconst bool intersect(const BoundingBox& bb, float& r1, float& r2) const +
return true if segment intersects BoundingSphere and return the intersection ratio's +

+ + +

oconst bool intersect(const BoundingSphere& bs) const +
return true if segment intersects BoundingSphere +

+ + +

oconst bool intersect(const BoundingSphere& bs, float& r1, float& r2) const +
return true if segment intersects BoundingSphere and return the intersection ratio's +

+ + +

oconst bool intersect(const Vec3& v1, const Vec3& v2, const Vec3& v3, float& r) +
return true if segment intersects triangle and set ratio long segment. +

+ + +

oinline void mult(const LineSegment& seg, const Matrix& m) +
post multiply a segment by matrix +

+ + +

oinline void mult(const Matrix& m, const LineSegment& seg) +
pre multiply a segment by matrix +

+ + +

ostatic const bool intersectAndClip(Vec3& s, Vec3& e, const BoundingBox& bb) +

+ + +

oVec3 _s +

+ + +

oVec3 _e +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/Material.html b/doc/doc++/osg/Material.html new file mode 100644 index 000000000..6de0046e4 --- /dev/null +++ b/doc/doc++/osg/Material.html @@ -0,0 +1,430 @@ + + + + + class SG_EXPORT osg::Material + + + + +

class SG_EXPORT osg::Material

Material - encapsulates OpenGL glMaterial state
+
+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Methods

+[more] Material() +
+[more]virtual Object* clone() const +
+[more]virtual bool isSameKindAs(const Object* obj) const +
+[more]const char* className() const +
+[more]virtual const Type getType() const +
+[more]virtual void setStateSetModes(StateSet& ds, const GLModeValue value) const +
+[more]virtual void apply(State& state) const +
+[more]inline void setColorMode(const ColorMode mode) +
+[more]inline const ColorMode getColorMode() const +
+[more]void setAmbient( const Face face, const Vec4& ambient ) +
+[more]const Vec4& getAmbient(const Face face) const +
+[more]inline const bool getAmbientFrontAndBack() const +
+[more]void setDiffuse( const Face face, const Vec4& diffuse ) +
+[more]const Vec4& getDiffuse(const Face face) const +
+[more]inline const bool getDiffuseFrontAndBack() const +
+[more]void setSpecular( const Face face, const Vec4& specular ) +
Set specular value of specified face(s) of the material, valid specular[03] range is 00 to 10 +
+[more]const Vec4& getSpecular(const Face face) const +
Get the specular value for specified face +
+[more]inline const bool getSpecularFrontAndBack() const +
Get the whether specular values are equal for front and back faces +
+[more]void setEmission( const Face face, const Vec4& emission ) +
Set emmision value of specified face(s) of the material, valid emmison[03] range is 00 to 10 +
+[more]const Vec4& getEmission(const Face face) const +
Get the emmsion value for specified face +
+[more]inline const bool getEmissionFrontAndBack() const +
Get the whether emmision values are equal for front and back faces +
+[more]void setShininess( const Face face, float shininess ) +
Set shininess of specified face(s) of the material, valid shininess range is 00 to 10 +
+[more]const float getShininess(const Face face) const +
Get the shininess value for specified face +
+[more]inline const bool getShininessFrontAndBack() const +
Get the whether shininess values are equal for front and back faces +
+[more]void setTransparency(const Face face, float trans) +
Set the alpha value of ambient,diffuse,specular and emmission colors, of specified face, to 1-transparancy. +
+[more]void setAlpha(const Face face, float alpha) +
Set the alpha value of ambient,diffuse,specular and emmission colors. +

+ +

+

Public Members

+[more]enum Face +
+[more]enum ColorMode +

+ +

+

Protected Fields

+[more]ColorMode _colorMode +
+[more]bool _ambientFrontAndBack +
+[more]Vec4 _ambientFront +
+[more]Vec4 _ambientBack +
+[more]bool _diffuseFrontAndBack +
+[more]Vec4 _diffuseFront +
+[more]Vec4 _diffuseBack +
+[more]bool _specularFrontAndBack +
+[more]Vec4 _specularFront +
+[more]Vec4 _specularBack +
+[more]bool _emissionFrontAndBack +
+[more]Vec4 _emissionFront +
+[more]Vec4 _emissionBack +
+[more]bool _shininessFrontAndBack +
+[more]float _shininessFront +
+[more]float _shininessBack +

+ +

+

Protected Methods

+[more]virtual ~Material() +

+ +
+

Inherited from StateAttribute:

+
+

+

Public Methods

+ovirtual void compile(State&) const +

+ +

+

Public Members

+otypedef GLenum GLMode +
+otypedef unsigned int GLModeValue +
+otypedef unsigned int OverrideValue +
+oenum Values +
+oenum Type +

+ +
+

Inherited from Object:

+
+
+

Inherited from Referenced:

+
+

+

Public Methods

+oinline Referenced& operator = (Referenced&) +
+oinline void ref() const +
+oinline void unref() const +
+oinline const int referenceCount() const +

+ +

+

Protected Fields

+omutable int _refCount +

+ +
+ + +
+

Documentation

+
Material - encapsulates OpenGL glMaterial state
+
+ + + +
o Material() +

+ + +

ovirtual Object* clone() const +

+ + +

ovirtual bool isSameKindAs(const Object* obj) const +

+ + +

oconst char* className() const +

+ + +

ovirtual const Type getType() const +

+ + +

ovirtual void setStateSetModes(StateSet& ds, const GLModeValue value) const +

+ + +

ovirtual void apply(State& state) const +

+ + +

oenum Face +

+ + + +
o FRONT +

+ + +

o BACK +

+ + +

o FRONT_AND_BACK +

+ + + +
oenum ColorMode +

+ + + +
o AMBIENT +

+ + +

o DIFFUSE +

+ + +

o SPECULAR +

+ + +

o EMISSION +

+ + +

o AMBIENT_AND_DIFFUSE +

+ + +

o OFF +

+ + + +
oinline void setColorMode(const ColorMode mode) +

+ + +

oinline const ColorMode getColorMode() const +

+ + +

ovoid setAmbient( const Face face, const Vec4& ambient ) +

+ + +

oconst Vec4& getAmbient(const Face face) const +

+ + +

oinline const bool getAmbientFrontAndBack() const +

+ + +

ovoid setDiffuse( const Face face, const Vec4& diffuse ) +

+ + +

oconst Vec4& getDiffuse(const Face face) const +

+ + +

oinline const bool getDiffuseFrontAndBack() const +

+ + +

ovoid setSpecular( const Face face, const Vec4& specular ) +
Set specular value of specified face(s) of the material, +valid specular[03] range is 00 to 10 +

+ + +

oconst Vec4& getSpecular(const Face face) const +
Get the specular value for specified face +

+ + +

oinline const bool getSpecularFrontAndBack() const +
Get the whether specular values are equal for front and back faces +

+ + +

ovoid setEmission( const Face face, const Vec4& emission ) +
Set emmision value of specified face(s) of the material, +valid emmison[03] range is 00 to 10 +

+ + +

oconst Vec4& getEmission(const Face face) const +
Get the emmsion value for specified face +

+ + +

oinline const bool getEmissionFrontAndBack() const +
Get the whether emmision values are equal for front and back faces +

+ + +

ovoid setShininess( const Face face, float shininess ) +
Set shininess of specified face(s) of the material, valid shininess range is 00 to 10 +

+ + +

oconst float getShininess(const Face face) const +
Get the shininess value for specified face +

+ + +

oinline const bool getShininessFrontAndBack() const +
Get the whether shininess values are equal for front and back faces +

+ + +

ovoid setTransparency(const Face face, float trans) +
Set the alpha value of ambient,diffuse,specular and emmission colors, +of specified face, to 1-transparancy. Valid transparancy range is 0.0 to 1.0. +

+ + +

ovoid setAlpha(const Face face, float alpha) +
Set the alpha value of ambient,diffuse,specular and emmission colors. +Valid transparancy range is 0.0 to 1.0. +

+ + +

ovirtual ~Material() +

+ + +

oColorMode _colorMode +

+ + +

obool _ambientFrontAndBack +

+ + +

oVec4 _ambientFront +

+ + +

oVec4 _ambientBack +

+ + +

obool _diffuseFrontAndBack +

+ + +

oVec4 _diffuseFront +

+ + +

oVec4 _diffuseBack +

+ + +

obool _specularFrontAndBack +

+ + +

oVec4 _specularFront +

+ + +

oVec4 _specularBack +

+ + +

obool _emissionFrontAndBack +

+ + +

oVec4 _emissionFront +

+ + +

oVec4 _emissionBack +

+ + +

obool _shininessFrontAndBack +

+ + +

ofloat _shininessFront +

+ + +

ofloat _shininessBack +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/Matrix.html b/doc/doc++/osg/Matrix.html new file mode 100644 index 000000000..f81bede82 --- /dev/null +++ b/doc/doc++/osg/Matrix.html @@ -0,0 +1,343 @@ + + + + + class SG_EXPORT osg::Matrix + + + + +

class SG_EXPORT osg::Matrix

4x4 Matrix for storage & manipulation of transformations in scene graph.
+
+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Fields

+[more]float _mat[4][4] +

+ +

+

Public Methods

+[more] Matrix() +
+[more] Matrix(const Matrix& matrix) +
+[more] Matrix( float a00, float a01, float a02, float a03, float a10, float a11, float a12, float a13, float a20, float a21, float a22, float a23, float a30, float a31, float a32, float a33) +
+[more]Matrix& operator = (const Matrix& matrix) +
+[more]virtual ~Matrix() +
+[more]virtual Object* clone() const +
+[more]virtual bool isSameKindAs(const Object* obj) const +
+[more]virtual const char* className() const +
+[more]void makeIdent() +
+[more]void set(const float* m) +
+[more]void set( float a00, float a01, float a02, float a03, float a10, float a11, float a12, float a13, float a20, float a21, float a22, float a23, float a30, float a31, float a32, float a33) +
+[more]void copy(const Matrix& matrix) +
+[more]void makeScale(float sx, float sy, float sz) +
+[more]void preScale( float sx, float sy, float sz, const Matrix& m ) +
+[more]void postScale( const Matrix& m, float sx, float sy, float sz ) +
+[more]void preScale( float sx, float sy, float sz ) +
+[more]void postScale( float sx, float sy, float sz ) +
+[more]void makeTrans( float tx, float ty, float tz ) +
+[more]void preTrans( float tx, float ty, float tz, const Matrix& m ) +
+[more]void postTrans( const Matrix& m, float tx, float ty, float tz ) +
+[more]void preTrans( float tx, float ty, float tz ) +
+[more]void postTrans( float tx, float ty, float tz ) +
+[more]void makeRot( const Vec3& old_vec, const Vec3& new_vec ) +
Calc the rotation matrix which aligns vector \a old_vec with vector \a new_vec. +
+[more]void makeRot( float deg, float x, float y, float z ) +
+[more]void preRot( float deg, float x, float y, float z, const Matrix& m ) +
+[more]void postRot( const Matrix& m, float deg, float x, float y, float z ) +
+[more]void preRot( float deg, float x, float y, float z ) +
+[more]void postRot( float deg, float x, float y, float z ) +
+[more]void setTrans( float tx, float ty, float tz ) +
+[more]void setTrans( const Vec3& v ) +
+[more]Vec3 getTrans() const +
+[more]void preMult(const Matrix& m) +
+[more]void postMult(const Matrix& m) +
+[more]void mult(const Matrix& lhs, const Matrix& rhs) +
+[more]Matrix operator * (const Matrix& m) const +
+[more]inline static Vec3 transform3x3(const Vec3& v, const Matrix& m) +
apply apply an 3x3 transform of v*M[02,02] +
+[more]inline static Vec3 transform3x3(const Matrix& m, const Vec3& v) +
apply apply an 3x3 transform of M[02,02]*v +
+[more]bool invert(const Matrix& m) +
+[more]inline Vec3 operator * (const Vec3& v) const +
post multipy v. +
+[more]inline Vec4 operator * (const Vec4& v) const +
post multipy v. +
+[more]inline Vec3 transform3x3(const Vec3& v, const Matrix& m) +
+[more]inline Vec3 transform3x3(const Matrix& m, const Vec3& v) +

+ +
+

Inherited from Object:

+
+
+

Inherited from Referenced:

+
+

+

Public Methods

+oinline void ref() const +
+oinline void unref() const +
+oinline const int referenceCount() const +

+ +

+

Protected Fields

+omutable int _refCount +

+ +
+ + +
+

Documentation

+
4x4 Matrix for storage & manipulation of transformations in scene graph. +Provides basic maths operations, IO and via osg::Object reference counting. +You can directly load the matrix with OpenGL's LoadMatrixf() function via +the public member _mat as the matrix is stored in the OpenGL format. +Caution: The disadvantage of this feature is, that the matrix access is +'transposed' if you compare it with the standard C/C++ 2d-array-access +convention . I.e. _mat[i][j] accesses the ith column of the jth row in the +4x4 matrix.
+
+ + + +
o Matrix() +

+ + +

o Matrix(const Matrix& matrix) +

+ + +

o Matrix( float a00, float a01, float a02, float a03, float a10, float a11, float a12, float a13, float a20, float a21, float a22, float a23, float a30, float a31, float a32, float a33) +

+ + +

oMatrix& operator = (const Matrix& matrix) +

+ + +

ovirtual ~Matrix() +

+ + +

ovirtual Object* clone() const +

+ + +

ovirtual bool isSameKindAs(const Object* obj) const +

+ + +

ovirtual const char* className() const +

+ + +

ovoid makeIdent() +

+ + +

ovoid set(const float* m) +

+ + +

ovoid set( float a00, float a01, float a02, float a03, float a10, float a11, float a12, float a13, float a20, float a21, float a22, float a23, float a30, float a31, float a32, float a33) +

+ + +

ovoid copy(const Matrix& matrix) +

+ + +

ovoid makeScale(float sx, float sy, float sz) +

+ + +

ovoid preScale( float sx, float sy, float sz, const Matrix& m ) +

+ + +

ovoid postScale( const Matrix& m, float sx, float sy, float sz ) +

+ + +

ovoid preScale( float sx, float sy, float sz ) +

+ + +

ovoid postScale( float sx, float sy, float sz ) +

+ + +

ovoid makeTrans( float tx, float ty, float tz ) +

+ + +

ovoid preTrans( float tx, float ty, float tz, const Matrix& m ) +

+ + +

ovoid postTrans( const Matrix& m, float tx, float ty, float tz ) +

+ + +

ovoid preTrans( float tx, float ty, float tz ) +

+ + +

ovoid postTrans( float tx, float ty, float tz ) +

+ + +

ovoid makeRot( const Vec3& old_vec, const Vec3& new_vec ) +
+Calc the rotation matrix which aligns vector \a old_vec with +vector \a new_vec. Both \a old_vec and \a new_vec must have +length 1.0. +

+ + +

ovoid makeRot( float deg, float x, float y, float z ) +

+ + +

ovoid preRot( float deg, float x, float y, float z, const Matrix& m ) +

+ + +

ovoid postRot( const Matrix& m, float deg, float x, float y, float z ) +

+ + +

ovoid preRot( float deg, float x, float y, float z ) +

+ + +

ovoid postRot( float deg, float x, float y, float z ) +

+ + +

ovoid setTrans( float tx, float ty, float tz ) +

+ + +

ovoid setTrans( const Vec3& v ) +

+ + +

oVec3 getTrans() const +

+ + +

ovoid preMult(const Matrix& m) +

+ + +

ovoid postMult(const Matrix& m) +

+ + +

ovoid mult(const Matrix& lhs, const Matrix& rhs) +

+ + +

oMatrix operator * (const Matrix& m) const +

+ + +

oinline static Vec3 transform3x3(const Vec3& v, const Matrix& m) +
apply apply an 3x3 transform of v*M[02,02] +

+ + +

oinline static Vec3 transform3x3(const Matrix& m, const Vec3& v) +
apply apply an 3x3 transform of M[02,02]*v +

+ + +

obool invert(const Matrix& m) +

+ + +

ofloat _mat[4][4] +

+ + +

oinline Vec3 operator * (const Vec3& v) const +
post multipy v. ie. (m*v) +

+ + +

oinline Vec4 operator * (const Vec4& v) const +
post multipy v. ie. (m*v) +

+ + +

oinline Vec3 transform3x3(const Vec3& v, const Matrix& m) +

+ + +

oinline Vec3 transform3x3(const Matrix& m, const Vec3& v) +

+ +
This class has no child classes.
+ +
Friends:
inline Vec3 operator * (const Vec3& v,const Matrix& m)
inline Vec4 operator * (const Vec4& v,const Matrix& m)
inline ostream& operator << (ostream& output, const Matrix& matrix)

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/MemoryAdapter.html b/doc/doc++/osg/MemoryAdapter.html new file mode 100644 index 000000000..6bc5f91f6 --- /dev/null +++ b/doc/doc++/osg/MemoryAdapter.html @@ -0,0 +1,106 @@ + + + + + class SG_EXPORT osg::MemoryAdapter + + + + +

class SG_EXPORT osg::MemoryAdapter

Class for adapting the memory management of external data.
+
+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Methods

+[more] MemoryAdapter() +
+[more]virtual void ref_data(void* ) = 0 +
Increment the reference count of the userData +
+[more]virtual void unref_data(void* ) = 0 +
Decrement the reference count of the userData. +
+[more]virtual void* clone_data(void* ) +
not current used, but will be used in future +

+ +

+

Protected Methods

+[more]virtual ~MemoryAdapter() +

+ +
+

Inherited from Referenced:

+
+

+

Public Methods

+oinline Referenced& operator = (Referenced&) +
+oinline void ref() const +
+oinline void unref() const +
+oinline const int referenceCount() const +

+ +

+

Protected Fields

+omutable int _refCount +

+ +
+ + +
+

Documentation

+
Class for adapting the memory management of external data. +Typically used to specify the memory management of user data +which can be attached to osg::Node.
+
+ + + +
o MemoryAdapter() +

+ + +

ovirtual void ref_data(void* ) = 0 +
Increment the reference count of the userData +

+ + +

ovirtual void unref_data(void* ) = 0 +
Decrement the reference count of the userData. +Is usually implemented such that if reference count +is decremented to zero the userData should be +deleted. However, this is entirely up to the +discression of the user who is extending this base class. +

+ + +

ovirtual void* clone_data(void* ) +
not current used, but will be used in future +

+ + +

ovirtual ~MemoryAdapter() +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/NavigatorButton.class b/doc/doc++/osg/NavigatorButton.class new file mode 100644 index 000000000..5fa134ee0 Binary files /dev/null and b/doc/doc++/osg/NavigatorButton.class differ diff --git a/doc/doc++/osg/Node.html b/doc/doc++/osg/Node.html new file mode 100644 index 000000000..194be6796 --- /dev/null +++ b/doc/doc++/osg/Node.html @@ -0,0 +1,440 @@ + + + + + class SG_EXPORT osg::Node + + + + +

class SG_EXPORT osg::Node

Base class for all internal nodes in the scene graph.
+
+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Methods

+[more] Node() +
Construct a node. +
+[more]virtual Object* clone() const +
return a shallow copy of a node, with Object* return type +
+[more]virtual bool isSameKindAs(const Object* obj) const +
return true if this and obj are of the same kind of object +
+[more]virtual const char* className() const +
return the name of the node's class type +
+[more]virtual void accept(NodeVisitor& nv) +
Visitor Pattern : calls the apply method of a NodeVisitor with this node's type +
+[more]virtual void ascend(NodeVisitor& nv) +
Traverse upwards : calls parents' accept method with NodeVisitor +
+[more]virtual void traverse(NodeVisitor& ) +
Traverse downwards : calls children's accept method with NodeVisitor +
+[more]inline void setName( const std::string& name ) +
Set the name of node using C++ style string +
+[more]inline void setName( const char* name ) +
Set the name of node using a C style string +
+[more]inline const std::string& getName() const +
Get the name of node +
+[more]inline const ParentList& getParents() const +
Get the parent list of node. +
+[more]inline Group* getParent(const int i) +
Get the a copy of parent list of node. +
+[more]inline const Group* getParent(const int i) const +
Get a single const parent of node. +
+[more]inline const int getNumParents() const +
Get the number of parents of node. +
+[more]inline void setUserData(void* data, MemoryAdapter* ma=0L) +
Set user data. +
+[more]inline void* getUserData() +
Get user data +
+[more]inline const void* getUserData() const +
Get const user data +
+[more]inline MemoryAdapter* getMemoryAdapter() +
Get the memory adapter associated with _userData +
+[more]inline const MemoryAdapter* getMemoryAdapter() const +
Get the const memory adapter associated with _userData +
+[more]inline void setNodeMask(const NodeMask nm) +
Set the node mask. +
+[more]inline const NodeMask getNodeMask() const +
Get the node Mask. +
+[more]inline const DescriptionList& getDescriptions() const +
Get the description list of the const node +
+[more]inline DescriptionList& getDescriptions() +
Get the description list of the const node +
+[more]inline const std::string& getDescription(const int i) const +
Get a single const description of the const node +
+[more]inline std::string& getDescription(const int i) +
Get a single description of the node +
+[more]inline const int getNumDescriptions() const +
Get the number of descriptions of the node +
+[more]void addDescription(const std::string& desc) +
Add a description string to the node +
+[more]inline void setStateSet(osg::StateSet* dstate) +
set the node's StateSet +
+[more]inline osg::StateSet* getStateSet() +
return the node's StateSet +
+[more]inline const osg::StateSet* getStateSet() const +
return the node's const StateSet +
+[more]inline const BoundingSphere& getBound() const +
get the bounding sphere of node. +
+[more]void dirtyBound() +
Mark this node's bounding sphere dirty. +

+ +

+

Public Members

+[more]typedef std::vector<Group*> ParentList +
A vector of osg::Group pointers which is used to store the parent(s) of node +
+[more]typedef std::vector<std::string> DescriptionList +
A vector of std::string's which are used to describe the object +

+ +

+

Protected Fields

+[more]mutable BoundingSphere _bsphere +
+[more]mutable bool _bsphere_computed +
+[more]std::string _name +
+[more]ParentList _parents +
+[more]void* _userData +
+[more]ref_ptr<MemoryAdapter> _memoryAdapter +
+[more]NodeMask _nodeMask +
+[more]DescriptionList _descriptions +
+[more]ref_ptr<StateSet> _dstate +

+ +

+

Protected Methods

+[more]virtual ~Node() +
Node destructor. +
+[more]virtual const bool computeBound() const +
Compute the bounding sphere around Node's geometry or children. +

+ +
+

Inherited from Object:

+
+
+

Inherited from Referenced:

+
+

+

Public Methods

+oinline Referenced& operator = (Referenced&) +
+oinline void ref() const +
+oinline void unref() const +
+oinline const int referenceCount() const +

+ +

+

Protected Fields

+omutable int _refCount +

+ +
+ + +
+

Documentation

+
Base class for all internal nodes in the scene graph. +Provides interface for most common node operations (Composite Pattern).
+
+ + + +
o Node() +
Construct a node. +Initialize the parent list to empty, node name to "" and +bounding sphere dirty flag to true. +

+ + +

ovirtual Object* clone() const +
return a shallow copy of a node, with Object* return type +

+ + +

ovirtual bool isSameKindAs(const Object* obj) const +
return true if this and obj are of the same kind of object +

+ + +

ovirtual const char* className() const +
return the name of the node's class type +

+ + +

ovirtual void accept(NodeVisitor& nv) +
Visitor Pattern : calls the apply method of a NodeVisitor with this node's type +

+ + +

ovirtual void ascend(NodeVisitor& nv) +
Traverse upwards : calls parents' accept method with NodeVisitor +

+ + +

ovirtual void traverse(NodeVisitor& ) +
Traverse downwards : calls children's accept method with NodeVisitor +

+ + +

oinline void setName( const std::string& name ) +
Set the name of node using C++ style string +

+ + +

oinline void setName( const char* name ) +
Set the name of node using a C style string +

+ + +

oinline const std::string& getName() const +
Get the name of node +

+ + +

otypedef std::vector<Group*> ParentList +
A vector of osg::Group pointers which is used to store the parent(s) of node +

+ + +

oinline const ParentList& getParents() const +
Get the parent list of node. +

+ + +

oinline Group* getParent(const int i) +
Get the a copy of parent list of node. A copy is returned to +prevent modifiaction of the parent list. +

+ + +

oinline const Group* getParent(const int i) const +
+Get a single const parent of node. + +
Parameters:
i - index of the parent to get. +
Returns:
the parent i.

+ + +

oinline const int getNumParents() const +
+Get the number of parents of node. + +
Returns:
the number of parents of this node.

+ + +

oinline void setUserData(void* data, MemoryAdapter* ma=0L) +
+Set user data. See MemoryAdapter documention for details +of how to specify memory managament of _userData. +

+ + +

oinline void* getUserData() +
Get user data +

+ + +

oinline const void* getUserData() const +
Get const user data +

+ + +

oinline MemoryAdapter* getMemoryAdapter() +
Get the memory adapter associated with _userData +

+ + +

oinline const MemoryAdapter* getMemoryAdapter() const +
Get the const memory adapter associated with _userData +

+ + +

oinline void setNodeMask(const NodeMask nm) +
Set the node mask. Note, node mask is will be replaced by TraversalMask. +

+ + +

oinline const NodeMask getNodeMask() const +
Get the node Mask. Note, node mask is will be replaced by TraversalMask. +

+ + +

otypedef std::vector<std::string> DescriptionList +
A vector of std::string's which are used to describe the object +

+ + +

oinline const DescriptionList& getDescriptions() const +
Get the description list of the const node +

+ + +

oinline DescriptionList& getDescriptions() +
Get the description list of the const node +

+ + +

oinline const std::string& getDescription(const int i) const +
Get a single const description of the const node +

+ + +

oinline std::string& getDescription(const int i) +
Get a single description of the node +

+ + +

oinline const int getNumDescriptions() const +
Get the number of descriptions of the node +

+ + +

ovoid addDescription(const std::string& desc) +
Add a description string to the node +

+ + +

oinline void setStateSet(osg::StateSet* dstate) +
set the node's StateSet +

+ + +

oinline osg::StateSet* getStateSet() +
return the node's StateSet +

+ + +

oinline const osg::StateSet* getStateSet() const +
return the node's const StateSet +

+ + +

oinline const BoundingSphere& getBound() const +
get the bounding sphere of node. +Using lazy evaluation computes the bounding sphere if it is 'dirty'. +

+ + +

ovoid dirtyBound() +
Mark this node's bounding sphere dirty. +Forcing it to be computed on the next call to getBound(). +

+ + +

ovirtual ~Node() +
Node destructor. Note, is protected so that Nodes cannot +be deleted other than by being dereferenced and the reference +count being zero (see osg::Referenced), preventing the deletion +of nodes which are still in use. This also means that +Node's cannot be created on stack i.e Node node will not compile, +forcing all nodes to be created on the heap i.e Node* node += new Node(). +

+ + +

ovirtual const bool computeBound() const +
Compute the bounding sphere around Node's geometry or children. +This method is automatically called by getBound() when the bounding +sphere has been marked dirty via dirtyBound(). +

+ + +

omutable BoundingSphere _bsphere +

+ + +

omutable bool _bsphere_computed +

+ + +

ostd::string _name +

+ + +

oParentList _parents +

+ + +

ovoid* _userData +

+ + +

oref_ptr<MemoryAdapter> _memoryAdapter +

+ + +

oNodeMask _nodeMask +

+ + +

oDescriptionList _descriptions +

+ + +

oref_ptr<StateSet> _dstate +

+
+
Direct child classes: +
LightSource
+Group
+Geode
+
+ +
Friends:
Group

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/NodeAcceptOp.html b/doc/doc++/osg/NodeAcceptOp.html new file mode 100644 index 000000000..7b0005ceb --- /dev/null +++ b/doc/doc++/osg/NodeAcceptOp.html @@ -0,0 +1,51 @@ + + + + + struct osg::NodeAcceptOp + + + + +

struct osg::NodeAcceptOp

Convinience functor for assisting visiting of arrays of osg::Node's
+ +
+

+
+[more]NodeVisitor& _nv +
+[more] NodeAcceptOp(NodeVisitor& nv) +
+[more]void operator () (Node* node) +
+[more]void operator () (ref_ptr<Node> node) +

+ + + +
+

Documentation

+
Convinience functor for assisting visiting of arrays of osg::Node's
+
+ + + +
oNodeVisitor& _nv +

+ + +

o NodeAcceptOp(NodeVisitor& nv) +

+ + +

ovoid operator () (Node* node) +

+ + +

ovoid operator () (ref_ptr<Node> node) +

+

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/NodePath.html b/doc/doc++/osg/NodePath.html new file mode 100644 index 000000000..a2eb69c9a --- /dev/null +++ b/doc/doc++/osg/NodePath.html @@ -0,0 +1,20 @@ + + + + + typedef std::vector<Node*> NodePath + + + + +

typedef std::vector<Node*> NodePath

A vector of Nodes pointers which is used to describe the path from a root node to a descendant
+ + +
+

Documentation

+
A vector of Nodes pointers which is used to describe the path from a root node to a descendant
+

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/NodeVisitor.html b/doc/doc++/osg/NodeVisitor.html new file mode 100644 index 000000000..42bcdbd8f --- /dev/null +++ b/doc/doc++/osg/NodeVisitor.html @@ -0,0 +1,239 @@ + + + + + class SG_EXPORT osg::NodeVisitor + + + + +

class SG_EXPORT osg::NodeVisitor

Visitor for type safe operations on osg::Node's.
+
+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Methods

+[more] NodeVisitor(TraversalMode tm=TRAVERSE_NONE) +
+[more]virtual ~NodeVisitor() +
+[more]virtual void reset() +
Method to call to reset visitor. +
+[more]void setTraversalMode(const TraversalMode mode) +
Set the traversal mode for Node::traverse() to use when deciding which children of a node to traverse. +
+[more]inline const TraversalMode getTraversalMode() const +
Get the traversal mode +
+[more]void setTraversalVisitor(NodeVisitor* nv) +
Set a visitor to handle traversal. +
+[more]NodeVisitor* getTraversalVisitor() +
Get the traversal visitor, returns NULL if none is attached +
+[more]void traverse(Node& node) +
Inline method for passing handling traversal of a nodes. +
+[more]virtual void apply(Node& node) +
+[more]virtual void apply(Geode& node) +
+[more]virtual void apply(Billboard& node) +
+[more]virtual void apply(LightSource& node) +
+[more]virtual void apply(Group& node) +
+[more]virtual void apply(Transform& node) +
+[more]virtual void apply(Switch& node) +
+[more]virtual void apply(Sequence& node) +
+[more]virtual void apply(LOD& node) +
+[more]virtual void apply(Impostor& node) +

+ +

+

Public Members

+[more]enum TraversalMode +

+ +

+

Protected Fields

+[more]ref_ptr<NodeVisitor> _traversalVisitor +
+[more]TraversalMode _traversalMode +

+ +
+

Inherited from Referenced:

+
+

+

Public Methods

+oinline Referenced& operator = (Referenced&) +
+oinline void ref() const +
+oinline void unref() const +
+oinline const int referenceCount() const +

+ +

+

Protected Fields

+omutable int _refCount +

+ +
+ + +
+

Documentation

+
Visitor for type safe operations on osg::Node's. +Based on GOF's Visitor pattern.
+
+ + + +
oenum TraversalMode +

+ + + +
o TRAVERSE_NONE +

+ + +

o TRAVERSE_PARENTS +

+ + +

o TRAVERSE_ALL_CHILDREN +

+ + +

o TRAVERSE_ACTIVE_CHILDREN +

+ + +

o TRAVERSE_VISITOR +

+ + + +
o NodeVisitor(TraversalMode tm=TRAVERSE_NONE) +

+ + +

ovirtual ~NodeVisitor() +

+ + +

ovirtual void reset() +
Method to call to reset visitor. Useful for your visitor accumulates +state during a traversal, and you plan to resuse the visitor. +To flush that state for the next traversal than call reset() prior +to each traversal. +

+ + +

ovoid setTraversalMode(const TraversalMode mode) +
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. +

+ + +

oinline const TraversalMode getTraversalMode() const +
Get the traversal mode +

+ + +

ovoid setTraversalVisitor(NodeVisitor* nv) +
Set a visitor to handle traversal. +Overides the traverse mode setting it to TRAVERSAL_VISITOR. +

+ + +

oNodeVisitor* getTraversalVisitor() +
Get the traversal visitor, returns NULL if none is attached +

+ + +

ovoid traverse(Node& node) +
Inline method for passing handling traversal of a nodes. +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. +

+ + +

ovirtual void apply(Node& node) +

+ + +

ovirtual void apply(Geode& node) +

+ + +

ovirtual void apply(Billboard& node) +

+ + +

ovirtual void apply(LightSource& node) +

+ + +

ovirtual void apply(Group& node) +

+ + +

ovirtual void apply(Transform& node) +

+ + +

ovirtual void apply(Switch& node) +

+ + +

ovirtual void apply(Sequence& node) +

+ + +

ovirtual void apply(LOD& node) +

+ + +

ovirtual void apply(Impostor& node) +

+ + +

oref_ptr<NodeVisitor> _traversalVisitor +

+ + +

oTraversalMode _traversalMode +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/NotifySeverity.html b/doc/doc++/osg/NotifySeverity.html new file mode 100644 index 000000000..4454a7108 --- /dev/null +++ b/doc/doc++/osg/NotifySeverity.html @@ -0,0 +1,73 @@ + + + + + enum osg::NotifySeverity + + + + +

enum osg::NotifySeverity

Range of notify levels from DEBUG_FP through to FATAL, ALWAYS is reserved for forcing the absorption of all messages.
+ +
+

+
+[more] ALWAYS +
+[more] FATAL +
+[more] WARN +
+[more] NOTICE +
+[more] INFO +
+[more] DEBUG_INFO +
+[more] DEBUG_FP +

+ + + +
+

Documentation

+
Range of notify levels from DEBUG_FP through to FATAL, ALWAYS +is reserved for forcing the absorption of all messages. The +keywords are also used verbatim when specified by the environmental +variable OSGNOTIFYLEVEL. See documentation on osg::notify() for +further details.
+
+ + + +
o ALWAYS +

+ + +

o FATAL +

+ + +

o WARN +

+ + +

o NOTICE +

+ + +

o INFO +

+ + +

o DEBUG_INFO +

+ + +

o DEBUG_FP +

+

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/OSG_GL_DEBUG.html b/doc/doc++/osg/OSG_GL_DEBUG.html new file mode 100644 index 000000000..d5b10f3bd --- /dev/null +++ b/doc/doc++/osg/OSG_GL_DEBUG.html @@ -0,0 +1,21 @@ + + + + + #define osg::OSG_GL_DEBUG + + + + +

#define osg::OSG_GL_DEBUG

(message)

macro for use with osg::StateAttrbiute::apply methods for detected and reporting OpenGL error messages
+ + +
+

Documentation

+
macro for use with osg::StateAttrbiute::apply methods for detected and +reporting OpenGL error messages
+

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/Object.html b/doc/doc++/osg/Object.html new file mode 100644 index 000000000..9cd9fc2dd --- /dev/null +++ b/doc/doc++/osg/Object.html @@ -0,0 +1,122 @@ + + + + + class SG_EXPORT osg::Object + + + + +

class SG_EXPORT osg::Object

Base class/standard interface for objects which require IO support, cloning and reference counting.
+
+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Methods

+[more] Object() +
Construct an object. +
+[more]virtual Object* clone() const = 0 +
return a shallow copy of a node, with Object* return type. +
+[more]virtual bool isSameKindAs(const Object*) const +
+[more]virtual const char* className() const = 0 +
return the name of the object's class type. +

+ +

+

Protected Methods

+[more]virtual ~Object() +
Object destructor. +

+ +
+

Inherited from Referenced:

+
+

+

Public Methods

+oinline Referenced& operator = (Referenced&) +
+oinline void ref() const +
+oinline void unref() const +
+oinline const int referenceCount() const +

+ +

+

Protected Fields

+omutable int _refCount +

+ +
+ + +
+

Documentation

+
Base class/standard interface for objects which require IO support, +cloning and reference counting. +Based on GOF Composite, Prototype and Template Method patterns.
+
+ + + +
o Object() +
Construct an object. Note Object is a pure virtual base class +and therefore cannot be constructed on its own, only derived +classes which overide the clone and className methods are +concrete classes and can be constructed. +

+ + +

ovirtual Object* clone() const = 0 +
return a shallow copy of a node, with Object* return type. +Must be defined by derived classes. +

+ + +

ovirtual bool isSameKindAs(const Object*) const +

+ + +

ovirtual const char* className() const = 0 +
return the name of the object's class type. Must be defined +by derived classes. +

+ + +

ovirtual ~Object() +
Object destructor. Note, is protected so that Objects cannot +be deleted other than by being derefernced and the reference +count being zero (see osg::Referenced), preventing the deletion +of nodes which are still in use. This also means that +Node's cannot be created on stack i.e Node node will not compile, +forcing all nodes to be created on the heap i.e Node* node += new Node(). +

+
+
Direct child classes: +
StateSet
+StateAttribute
+Node
+Matrix
+Image
+Drawable
+
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/Plane.html b/doc/doc++/osg/Plane.html new file mode 100644 index 000000000..dc27cb08d --- /dev/null +++ b/doc/doc++/osg/Plane.html @@ -0,0 +1,222 @@ + + + + + class SG_EXPORT osg::Plane + + + + +

class SG_EXPORT osg::Plane

A plane class.
+
+ +
+

+

Public Methods

+[more]inline Plane() +
+[more]inline Plane(const Plane& pl) +
+[more]inline Plane(const float a, const float b, const float c, const float d) +
+[more]inline Plane(const Vec4& vec) +
+[more]inline Plane(const Vec3& norm, const float d) +
+[more]inline Plane(const Vec3& v1, const Vec3& v2, const Vec3& v3) +
+[more]inline Plane& operator = (const Plane& pl) +
+[more]inline void set(const Plane& pl) +
+[more]inline void set(const float a, const float b, const float c, const float d) +
+[more]inline void set(const Vec4& vec) +
+[more]inline void set(const Vec3& norm, const float d) +
+[more]inline void set(const Vec3& v1, const Vec3& v2, const Vec3& v3) +
+[more]inline void makeUnitLength() +
+[more]inline void calculateUpperLowerBBCorners() +
calculate the upper and lower bounding box corners to be used in the intersect(BoundingBox&) method for speeding calculations +
+[more]inline const bool valid() const +
+[more]inline Vec4& asVec4() +
+[more]inline const Vec4& asVec4() const +
+[more]inline float& operator [] (const int i) +
+[more]inline float operator [] (const int i) const +
+[more]inline const float distance(const osg::Vec3& v) const +
calculate the distance between a point and the plane +
+[more]inline const int intersect(const BoundingSphere& bs) const +
interesection test between plane and bounding sphere. +
+[more]inline const int intersect(const BoundingBox& bb) const +
interesection test between plane and bounding sphere. +
+[more]inline void transform(const osg::Matrix& matrix) +
Transform the plane by matrix. +
+[more]inline void transformProvidingInverse(const osg::Matrix& matrix) +
Transform the plane by provide a pre inverted matrix. +

+ +

+

Protected Fields

+[more]Vec4 _fv +
+[more]unsigned int _upperBBCorner +
+[more]unsigned int _lowerBBCorner +

+ +
+ + +
+

Documentation

+
A plane class. It can be used to represent an infinite plane.
+
+ + + +
oinline Plane() +

+ + +

oinline Plane(const Plane& pl) +

+ + +

oinline Plane(const float a, const float b, const float c, const float d) +

+ + +

oinline Plane(const Vec4& vec) +

+ + +

oinline Plane(const Vec3& norm, const float d) +

+ + +

oinline Plane(const Vec3& v1, const Vec3& v2, const Vec3& v3) +

+ + +

oinline Plane& operator = (const Plane& pl) +

+ + +

oinline void set(const Plane& pl) +

+ + +

oinline void set(const float a, const float b, const float c, const float d) +

+ + +

oinline void set(const Vec4& vec) +

+ + +

oinline void set(const Vec3& norm, const float d) +

+ + +

oinline void set(const Vec3& v1, const Vec3& v2, const Vec3& v3) +

+ + +

oinline void makeUnitLength() +

+ + +

oinline void calculateUpperLowerBBCorners() +
calculate the upper and lower bounding box corners to be used +in the intersect(BoundingBox&) method for speeding calculations +

+ + +

oinline const bool valid() const +

+ + +

oinline Vec4& asVec4() +

+ + +

oinline const Vec4& asVec4() const +

+ + +

oinline float& operator [] (const int i) +

+ + +

oinline float operator [] (const int i) const +

+ + +

oinline const float distance(const osg::Vec3& v) const +
calculate the distance between a point and the plane +

+ + +

oinline const int intersect(const BoundingSphere& bs) const +
interesection test between plane and bounding sphere. +return 1 if the bs is completely above plane, +return 0 if the bs intersects the plane, +return -1 if the bs is completely below the plane. +

+ + +

oinline const int intersect(const BoundingBox& bb) const +
interesection test between plane and bounding sphere. +return 1 if the bs is completely above plane, +return 0 if the bs intersects the plane, +return -1 if the bs is completely below the plane. +

+ + +

oinline void transform(const osg::Matrix& matrix) +
Transform the plane by matrix. Note, this operations carries out +the calculation of the inverse of the matrix since to transforms +planes must be multiplied my the inverse transposed. This +make this operation expensive. If the inverse has been already +calculated elsewhere then use transformProvidingInverse() instead. +See http://www.worldserver.com/turk/computergraphics/NormalTransformations.pdf +

+ + +

oinline void transformProvidingInverse(const osg::Matrix& matrix) +
Transform the plane by provide a pre inverted matrix. +see transform for details. +

+ + +

oVec4 _fv +

+ + +

ounsigned int _upperBBCorner +

+ + +

ounsigned int _lowerBBCorner +

+ +
This class has no child classes.
+ +
Friends:
inline ostream& operator << (ostream& output, const Plane& pl)

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/Point.html b/doc/doc++/osg/Point.html new file mode 100644 index 000000000..9f9f06813 --- /dev/null +++ b/doc/doc++/osg/Point.html @@ -0,0 +1,199 @@ + + + + + class SG_EXPORT osg::Point + + + + +

class SG_EXPORT osg::Point

Point - encapsulates the OpenGL point smmothing and size state
+
+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Methods

+[more] Point() +
+[more]virtual Object* clone() const +
+[more]virtual bool isSameKindAs(const Object* obj) const +
+[more]virtual const char* className() const +
+[more]virtual const Type getType() const +
+[more]virtual void setStateSetModes(StateSet& ds, const GLModeValue value) const +
+[more]void setSize(const float size) +
+[more]inline const float getSize() const +
+[more]void setFadeThresholdSize(const float fadeThresholdSize) +
+[more]inline const float getFadeThresholdSize() const +
+[more]void setDistanceAttenuation(const Vec3& distanceAttenuation) +
+[more]inline const Vec3& getDistanceAttenuation() const +
+[more]virtual void apply(State& state) const +
+[more]static void init_GL_EXT() +

+ +

+

Protected Fields

+[more]float _size +
+[more]float _fadeThresholdSize +
+[more]Vec3 _distanceAttenuation +

+ +

+

Protected Methods

+[more]virtual ~Point() +

+ +
+

Inherited from StateAttribute:

+
+

+

Public Methods

+ovirtual void compile(State&) const +

+ +

+

Public Members

+otypedef GLenum GLMode +
+otypedef unsigned int GLModeValue +
+otypedef unsigned int OverrideValue +
+oenum Values +
+oenum Type +

+ +
+

Inherited from Object:

+
+
+

Inherited from Referenced:

+
+

+

Public Methods

+oinline Referenced& operator = (Referenced&) +
+oinline void ref() const +
+oinline void unref() const +
+oinline const int referenceCount() const +

+ +

+

Protected Fields

+omutable int _refCount +

+ +
+ + +
+

Documentation

+
Point - encapsulates the OpenGL point smmothing and size state
+
+ + + +
o Point() +

+ + +

ovirtual Object* clone() const +

+ + +

ovirtual bool isSameKindAs(const Object* obj) const +

+ + +

ovirtual const char* className() const +

+ + +

ovirtual const Type getType() const +

+ + +

ovirtual void setStateSetModes(StateSet& ds, const GLModeValue value) const +

+ + +

ovoid setSize(const float size) +

+ + +

oinline const float getSize() const +

+ + +

ovoid setFadeThresholdSize(const float fadeThresholdSize) +

+ + +

oinline const float getFadeThresholdSize() const +

+ + +

ovoid setDistanceAttenuation(const Vec3& distanceAttenuation) +

+ + +

oinline const Vec3& getDistanceAttenuation() const +

+ + +

ovirtual void apply(State& state) const +

+ + +

ostatic void init_GL_EXT() +

+ + +

ovirtual ~Point() +

+ + +

ofloat _size +

+ + +

ofloat _fadeThresholdSize +

+ + +

oVec3 _distanceAttenuation +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/PolygonMode.html b/doc/doc++/osg/PolygonMode.html new file mode 100644 index 000000000..9e2843a30 --- /dev/null +++ b/doc/doc++/osg/PolygonMode.html @@ -0,0 +1,214 @@ + + + + + class SG_EXPORT osg::PolygonMode + + + + +

class SG_EXPORT osg::PolygonMode

Class to for setting OpenGL's polygon culling mode
+
+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Methods

+[more] PolygonMode() +
+[more]virtual bool isSameKindAs(const Object* obj) const +
+[more]virtual Object* clone() const +
+[more]virtual const char* className() const +
+[more]virtual const Type getType() const +
+[more]void setMode(const Face face, const Mode mode) +
+[more]const Mode getMode(const Face face) const +
+[more]inline const bool getFrontAndBack() const +
+[more]virtual void apply(State& state) const +

+ +

+

Public Members

+[more]enum Face +
+[more]enum Mode +

+ +

+

Protected Fields

+[more]bool _frontAndBack +
+[more]Mode _modeFront +
+[more]Mode _modeBack +

+ +

+

Protected Methods

+[more]virtual ~PolygonMode() +

+ +
+

Inherited from StateAttribute:

+
+

+

Public Methods

+ovirtual void setStateSetModes(StateSet&, const GLModeValue) const +
+ovirtual void compile(State&) const +

+ +

+

Public Members

+otypedef GLenum GLMode +
+otypedef unsigned int GLModeValue +
+otypedef unsigned int OverrideValue +
+oenum Values +
+oenum Type +

+ +
+

Inherited from Object:

+
+
+

Inherited from Referenced:

+
+

+

Public Methods

+oinline Referenced& operator = (Referenced&) +
+oinline void ref() const +
+oinline void unref() const +
+oinline const int referenceCount() const +

+ +

+

Protected Fields

+omutable int _refCount +

+ +
+ + +
+

Documentation

+
Class to for setting OpenGL's polygon culling mode
+
+ + + +
o PolygonMode() +

+ + +

ovirtual bool isSameKindAs(const Object* obj) const +

+ + +

ovirtual Object* clone() const +

+ + +

ovirtual const char* className() const +

+ + +

ovirtual const Type getType() const +

+ + +

oenum Face +

+ + + +
o FRONT +

+ + +

o BACK +

+ + +

o FRONT_AND_BACK +

+ + + +
oenum Mode +

+ + + +
o POINT +

+ + +

o LINE +

+ + +

o FILL +

+ + + +
ovoid setMode(const Face face, const Mode mode) +

+ + +

oconst Mode getMode(const Face face) const +

+ + +

oinline const bool getFrontAndBack() const +

+ + +

ovirtual void apply(State& state) const +

+ + +

ovirtual ~PolygonMode() +

+ + +

obool _frontAndBack +

+ + +

oMode _modeFront +

+ + +

oMode _modeBack +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/PolygonOffset.html b/doc/doc++/osg/PolygonOffset.html new file mode 100644 index 000000000..0f4b965c6 --- /dev/null +++ b/doc/doc++/osg/PolygonOffset.html @@ -0,0 +1,175 @@ + + + + + class SG_EXPORT osg::PolygonOffset + + + + +

class SG_EXPORT osg::PolygonOffset

PolygonOffset - encapsulates the OpenGL glPolygonOffset state
+
+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Methods

+[more] PolygonOffset() +
+[more]virtual Object* clone() const +
+[more]virtual bool isSameKindAs(const Object* obj) const +
+[more]virtual const char* className() const +
+[more]virtual const Type getType() const +
+[more]virtual void setStateSetModes(StateSet& ds, const GLModeValue value) const +
+[more]inline void setFactor(const float factor) +
+[more]inline const float getFactor() const +
+[more]inline void setUnits(const float units) +
+[more]inline const float getUnits() const +
+[more]virtual void apply(State& state) const +

+ +

+

Protected Fields

+[more]float _factor +
+[more]float _units +

+ +

+

Protected Methods

+[more]virtual ~PolygonOffset() +

+ +
+

Inherited from StateAttribute:

+
+

+

Public Methods

+ovirtual void compile(State&) const +

+ +

+

Public Members

+otypedef GLenum GLMode +
+otypedef unsigned int GLModeValue +
+otypedef unsigned int OverrideValue +
+oenum Values +
+oenum Type +

+ +
+

Inherited from Object:

+
+
+

Inherited from Referenced:

+
+

+

Public Methods

+oinline Referenced& operator = (Referenced&) +
+oinline void ref() const +
+oinline void unref() const +
+oinline const int referenceCount() const +

+ +

+

Protected Fields

+omutable int _refCount +

+ +
+ + +
+

Documentation

+
PolygonOffset - encapsulates the OpenGL glPolygonOffset state
+
+ + + +
o PolygonOffset() +

+ + +

ovirtual Object* clone() const +

+ + +

ovirtual bool isSameKindAs(const Object* obj) const +

+ + +

ovirtual const char* className() const +

+ + +

ovirtual const Type getType() const +

+ + +

ovirtual void setStateSetModes(StateSet& ds, const GLModeValue value) const +

+ + +

oinline void setFactor(const float factor) +

+ + +

oinline const float getFactor() const +

+ + +

oinline void setUnits(const float units) +

+ + +

oinline const float getUnits() const +

+ + +

ovirtual void apply(State& state) const +

+ + +

ovirtual ~PolygonOffset() +

+ + +

ofloat _factor +

+ + +

ofloat _units +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/Quat.html b/doc/doc++/osg/Quat.html new file mode 100644 index 000000000..4feb93448 --- /dev/null +++ b/doc/doc++/osg/Quat.html @@ -0,0 +1,291 @@ + + + + + class SG_EXPORT osg::Quat + + + + +

class SG_EXPORT osg::Quat

A quaternion class.
+
+ +
+

+

Public Fields

+[more]Vec4 _fv +

+ +

+

Public Methods

+[more] Quat() +
+[more] Quat( float x, float y, float z, float w ) +
+[more] Quat( const Vec4& v ) +
+[more]inline Vec4& asVec4() +
+[more]inline const Vec4& asVec4() const +
+[more]inline const Vec3 asVec3() const +
+[more]inline void set(const float x, const float y, const float z, const float w) +
+[more]inline void set(const osg::Vec4& v) +
+[more]inline const Quat operator * (const float& rhs) const +
Multiply by scalar +
+[more]inline Quat& operator *= (const float& rhs) +
Unary multiply by scalar +
+[more]inline const Quat operator*(const Quat& rhs) const +
Binary multiply +
+[more]inline Quat& operator*=(const Quat& rhs) +
Unary multiply +
+[more]inline const Quat operator / (const float& rhs) const +
Divide by scalar +
+[more]inline Quat& operator /= (const float& rhs) +
Unary divide by scalar +
+[more]inline const Quat operator/(const Quat& denom) const +
Binary divide +
+[more]inline Quat& operator/=(const Quat& denom) +
Unary divide +
+[more]inline const Quat operator + (const Quat& rhs) const +
Binary addition +
+[more]inline Quat& operator += (const Quat& rhs) +
Unary addition +
+[more]inline const Quat operator - (const Quat& rhs) const +
Binary subtraction +
+[more]inline Quat& operator -= (const Quat& rhs) +
Unary subtraction +
+[more]inline const Quat operator - () const +
Negation operator - returns the negative of the quaternion. +
+[more]const float length() const +
Length of the quaternion = sqrt( vec . +
+[more]const float length2() const +
Length of the quaternion = vec . +
+[more]inline const Quat conj() const +
Conjugate +
+[more]inline const Quat inverse() const +
Multiplicative inverse method: q^(-1) = q^*/(qq^*) +
+[more]void makeRot( const float angle, const float x, const float y, const float z ) +
+[more]void makeRot( const float angle, const Vec3& vec ) +
+[more]void makeRot( const Vec3& vec1, const Vec3& vec2 ) +
Make a rotation Quat which will rotate vec1 to vec2. +
+[more]void getRot( float& angle, float& x, float& y, float& z ) const +
Return the angle and vector components represented by the quaternion +
+[more]void getRot( float& angle, Vec3& vec ) const +
Return the angle and vector represented by the quaternion +
+[more]void slerp( const float t, const Quat& from, const Quat& to) +
Spherical Linear Interpolation. +
+[more]void set( const osg::Matrix& m ) +
Set quaternion to be equivalent to specified matrix +
+[more]void get( osg::Matrix& m ) const +
Get the equivalent matrix for this quaternion +

+ +
+ + +
+

Documentation

+
A quaternion class. It can be used to represent an orientation in 3D space.
+
+ + + +
oVec4 _fv +

+ + +

o Quat() +

+ + +

o Quat( float x, float y, float z, float w ) +

+ + +

o Quat( const Vec4& v ) +

+ + +

oinline Vec4& asVec4() +

+ + +

oinline const Vec4& asVec4() const +

+ + +

oinline const Vec3 asVec3() const +

+ + +

oinline void set(const float x, const float y, const float z, const float w) +

+ + +

oinline void set(const osg::Vec4& v) +

+ + +

oinline const Quat operator * (const float& rhs) const +
Multiply by scalar +

+ + +

oinline Quat& operator *= (const float& rhs) +
Unary multiply by scalar +

+ + +

oinline const Quat operator*(const Quat& rhs) const +
Binary multiply +

+ + +

oinline Quat& operator*=(const Quat& rhs) +
Unary multiply +

+ + +

oinline const Quat operator / (const float& rhs) const +
Divide by scalar +

+ + +

oinline Quat& operator /= (const float& rhs) +
Unary divide by scalar +

+ + +

oinline const Quat operator/(const Quat& denom) const +
Binary divide +

+ + +

oinline Quat& operator/=(const Quat& denom) +
Unary divide +

+ + +

oinline const Quat operator + (const Quat& rhs) const +
Binary addition +

+ + +

oinline Quat& operator += (const Quat& rhs) +
Unary addition +

+ + +

oinline const Quat operator - (const Quat& rhs) const +
Binary subtraction +

+ + +

oinline Quat& operator -= (const Quat& rhs) +
Unary subtraction +

+ + +

oinline const Quat operator - () const +
Negation operator - returns the negative of the quaternion. +Basically just calls operator - () on the Vec4 +

+ + +

oconst float length() const +
Length of the quaternion = sqrt( vec . vec ) +

+ + +

oconst float length2() const +
Length of the quaternion = vec . vec +

+ + +

oinline const Quat conj() const +
Conjugate +

+ + +

oinline const Quat inverse() const +
Multiplicative inverse method: q^(-1) = q^*/(qq^*) +

+ + +

ovoid makeRot( const float angle, const float x, const float y, const float z ) +

+ + +

ovoid makeRot( const float angle, const Vec3& vec ) +

+ + +

ovoid makeRot( const Vec3& vec1, const Vec3& vec2 ) +
Make a rotation Quat which will rotate vec1 to vec2. +Generally take adot product to get the angle between these +and then use a cross product to get the rotation axis +Watch out for the two special cases of when the vectors +are co-incident or opposite in direction. +

+ + +

ovoid getRot( float& angle, float& x, float& y, float& z ) const +
Return the angle and vector components represented by the quaternion +

+ + +

ovoid getRot( float& angle, Vec3& vec ) const +
Return the angle and vector represented by the quaternion +

+ + +

ovoid slerp( const float t, const Quat& from, const Quat& to) +
Spherical Linear Interpolation. +As t goes from 0 to 1, the Quat object goes from "from" to "to". +

+ + +

ovoid set( const osg::Matrix& m ) +
Set quaternion to be equivalent to specified matrix +

+ + +

ovoid get( osg::Matrix& m ) const +
Get the equivalent matrix for this quaternion +

+ +
This class has no child classes.
+ +
Friends:
inline ostream& operator << (ostream& output, const Quat& vec)

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/Referenced.html b/doc/doc++/osg/Referenced.html new file mode 100644 index 000000000..e048f582b --- /dev/null +++ b/doc/doc++/osg/Referenced.html @@ -0,0 +1,114 @@ + + + + + class SG_EXPORT osg::Referenced + + + + +

class SG_EXPORT osg::Referenced

Base class from providing referencing counted objects
+
+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Methods

+[more] Referenced() +
+[more] Referenced(const Referenced&) +
+[more]inline Referenced& operator = (Referenced&) +
+[more]inline void ref() const +
increment the reference count by one, indicating that this object has another pointer which is referencing it +
+[more]inline void unref() const +
decrement the reference count by one, indicating that a pointer to this object is referencing it. +
+[more]inline const int referenceCount() const +
return the number pointers currently referencing this object. +

+ +

+

Protected Fields

+[more]mutable int _refCount +

+ +

+

Protected Methods

+[more]virtual ~Referenced() +

+ +
+ + +
+

Documentation

+
Base class from providing referencing counted objects
+
+ + + +
o Referenced() +

+ + +

o Referenced(const Referenced&) +

+ + +

oinline Referenced& operator = (Referenced&) +

+ + +

oinline void ref() const +
increment the reference count by one, indicating that +this object has another pointer which is referencing it +

+ + +

oinline void unref() const +
decrement the reference count by one, indicating that +a pointer to this object is referencing it. If the +refence count goes to zero, it is assumed that this object +is nolonger referenced and is automatically deleted. +

+ + +

oinline const int referenceCount() const +
return the number pointers currently referencing this object. +

+ + +

ovirtual ~Referenced() +

+ + +

omutable int _refCount +

+
+
Direct child classes: +
State
+Object
+NodeVisitor
+MemoryAdapter
+LineSegment
+ImpostorSpriteManager
+Camera
+
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/State.html b/doc/doc++/osg/State.html new file mode 100644 index 000000000..4dacd7c33 --- /dev/null +++ b/doc/doc++/osg/State.html @@ -0,0 +1,243 @@ + + + + + class SG_EXPORT osg::State + + + + +

class SG_EXPORT osg::State

State class for managing a state stack.
+
+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Methods

+[more] State() +
+[more]virtual ~State() +
+[more]void pushStateSet(const StateSet* dstate) +
push stateset onto state stack +
+[more]void popStateSet() +
pop drawstate off state stack +
+[more]void reset() +
reset the state object to an empty stack +
+[more]inline const bool apply_mode(const StateAttribute::GLMode mode, const bool enabled) +
apply an OpenGL mode if required. +
+[more]inline const bool apply_attribute(const StateAttribute* attribute) +
apply an attribute if required. +
+[more]void apply(const StateSet* dstate) +
apply stateset +
+[more]void apply() +
apply the state +
+[more]void have_applied(const StateAttribute::GLMode mode, const StateAttribute::GLModeValue value) +
mode has been set externally, update state to reflect this setting +
+[more]void have_applied(const StateAttribute* attribute) +
attribute has been applied externally, update state to reflect this setting +
+[more]inline void setContextID(unsigned int contextID) +
Set the current OpenGL context uniqueID. +
+[more]inline const unsigned int getContextID() const +
Get the current OpenGL context unique ID +
+[more]inline void setFrameNumber(unsigned int fn) +
Set the frame number +
+[more]inline unsigned int getFrameNumber() const +
Get the frame number +
+[more]inline void incrementFrameNumber() +
Increment the frame number. +
+[more]void setFineGrainedErrorDetection(const bool flag) +
Set the hint to OpenGL routines to do fine grained OpenGL error checking +
+[more]const bool getFineGrainedErrorDetection() const +
Get the hint to OpenGL routines to do fine grained OpenGL error checking +

+ +
+

Inherited from Referenced:

+
+

+

Public Methods

+oinline Referenced& operator = (Referenced&) +
+oinline void ref() const +
+oinline void unref() const +
+oinline const int referenceCount() const +

+ +

+

Protected Fields

+omutable int _refCount +

+ +
+ + +
+

Documentation

+
State class for managing a state stack. +Lazy state updating is used to minize state changes.
+
+ + + +
o State() +

+ + +

ovirtual ~State() +

+ + +

ovoid pushStateSet(const StateSet* dstate) +
push stateset onto state stack +

+ + +

ovoid popStateSet() +
pop drawstate off state stack +

+ + +

ovoid reset() +
reset the state object to an empty stack +

+ + +

oinline const bool apply_mode(const StateAttribute::GLMode mode, const bool enabled) +
apply an OpenGL mode if required. +

+ + +

oinline const bool apply_attribute(const StateAttribute* attribute) +
apply an attribute if required. +

+ + +

ovoid apply(const StateSet* dstate) +
apply stateset +

+ + +

ovoid apply() +
apply the state +

+ + +

ovoid have_applied(const StateAttribute::GLMode mode, const StateAttribute::GLModeValue value) +
mode has been set externally, update state to reflect this setting +

+ + +

ovoid have_applied(const StateAttribute* attribute) +
attribute has been applied externally, update state to reflect this setting +

+ + +

oinline void setContextID(unsigned int contextID) +
Set the current OpenGL context uniqueID. +Note, it is the application developers responsiblity to +set up unique ID for each OpenGL context. This value is +then used by osg::StateAttribure's and osg::Drawable's to +help manage OpenGL display list and texture binds appropriate +for each context. +

+ + +

oinline const unsigned int getContextID() const +
Get the current OpenGL context unique ID +

+ + +

oinline void setFrameNumber(unsigned int fn) +
Set the frame number +

+ + +

oinline unsigned int getFrameNumber() const +
Get the frame number +

+ + +

oinline void incrementFrameNumber() +
Increment the frame number. Done once per frame. +

+ + +

ovoid setFineGrainedErrorDetection(const bool flag) +
Set the hint to OpenGL routines to do fine grained OpenGL error checking +

+ + +

oconst bool getFineGrainedErrorDetection() const +
Get the hint to OpenGL routines to do fine grained OpenGL error checking +

+ + + +
o ModeStack() +

+ + +

obool changed +

+ + +

obool last_applied_value +

+ + +

oValueVec valueVec +

+
+ + + +
o AttributeStack() +

+ + +

obool changed +

+ + +

oconst StateAttribute* last_applied_attribute +

+ + +

oAttributeVec attributeVec +

+
+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/StateAttribute.html b/doc/doc++/osg/StateAttribute.html new file mode 100644 index 000000000..f97f7aafe --- /dev/null +++ b/doc/doc++/osg/StateAttribute.html @@ -0,0 +1,369 @@ + + + + + class SG_EXPORT osg::StateAttribute + + + + +

class SG_EXPORT osg::StateAttribute

Base class for state attribues
+
+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Methods

+[more] StateAttribute() +
+[more]virtual Object* clone() const = 0 +
return a shallow copy of a node, with Object* return type +
+[more]virtual bool isSameKindAs(const Object* obj) const +
return true if this and obj are of the same kind of object +
+[more]virtual const char* className() const +
return the name of the attribute's class type +
+[more]virtual const Type getType() const = 0 +
return the Type idenitifer of the attribute's class type +
+[more]virtual void setStateSetModes(StateSet&, const GLModeValue) const +
+[more]virtual void apply(State&) const = 0 +
apply the OpenGL state attributes. +
+[more]virtual void compile(State&) const +
default to nothing to compile - all state is applied immediately. +

+ +

+

Public Members

+[more]typedef GLenum GLMode +
GLMode is the value used in glEnable/glDisable(mode) +
+[more]typedef unsigned int GLModeValue +
GLModeValue is used to specified whether an mode is enabled (ON) or disabled (OFF). +
+[more]typedef unsigned int OverrideValue +
Override is used to specified the override behavior of StateAttributes from from parent to children. +
+[more]enum Values +
list values which can be used in to set either GLModeValues or OverrideValues. +
+[more]enum Type +
Values of StateAttribute::Type used to aid identification of diffenent StateAttribute subclasses. +

+ +

+

Protected Methods

+[more]virtual ~StateAttribute() +

+ +
+

Inherited from Object:

+
+
+

Inherited from Referenced:

+
+

+

Public Methods

+oinline Referenced& operator = (Referenced&) +
+oinline void ref() const +
+oinline void unref() const +
+oinline const int referenceCount() const +

+ +

+

Protected Fields

+omutable int _refCount +

+ +
+ + +
+

Documentation

+
Base class for state attribues
+
+ + + +
otypedef GLenum GLMode +
GLMode is the value used in glEnable/glDisable(mode) +

+ + +

otypedef unsigned int GLModeValue +
GLModeValue is used to specified whether an mode is enabled (ON) or disabled (OFF). +GLMoveValue is also used to speficy the override behavior of modes from parent to children. +See enum Value description for more details. +

+ + +

otypedef unsigned int OverrideValue +
Override is used to specified the override behavior of StateAttributes +from from parent to children. +See enum Value description for more details. +

+ + +

oenum Values +
list values which can be used in to set either GLModeValues +or OverrideValues. When using in conjection with GLModeValues +all Values have meaning. When using in conjection with +StateAttribute OverrideValue only OFF,OVERRIDE and INHERIT +are meaningful. However, they are useful when using GLModeValue +and OverrideValue in conjunction with each other as when using +StateSet::setAttributeAndModes(..). +

+ + + +
o OFF +
means that associated GLMode and Override is disabled +

+ + +

o ON +
means that associated GLMode is enabled and Override is disabled +

+ + +

o OVERRIDE +
Overriding of GLMode's or StateAttributes is enabled +

+ + +

o OVERRIDE_OFF +
means that associated GLMode is disabled and Override is enabled +

+ + +

o OVERRIDE_ON +
means that associated GLMode and Override is enabled +

+ + +

o INHERIT +
means that GLMode or StateAttribute should in inherited from above +

+ + + +
oenum Type +
Values of StateAttribute::Type used to aid identification +of diffenent StateAttribute subclasses. Each subclass defines +it own value in the virtual Type getType() method. When +extending the osg's StateAttribute's simply define your +own Type value which is unique, using the StateAttribute::Type +enum as a guide of what values to use. If your new subclass +needs to override a standard StateAttriubte then simple use +that types value. +

+ + + +
o ALPHAFUNC +

+ + +

o ANTIALIAS +

+ + +

o COLORTABLE +

+ + +

o CULLFACE +

+ + +

o FOG +

+ + +

o FRONTFACE +

+ + +

o LIGHTING +

+ + +

o MATERIAL +

+ + +

o POINT +

+ + +

o POLYGONMODE +

+ + +

o POLYGONOFFSET +

+ + +

o TEXENV +

+ + +

o TEXGEN +

+ + +

o TEXMAT +

+ + +

o TEXTURE +

+ + +

o TEXTURE_0 +

+ + +

o TEXTURE_1 +

+ + +

o TEXTURE_2 +

+ + +

o TEXTURE_3 +

+ + +

o TRANSPARENCY +

+ + +

o STENCIL +

+ + +

o COLORMASK +

+ + +

o CLIPPLANE +

+ + +

o CLIPPLANE_0 +

+ + +

o CLIPPLANE_1 +

+ + +

o CLIPPLANE_2 +

+ + +

o CLIPPLANE_3 +

+ + +

o CLIPPLANE_4 +

+ + +

o CLIPPLANE_5 +

+ + +

o DEPTH +

+ + + +
o StateAttribute() +

+ + +

ovirtual Object* clone() const = 0 +
return a shallow copy of a node, with Object* return type +

+ + +

ovirtual bool isSameKindAs(const Object* obj) const +
return true if this and obj are of the same kind of object +

+ + +

ovirtual const char* className() const +
return the name of the attribute's class type +

+ + +

ovirtual const Type getType() const = 0 +
return the Type idenitifer of the attribute's class type +

+ + +

ovirtual void setStateSetModes(StateSet&, const GLModeValue) const +

+ + +

ovirtual void apply(State&) const = 0 +
apply the OpenGL state attributes. +The global state for the current OpenGL context is passed +in to allow the StateAttribute to obtain details on the +the current context and state. +

+ + +

ovirtual void compile(State&) const +
default to nothing to compile - all state is applied immediately. +

+ + +

ovirtual ~StateAttribute() +

+
+
Direct child classes: +
Transparency
+Texture
+TexMat
+TexGen
+TexEnv
+Stencil
+PolygonOffset
+PolygonMode
+Point
+Material
+Light
+FrontFace
+Fog
+Depth
+CullFace
+ColorMask
+ClipPlane
+AlphaFunc
+
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/StateSet.html b/doc/doc++/osg/StateSet.html new file mode 100644 index 000000000..fbec20083 --- /dev/null +++ b/doc/doc++/osg/StateSet.html @@ -0,0 +1,455 @@ + + + + + class SG_EXPORT osg::StateSet + + + + +

class SG_EXPORT osg::StateSet

Encapsulates OpenGL state modes and attributes.
+
+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Methods

+[more] StateSet() +
+[more]virtual Object* clone() const +
+[more]virtual bool isSameKindAs(const Object* obj) const +
+[more]virtual const char* className() const +
+[more]void setGlobalDefaults() +
set all the modes to on or off so that it defines a complete state, typically used for a default global state +
+[more]void setAllToInherit() +
set all the modes to inherit, typically used to signifiy nodes which inherit all of their modes for the global state +
+[more]void setMode(const StateAttribute::GLMode mode, const StateAttribute::GLModeValue value) +
set this StateSet to contain specified GLMode and value +
+[more]void setModeToInherit(const StateAttribute::GLMode mode) +
set this StateSet to inherit specified GLMode type from parents. +
+[more]const StateAttribute::GLModeValue getMode(const StateAttribute::GLMode mode) const +
get specified GLModeValue for specified GLMode. +
+[more]inline ModeList& getModeList() +
return the list of all GLModes contained in this StateSet +
+[more]inline const ModeList& getModeList() const +
return the const list of all GLModes contained in this const StateSet +
+[more]void setAttribute(StateAttribute* attribute, const StateAttribute::OverrideValue value=StateAttribute::OFF) +
set this StateSet to contain specified attribute and override flag +
+[more]void setAttributeAndModes(StateAttribute* attribute, const StateAttribute::GLModeValue value=StateAttribute::ON) +
set this StateSet to contain specified attribute and set the associated GLMode's to specifed value +
+[more]void setAttributeToInherit(const StateAttribute::Type type) +
set this StateSet to inherit specified attribute type from parents. +
+[more]const StateAttribute* getAttribute(const StateAttribute::Type type) const +
get specified StateAttribute for specified type. +
+[more]const RefAttributePair* getAttributePair(const StateAttribute::Type type) const +
get specified RefAttributePair for specified type. +
+[more]inline AttributeList& getAttributeList() +
return the list of all StateAttributes contained in this StateSet +
+[more]inline const AttributeList& getAttributeList() const +
return the const list of all StateAttributes contained in this const StateSet +
+[more]const ModeVector getModeVector() const +
get method which copies this StateSet's osg::GLModeValues's into a std::vector. +
+[more]const AttributeVector getAttributeVector() const +
get method which copies this StateSet's osg::StateAttribute's into a std::vector. +
+[more]void setRenderingHint(const int hint) +
set the RenderingHint of the StateSet. +
+[more]inline const int getRenderingHint() const +
get the RenderingHint of the StateSet +
+[more]void setRenderBinDetails(const int binNum, const std::string& binName, const RenderBinMode mode=USE_RENDERBIN_DETAILS) +
set the render bin details +
+[more]void setRendingBinToInherit() +
set the render bin details to inherit +
+[more]inline const RenderBinMode getRenderBinMode() const +
get the render bin mode +
+[more]inline const bool useRenderBinDetails() const +
get whether the render bin details are set and should be used +
+[more]inline const int getBinNumber() const +
get the render bin number +
+[more]inline const std::string& getBinName() const +
get the render bin name +
+[more]void compile(State& state) const +
call compile on all StateAttributes contained within this StateSet +

+ +

+

Public Members

+[more]typedef std::map<StateAttribute::GLMode,StateAttribute::GLModeValue> ModeList +
a container to map GLModes to their respective GLModeValues +
+[more]typedef std::pair<ref_ptr<StateAttribute>,StateAttribute::OverrideValue> RefAttributePair +
simple pairing between an attribute and its override flag +
+[more]typedef std::map<StateAttribute::Type,RefAttributePair> AttributeList +
a container to map StateAttribyte::Types to their respective RefAttributePair +
+[more]typedef std::vector<std::pair<StateAttribute::GLMode,StateAttribute::GLModeValue> > ModeVector +
tempory type def to support tempory method getModeVector +
+[more]typedef std::vector<const StateAttribute*> AttributeVector +
tempory type def to support tempory method getAttributeVector +
+[more]enum RenderingHint +
+[more]enum RenderBinMode +

+ +

+

Protected Fields

+[more]ModeList _modeList +
+[more]AttributeList _attributeList +
+[more]int _renderingHint +
+[more]RenderBinMode _binMode +
+[more]int _binNum +
+[more]std::string _binName +

+ +

+

Protected Methods

+[more]virtual ~StateSet() +
+[more] StateSet(const StateSet&) +
+[more]StateSet& operator = (const StateSet&) +

+ +
+

Inherited from Object:

+
+
+

Inherited from Referenced:

+
+

+

Public Methods

+oinline void ref() const +
+oinline void unref() const +
+oinline const int referenceCount() const +

+ +

+

Protected Fields

+omutable int _refCount +

+ +
+ + +
+

Documentation

+
+Encapsulates OpenGL state modes and attributes. +Used to specificy textures etc of osg::Drawable's which hold references +to a single osg::StateSet. StateSet can be shared between Drawable's +and is recommend if possible as it minimize expensive state changes +in the graphics pipeline.
+
+ + + +
o StateSet() +

+ + +

ovirtual Object* clone() const +

+ + +

ovirtual bool isSameKindAs(const Object* obj) const +

+ + +

ovirtual const char* className() const +

+ + +

ovoid setGlobalDefaults() +
set all the modes to on or off so that it defines a +complete state, typically used for a default global state +

+ + +

ovoid setAllToInherit() +
set all the modes to inherit, typically used to signifiy +nodes which inherit all of their modes for the global state +

+ + +

otypedef std::map<StateAttribute::GLMode,StateAttribute::GLModeValue> ModeList +
a container to map GLModes to their respective GLModeValues +

+ + +

ovoid setMode(const StateAttribute::GLMode mode, const StateAttribute::GLModeValue value) +
set this StateSet to contain specified GLMode and value +

+ + +

ovoid setModeToInherit(const StateAttribute::GLMode mode) +
set this StateSet to inherit specified GLMode type from parents. +has the effect of deleting any GlMode of specified type from StateSet. +

+ + +

oconst StateAttribute::GLModeValue getMode(const StateAttribute::GLMode mode) const +
get specified GLModeValue for specified GLMode. +returns INHERIT if no GLModeValue is contained within StateSet. +

+ + +

oinline ModeList& getModeList() +
return the list of all GLModes contained in this StateSet +

+ + +

oinline const ModeList& getModeList() const +
return the const list of all GLModes contained in this const StateSet +

+ + +

otypedef std::pair<ref_ptr<StateAttribute>,StateAttribute::OverrideValue> RefAttributePair +
simple pairing between an attribute and its override flag +

+ + +

otypedef std::map<StateAttribute::Type,RefAttributePair> AttributeList +
a container to map StateAttribyte::Types to their respective RefAttributePair +

+ + +

ovoid setAttribute(StateAttribute* attribute, const StateAttribute::OverrideValue value=StateAttribute::OFF) +
set this StateSet to contain specified attribute and override flag +

+ + +

ovoid setAttributeAndModes(StateAttribute* attribute, const StateAttribute::GLModeValue value=StateAttribute::ON) +
set this StateSet to contain specified attribute and set the associated GLMode's to specifed value +

+ + +

ovoid setAttributeToInherit(const StateAttribute::Type type) +
set this StateSet to inherit specified attribute type from parents. +has the effect of deleting any state attributes of specified type from StateSet. +

+ + +

oconst StateAttribute* getAttribute(const StateAttribute::Type type) const +
get specified StateAttribute for specified type. +returns NULL if no type is contained within StateSet. +

+ + +

oconst RefAttributePair* getAttributePair(const StateAttribute::Type type) const +
get specified RefAttributePair for specified type. +returns NULL if no type is contained within StateSet. +

+ + +

oinline AttributeList& getAttributeList() +
return the list of all StateAttributes contained in this StateSet +

+ + +

oinline const AttributeList& getAttributeList() const +
return the const list of all StateAttributes contained in this const StateSet +

+ + +

otypedef std::vector<std::pair<StateAttribute::GLMode,StateAttribute::GLModeValue> > ModeVector +
tempory type def to support tempory method getModeVector +

+ + +

oconst ModeVector getModeVector() const +
get method which copies this StateSet's osg::GLModeValues's into +a std::vector. method is overlaps on the propper get method - +getModeList and only exists to get round a crash under Windows. +Will be removed once problem is fixed. +

+ + +

otypedef std::vector<const StateAttribute*> AttributeVector +
tempory type def to support tempory method getAttributeVector +

+ + +

oconst AttributeVector getAttributeVector() const +
get method which copies this StateSet's osg::StateAttribute's into +a std::vector. method is overlaps on the propper get method - +getAttributeList and only exists to get round a crash under Windows. +Will be removed once problem is fixed. +

+ + +

oenum RenderingHint +

+ + + +
o DEFAULT_BIN +

+ + +

o OPAQUE_BIN +

+ + +

o TRANSPARENT_BIN +

+ + + +
ovoid setRenderingHint(const int hint) +
set the RenderingHint of the StateSet. +RenderingHint is used by osgUtil::Renderer to determine which +draw bin to drop associated osg::Drawables in. For opaque +objects OPAQUE_BIN would typical used, which TRANSPARENT_BIN +should be used for objects which need to be depth sorted. +

+ + +

oinline const int getRenderingHint() const +
get the RenderingHint of the StateSet +

+ + +

oenum RenderBinMode +

+ + + +
o INHERIT_RENDERBIN_DETAILS +

+ + +

o USE_RENDERBIN_DETAILS +

+ + +

o OVERRIDE_RENDERBIN_DETAILS +

+ + +

o ENCLOSE_RENDERBIN_DETAILS +

+ + + +
ovoid setRenderBinDetails(const int binNum, const std::string& binName, const RenderBinMode mode=USE_RENDERBIN_DETAILS) +
set the render bin details +

+ + +

ovoid setRendingBinToInherit() +
set the render bin details to inherit +

+ + +

oinline const RenderBinMode getRenderBinMode() const +
get the render bin mode +

+ + +

oinline const bool useRenderBinDetails() const +
get whether the render bin details are set and should be used +

+ + +

oinline const int getBinNumber() const +
get the render bin number +

+ + +

oinline const std::string& getBinName() const +
get the render bin name +

+ + +

ovoid compile(State& state) const +
call compile on all StateAttributes contained within this StateSet +

+ + +

ovirtual ~StateSet() +

+ + +

o StateSet(const StateSet&) +

+ + +

oStateSet& operator = (const StateSet&) +

+ + +

oModeList _modeList +

+ + +

oAttributeList _attributeList +

+ + +

oint _renderingHint +

+ + +

oRenderBinMode _binMode +

+ + +

oint _binNum +

+ + +

ostd::string _binName +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/Stencil.html b/doc/doc++/osg/Stencil.html new file mode 100644 index 000000000..b124cf112 --- /dev/null +++ b/doc/doc++/osg/Stencil.html @@ -0,0 +1,330 @@ + + + + + class SG_EXPORT osg::Stencil + + + + +

class SG_EXPORT osg::Stencil

Encapsulte OpenGL glStencilFunc/Op/Mask functions
+
+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Methods

+[more] Stencil() +
+[more]virtual bool isSameKindAs(const Object* obj) const +
+[more]virtual Object* clone() const +
+[more]virtual const char* className() const +
+[more]virtual const Type getType() const +
+[more]virtual void setStateSetModes(StateSet& ds, const GLModeValue value) const +
+[more]inline void setFunction(const Function func, int ref, uint mask) +
+[more]inline const Function getFunction() const +
+[more]inline const int getFunctionRef() const +
+[more]inline const uint getFunctionMask() const +
+[more]inline void setOperation(const Operation sfail, const Operation zfail, const Operation zpass) +
set the operations to apply when the various stencil and depth tests fail or pass. +
+[more]inline const Operation getStencilFailOperation() const +
get the operation when the stencil test fails +
+[more]inline const Operation getStencilPassAndDepthFailOperation() const +
get the operation when the stencil test passes but the depth test fails +
+[more]inline const Operation getStencilPassAndDepthPassOperation() const +
get the operation when both the stencil test and the depth test pass +
+[more]inline void setWriteMask(uint mask) +
+[more]inline const uint getWriteMask() const +
+[more]virtual void apply(State& state) const +

+ +

+

Public Members

+[more]enum Function +
+[more]enum Operation +

+ +

+

Protected Fields

+[more]Function _func +
+[more]int _funcRef +
+[more]uint _funcMask +
+[more]Operation _sfail +
+[more]Operation _zfail +
+[more]Operation _zpass +
+[more]uint _writeMask +

+ +

+

Protected Methods

+[more]virtual ~Stencil() +

+ +
+

Inherited from StateAttribute:

+
+

+

Public Methods

+ovirtual void compile(State&) const +

+ +

+

Public Members

+otypedef GLenum GLMode +
+otypedef unsigned int GLModeValue +
+otypedef unsigned int OverrideValue +
+oenum Values +
+oenum Type +

+ +
+

Inherited from Object:

+
+
+

Inherited from Referenced:

+
+

+

Public Methods

+oinline Referenced& operator = (Referenced&) +
+oinline void ref() const +
+oinline void unref() const +
+oinline const int referenceCount() const +

+ +

+

Protected Fields

+omutable int _refCount +

+ +
+ + +
+

Documentation

+
Encapsulte OpenGL glStencilFunc/Op/Mask functions
+
+ + + +
o Stencil() +

+ + +

ovirtual bool isSameKindAs(const Object* obj) const +

+ + +

ovirtual Object* clone() const +

+ + +

ovirtual const char* className() const +

+ + +

ovirtual const Type getType() const +

+ + +

ovirtual void setStateSetModes(StateSet& ds, const GLModeValue value) const +

+ + +

oenum Function +

+ + + +
o NEVER +

+ + +

o LESS +

+ + +

o EQUAL +

+ + +

o LEQUAL +

+ + +

o GREATER +

+ + +

o NOTEQUAL +

+ + +

o GEQUAL +

+ + +

o ALWAYS +

+ + + +
oinline void setFunction(const Function func, int ref, uint mask) +

+ + +

oinline const Function getFunction() const +

+ + +

oinline const int getFunctionRef() const +

+ + +

oinline const uint getFunctionMask() const +

+ + +

oenum Operation +

+ + + +
o KEEP +

+ + +

o ZERO +

+ + +

o REPLACE +

+ + +

o INCR +

+ + +

o DECR +

+ + +

o INVERT +

+ + + +
oinline void setOperation(const Operation sfail, const Operation zfail, const Operation zpass) +
set the operations to apply when the various stencil and depth +tests fail or pass. First paramater is to control the operation +when the stencil test fails. The second paramter is to control the +operatiorn when the stencil test passes, but depth test fails. The +third parameter controls the operation when both the stencil test +and depth pass. Ordering of parameter is the same as if using +glStencilOp(,,). +

+ + +

oinline const Operation getStencilFailOperation() const +
get the operation when the stencil test fails +

+ + +

oinline const Operation getStencilPassAndDepthFailOperation() const +
get the operation when the stencil test passes but the depth test fails +

+ + +

oinline const Operation getStencilPassAndDepthPassOperation() const +
get the operation when both the stencil test and the depth test pass +

+ + +

oinline void setWriteMask(uint mask) +

+ + +

oinline const uint getWriteMask() const +

+ + +

ovirtual void apply(State& state) const +

+ + +

ovirtual ~Stencil() +

+ + +

oFunction _func +

+ + +

oint _funcRef +

+ + +

ouint _funcMask +

+ + +

oOperation _sfail +

+ + +

oOperation _zfail +

+ + +

oOperation _zpass +

+ + +

ouint _writeMask +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/Switch.html b/doc/doc++/osg/Switch.html new file mode 100644 index 000000000..890a9c033 --- /dev/null +++ b/doc/doc++/osg/Switch.html @@ -0,0 +1,290 @@ + + + + + class SG_EXPORT osg::Switch + + + + +

class SG_EXPORT osg::Switch

Switch is a Group node which allows switching between children.
+
+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Methods

+[more] Switch() +
+[more]virtual Object* clone() const +
+[more]virtual bool isSameKindAs(const Object* obj) const +
+[more]virtual const char* className() const +
+[more]virtual void accept(NodeVisitor& nv) +
+[more]virtual void traverse(NodeVisitor& nv) +
+[more]inline void setValue(const int value) +
Selects the active child Node or enables a special SwitchType mode. +
+[more]inline const int getValue() const +
Returns the number of the active child Node or the SwitchType +

+ +

+

Public Members

+[more]enum SwitchType +
Special mode values for the Switch. +

+ +

+

Protected Fields

+[more]int _value +
The current Switch value. +

+ +

+

Protected Methods

+[more]virtual ~Switch() +

+ +
+

Inherited from Group:

+
+

+

Public Methods

+ovirtual bool addChild( Node* child ) +
+ovirtual bool removeChild( Node* child ) +
+ovirtual bool replaceChild( Node* origChild, Node* newChild ) +
+oinline const int getNumChildren() const +
+oinline Node* getChild( const int i ) +
+oinline const Node* getChild( const int i ) const +
+oinline bool containsNode( const Node* node ) const +
+oinline ChildList::iterator findNode( const Node* node ) +
+oinline ChildList::const_iterator findNode( const Node* node ) const +

+ +

+

Protected Fields

+oChildList _children +

+ +

+

Protected Methods

+ovirtual const bool computeBound() const +

+ +
+

Inherited from Node:

+
+

+

Public Methods

+ovirtual void ascend(NodeVisitor& nv) +
+oinline void setName( const std::string& name ) +
+oinline void setName( const char* name ) +
+oinline const std::string& getName() const +
+oinline const ParentList& getParents() const +
+oinline Group* getParent(const int i) +
+oinline const Group* getParent(const int i) const +
+oinline const int getNumParents() const +
+oinline void setUserData(void* data, MemoryAdapter* ma=0L) +
+oinline void* getUserData() +
+oinline const void* getUserData() const +
+oinline MemoryAdapter* getMemoryAdapter() +
+oinline const MemoryAdapter* getMemoryAdapter() const +
+oinline void setNodeMask(const NodeMask nm) +
+oinline const NodeMask getNodeMask() const +
+oinline const DescriptionList& getDescriptions() const +
+oinline DescriptionList& getDescriptions() +
+oinline const std::string& getDescription(const int i) const +
+oinline std::string& getDescription(const int i) +
+oinline const int getNumDescriptions() const +
+ovoid addDescription(const std::string& desc) +
+oinline void setStateSet(osg::StateSet* dstate) +
+oinline osg::StateSet* getStateSet() +
+oinline const osg::StateSet* getStateSet() const +
+oinline const BoundingSphere& getBound() const +
+ovoid dirtyBound() +

+ +

+

Public Members

+otypedef std::vector<Group*> ParentList +
+otypedef std::vector<std::string> DescriptionList +

+ +

+

Protected Fields

+omutable BoundingSphere _bsphere +
+omutable bool _bsphere_computed +
+ostd::string _name +
+oParentList _parents +
+ovoid* _userData +
+oref_ptr<MemoryAdapter> _memoryAdapter +
+oNodeMask _nodeMask +
+oDescriptionList _descriptions +
+oref_ptr<StateSet> _dstate +

+ +
+

Inherited from Object:

+
+
+

Inherited from Referenced:

+
+

+

Public Methods

+oinline Referenced& operator = (Referenced&) +
+oinline void ref() const +
+oinline void unref() const +
+oinline const int referenceCount() const +

+ +

+

Protected Fields

+omutable int _refCount +

+ +
+ + +
+

Documentation

+
Switch is a Group node which allows switching between children. +Typical uses would be for objects which might need to be rendered +differently at different times, for instance a switch could be used +to represent the different states of a traffic light.
+
+ + + +
oenum SwitchType +
+Special mode values for the Switch. Use these if you want to +turn on/off all child nodes. +

+ + + +
o ALL_CHILDREN_ON +
Turn on all children. +

+ + +

o ALL_CHILDREN_OFF +
Turn off all children. +

+ + + +
o Switch() +

+ + +

ovirtual Object* clone() const +

+ + +

ovirtual bool isSameKindAs(const Object* obj) const +

+ + +

ovirtual const char* className() const +

+ + +

ovirtual void accept(NodeVisitor& nv) +

+ + +

ovirtual void traverse(NodeVisitor& nv) +

+ + +

oinline void setValue(const int value) +
+Selects the active child Node or enables a special +SwitchType mode. + +
Parameters:
value - the number of the active child +(first child == number 0) or SwitchType. Invalid values +will be ignored.

+ + +

oinline const int getValue() const +
+Returns the number of the active child Node or the SwitchType +

+ + +

ovirtual ~Switch() +

+ + +

oint _value +
The current Switch value. +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/TexEnv.html b/doc/doc++/osg/TexEnv.html new file mode 100644 index 000000000..cafc810ce --- /dev/null +++ b/doc/doc++/osg/TexEnv.html @@ -0,0 +1,180 @@ + + + + + class SG_EXPORT osg::TexEnv + + + + +

class SG_EXPORT osg::TexEnv

TexEnv - encapsulates the OpenGL glTexEnv (texture environment) state
+
+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Methods

+[more] TexEnv( void ) +
+[more]virtual Object* clone() const +
+[more]virtual bool isSameKindAs(const Object* obj) const +
+[more]virtual const char* className() const +
+[more]virtual const Type getType() const +
+[more]void setMode( const Mode mode ) +
+[more]const Mode getMode() const +
+[more]virtual void apply(State& state) const +

+ +

+

Public Members

+[more]enum Mode +

+ +

+

Protected Fields

+[more]Mode _mode +

+ +

+

Protected Methods

+[more]virtual ~TexEnv( void ) +

+ +
+

Inherited from StateAttribute:

+
+

+

Public Methods

+ovirtual void setStateSetModes(StateSet&, const GLModeValue) const +
+ovirtual void compile(State&) const +

+ +

+

Public Members

+otypedef GLenum GLMode +
+otypedef unsigned int GLModeValue +
+otypedef unsigned int OverrideValue +
+oenum Values +
+oenum Type +

+ +
+

Inherited from Object:

+
+
+

Inherited from Referenced:

+
+

+

Public Methods

+oinline Referenced& operator = (Referenced&) +
+oinline void ref() const +
+oinline void unref() const +
+oinline const int referenceCount() const +

+ +

+

Protected Fields

+omutable int _refCount +

+ +
+ + +
+

Documentation

+
TexEnv - encapsulates the OpenGL glTexEnv (texture environment) state
+
+ + + +
o TexEnv( void ) +

+ + +

ovirtual Object* clone() const +

+ + +

ovirtual bool isSameKindAs(const Object* obj) const +

+ + +

ovirtual const char* className() const +

+ + +

ovirtual const Type getType() const +

+ + +

oenum Mode +

+ + + +
o DECAL +

+ + +

o MODULATE +

+ + +

o BLEND +

+ + +

o REPLACE +

+ + + +
ovoid setMode( const Mode mode ) +

+ + +

oconst Mode getMode() const +

+ + +

ovirtual void apply(State& state) const +

+ + +

ovirtual ~TexEnv( void ) +

+ + +

oMode _mode +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/TexGen.html b/doc/doc++/osg/TexGen.html new file mode 100644 index 000000000..1c20ce68c --- /dev/null +++ b/doc/doc++/osg/TexGen.html @@ -0,0 +1,242 @@ + + + + + class SG_EXPORT osg::TexGen + + + + +

class SG_EXPORT osg::TexGen

TexGen - encapsulates the OpenGL glTexGen (texture coordinate generation) state
+
+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Methods

+[more] TexGen( void ) +
+[more]virtual Object* clone() const +
+[more]virtual bool isSameKindAs(const Object* obj) const +
+[more]virtual const char* className() const +
+[more]virtual const Type getType() const +
+[more]virtual void setStateSetModes(StateSet& ds, const GLModeValue value) const +
+[more]virtual void apply(State& state) const +
+[more]inline void setMode( const Mode mode ) +
+[more]const Mode getMode() const +
+[more]void setPlane(const Coord which, const Vec4& plane) +
+[more]const Vec4& getPlane(const Coord which) const +

+ +

+

Public Members

+[more]enum Mode +
+[more]enum Coord +

+ +

+

Protected Fields

+[more]Mode _mode +
+[more]Vec4 _plane_s +
additional texgen coefficents for GL_OBJECT_PLANE or GL_EYE_PLANE, +
+[more]Vec4 _plane_t +
+[more]Vec4 _plane_r +
+[more]Vec4 _plane_q +

+ +

+

Protected Methods

+[more]virtual ~TexGen( void ) +

+ +
+

Inherited from StateAttribute:

+
+

+

Public Methods

+ovirtual void compile(State&) const +

+ +

+

Public Members

+otypedef GLenum GLMode +
+otypedef unsigned int GLModeValue +
+otypedef unsigned int OverrideValue +
+oenum Values +
+oenum Type +

+ +
+

Inherited from Object:

+
+
+

Inherited from Referenced:

+
+

+

Public Methods

+oinline Referenced& operator = (Referenced&) +
+oinline void ref() const +
+oinline void unref() const +
+oinline const int referenceCount() const +

+ +

+

Protected Fields

+omutable int _refCount +

+ +
+ + +
+

Documentation

+
TexGen - encapsulates the OpenGL glTexGen (texture coordinate generation) state
+
+ + + +
o TexGen( void ) +

+ + +

ovirtual Object* clone() const +

+ + +

ovirtual bool isSameKindAs(const Object* obj) const +

+ + +

ovirtual const char* className() const +

+ + +

ovirtual const Type getType() const +

+ + +

ovirtual void setStateSetModes(StateSet& ds, const GLModeValue value) const +

+ + +

ovirtual void apply(State& state) const +

+ + +

oenum Mode +

+ + + +
o OBJECT_LINEAR +

+ + +

o EYE_LINEAR +

+ + +

o SPHERE_MAP +

+ + + +
oinline void setMode( const Mode mode ) +

+ + +

oconst Mode getMode() const +

+ + +

oenum Coord +

+ + + +
o S +

+ + +

o T +

+ + +

o R +

+ + +

o Q +

+ + + +
ovoid setPlane(const Coord which, const Vec4& plane) +

+ + +

oconst Vec4& getPlane(const Coord which) const +

+ + +

ovirtual ~TexGen( void ) +

+ + +

oMode _mode +

+ + +

oVec4 _plane_s +
additional texgen coefficents for GL_OBJECT_PLANE or GL_EYE_PLANE, +

+ + +

oVec4 _plane_t +

+ + +

oVec4 _plane_r +

+ + +

oVec4 _plane_q +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/TexMat.html b/doc/doc++/osg/TexMat.html new file mode 100644 index 000000000..be525afee --- /dev/null +++ b/doc/doc++/osg/TexMat.html @@ -0,0 +1,167 @@ + + + + + class SG_EXPORT osg::TexMat + + + + +

class SG_EXPORT osg::TexMat

Texture Matrix state class for encapsulating OpenGL texture matrix functionality
+
+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Methods

+[more] TexMat( void ) +
+[more]virtual Object* clone() const +
+[more]virtual bool isSameKindAs(const Object* obj) const +
+[more]virtual const char* className() const +
+[more]virtual const Type getType() const +
+[more]inline void setMatrix(const Matrix& matrix) +
Set the texture matrix +
+[more]inline Matrix& getMatrix() +
Get the texture matrix +
+[more]inline const Matrix& getMatrix() const +
Get the const texture matrix +
+[more]virtual void apply(State& state) const +
apply as OpenGL texture matrix +

+ +

+

Protected Fields

+[more]Matrix _matrix +

+ +

+

Protected Methods

+[more]virtual ~TexMat( void ) +

+ +
+

Inherited from StateAttribute:

+
+

+

Public Methods

+ovirtual void setStateSetModes(StateSet&, const GLModeValue) const +
+ovirtual void compile(State&) const +

+ +

+

Public Members

+otypedef GLenum GLMode +
+otypedef unsigned int GLModeValue +
+otypedef unsigned int OverrideValue +
+oenum Values +
+oenum Type +

+ +
+

Inherited from Object:

+
+
+

Inherited from Referenced:

+
+

+

Public Methods

+oinline Referenced& operator = (Referenced&) +
+oinline void ref() const +
+oinline void unref() const +
+oinline const int referenceCount() const +

+ +

+

Protected Fields

+omutable int _refCount +

+ +
+ + +
+

Documentation

+
Texture Matrix state class for encapsulating OpenGL texture matrix functionality
+
+ + + +
o TexMat( void ) +

+ + +

ovirtual Object* clone() const +

+ + +

ovirtual bool isSameKindAs(const Object* obj) const +

+ + +

ovirtual const char* className() const +

+ + +

ovirtual const Type getType() const +

+ + +

oinline void setMatrix(const Matrix& matrix) +
Set the texture matrix +

+ + +

oinline Matrix& getMatrix() +
Get the texture matrix +

+ + +

oinline const Matrix& getMatrix() const +
Get the const texture matrix +

+ + +

ovirtual void apply(State& state) const +
apply as OpenGL texture matrix +

+ + +

ovirtual ~TexMat( void ) +

+ + +

oMatrix _matrix +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/Texture.html b/doc/doc++/osg/Texture.html new file mode 100644 index 000000000..cfb6361f5 --- /dev/null +++ b/doc/doc++/osg/Texture.html @@ -0,0 +1,633 @@ + + + + + class SG_EXPORT osg::Texture + + + + +

class SG_EXPORT osg::Texture

Texture state class which encapsulates OpenGl texture functionality
+
+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Methods

+[more] Texture() +
+[more]virtual Object* clone() const +
+[more]virtual bool isSameKindAs(const Object* obj) const +
+[more]virtual const char* className() const +
+[more]virtual const Type getType() const +
+[more]virtual void setStateSetModes(StateSet& ds, const GLModeValue value) const +
+[more]void setImage(Image* image) +
Set the texture image. +
+[more]Image* getImage() +
Get the texture image. +
+[more]inline const Image* getImage() const +
Get the const texture image. +
+[more]void copyTexImage2D(State& state, int x, int y, int width, int height ) +
Copy pixels into a 2D texture imageAs per glCopyTexImage2D. +
+[more]void copyTexSubImage2D(State& state, int xoffset, int yoffset, int x, int y, int width, int height ) +
Copy a two-dimensional texture subimage. +
+[more]inline void setTextureUnit(const unsigned int textureUnit) +
Set the texture unit. +
+[more]inline const unsigned int getTextureUnit() const +
get the texture unit +
+[more]void setWrap(const WrapParameter which, const WrapMode wrap) +
Set the texture wrap mode +
+[more]const WrapMode getWrap(const WrapParameter which) const +
Get the texture wrap mode +
+[more]void setFilter(const FilterParameter which, const FilterMode filter) +
Set the texture filter mode +
+[more]const FilterMode getFilter(const FilterParameter which) const +
Get the texture filter mode +
+[more]inline void setInternalFormatMode(const InternalFormatMode mode) +
Set the internal format mode. +
+[more]inline const InternalFormatMode getInternalFormatMode() const +
Get the internal format mode +
+[more]inline void setInternalFormatValue(const int internalFormat) +
Set the internal format to use when creating OpenGL textures. +
+[more]inline const int getInternalFormatValue() const +
Get the internal format to use when creating OpenGL textures +
+[more]inline const uint getTextureObject(const uint contextID) const +
return the OpenGL texture object for specified context +
+[more]inline const uint getTextureObjectSize() const +
return the memory size of texture object. +
+[more]inline void setSubloadMode(const SubloadMode mode) +
Set the texture subload mode. +
+[more]inline const SubloadMode getSubloadMode() const +
Get the texture subload mode. +
+[more]inline void setSubloadOffset(const int x, const int y) +
Set the texture subload offsets. +
+[more]inline void getSubloadOffset(int& x, int& y) const +
Get the texture subload offsets. +
+[more]inline uint& getHandle(const uint contextID) const +
Get the handle to the texture object for the current context +
+[more]void dirtyTextureObject() +
Force a recompile on next apply() of associated OpenGL texture objects +
+[more]virtual void apply(State& state) const +
On first apply (unless already compiled), create the minmapped texture and bind it, subsequent apply will simple bind to texture +
+[more]virtual void compile(State& state) const +
Compile the texture mip maps. +
+[more]virtual void applyImmediateMode(State& state) const +
Method which does the creation of the texture itself, and does not set or use texture binding. +
+[more]static void deleteTextureObject(uint contextID, uint handle) +
use deleteTextureObject instead of glDeleteTextures to allow OpenGL texture objects to cached until they can be deleted by the OpenGL context in which they were created, specified by contextID +
+[more]static void flushDeletedTextureObjects(uint contextID) +
flush all the cached display list which need to be deleted in the OpenGL context related to contextID +

+ +

+

Public Members

+[more]enum WrapParameter +
+[more]enum WrapMode +
+[more]enum FilterParameter +
+[more]enum FilterMode +
+[more]enum InternalFormatMode +
+[more]enum SubloadMode +

+ +

+

Protected Fields

+[more]mutable uint _textureObjectSize +
+[more]mutable ref_ptr<Image> _image +
+[more]unsigned int _textureUnit +
+[more]WrapMode _wrap_s +
+[more]WrapMode _wrap_t +
+[more]WrapMode _wrap_r +
+[more]FilterMode _min_filter +
+[more]FilterMode _mag_filter +
+[more]InternalFormatMode _internalFormatMode +
+[more]int _internalFormatValue +
+[more]mutable unsigned int _textureWidth +
+[more]mutable unsigned int _textureHeight +
+[more]SubloadMode _subloadMode +
+[more]unsigned int _subloadOffsX +
+[more]unsigned int _subloadOffsY +

+ +

+

Protected Methods

+[more]virtual ~Texture() +

+ +

+

Protected Members

+[more]typedef std::vector<uint> TextureNameList mutable TextureNameList _handleList +
+[more]typedef std::vector<uint> ImageModifiedTag mutable ImageModifiedTag _modifiedTag +
+[more]typedef std::map<uint,std::set<uint> >static DeletedTextureObjectCache DeletedTextureObjectCache s_deletedTextureObjectCache +

+ +
+

Inherited from StateAttribute:

+
+

+

Public Members

+otypedef GLenum GLMode +
+otypedef unsigned int GLModeValue +
+otypedef unsigned int OverrideValue +
+oenum Values +
+oenum Type +

+ +
+

Inherited from Object:

+
+
+

Inherited from Referenced:

+
+

+

Public Methods

+oinline Referenced& operator = (Referenced&) +
+oinline void ref() const +
+oinline void unref() const +
+oinline const int referenceCount() const +

+ +

+

Protected Fields

+omutable int _refCount +

+ +
+ + +
+

Documentation

+
Texture state class which encapsulates OpenGl texture functionality
+
+ + + +
o Texture() +

+ + +

ovirtual Object* clone() const +

+ + +

ovirtual bool isSameKindAs(const Object* obj) const +

+ + +

ovirtual const char* className() const +

+ + +

ovirtual const Type getType() const +

+ + +

ovirtual void setStateSetModes(StateSet& ds, const GLModeValue value) const +

+ + +

ovoid setImage(Image* image) +
Set the texture image. +

+ + +

oImage* getImage() +
Get the texture image. +

+ + +

oinline const Image* getImage() const +
Get the const texture image. +

+ + +

ovoid copyTexImage2D(State& state, int x, int y, int width, int height ) +
Copy pixels into a 2D texture imageAs per glCopyTexImage2D. +Creates an OpenGL texture object from the current OpenGL background +framebuffer contents at pos \a x, \a y with width \a width and +height \a height. \a width and \a height must be a power of two. +

+ + +

ovoid copyTexSubImage2D(State& state, int xoffset, int yoffset, int x, int y, int width, int height ) +
Copy a two-dimensional texture subimage. As per glCopyTexSubImage2D. +Updates portion of an exisiting OpenGL texture object from the current OpenGL background +framebuffer contents at pos \a x, \a y with width \a width and +height \a height. \a width and \a height must be a power of two, +and writing into the texture with offset \a xoffset and \a yoffset. +

+ + +

oinline void setTextureUnit(const unsigned int textureUnit) +
Set the texture unit. +Valid values are 0,1,2,3. +Default value of texture unit is 0. +note, multi-texturing not fully implemented yet... April 2001. +

+ + +

oinline const unsigned int getTextureUnit() const +
get the texture unit +

+ + +

oenum WrapParameter +

+ + + +
o WRAP_S +

+ + +

o WRAP_T +

+ + +

o WRAP_R +

+ + + +
oenum WrapMode +

+ + + +
o CLAMP +

+ + +

o REPEAT +

+ + +

o MIRROR +

+ + + +
ovoid setWrap(const WrapParameter which, const WrapMode wrap) +
Set the texture wrap mode +

+ + +

oconst WrapMode getWrap(const WrapParameter which) const +
Get the texture wrap mode +

+ + +

oenum FilterParameter +

+ + + +
o MIN_FILTER +

+ + +

o MAG_FILTER +

+ + + +
oenum FilterMode +

+ + + +
o LINEAR +

+ + +

o LINEAR_MIPMAP_LINEAR +

+ + +

o LINEAR_MIPMAP_NEAREST +

+ + +

o NEAREST +

+ + +

o NEAREST_MIPMAP_LINEAR +

+ + +

o NEAREST_MIPMAP_NEAREST +

+ + +

o ANISOTROPIC +

+ + + +
ovoid setFilter(const FilterParameter which, const FilterMode filter) +
Set the texture filter mode +

+ + +

oconst FilterMode getFilter(const FilterParameter which) const +
Get the texture filter mode +

+ + +

oenum InternalFormatMode +

+ + + +
o USE_IMAGE_DATA_FORMAT +

+ + +

o USE_USER_DEFINED_FORMAT +

+ + +

o USE_ARB_COMPRESSION +

+ + +

o USE_S3TC_DXT1_COMPRESSION +

+ + +

o USE_S3TC_DXT3_COMPRESSION +

+ + +

o USE_S3TC_DXT5_COMPRESSION +

+ + + +
oinline void setInternalFormatMode(const InternalFormatMode mode) +
Set the internal format mode. +Note, If the mode is set USE_IMAGE_DATA_FORMAT, USE_ARB_COMPRESSION, +USE_S3TC_COMPRESSION the internalFormat is automatically selected, +and will overwrite the previous _internalFormatValue. +

+ + +

oinline const InternalFormatMode getInternalFormatMode() const +
Get the internal format mode +

+ + +

oinline void setInternalFormatValue(const int internalFormat) +
Set the internal format to use when creating OpenGL textures. +Also sets the internalFormatMode to USE_USER_DEFINED_FORMAT. +

+ + +

oinline const int getInternalFormatValue() const +
Get the internal format to use when creating OpenGL textures +

+ + +

oinline const uint getTextureObject(const uint contextID) const +
return the OpenGL texture object for specified context +

+ + +

oinline const uint getTextureObjectSize() const +
return the memory size of texture object. +Texture object size can be used for estimating the cost of +uploading the texture to graphics hardware, which inturn can +be used for setting texture residence priorities. +

+ + +

oenum SubloadMode +

+ + + +
o OFF +

+ + +

o AUTO +

+ + +

o IF_DIRTY +

+ + + +
oinline void setSubloadMode(const SubloadMode mode) +
Set the texture subload mode. +

+ + +

oinline const SubloadMode getSubloadMode() const +
Get the texture subload mode. +

+ + +

oinline void setSubloadOffset(const int x, const int y) +
Set the texture subload offsets. +

+ + +

oinline void getSubloadOffset(int& x, int& y) const +
Get the texture subload offsets. +

+ + +

oinline uint& getHandle(const uint contextID) const +
Get the handle to the texture object for the current context +

+ + +

ovoid dirtyTextureObject() +
Force a recompile on next apply() of associated OpenGL texture objects +

+ + +

ovirtual void apply(State& state) const +
On first apply (unless already compiled), create the minmapped +texture and bind it, subsequent apply will simple bind to texture +

+ + +

ovirtual void compile(State& state) const +
Compile the texture mip maps. Implemented by simply calling apply(). +

+ + +

ovirtual void applyImmediateMode(State& state) const +
Method which does the creation of the texture itself, and +does not set or use texture binding. +

+ + +

ostatic void deleteTextureObject(uint contextID, uint handle) +
use deleteTextureObject instead of glDeleteTextures to allow +OpenGL texture objects to cached until they can be deleted +by the OpenGL context in which they were created, specified +by contextID +

+ + +

ostatic void flushDeletedTextureObjects(uint contextID) +
flush all the cached display list which need to be deleted +in the OpenGL context related to contextID +

+ + +

ovirtual ~Texture() +

+ + +

otypedef std::vector<uint> TextureNameList mutable TextureNameList _handleList +

+ + +

otypedef std::vector<uint> ImageModifiedTag mutable ImageModifiedTag _modifiedTag +

+ + +

omutable uint _textureObjectSize +

+ + +

omutable ref_ptr<Image> _image +

+ + +

ounsigned int _textureUnit +

+ + +

oWrapMode _wrap_s +

+ + +

oWrapMode _wrap_t +

+ + +

oWrapMode _wrap_r +

+ + +

oFilterMode _min_filter +

+ + +

oFilterMode _mag_filter +

+ + +

oInternalFormatMode _internalFormatMode +

+ + +

oint _internalFormatValue +

+ + +

omutable unsigned int _textureWidth +

+ + +

omutable unsigned int _textureHeight +

+ + +

oSubloadMode _subloadMode +

+ + +

ounsigned int _subloadOffsX +

+ + +

ounsigned int _subloadOffsY +

+ + +

otypedef std::map<uint,std::set<uint> >static DeletedTextureObjectCache DeletedTextureObjectCache s_deletedTextureObjectCache +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/Timer.html b/doc/doc++/osg/Timer.html new file mode 100644 index 000000000..2d09454ca --- /dev/null +++ b/doc/doc++/osg/Timer.html @@ -0,0 +1,86 @@ + + + + + class SG_EXPORT osg::Timer + + + + +

class SG_EXPORT osg::Timer

A high resolution, low latency time stamper
+
+ +
+

+

Public Methods

+[more] Timer( void ) +
+[more] ~Timer( void ) +
+[more]pragmaoptimize ("", off)( void ) +
+[more]pragmaoptimize("", on)(x) (".byte 0x0f, 0x31" : "=A" (x))( void ) +
+[more]inline Timer_t tick( void ) +
+[more]double delta_s( Timer_t t1, Timer_t t2 ) +
+[more]double delta_m( Timer_t t1, Timer_t t2 ) +
+[more]Timer_t delta_u( Timer_t t1, Timer_t t2 ) +
+[more]Timer_t delta_n( Timer_t t1, Timer_t t2 ) +

+ +
+ + +
+

Documentation

+
A high resolution, low latency time stamper
+
+ + + +
o Timer( void ) +

+ + +

o ~Timer( void ) +

+ + +

opragmaoptimize ("", off)( void ) +

+ + +

opragmaoptimize("", on)(x) (".byte 0x0f, 0x31" : "=A" (x))( void ) +

+ + +

oinline Timer_t tick( void ) +

+ + +

odouble delta_s( Timer_t t1, Timer_t t2 ) +

+ + +

odouble delta_m( Timer_t t1, Timer_t t2 ) +

+ + +

oTimer_t delta_u( Timer_t t1, Timer_t t2 ) +

+ + +

oTimer_t delta_n( Timer_t t1, Timer_t t2 ) +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/Transform.html b/doc/doc++/osg/Transform.html new file mode 100644 index 000000000..bc8c2d52c --- /dev/null +++ b/doc/doc++/osg/Transform.html @@ -0,0 +1,286 @@ + + + + + class SG_EXPORT osg::Transform + + + + +

class SG_EXPORT osg::Transform

Transform - is group which all children are transformed by the the Transform's osg::Matrix.
+
+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Methods

+[more] Transform() +
+[more] Transform(const Matrix& matix) +
+[more]virtual Object* clone() const +
+[more]virtual bool isSameKindAs(const Object* obj) const +
+[more]virtual const char* className() const +
+[more]virtual void accept(NodeVisitor& nv) +
+[more]void setMatrix(const Matrix& mat ) +
+[more]inline Matrix& getMatrix() +
+[more]inline const Matrix& getMatrix() const +
+[more]void preMult( const Matrix& mat ) +
+[more]void preScale( const float sx, const float sy, const float sz ) +
+[more]void preTranslate( const float tx, const float ty, const float tz ) +
+[more]void preRotate( const float deg, const float x, const float y, const float z ) +

+ +

+

Protected Fields

+[more]ref_ptr<Matrix> _matrix +

+ +

+

Protected Methods

+[more]virtual ~Transform() +
+[more]virtual const bool computeBound() const +

+ +
+

Inherited from Group:

+
+

+

Public Methods

+ovirtual void traverse(NodeVisitor& nv) +
+ovirtual bool addChild( Node* child ) +
+ovirtual bool removeChild( Node* child ) +
+ovirtual bool replaceChild( Node* origChild, Node* newChild ) +
+oinline const int getNumChildren() const +
+oinline Node* getChild( const int i ) +
+oinline const Node* getChild( const int i ) const +
+oinline bool containsNode( const Node* node ) const +
+oinline ChildList::iterator findNode( const Node* node ) +
+oinline ChildList::const_iterator findNode( const Node* node ) const +

+ +

+

Protected Fields

+oChildList _children +

+ +
+

Inherited from Node:

+
+

+

Public Methods

+ovirtual void ascend(NodeVisitor& nv) +
+oinline void setName( const std::string& name ) +
+oinline void setName( const char* name ) +
+oinline const std::string& getName() const +
+oinline const ParentList& getParents() const +
+oinline Group* getParent(const int i) +
+oinline const Group* getParent(const int i) const +
+oinline const int getNumParents() const +
+oinline void setUserData(void* data, MemoryAdapter* ma=0L) +
+oinline void* getUserData() +
+oinline const void* getUserData() const +
+oinline MemoryAdapter* getMemoryAdapter() +
+oinline const MemoryAdapter* getMemoryAdapter() const +
+oinline void setNodeMask(const NodeMask nm) +
+oinline const NodeMask getNodeMask() const +
+oinline const DescriptionList& getDescriptions() const +
+oinline DescriptionList& getDescriptions() +
+oinline const std::string& getDescription(const int i) const +
+oinline std::string& getDescription(const int i) +
+oinline const int getNumDescriptions() const +
+ovoid addDescription(const std::string& desc) +
+oinline void setStateSet(osg::StateSet* dstate) +
+oinline osg::StateSet* getStateSet() +
+oinline const osg::StateSet* getStateSet() const +
+oinline const BoundingSphere& getBound() const +
+ovoid dirtyBound() +

+ +

+

Public Members

+otypedef std::vector<Group*> ParentList +
+otypedef std::vector<std::string> DescriptionList +

+ +

+

Protected Fields

+omutable BoundingSphere _bsphere +
+omutable bool _bsphere_computed +
+ostd::string _name +
+oParentList _parents +
+ovoid* _userData +
+oref_ptr<MemoryAdapter> _memoryAdapter +
+oNodeMask _nodeMask +
+oDescriptionList _descriptions +
+oref_ptr<StateSet> _dstate +

+ +
+

Inherited from Object:

+
+
+

Inherited from Referenced:

+
+

+

Public Methods

+oinline Referenced& operator = (Referenced&) +
+oinline void ref() const +
+oinline void unref() const +
+oinline const int referenceCount() const +

+ +

+

Protected Fields

+omutable int _refCount +

+ +
+ + +
+

Documentation

+
Transform - is group which all children +are transformed by the the Transform's osg::Matrix. Typical uses +of the Transform is for positioning objects within a scene or +producing trakerball functionality or for animatiion.
+
+ + + +
o Transform() +

+ + +

o Transform(const Matrix& matix) +

+ + +

ovirtual Object* clone() const +

+ + +

ovirtual bool isSameKindAs(const Object* obj) const +

+ + +

ovirtual const char* className() const +

+ + +

ovirtual void accept(NodeVisitor& nv) +

+ + +

ovoid setMatrix(const Matrix& mat ) +

+ + +

oinline Matrix& getMatrix() +

+ + +

oinline const Matrix& getMatrix() const +

+ + +

ovoid preMult( const Matrix& mat ) +

+ + +

ovoid preScale( const float sx, const float sy, const float sz ) +

+ + +

ovoid preTranslate( const float tx, const float ty, const float tz ) +

+ + +

ovoid preRotate( const float deg, const float x, const float y, const float z ) +

+ + +

ovirtual ~Transform() +

+ + +

ovirtual const bool computeBound() const +

+ + +

oref_ptr<Matrix> _matrix +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/Transparency.html b/doc/doc++/osg/Transparency.html new file mode 100644 index 000000000..b2f10218e --- /dev/null +++ b/doc/doc++/osg/Transparency.html @@ -0,0 +1,236 @@ + + + + + class SG_EXPORT osg::Transparency + + + + +

class SG_EXPORT osg::Transparency

Transparancy - encapsulates the OpenGL transparancy state
+
+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Methods

+[more] Transparency() +
+[more]virtual Object* clone() const +
+[more]virtual bool isSameKindAs(const Object* obj) const +
+[more]virtual const char* className() const +
+[more]virtual const Type getType() const +
+[more]virtual void setStateSetModes(StateSet& ds, const GLModeValue value) const +
+[more]inline void setFunction( const int source, const int destination ) +
+[more]void setSource(const int source) +
+[more]inline const int getSource() const +
+[more]void setDestination(const int destination) +
+[more]inline const int getDestination() const +
+[more]virtual void apply(State& state) const +

+ +

+

Public Members

+[more]enum TransparencyMode +

+ +

+

Protected Fields

+[more]int _source_factor +
+[more]int _destination_factor +

+ +

+

Protected Methods

+[more]virtual ~Transparency() +

+ +
+

Inherited from StateAttribute:

+
+

+

Public Methods

+ovirtual void compile(State&) const +

+ +

+

Public Members

+otypedef GLenum GLMode +
+otypedef unsigned int GLModeValue +
+otypedef unsigned int OverrideValue +
+oenum Values +
+oenum Type +

+ +
+

Inherited from Object:

+
+
+

Inherited from Referenced:

+
+

+

Public Methods

+oinline Referenced& operator = (Referenced&) +
+oinline void ref() const +
+oinline void unref() const +
+oinline const int referenceCount() const +

+ +

+

Protected Fields

+omutable int _refCount +

+ +
+ + +
+

Documentation

+
Transparancy - encapsulates the OpenGL transparancy state
+
+ + + +
o Transparency() +

+ + +

ovirtual Object* clone() const +

+ + +

ovirtual bool isSameKindAs(const Object* obj) const +

+ + +

ovirtual const char* className() const +

+ + +

ovirtual const Type getType() const +

+ + +

ovirtual void setStateSetModes(StateSet& ds, const GLModeValue value) const +

+ + +

oenum TransparencyMode +

+ + + +
o DST_ALPHA +

+ + +

o DST_COLOR +

+ + +

o ONE +

+ + +

o ONE_MINUS_DST_ALPHA +

+ + +

o ONE_MINUS_DST_COLOR +

+ + +

o ONE_MINUS_SRC_ALPHA +

+ + +

o ONE_MINUS_SRC_COLOR +

+ + +

o SRC_ALPHA +

+ + +

o SRC_ALPHA_SATURATE +

+ + +

o SRC_COLOR +

+ + +

o ZERO +

+ + + +
oinline void setFunction( const int source, const int destination ) +

+ + +

ovoid setSource(const int source) +

+ + +

oinline const int getSource() const +

+ + +

ovoid setDestination(const int destination) +

+ + +

oinline const int getDestination() const +

+ + +

ovirtual void apply(State& state) const +

+ + +

ovirtual ~Transparency() +

+ + +

oint _source_factor +

+ + +

oint _destination_factor +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/Vec2.html b/doc/doc++/osg/Vec2.html new file mode 100644 index 000000000..83dd94ee7 --- /dev/null +++ b/doc/doc++/osg/Vec2.html @@ -0,0 +1,229 @@ + + + + + class osg::Vec2 + + + + +

class osg::Vec2

General purpose float pair, uses include representation of texture coordinates.
+
+ +
+

+

Public Fields

+[more]float _v[2] +

+ +

+

Public Methods

+[more] Vec2() +
+[more] Vec2(float x, float y) +
+[more]const bool operator == (const Vec2& v) const +
+[more]const bool operator < (const Vec2& v) const +
+[more]inline float* ptr() +
+[more]inline const float* ptr() const +
+[more]inline void set( float x, float y ) +
+[more]inline float& operator [] (int i) +
+[more]inline const float operator [] (int i) const +
+[more]inline float& x() +
+[more]inline float& y() +
+[more]inline const float x() const +
+[more]inline const float y() const +
+[more]inline const float operator * (const Vec2& rhs) const +
dot product +
+[more]inline const Vec2 operator * (const float& rhs) const +
multiply by scalar +
+[more]inline Vec2& operator *= (const float& rhs) +
unary multiply by scalar +
+[more]inline const Vec2 operator / (const float& rhs) const +
divide by scalar +
+[more]inline Vec2& operator /= (const float& rhs) +
unary divide by scalar +
+[more]inline const Vec2 operator + (const Vec2& rhs) const +
binary vector add +
+[more]inline Vec2& operator += (const Vec2& rhs) +
unary vector add. +
+[more]inline const Vec2 operator - (const Vec2& rhs) const +
binary vector subract +
+[more]inline Vec2& operator -= (const Vec2& rhs) +
unary vector subract +
+[more]inline const Vec2 operator - () const +
negation operator. +
+[more]inline const float length() const +
Length of the vector = sqrt( vec . +
+[more]inline const float length2( void ) const +
Length squared of the vector = vec . +
+[more]inline const float normalize() +
normalize the vector so that it has length unity returns the previous length of the vector +

+ +
+ + +
+

Documentation

+
General purpose float pair, uses include representation of +texture coordinates. +No support yet added for float * Vec2 - is it necessary? +Need to define a non-member non-friend operator* etc. +BTW: Vec2 * float is okay
+
+ + + +
o Vec2() +

+ + +

o Vec2(float x, float y) +

+ + +

ofloat _v[2] +

+ + +

oconst bool operator == (const Vec2& v) const +

+ + +

oconst bool operator < (const Vec2& v) const +

+ + +

oinline float* ptr() +

+ + +

oinline const float* ptr() const +

+ + +

oinline void set( float x, float y ) +

+ + +

oinline float& operator [] (int i) +

+ + +

oinline const float operator [] (int i) const +

+ + +

oinline float& x() +

+ + +

oinline float& y() +

+ + +

oinline const float x() const +

+ + +

oinline const float y() const +

+ + +

oinline const float operator * (const Vec2& rhs) const +
dot product +

+ + +

oinline const Vec2 operator * (const float& rhs) const +
multiply by scalar +

+ + +

oinline Vec2& operator *= (const float& rhs) +
unary multiply by scalar +

+ + +

oinline const Vec2 operator / (const float& rhs) const +
divide by scalar +

+ + +

oinline Vec2& operator /= (const float& rhs) +
unary divide by scalar +

+ + +

oinline const Vec2 operator + (const Vec2& rhs) const +
binary vector add +

+ + +

oinline Vec2& operator += (const Vec2& rhs) +
unary vector add. Slightly more efficient because no temporary +intermediate object. +

+ + +

oinline const Vec2 operator - (const Vec2& rhs) const +
binary vector subract +

+ + +

oinline Vec2& operator -= (const Vec2& rhs) +
unary vector subract +

+ + +

oinline const Vec2 operator - () const +
negation operator. Returns the negative of the Vec2 +

+ + +

oinline const float length() const +
Length of the vector = sqrt( vec . vec ) +

+ + +

oinline const float length2( void ) const +
Length squared of the vector = vec . vec +

+ + +

oinline const float normalize() +
normalize the vector so that it has length unity +returns the previous length of the vector +

+ +
This class has no child classes.
+ +
Friends:
inline ostream& operator << (ostream& output, const Vec2& vec)

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/Vec3.html b/doc/doc++/osg/Vec3.html new file mode 100644 index 000000000..8ddb18cab --- /dev/null +++ b/doc/doc++/osg/Vec3.html @@ -0,0 +1,249 @@ + + + + + class osg::Vec3 + + + + +

class osg::Vec3

General purpose float triple for use as vertices, vectors and normals.
+
+ +
+

+

Public Fields

+[more]float _v[3] +

+ +

+

Public Methods

+[more] Vec3() +
+[more] Vec3(float x, float y, float z) +
+[more]inline const bool operator == (const Vec3& v) const +
+[more]inline const bool operator < (const Vec3& v) const +
+[more]inline float* ptr() +
+[more]inline const float* ptr() const +
+[more]inline void set( float x, float y, float z) +
+[more]inline float& operator [] (int i) +
+[more]inline const float operator [] (int i) const +
+[more]inline float& x() +
+[more]inline float& y() +
+[more]inline float& z() +
+[more]inline const float x() const +
+[more]inline const float y() const +
+[more]inline const float z() const +
+[more]inline float operator * (const Vec3& rhs) const +
dot product +
+[more]inline const Vec3 operator ^ (const Vec3& rhs) const +
cross product +
+[more]inline const Vec3 operator * (const float& rhs) const +
multiply by scalar +
+[more]inline Vec3& operator *= (const float& rhs) +
unary multiply by scalar +
+[more]inline const Vec3 operator / (const float& rhs) const +
divide by scalar +
+[more]inline Vec3& operator /= (const float& rhs) +
unary divide by scalar +
+[more]inline const Vec3 operator + (const Vec3& rhs) const +
binary vector add +
+[more]inline Vec3& operator += (const Vec3& rhs) +
unary vector add. +
+[more]inline const Vec3 operator - (const Vec3& rhs) const +
binary vector subract +
+[more]inline Vec3& operator -= (const Vec3& rhs) +
unary vector subract +
+[more]inline const Vec3 operator - () const +
negation operator. +
+[more]inline const float length() const +
Length of the vector = sqrt( vec . +
+[more]inline const float length2() const +
Length squared of the vector = vec . +
+[more]inline const float normalize() +
normalize the vector so that it has length unity returns the previous length of the vector +

+ +
+ + +
+

Documentation

+
General purpose float triple for use as vertices, vectors and normals. +Provides general maths operations from addition through to cross products. +No support yet added for float * Vec3 - is it necessary? +Need to define a non-member non-friend operator* etc. +Vec3 * float is okay
+
+ + + +
o Vec3() +

+ + +

o Vec3(float x, float y, float z) +

+ + +

ofloat _v[3] +

+ + +

oinline const bool operator == (const Vec3& v) const +

+ + +

oinline const bool operator < (const Vec3& v) const +

+ + +

oinline float* ptr() +

+ + +

oinline const float* ptr() const +

+ + +

oinline void set( float x, float y, float z) +

+ + +

oinline float& operator [] (int i) +

+ + +

oinline const float operator [] (int i) const +

+ + +

oinline float& x() +

+ + +

oinline float& y() +

+ + +

oinline float& z() +

+ + +

oinline const float x() const +

+ + +

oinline const float y() const +

+ + +

oinline const float z() const +

+ + +

oinline float operator * (const Vec3& rhs) const +
dot product +

+ + +

oinline const Vec3 operator ^ (const Vec3& rhs) const +
cross product +

+ + +

oinline const Vec3 operator * (const float& rhs) const +
multiply by scalar +

+ + +

oinline Vec3& operator *= (const float& rhs) +
unary multiply by scalar +

+ + +

oinline const Vec3 operator / (const float& rhs) const +
divide by scalar +

+ + +

oinline Vec3& operator /= (const float& rhs) +
unary divide by scalar +

+ + +

oinline const Vec3 operator + (const Vec3& rhs) const +
binary vector add +

+ + +

oinline Vec3& operator += (const Vec3& rhs) +
unary vector add. Slightly more efficient because no temporary +intermediate object +

+ + +

oinline const Vec3 operator - (const Vec3& rhs) const +
binary vector subract +

+ + +

oinline Vec3& operator -= (const Vec3& rhs) +
unary vector subract +

+ + +

oinline const Vec3 operator - () const +
negation operator. Returns the negative of the Vec3 +

+ + +

oinline const float length() const +
Length of the vector = sqrt( vec . vec ) +

+ + +

oinline const float length2() const +
Length squared of the vector = vec . vec +

+ + +

oinline const float normalize() +
normalize the vector so that it has length unity +returns the previous length of the vector +

+ +
This class has no child classes.
+ +
Friends:
inline ostream& operator << (ostream& output, const Vec3& vec)

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/Vec4.html b/doc/doc++/osg/Vec4.html new file mode 100644 index 000000000..fbbb0309c --- /dev/null +++ b/doc/doc++/osg/Vec4.html @@ -0,0 +1,253 @@ + + + + + class osg::Vec4 + + + + +

class osg::Vec4

General purpose float quad, uses include representation of colour coordinates.
+
+ +
+

+

Public Fields

+[more]float _v[4] +

+ +

+

Public Methods

+[more] Vec4() +
+[more] Vec4(float x, float y, float z, float w) +
+[more]inline const bool operator == (const Vec4& v) const +
+[more]inline const bool operator < (const Vec4& v) const +
+[more]inline float* ptr() +
+[more]inline const float* ptr() const +
+[more]inline void set( float x, float y, float z, float w) +
+[more]inline float& operator [] (const int i) +
+[more]inline float operator [] (const int i) const +
+[more]inline float& x() +
+[more]inline float& y() +
+[more]inline float& z() +
+[more]inline float& w() +
+[more]inline float x() const +
+[more]inline float y() const +
+[more]inline float z() const +
+[more]inline float w() const +
+[more]inline float operator * (const Vec4& rhs) const +
dot product +
+[more]inline Vec4 operator * (const float& rhs) const +
multiply by scalar +
+[more]inline Vec4& operator *= (const float& rhs) +
unary multiply by scalar +
+[more]inline Vec4 operator / (const float& rhs) const +
divide by scalar +
+[more]inline Vec4& operator /= (const float& rhs) +
unary divide by scalar +
+[more]inline Vec4 operator + (const Vec4& rhs) const +
binary vector add +
+[more]inline Vec4& operator += (const Vec4& rhs) +
unary vector add. +
+[more]inline Vec4 operator - (const Vec4& rhs) const +
binary vector subract +
+[more]inline Vec4& operator -= (const Vec4& rhs) +
unary vector subract +
+[more]inline const Vec4 operator - () const +
negation operator. +
+[more]inline const float length() const +
Length of the vector = sqrt( vec . +
+[more]inline const float length2() const +
Length squared of the vector = vec . +
+[more]inline const float normalize() +
normalize the vector so that it has length unity returns the previous length of the vector +

+ +
+ + +
+

Documentation

+
General purpose float quad, uses include representation +of colour coordinates. +No support yet added for float * Vec4 - is it necessary? +Need to define a non-member non-friend operator* etc. +Vec4 * float is okay
+
+ + + +
o Vec4() +

+ + +

o Vec4(float x, float y, float z, float w) +

+ + +

ofloat _v[4] +

+ + +

oinline const bool operator == (const Vec4& v) const +

+ + +

oinline const bool operator < (const Vec4& v) const +

+ + +

oinline float* ptr() +

+ + +

oinline const float* ptr() const +

+ + +

oinline void set( float x, float y, float z, float w) +

+ + +

oinline float& operator [] (const int i) +

+ + +

oinline float operator [] (const int i) const +

+ + +

oinline float& x() +

+ + +

oinline float& y() +

+ + +

oinline float& z() +

+ + +

oinline float& w() +

+ + +

oinline float x() const +

+ + +

oinline float y() const +

+ + +

oinline float z() const +

+ + +

oinline float w() const +

+ + +

oinline float operator * (const Vec4& rhs) const +
dot product +

+ + +

oinline Vec4 operator * (const float& rhs) const +
multiply by scalar +

+ + +

oinline Vec4& operator *= (const float& rhs) +
unary multiply by scalar +

+ + +

oinline Vec4 operator / (const float& rhs) const +
divide by scalar +

+ + +

oinline Vec4& operator /= (const float& rhs) +
unary divide by scalar +

+ + +

oinline Vec4 operator + (const Vec4& rhs) const +
binary vector add +

+ + +

oinline Vec4& operator += (const Vec4& rhs) +
unary vector add. Slightly more efficient because no temporary +intermediate object +

+ + +

oinline Vec4 operator - (const Vec4& rhs) const +
binary vector subract +

+ + +

oinline Vec4& operator -= (const Vec4& rhs) +
unary vector subract +

+ + +

oinline const Vec4 operator - () const +
negation operator. Returns the negative of the Vec4 +

+ + +

oinline const float length() const +
Length of the vector = sqrt( vec . vec ) +

+ + +

oinline const float length2() const +
Length squared of the vector = vec . vec +

+ + +

oinline const float normalize() +
normalize the vector so that it has length unity +returns the previous length of the vector +

+ +
This class has no child classes.
+ +
Friends:
inline ostream& operator << (ostream& output, const Vec4& vec)

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/clampArray3BetweenRange.html b/doc/doc++/osg/clampArray3BetweenRange.html new file mode 100644 index 000000000..fb2a2ef15 --- /dev/null +++ b/doc/doc++/osg/clampArray3BetweenRange.html @@ -0,0 +1,23 @@ + + + + + template<class A, class T>inline void osg::clampArray3BetweenRange + + + + +

template<class A, class T>inline void osg::clampArray3BetweenRange

(A& value,
  const T minValue,
  const T maxValue,
  const char* valueName)

if array4 elements are between or equal to minValue and maxValue do nothing - legal value, otherise clamp value to specified to range and return warning with valueName specifying which variable was clamped.
+ + +
+

Documentation

+
if array4 elements are between or equal to minValue and maxValue do nothing - legal value, +otherise clamp value to specified to range and return warning +with valueName specifying which variable was clamped. Equivilant to +calling clampGEQUAL(value,minValue,valueName); clampLEQUAL(value,maxValue,valueName);
+

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/clampArray3GEQUAL.html b/doc/doc++/osg/clampArray3GEQUAL.html new file mode 100644 index 000000000..629cf4284 --- /dev/null +++ b/doc/doc++/osg/clampArray3GEQUAL.html @@ -0,0 +1,22 @@ + + + + + template<class A, class T>inline void osg::clampArray3GEQUAL + + + + +

template<class A, class T>inline void osg::clampArray3GEQUAL

(A& value,
  const T minValue,
  const char* valueName)

if array4 elements are greater than or equal to minValue do nothing - legal value, otherise clamp value to specified maximum value and return warning with valueName specifying which variable was clamped
+ + +
+

Documentation

+
if array4 elements are greater than or equal to minValue do nothing - legal value, +otherise clamp value to specified maximum value and return warning +with valueName specifying which variable was clamped
+

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/clampArray3LEQUAL.html b/doc/doc++/osg/clampArray3LEQUAL.html new file mode 100644 index 000000000..88a920f52 --- /dev/null +++ b/doc/doc++/osg/clampArray3LEQUAL.html @@ -0,0 +1,22 @@ + + + + + template<class A, class T>inline void osg::clampArray3LEQUAL + + + + +

template<class A, class T>inline void osg::clampArray3LEQUAL

(A& value,
  const T maxValue,
  const char* valueName)

if array4 elements are is less than or equal to maxValue do nothing - legal value, otherise clamp value to specified maximum value and return warning with valueName specifying which variable was clamped
+ + +
+

Documentation

+
if array4 elements are is less than or equal to maxValue do nothing - legal value, +otherise clamp value to specified maximum value and return warning +with valueName specifying which variable was clamped
+

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/clampArray4BetweenRange.html b/doc/doc++/osg/clampArray4BetweenRange.html new file mode 100644 index 000000000..eb34e1e0d --- /dev/null +++ b/doc/doc++/osg/clampArray4BetweenRange.html @@ -0,0 +1,23 @@ + + + + + template<class A, class T>inline void osg::clampArray4BetweenRange + + + + +

template<class A, class T>inline void osg::clampArray4BetweenRange

(A& value,
  const T minValue,
  const T maxValue,
  const char* valueName)

if array4 elements are between or equal to minValue and maxValue do nothing - legal value, otherise clamp value to specified to range and return warning with valueName specifying which variable was clamped.
+ + +
+

Documentation

+
if array4 elements are between or equal to minValue and maxValue do nothing - legal value, +otherise clamp value to specified to range and return warning +with valueName specifying which variable was clamped. Equivilant to +calling clampGEQUAL(value,minValue,valueName); clampLEQUAL(value,maxValue,valueName);
+

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/clampArray4GEQUAL.html b/doc/doc++/osg/clampArray4GEQUAL.html new file mode 100644 index 000000000..21a10b543 --- /dev/null +++ b/doc/doc++/osg/clampArray4GEQUAL.html @@ -0,0 +1,22 @@ + + + + + template<class A, class T>inline void osg::clampArray4GEQUAL + + + + +

template<class A, class T>inline void osg::clampArray4GEQUAL

(A& value,
  const T minValue,
  const char* valueName)

if array4 elements are greater than or equal to minValue do nothing - legal value, otherise clamp value to specified maximum value and return warning with valueName specifying which variable was clamped
+ + +
+

Documentation

+
if array4 elements are greater than or equal to minValue do nothing - legal value, +otherise clamp value to specified maximum value and return warning +with valueName specifying which variable was clamped
+

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/clampArray4LEQUAL.html b/doc/doc++/osg/clampArray4LEQUAL.html new file mode 100644 index 000000000..c21e5c49f --- /dev/null +++ b/doc/doc++/osg/clampArray4LEQUAL.html @@ -0,0 +1,22 @@ + + + + + template<class A, class T>inline void osg::clampArray4LEQUAL + + + + +

template<class A, class T>inline void osg::clampArray4LEQUAL

(A& value,
  const unsigned int first,
  const unsigned int last,
  const T maxValue,
  const char* valueName)

if array4 elements are is less than or equal to maxValue do nothing - legal value, otherise clamp value to specified maximum value and return warning with valueName specifying which variable was clamped
+ + +
+

Documentation

+
if array4 elements are is less than or equal to maxValue do nothing - legal value, +otherise clamp value to specified maximum value and return warning +with valueName specifying which variable was clamped
+

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/clampArrayElementBetweenRange.html b/doc/doc++/osg/clampArrayElementBetweenRange.html new file mode 100644 index 000000000..b30c0dd19 --- /dev/null +++ b/doc/doc++/osg/clampArrayElementBetweenRange.html @@ -0,0 +1,23 @@ + + + + + template<class A, class T>inline void osg::clampArrayElementBetweenRange + + + + +

template<class A, class T>inline void osg::clampArrayElementBetweenRange

(A& value,
  const unsigned int i,
  const T minValue,
  const T maxValue,
  const char* valueName)

if array element value[i] is between or equal to minValue and maxValue do nothing - legal value, otherise clamp value to specified to range and return warning with valueName specifying which variable was clamped.
+ + +
+

Documentation

+
if array element value[i] is between or equal to minValue and maxValue do nothing - legal value, +otherise clamp value to specified to range and return warning +with valueName specifying which variable was clamped. Equivilant to +calling clampGEQUAL(value,minValue,valueName); clampLEQUAL(value,maxValue,valueName);
+

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/clampArrayElementGEQUAL.html b/doc/doc++/osg/clampArrayElementGEQUAL.html new file mode 100644 index 000000000..c30c68c2b --- /dev/null +++ b/doc/doc++/osg/clampArrayElementGEQUAL.html @@ -0,0 +1,22 @@ + + + + + template<class A, class T>inline void osg::clampArrayElementGEQUAL + + + + +

template<class A, class T>inline void osg::clampArrayElementGEQUAL

(A& value,
  const unsigned int i,
  const T minValue,
  const char* valueName)

if array element value[i] is greater than or equal to minValue do nothing - legal value, otherise clamp value to specified maximum value and return warning with valueName specifying which variable was clamped
+ + +
+

Documentation

+
if array element value[i] is greater than or equal to minValue do nothing - legal value, +otherise clamp value to specified maximum value and return warning +with valueName specifying which variable was clamped
+

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/clampArrayElementLEQUAL.html b/doc/doc++/osg/clampArrayElementLEQUAL.html new file mode 100644 index 000000000..7fed7ef3e --- /dev/null +++ b/doc/doc++/osg/clampArrayElementLEQUAL.html @@ -0,0 +1,22 @@ + + + + + template<class A, class T>inline void osg::clampArrayElementLEQUAL + + + + +

template<class A, class T>inline void osg::clampArrayElementLEQUAL

(A& value,
  const unsigned int i,
  const T maxValue,
  const char* valueName)

if array element value[i] is less than or equal to maxValue do nothing - legal value, otherise clamp value to specified maximum value and return warning with valueName specifying which variable was clamped
+ + +
+

Documentation

+
if array element value[i] is less than or equal to maxValue do nothing - legal value, +otherise clamp value to specified maximum value and return warning +with valueName specifying which variable was clamped
+

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/clampArrayElementsBetweenRange.html b/doc/doc++/osg/clampArrayElementsBetweenRange.html new file mode 100644 index 000000000..73937741c --- /dev/null +++ b/doc/doc++/osg/clampArrayElementsBetweenRange.html @@ -0,0 +1,23 @@ + + + + + template<class A, class T>inline void osg::clampArrayElementsBetweenRange + + + + +

template<class A, class T>inline void osg::clampArrayElementsBetweenRange

(A& value,
  const unsigned int first,
  const unsigned int last,
  const T minValue,
  const T maxValue,
  const char* valueName)

if array elements are between or equal to minValue and maxValue do nothing - legal value, otherise clamp value to specified to range and return warning with valueName specifying which variable was clamped.
+ + +
+

Documentation

+
if array elements are between or equal to minValue and maxValue do nothing - legal value, +otherise clamp value to specified to range and return warning +with valueName specifying which variable was clamped. Equivilant to +calling clampGEQUAL(value,minValue,valueName); clampLEQUAL(value,maxValue,valueName);
+

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/clampArrayElementsGEQUAL.html b/doc/doc++/osg/clampArrayElementsGEQUAL.html new file mode 100644 index 000000000..4855db0ec --- /dev/null +++ b/doc/doc++/osg/clampArrayElementsGEQUAL.html @@ -0,0 +1,22 @@ + + + + + template<class A, class T>inline void osg::clampArrayElementsGEQUAL + + + + +

template<class A, class T>inline void osg::clampArrayElementsGEQUAL

(A& value,
  const unsigned int first,
  const unsigned int last,
  const T minValue,
  const char* valueName)

if array elements are greater than or equal to minValue do nothing - legal value, otherise clamp value to specified maximum value and return warning with valueName specifying which variable was clamped
+ + +
+

Documentation

+
if array elements are greater than or equal to minValue do nothing - legal value, +otherise clamp value to specified maximum value and return warning +with valueName specifying which variable was clamped
+

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/clampArrayElementsLEQUAL.html b/doc/doc++/osg/clampArrayElementsLEQUAL.html new file mode 100644 index 000000000..fdc7a560d --- /dev/null +++ b/doc/doc++/osg/clampArrayElementsLEQUAL.html @@ -0,0 +1,22 @@ + + + + + template<class A, class T>inline void osg::clampArrayElementsLEQUAL + + + + +

template<class A, class T>inline void osg::clampArrayElementsLEQUAL

(A& value,
  const unsigned int first,
  const unsigned int last,
  const T maxValue,
  const char* valueName)

if array elements are less than or equal to maxValue do nothing - legal value, otherise clamp value to specified maximum value and return warning with valueName specifying which variable was clamped
+ + +
+

Documentation

+
if array elements are less than or equal to maxValue do nothing - legal value, +otherise clamp value to specified maximum value and return warning +with valueName specifying which variable was clamped
+

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/clampBetweenRange.html b/doc/doc++/osg/clampBetweenRange.html new file mode 100644 index 000000000..ca5c0dc8b --- /dev/null +++ b/doc/doc++/osg/clampBetweenRange.html @@ -0,0 +1,23 @@ + + + + + template<class T>inline void osg::clampBetweenRange + + + + +

template<class T>inline void osg::clampBetweenRange

(T& value,
  const T minValue,
  const T maxValue,
  const char* valueName)

if value is between or equal to minValue and maxValue do nothing - legal value, otherise clamp value to specified to range and return warning with valueName specifying which variable was clamped.
+ + +
+

Documentation

+
if value is between or equal to minValue and maxValue do nothing - legal value, +otherise clamp value to specified to range and return warning +with valueName specifying which variable was clamped. Equivilant to +calling clampGEQUAL(value,minValue,valueName); clampLEQUAL(value,maxValue,valueName);
+

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/clampGEQUAL.html b/doc/doc++/osg/clampGEQUAL.html new file mode 100644 index 000000000..2868db348 --- /dev/null +++ b/doc/doc++/osg/clampGEQUAL.html @@ -0,0 +1,22 @@ + + + + + template<class T>inline void osg::clampGEQUAL + + + + +

template<class T>inline void osg::clampGEQUAL

(T& value,
  const T minValue,
  const char* valueName)

if value is greater than or equal to minValue do nothing - legal value, otherise clamp value to specified maximum value and return warning with valueName specifying which variable was clamped
+ + +
+

Documentation

+
if value is greater than or equal to minValue do nothing - legal value, +otherise clamp value to specified maximum value and return warning +with valueName specifying which variable was clamped
+

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/clampLEQUAL.html b/doc/doc++/osg/clampLEQUAL.html new file mode 100644 index 000000000..c7287ce15 --- /dev/null +++ b/doc/doc++/osg/clampLEQUAL.html @@ -0,0 +1,22 @@ + + + + + template<class T>inline void osg::clampLEQUAL + + + + +

template<class T>inline void osg::clampLEQUAL

(T& value,
  const T maxValue,
  const char* valueName)

if value is less than or equal to maxValue do nothing - legal value, otherise clamp value to specified maximum value and return warning with valueName specifying which variable was clamped
+ + +
+

Documentation

+
if value is less than or equal to maxValue do nothing - legal value, +otherise clamp value to specified maximum value and return warning +with valueName specifying which variable was clamped
+

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/createGeodeForImage.2.html b/doc/doc++/osg/createGeodeForImage.2.html new file mode 100644 index 000000000..b4cd1f10b --- /dev/null +++ b/doc/doc++/osg/createGeodeForImage.2.html @@ -0,0 +1,22 @@ + + + + + SG_EXPORT extern Geode* osg::createGeodeForImage + + + + +

SG_EXPORT extern Geode* osg::createGeodeForImage

(Image* image,
  const float s,
  const float t)

Convenience function to be used by images loaders to generate a valid geode to return for readNode().
+ + +
+

Documentation

+
Convenience function to be used by images loaders to generate a valid geode +to return for readNode(). +Use the specified s and t values scale the dimensions of the image.
+

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/createGeodeForImage.html b/doc/doc++/osg/createGeodeForImage.html new file mode 100644 index 000000000..e0d6b355e --- /dev/null +++ b/doc/doc++/osg/createGeodeForImage.html @@ -0,0 +1,22 @@ + + + + + SG_EXPORT extern Geode* osg::createGeodeForImage + + + + +

SG_EXPORT extern Geode* osg::createGeodeForImage

(Image* image)

Convenience function to be used by images loaders to generate a valid geode to return for readNode().
+ + +
+

Documentation

+
Convenience function to be used by images loaders to generate a valid geode +to return for readNode(). +Use the images s and t values scale the dimensions of the image.
+

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/for_each_triangle.html b/doc/doc++/osg/for_each_triangle.html new file mode 100644 index 000000000..8c411568a --- /dev/null +++ b/doc/doc++/osg/for_each_triangle.html @@ -0,0 +1,22 @@ + + + + + template<class T> void osg::for_each_triangle + + + + +

template<class T> void osg::for_each_triangle

(GeoSet& gset,
  T& op)

Template function for iterating through a GeoSet operating on triangles with templated functor.
+ + +
+

Documentation

+
Template function for iterating through a GeoSet operating on triangles +with templated functor. Function automatically decomposes quads and polygons +into sub triangles which are passed onto functor.
+

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/g_NotifyLevel.html b/doc/doc++/osg/g_NotifyLevel.html new file mode 100644 index 000000000..3c5100222 --- /dev/null +++ b/doc/doc++/osg/g_NotifyLevel.html @@ -0,0 +1,20 @@ + + + + + SG_EXPORT extern NotifySeverity osg::g_NotifyLevel + + + + +

SG_EXPORT extern NotifySeverity osg::g_NotifyLevel

global notify level.
+ + +
+

Documentation

+
global notify level.
+

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/getGLExtensionFuncPtr.html b/doc/doc++/osg/getGLExtensionFuncPtr.html new file mode 100644 index 000000000..b35e2e0be --- /dev/null +++ b/doc/doc++/osg/getGLExtensionFuncPtr.html @@ -0,0 +1,21 @@ + + + + + SG_EXPORT extern void* osg::getGLExtensionFuncPtr + + + + +

SG_EXPORT extern void* osg::getGLExtensionFuncPtr

(const char* funcName)

return the address of the specified OpenGL function.
+ + +
+

Documentation

+
return the address of the specified OpenGL function. +return NULL if function not supported by OpenGL library.
+

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/getNotifyLevel.html b/doc/doc++/osg/getNotifyLevel.html new file mode 100644 index 000000000..e89c3f9d5 --- /dev/null +++ b/doc/doc++/osg/getNotifyLevel.html @@ -0,0 +1,20 @@ + + + + + SG_EXPORT extern NotifySeverity osg::getNotifyLevel + + + + +

SG_EXPORT extern NotifySeverity osg::getNotifyLevel

()

get the notify level.
+ + +
+

Documentation

+
get the notify level.
+

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/icon1.gif b/doc/doc++/osg/icon1.gif new file mode 100644 index 000000000..f78f30eb9 Binary files /dev/null and b/doc/doc++/osg/icon1.gif differ diff --git a/doc/doc++/osg/icon2.gif b/doc/doc++/osg/icon2.gif new file mode 100644 index 000000000..6cbe01a83 Binary files /dev/null and b/doc/doc++/osg/icon2.gif differ diff --git a/doc/doc++/osg/index.html b/doc/doc++/osg/index.html new file mode 100644 index 000000000..c872b45a8 --- /dev/null +++ b/doc/doc++/osg/index.html @@ -0,0 +1,126 @@ + + + + + Table of Contents + + + + +

Table of Contents

+

Namespaces

+ +

Functions

+
    +
  • osgGetLibraryName getLibraryName_osg() returns the library name in human friendly form +
  • osgGetVersion getVersion_osg() returns the library version number. +
+

Macros

+ +

Typedefs

+
    +
  • NodePath A vector of Nodes pointers which is used to describe the path from a root node to a descendant +
+

Hierarchy of classes


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/initNotifyLevel.html b/doc/doc++/osg/initNotifyLevel.html new file mode 100644 index 000000000..9998b8302 --- /dev/null +++ b/doc/doc++/osg/initNotifyLevel.html @@ -0,0 +1,20 @@ + + + + + SG_EXPORT extern bool osg::initNotifyLevel + + + + +

SG_EXPORT extern bool osg::initNotifyLevel

()

initialize notify level.
+ + +
+

Documentation

+
initialize notify level.
+

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/isGLExtensionSupported.html b/doc/doc++/osg/isGLExtensionSupported.html new file mode 100644 index 000000000..d19295028 --- /dev/null +++ b/doc/doc++/osg/isGLExtensionSupported.html @@ -0,0 +1,22 @@ + + + + + SG_EXPORT extern const bool osg::isGLExtensionSupported + + + + +

SG_EXPORT extern const bool osg::isGLExtensionSupported

(const char* extension)

return true if OpenGL "extension" is supported.
+ + +
+

Documentation

+
return true if OpenGL "extension" is supported. +note: Must only called within a valid OpenGL context, +undefined behaviour may occur otherwise.
+

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/mem_ptr.html b/doc/doc++/osg/mem_ptr.html new file mode 100644 index 000000000..36e3291f0 --- /dev/null +++ b/doc/doc++/osg/mem_ptr.html @@ -0,0 +1,140 @@ + + + + + template<class T> class osg::mem_ptr + + + + +

template<class T> class osg::mem_ptr

Smart pointer for handling memory pointers via associated memory adapter
+
+ +
+

+

Public Methods

+[more] mem_ptr() +
+[more] mem_ptr(T* t, MemoryAdapter* ma) +
+[more] mem_ptr(const mem_ptr& rp) +
+[more] ~mem_ptr() +
+[more]inline mem_ptr& operator = (const mem_ptr& rp) +
+[more]inline void set(T* t, MemoryAdapter* ma) +
+[more]inline const bool operator == (const mem_ptr& rp) const +
+[more]inline const bool operator == (const T* ptr) const +
+[more]inline const bool operator != (const mem_ptr& rp) const +
+[more]inline const bool operator != (const T* ptr) const +
+[more]inline T& operator*() +
+[more]inline const T& operator*() const +
+[more]inline T* operator->() +
+[more]inline const T* operator->() const +
+[more]inline const bool operator!() const +
+[more]inline const bool valid() const +
+[more]inline T* get() +
+[more]inline const T* get() const +

+ +
+ + +
+

Documentation

+
Smart pointer for handling memory pointers via associated memory adapter
+
+ + + +
o mem_ptr() +

+ + +

o mem_ptr(T* t, MemoryAdapter* ma) +

+ + +

o mem_ptr(const mem_ptr& rp) +

+ + +

o ~mem_ptr() +

+ + +

oinline mem_ptr& operator = (const mem_ptr& rp) +

+ + +

oinline void set(T* t, MemoryAdapter* ma) +

+ + +

oinline const bool operator == (const mem_ptr& rp) const +

+ + +

oinline const bool operator == (const T* ptr) const +

+ + +

oinline const bool operator != (const mem_ptr& rp) const +

+ + +

oinline const bool operator != (const T* ptr) const +

+ + +

oinline T& operator*() +

+ + +

oinline const T& operator*() const +

+ + +

oinline T* operator->() +

+ + +

oinline const T* operator->() const +

+ + +

oinline const bool operator!() const +

+ + +

oinline const bool valid() const +

+ + +

oinline T* get() +

+ + +

oinline const T* get() const +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/notify.html b/doc/doc++/osg/notify.html new file mode 100644 index 000000000..f076a26ac --- /dev/null +++ b/doc/doc++/osg/notify.html @@ -0,0 +1,32 @@ + + + + + inline ostream& osg::notify + + + + +

inline ostream& osg::notify

(const NotifySeverity severity=INFO)

notify messaging function for providing fatal through to verbose debugging messages.
+ + +
+

Documentation

+
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 +application or via the an environmental variable. For instance +setenv OSGNOTIFYLEVEL DEBUG (for tsh), export OSGNOTIFYLEVEL=DEBUG +(for bourne shell) or set OSGNOTIFYLEVEL=DEBUG (for Windows) all +set tell the osg to redirect all debugging and more important messages +to the console (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 +NotifySeverity for full range of possibilities. To use the notify +with your code simply use the notify function as a normal file +stream (like cout) i.e osg::notify(osg::DEBUG) << "Hello Bugs!"< +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/osg.html b/doc/doc++/osg/osg.html new file mode 100644 index 000000000..b32fe337b --- /dev/null +++ b/doc/doc++/osg/osg.html @@ -0,0 +1,382 @@ + + + + + namespace osg + + + + +

namespace osg

+
+

+
+class SG_EXPORT AlphaFunc: public StateAttribute +
Encapsulte OpenGL glAlphaFunc +
+class SG_EXPORT Billboard: public Geode +
Billboard - a Geode which orientates its child osg::Drawable's to face the eye point. +
+class SG_EXPORT BoundingBox +
General purpose axis-aligned bounding box class for enclosing objects/vertices. +
+class SG_EXPORT BoundingSphere +
General purpose bounding sphere class for enclosing nodes/objects/vertices. +
+template<class T>inline void clampGEQUAL(T& value, const T minValue, const char* valueName) +
if value is greater than or equal to minValue do nothing - legal value, otherise clamp value to specified maximum value and return warning with valueName specifying which variable was clamped +
+template<class T>inline void clampLEQUAL(T& value, const T maxValue, const char* valueName) +
if value is less than or equal to maxValue do nothing - legal value, otherise clamp value to specified maximum value and return warning with valueName specifying which variable was clamped +
+template<class T>inline void clampBetweenRange(T& value, const T minValue, const T maxValue, const char* valueName) +
if value is between or equal to minValue and maxValue do nothing - legal value, otherise clamp value to specified to range and return warning with valueName specifying which variable was clamped. +
+template<class A, class T>inline void clampArrayElementGEQUAL(A& value, const unsigned int i, const T minValue, const char* valueName) +
if array element value[i] is greater than or equal to minValue do nothing - legal value, otherise clamp value to specified maximum value and return warning with valueName specifying which variable was clamped +
+template<class A, class T>inline void clampArrayElementLEQUAL(A& value, const unsigned int i, const T maxValue, const char* valueName) +
if array element value[i] is less than or equal to maxValue do nothing - legal value, otherise clamp value to specified maximum value and return warning with valueName specifying which variable was clamped +
+template<class A, class T>inline void clampArrayElementBetweenRange(A& value, const unsigned int i, const T minValue, const T maxValue, const char* valueName) +
if array element value[i] is between or equal to minValue and maxValue do nothing - legal value, otherise clamp value to specified to range and return warning with valueName specifying which variable was clamped. +
+template<class A, class T>inline void clampArrayElementsGEQUAL(A& value, const unsigned int first, const unsigned int last, const T minValue, const char* valueName) +
if array elements are greater than or equal to minValue do nothing - legal value, otherise clamp value to specified maximum value and return warning with valueName specifying which variable was clamped +
+template<class A, class T>inline void clampArrayElementsLEQUAL(A& value, const unsigned int first, const unsigned int last, const T maxValue, const char* valueName) +
if array elements are less than or equal to maxValue do nothing - legal value, otherise clamp value to specified maximum value and return warning with valueName specifying which variable was clamped +
+template<class A, class T>inline void clampArrayElementsBetweenRange(A& value, const unsigned int first, const unsigned int last, const T minValue, const T maxValue, const char* valueName) +
if array elements are between or equal to minValue and maxValue do nothing - legal value, otherise clamp value to specified to range and return warning with valueName specifying which variable was clamped. +
+template<class A, class T>inline void clampArray3GEQUAL(A& value, const T minValue, const char* valueName) +
if array4 elements are greater than or equal to minValue do nothing - legal value, otherise clamp value to specified maximum value and return warning with valueName specifying which variable was clamped +
+template<class A, class T>inline void clampArray3LEQUAL(A& value, const T maxValue, const char* valueName) +
if array4 elements are is less than or equal to maxValue do nothing - legal value, otherise clamp value to specified maximum value and return warning with valueName specifying which variable was clamped +
+template<class A, class T>inline void clampArray3BetweenRange(A& value, const T minValue, const T maxValue, const char* valueName) +
if array4 elements are between or equal to minValue and maxValue do nothing - legal value, otherise clamp value to specified to range and return warning with valueName specifying which variable was clamped. +
+template<class A, class T>inline void clampArray4GEQUAL(A& value, const T minValue, const char* valueName) +
if array4 elements are greater than or equal to minValue do nothing - legal value, otherise clamp value to specified maximum value and return warning with valueName specifying which variable was clamped +
+template<class A, class T>inline void clampArray4LEQUAL(A& value, const unsigned int first, const unsigned int last, const T maxValue, const char* valueName) +
if array4 elements are is less than or equal to maxValue do nothing - legal value, otherise clamp value to specified maximum value and return warning with valueName specifying which variable was clamped +
+template<class A, class T>inline void clampArray4BetweenRange(A& value, const T minValue, const T maxValue, const char* valueName) +
if array4 elements are between or equal to minValue and maxValue do nothing - legal value, otherise clamp value to specified to range and return warning with valueName specifying which variable was clamped. +
+class SG_EXPORT Camera: public osg::Referenced +
Camera class for encapsulating the view position and orientation and projection (lens) used. +
+class SG_EXPORT ClippingVolume +
A ClippingVolume class for represecting convex clipping volumes made up +
+class SG_EXPORT ClipPlane: public StateAttribute +
ClipPlane state class which encapsulates OpenGL glClipPlane() functionality +
+class SG_EXPORT ColorMask: public StateAttribute +
Encapsulte OpenGL glColorMaskFunc/Op/Mask functions +
+class SG_EXPORT CullFace: public StateAttribute +
Class to globally enable/disable OpenGL's polygon culling mode= +
+class SG_EXPORT Depth: public StateAttribute +
Encapsulte OpenGL glDepthFunc/Mask/Range functions +
+class SG_EXPORT Drawable: public Object +
Pure virtual base class for drawable Geomtery. +
+class SG_EXPORT Fog: public StateAttribute +
Fog - encapsulates OpenGL fog state. +
+class SG_EXPORT FrontFace: public StateAttribute +
Class to specifies the orientation of front-facing polygons +
+class SG_EXPORT Geode: public Node +
Leaf Node for grouping Drawables +
+class SG_EXPORT GeoSet: public Drawable +
Encapsulates OpenGL drawing primitives, geometry and optional binding of normal, color and texture coordinates. +
+template<class T> void for_each_triangle(GeoSet& gset, T& op) +
Template function for iterating through a GeoSet operating on triangles with templated functor. +
+SG_EXPORT extern const bool isGLExtensionSupported(const char* extension) +
return true if OpenGL "extension" is supported. +
+SG_EXPORT extern void* getGLExtensionFuncPtr(const char* funcName) +
return the address of the specified OpenGL function. +
+class SG_EXPORT Group: public Node +
General group node which maintains a list of children. +
+class SG_EXPORT Image: public Object +
Image class for encapsulating the storage texture image data +
+SG_EXPORT extern Geode* createGeodeForImage(Image* image) +
Convenience function to be used by images loaders to generate a valid geode to return for readNode(). +
+SG_EXPORT extern Geode* createGeodeForImage(Image* image, const float s, const float t) +
Convenience function to be used by images loaders to generate a valid geode to return for readNode(). +
+class SG_EXPORT Impostor: public LOD +
Impostor - is a form of Level Of Detail group node which allows both switching between children depending on distance from eye point and image caching. +
+class SG_EXPORT ImpostorSprite: public Drawable +
An ImposterSprite is a textured quad which is rendered in place a 3D geometry. +
+class SG_EXPORT ImpostorSpriteManager: public Referenced +
Helper class for managing the reuse of ImpostorSprite resources +
+class SG_EXPORT Light: public StateAttribute +
Light state class which encapsulates OpenGL glLight() functionality +
+class SG_EXPORT LightSource: public Node +
Leaf Node for defining a light in the scene +
+class SG_EXPORT LineSegment: public Referenced +
LineSegmentment class for representing a line segment +
+class SG_EXPORT LOD: public Group +
LOD - Level Of Detail group node which allows switching between children depending on distance from eye point. +
+class SG_EXPORT Material: public StateAttribute +
Material - encapsulates OpenGL glMaterial state +
+class SG_EXPORT Matrix: public Object +
4x4 Matrix for storage & manipulation of transformations in scene graph. +
+[more]inline Vec3 operator * (const Vec3& v, const Matrix& m) +
+[more]inline Vec4 operator * (const Vec4& v, const Matrix& m) +
+[more]inline ostream& operator << (ostream& output, const Matrix& matrix) +
+class SG_EXPORT MemoryAdapter: public Referenced +
Class for adapting the memory management of external data. +
+template<class T> class mem_ptr +
Smart pointer for handling memory pointers via associated memory adapter +
+class SG_EXPORT Node: public Object +
Base class for all internal nodes in the scene graph. +
+class SG_EXPORT NodeVisitor: public Referenced +
Visitor for type safe operations on osg::Node's. +
+struct NodeAcceptOp +
Convinience functor for assisting visiting of arrays of osg::Node's +
+enum NotifySeverity +
Range of notify levels from DEBUG_FP through to FATAL, ALWAYS is reserved for forcing the absorption of all messages. +
+SG_EXPORT extern NotifySeverity g_NotifyLevel +
global notify level. +
+SG_EXPORT extern void setNotifyLevel(NotifySeverity severity) +
set the notify level, overriding the default or value set by the environmental variable OSGNOTIFYLEVEL +
+SG_EXPORT extern NotifySeverity getNotifyLevel() +
get the notify level. +
+SG_EXPORT extern bool initNotifyLevel() +
initialize notify level. +
+inline ostream& notify(const NotifySeverity severity=INFO) +
notify messaging function for providing fatal through to verbose debugging messages. +
+class SG_EXPORT Object: public Referenced +
Base class/standard interface for objects which require IO support, cloning and reference counting. +
+class SG_EXPORT Plane +
A plane class. +
+[more]inline ostream& operator << (ostream& output, const Plane& pl) +
+class SG_EXPORT Point: public StateAttribute +
Point - encapsulates the OpenGL point smmothing and size state +
+class SG_EXPORT PolygonMode: public StateAttribute +
Class to for setting OpenGL's polygon culling mode +
+class SG_EXPORT PolygonOffset: public StateAttribute +
PolygonOffset - encapsulates the OpenGL glPolygonOffset state +
+class SG_EXPORT Quat +
A quaternion class. +
+[more]inline ostream& operator << (ostream& output, const Quat& vec) +
+class SG_EXPORT Referenced +
Base class from providing referencing counted objects +
+template<class T> class ref_ptr +
Smart pointer for handling referenced counted objects +
+#define OSG_GL_DEBUG(message) +
macro for use with osg::StateAttrbiute::apply methods for detected and reporting OpenGL error messages +
+class SG_EXPORT State: public Referenced +
State class for managing a state stack. +
+class SG_EXPORT StateAttribute: public Object +
Base class for state attribues +
+class SG_EXPORT StateSet: public Object +
Encapsulates OpenGL state modes and attributes. +
+class SG_EXPORT Stencil: public StateAttribute +
Encapsulte OpenGL glStencilFunc/Op/Mask functions +
+class SG_EXPORT Switch: public Group +
Switch is a Group node which allows switching between children. +
+class SG_EXPORT TexEnv: public StateAttribute +
TexEnv - encapsulates the OpenGL glTexEnv (texture environment) state +
+class SG_EXPORT TexGen: public StateAttribute +
TexGen - encapsulates the OpenGL glTexGen (texture coordinate generation) state +
+class SG_EXPORT TexMat: public StateAttribute +
Texture Matrix state class for encapsulating OpenGL texture matrix functionality +
+class SG_EXPORT Texture: public StateAttribute +
Texture state class which encapsulates OpenGl texture functionality +
+class SG_EXPORT Timer +
A high resolution, low latency time stamper +
+class SG_EXPORT Transform: public Group +
Transform - is group which all children are transformed by the the Transform's osg::Matrix. +
+class SG_EXPORT Transparency: public StateAttribute +
Transparancy - encapsulates the OpenGL transparancy state +
+[more]#define M_E +
+[more]#define M_LOG2E +
+[more]#define M_LOG10E +
+[more]#define M_LN2 +
+[more]#define M_LN10 +
+[more]#define M_PI +
+[more]#define M_PI_2 +
+[more]#define M_PI_4 +
+[more]#define M_1_PI +
+[more]#define M_2_PI +
+[more]#define M_2_SQRTPI +
+[more]#define M_SQRT2 +
+[more]#define M_SQRT1_2 +
+class Vec2 +
General purpose float pair, uses include representation of texture coordinates. +
+class Vec3 +
General purpose float triple for use as vertices, vectors and normals. +
+[more]inline ostream& operator << (ostream& output, const Vec3& vec) +
+class Vec4 +
General purpose float quad, uses include representation of colour coordinates. +

+ + + +
+

Documentation

+
+ + + +
oinline Vec3 operator * (const Vec3& v, const Matrix& m) +

+ + +

oinline Vec4 operator * (const Vec4& v, const Matrix& m) +

+ + +

oinline ostream& operator << (ostream& output, const Matrix& matrix) +

+ + +

oinline ostream& operator << (ostream& output, const Plane& pl) +

+ + +

oinline ostream& operator << (ostream& output, const Quat& vec) +

+ + +

o#define M_E +

+ + +

o#define M_LOG2E +

+ + +

o#define M_LOG10E +

+ + +

o#define M_LN2 +

+ + +

o#define M_LN10 +

+ + +

o#define M_PI +

+ + +

o#define M_PI_2 +

+ + +

o#define M_PI_4 +

+ + +

o#define M_1_PI +

+ + +

o#define M_2_PI +

+ + +

o#define M_2_SQRTPI +

+ + +

o#define M_SQRT2 +

+ + +

o#define M_SQRT1_2 +

+ + +

oinline ostream& operator << (ostream& output, const Vec3& vec) +

+

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/osgGetLibraryName.html b/doc/doc++/osg/osgGetLibraryName.html new file mode 100644 index 000000000..c287bfe17 --- /dev/null +++ b/doc/doc++/osg/osgGetLibraryName.html @@ -0,0 +1,21 @@ + + + + + extern SG_EXPORT const char* osgGetLibraryName + + + + +

extern SG_EXPORT const char* osgGetLibraryName

()

getLibraryName_osg() returns the library name in human friendly form
+ + +
+

Documentation

+
+getLibraryName_osg() returns the library name in human friendly form
+

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/osgGetVersion.html b/doc/doc++/osg/osgGetVersion.html new file mode 100644 index 000000000..930299754 --- /dev/null +++ b/doc/doc++/osg/osgGetVersion.html @@ -0,0 +1,34 @@ + + + + + extern SG_EXPORT const char* osgGetVersion + + + + +

extern SG_EXPORT const char* osgGetVersion

()

getVersion_osg() returns the library version number.
+ + +
+

Documentation

+
+getVersion_osg() returns the library version number. +Numbering conventon : osg_src-0.8-31 will return 0.8.31 from getVersion_osg. + +

This C function can be also used to check for the existance of the OpenSceneGraph +library using autoconf and its m4 macro AC_CHECK_LIB. + +

Here is the code to add to your configure.in: +\verbatim +# +# Check for the OpenSceneGraph (OSG) library +# +AC_CHECK_LIB(osg, osgGetVersion, , +[AC_MSG_ERROR(OpenSceneGraph library not found. See http://www.openscenegraph.org)],) +\endverbatim

+

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/ref_ptr.html b/doc/doc++/osg/ref_ptr.html new file mode 100644 index 000000000..b9a188611 --- /dev/null +++ b/doc/doc++/osg/ref_ptr.html @@ -0,0 +1,152 @@ + + + + + template<class T> class osg::ref_ptr + + + + +

template<class T> class osg::ref_ptr

Smart pointer for handling referenced counted objects
+
+ +
+

+

Public Methods

+[more] ref_ptr() +
+[more] ref_ptr(T* t) +
+[more] ref_ptr(const ref_ptr& rp) +
+[more] ~ref_ptr() +
+[more]inline ref_ptr& operator = (const ref_ptr& rp) +
+[more]inline ref_ptr& operator = (T* ptr) +
+[more]inline const bool operator == (const ref_ptr& rp) const +
+[more]inline const bool operator == (const T* ptr) const +
+[more]inline const bool operator != (const ref_ptr& rp) const +
+[more]inline const bool operator != (const T* ptr) const +
+[more]inline const bool operator < (const ref_ptr& rp) const +
+[more]inline const bool operator < (const T* ptr) const +
+[more]inline T& operator*() +
+[more]inline const T& operator*() const +
+[more]inline T* operator->() +
+[more]inline const T* operator->() const +
+[more]inline const bool operator!() const +
+[more]inline const bool valid() const +
+[more]inline T* get() +
+[more]inline const T* get() const +

+ +
+ + +
+

Documentation

+
Smart pointer for handling referenced counted objects
+
+ + + +
o ref_ptr() +

+ + +

o ref_ptr(T* t) +

+ + +

o ref_ptr(const ref_ptr& rp) +

+ + +

o ~ref_ptr() +

+ + +

oinline ref_ptr& operator = (const ref_ptr& rp) +

+ + +

oinline ref_ptr& operator = (T* ptr) +

+ + +

oinline const bool operator == (const ref_ptr& rp) const +

+ + +

oinline const bool operator == (const T* ptr) const +

+ + +

oinline const bool operator != (const ref_ptr& rp) const +

+ + +

oinline const bool operator != (const T* ptr) const +

+ + +

oinline const bool operator < (const ref_ptr& rp) const +

+ + +

oinline const bool operator < (const T* ptr) const +

+ + +

oinline T& operator*() +

+ + +

oinline const T& operator*() const +

+ + +

oinline T* operator->() +

+ + +

oinline const T* operator->() const +

+ + +

oinline const bool operator!() const +

+ + +

oinline const bool valid() const +

+ + +

oinline T* get() +

+ + +

oinline const T* get() const +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/setNotifyLevel.html b/doc/doc++/osg/setNotifyLevel.html new file mode 100644 index 000000000..f7c584ac5 --- /dev/null +++ b/doc/doc++/osg/setNotifyLevel.html @@ -0,0 +1,21 @@ + + + + + SG_EXPORT extern void osg::setNotifyLevel + + + + +

SG_EXPORT extern void osg::setNotifyLevel

(NotifySeverity severity)

set the notify level, overriding the default or value set by the environmental variable OSGNOTIFYLEVEL
+ + +
+

Documentation

+
set the notify level, overriding the default or value set by +the environmental variable OSGNOTIFYLEVEL
+

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgDB/ClassGraph.class b/doc/doc++/osgDB/ClassGraph.class new file mode 100644 index 000000000..c6a7b6c79 Binary files /dev/null and b/doc/doc++/osgDB/ClassGraph.class differ diff --git a/doc/doc++/osgDB/ClassGraphPanel.class b/doc/doc++/osgDB/ClassGraphPanel.class new file mode 100644 index 000000000..94b21b47a Binary files /dev/null and b/doc/doc++/osgDB/ClassGraphPanel.class differ diff --git a/doc/doc++/osgDB/ClassLayout.class b/doc/doc++/osgDB/ClassLayout.class new file mode 100644 index 000000000..77fb9fa28 Binary files /dev/null and b/doc/doc++/osgDB/ClassLayout.class differ diff --git a/doc/doc++/osgDB/DirectoryContents.html b/doc/doc++/osgDB/DirectoryContents.html new file mode 100644 index 000000000..8d7927e47 --- /dev/null +++ b/doc/doc++/osgDB/DirectoryContents.html @@ -0,0 +1,20 @@ + + + + + typedef std::vector<std::string> osgDB::DirectoryContents + + + + +

typedef std::vector<std::string> osgDB::DirectoryContents

simple list of names to represent a directory's contents.
+ + +
+

Documentation

+
simple list of names to represent a directory's contents.
+

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgDB/DotOsgWrapper.html b/doc/doc++/osgDB/DotOsgWrapper.html new file mode 100644 index 000000000..b7b7897c5 --- /dev/null +++ b/doc/doc++/osgDB/DotOsgWrapper.html @@ -0,0 +1,182 @@ + + + + + class OSGDB_EXPORT osgDB::DotOsgWrapper + + + + +

class OSGDB_EXPORT osgDB::DotOsgWrapper

Wrapper class for specifing read and write functions for extending the osg file format.
+
+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Methods

+[more]typedef bool (*ReadFunc)(osg::Object&, osgDB::Input&) +
+[more]typedef bool (*WriteFunc)(const osg::Object&, osgDB::Output&) +
+[more] DotOsgWrapper(osg::Object* proto, const std::string& name, const std::string& associates, ReadFunc readFunc, WriteFunc writeFunc, ReadWriteMode readWriteMode=READ_AND_WRITE) +
+[more]inline const osg::Object* getPrototype() const +
+[more]inline const std::string& getName() const +
+[more]inline const Associates& getAssociates() const +
+[more]inline ReadFunc getReadFunc() const +
+[more]inline WriteFunc getWriteFunc() const +
+[more]inline ReadWriteMode getReadWriteMode() const +

+ +

+

Public Members

+[more]enum ReadWriteMode +

+ +

+

Protected Fields

+[more]osg::ref_ptr<osg::Object> _prototype +
+[more]std::string _name +
+[more]Associates _associates +
+[more]ReadFunc _readFunc +
+[more]WriteFunc _writeFunc +
+[more]ReadWriteMode _readWriteMode +

+ +

+

Protected Methods

+[more] DotOsgWrapper() +
protected to prevent inappropriate creation of wrappers +
+[more] DotOsgWrapper(DotOsgWrapper&) +
protected to prevent inappropriate creation of wrappers +
+[more]virtual ~DotOsgWrapper() +
protected to prevent wrapper being created on stack +

+ +
+ + +
+

Documentation

+
Wrapper class for specifing read and write functions for extending +the osg file format.
+
+ + + +
otypedef bool (*ReadFunc)(osg::Object&, osgDB::Input&) +

+ + +

otypedef bool (*WriteFunc)(const osg::Object&, osgDB::Output&) +

+ + +

oenum ReadWriteMode +

+ + + +
o READ_AND_WRITE +

+ + +

o READ_ONLY +

+ + + +
o DotOsgWrapper(osg::Object* proto, const std::string& name, const std::string& associates, ReadFunc readFunc, WriteFunc writeFunc, ReadWriteMode readWriteMode=READ_AND_WRITE) +

+ + +

oinline const osg::Object* getPrototype() const +

+ + +

oinline const std::string& getName() const +

+ + +

oinline const Associates& getAssociates() const +

+ + +

oinline ReadFunc getReadFunc() const +

+ + +

oinline WriteFunc getWriteFunc() const +

+ + +

oinline ReadWriteMode getReadWriteMode() const +

+ + +

o DotOsgWrapper() +
protected to prevent inappropriate creation of wrappers +

+ + +

o DotOsgWrapper(DotOsgWrapper&) +
protected to prevent inappropriate creation of wrappers +

+ + +

ovirtual ~DotOsgWrapper() +
protected to prevent wrapper being created on stack +

+ + +

oosg::ref_ptr<osg::Object> _prototype +

+ + +

ostd::string _name +

+ + +

oAssociates _associates +

+ + +

oReadFunc _readFunc +

+ + +

oWriteFunc _writeFunc +

+ + +

oReadWriteMode _readWriteMode +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgDB/DynamicLibrary.html b/doc/doc++/osgDB/DynamicLibrary.html new file mode 100644 index 000000000..6a7b044a2 --- /dev/null +++ b/doc/doc++/osgDB/DynamicLibrary.html @@ -0,0 +1,148 @@ + + + + + class OSGDB_EXPORT osgDB::DynamicLibrary + + + + +

class OSGDB_EXPORT osgDB::DynamicLibrary

DynamicLibrary - encapsulates the loading and unloading of dynamic libraries, typically used for loading ReaderWriter plug-ins
+
+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Methods

+[more]static DynamicLibrary* loadLibrary(const std::string& libraryName) +
returns a pointer to a DynamicLibrary object on successfully opening of library returns NULL on failure +
+[more]const std::string& getName() const +
return name of library stripped of path +
+[more]const std::string& getFullName() const +
return name of library including full path to it +
+[more]HANDLE getHandle() const +
return handle to dso/dll dynamic library itself +
+[more]PROC_ADDRESS getProcAddress(const std::string& procName) +
return address of function located in library +

+ +

+

Protected Fields

+[more]HANDLE _handle +
+[more]std::string _name +
+[more]std::string _fullName +

+ +

+

Protected Methods

+[more] DynamicLibrary() +
disallow default constructor +
+[more] DynamicLibrary(const DynamicLibrary&) +
disallow copy constructor +
+[more]DynamicLibrary& operator == (const DynamicLibrary&) +
disallow copy operator +
+[more] DynamicLibrary(const std::string& name, HANDLE handle) +
Disallow public construction so that users have to go through loadLibrary() above which returns NULL on failure, a valid DynamicLibrary object on success +
+[more] ~DynamicLibrary() +

+ +
+ + +
+

Documentation

+
DynamicLibrary - encapsulates the loading and unloading of dynamic libraries, +typically used for loading ReaderWriter plug-ins
+
+ + + +
ostatic DynamicLibrary* loadLibrary(const std::string& libraryName) +
returns a pointer to a DynamicLibrary object on successfully +opening of library returns NULL on failure +

+ + +

oconst std::string& getName() const +
return name of library stripped of path +

+ + +

oconst std::string& getFullName() const +
return name of library including full path to it +

+ + +

oHANDLE getHandle() const +
return handle to dso/dll dynamic library itself +

+ + +

oPROC_ADDRESS getProcAddress(const std::string& procName) +
return address of function located in library +

+ + +

o DynamicLibrary() +
disallow default constructor +

+ + +

o DynamicLibrary(const DynamicLibrary&) +
disallow copy constructor +

+ + +

oDynamicLibrary& operator == (const DynamicLibrary&) +
disallow copy operator +

+ + +

o DynamicLibrary(const std::string& name, HANDLE handle) +
Disallow public construction so that users have to go +through loadLibrary() above which returns NULL on +failure, a valid DynamicLibrary object on success +

+ + +

o ~DynamicLibrary() +

+ + +

oHANDLE _handle +

+ + +

ostd::string _name +

+ + +

ostd::string _fullName +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgDB/Field.html b/doc/doc++/osgDB/Field.html new file mode 100644 index 000000000..d049463b4 --- /dev/null +++ b/doc/doc++/osgDB/Field.html @@ -0,0 +1,367 @@ + + + + + class OSGDB_EXPORT osgDB::Field + + + + +

class OSGDB_EXPORT osgDB::Field


+ +
+

+

Public Methods

+[more] Field() +
+[more] Field(const Field& field) +
+[more]virtual ~Field() +
+[more]virtual Field& operator = (const Field& ic) +
+[more]void reset() +
+[more]void addChar(char c) +
+[more]int getNoCharacters() const +
+[more]void setWithinQuotes(bool withinQuotes=true) +
+[more]bool getWithinQuotes() +
+[more]void setNoNestedBrackets(int no) +
+[more]int getNoNestedBrackets() +
+[more]FieldType getFieldType() const +
+[more]bool isValid() const +
+[more]bool isOpenBracket() const +
+[more]bool isCloseBracket() const +
+[more]bool isWord() const +
+[more]bool matchWord(const char* str) const +
+[more]bool matchWord(const char* str, int noCharacters) const +
+[more]bool isString() const +
+[more]bool matchString(const char* str) const +
+[more]bool matchString(const char* str, int noCharacters) const +
+[more]bool isQuotedString() const +
+[more]const char* getStr() const +
+[more]char* takeStr() +
+[more]bool isInt() const +
+[more]bool matchInt(int i) const +
+[more]bool getInt(int& i) const +
+[more]bool isUInt() const +
+[more]bool matchUInt(osg::uint i) const +
+[more]bool getUInt(osg::uint& i) const +
+[more]bool isFloat() const +
+[more]bool matchFloat(float f) const +
+[more]bool getFloat(float& f) const +
+[more]bool isDouble() const +
+[more]bool matchDouble(double f) const +
+[more]bool getDouble(double& d) const +
+[more]static FieldType calculateFieldType(const char* str, bool withinQuotes=false) +

+ +

+

Public Members

+[more]enum +
+[more]enum FieldType +

+ +

+

Protected Fields

+[more]int _fieldCacheCapacity +
+[more]int _fieldCacheSize +
+[more]char* _fieldCache +
+[more]mutable FieldType _fieldType +
+[more]bool _withinQuotes +
+[more]int _noNestedBrackets +

+ +

+

Protected Methods

+[more]void _init() +
+[more]void _free() +
+[more]void _copy(const Field& ic) +

+ +
+ + +
+

Documentation

+
+ + + +
oenum +

+ + + +
o MIN_CACHE_SIZE +

+ + + +
o Field() +

+ + +

o Field(const Field& field) +

+ + +

ovirtual ~Field() +

+ + +

ovirtual Field& operator = (const Field& ic) +

+ + +

ovoid reset() +

+ + +

ovoid addChar(char c) +

+ + +

oint getNoCharacters() const +

+ + +

ovoid setWithinQuotes(bool withinQuotes=true) +

+ + +

obool getWithinQuotes() +

+ + +

ovoid setNoNestedBrackets(int no) +

+ + +

oint getNoNestedBrackets() +

+ + +

oenum FieldType +

+ + + +
o OPEN_BRACKET +

+ + +

o CLOSE_BRACKET +

+ + +

o STRING +

+ + +

o WORD +

+ + +

o REAL +

+ + +

o INTEGER +

+ + +

o BLANK +

+ + +

o UNINTIALISED +

+ + + +
oFieldType getFieldType() const +

+ + +

obool isValid() const +

+ + +

obool isOpenBracket() const +

+ + +

obool isCloseBracket() const +

+ + +

obool isWord() const +

+ + +

obool matchWord(const char* str) const +

+ + +

obool matchWord(const char* str, int noCharacters) const +

+ + +

obool isString() const +

+ + +

obool matchString(const char* str) const +

+ + +

obool matchString(const char* str, int noCharacters) const +

+ + +

obool isQuotedString() const +

+ + +

oconst char* getStr() const +

+ + +

ochar* takeStr() +

+ + +

obool isInt() const +

+ + +

obool matchInt(int i) const +

+ + +

obool getInt(int& i) const +

+ + +

obool isUInt() const +

+ + +

obool matchUInt(osg::uint i) const +

+ + +

obool getUInt(osg::uint& i) const +

+ + +

obool isFloat() const +

+ + +

obool matchFloat(float f) const +

+ + +

obool getFloat(float& f) const +

+ + +

obool isDouble() const +

+ + +

obool matchDouble(double f) const +

+ + +

obool getDouble(double& d) const +

+ + +

ostatic FieldType calculateFieldType(const char* str, bool withinQuotes=false) +

+ + +

ovoid _init() +

+ + +

ovoid _free() +

+ + +

ovoid _copy(const Field& ic) +

+ + +

oint _fieldCacheCapacity +

+ + +

oint _fieldCacheSize +

+ + +

ochar* _fieldCache +

+ + +

omutable FieldType _fieldType +

+ + +

obool _withinQuotes +

+ + +

oint _noNestedBrackets +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgDB/FieldReader.html b/doc/doc++/osgDB/FieldReader.html new file mode 100644 index 000000000..96c0c6c65 --- /dev/null +++ b/doc/doc++/osgDB/FieldReader.html @@ -0,0 +1,92 @@ + + + + + class OSGDB_EXPORT osgDB::FieldReader + + + + +

class OSGDB_EXPORT osgDB::FieldReader


+ +
+

+

Public Methods

+[more] FieldReader() +
+[more] FieldReader(const FieldReader& ic) +
+[more]virtual ~FieldReader() +
+[more]virtual FieldReader& operator = (const FieldReader& ic) +
+[more]void attach(istream* input) +
+[more]void detach() +
+[more]virtual bool eof() const +
+[more]bool readField(Field& fieldPtr) +
+[more]void ignoreField() +
+[more]int getNoNestedBrackets() const +
no of unmatched `{' encounterd so far in file +

+ +
+ + +
+

Documentation

+
+ + + +
o FieldReader() +

+ + +

o FieldReader(const FieldReader& ic) +

+ + +

ovirtual ~FieldReader() +

+ + +

ovirtual FieldReader& operator = (const FieldReader& ic) +

+ + +

ovoid attach(istream* input) +

+ + +

ovoid detach() +

+ + +

ovirtual bool eof() const +

+ + +

obool readField(Field& fieldPtr) +

+ + +

ovoid ignoreField() +

+ + +

oint getNoNestedBrackets() const +
no of unmatched `{' encounterd so far in file +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgDB/FieldReaderIterator.html b/doc/doc++/osgDB/FieldReaderIterator.html new file mode 100644 index 000000000..84a003725 --- /dev/null +++ b/doc/doc++/osgDB/FieldReaderIterator.html @@ -0,0 +1,168 @@ + + + + + class OSGDB_EXPORT osgDB::FieldReaderIterator + + + + +

class OSGDB_EXPORT osgDB::FieldReaderIterator


+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Methods

+[more] FieldReaderIterator() +
+[more] FieldReaderIterator(const FieldReaderIterator& ic) +
+[more]virtual ~FieldReaderIterator() +
+[more]virtual FieldReaderIterator& operator = (const FieldReaderIterator& ic) +
+[more]void attach(istream* input) +
+[more]void detach() +
+[more]virtual bool eof() const +
+[more]FieldReader& getFieldReader() +
+[more]void insert(int pos, Field* field) +
+[more]void insert(int pos, const char* str) +
+[more]Field& operator [] (int pos) +
+[more]Field& field(int pos) +
+[more]FieldReaderIterator& operator ++ () +
+[more]FieldReaderIterator& operator += (int no) +
+[more]void advanceOverCurrentFieldOrBlock() +
increments the itetor of the next simple field or whole block if the current field[0] is an open bracket +
+[more]void advanceToEndOfCurrentBlock() +
+[more]void advanceToEndOfBlock(int noNestBrackets) +
+[more]bool matchSequence(const char* str) +

+ +

+

Public Members

+[more]enum +

+ +
+ + +
+

Documentation

+
+ + + +
oenum +

+ + + +
o MINIMUM_FIELD_READER_QUEUE_SIZE +

+ + + +
o FieldReaderIterator() +

+ + +

o FieldReaderIterator(const FieldReaderIterator& ic) +

+ + +

ovirtual ~FieldReaderIterator() +

+ + +

ovirtual FieldReaderIterator& operator = (const FieldReaderIterator& ic) +

+ + +

ovoid attach(istream* input) +

+ + +

ovoid detach() +

+ + +

ovirtual bool eof() const +

+ + +

oFieldReader& getFieldReader() +

+ + +

ovoid insert(int pos, Field* field) +

+ + +

ovoid insert(int pos, const char* str) +

+ + +

oField& operator [] (int pos) +

+ + +

oField& field(int pos) +

+ + +

oFieldReaderIterator& operator ++ () +

+ + +

oFieldReaderIterator& operator += (int no) +

+ + +

ovoid advanceOverCurrentFieldOrBlock() +
increments the itetor of the next simple field or +whole block if the current field[0] is an open bracket +

+ + +

ovoid advanceToEndOfCurrentBlock() +

+ + +

ovoid advanceToEndOfBlock(int noNestBrackets) +

+ + +

obool matchSequence(const char* str) +

+
+
Direct child classes: +
Input
+
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgDB/General.html b/doc/doc++/osgDB/General.html new file mode 100644 index 000000000..176d62f8d --- /dev/null +++ b/doc/doc++/osgDB/General.html @@ -0,0 +1,67 @@ + + + + + General Bits + + + + +
+
+ +o#define +OSGDB_DOTOSGWRAPPER
+ +o#define +OSG_DYNAMICLIBRARY
+ +o#define +OSGDB_EXPORT_
+ +o#define +OSGDB_EXPORT(dllexport)
+ +o#define +OSGDB_EXPORT(dllimport)
+ +o#define +OSGDB_EXPORT
+ +o#define +OSGDB_FIELD
+ +o#define +OSGDB_FIELDREADER
+ +o#define +OSGDB_FIELDREADERITERATOR
+ +o#define +OSGDB_FILENAMEUTILS
+ +o#define +OSGDB_INPUT
+ +o#define +OSGDB_OUTPUT
+ +o#define +OSGDB_READERWRITER
+ +o#define +OSGDB_READFILE
+ +o#define +OSGDB_REGISTRY
+ +o#define +OSG_VERSION
+ +o#define +OSGDB_FILEUTILS
+

Alphabetic index Hierarchy of classes


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgDB/HIER.html b/doc/doc++/osgDB/HIER.html new file mode 100644 index 000000000..50e4710b4 --- /dev/null +++ b/doc/doc++/osgDB/HIER.html @@ -0,0 +1,29 @@ + + + + + Hierarchy of Classes + + + +

Hierarchy of Classes

+ +

Alphabetic index


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgDB/HIERjava.html b/doc/doc++/osgDB/HIERjava.html new file mode 100644 index 000000000..991dfae66 --- /dev/null +++ b/doc/doc++/osgDB/HIERjava.html @@ -0,0 +1,86 @@ + + + + + Hierarchy of Classes + + + +

Hierarchy of classes

+
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ alphabetic index


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgDB/Input.html b/doc/doc++/osgDB/Input.html new file mode 100644 index 000000000..2c1b8c6a8 --- /dev/null +++ b/doc/doc++/osgDB/Input.html @@ -0,0 +1,161 @@ + + + + + class OSGDB_EXPORT osgDB::Input + + + + +

class OSGDB_EXPORT osgDB::Input

Class for managing the reading of ASCII osg files
+
+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Methods

+[more] Input() +
+[more]virtual ~Input() +
+[more]virtual osg::Object* readObjectOfType(const osg::Object& compObj) +
+[more]virtual osg::Object* readObject() +
+[more]virtual osg::Image* readImage() +
+[more]virtual osg::Drawable* readDrawable() +
+[more]virtual osg::StateAttribute* readStateAttribute() +
+[more]virtual osg::Node* readNode() +
+[more]virtual osg::Object* readObject(const std::string& fileName) +
+[more]virtual osg::Image* readImage(const std::string& fileName) +
+[more]virtual osg::Node* readNode(const std::string& fileName) +
+[more]virtual osg::Object* getObjectForUniqueID(const std::string& uniqueID) +
+[more]virtual void regisiterUniqueIDForObject(const std::string& uniqueID, osg::Object* obj) +

+ +
+

Inherited from FieldReaderIterator:

+
+

+

Public Methods

+ovirtual FieldReaderIterator& operator = (const FieldReaderIterator& ic) +
+ovoid attach(istream* input) +
+ovoid detach() +
+ovirtual bool eof() const +
+oFieldReader& getFieldReader() +
+ovoid insert(int pos, Field* field) +
+ovoid insert(int pos, const char* str) +
+oField& operator [] (int pos) +
+oField& field(int pos) +
+oFieldReaderIterator& operator ++ () +
+oFieldReaderIterator& operator += (int no) +
+ovoid advanceOverCurrentFieldOrBlock() +
+ovoid advanceToEndOfCurrentBlock() +
+ovoid advanceToEndOfBlock(int noNestBrackets) +
+obool matchSequence(const char* str) +

+ +

+

Public Members

+oenum +

+ +
+ + +
+

Documentation

+
Class for managing the reading of ASCII osg files
+
+ + + +
o Input() +

+ + +

ovirtual ~Input() +

+ + +

ovirtual osg::Object* readObjectOfType(const osg::Object& compObj) +

+ + +

ovirtual osg::Object* readObject() +

+ + +

ovirtual osg::Image* readImage() +

+ + +

ovirtual osg::Drawable* readDrawable() +

+ + +

ovirtual osg::StateAttribute* readStateAttribute() +

+ + +

ovirtual osg::Node* readNode() +

+ + +

ovirtual osg::Object* readObject(const std::string& fileName) +

+ + +

ovirtual osg::Image* readImage(const std::string& fileName) +

+ + +

ovirtual osg::Node* readNode(const std::string& fileName) +

+ + +

ovirtual osg::Object* getObjectForUniqueID(const std::string& uniqueID) +

+ + +

ovirtual void regisiterUniqueIDForObject(const std::string& uniqueID, osg::Object* obj) +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgDB/NavigatorButton.class b/doc/doc++/osgDB/NavigatorButton.class new file mode 100644 index 000000000..5fa134ee0 Binary files /dev/null and b/doc/doc++/osgDB/NavigatorButton.class differ diff --git a/doc/doc++/osgDB/Output.html b/doc/doc++/osgDB/Output.html new file mode 100644 index 000000000..67bda34c8 --- /dev/null +++ b/doc/doc++/osgDB/Output.html @@ -0,0 +1,259 @@ + + + + + class OSGDB_EXPORT osgDB::Output + + + + +

class OSGDB_EXPORT osgDB::Output

ofstream wrapper class for adding support for indenting.
+
+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Methods

+[more] Output() +
+[more] Output(const char* name) +
+[more]virtual ~Output() +
+[more]void open(const char* name) +
+[more]void open(const char* name, int mode) +
+[more]Output& indent() +
+[more]inline const int getIndentStep() const +
+[more]inline void setIndentStep(int step) +
+[more]inline const int getIndent() const +
+[more]inline void setIndent(int indent) +
+[more]inline const int getNumIndicesPerLine() const +
+[more]inline void setNumIndicesPerLine(int num) +
+[more]void moveIn() +
+[more]void moveOut() +
+[more]virtual bool writeObject(const osg::Object& obj) +
+[more]bool getUniqueIDForObject(const osg::Object* obj, std::string& uniqueID) +
+[more]bool createUniqueIDForObject(const osg::Object* obj, std::string& uniqueID) +
+[more]bool registerUniqueIDForObject(const osg::Object* obj, std::string& uniqueID) +
+[more]inline void setPathNameHint(const PathNameHint pnh) +
+[more]inline const PathNameHint getPathNameHint() const +
+[more]virtual const std::string getFileNameForOutput(const std::string& filename) const +

+ +

+

Public Members

+[more]enum PathNameHint +

+ +

+

Protected Fields

+[more]int _indent +
+[more]int _indentStep +
+[more]int _numIndicesPerLine +
+[more]std::string _filename +
+[more]PathNameHint _pathNameHint +

+ +

+

Protected Methods

+[more] Output(const Output&) +
+[more]Output& operator = (const Output&) +
+[more]virtual void init() +

+ +

+

Protected Members

+[more]typedef std::map<const osg::Object*,std::string> UniqueIDToLabelMapping UniqueIDToLabelMapping _objectToUniqueIDMap +

+ +
+ + +
+

Documentation

+
ofstream wrapper class for adding support for indenting. +Used in output of .osg ASCII files to improve their readability.
+
+ + + +
o Output() +

+ + +

o Output(const char* name) +

+ + +

ovirtual ~Output() +

+ + +

ovoid open(const char* name) +

+ + +

ovoid open(const char* name, int mode) +

+ + +

oOutput& indent() +

+ + +

oinline const int getIndentStep() const +

+ + +

oinline void setIndentStep(int step) +

+ + +

oinline const int getIndent() const +

+ + +

oinline void setIndent(int indent) +

+ + +

oinline const int getNumIndicesPerLine() const +

+ + +

oinline void setNumIndicesPerLine(int num) +

+ + +

ovoid moveIn() +

+ + +

ovoid moveOut() +

+ + +

ovirtual bool writeObject(const osg::Object& obj) +

+ + +

obool getUniqueIDForObject(const osg::Object* obj, std::string& uniqueID) +

+ + +

obool createUniqueIDForObject(const osg::Object* obj, std::string& uniqueID) +

+ + +

obool registerUniqueIDForObject(const osg::Object* obj, std::string& uniqueID) +

+ + +

oenum PathNameHint +

+ + + +
o AS_IS +

+ + +

o FULL_PATH +

+ + +

o RELATIVE_PATH +

+ + +

o FILENAME_ONLY +

+ + + +
oinline void setPathNameHint(const PathNameHint pnh) +

+ + +

oinline const PathNameHint getPathNameHint() const +

+ + +

ovirtual const std::string getFileNameForOutput(const std::string& filename) const +

+ + +

o Output(const Output&) +

+ + +

oOutput& operator = (const Output&) +

+ + +

ovirtual void init() +

+ + +

oint _indent +

+ + +

oint _indentStep +

+ + +

oint _numIndicesPerLine +

+ + +

otypedef std::map<const osg::Object*,std::string> UniqueIDToLabelMapping UniqueIDToLabelMapping _objectToUniqueIDMap +

+ + +

ostd::string _filename +

+ + +

oPathNameHint _pathNameHint +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgDB/ReaderWriter.html b/doc/doc++/osgDB/ReaderWriter.html new file mode 100644 index 000000000..93779a0cf --- /dev/null +++ b/doc/doc++/osgDB/ReaderWriter.html @@ -0,0 +1,96 @@ + + + + + class OSGDB_EXPORT osgDB::ReaderWriter + + + + +

class OSGDB_EXPORT osgDB::ReaderWriter

pure virtual base class for reading and writing of non native formats.
+
+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Methods

+[more]virtual ~ReaderWriter() +
+[more]virtual const char* className() = 0 +
+[more]virtual bool acceptsExtension(const std::string&xtension*/) +
+[more]virtual osg::Object* readObject(const std::string& ) +
+[more]virtual osg::Image* readImage(const std::string& ) +
+[more]virtual osg::Node* readNode(const std::string& ) +
+[more]virtual bool writeObject(const osg::Object& , const std::string& ) +
+[more]virtual bool writeImage(const osg::Image& , const std::string& ) +
+[more]virtual bool writeNode(const osg::Node& , const std::string& ) +

+ +
+ + +
+

Documentation

+
pure virtual base class for reading and writing of non native formats.
+
+ + + +
ovirtual ~ReaderWriter() +

+ + +

ovirtual const char* className() = 0 +

+ + +

ovirtual bool acceptsExtension(const std::string&xtension*/) +

+ + +

ovirtual osg::Object* readObject(const std::string& ) +

+ + +

ovirtual osg::Image* readImage(const std::string& ) +

+ + +

ovirtual osg::Node* readNode(const std::string& ) +

+ + +

ovirtual bool writeObject(const osg::Object& , const std::string& ) +

+ + +

ovirtual bool writeImage(const osg::Image& , const std::string& ) +

+ + +

ovirtual bool writeNode(const osg::Node& , const std::string& ) +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgDB/RegisterDotOsgWrapperProxy.html b/doc/doc++/osgDB/RegisterDotOsgWrapperProxy.html new file mode 100644 index 000000000..d8f2645a5 --- /dev/null +++ b/doc/doc++/osgDB/RegisterDotOsgWrapperProxy.html @@ -0,0 +1,53 @@ + + + + + class osgDB::RegisterDotOsgWrapperProxy + + + + +

class osgDB::RegisterDotOsgWrapperProxy

Proxy class for automatic registration of DotOsgWrappers with the Registry
+
+ +
+

+

Public Methods

+[more] RegisterDotOsgWrapperProxy(osg::Object* proto, const std::string& name, const std::string& associates, DotOsgWrapper::ReadFunc readFunc, DotOsgWrapper::WriteFunc writeFunc, DotOsgWrapper::ReadWriteMode readWriteMode=DotOsgWrapper::READ_AND_WRITE) +
+[more] ~RegisterDotOsgWrapperProxy() +

+ +

+

Protected Fields

+[more]osg::ref_ptr<DotOsgWrapper> _wrapper +

+ +
+ + +
+

Documentation

+
Proxy class for automatic registration of DotOsgWrappers with the Registry
+
+ + + +
o RegisterDotOsgWrapperProxy(osg::Object* proto, const std::string& name, const std::string& associates, DotOsgWrapper::ReadFunc readFunc, DotOsgWrapper::WriteFunc writeFunc, DotOsgWrapper::ReadWriteMode readWriteMode=DotOsgWrapper::READ_AND_WRITE) +

+ + +

o ~RegisterDotOsgWrapperProxy() +

+ + +

oosg::ref_ptr<DotOsgWrapper> _wrapper +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgDB/RegisterReaderWriterProxy.html b/doc/doc++/osgDB/RegisterReaderWriterProxy.html new file mode 100644 index 000000000..e82c7bd1e --- /dev/null +++ b/doc/doc++/osgDB/RegisterReaderWriterProxy.html @@ -0,0 +1,53 @@ + + + + + template<class T> class osgDB::RegisterReaderWriterProxy + + + + +

template<class T> class osgDB::RegisterReaderWriterProxy

Proxy class for automatic registration of reader/writers with the Registry
+
+ +
+

+

Public Methods

+[more] RegisterReaderWriterProxy() +
+[more] ~RegisterReaderWriterProxy() +

+ +

+

Protected Fields

+[more]osg::ref_ptr<T> _rw +

+ +
+ + +
+

Documentation

+
Proxy class for automatic registration of reader/writers with the Registry
+
+ + + +
o RegisterReaderWriterProxy() +

+ + +

o ~RegisterReaderWriterProxy() +

+ + +

oosg::ref_ptr<T> _rw +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgDB/Registry.html b/doc/doc++/osgDB/Registry.html new file mode 100644 index 000000000..b96be6d9c --- /dev/null +++ b/doc/doc++/osgDB/Registry.html @@ -0,0 +1,212 @@ + + + + + class OSGDB_EXPORT osgDB::Registry + + + + +

class OSGDB_EXPORT osgDB::Registry

Registry is a singleton factory which stores the Objects types available at runtime for loading, and any Object reader or writers which are linked in at runtime for reading non-native file formats.
+
+ +
+

+

Public Methods

+[more] ~Registry() +
+[more]static Registry* instance() +
+[more]void addFileExtensionAlias(const std::string mapExt, const std::string toExt) +
register an fileextension alias to mapExt toExt, the later should the the extension name of the readerwriter plugin library. +
+[more]void addDotOsgWrapper(DotOsgWrapper* wrapper) +
+[more]void removeDotOsgWrapper(DotOsgWrapper* wrapper) +
+[more]void addReaderWriter(ReaderWriter* rw) +
+[more]void removeReaderWriter(ReaderWriter* rw) +
+[more]std::string createLibraryNameForFile(const std::string& fileName) +
create the platform specific library name associated with file +
+[more]std::string createLibraryNameForExt(const std::string& ext) +
create the platform specific library name associated with file extension +
+[more]bool loadLibrary(const std::string& fileName) +
find the library in the SG_LIBRARY_PATH and load it +
+[more]bool closeLibrary(const std::string& fileName) +
close the attached library with specified name +
+[more]osg::Object* readObjectOfType(const osg::Object& compObj, Input& fr) +
+[more]osg::Object* readObject(Input& fr) +
+[more]osg::Image* readImage(Input& fr) +
+[more]osg::Drawable* readDrawable(Input& fr) +
+[more]osg::StateAttribute* readStateAttribute(Input& fr) +
+[more]osg::Node* readNode(Input& fr) +
+[more]bool writeObject(const osg::Object& obj, Output& fw) +
+[more]osg::Object* readObject(const std::string& fileName) +
+[more]bool writeObject(const osg::Object& obj, const std::string& fileName) +
+[more]osg::Image* readImage(const std::string& fileName) +
+[more]bool writeImage(const osg::Image& obj, const std::string& fileName) +
+[more]osg::Node* readNode(const std::string& fileName) +
+[more]bool writeNode(const osg::Node& node, const std::string& fileName) +
+[more]void setCreateNodeFromImage(bool flag) +
+[more]bool getCreateNodeFromImage() const +

+ +
+ + +
+

Documentation

+
+Registry is a singleton factory which stores +the Objects types available at runtime for loading, +and any Object reader or writers which are linked in +at runtime for reading non-native file formats. + +

The RegisterObjectProxy can be used to automatically register +at runtime a Object with the Registry. + +

The RegisterReaderWriterProxy can be used to automatically +register at runtime a reader/writer with the Registry.

+
+ + + +
o ~Registry() +

+ + +

ostatic Registry* instance() +

+ + +

ovoid addFileExtensionAlias(const std::string mapExt, const std::string toExt) +
register an fileextension alias to mapExt toExt, the later +should the the extension name of the readerwriter plugin library. +For example to map .tif files to the tiff loader, use +addExtAlias("tif","tiff") which will enable .tif to be read +by the libdb_tiff readerwriter plugin. +

+ + +

ovoid addDotOsgWrapper(DotOsgWrapper* wrapper) +

+ + +

ovoid removeDotOsgWrapper(DotOsgWrapper* wrapper) +

+ + +

ovoid addReaderWriter(ReaderWriter* rw) +

+ + +

ovoid removeReaderWriter(ReaderWriter* rw) +

+ + +

ostd::string createLibraryNameForFile(const std::string& fileName) +
create the platform specific library name associated with file +

+ + +

ostd::string createLibraryNameForExt(const std::string& ext) +
create the platform specific library name associated with file extension +

+ + +

obool loadLibrary(const std::string& fileName) +
find the library in the SG_LIBRARY_PATH and load it +

+ + +

obool closeLibrary(const std::string& fileName) +
close the attached library with specified name +

+ + +

oosg::Object* readObjectOfType(const osg::Object& compObj, Input& fr) +

+ + +

oosg::Object* readObject(Input& fr) +

+ + +

oosg::Image* readImage(Input& fr) +

+ + +

oosg::Drawable* readDrawable(Input& fr) +

+ + +

oosg::StateAttribute* readStateAttribute(Input& fr) +

+ + +

oosg::Node* readNode(Input& fr) +

+ + +

obool writeObject(const osg::Object& obj, Output& fw) +

+ + +

oosg::Object* readObject(const std::string& fileName) +

+ + +

obool writeObject(const osg::Object& obj, const std::string& fileName) +

+ + +

oosg::Image* readImage(const std::string& fileName) +

+ + +

obool writeImage(const osg::Image& obj, const std::string& fileName) +

+ + +

oosg::Node* readNode(const std::string& fileName) +

+ + +

obool writeNode(const osg::Node& node, const std::string& fileName) +

+ + +

ovoid setCreateNodeFromImage(bool flag) +

+ + +

obool getCreateNodeFromImage() const +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgDB/findDSO.html b/doc/doc++/osgDB/findDSO.html new file mode 100644 index 000000000..3c8e552f2 --- /dev/null +++ b/doc/doc++/osgDB/findDSO.html @@ -0,0 +1,20 @@ + + + + + OSGDB_EXPORT extern char* osgDB::findDSO + + + + +

OSGDB_EXPORT extern char* osgDB::findDSO

( const char* name )

find specified dso/dll
+ + +
+

Documentation

+
find specified dso/dll
+

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgDB/findFile.html b/doc/doc++/osgDB/findFile.html new file mode 100644 index 000000000..ba693df7e --- /dev/null +++ b/doc/doc++/osgDB/findFile.html @@ -0,0 +1,20 @@ + + + + + OSGDB_EXPORT extern char* osgDB::findFile + + + + +

OSGDB_EXPORT extern char* osgDB::findFile

( const char* file )

find specified file on the set data file path
+ + +
+

Documentation

+
find specified file on the set data file path
+

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgDB/findFileInDirectory.html b/doc/doc++/osgDB/findFileInDirectory.html new file mode 100644 index 000000000..992cf5ef1 --- /dev/null +++ b/doc/doc++/osgDB/findFileInDirectory.html @@ -0,0 +1,23 @@ + + + + + OSGDB_EXPORT extern std::string osgDB::findFileInDirectory + + + + +

OSGDB_EXPORT extern std::string osgDB::findFileInDirectory

(const std::string& fileName,
  const std::string& dirName,
  bool caseInsensitive=false)

return the directory/filename of a file if its is contained within specified directory.
+ + +
+

Documentation

+
return the directory/filename of a file if its is contained within specified directory. +return "" if directory does not contain file. If caseInsensitive is set to true then +a case insenstive comparision is used to compare fileName to directory contents. +This is useful when unix programs attempt read case insentive windows filenames.
+

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgDB/getDirectoryContents.html b/doc/doc++/osgDB/getDirectoryContents.html new file mode 100644 index 000000000..a5ba70728 --- /dev/null +++ b/doc/doc++/osgDB/getDirectoryContents.html @@ -0,0 +1,21 @@ + + + + + OSGDB_EXPORT extern DirectoryContents osgDB::getDirectoryContents + + + + +

OSGDB_EXPORT extern DirectoryContents osgDB::getDirectoryContents

(const std::string& dirName)

return the contents of a directory.
+ + +
+

Documentation

+
return the contents of a directory. +returns an empty array on any error.
+

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgDB/getFilePath.html b/doc/doc++/osgDB/getFilePath.html new file mode 100644 index 000000000..60d08d5d5 --- /dev/null +++ b/doc/doc++/osgDB/getFilePath.html @@ -0,0 +1,20 @@ + + + + + OSGDB_EXPORT extern const char* osgDB::getFilePath + + + + +

OSGDB_EXPORT extern const char* osgDB::getFilePath

()

set the data file path
+ + +
+

Documentation

+
set the data file path
+

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgDB/icon1.gif b/doc/doc++/osgDB/icon1.gif new file mode 100644 index 000000000..f78f30eb9 Binary files /dev/null and b/doc/doc++/osgDB/icon1.gif differ diff --git a/doc/doc++/osgDB/icon2.gif b/doc/doc++/osgDB/icon2.gif new file mode 100644 index 000000000..6cbe01a83 Binary files /dev/null and b/doc/doc++/osgDB/icon2.gif differ diff --git a/doc/doc++/osgDB/index.html b/doc/doc++/osgDB/index.html new file mode 100644 index 000000000..c9ef9afa8 --- /dev/null +++ b/doc/doc++/osgDB/index.html @@ -0,0 +1,47 @@ + + + + + Table of Contents + + + + +

Table of Contents

+

Namespaces

+ +

Functions

+ +

Macros

+ +

Hierarchy of classes


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgDB/initFilePath.html b/doc/doc++/osgDB/initFilePath.html new file mode 100644 index 000000000..a88085776 --- /dev/null +++ b/doc/doc++/osgDB/initFilePath.html @@ -0,0 +1,22 @@ + + + + + OSGDB_EXPORT extern void osgDB::initFilePath + + + + +

OSGDB_EXPORT extern void osgDB::initFilePath

( void )

initialize the data file path, uses OSGFILEPATH environmental variable to defined
+ + +
+

Documentation

+
initialize the data file path, +uses OSGFILEPATH environmental +variable to defined
+

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgDB/osgDB.html b/doc/doc++/osgDB/osgDB.html new file mode 100644 index 000000000..d8f7a2b20 --- /dev/null +++ b/doc/doc++/osgDB/osgDB.html @@ -0,0 +1,145 @@ + + + + + namespace osgDB + + + + +

namespace osgDB

+
+

+
+class OSGDB_EXPORT DotOsgWrapper: public osg::Referenced +
Wrapper class for specifing read and write functions for extending the osg file format. +
+class OSGDB_EXPORT DynamicLibrary: public osg::Referenced +
DynamicLibrary - encapsulates the loading and unloading of dynamic libraries, typically used for loading ReaderWriter plug-ins +
+class OSGDB_EXPORT Field +
+class OSGDB_EXPORT FieldReader +
+class OSGDB_EXPORT FieldReaderIterator +
+[more]OSGDB_EXPORT extern std::string getFilePath(const std::string& filename) +
+[more]OSGDB_EXPORT extern std::string getFileExtension(const std::string& filename) +
+[more]OSGDB_EXPORT extern std::string getLowerCaseFileExtension(const std::string& filename) +
+[more]OSGDB_EXPORT extern std::string getSimpleFileName(const std::string& fileName) +
+[more]OSGDB_EXPORT extern std::string getStrippedName(const std::string& fileName) +
+[more]OSGDB_EXPORT extern bool equalCaseInsensitive(const std::string& lhs, const std::string& rhs) +
+[more]OSGDB_EXPORT extern bool equalCaseInsensitive(const std::string& lhs, const char* rhs) +
+OSGDB_EXPORT extern void initFilePath( void ) +
initialize the data file path, uses OSGFILEPATH environmental variable to defined +
+OSGDB_EXPORT extern void setFilePath( const char* _path ) +
set the data file path +
+OSGDB_EXPORT extern const char* getFilePath() +
set the data file path +
+OSGDB_EXPORT extern char* findFile( const char* file ) +
find specified file on the set data file path +
+OSGDB_EXPORT extern char* findDSO( const char* name ) +
find specified dso/dll +
+typedef std::vector<std::string> DirectoryContents +
simple list of names to represent a directory's contents. +
+OSGDB_EXPORT extern std::string findFileInDirectory(const std::string& fileName, const std::string& dirName, bool caseInsensitive=false) +
return the directory/filename of a file if its is contained within specified directory. +
+OSGDB_EXPORT extern DirectoryContents getDirectoryContents(const std::string& dirName) +
return the contents of a directory. +
+class OSGDB_EXPORT Input: public FieldReaderIterator +
Class for managing the reading of ASCII osg files +
+class OSGDB_EXPORT Output: public ofstream +
ofstream wrapper class for adding support for indenting. +
+[more]template<class T> bool writeArrayBlock(Output& fw, T* start, T* finish) +
+class OSGDB_EXPORT ReaderWriter: public osg::Referenced +
pure virtual base class for reading and writing of non native formats. +
+OSGDB_EXPORT extern osg::Object* readObjectFile(const std::string& filename) +
Read an osg::Object from file. +
+OSGDB_EXPORT extern osg::Image* readImageFile(const std::string& filename) +
Read an osg::Image from file. +
+OSGDB_EXPORT extern osg::Node* readNodeFile(const std::string& filename) +
Read an osg::Node from file. +
+class OSGDB_EXPORT Registry +
Registry is a singleton factory which stores the Objects types available at runtime for loading, and any Object reader or writers which are linked in at runtime for reading non-native file formats. +
+class RegisterDotOsgWrapperProxy +
Proxy class for automatic registration of DotOsgWrappers with the Registry +
+template<class T> class RegisterReaderWriterProxy +
Proxy class for automatic registration of reader/writers with the Registry +
+OSGDB_EXPORT extern bool writeObjectFile(const osg::Object& object, const std::string& filename) +
Write an osg::Object to file. +
+OSGDB_EXPORT extern bool writeImageFile(const osg::Image& image, const std::string& filename) +
Write an osg::Image to file. +
+OSGDB_EXPORT extern bool writeNodeFile(const osg::Node& node, const std::string& filename) +
Write an osg::Node to file. +

+ + + +
+

Documentation

+
+ + + +
oOSGDB_EXPORT extern std::string getFilePath(const std::string& filename) +

+ + +

oOSGDB_EXPORT extern std::string getFileExtension(const std::string& filename) +

+ + +

oOSGDB_EXPORT extern std::string getLowerCaseFileExtension(const std::string& filename) +

+ + +

oOSGDB_EXPORT extern std::string getSimpleFileName(const std::string& fileName) +

+ + +

oOSGDB_EXPORT extern std::string getStrippedName(const std::string& fileName) +

+ + +

oOSGDB_EXPORT extern bool equalCaseInsensitive(const std::string& lhs, const std::string& rhs) +

+ + +

oOSGDB_EXPORT extern bool equalCaseInsensitive(const std::string& lhs, const char* rhs) +

+ + +

otemplate<class T> bool writeArrayBlock(Output& fw, T* start, T* finish) +

+

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgDB/osgDBGetLibraryName.html b/doc/doc++/osgDB/osgDBGetLibraryName.html new file mode 100644 index 000000000..f86c3351d --- /dev/null +++ b/doc/doc++/osgDB/osgDBGetLibraryName.html @@ -0,0 +1,21 @@ + + + + + extern OSGDB_EXPORT const char* osgDBGetLibraryName + + + + +

extern OSGDB_EXPORT const char* osgDBGetLibraryName

()

getLibraryName() returns the library name in human friendly form
+ + +
+

Documentation

+
+getLibraryName() returns the library name in human friendly form
+

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgDB/osgDBGetVersion.html b/doc/doc++/osgDB/osgDBGetVersion.html new file mode 100644 index 000000000..1dc87438f --- /dev/null +++ b/doc/doc++/osgDB/osgDBGetVersion.html @@ -0,0 +1,34 @@ + + + + + extern OSGDB_EXPORT const char* osgDBGetVersion + + + + +

extern OSGDB_EXPORT const char* osgDBGetVersion

()

osgDBGetVersion() returns the library version number.
+ + +
+

Documentation

+
+osgDBGetVersion() returns the library version number. +Numbering conventon : osg_src-0.8.31 will return 0.8.31 from getVersion_osg. + +

This C function can be also used to check for the existance of the OpenSceneGraph +library using autoconf and its m4 macro AC_CHECK_LIB. + +

Here is the code to add to your configure.in: +\verbatim +# +# Check for the OpenSceneGraph (OSG) library +# +AC_CHECK_LIB(osg, osgDBGetVersion, , +[AC_MSG_ERROR(OpenSceneGraph DB library not found. See http://www.openscenegraph.org)],) +\endverbatim

+

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgDB/readImageFile.html b/doc/doc++/osgDB/readImageFile.html new file mode 100644 index 000000000..46fab13c5 --- /dev/null +++ b/doc/doc++/osgDB/readImageFile.html @@ -0,0 +1,25 @@ + + + + + OSGDB_EXPORT extern osg::Image* osgDB::readImageFile + + + + +

OSGDB_EXPORT extern osg::Image* osgDB::readImageFile

(const std::string& filename)

Read an osg::Image from file.
+ + +
+

Documentation

+
Read an osg::Image from file. +Return valid osg::Image on sucess, +return NULL on failure. +The osgDB::Registry is used to load the appropriate ReaderWriter plugin +for the filename extension, and this plugin then handles the request +to read the specified file.
+

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgDB/readNodeFile.html b/doc/doc++/osgDB/readNodeFile.html new file mode 100644 index 000000000..60619cb26 --- /dev/null +++ b/doc/doc++/osgDB/readNodeFile.html @@ -0,0 +1,25 @@ + + + + + OSGDB_EXPORT extern osg::Node* osgDB::readNodeFile + + + + +

OSGDB_EXPORT extern osg::Node* osgDB::readNodeFile

(const std::string& filename)

Read an osg::Node from file.
+ + +
+

Documentation

+
Read an osg::Node from file. +Return valid osg::Node on sucess, +return NULL on failure. +The osgDB::Registry is used to load the appropriate ReaderWriter plugin +for the filename extension, and this plugin then handles the request +to read the specified file.
+

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgDB/readObjectFile.html b/doc/doc++/osgDB/readObjectFile.html new file mode 100644 index 000000000..e4d6d165a --- /dev/null +++ b/doc/doc++/osgDB/readObjectFile.html @@ -0,0 +1,25 @@ + + + + + OSGDB_EXPORT extern osg::Object* osgDB::readObjectFile + + + + +

OSGDB_EXPORT extern osg::Object* osgDB::readObjectFile

(const std::string& filename)

Read an osg::Object from file.
+ + +
+

Documentation

+
Read an osg::Object from file. +Return valid osg::Object on sucess, +return NULL on failure. +The osgDB::Registry is used to load the appropriate ReaderWriter plugin +for the filename extension, and this plugin then handles the request +to read the specified file.
+

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgDB/setFilePath.html b/doc/doc++/osgDB/setFilePath.html new file mode 100644 index 000000000..521e55d30 --- /dev/null +++ b/doc/doc++/osgDB/setFilePath.html @@ -0,0 +1,20 @@ + + + + + OSGDB_EXPORT extern void osgDB::setFilePath + + + + +

OSGDB_EXPORT extern void osgDB::setFilePath

( const char* _path )

set the data file path
+ + +
+

Documentation

+
set the data file path
+

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgDB/writeImageFile.html b/doc/doc++/osgDB/writeImageFile.html new file mode 100644 index 000000000..e5e3308ea --- /dev/null +++ b/doc/doc++/osgDB/writeImageFile.html @@ -0,0 +1,25 @@ + + + + + OSGDB_EXPORT extern bool osgDB::writeImageFile + + + + +

OSGDB_EXPORT extern bool osgDB::writeImageFile

(const osg::Image& image,
  const std::string& filename)

Write an osg::Image to file.
+ + +
+

Documentation

+
Write an osg::Image to file. +Return true on sucess, +return false on failure. +The osgDB::Registry is used to load the appropriate ReaderWriter plugin +for the filename extension, and this plugin then handles the request +to write the specified file.
+

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgDB/writeNodeFile.html b/doc/doc++/osgDB/writeNodeFile.html new file mode 100644 index 000000000..ca20b6a19 --- /dev/null +++ b/doc/doc++/osgDB/writeNodeFile.html @@ -0,0 +1,25 @@ + + + + + OSGDB_EXPORT extern bool osgDB::writeNodeFile + + + + +

OSGDB_EXPORT extern bool osgDB::writeNodeFile

(const osg::Node& node,
  const std::string& filename)

Write an osg::Node to file.
+ + +
+

Documentation

+
Write an osg::Node to file. +Return true on sucess, +return false on failure. +The osgDB::Registry is used to load the appropriate ReaderWriter plugin +for the filename extension, and this plugin then handles the request +to write the specified file.
+

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgDB/writeObjectFile.html b/doc/doc++/osgDB/writeObjectFile.html new file mode 100644 index 000000000..bfa06b2d9 --- /dev/null +++ b/doc/doc++/osgDB/writeObjectFile.html @@ -0,0 +1,25 @@ + + + + + OSGDB_EXPORT extern bool osgDB::writeObjectFile + + + + +

OSGDB_EXPORT extern bool osgDB::writeObjectFile

(const osg::Object& object,
  const std::string& filename)

Write an osg::Object to file.
+ + +
+

Documentation

+
Write an osg::Object to file. +Return true on sucess, +return false on failure. +The osgDB::Registry is used to load the appropriate ReaderWriter plugin +for the filename extension, and this plugin then handles the request +to write the specified file.
+

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgGLUT/ClassGraph.class b/doc/doc++/osgGLUT/ClassGraph.class new file mode 100644 index 000000000..c6a7b6c79 Binary files /dev/null and b/doc/doc++/osgGLUT/ClassGraph.class differ diff --git a/doc/doc++/osgGLUT/ClassGraphPanel.class b/doc/doc++/osgGLUT/ClassGraphPanel.class new file mode 100644 index 000000000..94b21b47a Binary files /dev/null and b/doc/doc++/osgGLUT/ClassGraphPanel.class differ diff --git a/doc/doc++/osgGLUT/ClassLayout.class b/doc/doc++/osgGLUT/ClassLayout.class new file mode 100644 index 000000000..77fb9fa28 Binary files /dev/null and b/doc/doc++/osgGLUT/ClassLayout.class differ diff --git a/doc/doc++/osgGLUT/GLUTEventAdapter.html b/doc/doc++/osgGLUT/GLUTEventAdapter.html new file mode 100644 index 000000000..9e043caf7 --- /dev/null +++ b/doc/doc++/osgGLUT/GLUTEventAdapter.html @@ -0,0 +1,323 @@ + + + + + class OSGGLUT_EXPORT osgGLUT::GLUTEventAdapter + + + + +

class OSGGLUT_EXPORT osgGLUT::GLUTEventAdapter

Class for adapting GLUT events so that they can be used as input to osgUtil::CameraManipulators
+
+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Methods

+[more] GLUTEventAdapter() +
+[more]virtual ~GLUTEventAdapter() +
+[more]virtual EventType getEventType() const +
Get the EventType of the GUI event +
+[more]virtual int getKey() const +
key pressed, return -1 if inapropriate for this event. +
+[more]virtual int getButton() const +
button pressed/released, return -1 if inappropriate for this event +
+[more]virtual int getXmin() const +
window minimum x. +
+[more]virtual int getXmax() const +
window maximum x. +
+[more]virtual int getYmin() const +
window minimum y. +
+[more]virtual int getYmax() const +
window maximum y. +
+[more]virtual int getX() const +
current mouse x position +
+[more]virtual int getY() const +
current mouse y position +
+[more]virtual unsigned int getButtonMask() const +
current mouse button state +
+[more]virtual float time() const +
time in seconds of event. +
+[more]static void setWindowSize(int Xmin, int Ymin, int Xmax, int Ymax) +
static method for setting window dimensions +
+[more]static void setButtonMask(unsigned int buttonMask) +
static method for setting button state +
+[more]void adaptResize(float t, int Xmin, int Ymin, int Xmax, int Ymax) +
method for adapting resize events. +
+[more]void adaptMouseMotion(float t, int x, int y) +
method for adapting mouse motion events whilst mouse buttons are pressed +
+[more]void adaptMousePassiveMotion(float t, int x, int y) +
method for adapting mouse motion events whilst no mouse button are pressed +
+[more]void adaptMouse(float t, int button, int state, int x, int y) +
method for adapting mouse button pressed/released events +
+[more]void adaptKeyboard(float t, unsigned char key, int x, int y ) +
method for adapting keyboard events +
+[more]void adaptFrame(float t) +
method for adapting frame events, ie. +
+[more]void copyStaticVariables() +

+ +

+

Protected Fields

+[more]EventType _eventType +
+[more]int _key +
+[more]int _button +
+[more]int _Xmin +
+[more]int _Xmax +
+[more]int _Ymin +
+[more]int _Ymax +
+[more]int _mx +
+[more]int _my +
+[more]unsigned int _buttonMask +
+[more]float _time +
+[more]static unsigned int _s_accumulatedButtonMask +
+[more]static int _s_Xmin +
+[more]static int _s_Xmax +
+[more]static int _s_Ymin +
+[more]static int _s_Ymax +
+[more]static int _s_mx +
+[more]static int _s_my +

+ +
+ + +
+

Documentation

+
Class for adapting GLUT events so that they can be used as input to osgUtil::CameraManipulators
+
+ + + +
o GLUTEventAdapter() +

+ + +

ovirtual ~GLUTEventAdapter() +

+ + +

ovirtual EventType getEventType() const +
Get the EventType of the GUI event +

+ + +

ovirtual int getKey() const +
key pressed, return -1 if inapropriate for this event. +

+ + +

ovirtual int getButton() const +
button pressed/released, return -1 if inappropriate for this event +

+ + +

ovirtual int getXmin() const +
window minimum x. +

+ + +

ovirtual int getXmax() const +
window maximum x. +

+ + +

ovirtual int getYmin() const +
window minimum y. +

+ + +

ovirtual int getYmax() const +
window maximum y. +

+ + +

ovirtual int getX() const +
current mouse x position +

+ + +

ovirtual int getY() const +
current mouse y position +

+ + +

ovirtual unsigned int getButtonMask() const +
current mouse button state +

+ + +

ovirtual float time() const +
time in seconds of event. +

+ + +

ostatic void setWindowSize(int Xmin, int Ymin, int Xmax, int Ymax) +
static method for setting window dimensions +

+ + +

ostatic void setButtonMask(unsigned int buttonMask) +
static method for setting button state +

+ + +

ovoid adaptResize(float t, int Xmin, int Ymin, int Xmax, int Ymax) +
method for adapting resize events. +

+ + +

ovoid adaptMouseMotion(float t, int x, int y) +
method for adapting mouse motion events whilst mouse buttons are pressed +

+ + +

ovoid adaptMousePassiveMotion(float t, int x, int y) +
method for adapting mouse motion events whilst no mouse button are pressed +

+ + +

ovoid adaptMouse(float t, int button, int state, int x, int y) +
method for adapting mouse button pressed/released events +

+ + +

ovoid adaptKeyboard(float t, unsigned char key, int x, int y ) +
method for adapting keyboard events +

+ + +

ovoid adaptFrame(float t) +
method for adapting frame events, ie. iddle/display callback. +

+ + +

ovoid copyStaticVariables() +

+ + +

oEventType _eventType +

+ + +

oint _key +

+ + +

oint _button +

+ + +

oint _Xmin +

+ + +

oint _Xmax +

+ + +

oint _Ymin +

+ + +

oint _Ymax +

+ + +

oint _mx +

+ + +

oint _my +

+ + +

ounsigned int _buttonMask +

+ + +

ofloat _time +

+ + +

ostatic unsigned int _s_accumulatedButtonMask +

+ + +

ostatic int _s_Xmin +

+ + +

ostatic int _s_Xmax +

+ + +

ostatic int _s_Ymin +

+ + +

ostatic int _s_Ymax +

+ + +

ostatic int _s_mx +

+ + +

ostatic int _s_my +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgGLUT/General.html b/doc/doc++/osgGLUT/General.html new file mode 100644 index 000000000..9eb92ecbc --- /dev/null +++ b/doc/doc++/osgGLUT/General.html @@ -0,0 +1,37 @@ + + + + + General Bits + + + + +
+
+ +o#define +OSGGLUT_EXPORT_
+ +o#define +OSGGLUT_EXPORT(dllexport)
+ +o#define +OSGGLUT_EXPORT(dllimport)
+ +o#define +OSGGLUT_EXPORT
+ +o#define +OSGGLUT_GLUTEVENTADAPTER
+ +o#define +OSGGLUT_VERSION
+ +o#define +OSGGLUT_VIEWER
+

Alphabetic index Hierarchy of classes


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgGLUT/HIER.html b/doc/doc++/osgGLUT/HIER.html new file mode 100644 index 000000000..2274d76ed --- /dev/null +++ b/doc/doc++/osgGLUT/HIER.html @@ -0,0 +1,18 @@ + + + + + Hierarchy of Classes + + + +

Hierarchy of Classes

+ +

Alphabetic index


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgGLUT/HIERjava.html b/doc/doc++/osgGLUT/HIERjava.html new file mode 100644 index 000000000..e98c1bb73 --- /dev/null +++ b/doc/doc++/osgGLUT/HIERjava.html @@ -0,0 +1,30 @@ + + + + + Hierarchy of Classes + + + +

Hierarchy of classes

+
    + + + + + + + + + + + + + + +
+ alphabetic index


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgGLUT/NavigatorButton.class b/doc/doc++/osgGLUT/NavigatorButton.class new file mode 100644 index 000000000..5fa134ee0 Binary files /dev/null and b/doc/doc++/osgGLUT/NavigatorButton.class differ diff --git a/doc/doc++/osgGLUT/Viewer.html b/doc/doc++/osgGLUT/Viewer.html new file mode 100644 index 000000000..f46ca07a8 --- /dev/null +++ b/doc/doc++/osgGLUT/Viewer.html @@ -0,0 +1,596 @@ + + + + + class OSGGLUT_EXPORT osgGLUT::Viewer + + + + +

class OSGGLUT_EXPORT osgGLUT::Viewer

A basic viewer base class which provides a window, simple keyboard and mouse interaction.
+
+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Methods

+[more] Viewer() +
+[more]virtual ~Viewer() +
+[more]void setWindowOrigin(int x, int y) +
+[more]void setWindowSize(int width, int height) +
+[more]void setWindowTitle(const std::string& title) +
+[more]virtual void init(osg::Node* rootnode) +
init is deprecated, you should use addViewport instead. +
+[more]virtual void addViewport(osgUtil::SceneView* sv, float x = 0.0, float y = 0.0, float width = 1.0, float height = 1.0) +
+[more]virtual void addViewport(osg::Node*, float x = 0.0, float y = 0.0, float width = 1.0, float height = 1.0) +
+[more]const int getNumViewports() const +
+[more]osgUtil::SceneView* getViewportSceneView(unsigned int pos) +
+[more]virtual bool open() +
+[more]virtual bool run() +
+[more]virtual float app(unsigned int viewport) +
+[more]virtual float cull(unsigned int viewport) +
+[more]virtual float draw(unsigned int viewport) +
+[more]long initClock() +
+[more]float clockSeconds() +
+[more]osg::Timer_t updateFrameTick() +
+[more]float frameSeconds() +
+[more]float frameRate() +
+[more]void help(ostream& fout) +
+[more]unsigned int registerCameraManipulator(osgUtil::CameraManipulator* cm, unsigned int viewport = 0) +
+[more]void selectCameraManipulator(unsigned int pos, unsigned int viewport = 0) +
+[more]virtual void requestRedraw() +
+[more]virtual void requestContinuousUpdate(bool ) +
+[more]virtual void requestWarpPointer(int x, int y) +

+ +

+

Protected Fields

+[more]static Viewer* s_theViewer +
+[more]unsigned int _focusedViewport +
+[more]std::string _saveFileName +
+[more]std::string _title +
+[more]int wx +
+[more]int wy +
+[more]int ww +
+[more]int wh +
+[more]int _is_open +
+[more]unsigned int frame_rate +
+[more]RTfs* fs +
+[more]bool _viewFrustumCullingActive +
+[more]bool _smallFeatureCullingActive +
+[more]int mx +
+[more]int my +
+[more]int mbutton +
+[more]int polymode +
+[more]int texture +
+[more]int backface +
+[more]int lighting +
+[more]int flat_shade +
+[more]int _two_sided_lighting +
+[more]bool fullscreen +
+[more]int _saved_wx +
+[more]int _saved_wy +
+[more]int _saved_ww +
+[more]int _saved_wh +
+[more]float frRate +
+[more]int _printStats +
+[more]bool _useDisplayLists +
+[more]osg::Timer _timer +
+[more]osg::Timer_t _tickRatePerSecond +
+[more]osg::Timer_t _initialTick +
+[more]osg::Timer_t _lastFrameTick +
+[more]osg::Timer_t _frameTick +

+ +

+

Protected Methods

+[more]static void displayCB() +
+[more]static void reshapeCB(int w, int h) +
+[more]static void visibilityCB(int state) +
+[more]static void mouseMotionCB(int x, int y) +
+[more]static void mousePassiveMotionCB(int x, int y) +
+[more]static void mouseCB(int button, int state, int x, int y) +
+[more]static void keyboardCB(unsigned char key, int x, int y ) +
+[more]virtual void display() +
+[more]virtual void reshape(GLint w, GLint h) +
+[more]virtual void visibility(int state) +
+[more]virtual void mouseMotion(int x, int y) +
+[more]virtual void mousePassiveMotion(int x, int y) +
+[more]virtual void mouse(int button, int state, int x, int y) +
+[more]virtual void keyboard(unsigned char key, int x, int y) +
+[more]void setFocusedViewport(unsigned int pos) +
+[more]int mapWindowXYToSceneView(int x, int y) +
+[more]void showStats(void) +
+[more]osg::Timer_t clockTick() +
+[more]osg::Timer_t frameTick() +

+ +

+

Protected Members

+[more]typedef std::vector<osg::ref_ptr<osgUtil::CameraManipulator> > CameraManipListstruct ViewportDef +
+[more]typedef std::vector<ViewportDef> ViewportList ViewportList _viewportList +
+[more]struct +

+ +
+ + +
+

Documentation

+
A basic viewer base class which provides a window, simple keyboard and mouse interaction. +Please note, this viewer class has been developed via a rather haphazard +path and needs a total rewrite. It currently suffices for osg demo's +but shouldn't be viewed as the be all and end of osg viewer classes. +Someone please rewrite it :-)
+
+ + + +
o Viewer() +

+ + +

ovirtual ~Viewer() +

+ + +

ovoid setWindowOrigin(int x, int y) +

+ + +

ovoid setWindowSize(int width, int height) +

+ + +

ovoid setWindowTitle(const std::string& title) +

+ + +

ovirtual void init(osg::Node* rootnode) +
init is deprecated, you should use addViewport instead. init is +only available for backwards compatibility. +

+ + +

ovirtual void addViewport(osgUtil::SceneView* sv, float x = 0.0, float y = 0.0, float width = 1.0, float height = 1.0) +

+ + +

ovirtual void addViewport(osg::Node*, float x = 0.0, float y = 0.0, float width = 1.0, float height = 1.0) +

+ + +

oconst int getNumViewports() const +

+ + +

oosgUtil::SceneView* getViewportSceneView(unsigned int pos) +

+ + +

ovirtual bool open() +

+ + +

ovirtual bool run() +

+ + +

ovirtual float app(unsigned int viewport) +

+ + +

ovirtual float cull(unsigned int viewport) +

+ + +

ovirtual float draw(unsigned int viewport) +

+ + +

olong initClock() +

+ + +

ofloat clockSeconds() +

+ + +

oosg::Timer_t updateFrameTick() +

+ + +

ofloat frameSeconds() +

+ + +

ofloat frameRate() +

+ + +

ovoid help(ostream& fout) +

+ + +

ounsigned int registerCameraManipulator(osgUtil::CameraManipulator* cm, unsigned int viewport = 0) +

+ + +

ovoid selectCameraManipulator(unsigned int pos, unsigned int viewport = 0) +

+ + +

ovirtual void requestRedraw() +

+ + +

ovirtual void requestContinuousUpdate(bool ) +

+ + +

ovirtual void requestWarpPointer(int x, int y) +

+ + +

ostatic void displayCB() +

+ + +

ostatic void reshapeCB(int w, int h) +

+ + +

ostatic void visibilityCB(int state) +

+ + +

ostatic void mouseMotionCB(int x, int y) +

+ + +

ostatic void mousePassiveMotionCB(int x, int y) +

+ + +

ostatic void mouseCB(int button, int state, int x, int y) +

+ + +

ostatic void keyboardCB(unsigned char key, int x, int y ) +

+ + +

ovirtual void display() +

+ + +

ovirtual void reshape(GLint w, GLint h) +

+ + +

ovirtual void visibility(int state) +

+ + +

ovirtual void mouseMotion(int x, int y) +

+ + +

ovirtual void mousePassiveMotion(int x, int y) +

+ + +

ovirtual void mouse(int button, int state, int x, int y) +

+ + +

ovirtual void keyboard(unsigned char key, int x, int y) +

+ + +

ovoid setFocusedViewport(unsigned int pos) +

+ + +

oint mapWindowXYToSceneView(int x, int y) +

+ + +

ovoid showStats(void) +

+ + +

ostatic Viewer* s_theViewer +

+ + +

otypedef std::vector<osg::ref_ptr<osgUtil::CameraManipulator> > CameraManipListstruct ViewportDef +

+ + + +
oosg::ref_ptr<osgUtil::SceneView> sceneView +

+ + +

ofloat viewport[4] +

+ + +

oosg::ref_ptr<osgUtil::CameraManipulator> _cameraManipulator +

+ + +

oCameraManipList _cameraManipList +

+ + + +
otypedef std::vector<ViewportDef> ViewportList ViewportList _viewportList +

+ + +

ounsigned int _focusedViewport +

+ + +

ostd::string _saveFileName +

+ + +

ostd::string _title +

+ + +

oint wx +

+ + +

oint wy +

+ + +

oint ww +

+ + +

oint wh +

+ + +

oint _is_open +

+ + +

ounsigned int frame_rate +

+ + +

oRTfs* fs +

+ + +

obool _viewFrustumCullingActive +

+ + +

obool _smallFeatureCullingActive +

+ + +

oint mx +

+ + +

oint my +

+ + +

oint mbutton +

+ + +

oint polymode +

+ + +

oint texture +

+ + +

oint backface +

+ + +

oint lighting +

+ + +

oint flat_shade +

+ + +

oint _two_sided_lighting +

+ + +

obool fullscreen +

+ + +

oint _saved_wx +

+ + +

oint _saved_wy +

+ + +

oint _saved_ww +

+ + +

oint _saved_wh +

+ + +

ofloat frRate +

+ + +

oint _printStats +

+ + +

ostruct +

+ + + +
ofloat timeApp +

+ + +

ofloat timeCull +

+ + +

ofloat timeDraw +

+ + +

ofloat timeFrame +

+ + +

oosg::Timer_t frameend +

+ + + +
obool _useDisplayLists +

+ + +

oosg::Timer _timer +

+ + +

oosg::Timer_t _tickRatePerSecond +

+ + +

oosg::Timer_t _initialTick +

+ + +

oosg::Timer_t _lastFrameTick +

+ + +

oosg::Timer_t _frameTick +

+ + +

oosg::Timer_t clockTick() +

+ + +

oosg::Timer_t frameTick() +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgGLUT/icon1.gif b/doc/doc++/osgGLUT/icon1.gif new file mode 100644 index 000000000..f78f30eb9 Binary files /dev/null and b/doc/doc++/osgGLUT/icon1.gif differ diff --git a/doc/doc++/osgGLUT/icon2.gif b/doc/doc++/osgGLUT/icon2.gif new file mode 100644 index 000000000..6cbe01a83 Binary files /dev/null and b/doc/doc++/osgGLUT/icon2.gif differ diff --git a/doc/doc++/osgGLUT/index.html b/doc/doc++/osgGLUT/index.html new file mode 100644 index 000000000..922b4a30c --- /dev/null +++ b/doc/doc++/osgGLUT/index.html @@ -0,0 +1,37 @@ + + + + + Table of Contents + + + + +

Table of Contents

+

Namespaces

+ +

Functions

+ +

Macros

+ +

Hierarchy of classes


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgGLUT/osgGLUT.html b/doc/doc++/osgGLUT/osgGLUT.html new file mode 100644 index 000000000..a5da4b900 --- /dev/null +++ b/doc/doc++/osgGLUT/osgGLUT.html @@ -0,0 +1,31 @@ + + + + + namespace osgGLUT + + + + +

namespace osgGLUT

+
+

+
+class OSGGLUT_EXPORT GLUTEventAdapter: public osgUtil::GUIEventAdapter +
Class for adapting GLUT events so that they can be used as input to osgUtil::CameraManipulators +
+class OSGGLUT_EXPORT Viewer: public osgUtil::GUIActionAdapter +
A basic viewer base class which provides a window, simple keyboard and mouse interaction. +

+ + + +
+

Documentation

+
+
+

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgGLUT/osgGLUTGetLibraryName.html b/doc/doc++/osgGLUT/osgGLUTGetLibraryName.html new file mode 100644 index 000000000..bfd789ceb --- /dev/null +++ b/doc/doc++/osgGLUT/osgGLUTGetLibraryName.html @@ -0,0 +1,21 @@ + + + + + extern OSGGLUT_EXPORT const char* osgGLUTGetLibraryName + + + + +

extern OSGGLUT_EXPORT const char* osgGLUTGetLibraryName

()

getLibraryName_osgGLUT() returns the library name in human friendly form
+ + +
+

Documentation

+
+getLibraryName_osgGLUT() returns the library name in human friendly form
+

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgGLUT/osgGLUTGetVersion.html b/doc/doc++/osgGLUT/osgGLUTGetVersion.html new file mode 100644 index 000000000..38e876bcd --- /dev/null +++ b/doc/doc++/osgGLUT/osgGLUTGetVersion.html @@ -0,0 +1,34 @@ + + + + + extern OSGGLUT_EXPORT const char* osgGLUTGetVersion + + + + +

extern OSGGLUT_EXPORT const char* osgGLUTGetVersion

()

osgGLUTGetVersion() returns the library version number.
+ + +
+

Documentation

+
+osgGLUTGetVersion() returns the library version number. +Numbering conventon : osg_src-0.8.31 will return 0.8.31. + +

This C function can be also used to check for the existance of the OpenSceneGraph +library using autoconf and its m4 macro AC_CHECK_LIB. + +

Here is the code to add to your configure.in: +\verbatim +# +# Check for the OpenSceneGraph (OSG) GLUT library +# +AC_CHECK_LIB(osg, osgGLUTGetVersion, , +[AC_MSG_ERROR(OpenSceneGraph GLUT library not found. See http://www.openscenegraph.org)],) +\endverbatim

+

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgUtil/BufferRequirementsVisitor.html b/doc/doc++/osgUtil/BufferRequirementsVisitor.html new file mode 100644 index 000000000..379651ece --- /dev/null +++ b/doc/doc++/osgUtil/BufferRequirementsVisitor.html @@ -0,0 +1,184 @@ + + + + + class OSGUTIL_EXPORT osgUtil::BufferRequirementsVisitor + + + + +

class OSGUTIL_EXPORT osgUtil::BufferRequirementsVisitor

A visitor for traversing a scene graph establishing the OpenGL buffers required to support rendering of that scene graph.
+
+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Methods

+[more] BufferRequirementsVisitor() +
Default to traversing all children, and reqiresDoubleBuffer, requiresRGB and requiresDepthBuffer to true and with alpha and stencil off +
+[more]void setRequiresDoubleBuffer(const bool flag) +
+[more]const bool requiresDoubleBuffer() const +
+[more]void setRequiresRGB(const bool flag) +
+[more]const bool requiresRGB() const +
+[more]void setRequiresDepthBuffer(const bool flag) +
+[more]const bool requiresDepthBuffer() const +
+[more]void setMinumumNumAlphaBits(const unsigned int bits) +
+[more]const unsigned int getMinumumNumAlphaBits() const +
+[more]const bool requiresAlphaBuffer() const +
+[more]void setMinumumNumStencilBits(const unsigned int bits) +
+[more]const unsigned int getMinumumNumStencilBits() const +
+[more]const bool requiresStencilBuffer() const +
+[more]virtual void apply(osg::StateSet& stateset) +
+[more]virtual void apply(osg::Node& node) +
+[more]virtual void apply(osg::Geode& geode) +
+[more]virtual void apply(osg::Impostor& impostor) +

+ +

+

Protected Fields

+[more]bool _requiresDoubleBuffer +
+[more]bool _requiresRBG +
+[more]bool _requiresDepthBuffer +
+[more]unsigned int _minimumNumberAlphaBits +
+[more]unsigned int _minimumNumberStencilBits +

+ +
+ + +
+

Documentation

+
A visitor for traversing a scene graph establishing the OpenGL buffers required to +support rendering of that scene graph. The results can then be used by +applications to set up there windows with the corret visuals. Have a look at +src/osgGLUT/Viewer.cpp's Viewer::open() method for an example how to use it.
+
+ + + +
o BufferRequirementsVisitor() +
Default to traversing all children, and reqiresDoubleBuffer, +requiresRGB and requiresDepthBuffer to true and with +alpha and stencil off +

+ + +

ovoid setRequiresDoubleBuffer(const bool flag) +

+ + +

oconst bool requiresDoubleBuffer() const +

+ + +

ovoid setRequiresRGB(const bool flag) +

+ + +

oconst bool requiresRGB() const +

+ + +

ovoid setRequiresDepthBuffer(const bool flag) +

+ + +

oconst bool requiresDepthBuffer() const +

+ + +

ovoid setMinumumNumAlphaBits(const unsigned int bits) +

+ + +

oconst unsigned int getMinumumNumAlphaBits() const +

+ + +

oconst bool requiresAlphaBuffer() const +

+ + +

ovoid setMinumumNumStencilBits(const unsigned int bits) +

+ + +

oconst unsigned int getMinumumNumStencilBits() const +

+ + +

oconst bool requiresStencilBuffer() const +

+ + +

ovirtual void apply(osg::StateSet& stateset) +

+ + +

ovirtual void apply(osg::Node& node) +

+ + +

ovirtual void apply(osg::Geode& geode) +

+ + +

ovirtual void apply(osg::Impostor& impostor) +

+ + +

obool _requiresDoubleBuffer +

+ + +

obool _requiresRBG +

+ + +

obool _requiresDepthBuffer +

+ + +

ounsigned int _minimumNumberAlphaBits +

+ + +

ounsigned int _minimumNumberStencilBits +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgUtil/CameraManipulator.html b/doc/doc++/osgUtil/CameraManipulator.html new file mode 100644 index 000000000..7406e23ee --- /dev/null +++ b/doc/doc++/osgUtil/CameraManipulator.html @@ -0,0 +1,128 @@ + + + + + class OSGUTIL_EXPORT osgUtil::CameraManipulator + + + + +

class OSGUTIL_EXPORT osgUtil::CameraManipulator


+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Methods

+[more] CameraManipulator() +
+[more]virtual ~CameraManipulator() +
+[more]virtual void setCamera(osg::Camera*) +
attach a camera to the manipulator to be used for specifying view +
+[more]virtual const osg::Camera* getCamera() const +
get the attached a camera +
+[more]virtual void setNode(osg::Node*) +
Attach a node to the manipulator. +
+[more]virtual const osg::Node* getNode() const +
Return node if attached +
+[more]virtual void home(const GUIEventAdapter&, GUIActionAdapter&) +
Move the camera to the default position. +
+[more]virtual void init(const GUIEventAdapter&, GUIActionAdapter&) +
Start/restart the manipulator +
+[more]virtual bool handle(const GUIEventAdapter& ea, GUIActionAdapter& us) +
Handle events, return true if handled, false otherwise +

+ +

+

Protected Fields

+[more]osg::ref_ptr<osg::Camera> _camera +

+ +
+

Inherited from GUIEventHandler:

+
+
+ + +
+

Documentation

+
+ + + +
o CameraManipulator() +

+ + +

ovirtual ~CameraManipulator() +

+ + +

ovirtual void setCamera(osg::Camera*) +
attach a camera to the manipulator to be used for specifying view +

+ + +

ovirtual const osg::Camera* getCamera() const +
get the attached a camera +

+ + +

ovirtual void setNode(osg::Node*) +
Attach a node to the manipulator. +Automatically detaches previously attached node. +setNode(NULL) detaches previously nodes. +Is ignored by manipulators which do not require a reference model. +

+ + +

ovirtual const osg::Node* getNode() const +
Return node if attached +

+ + +

ovirtual void home(const GUIEventAdapter&, GUIActionAdapter&) +
Move the camera to the default position. +May be ignored by manipulators if home functionality is not appropriate. +

+ + +

ovirtual void init(const GUIEventAdapter&, GUIActionAdapter&) +
Start/restart the manipulator +

+ + +

ovirtual bool handle(const GUIEventAdapter& ea, GUIActionAdapter& us) +
Handle events, return true if handled, false otherwise +

+ + +

oosg::ref_ptr<osg::Camera> _camera +

+
+
Direct child classes: +
TrackballManipulator
+FlightManipulator
+DriveManipulator
+
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgUtil/ClassGraph.class b/doc/doc++/osgUtil/ClassGraph.class new file mode 100644 index 000000000..c6a7b6c79 Binary files /dev/null and b/doc/doc++/osgUtil/ClassGraph.class differ diff --git a/doc/doc++/osgUtil/ClassGraphPanel.class b/doc/doc++/osgUtil/ClassGraphPanel.class new file mode 100644 index 000000000..94b21b47a Binary files /dev/null and b/doc/doc++/osgUtil/ClassGraphPanel.class differ diff --git a/doc/doc++/osgUtil/ClassLayout.class b/doc/doc++/osgUtil/ClassLayout.class new file mode 100644 index 000000000..77fb9fa28 Binary files /dev/null and b/doc/doc++/osgUtil/ClassLayout.class differ diff --git a/doc/doc++/osgUtil/CullViewState.html b/doc/doc++/osgUtil/CullViewState.html new file mode 100644 index 000000000..b103b9ad8 --- /dev/null +++ b/doc/doc++/osgUtil/CullViewState.html @@ -0,0 +1,184 @@ + + + + + class OSGUTIL_EXPORT osgUtil::CullViewState + + + + +

class OSGUTIL_EXPORT osgUtil::CullViewState

Container class for encapsulating the viewing state in local coordinates, during the cull traversal
+
+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Fields

+[more]osg::ref_ptr<osg::Matrix> _matrix +
+[more]osg::ref_ptr<osg::Matrix> _inverse +
+[more]osg::Vec3 _eyePoint +
+[more]osg::Vec3 _centerPoint +
+[more]osg::Vec3 _lookVector +
+[more]osg::Vec3 _upVector +
+[more]unsigned int _bbCornerFar +
+[more]unsigned int _bbCornerNear +
+[more]float _ratio2 +
+[more]osg::ClippingVolume _clippingVolume +

+ +

+

Public Methods

+[more] CullViewState() +
+[more]typedef unsigned intinline CullingMode bool isCulled(const osg::BoundingSphere& sp, CullingMode& mode) const +
+[more]inline bool isCulled(const osg::BoundingBox& bb, CullingMode mode) const +

+ +

+

Public Members

+[more]enum +

+ +

+

Protected Methods

+[more] ~CullViewState() +

+ +
+ + +
+

Documentation

+
Container class for encapsulating the viewing state in local +coordinates, during the cull traversal
+
+ + + +
o CullViewState() +

+ + +

oosg::ref_ptr<osg::Matrix> _matrix +

+ + +

oosg::ref_ptr<osg::Matrix> _inverse +

+ + +

oosg::Vec3 _eyePoint +

+ + +

oosg::Vec3 _centerPoint +

+ + +

oosg::Vec3 _lookVector +

+ + +

oosg::Vec3 _upVector +

+ + +

ounsigned int _bbCornerFar +

+ + +

ounsigned int _bbCornerNear +

+ + +

ofloat _ratio2 +

+ + +

oosg::ClippingVolume _clippingVolume +

+ + +

oenum +

+ + + +
o NO_CULLING +

+ + +

o FRUSTUM_LEFT_CULLING +

+ + +

o FRUSTUM_RIGHT_CULLING +

+ + +

o FRUSTUM_BOTTOM_CULLING +

+ + +

o FRUSTUM_TOP_CULLING +

+ + +

o FRUSTUM_NEAR_CULLING +

+ + +

o FRUSTUM_FAR_CULLING +

+ + +

o VIEW_FRUSTUM_CULLING +

+ + +

o SMALL_FEATURE_CULLING +

+ + +

o ENALBE_ALL_CULLING +

+ + + +
otypedef unsigned intinline CullingMode bool isCulled(const osg::BoundingSphere& sp, CullingMode& mode) const +

+ + +

oinline bool isCulled(const osg::BoundingBox& bb, CullingMode mode) const +

+ + +

o ~CullViewState() +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgUtil/CullVisitor.html b/doc/doc++/osgUtil/CullVisitor.html new file mode 100644 index 000000000..afe367824 --- /dev/null +++ b/doc/doc++/osgUtil/CullVisitor.html @@ -0,0 +1,629 @@ + + + + + class OSGUTIL_EXPORT osgUtil::CullVisitor + + + + +

class OSGUTIL_EXPORT osgUtil::CullVisitor

Basic NodeVisitor implementation for rendering a scene.
+
+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Methods

+[more] CullVisitor() +
+[more]virtual ~CullVisitor() +
+[more]void reset() +
+[more]virtual void apply(osg::Node&) +
+[more]virtual void apply(osg::Geode& node) +
+[more]virtual void apply(osg::Billboard& node) +
+[more]virtual void apply(osg::LightSource& node) +
+[more]virtual void apply(osg::Group& node) +
+[more]virtual void apply(osg::Transform& node) +
+[more]virtual void apply(osg::Switch& node) +
+[more]virtual void apply(osg::LOD& node) +
+[more]virtual void apply(osg::Impostor& node) +
+[more]void setCamera(const osg::Camera& camera) +
+[more]const osg::Camera* getCamera() const +
+[more]void setLODBias(const float bias) +
+[more]const float getLODBias() const +
+[more]void setImpostorsActive(const bool active) +
Switch the creation of Impostors on or off. +
+[more]const bool getImpostorsActive() const +
Get whether impostors are active or not. +
+[more]void setImpostorPixelErrorThreshold(const float numPixels) +
Set the impostor error threshold. +
+[more]const float getImpostorPixelErrorThreshold() const +
Get the impostor error threshold +
+[more]void setDepthSortImpostorSprites(const bool doDepthSort) +
Set whether ImpsotorSprite's should be placed in a depth sorted bin for rendering +
+[more]const bool setDepthSortImpostorSprites() const +
Get whether ImpsotorSprite's are depth sorted bin for rendering +
+[more]void setNumberOfFrameToKeepImpostorSprites(const int numFrames) +
Set the number of frames that an ImpsotorSprite's is kept whilst not being beyond, before being recycled +
+[more]const int getNumberOfFrameToKeepImpostorSprites() const +
Get the number of frames that an ImpsotorSprite's is kept whilst not being beyond, before being recycled +
+[more]void setTransparencySortMode(TransparencySortMode tsm) +
+[more]void setCullingMode(CullViewState::CullingMode mode) +
Sets the current CullingMode +
+[more]CullViewState::CullingMode getCullingMode() const +
Returns the current CullingMode +
+[more]void setViewport(int x, int y, int width, int height) +
Set the viewport. +
+[more]void getViewport(int& x, int& y, int& width, int& height) +
Get the viewport. +
+[more]inline void setFrameNumber(const int fn) +
Set the frame number +
+[more]inline const int getFrameNumber() const +
Get the frame number +
+[more]void pushCullViewState(const osg::Matrix* matrix=NULL) +
+[more]void popCullViewState() +
+[more]inline void pushStateSet(const osg::StateSet* ss) +
Push state set on the current state group. +
+[more]inline void popStateSet() +
Pop the top state set and hence associated state group. +
+[more]void setRenderGraph(RenderGraph* rg) +
+[more]RenderGraph* getRenderGraph() +
+[more]void setRenderStage(RenderStage* rg) +
+[more]RenderStage* getRenderStage() +
+[more]const float getCalculatedNearPlane() const +
+[more]const float getCalculatedFarPlane() const +

+ +

+

Public Members

+[more]enum TransparencySortMode +

+ +

+

Protected Fields

+[more]int _frameNumber +
+[more]osg::ref_ptr<CullViewState> _tvs +
+[more]osg::ref_ptr<CullViewState> _cvs +
+[more]osg::ref_ptr<RenderGraph> _rootRenderGraph +
+[more]RenderGraph* _currentRenderGraph +
+[more]osg::ref_ptr<RenderStage> _rootRenderStage +
+[more]RenderBin* _currentRenderBin +
+[more]std::vector<CullViewState::CullingMode> _cullingModeStack +
+[more]float _LODBias +
+[more]float _calculated_znear +
+[more]float _calculated_zfar +
+[more]osg::ref_ptr<const osg::Camera> _camera +
+[more]TransparencySortMode _tsm +
+[more]int _view[4] +
+[more]bool _impostorActive +
+[more]bool _depthSortImpostorSprites +
+[more]float _impostorPixelErrorThreshold +
+[more]int _numFramesToKeepImpostorSprites +
+[more]unsigned int _currentReuseMatrixIndex +
+[more]unsigned int _currentReuseRenderLeafIndex +
+[more]osg::ref_ptr<osg::ImpostorSpriteManager> _impostorSpriteManager +

+ +

+

Protected Methods

+[more] CullVisitor(const CullVisitor&) +
prevent unwanted copy construction +
+[more]CullVisitor& operator = (const CullVisitor&) +
prevent unwanted copy operator +
+[more]inline osg::Matrix* getCurrentMatrix() +
+[more]inline osg::Matrix* getInverseCurrentMatrix() +
+[more]inline const osg::Vec3& getEyeLocal() const +
+[more]inline const osg::Vec3& getCenterLocal() const +
+[more]inline const osg::Vec3& getLookVectorLocal() const +
+[more]inline bool isCulled(const osg::BoundingSphere& sp, CullViewState::CullingMode& mode) const +
+[more]inline const bool isCulled(const osg::BoundingBox& bb, const CullViewState::CullingMode mode) const +
+[more]void updateCalculatedNearFar(const osg::BoundingBox& bb) +
+[more]void updateCalculatedNearFar(const osg::Vec3& pos) +
+[more]inline void addDrawable(osg::Drawable* drawable, osg::Matrix* matrix) +
Add a drawable to current render graph +
+[more]inline void addDrawableAndDepth(osg::Drawable* drawable, osg::Matrix* matrix, const float depth) +
Add a drawable and depth to current render graph +
+[more]inline void addLight(osg::Light* light, osg::Matrix* matrix) +
Add a light to current render graph +
+[more]osg::ImpostorSprite* createImpostorSprite(osg::Impostor& node) +
create an impostor sprite by setting up a pre-rendering stage to generate the impostor texture. +
+[more]inline osg::Matrix* createOrReuseMatrix() +
+[more]inline RenderLeaf* createOrReuseRenderLeaf(osg::Drawable* drawable, osg::Matrix* matrix, float depth=0.0f) +

+ +

+

Protected Members

+[more]typedef std::vector< osg::ref_ptr<CullViewState> > CullViewStateStack CullViewStateStack _viewStateStack +
+[more]typedef std::vector< osg::ref_ptr<osg::Matrix> > MatrixList MatrixList _reuseMatrixList +
+[more]typedef std::vector< osg::ref_ptr<RenderLeaf> > RenderLeafList RenderLeafList _reuseRenderLeafList +

+ +
+ + +
+

Documentation

+
+Basic NodeVisitor implementation for rendering a scene. +This visitor traverses the scene graph, collecting transparent and +opaque osg::Drawables into a depth sorted transparent bin and a state +sorted opaque bin. The opaque bin is rendered first, and then the +transparent bin in rendered in order from the furthest osg::Drawable +from the eye to the one nearest the eye.
+
+ + + +
o CullVisitor() +

+ + +

ovirtual ~CullVisitor() +

+ + +

ovoid reset() +

+ + +

ovirtual void apply(osg::Node&) +

+ + +

ovirtual void apply(osg::Geode& node) +

+ + +

ovirtual void apply(osg::Billboard& node) +

+ + +

ovirtual void apply(osg::LightSource& node) +

+ + +

ovirtual void apply(osg::Group& node) +

+ + +

ovirtual void apply(osg::Transform& node) +

+ + +

ovirtual void apply(osg::Switch& node) +

+ + +

ovirtual void apply(osg::LOD& node) +

+ + +

ovirtual void apply(osg::Impostor& node) +

+ + +

ovoid setCamera(const osg::Camera& camera) +

+ + +

oconst osg::Camera* getCamera() const +

+ + +

ovoid setLODBias(const float bias) +

+ + +

oconst float getLODBias() const +

+ + +

ovoid setImpostorsActive(const bool active) +
Switch the creation of Impostors on or off. +Setting active to false forces the CullVisitor to use the Impostor +LOD children for rendering. Setting active to true forces the +CullVisitor to create the appropriate pre-rendering stages which +render to the ImpostorSprite's texture. +

+ + +

oconst bool getImpostorsActive() const +
Get whether impostors are active or not. +

+ + +

ovoid setImpostorPixelErrorThreshold(const float numPixels) +
Set the impostor error threshold. +Used in calculation of whether impostors remain valid. +

+ + +

oconst float getImpostorPixelErrorThreshold() const +
Get the impostor error threshold +

+ + +

ovoid setDepthSortImpostorSprites(const bool doDepthSort) +
Set whether ImpsotorSprite's should be placed in a depth sorted bin for rendering +

+ + +

oconst bool setDepthSortImpostorSprites() const +
Get whether ImpsotorSprite's are depth sorted bin for rendering +

+ + +

ovoid setNumberOfFrameToKeepImpostorSprites(const int numFrames) +
Set the number of frames that an ImpsotorSprite's is kept whilst not being beyond, +before being recycled +

+ + +

oconst int getNumberOfFrameToKeepImpostorSprites() const +
Get the number of frames that an ImpsotorSprite's is kept whilst not being beyond, +before being recycled +

+ + +

oenum TransparencySortMode +

+ + + +
o LOOK_VECTOR_DISTANCE +

+ + +

o OBJECT_EYE_POINT_DISTANCE +

+ + + +
ovoid setTransparencySortMode(TransparencySortMode tsm) +

+ + +

ovoid setCullingMode(CullViewState::CullingMode mode) +
Sets the current CullingMode +

+ + +

oCullViewState::CullingMode getCullingMode() const +
Returns the current CullingMode +

+ + +

ovoid setViewport(int x, int y, int width, int height) +
Set the viewport. +Used to enable the CullVisitor can make decision +such as based on viewport dimensions,. +

+ + +

ovoid getViewport(int& x, int& y, int& width, int& height) +
Get the viewport. +

+ + +

oinline void setFrameNumber(const int fn) +
Set the frame number +

+ + +

oinline const int getFrameNumber() const +
Get the frame number +

+ + +

ovoid pushCullViewState(const osg::Matrix* matrix=NULL) +

+ + +

ovoid popCullViewState() +

+ + +

oinline void pushStateSet(const osg::StateSet* ss) +
Push state set on the current state group. +If the state exists in a child state group of the current +state group then move the current state group to that child. +Otherwise, create a new state group for the state set, add +it to the current state group then move the current state +group pointer to the new state group. +

+ + +

oinline void popStateSet() +
Pop the top state set and hence associated state group. +Move the current state group to the parent of the popped +state group. +

+ + +

ovoid setRenderGraph(RenderGraph* rg) +

+ + +

oRenderGraph* getRenderGraph() +

+ + +

ovoid setRenderStage(RenderStage* rg) +

+ + +

oRenderStage* getRenderStage() +

+ + +

oconst float getCalculatedNearPlane() const +

+ + +

oconst float getCalculatedFarPlane() const +

+ + +

o CullVisitor(const CullVisitor&) +
prevent unwanted copy construction +

+ + +

oCullVisitor& operator = (const CullVisitor&) +
prevent unwanted copy operator +

+ + +

oinline osg::Matrix* getCurrentMatrix() +

+ + +

oinline osg::Matrix* getInverseCurrentMatrix() +

+ + +

oinline const osg::Vec3& getEyeLocal() const +

+ + +

oinline const osg::Vec3& getCenterLocal() const +

+ + +

oinline const osg::Vec3& getLookVectorLocal() const +

+ + +

oinline bool isCulled(const osg::BoundingSphere& sp, CullViewState::CullingMode& mode) const +

+ + +

oinline const bool isCulled(const osg::BoundingBox& bb, const CullViewState::CullingMode mode) const +

+ + +

ovoid updateCalculatedNearFar(const osg::BoundingBox& bb) +

+ + +

ovoid updateCalculatedNearFar(const osg::Vec3& pos) +

+ + +

oinline void addDrawable(osg::Drawable* drawable, osg::Matrix* matrix) +
Add a drawable to current render graph +

+ + +

oinline void addDrawableAndDepth(osg::Drawable* drawable, osg::Matrix* matrix, const float depth) +
Add a drawable and depth to current render graph +

+ + +

oinline void addLight(osg::Light* light, osg::Matrix* matrix) +
Add a light to current render graph +

+ + +

oosg::ImpostorSprite* createImpostorSprite(osg::Impostor& node) +
create an impostor sprite by setting up a pre-rendering stage +to generate the impostor texture. +

+ + +

oint _frameNumber +

+ + +

otypedef std::vector< osg::ref_ptr<CullViewState> > CullViewStateStack CullViewStateStack _viewStateStack +

+ + +

oosg::ref_ptr<CullViewState> _tvs +

+ + +

oosg::ref_ptr<CullViewState> _cvs +

+ + +

oosg::ref_ptr<RenderGraph> _rootRenderGraph +

+ + +

oRenderGraph* _currentRenderGraph +

+ + +

oosg::ref_ptr<RenderStage> _rootRenderStage +

+ + +

oRenderBin* _currentRenderBin +

+ + +

ostd::vector<CullViewState::CullingMode> _cullingModeStack +

+ + +

ofloat _LODBias +

+ + +

ofloat _calculated_znear +

+ + +

ofloat _calculated_zfar +

+ + +

oosg::ref_ptr<const osg::Camera> _camera +

+ + +

oTransparencySortMode _tsm +

+ + +

oint _view[4] +

+ + +

obool _impostorActive +

+ + +

obool _depthSortImpostorSprites +

+ + +

ofloat _impostorPixelErrorThreshold +

+ + +

oint _numFramesToKeepImpostorSprites +

+ + +

otypedef std::vector< osg::ref_ptr<osg::Matrix> > MatrixList MatrixList _reuseMatrixList +

+ + +

ounsigned int _currentReuseMatrixIndex +

+ + +

oinline osg::Matrix* createOrReuseMatrix() +

+ + +

otypedef std::vector< osg::ref_ptr<RenderLeaf> > RenderLeafList RenderLeafList _reuseRenderLeafList +

+ + +

ounsigned int _currentReuseRenderLeafIndex +

+ + +

oinline RenderLeaf* createOrReuseRenderLeaf(osg::Drawable* drawable, osg::Matrix* matrix, float depth=0.0f) +

+ + +

oosg::ref_ptr<osg::ImpostorSpriteManager> _impostorSpriteManager +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgUtil/DepthSortedBin.html b/doc/doc++/osgUtil/DepthSortedBin.html new file mode 100644 index 000000000..c2ed5a0d7 --- /dev/null +++ b/doc/doc++/osgUtil/DepthSortedBin.html @@ -0,0 +1,177 @@ + + + + + class OSGUTIL_EXPORT osgUtil::DepthSortedBin + + + + +

class OSGUTIL_EXPORT osgUtil::DepthSortedBin


+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Methods

+[more] DepthSortedBin() +
+[more]virtual osg::Object* clone() const +
+[more]virtual bool isSameKindAs(const osg::Object* obj) const +
+[more]virtual const char* className() const +
+[more]virtual void reset() +
+[more]virtual void sort_local() +
+[more]virtual void draw_local(osg::State& state, RenderLeaf*& previous) +
+[more]void setDrawOrder(const DrawOrder drawOrder) +
+[more]const DrawOrder getDrawOrder() const +

+ +

+

Public Members

+[more]enum DrawOrder +

+ +

+

Protected Fields

+[more]DrawOrder _drawOrder +
+[more]RenderLeafList _renderLeafList +

+ +

+

Protected Methods

+[more]virtual ~DepthSortedBin() +

+ +
+

Inherited from RenderBin:

+
+

+

Public Fields

+oint _binNum +
+oRenderBin* _parent +
+oRenderStage* _stage +
+oRenderBinList _bins +
+oRenderGraphList _renderGraphList +

+ +

+

Public Methods

+otypedef std::map< int, osg::ref_ptr<RenderBin> >static RenderBinList RenderBin* createRenderBin(const std::string& binName) +
+ostatic void addRenderBinPrototype(RenderBin* proto) +
+ostatic void removeRenderBinPrototype(RenderBin* proto) +
+oRenderBin* find_or_insert(int binNum, const std::string& binName) +
+ovoid addRenderGraph(RenderGraph* rg) +
+ovoid sort() +
+ovirtual void draw(osg::State& state, RenderLeaf*& previous) +
+ovoid getPrims(Statistics* primStats) +

+ +

+

Public Members

+otypedef std::map< std::string, osg::ref_ptr<RenderBin> >static RenderBinPrototypeList RenderBinPrototypeList s_renderBinPrototypeList +

+ +
+ + +
+

Documentation

+
+ + + +
o DepthSortedBin() +

+ + +

ovirtual osg::Object* clone() const +

+ + +

ovirtual bool isSameKindAs(const osg::Object* obj) const +

+ + +

ovirtual const char* className() const +

+ + +

ovirtual void reset() +

+ + +

ovirtual void sort_local() +

+ + +

ovirtual void draw_local(osg::State& state, RenderLeaf*& previous) +

+ + +

oenum DrawOrder +

+ + + +
o FRONT_TO_BACK +

+ + +

o BACK_TO_FRONT +

+ + + +
ovoid setDrawOrder(const DrawOrder drawOrder) +

+ + +

oconst DrawOrder getDrawOrder() const +

+ + +

ovirtual ~DepthSortedBin() +

+ + +

oDrawOrder _drawOrder +

+ + +

oRenderLeafList _renderLeafList +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgUtil/DisplayListVisitor.html b/doc/doc++/osgUtil/DisplayListVisitor.html new file mode 100644 index 000000000..079093797 --- /dev/null +++ b/doc/doc++/osgUtil/DisplayListVisitor.html @@ -0,0 +1,177 @@ + + + + + class OSGUTIL_EXPORT osgUtil::DisplayListVisitor + + + + +

class OSGUTIL_EXPORT osgUtil::DisplayListVisitor

Visitor for traversing scene graph and setting each osg::GeoSet's _useDisplayList flag, with option to immediately compile osg::GeoSet's OpenGL Display lists.
+
+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Methods

+[more] DisplayListVisitor(DisplayListMode mode=SWITCH_ON_DISPLAY_LISTS) +
Construct a CompileGeoSetsVisior to traverse all child, with set specfied display list mode. +
+[more]void setDisplayListMode(DisplayListMode mode) +
Set the operational mode of how the visitor should set up osg::GeoSet's +
+[more]DisplayListMode getDisplayListMode() const +
Get the operational mode +
+[more]void setState(osg::State* state) +
Set the State to use during traversal. +
+[more]osg::State* getState() +
+[more]virtual void apply(osg::Node& node) +
Simply traverse using standard NodeVisitor traverse method +
+[more]virtual void apply(osg::Geode& node) +
For each Geode visited set the display list usage according to the _displayListMode +

+ +

+

Public Members

+[more]enum DisplayListMode +
Operation modes of the DisplayListVisitor +

+ +

+

Protected Fields

+[more]DisplayListMode _displayListMode +
+[more]osg::ref_ptr<osg::State> _localState +
local state is created in constructor and used as the default state during traversal +
+[more]osg::ref_ptr<osg::State> _externalState +
external state is used to override the default state +
+[more]osg::ref_ptr<osg::State> _activeState +
active state is equal to _externalState when it is valid, otherwise defaults to _localState +

+ +
+ + +
+

Documentation

+
Visitor for traversing scene graph and setting each osg::GeoSet's _useDisplayList flag, +with option to immediately compile osg::GeoSet's OpenGL Display lists. +The mode of operation +of the vistor is controlled by setting the DisplayListMode either on visitor +constructor or via the setDisplayListMode() method. DisplayListMode options are: +_displayListMode == SWITCH_ON_AND_COMPILE_DISPLAY_LISTS cals gset->compile() on +all Geode childern. Note, the visitor must only be used within a valid +OpenGL context as compile uses OpenGL calls. +_displayListMode == SWITCH_ON_DISPLAY_LISTS sets the Geode's children with +gset->setUseDisplayList(true), this method does not directly create display list, +or uses OpenGL calls so if safe to use before a valid OpenGL context has been set up. +On the next redraw of the scene, the gset's draw methods will be called +which then will respond to their _useDisplayList being set by creating display lists +automatically. +_displayListMode == SWITCH_OFF_DISPLAY_LISTS sets the Geode's children with +gset->setUseDisplayList(false), this method does not directly create display list, +or uses OpenGL calls so if safe to use before a valid OpenGL context has been set up.
+
+ + + +
oenum DisplayListMode +
Operation modes of the DisplayListVisitor +

+ + + +
o SWITCH_ON_AND_COMPILE_DISPLAY_LISTS +

+ + +

o COMPILE_ON_DISPLAY_LISTS +

+ + +

o SWITCH_ON_DISPLAY_LISTS +

+ + +

o SWITCH_OFF_DISPLAY_LISTS +

+ + + +
o DisplayListVisitor(DisplayListMode mode=SWITCH_ON_DISPLAY_LISTS) +
Construct a CompileGeoSetsVisior to traverse all child, +with set specfied display list mode. Default mode is to +gset->setUseDisplayList(true). +

+ + +

ovoid setDisplayListMode(DisplayListMode mode) +
Set the operational mode of how the visitor should set up osg::GeoSet's +

+ + +

oDisplayListMode getDisplayListMode() const +
Get the operational mode +

+ + +

ovoid setState(osg::State* state) +
Set the State to use during traversal. +

+ + +

oosg::State* getState() +

+ + +

ovirtual void apply(osg::Node& node) +
Simply traverse using standard NodeVisitor traverse method +

+ + +

ovirtual void apply(osg::Geode& node) +
For each Geode visited set the display list usage according to the +_displayListMode +

+ + +

oDisplayListMode _displayListMode +

+ + +

oosg::ref_ptr<osg::State> _localState +
local state is created in constructor and used as the default state during traversal +

+ + +

oosg::ref_ptr<osg::State> _externalState +
external state is used to override the default state +

+ + +

oosg::ref_ptr<osg::State> _activeState +
active state is equal to _externalState when it is valid, otherwise defaults to _localState +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgUtil/DriveManipulator.html b/doc/doc++/osgUtil/DriveManipulator.html new file mode 100644 index 000000000..c2a982072 --- /dev/null +++ b/doc/doc++/osgUtil/DriveManipulator.html @@ -0,0 +1,124 @@ + + + + + class OSGUTIL_EXPORT osgUtil::DriveManipulator + + + + +

class OSGUTIL_EXPORT osgUtil::DriveManipulator


+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Methods

+[more] DriveManipulator() +
+[more]virtual ~DriveManipulator() +
+[more]virtual void setNode(osg::Node*) +
Attach a node to the manipulator. +
+[more]virtual const osg::Node* getNode() const +
Return node if attached +
+[more]virtual void home(const GUIEventAdapter& ea, GUIActionAdapter& us) +
Move the camera to the default position. +
+[more]virtual void init(const GUIEventAdapter& ea, GUIActionAdapter& us) +
Start/restart the manipulator +
+[more]virtual bool handle(const GUIEventAdapter& ea, GUIActionAdapter& us) +
handle events, return true if handled, false otherwise +

+ +
+

Inherited from CameraManipulator:

+
+

+

Public Methods

+ovirtual void setCamera(osg::Camera*) +
+ovirtual const osg::Camera* getCamera() const +

+ +

+

Protected Fields

+oosg::ref_ptr<osg::Camera> _camera +

+ +
+

Inherited from GUIEventHandler:

+
+
+ + +
+

Documentation

+
+ + + +
o DriveManipulator() +

+ + +

ovirtual ~DriveManipulator() +

+ + +

ovirtual void setNode(osg::Node*) +
Attach a node to the manipulator. +Automatically detaches previously attached node. +setNode(NULL) detaches previously nodes. +Is ignored by manipulators which do not require a reference model. +

+ + +

ovirtual const osg::Node* getNode() const +
Return node if attached +

+ + +

ovirtual void home(const GUIEventAdapter& ea, GUIActionAdapter& us) +
Move the camera to the default position. +May be ignored by manipulators if home functionality is not appropriate. +

+ + +

ovirtual void init(const GUIEventAdapter& ea, GUIActionAdapter& us) +
Start/restart the manipulator +

+ + +

ovirtual bool handle(const GUIEventAdapter& ea, GUIActionAdapter& us) +
handle events, return true if handled, false otherwise +

+ + + +
o USE_MOUSE_Y_FOR_SPEED +

+ + +

o USE_MOUSE_BUTTONS_FOR_SPEED +

+
+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgUtil/FlightManipulator.html b/doc/doc++/osgUtil/FlightManipulator.html new file mode 100644 index 000000000..92d15465e --- /dev/null +++ b/doc/doc++/osgUtil/FlightManipulator.html @@ -0,0 +1,141 @@ + + + + + class OSGUTIL_EXPORT osgUtil::FlightManipulator + + + + +

class OSGUTIL_EXPORT osgUtil::FlightManipulator


+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Methods

+[more] FlightManipulator() +
+[more]virtual ~FlightManipulator() +
+[more]virtual void setNode(osg::Node*) +
Attach a node to the manipulator. +
+[more]virtual const osg::Node* getNode() const +
Return node if attached +
+[more]virtual void home(const GUIEventAdapter& ea, GUIActionAdapter& us) +
Move the camera to the default position. +
+[more]virtual void init(const GUIEventAdapter& ea, GUIActionAdapter& us) +
Start/restart the manipulator +
+[more]virtual bool handle(const GUIEventAdapter& ea, GUIActionAdapter& us) +
handle events, return true if handled, false otherwise +
+[more]void setYawControlMode(YawControlMode ycm) +
Set the yaw control between no yaw and yawing when banked +

+ +

+

Public Members

+[more]enum YawControlMode +

+ +
+

Inherited from CameraManipulator:

+
+

+

Public Methods

+ovirtual void setCamera(osg::Camera*) +
+ovirtual const osg::Camera* getCamera() const +

+ +

+

Protected Fields

+oosg::ref_ptr<osg::Camera> _camera +

+ +
+

Inherited from GUIEventHandler:

+
+
+ + +
+

Documentation

+
+ + + +
o FlightManipulator() +

+ + +

ovirtual ~FlightManipulator() +

+ + +

ovirtual void setNode(osg::Node*) +
Attach a node to the manipulator. +Automatically detaches previously attached node. +setNode(NULL) detaches previously nodes. +Is ignored by manipulators which do not require a reference model. +

+ + +

ovirtual const osg::Node* getNode() const +
Return node if attached +

+ + +

ovirtual void home(const GUIEventAdapter& ea, GUIActionAdapter& us) +
Move the camera to the default position. +May be ignored by manipulators if home functionality is not appropriate. +

+ + +

ovirtual void init(const GUIEventAdapter& ea, GUIActionAdapter& us) +
Start/restart the manipulator +

+ + +

ovirtual bool handle(const GUIEventAdapter& ea, GUIActionAdapter& us) +
handle events, return true if handled, false otherwise +

+ + +

oenum YawControlMode +

+ + + +
o YAW_AUTOMATICALLY_WHEN_BANKED +

+ + +

o NO_AUTOMATIC_YAW +

+ + + +
ovoid setYawControlMode(YawControlMode ycm) +
Set the yaw control between no yaw and yawing when banked +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgUtil/GUIActionAdapter.html b/doc/doc++/osgUtil/GUIActionAdapter.html new file mode 100644 index 000000000..dfcd61ca1 --- /dev/null +++ b/doc/doc++/osgUtil/GUIActionAdapter.html @@ -0,0 +1,77 @@ + + + + + class osgUtil::GUIActionAdapter + + + + +

class osgUtil::GUIActionAdapter

Pure virtual base class for adapting the GUI actions requested by CameraManipulators into actions which are handled by the GUI toolkit of the users application.
+
+ +
+

+

Public Methods

+[more]virtual void requestRedraw() = 0 +
+[more]virtual void requestContinuousUpdate(bool needed=true) = 0 +
+[more]virtual void requestWarpPointer(int x, int y) = 0 +

+ +
+ + +
+

Documentation

+
Pure virtual base class for adapting the GUI actions requested by CameraManipulators +into actions which are handled by the GUI toolkit of the users application. + +

There are several was of using the ActionAdapter either inheriting it as +done with osgGLUT::Viewer class or passing a simple struct to the camera +manipulator then unpacking the results and working out what to do to respond +to the requests. + +

Also there are several ways to run your app and handle the updating of +the window. osgGLUT::Viewer always has a idle callback registered which does a +redraw all the time. osgGLUT::Viewer can safely ignore both requestRedraw() and +requestContinousUpdate() as these are happening all the time anyway. + +

Other apps will probably want to respond to the requestRedraw() and +requestContinousUpdate(bool) and again there is more than one way to handle it. +You can override requestRedraw() and implement to call your own window +redraw straight away. Or you can implement so that a flag is set and +then you then respond the flag being set in your own leisure. + +

requestContinousUpdate(bool) is for enabling a throw or idle +callback to be requested by the camera manipulator. Again you can respond +to this immediately by registering a idle callback or a timed callback, or +you can delay setting the callback and do at you own leisure. + +

requestWarpPointer(int,int) is requesting a respositioning of a mouse pointer +to a specified x,y location on the window. Used by some camera manipulators +to initialize the mouse pointer when mouse position relative to a controls +neutral mouse position is required, i.e when mimicking a aircrafts joystick.

+
+ + + +
ovirtual void requestRedraw() = 0 +

+ + +

ovirtual void requestContinuousUpdate(bool needed=true) = 0 +

+ + +

ovirtual void requestWarpPointer(int x, int y) = 0 +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgUtil/GUIEventAdapter.html b/doc/doc++/osgUtil/GUIEventAdapter.html new file mode 100644 index 000000000..71ce35d49 --- /dev/null +++ b/doc/doc++/osgUtil/GUIEventAdapter.html @@ -0,0 +1,215 @@ + + + + + class osgUtil::GUIEventAdapter + + + + +

class osgUtil::GUIEventAdapter

Pure virtual base class for adapting platform specific events into generic keyboard and mouse events.
+
+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Methods

+[more] GUIEventAdapter() +
+[more]virtual EventType getEventType() const = 0 +
Get the EventType of the GUI event +
+[more]virtual int getKey() const = 0 +
key pressed, return -1 if inappropriate for this event. +
+[more]virtual int getButton() const = 0 +
button pressed/released, return -1 if inappropriate for this event +
+[more]virtual int getXmin() const = 0 +
window minimum x. +
+[more]virtual int getXmax() const = 0 +
window maximum x. +
+[more]virtual int getYmin() const = 0 +
window minimum y. +
+[more]virtual int getYmax() const = 0 +
window maximum y. +
+[more]virtual int getX() const = 0 +
current mouse x position +
+[more]virtual int getY() const = 0 +
current mouse y position +
+[more]virtual unsigned int getButtonMask() const = 0 +
current mouse button state +
+[more]virtual float time() const = 0 +
time in seconds of event. +

+ +

+

Public Members

+[more]enum MouseButtonMask +
+[more]enum EventType +

+ +

+

Protected Methods

+[more]virtual ~GUIEventAdapter() +
Force users to create on heap, so that multiple referencing is safe +

+ +
+ + +
+

Documentation

+
Pure virtual base class for adapting platform specific events into +generic keyboard and mouse events. + +

Used as GUI toolkit independent input into the osgUtil::CameraManipualor's. +For an example of how GUIEventAdapter is specialised for a particular GUI +Toolkit see osgGLUT::GLUTEventAdapter.

+
+ + + +
o GUIEventAdapter() +

+ + +

oenum MouseButtonMask +

+ + + +
o LEFT_BUTTON +

+ + +

o MIDDLE_BUTTON +

+ + +

o RIGHT_BUTTON +

+ + + +
oenum EventType +

+ + + +
o PUSH +

+ + +

o RELEASE +

+ + +

o DRAG +

+ + +

o MOVE +

+ + +

o KEYBOARD +

+ + +

o FRAME +

+ + +

o RESIZE +

+ + +

o NONE +

+ + + +
ovirtual EventType getEventType() const = 0 +
Get the EventType of the GUI event +

+ + +

ovirtual int getKey() const = 0 +
key pressed, return -1 if inappropriate for this event. +

+ + +

ovirtual int getButton() const = 0 +
button pressed/released, return -1 if inappropriate for this event +

+ + +

ovirtual int getXmin() const = 0 +
window minimum x. +

+ + +

ovirtual int getXmax() const = 0 +
window maximum x. +

+ + +

ovirtual int getYmin() const = 0 +
window minimum y. +

+ + +

ovirtual int getYmax() const = 0 +
window maximum y. +

+ + +

ovirtual int getX() const = 0 +
current mouse x position +

+ + +

ovirtual int getY() const = 0 +
current mouse y position +

+ + +

ovirtual unsigned int getButtonMask() const = 0 +
current mouse button state +

+ + +

ovirtual float time() const = 0 +
time in seconds of event. +

+ + +

ovirtual ~GUIEventAdapter() +
Force users to create on heap, so that multiple referencing is safe +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgUtil/GUIEventHandler.html b/doc/doc++/osgUtil/GUIEventHandler.html new file mode 100644 index 000000000..2e90e1c2b --- /dev/null +++ b/doc/doc++/osgUtil/GUIEventHandler.html @@ -0,0 +1,52 @@ + + + + + class OSGUTIL_EXPORT osgUtil::GUIEventHandler + + + + +

class OSGUTIL_EXPORT osgUtil::GUIEventHandler


+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Methods

+[more]virtual bool handle(const GUIEventAdapter& ea, GUIActionAdapter& us) = 0 +
Handle events, return true if handled, false otherwise +

+ +
+ + +
+

Documentation

+
+ + + +
ovirtual bool handle(const GUIEventAdapter& ea, GUIActionAdapter& us) = 0 +
Handle events, return true if handled, false otherwise +

+
+
Direct child classes: +
StateSetManipulator
+SceneViewManipulator
+CameraManipulator
+
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgUtil/General.html b/doc/doc++/osgUtil/General.html new file mode 100644 index 000000000..8e5109b0b --- /dev/null +++ b/doc/doc++/osgUtil/General.html @@ -0,0 +1,112 @@ + + + + + General Bits + + + + +
+
+ +o#define +OSGUTIL_CAMERAMANIPULATOR
+ +o#define +OSGUTIL_CULLVIEWSTATE
+ +o#define +OSGUTIL_NEWCULLVISITOR
+ +o#define +OSGUTIL_DEPTHSORTEDBIN
+ +o#define +OSGUTIL_DISPLAYLISTVISITOR
+ +o#define +OSGUTIL_DRIVEMANIPULATOR
+ +o#define +OSGUTIL_EXPORT_
+ +o#define +OSGUTIL_EXPORT(dllexport)
+ +o#define +OSGUTIL_EXPORT(dllimport)
+ +o#define +OSGUTIL_EXPORT
+ +o#define +OSGUTIL_FLIGHTMANIPULATOR
+ +o#define +OSGUTIL_GUIACTIONADAPTER
+ +o#define +OSGUTIL_GUIEVENTADAPTER
+ +o#define +OSGUTIL_GUIEVENTHANDLER
+ +o#define +OSGUTIL_INSERTIMPOSTORSVISITOR
+ +o#define +OSGUTIL_INTERSECTVISITOR
+ +o#define +OSGUTIL_RENDERBIN
+ +o#define +OSGUTIL_RENDERGRAPH
+ +o#define +OSGUTIL_RENDERLEAF
+ +o#define +OSGUTIL_RENDERSTAGE
+ +o#define +OSGUTIL_RENDERSTAGELIGHTING
+ +o#define +OSGUTIL_RENDERTOTEXTURESTAGE
+ +o#define +OSGUTIL_SCENEVIEW
+ +o#define +OSGUTIL_SceneViewManipulator
+ +o#define +OSGUTIL_SMOOTHINGVISITOR
+ +o#define +OSGUTIL_GEOSTATE_MANIPULATOR
+ +o#define +OSGUTIL_STATISTICS
+ +o#define +OSGUTIL_Tesselator
+ +o#define +OSGUTIL_TRACKBALLMANIPULATOR
+ +o#define +OSGUTIL_TRISTRIPVISITOR
+ +o#define +OSGUTIL_VERSION
+ +o#define +OSGUTIL_VISUALSREQUIREMENTSVISITOR
+

Alphabetic index Hierarchy of classes


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgUtil/HIER.html b/doc/doc++/osgUtil/HIER.html new file mode 100644 index 000000000..3df636192 --- /dev/null +++ b/doc/doc++/osgUtil/HIER.html @@ -0,0 +1,54 @@ + + + + + Hierarchy of Classes + + + +

Hierarchy of Classes

+ +

Alphabetic index


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgUtil/HIERjava.html b/doc/doc++/osgUtil/HIERjava.html new file mode 100644 index 000000000..5cb98b740 --- /dev/null +++ b/doc/doc++/osgUtil/HIERjava.html @@ -0,0 +1,163 @@ + + + + + Hierarchy of Classes + + + +

Hierarchy of classes

+
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ alphabetic index


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgUtil/Hit.html b/doc/doc++/osgUtil/Hit.html new file mode 100644 index 000000000..b9be68f93 --- /dev/null +++ b/doc/doc++/osgUtil/Hit.html @@ -0,0 +1,139 @@ + + + + + class OSGUTIL_EXPORT osgUtil::Hit + + + + +

class OSGUTIL_EXPORT osgUtil::Hit


+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Fields

+[more]float _ratio +
+[more]osg::LineSegment* _originalLineSegment +
+[more]osg::LineSegment* _localLineSegment +
+[more]osg::NodePath _nodePath +
+[more]osg::Geode* _geode +
+[more]osg::GeoSet* _geoset +
+[more]osg::Matrix* _matrix +
+[more]VecIndexList _vecIndexList +
+[more]int _primitiveIndex +
+[more]osg::Vec3 _intersectPoint +
+[more]osg::Vec3 _intersectNormal +

+ +

+

Public Methods

+[more] Hit() +
+[more] Hit(const Hit& hit) +
+[more] ~Hit() +
+[more]Hit& operator = (const Hit& hit) +
+[more]typedef std::vector<int> VecIndexList bool operator < (const Hit& hit) const +

+ +
+ + +
+

Documentation

+
+ + + +
o Hit() +

+ + +

o Hit(const Hit& hit) +

+ + +

o ~Hit() +

+ + +

oHit& operator = (const Hit& hit) +

+ + +

otypedef std::vector<int> VecIndexList bool operator < (const Hit& hit) const +

+ + +

ofloat _ratio +

+ + +

oosg::LineSegment* _originalLineSegment +

+ + +

oosg::LineSegment* _localLineSegment +

+ + +

oosg::NodePath _nodePath +

+ + +

oosg::Geode* _geode +

+ + +

oosg::GeoSet* _geoset +

+ + +

oosg::Matrix* _matrix +

+ + +

oVecIndexList _vecIndexList +

+ + +

oint _primitiveIndex +

+ + +

oosg::Vec3 _intersectPoint +

+ + +

oosg::Vec3 _intersectNormal +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgUtil/InsertImpostorsVisitor.html b/doc/doc++/osgUtil/InsertImpostorsVisitor.html new file mode 100644 index 000000000..60e14d44d --- /dev/null +++ b/doc/doc++/osgUtil/InsertImpostorsVisitor.html @@ -0,0 +1,149 @@ + + + + + class OSGUTIL_EXPORT osgUtil::InsertImpostorsVisitor + + + + +

class OSGUTIL_EXPORT osgUtil::InsertImpostorsVisitor

Insert impostor nodes into scene graph.
+
+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Methods

+[more] InsertImpostorsVisitor() +
default to traversing all children +
+[more]void setImpostorThresholdRatio(const float ratio) +
+[more]const float getImpostorThresholdRatio() const +
+[more]void setMaximumNumberOfNestedImpostors(const unsigned int num) +
+[more]const unsigned int getMaximumNumberOfNestedImpostors() const +
+[more]void reset() +
empty visitor, make it ready for next traversal +
+[more]virtual void apply(osg::Node& node) +
+[more]virtual void apply(osg::Group& node) +
+[more]virtual void apply(osg::LOD& node) +
+[more]virtual void apply(osg::Impostor& node) +
+[more]void insertImpostors() +

+ +

+

Protected Fields

+[more]LODList _lodList +
+[more]float _impostorThresholdRatio +
+[more]unsigned int _maximumNumNestedImpostors +
+[more]unsigned int _numNestedImpostors +

+ +

+

Protected Members

+[more]typedef std::vector< osg::LOD* > LODList GroupList _groupList +

+ +
+ + +
+

Documentation

+
Insert impostor nodes into scene graph. +For example of usage see src/Demos/osgimpostor.
+
+ + + +
o InsertImpostorsVisitor() +
default to traversing all children +

+ + +

ovoid setImpostorThresholdRatio(const float ratio) +

+ + +

oconst float getImpostorThresholdRatio() const +

+ + +

ovoid setMaximumNumberOfNestedImpostors(const unsigned int num) +

+ + +

oconst unsigned int getMaximumNumberOfNestedImpostors() const +

+ + +

ovoid reset() +
empty visitor, make it ready for next traversal +

+ + +

ovirtual void apply(osg::Node& node) +

+ + +

ovirtual void apply(osg::Group& node) +

+ + +

ovirtual void apply(osg::LOD& node) +

+ + +

ovirtual void apply(osg::Impostor& node) +

+ + +

ovoid insertImpostors() +

+ + +

otypedef std::vector< osg::LOD* > LODList GroupList _groupList +

+ + +

oLODList _lodList +

+ + +

ofloat _impostorThresholdRatio +

+ + +

ounsigned int _maximumNumNestedImpostors +

+ + +

ounsigned int _numNestedImpostors +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgUtil/IntersectState.html b/doc/doc++/osgUtil/IntersectState.html new file mode 100644 index 000000000..32225705f --- /dev/null +++ b/doc/doc++/osgUtil/IntersectState.html @@ -0,0 +1,97 @@ + + + + + class OSGUTIL_EXPORT osgUtil::IntersectState + + + + +

class OSGUTIL_EXPORT osgUtil::IntersectState


+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Fields

+[more]osg::Matrix* _matrix +
+[more]osg::Matrix* _inverse +

+ +

+

Public Methods

+[more] IntersectState() +
+[more]bool isCulled(const osg::BoundingSphere& bs, LineSegmentmentMask& segMaskOut) +
+[more]bool isCulled(const osg::BoundingBox& bb, LineSegmentmentMask& segMaskOut) +

+ +

+

Public Members

+[more]typedef std::vector< std::pair<osg::LineSegment*,osg::LineSegment*> > LineSegmentList LineSegmentList _segList +
+[more]typedef std::vector<LineSegmentmentMask> LineSegmentmentMaskStack LineSegmentmentMaskStack _segmentMaskStack +

+ +

+

Protected Methods

+[more] ~IntersectState() +

+ +
+ + +
+

Documentation

+
+ + + +
o IntersectState() +

+ + +

oosg::Matrix* _matrix +

+ + +

oosg::Matrix* _inverse +

+ + +

otypedef std::vector< std::pair<osg::LineSegment*,osg::LineSegment*> > LineSegmentList LineSegmentList _segList +

+ + +

otypedef std::vector<LineSegmentmentMask> LineSegmentmentMaskStack LineSegmentmentMaskStack _segmentMaskStack +

+ + +

obool isCulled(const osg::BoundingSphere& bs, LineSegmentmentMask& segMaskOut) +

+ + +

obool isCulled(const osg::BoundingBox& bb, LineSegmentmentMask& segMaskOut) +

+ + +

o ~IntersectState() +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgUtil/IntersectVisitor.html b/doc/doc++/osgUtil/IntersectVisitor.html new file mode 100644 index 000000000..f9a3ecf35 --- /dev/null +++ b/doc/doc++/osgUtil/IntersectVisitor.html @@ -0,0 +1,230 @@ + + + + + class OSGUTIL_EXPORT osgUtil::IntersectVisitor + + + + +

class OSGUTIL_EXPORT osgUtil::IntersectVisitor

Basic visitor for ray based collisions of a scene.
+
+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Methods

+[more] IntersectVisitor() +
+[more]virtual ~IntersectVisitor() +
+[more]void reset() +
+[more]void addLineSegment(osg::LineSegment* seg) +
Add a line segment to use for intersection testing during scene traversal +
+[more]void setHitReportingMode(HitReportingMode hrm) +
Set the mode of how hits should reported back from a traversal +
+[more]HitReportingMode getHitReportingMode() +
Get the mode of how hits should reported back from a traversal +
+[more]typedef std::map<osg::LineSegment*,HitList > LineSegmentHitListMap HitList& getHitList(osg::LineSegment* seg) +
+[more]int getNumHits(osg::LineSegment* seg) +
+[more]bool hits() +
+[more]virtual void apply(osg::Node&) +
+[more]virtual void apply(osg::Geode& node) +
+[more]virtual void apply(osg::Billboard& node) +
+[more]virtual void apply(osg::Group& node) +
+[more]virtual void apply(osg::Transform& node) +
+[more]virtual void apply(osg::Switch& node) +
+[more]virtual void apply(osg::LOD& node) +

+ +

+

Public Members

+[more]enum HitReportingMode +
Modes to control how IntersectVisitor reports hits. +

+ +

+

Protected Fields

+[more]osg::NodePath _nodePath +
+[more]HitReportingMode _hitReportingMode +
+[more]LineSegmentHitListMap _segHitList +

+ +

+

Protected Methods

+[more]bool intersect(osg::GeoSet& gset) +
+[more]void pushMatrix(const osg::Matrix& matrix) +
+[more]void popMatrix() +
+[more]bool enterNode(osg::Node& node) +
+[more]void leaveNode() +

+ +

+

Protected Members

+[more]typedef std::vector<osg::ref_ptr<IntersectState> > IntersectStateStack IntersectStateStack _intersectStateStack +

+ +
+ + +
+

Documentation

+
Basic visitor for ray based collisions of a scene. +Note, still in development, current version has not +pratical functionality!
+
+ + + +
o IntersectVisitor() +

+ + +

ovirtual ~IntersectVisitor() +

+ + +

ovoid reset() +

+ + +

ovoid addLineSegment(osg::LineSegment* seg) +
Add a line segment to use for intersection testing during scene traversal +

+ + +

oenum HitReportingMode +
Modes to control how IntersectVisitor reports hits. +

+ + + +
o ONLY_NEAREST_HIT +

+ + +

o ALL_HITS +

+ + + +
ovoid setHitReportingMode(HitReportingMode hrm) +
Set the mode of how hits should reported back from a traversal +

+ + +

oHitReportingMode getHitReportingMode() +
Get the mode of how hits should reported back from a traversal +

+ + +

otypedef std::map<osg::LineSegment*,HitList > LineSegmentHitListMap HitList& getHitList(osg::LineSegment* seg) +

+ + +

oint getNumHits(osg::LineSegment* seg) +

+ + +

obool hits() +

+ + +

ovirtual void apply(osg::Node&) +

+ + +

ovirtual void apply(osg::Geode& node) +

+ + +

ovirtual void apply(osg::Billboard& node) +

+ + +

ovirtual void apply(osg::Group& node) +

+ + +

ovirtual void apply(osg::Transform& node) +

+ + +

ovirtual void apply(osg::Switch& node) +

+ + +

ovirtual void apply(osg::LOD& node) +

+ + +

obool intersect(osg::GeoSet& gset) +

+ + +

ovoid pushMatrix(const osg::Matrix& matrix) +

+ + +

ovoid popMatrix() +

+ + +

obool enterNode(osg::Node& node) +

+ + +

ovoid leaveNode() +

+ + +

otypedef std::vector<osg::ref_ptr<IntersectState> > IntersectStateStack IntersectStateStack _intersectStateStack +

+ + +

oosg::NodePath _nodePath +

+ + +

oHitReportingMode _hitReportingMode +

+ + +

oLineSegmentHitListMap _segHitList +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgUtil/NavigatorButton.class b/doc/doc++/osgUtil/NavigatorButton.class new file mode 100644 index 000000000..5fa134ee0 Binary files /dev/null and b/doc/doc++/osgUtil/NavigatorButton.class differ diff --git a/doc/doc++/osgUtil/OptimizeVisitor.html b/doc/doc++/osgUtil/OptimizeVisitor.html new file mode 100644 index 000000000..1e6b57b54 --- /dev/null +++ b/doc/doc++/osgUtil/OptimizeVisitor.html @@ -0,0 +1,125 @@ + + + + + class OSGUTIL_EXPORT osgUtil::OptimizeVisitor + + + + +

class OSGUTIL_EXPORT osgUtil::OptimizeVisitor

A smoothing visitor for calculating smoothed normals for osg::GeoSet's which contains surface primitives
+
+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Methods

+[more] OptimizeVisitor() +
default to traversing all children +
+[more]void setImpostorThresholdRatio(const float ratio) +
+[more]const float getImpostorThresholdRatio() +
+[more]void reset() +
empty visitor, make it ready for next traversal +
+[more]virtual void apply(osg::Node& node) +
+[more]virtual void apply(osg::Group& node) +
+[more]virtual void apply(osg::LOD& node) +
+[more]virtual void apply(osg::Impostor& node) +
+[more]void insertImpostors() +

+ +

+

Protected Fields

+[more]LODList _lodList +
+[more]float _impostorThresholdRatio +

+ +

+

Protected Members

+[more]typedef std::vector< osg::LOD* > LODList GroupList _groupList +

+ +
+ + +
+

Documentation

+
A smoothing visitor for calculating smoothed normals for +osg::GeoSet's which contains surface primitives
+
+ + + +
o OptimizeVisitor() +
default to traversing all children +

+ + +

ovoid setImpostorThresholdRatio(const float ratio) +

+ + +

oconst float getImpostorThresholdRatio() +

+ + +

ovoid reset() +
empty visitor, make it ready for next traversal +

+ + +

ovirtual void apply(osg::Node& node) +

+ + +

ovirtual void apply(osg::Group& node) +

+ + +

ovirtual void apply(osg::LOD& node) +

+ + +

ovirtual void apply(osg::Impostor& node) +

+ + +

ovoid insertImpostors() +

+ + +

otypedef std::vector< osg::LOD* > LODList GroupList _groupList +

+ + +

oLODList _lodList +

+ + +

ofloat _impostorThresholdRatio +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgUtil/RegisterRenderBinProxy.html b/doc/doc++/osgUtil/RegisterRenderBinProxy.html new file mode 100644 index 000000000..a6b65a6c8 --- /dev/null +++ b/doc/doc++/osgUtil/RegisterRenderBinProxy.html @@ -0,0 +1,53 @@ + + + + + template<class T> class osgUtil::RegisterRenderBinProxy + + + + +

template<class T> class osgUtil::RegisterRenderBinProxy

Proxy class for automatic registration of renderbins with the RenderBin prototypelist
+
+ +
+

+

Public Methods

+[more] RegisterRenderBinProxy() +
+[more] ~RegisterRenderBinProxy() +

+ +

+

Protected Fields

+[more]osg::ref_ptr<T> _rb +

+ +
+ + +
+

Documentation

+
Proxy class for automatic registration of renderbins with the RenderBin prototypelist
+
+ + + +
o RegisterRenderBinProxy() +

+ + +

o ~RegisterRenderBinProxy() +

+ + +

oosg::ref_ptr<T> _rb +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgUtil/RenderBin.html b/doc/doc++/osgUtil/RenderBin.html new file mode 100644 index 000000000..fef2331a2 --- /dev/null +++ b/doc/doc++/osgUtil/RenderBin.html @@ -0,0 +1,189 @@ + + + + + class OSGUTIL_EXPORT osgUtil::RenderBin + + + + +

class OSGUTIL_EXPORT osgUtil::RenderBin

RenderBin base class
+
+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Fields

+[more]int _binNum +
+[more]RenderBin* _parent +
+[more]RenderStage* _stage +
+[more]RenderBinList _bins +
+[more]RenderGraphList _renderGraphList +

+ +

+

Public Methods

+[more]typedef std::map< int, osg::ref_ptr<RenderBin> >static RenderBinList RenderBin* createRenderBin(const std::string& binName) +
+[more]static void addRenderBinPrototype(RenderBin* proto) +
+[more]static void removeRenderBinPrototype(RenderBin* proto) +
+[more] RenderBin() +
+[more]virtual osg::Object* clone() const +
+[more]virtual bool isSameKindAs(const osg::Object* obj) const +
+[more]virtual const char* className() const +
+[more]virtual void reset() +
+[more]RenderBin* find_or_insert(int binNum, const std::string& binName) +
+[more]void addRenderGraph(RenderGraph* rg) +
+[more]void sort() +
+[more]virtual void sort_local() +
+[more]virtual void draw(osg::State& state, RenderLeaf*& previous) +
+[more]virtual void draw_local(osg::State& state, RenderLeaf*& previous) +
+[more]void getPrims(Statistics* primStats) +
extract stats for current draw list. +

+ +

+

Public Members

+[more]typedef std::map< std::string, osg::ref_ptr<RenderBin> >static RenderBinPrototypeList RenderBinPrototypeList s_renderBinPrototypeList +

+ +

+

Protected Methods

+[more]virtual ~RenderBin() +

+ +
+ + +
+

Documentation

+
+RenderBin base class
+
+ + + +
otypedef std::map< int, osg::ref_ptr<RenderBin> >static RenderBinList RenderBin* createRenderBin(const std::string& binName) +

+ + +

ostatic void addRenderBinPrototype(RenderBin* proto) +

+ + +

ostatic void removeRenderBinPrototype(RenderBin* proto) +

+ + +

o RenderBin() +

+ + +

ovirtual osg::Object* clone() const +

+ + +

ovirtual bool isSameKindAs(const osg::Object* obj) const +

+ + +

ovirtual const char* className() const +

+ + +

ovirtual void reset() +

+ + +

oRenderBin* find_or_insert(int binNum, const std::string& binName) +

+ + +

ovoid addRenderGraph(RenderGraph* rg) +

+ + +

ovoid sort() +

+ + +

ovirtual void sort_local() +

+ + +

ovirtual void draw(osg::State& state, RenderLeaf*& previous) +

+ + +

ovirtual void draw_local(osg::State& state, RenderLeaf*& previous) +

+ + +

ovoid getPrims(Statistics* primStats) +
extract stats for current draw list. +

+ + +

oint _binNum +

+ + +

oRenderBin* _parent +

+ + +

oRenderStage* _stage +

+ + +

oRenderBinList _bins +

+ + +

oRenderGraphList _renderGraphList +

+ + +

otypedef std::map< std::string, osg::ref_ptr<RenderBin> >static RenderBinPrototypeList RenderBinPrototypeList s_renderBinPrototypeList +

+ + +

ovirtual ~RenderBin() +

+
+
Direct child classes: +
RenderStage
+DepthSortedBin
+
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgUtil/RenderGraph.html b/doc/doc++/osgUtil/RenderGraph.html new file mode 100644 index 000000000..25e96a538 --- /dev/null +++ b/doc/doc++/osgUtil/RenderGraph.html @@ -0,0 +1,159 @@ + + + + + class OSGUTIL_EXPORT osgUtil::RenderGraph + + + + +

class OSGUTIL_EXPORT osgUtil::RenderGraph


+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Fields

+[more]osg::ref_ptr<const osg::StateSet> _stateset +
+[more]int _depth +
+[more]ChildList _children +
+[more]LeafList _leaves +

+ +

+

Public Methods

+[more] RenderGraph() +
+[more] RenderGraph(RenderGraph* parent, const osg::StateSet* stateset) +
+[more] ~RenderGraph() +
+[more]inline const bool empty() const +
return true if all of drawables, lights and chilren are empty +
+[more]inline const bool leaves_empty() const +
+[more]void reset() +
reset the internal contents of a RenderGraph, including deleting all children +
+[more]void clean() +
recursively clean the RenderGraph of all its drawables, lights and depths. +
+[more]void prune() +
recursively prune the RenderGraph of empty children +
+[more]inline RenderGraph* find_or_insert(const osg::StateSet* stateset) +
+[more]inline void addLeaf(RenderLeaf* leaf) +
add a render leaf +
+[more]static inline void moveRenderGraph(osg::State& state, RenderGraph* sg_curr, RenderGraph* sg_new) +
+[more]inline static void moveToRootRenderGraph(osg::State& state, RenderGraph* sg_curr) +

+ +

+

Public Members

+[more]typedef std::vector< osg::ref_ptr<RenderLeaf> > LeafList RenderGraph* _parent +

+ +
+ + +
+

Documentation

+
+ + + +
otypedef std::vector< osg::ref_ptr<RenderLeaf> > LeafList RenderGraph* _parent +

+ + +

oosg::ref_ptr<const osg::StateSet> _stateset +

+ + +

oint _depth +

+ + +

oChildList _children +

+ + +

oLeafList _leaves +

+ + +

o RenderGraph() +

+ + +

o RenderGraph(RenderGraph* parent, const osg::StateSet* stateset) +

+ + +

o ~RenderGraph() +

+ + +

oinline const bool empty() const +
return true if all of drawables, lights and chilren are empty +

+ + +

oinline const bool leaves_empty() const +

+ + +

ovoid reset() +
reset the internal contents of a RenderGraph, including deleting all children +

+ + +

ovoid clean() +
recursively clean the RenderGraph of all its drawables, lights and depths. +Leaves children intact, and ready to be populated again. +

+ + +

ovoid prune() +
recursively prune the RenderGraph of empty children +

+ + +

oinline RenderGraph* find_or_insert(const osg::StateSet* stateset) +

+ + +

oinline void addLeaf(RenderLeaf* leaf) +
add a render leaf +

+ + +

ostatic inline void moveRenderGraph(osg::State& state, RenderGraph* sg_curr, RenderGraph* sg_new) +

+ + +

oinline static void moveToRootRenderGraph(osg::State& state, RenderGraph* sg_curr) +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgUtil/RenderLeaf.html b/doc/doc++/osgUtil/RenderLeaf.html new file mode 100644 index 000000000..12ec6b02a --- /dev/null +++ b/doc/doc++/osgUtil/RenderLeaf.html @@ -0,0 +1,93 @@ + + + + + class OSGUTIL_EXPORT osgUtil::RenderLeaf + + + + +

class OSGUTIL_EXPORT osgUtil::RenderLeaf

container class for all data required for rendering of drawables
+
+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Fields

+[more]RenderGraph* _parent +
+[more]osg::Drawable* _drawable +
+[more]osg::ref_ptr<osg::Matrix> _matrix +
+[more]float _depth +

+ +

+

Public Methods

+[more]inline RenderLeaf(osg::Drawable* drawable, osg::Matrix* matrix, float depth=0.0f) +
+[more]inline void set(osg::Drawable* drawable, osg::Matrix* matrix, float depth=0.0f) +
+[more]inline void reset() +
+[more]virtual void render(osg::State& state, RenderLeaf* previous) +

+ +
+ + +
+

Documentation

+
container class for all data required for rendering of drawables
+
+ + + +
oinline RenderLeaf(osg::Drawable* drawable, osg::Matrix* matrix, float depth=0.0f) +

+ + +

oinline void set(osg::Drawable* drawable, osg::Matrix* matrix, float depth=0.0f) +

+ + +

oinline void reset() +

+ + +

ovirtual void render(osg::State& state, RenderLeaf* previous) +

+ + +

oRenderGraph* _parent +

+ + +

oosg::Drawable* _drawable +

+ + +

oosg::ref_ptr<osg::Matrix> _matrix +

+ + +

ofloat _depth +

+ +
This class has no child classes.
+ +
Friends:
RenderGraph

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgUtil/RenderStage.html b/doc/doc++/osgUtil/RenderStage.html new file mode 100644 index 000000000..24822f05c --- /dev/null +++ b/doc/doc++/osgUtil/RenderStage.html @@ -0,0 +1,383 @@ + + + + + class OSGUTIL_EXPORT osgUtil::RenderStage + + + + +

class OSGUTIL_EXPORT osgUtil::RenderStage

RenderState base class.
+
+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Fields

+[more]DependencyList _dependencyList +
+[more]osg::ref_ptr<osg::Camera> _camera +
+[more]GLint _view[4] +
+[more]GLbitfield _clearMask +
+[more]osg::Vec4 _clearColor +
+[more]osg::Vec4 _clearAccum +
+[more]double _clearDepth +
+[more]int _clearStencil +
+[more]mutable osg::ref_ptr<RenderStageLighting> _renderStageLighting +

+ +

+

Public Methods

+[more] RenderStage() +
+[more]virtual osg::Object* clone() const +
+[more]virtual bool isSameKindAs(const osg::Object* obj) const +
+[more]virtual const char* className() const +
+[more]virtual void reset() +
+[more]void setViewport(int x, int y, int width, int height) +
Set the viewport of the scene view. +
+[more]void getViewport(int& x, int& y, int& width, int& height) const +
Get the viewport of the scene view. +
+[more]void setClearMask(const GLbitfield mask) +
Set the clear mask used in glClear(). +
+[more]const GLbitfield getClearMask() const +
Get the clear mask +
+[more]void setClearColor(const osg::Vec4& color) +
Set the clear color used in glClearColor(). +
+[more]const osg::Vec4& getClearColor() const +
Get the clear color +
+[more]void setClearAccum(const osg::Vec4& color) +
Set the clear accum used in glClearAccum(). +
+[more]const osg::Vec4& getClearAccum() const +
Get the clear accum +
+[more]void setClearDepth(const double depth) +
Set the clear depth used in glClearDepth(). +
+[more]const double getClearDepth() const +
Get the clear depth +
+[more]void setClearStencil(const int stencil) +
Set the clear stencil value used in glClearStencil(). +
+[more]const int getClearStencil() const +
Get the clear color +
+[more]void setCamera(osg::Camera* camera) +
+[more]osg::Camera* getCamera() +
+[more]const osg::Camera* getCamera() const +
+[more]void setRenderStageLighting(RenderStageLighting* rsl) +
+[more]RenderStageLighting* getRenderStageLighting() const +
+[more]void setLightingMode(RenderStageLighting::Mode mode) +
+[more]RenderStageLighting::Mode getLightingMode() const +
+[more]void setLight(osg::Light* light) +
+[more]osg::Light* getLight() +
+[more]const osg::Light* getLight() const +
+[more]virtual void addLight(osg::Light* light, osg::Matrix* matrix) +
+[more]virtual void draw(osg::State& state, RenderLeaf*& previous) +
+[more]void addToDependencyList(RenderStage* rs) +
+[more]void getPrims(Statistics* primStats) +
extract stats for current draw list. +

+ +

+

Public Members

+[more]typedef std::vector< osg::ref_ptr<RenderStage> > DependencyList bool _stageDrawnThisFrame +

+ +

+

Protected Methods

+[more]virtual ~RenderStage() +

+ +
+

Inherited from RenderBin:

+
+

+

Public Fields

+oint _binNum +
+oRenderBin* _parent +
+oRenderStage* _stage +
+oRenderBinList _bins +
+oRenderGraphList _renderGraphList +

+ +

+

Public Methods

+otypedef std::map< int, osg::ref_ptr<RenderBin> >static RenderBinList RenderBin* createRenderBin(const std::string& binName) +
+ostatic void addRenderBinPrototype(RenderBin* proto) +
+ostatic void removeRenderBinPrototype(RenderBin* proto) +
+oRenderBin* find_or_insert(int binNum, const std::string& binName) +
+ovoid addRenderGraph(RenderGraph* rg) +
+ovoid sort() +
+ovirtual void sort_local() +
+ovirtual void draw_local(osg::State& state, RenderLeaf*& previous) +

+ +

+

Public Members

+otypedef std::map< std::string, osg::ref_ptr<RenderBin> >static RenderBinPrototypeList RenderBinPrototypeList s_renderBinPrototypeList +

+ +
+ + +
+

Documentation

+
+RenderState base class. Used for encapsulate a complete stage in +rendering - setting up of viewport, the projection and model +matrices and rendering the RenderBin's enclosed with this RenderStage. +RenderStage also has a dependancy list of other RenderStages, each +of which must be called before the rendering of this stage. These +'pre' rendering stages are used for advanced rendering techniques +like multistage pixel shading or impostors.
+
+ + + +
o RenderStage() +

+ + +

ovirtual osg::Object* clone() const +

+ + +

ovirtual bool isSameKindAs(const osg::Object* obj) const +

+ + +

ovirtual const char* className() const +

+ + +

ovirtual void reset() +

+ + +

ovoid setViewport(int x, int y, int width, int height) +
Set the viewport of the scene view. +

+ + +

ovoid getViewport(int& x, int& y, int& width, int& height) const +
Get the viewport of the scene view. +

+ + +

ovoid setClearMask(const GLbitfield mask) +
Set the clear mask used in glClear(). +Defaults to GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT. +

+ + +

oconst GLbitfield getClearMask() const +
Get the clear mask +

+ + +

ovoid setClearColor(const osg::Vec4& color) +
Set the clear color used in glClearColor(). +glClearColor is only called if mask & GL_COLOR_BUFFER_BIT is true +

+ + +

oconst osg::Vec4& getClearColor() const +
Get the clear color +

+ + +

ovoid setClearAccum(const osg::Vec4& color) +
Set the clear accum used in glClearAccum(). +glClearAcumm is only called if mask & GL_ACCUM_BUFFER_BIT is true +

+ + +

oconst osg::Vec4& getClearAccum() const +
Get the clear accum +

+ + +

ovoid setClearDepth(const double depth) +
Set the clear depth used in glClearDepth(). Defaults to 1.0 +glClearDepth is only called if mask & GL_DEPTH_BUFFER_BIT is true +

+ + +

oconst double getClearDepth() const +
Get the clear depth +

+ + +

ovoid setClearStencil(const int stencil) +
Set the clear stencil value used in glClearStencil(). Defaults to 1.0 +glClearStencil is only called if mask & GL_STENCIL_BUFFER_BIT is true +

+ + +

oconst int getClearStencil() const +
Get the clear color +

+ + +

ovoid setCamera(osg::Camera* camera) +

+ + +

oosg::Camera* getCamera() +

+ + +

oconst osg::Camera* getCamera() const +

+ + +

ovoid setRenderStageLighting(RenderStageLighting* rsl) +

+ + +

oRenderStageLighting* getRenderStageLighting() const +

+ + +

ovoid setLightingMode(RenderStageLighting::Mode mode) +

+ + +

oRenderStageLighting::Mode getLightingMode() const +

+ + +

ovoid setLight(osg::Light* light) +

+ + +

oosg::Light* getLight() +

+ + +

oconst osg::Light* getLight() const +

+ + +

ovirtual void addLight(osg::Light* light, osg::Matrix* matrix) +

+ + +

ovirtual void draw(osg::State& state, RenderLeaf*& previous) +

+ + +

ovoid addToDependencyList(RenderStage* rs) +

+ + +

ovoid getPrims(Statistics* primStats) +
extract stats for current draw list. +

+ + +

otypedef std::vector< osg::ref_ptr<RenderStage> > DependencyList bool _stageDrawnThisFrame +

+ + +

oDependencyList _dependencyList +

+ + +

oosg::ref_ptr<osg::Camera> _camera +

+ + +

oGLint _view[4] +

+ + +

oGLbitfield _clearMask +

+ + +

oosg::Vec4 _clearColor +

+ + +

oosg::Vec4 _clearAccum +

+ + +

odouble _clearDepth +

+ + +

oint _clearStencil +

+ + +

omutable osg::ref_ptr<RenderStageLighting> _renderStageLighting +

+ + +

ovirtual ~RenderStage() +

+
+
Direct child classes: +
RenderToTextureStage
+
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgUtil/RenderStageLighting.html b/doc/doc++/osgUtil/RenderStageLighting.html new file mode 100644 index 000000000..20a5f155b --- /dev/null +++ b/doc/doc++/osgUtil/RenderStageLighting.html @@ -0,0 +1,168 @@ + + + + + class OSGUTIL_EXPORT osgUtil::RenderStageLighting + + + + +

class OSGUTIL_EXPORT osgUtil::RenderStageLighting

RenderBin base class
+
+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Fields

+[more]Mode _lightingMode +
+[more]osg::ref_ptr<osg::Light> _light +
+[more]LightList _lightList +

+ +

+

Public Methods

+[more] RenderStageLighting() +
+[more]virtual osg::Object* clone() const +
+[more]virtual bool isSameKindAs(const osg::Object* obj) const +
+[more]virtual const char* className() const +
+[more]virtual void reset() +
+[more]void setLightingMode(Mode mode) +
+[more]Mode getLightingMode() const +
+[more]void setLight(osg::Light* light) +
+[more]osg::Light* getLight() +
+[more]const osg::Light* getLight() const +
+[more]typedef std::vector< LightMatrixPair >virtual LightList void addLight(osg::Light* light, osg::Matrix* matrix) +
+[more]virtual void draw(osg::State& state, RenderLeaf*& previous) +

+ +

+

Public Members

+[more]enum Mode +

+ +

+

Protected Methods

+[more]virtual ~RenderStageLighting() +

+ +
+ + +
+

Documentation

+
+RenderBin base class
+
+ + + +
o RenderStageLighting() +

+ + +

ovirtual osg::Object* clone() const +

+ + +

ovirtual bool isSameKindAs(const osg::Object* obj) const +

+ + +

ovirtual const char* className() const +

+ + +

ovirtual void reset() +

+ + +

oenum Mode +

+ + + +
o HEADLIGHT +

+ + +

o SKY_LIGHT +

+ + +

o NO_SCENEVIEW_LIGHT +

+ + + +
ovoid setLightingMode(Mode mode) +

+ + +

oMode getLightingMode() const +

+ + +

ovoid setLight(osg::Light* light) +

+ + +

oosg::Light* getLight() +

+ + +

oconst osg::Light* getLight() const +

+ + +

otypedef std::vector< LightMatrixPair >virtual LightList void addLight(osg::Light* light, osg::Matrix* matrix) +

+ + +

ovirtual void draw(osg::State& state, RenderLeaf*& previous) +

+ + +

oMode _lightingMode +

+ + +

oosg::ref_ptr<osg::Light> _light +

+ + +

oLightList _lightList +

+ + +

ovirtual ~RenderStageLighting() +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgUtil/RenderToTextureStage.html b/doc/doc++/osgUtil/RenderToTextureStage.html new file mode 100644 index 000000000..7e0b195a0 --- /dev/null +++ b/doc/doc++/osgUtil/RenderToTextureStage.html @@ -0,0 +1,231 @@ + + + + + class OSGUTIL_EXPORT osgUtil::RenderToTextureStage + + + + +

class OSGUTIL_EXPORT osgUtil::RenderToTextureStage

RenderBin base class
+
+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Methods

+[more] RenderToTextureStage() +
+[more]virtual osg::Object* clone() const +
+[more]virtual bool isSameKindAs(const osg::Object* obj) const +
+[more]virtual const char* className() const +
+[more]virtual void reset() +
+[more]void setTexture(osg::Texture* texture) +
+[more]osg::Texture* getTexture() +
+[more]virtual void draw(osg::State& state, RenderLeaf*& previous) +

+ +

+

Protected Fields

+[more]osg::ref_ptr<osg::Texture> _texture +

+ +

+

Protected Methods

+[more]virtual ~RenderToTextureStage() +

+ +
+

Inherited from RenderStage:

+
+

+

Public Fields

+oDependencyList _dependencyList +
+oosg::ref_ptr<osg::Camera> _camera +
+oGLint _view[4] +
+oGLbitfield _clearMask +
+oosg::Vec4 _clearColor +
+oosg::Vec4 _clearAccum +
+odouble _clearDepth +
+oint _clearStencil +
+omutable osg::ref_ptr<RenderStageLighting> _renderStageLighting +

+ +

+

Public Methods

+ovoid setViewport(int x, int y, int width, int height) +
+ovoid getViewport(int& x, int& y, int& width, int& height) const +
+ovoid setClearMask(const GLbitfield mask) +
+oconst GLbitfield getClearMask() const +
+ovoid setClearColor(const osg::Vec4& color) +
+oconst osg::Vec4& getClearColor() const +
+ovoid setClearAccum(const osg::Vec4& color) +
+oconst osg::Vec4& getClearAccum() const +
+ovoid setClearDepth(const double depth) +
+oconst double getClearDepth() const +
+ovoid setClearStencil(const int stencil) +
+oconst int getClearStencil() const +
+ovoid setCamera(osg::Camera* camera) +
+oosg::Camera* getCamera() +
+oconst osg::Camera* getCamera() const +
+ovoid setRenderStageLighting(RenderStageLighting* rsl) +
+oRenderStageLighting* getRenderStageLighting() const +
+ovoid setLightingMode(RenderStageLighting::Mode mode) +
+oRenderStageLighting::Mode getLightingMode() const +
+ovoid setLight(osg::Light* light) +
+oosg::Light* getLight() +
+oconst osg::Light* getLight() const +
+ovirtual void addLight(osg::Light* light, osg::Matrix* matrix) +
+ovoid addToDependencyList(RenderStage* rs) +
+ovoid getPrims(Statistics* primStats) +

+ +

+

Public Members

+otypedef std::vector< osg::ref_ptr<RenderStage> > DependencyList bool _stageDrawnThisFrame +

+ +
+

Inherited from RenderBin:

+
+

+

Public Fields

+oint _binNum +
+oRenderBin* _parent +
+oRenderStage* _stage +
+oRenderBinList _bins +
+oRenderGraphList _renderGraphList +

+ +

+

Public Methods

+otypedef std::map< int, osg::ref_ptr<RenderBin> >static RenderBinList RenderBin* createRenderBin(const std::string& binName) +
+ostatic void addRenderBinPrototype(RenderBin* proto) +
+ostatic void removeRenderBinPrototype(RenderBin* proto) +
+oRenderBin* find_or_insert(int binNum, const std::string& binName) +
+ovoid addRenderGraph(RenderGraph* rg) +
+ovoid sort() +
+ovirtual void sort_local() +
+ovirtual void draw_local(osg::State& state, RenderLeaf*& previous) +

+ +

+

Public Members

+otypedef std::map< std::string, osg::ref_ptr<RenderBin> >static RenderBinPrototypeList RenderBinPrototypeList s_renderBinPrototypeList +

+ +
+ + +
+

Documentation

+
+RenderBin base class
+
+ + + +
o RenderToTextureStage() +

+ + +

ovirtual osg::Object* clone() const +

+ + +

ovirtual bool isSameKindAs(const osg::Object* obj) const +

+ + +

ovirtual const char* className() const +

+ + +

ovirtual void reset() +

+ + +

ovoid setTexture(osg::Texture* texture) +

+ + +

oosg::Texture* getTexture() +

+ + +

ovirtual void draw(osg::State& state, RenderLeaf*& previous) +

+ + +

ovirtual ~RenderToTextureStage() +

+ + +

oosg::ref_ptr<osg::Texture> _texture +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgUtil/SceneView.html b/doc/doc++/osgUtil/SceneView.html new file mode 100644 index 000000000..a05efcc0a --- /dev/null +++ b/doc/doc++/osgUtil/SceneView.html @@ -0,0 +1,537 @@ + + + + + class OSGUTIL_EXPORT osgUtil::SceneView + + + + +

class OSGUTIL_EXPORT osgUtil::SceneView

SceneView is literaly a view of a scene, encapsulating the camera, global state, lights and the scene itself.
+
+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Methods

+[more] SceneView() +
Constrcut a default scene view +
+[more]void setSceneData(osg::Node* node) +
Set the data which to view. +
+[more]osg::Node* getSceneData() +
Get the scene data which to view. +
+[more]const osg::Node* getSceneData() const +
Get the const scene data which to view. +
+[more]void setViewport(int x, int y, int width, int height) +
Set the viewport of the scene view. +
+[more]void getViewport(int& x, int& y, int& width, int& height) +
Get the viewport of the scene view. +
+[more]void setDefaults() +
Set scene view to use default global state, light, camera and render visitor +
+[more]void setBackgroundColor(const osg::Vec4& color) +
Set the background color used in glClearColor(). +
+[more]const osg::Vec4& getBackgroundColor() const +
Get the background color +
+[more]void setGlobalState(osg::StateSet* state) +
+[more]osg::StateSet* getGlobalState() +
+[more]const osg::StateSet* getGlobalState() const +
+[more]void setLightingMode(LightingMode mode) +
+[more]LightingMode getLightingMode() const +
+[more]void setLight(osg::Light* light) +
+[more]osg::Light* getLight() +
+[more]const osg::Light* getLight() const +
+[more]void setCamera(osg::Camera* camera) +
+[more]osg::Camera* getCamera() +
+[more]const osg::Camera* getCamera() const +
+[more]void setState(osg::State* state) +
+[more]osg::State* getState() +
+[more]const osg::State* getState() const +
+[more]void setAppVisitor(osg::NodeVisitor* av) +
+[more]osg::NodeVisitor* getAppVisitor() +
+[more]const osg::NodeVisitor* getAppVisitor() const +
+[more]void setCullVisitor(osgUtil::CullVisitor* cv) +
+[more]osgUtil::CullVisitor* getCullVisitor() +
+[more]const osgUtil::CullVisitor* getCullVisitor() const +
+[more]void setRenderGraph(osgUtil::RenderGraph* rg) +
+[more]osgUtil::RenderGraph* getRenderGraph() +
+[more]const osgUtil::RenderGraph* getRenderGraph() const +
+[more]void setRenderStage(osgUtil::RenderStage* rs) +
+[more]osgUtil::RenderStage* getRenderStage() +
+[more]const osgUtil::RenderStage* getRenderStage() const +
+[more]void setLODBias(float bias) +
+[more]float getLODBias() const +
+[more]void setCalcNearFar(bool calc) +
Set to true if you want SceneView to automatically calculate values for the near/far clipping planes, each frame, set false to use camera's internal near and far planes. +
+[more]bool getCalcNearFar() const +
return true if SceneView automatically caclculates near and far clipping planes for each frame +
+[more]void setPrioritizeTextures(bool pt) +
set whether the draw method should call renderer->prioritizeTexture +
+[more]bool getPrioritizeTextures() const +
get whether the draw method should call renderer->prioritizeTexture +
+[more]bool projectWindowIntoObject(const osg::Vec3& window, osg::Vec3& object) const +
Calculate, via glUnProject, the object coordinates of a window point. +
+[more]bool projectWindowXYIntoObject(int x, int y, osg::Vec3& near_point, osg::Vec3& far_point) const +
Calculate, via glUnProject, the object coordinates of a window x,y when projected onto the near and far planes. +
+[more]bool projectObjectIntoWindow(const osg::Vec3& object, osg::Vec3& window) const +
Calculate, via glProject, the object coordinates of a window. +
+[more]virtual void app() +
do app traversal of attached scene graph using App NodeVisitor +
+[more]virtual void cull() +
do cull traversal of attached scene graph using App CullVisitor +
+[more]virtual void draw() +
do draw traversal of draw bins generated by cull traversal +

+ +

+

Public Members

+[more]enum LightingMode +

+ +

+

Protected Fields

+[more]osg::ref_ptr<osg::Node> _sceneData +
+[more]osg::ref_ptr<osg::StateSet> _globalState +
+[more]osg::ref_ptr<osg::Light> _light +
+[more]osg::ref_ptr<osg::Camera> _camera +
+[more]osg::ref_ptr<osg::State> _state +
+[more]osg::ref_ptr<osg::NodeVisitor> _appVisitor +
+[more]osg::ref_ptr<osgUtil::CullVisitor> _cullVisitor +
+[more]osg::ref_ptr<osgUtil::RenderGraph> _rendergraph +
+[more]osg::ref_ptr<osgUtil::RenderStage> _renderStage +
+[more]bool _need_compile +
+[more]bool _calc_nearfar +
+[more]osg::Vec4 _backgroundColor +
+[more]double _near_plane +
+[more]double _far_plane +
+[more]float _lodBias +
+[more]GLint _view[4] +
+[more]LightingMode _lightingMode +
+[more]bool _prioritizeTextures +
+[more]int _frameNumber +

+ +

+

Protected Methods

+[more]virtual ~SceneView() +

+ +
+ + +
+

Documentation

+
+SceneView is literaly a view of a scene, encapsulating the +camera, global state, lights and the scene itself. Provides +methods for setting up the view and rendering it.
+
+ + + +
o SceneView() +
Constrcut a default scene view +

+ + +

ovoid setSceneData(osg::Node* node) +
Set the data which to view. The data will typically be +an osg::Scene but can be any osg::Node type. +

+ + +

oosg::Node* getSceneData() +
Get the scene data which to view. The data will typically be +an osg::Scene but can be any osg::Node type. +

+ + +

oconst osg::Node* getSceneData() const +
Get the const scene data which to view. The data will typically be +an osg::Scene but can be any osg::Node type. +

+ + +

ovoid setViewport(int x, int y, int width, int height) +
Set the viewport of the scene view. +

+ + +

ovoid getViewport(int& x, int& y, int& width, int& height) +
Get the viewport of the scene view. +

+ + +

ovoid setDefaults() +
Set scene view to use default global state, light, camera +and render visitor +

+ + +

ovoid setBackgroundColor(const osg::Vec4& color) +
Set the background color used in glClearColor(). +Defaults to an off blue color. +

+ + +

oconst osg::Vec4& getBackgroundColor() const +
Get the background color +

+ + +

ovoid setGlobalState(osg::StateSet* state) +

+ + +

oosg::StateSet* getGlobalState() +

+ + +

oconst osg::StateSet* getGlobalState() const +

+ + +

oenum LightingMode +

+ + + +
o HEADLIGHT +

+ + +

o SKY_LIGHT +

+ + +

o NO_SCENEVIEW_LIGHT +

+ + + +
ovoid setLightingMode(LightingMode mode) +

+ + +

oLightingMode getLightingMode() const +

+ + +

ovoid setLight(osg::Light* light) +

+ + +

oosg::Light* getLight() +

+ + +

oconst osg::Light* getLight() const +

+ + +

ovoid setCamera(osg::Camera* camera) +

+ + +

oosg::Camera* getCamera() +

+ + +

oconst osg::Camera* getCamera() const +

+ + +

ovoid setState(osg::State* state) +

+ + +

oosg::State* getState() +

+ + +

oconst osg::State* getState() const +

+ + +

ovoid setAppVisitor(osg::NodeVisitor* av) +

+ + +

oosg::NodeVisitor* getAppVisitor() +

+ + +

oconst osg::NodeVisitor* getAppVisitor() const +

+ + +

ovoid setCullVisitor(osgUtil::CullVisitor* cv) +

+ + +

oosgUtil::CullVisitor* getCullVisitor() +

+ + +

oconst osgUtil::CullVisitor* getCullVisitor() const +

+ + +

ovoid setRenderGraph(osgUtil::RenderGraph* rg) +

+ + +

oosgUtil::RenderGraph* getRenderGraph() +

+ + +

oconst osgUtil::RenderGraph* getRenderGraph() const +

+ + +

ovoid setRenderStage(osgUtil::RenderStage* rs) +

+ + +

oosgUtil::RenderStage* getRenderStage() +

+ + +

oconst osgUtil::RenderStage* getRenderStage() const +

+ + +

ovoid setLODBias(float bias) +

+ + +

ofloat getLODBias() const +

+ + +

ovoid setCalcNearFar(bool calc) +
Set to true if you want SceneView to automatically calculate values +for the near/far clipping planes, each frame, set false to use camera's +internal near and far planes. Default value is true. +

+ + +

obool getCalcNearFar() const +
return true if SceneView automatically caclculates near and +far clipping planes for each frame +

+ + +

ovoid setPrioritizeTextures(bool pt) +
set whether the draw method should call renderer->prioritizeTexture +

+ + +

obool getPrioritizeTextures() const +
get whether the draw method should call renderer->prioritizeTexture +

+ + +

obool projectWindowIntoObject(const osg::Vec3& window, osg::Vec3& object) const +
Calculate, via glUnProject, the object coordinates of a window point. +Note, current implementation requires that SceneView::draw() has been previously called +for projectWindowIntoObject to produce valid values. Consistent with OpenGL +windows coordinates are calculated relative to the bottom left of the window. +Returns true on successful projection. +

+ + +

obool projectWindowXYIntoObject(int x, int y, osg::Vec3& near_point, osg::Vec3& far_point) const +
Calculate, via glUnProject, the object coordinates of a window x,y +when projected onto the near and far planes. +Note, current implementation requires that SceneView::draw() has been previously called +for projectWindowIntoObject to produce valid values. Consistent with OpenGL +windows coordinates are calculated relative to the bottom left of the window. +Returns true on successful projection. +

+ + +

obool projectObjectIntoWindow(const osg::Vec3& object, osg::Vec3& window) const +
Calculate, via glProject, the object coordinates of a window. +Note, current implementation requires that SceneView::draw() has been previously called +for projectWindowIntoObject to produce valid values. Consistent with OpenGL +windows coordinates are calculated relative to the bottom left of the window, +whereas as window API's normally have the top left as the origin, +so you may need to pass in (mouseX,window_height-mouseY,...). +Returns true on successful projection. +

+ + +

ovirtual void app() +
do app traversal of attached scene graph using App NodeVisitor +

+ + +

ovirtual void cull() +
do cull traversal of attached scene graph using App CullVisitor +

+ + +

ovirtual void draw() +
do draw traversal of draw bins generated by cull traversal +

+ + +

ovirtual ~SceneView() +

+ + +

oosg::ref_ptr<osg::Node> _sceneData +

+ + +

oosg::ref_ptr<osg::StateSet> _globalState +

+ + +

oosg::ref_ptr<osg::Light> _light +

+ + +

oosg::ref_ptr<osg::Camera> _camera +

+ + +

oosg::ref_ptr<osg::State> _state +

+ + +

oosg::ref_ptr<osg::NodeVisitor> _appVisitor +

+ + +

oosg::ref_ptr<osgUtil::CullVisitor> _cullVisitor +

+ + +

oosg::ref_ptr<osgUtil::RenderGraph> _rendergraph +

+ + +

oosg::ref_ptr<osgUtil::RenderStage> _renderStage +

+ + +

obool _need_compile +

+ + +

obool _calc_nearfar +

+ + +

oosg::Vec4 _backgroundColor +

+ + +

odouble _near_plane +

+ + +

odouble _far_plane +

+ + +

ofloat _lodBias +

+ + +

oGLint _view[4] +

+ + +

oLightingMode _lightingMode +

+ + +

obool _prioritizeTextures +

+ + +

oint _frameNumber +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgUtil/SceneViewManipulator.html b/doc/doc++/osgUtil/SceneViewManipulator.html new file mode 100644 index 000000000..cdfe02138 --- /dev/null +++ b/doc/doc++/osgUtil/SceneViewManipulator.html @@ -0,0 +1,156 @@ + + + + + class OSGUTIL_EXPORT osgUtil::SceneViewManipulator + + + + +

class OSGUTIL_EXPORT osgUtil::SceneViewManipulator


+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Methods

+[more] SceneViewManipulator() +
+[more]virtual ~SceneViewManipulator() +
+[more]virtual void setSceneView(SceneView*) +
attach a scene view to the manipulator. +
+[more]virtual SceneView* getSceneView() +
get the attached a scene view +
+[more]virtual const SceneView* getSceneView() const +
get the attached a const scene view +
+[more]virtual void setCameraManipulator(CameraManipulator* cm) +
Set the camera manipulator on the object +
+[more]virtual CameraManipulator* getCameraManipulator() +
Get the camera manipulator on the object +
+[more]virtual const CameraManipulator* getCameraManipulator() const +
Get the const camera manipulator on the object +
+[more]virtual void setStateSetManipulator(StateSetManipulator* cm) +
Set the geostate manipulator on the object +
+[more]virtual StateSetManipulator* getStateSetManipulator() +
Get the geostate manipulator on the object +
+[more]virtual const StateSetManipulator* getStateSetManipulator() const +
Get the geostate manipulator on the object +
+[more]virtual bool handle(const GUIEventAdapter& ea, GUIActionAdapter& us) +
Handle events, return true if handled, false otherwise +

+ +

+

Protected Fields

+[more]osg::ref_ptr<SceneView> _sv +
+[more]osg::ref_ptr<CameraManipulator> _cm +
+[more]osg::ref_ptr<StateSetManipulator> _gm +

+ +
+

Inherited from GUIEventHandler:

+
+
+ + +
+

Documentation

+
+ + + +
o SceneViewManipulator() +

+ + +

ovirtual ~SceneViewManipulator() +

+ + +

ovirtual void setSceneView(SceneView*) +
attach a scene view to the manipulator. +

+ + +

ovirtual SceneView* getSceneView() +
get the attached a scene view +

+ + +

ovirtual const SceneView* getSceneView() const +
get the attached a const scene view +

+ + +

ovirtual void setCameraManipulator(CameraManipulator* cm) +
Set the camera manipulator on the object +

+ + +

ovirtual CameraManipulator* getCameraManipulator() +
Get the camera manipulator on the object +

+ + +

ovirtual const CameraManipulator* getCameraManipulator() const +
Get the const camera manipulator on the object +

+ + +

ovirtual void setStateSetManipulator(StateSetManipulator* cm) +
Set the geostate manipulator on the object +

+ + +

ovirtual StateSetManipulator* getStateSetManipulator() +
Get the geostate manipulator on the object +

+ + +

ovirtual const StateSetManipulator* getStateSetManipulator() const +
Get the geostate manipulator on the object +

+ + +

ovirtual bool handle(const GUIEventAdapter& ea, GUIActionAdapter& us) +
Handle events, return true if handled, false otherwise +

+ + +

oosg::ref_ptr<SceneView> _sv +

+ + +

oosg::ref_ptr<CameraManipulator> _cm +

+ + +

oosg::ref_ptr<StateSetManipulator> _gm +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgUtil/SmoothingVisitor.html b/doc/doc++/osgUtil/SmoothingVisitor.html new file mode 100644 index 000000000..69854f393 --- /dev/null +++ b/doc/doc++/osgUtil/SmoothingVisitor.html @@ -0,0 +1,67 @@ + + + + + class OSGUTIL_EXPORT osgUtil::SmoothingVisitor + + + + +

class OSGUTIL_EXPORT osgUtil::SmoothingVisitor

A smoothing visitor for calculating smoothed normals for osg::GeoSet's which contains surface primitives
+
+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Methods

+[more] SmoothingVisitor() +
default to traversing all children +
+[more]static void smooth(osg::GeoSet& geoset) +
smooth geoset by creating per vertex normals +
+[more]virtual void apply(osg::Geode& geode) +
apply smoothing method to all geode geosets +

+ +
+ + +
+

Documentation

+
A smoothing visitor for calculating smoothed normals for +osg::GeoSet's which contains surface primitives
+
+ + + +
o SmoothingVisitor() +
default to traversing all children +

+ + +

ostatic void smooth(osg::GeoSet& geoset) +
smooth geoset by creating per vertex normals +

+ + +

ovirtual void apply(osg::Geode& geode) +
apply smoothing method to all geode geosets +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgUtil/StateSetManipulator.html b/doc/doc++/osgUtil/StateSetManipulator.html new file mode 100644 index 000000000..528b1b36c --- /dev/null +++ b/doc/doc++/osgUtil/StateSetManipulator.html @@ -0,0 +1,114 @@ + + + + + class OSGUTIL_EXPORT osgUtil::StateSetManipulator + + + + +

class OSGUTIL_EXPORT osgUtil::StateSetManipulator


+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Methods

+[more] StateSetManipulator() +
+[more]virtual ~StateSetManipulator() +
+[more]virtual void setStateSet(osg::StateSet*) +
attach a geostate to the manipulator to be used for specifying view +
+[more]virtual osg::StateSet* getStateSet() +
get the attached a geostate +
+[more]virtual const osg::StateSet* getStateSet() const +
get the attached a geostate +
+[more]virtual bool handle(const GUIEventAdapter& ea, GUIActionAdapter& us) +
Handle events, return true if handled, false otherwise +

+ +

+

Protected Fields

+[more]osg::ref_ptr<osg::StateSet> _drawState +
+[more]bool _backface +
+[more]bool _lighting +
+[more]bool _texture +

+ +
+

Inherited from GUIEventHandler:

+
+
+ + +
+

Documentation

+
+ + + +
o StateSetManipulator() +

+ + +

ovirtual ~StateSetManipulator() +

+ + +

ovirtual void setStateSet(osg::StateSet*) +
attach a geostate to the manipulator to be used for specifying view +

+ + +

ovirtual osg::StateSet* getStateSet() +
get the attached a geostate +

+ + +

ovirtual const osg::StateSet* getStateSet() const +
get the attached a geostate +

+ + +

ovirtual bool handle(const GUIEventAdapter& ea, GUIActionAdapter& us) +
Handle events, return true if handled, false otherwise +

+ + +

oosg::ref_ptr<osg::StateSet> _drawState +

+ + +

obool _backface +

+ + +

obool _lighting +

+ + +

obool _texture +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgUtil/Statistics.html b/doc/doc++/osgUtil/Statistics.html new file mode 100644 index 000000000..556b29593 --- /dev/null +++ b/doc/doc++/osgUtil/Statistics.html @@ -0,0 +1,143 @@ + + + + + class OSGUTIL_EXPORT osgUtil::Statistics + + + + +

class OSGUTIL_EXPORT osgUtil::Statistics

Statistics base class.
+
+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Fields

+[more]int numOpaque +
+[more]int nummat +
+[more]int nbins +
+[more]int nprims +
+[more]int nlights +
+[more]int numprimtypes[20] +
+[more]int primtypes[20] +
+[more]int primlens[20] +
+[more]int primverts[20] +

+ +

+

Public Methods

+[more] Statistics() +
+[more] ~Statistics() +
+[more]void reset() +
+[more]virtual osg::Object* clone() const +
+[more]virtual bool isSameKindAs(const osg::Object* obj) const +
+[more]virtual const char* className() const +
+[more]void addstat(osg::GeoSet* gs) +

+ +
+ + +
+

Documentation

+
+Statistics base class. Used to extract primitive information from +the renderBin(s).
+
+ + + +
o Statistics() +

+ + +

o ~Statistics() +

+ + +

ovoid reset() +

+ + +

ovirtual osg::Object* clone() const +

+ + +

ovirtual bool isSameKindAs(const osg::Object* obj) const +

+ + +

ovirtual const char* className() const +

+ + +

ovoid addstat(osg::GeoSet* gs) +

+ + +

oint numOpaque +

+ + +

oint nummat +

+ + +

oint nbins +

+ + +

oint nprims +

+ + +

oint nlights +

+ + +

oint numprimtypes[20] +

+ + +

oint primtypes[20] +

+ + +

oint primlens[20] +

+ + +

oint primverts[20] +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgUtil/Tesselator.html b/doc/doc++/osgUtil/Tesselator.html new file mode 100644 index 000000000..3abba4cc1 --- /dev/null +++ b/doc/doc++/osgUtil/Tesselator.html @@ -0,0 +1,193 @@ + + + + + class OSGUTIL_EXPORT osgUtil::Tesselator + + + + +

class OSGUTIL_EXPORT osgUtil::Tesselator

A simple class for tesselating a single polygon boundary.
+
+ +
+

+

Public Fields

+[more]int _errorCode +

+ +

+

Public Methods

+[more] Tesselator() +
+[more] ~Tesselator() +
+[more]void tesselate(osg::Vec3* coords, int numIndices, int* indices, InputBoundaryDirection ibd=COUNTER_CLOCK_WISE) +
+[more]void tesselate(osg::Vec3* coords, int numIndices, osg::ushort* indices, InputBoundaryDirection ibd=COUNTER_CLOCK_WISE) +
+[more]void tesselate(osg::Vec3* coords, int numIndices, osg::uint* indices, InputBoundaryDirection ibd=COUNTER_CLOCK_WISE) +
+[more]typedef std::vector<osg::uint> IndexVec const IndexVec& getResult() const +
+[more]void beginPrimitive(int primitiveType) +
+[more]void endPrimitive() +

+ +

+

Public Members

+[more]enum InputBoundaryDirection +
+[more]struct VertexIndexSet +

+ +

+

Protected Fields

+[more]CoordVec _coordVec +
+[more]IndexVec _tesselated_indices +
+[more]int _currentPrimtiveType +
+[more]IndexVec _acummulated_indices +

+ +

+

Protected Methods

+[more]typedef std::vector<VertexIndexSet> CoordVec void init() +
+[more]void do_it() +

+ +
+ + +
+

Documentation

+
A simple class for tesselating a single polygon boundary. +Currently uses old style glu tesselation functions for portablity. +It be nice to use the modern glu tesselation functions or to find +a small set of code for doing this job better.
+
+ + + +
o Tesselator() +

+ + +

o ~Tesselator() +

+ + +

oenum InputBoundaryDirection +

+ + + +
o CLOCK_WISE +

+ + +

o COUNTER_CLOCK_WISE +

+ + + +
ovoid tesselate(osg::Vec3* coords, int numIndices, int* indices, InputBoundaryDirection ibd=COUNTER_CLOCK_WISE) +

+ + +

ovoid tesselate(osg::Vec3* coords, int numIndices, osg::ushort* indices, InputBoundaryDirection ibd=COUNTER_CLOCK_WISE) +

+ + +

ovoid tesselate(osg::Vec3* coords, int numIndices, osg::uint* indices, InputBoundaryDirection ibd=COUNTER_CLOCK_WISE) +

+ + +

otypedef std::vector<osg::uint> IndexVec const IndexVec& getResult() const +

+ + +

ovoid beginPrimitive(int primitiveType) +

+ + +

ovoid endPrimitive() +

+ + +

oint _errorCode +

+ + +

ostruct VertexIndexSet +

+ + + +
o VertexIndexSet(Tesselator* tess, const osg::Vec3& vec, osg::uint index) +

+ + +

o VertexIndexSet(const VertexIndexSet& vip) +

+ + +

oVertexIndexSet& operator = (const VertexIndexSet& vip) +

+ + +

ovoid set(Tesselator* tess, const osg::Vec3& vec, osg::uint index) +

+ + +

ovoid accumulate() +

+ + +

odouble _vertex[3] +

+ + +

oTesselator* _Tesselator +

+ + +

oosg::uint _index +

+ + + +
otypedef std::vector<VertexIndexSet> CoordVec void init() +

+ + +

ovoid do_it() +

+ + +

oCoordVec _coordVec +

+ + +

oIndexVec _tesselated_indices +

+ + +

oint _currentPrimtiveType +

+ + +

oIndexVec _acummulated_indices +

+ +
This class has no child classes.
+ +
Friends:
VertexIndexSet

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgUtil/TrackballManipulator.html b/doc/doc++/osgUtil/TrackballManipulator.html new file mode 100644 index 000000000..e5a59f8c3 --- /dev/null +++ b/doc/doc++/osgUtil/TrackballManipulator.html @@ -0,0 +1,114 @@ + + + + + class OSGUTIL_EXPORT osgUtil::TrackballManipulator + + + + +

class OSGUTIL_EXPORT osgUtil::TrackballManipulator


+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Methods

+[more] TrackballManipulator() +
+[more]virtual ~TrackballManipulator() +
+[more]virtual void setNode(osg::Node*) +
Attach a node to the manipulator. +
+[more]virtual const osg::Node* getNode() const +
Return node if attached +
+[more]virtual void home(const GUIEventAdapter& ea, GUIActionAdapter& us) +
Move the camera to the default position. +
+[more]virtual void init(const GUIEventAdapter& ea, GUIActionAdapter& us) +
Start/restart the manipulator +
+[more]virtual bool handle(const GUIEventAdapter& ea, GUIActionAdapter& us) +
handle events, return true if handled, false otherwise +

+ +
+

Inherited from CameraManipulator:

+
+

+

Public Methods

+ovirtual void setCamera(osg::Camera*) +
+ovirtual const osg::Camera* getCamera() const +

+ +

+

Protected Fields

+oosg::ref_ptr<osg::Camera> _camera +

+ +
+

Inherited from GUIEventHandler:

+
+
+ + +
+

Documentation

+
+ + + +
o TrackballManipulator() +

+ + +

ovirtual ~TrackballManipulator() +

+ + +

ovirtual void setNode(osg::Node*) +
Attach a node to the manipulator. +Automatically detaches previously attached node. +setNode(NULL) detaches previously nodes. +Is ignored by manipulators which do not require a reference model. +

+ + +

ovirtual const osg::Node* getNode() const +
Return node if attached +

+ + +

ovirtual void home(const GUIEventAdapter& ea, GUIActionAdapter& us) +
Move the camera to the default position. +May be ignored by manipulators if home functionality is not appropriate. +

+ + +

ovirtual void init(const GUIEventAdapter& ea, GUIActionAdapter& us) +
Start/restart the manipulator +

+ + +

ovirtual bool handle(const GUIEventAdapter& ea, GUIActionAdapter& us) +
handle events, return true if handled, false otherwise +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgUtil/TriStripVisitor.html b/doc/doc++/osgUtil/TriStripVisitor.html new file mode 100644 index 000000000..f8c5458bc --- /dev/null +++ b/doc/doc++/osgUtil/TriStripVisitor.html @@ -0,0 +1,69 @@ + + + + + class OSGUTIL_EXPORT osgUtil::TriStripVisitor + + + + +

class OSGUTIL_EXPORT osgUtil::TriStripVisitor

A tri stripping visitor for converting GeoSet primitives into tri strips.
+
+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Methods

+[more] TriStripVisitor() +
default to traversing all children +
+[more]static void stripify(osg::GeoSet& gset) +
convert mesh primitives in geoset into Tri Strips using NvTriStrip. +
+[more]virtual void apply(osg::Geode& geode) +
apply stripify method to all geode geosets +

+ +
+ + +
+

Documentation

+
A tri stripping visitor for converting GeoSet primitives into tri strips. +The current implemention is based up NVidia's NvTriStrip.
+
+ + + +
o TriStripVisitor() +
default to traversing all children +

+ + +

ostatic void stripify(osg::GeoSet& gset) +
convert mesh primitives in geoset into Tri Strips using +NvTriStrip. Converts all primtive types except points +and lines, linestrips which it leaves unchanged. +

+ + +

ovirtual void apply(osg::Geode& geode) +
apply stripify method to all geode geosets +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgUtil/VisualsRequirementsVisitor.html b/doc/doc++/osgUtil/VisualsRequirementsVisitor.html new file mode 100644 index 000000000..a8e6fa87d --- /dev/null +++ b/doc/doc++/osgUtil/VisualsRequirementsVisitor.html @@ -0,0 +1,184 @@ + + + + + class OSGUTIL_EXPORT osgUtil::VisualsRequirementsVisitor + + + + +

class OSGUTIL_EXPORT osgUtil::VisualsRequirementsVisitor

A visitor for traversing a scene graph establishing the OpenGL visuals are required to support rendering of that scene graph.
+
+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Methods

+[more] VisualsRequirementsVisitor() +
Default to traversing all children, and reqiresDoubleBuffer, requiresRGB and requiresDepthBuffer to true and with alpha and stencil off +
+[more]void setRequiresDoubleBuffer(const bool flag) +
+[more]const bool requiresDoubleBuffer() const +
+[more]void setRequiresRGB(const bool flag) +
+[more]const bool requiresRGB() const +
+[more]void setRequiresDepthBuffer(const bool flag) +
+[more]const bool requiresDepthBuffer() const +
+[more]void setMinumumNumAlphaBits(const unsigned int bits) +
+[more]const unsigned int getMinumumNumAlphaBits() const +
+[more]const bool requiresAlphaBuffer() const +
+[more]void setMinumumNumStencilBits(const unsigned int bits) +
+[more]const unsigned int getMinumumNumStencilBits() const +
+[more]const bool requiresStencilBuffer() const +
+[more]virtual void applyStateSet(osg::StateSet& stateset) +
+[more]virtual void apply(osg::Node& node) +
+[more]virtual void apply(osg::Geode& geode) +
+[more]virtual void apply(osg::Impostor& impostor) +

+ +

+

Protected Fields

+[more]bool _requiresDoubleBuffer +
+[more]bool _requiresRBG +
+[more]bool _requiresDepthBuffer +
+[more]unsigned int _minimumNumberAlphaBits +
+[more]unsigned int _minimumNumberStencilBits +

+ +
+ + +
+

Documentation

+
A visitor for traversing a scene graph establishing the OpenGL visuals are required +to support rendering of that scene graph. The results can then be used by +applications to set up there windows with the corret visuals. Have a look at +src/osgGLUT/Viewer.cpp's Viewer::open() method for an example how to use it.
+
+ + + +
o VisualsRequirementsVisitor() +
Default to traversing all children, and reqiresDoubleBuffer, +requiresRGB and requiresDepthBuffer to true and with +alpha and stencil off +

+ + +

ovoid setRequiresDoubleBuffer(const bool flag) +

+ + +

oconst bool requiresDoubleBuffer() const +

+ + +

ovoid setRequiresRGB(const bool flag) +

+ + +

oconst bool requiresRGB() const +

+ + +

ovoid setRequiresDepthBuffer(const bool flag) +

+ + +

oconst bool requiresDepthBuffer() const +

+ + +

ovoid setMinumumNumAlphaBits(const unsigned int bits) +

+ + +

oconst unsigned int getMinumumNumAlphaBits() const +

+ + +

oconst bool requiresAlphaBuffer() const +

+ + +

ovoid setMinumumNumStencilBits(const unsigned int bits) +

+ + +

oconst unsigned int getMinumumNumStencilBits() const +

+ + +

oconst bool requiresStencilBuffer() const +

+ + +

ovirtual void applyStateSet(osg::StateSet& stateset) +

+ + +

ovirtual void apply(osg::Node& node) +

+ + +

ovirtual void apply(osg::Geode& geode) +

+ + +

ovirtual void apply(osg::Impostor& impostor) +

+ + +

obool _requiresDoubleBuffer +

+ + +

obool _requiresRBG +

+ + +

obool _requiresDepthBuffer +

+ + +

ounsigned int _minimumNumberAlphaBits +

+ + +

ounsigned int _minimumNumberStencilBits +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgUtil/icon1.gif b/doc/doc++/osgUtil/icon1.gif new file mode 100644 index 000000000..f78f30eb9 Binary files /dev/null and b/doc/doc++/osgUtil/icon1.gif differ diff --git a/doc/doc++/osgUtil/icon2.gif b/doc/doc++/osgUtil/icon2.gif new file mode 100644 index 000000000..6cbe01a83 Binary files /dev/null and b/doc/doc++/osgUtil/icon2.gif differ diff --git a/doc/doc++/osgUtil/index.html b/doc/doc++/osgUtil/index.html new file mode 100644 index 000000000..38d32ebc8 --- /dev/null +++ b/doc/doc++/osgUtil/index.html @@ -0,0 +1,62 @@ + + + + + Table of Contents + + + + +

Table of Contents

+

Namespaces

+ +

Functions

+ +

Macros

+ +

Hierarchy of classes


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgUtil/osgUtil.html b/doc/doc++/osgUtil/osgUtil.html new file mode 100644 index 000000000..646c787f0 --- /dev/null +++ b/doc/doc++/osgUtil/osgUtil.html @@ -0,0 +1,104 @@ + + + + + namespace osgUtil + + + + +

namespace osgUtil

+
+

+
+class OSGUTIL_EXPORT CameraManipulator: public GUIEventHandler +
+class OSGUTIL_EXPORT CullViewState: public osg::Referenced +
Container class for encapsulating the viewing state in local coordinates, during the cull traversal +
+class OSGUTIL_EXPORT CullVisitor: public osg::NodeVisitor +
Basic NodeVisitor implementation for rendering a scene. +
+class OSGUTIL_EXPORT DepthSortedBin: public RenderBin +
+class OSGUTIL_EXPORT DisplayListVisitor: public osg::NodeVisitor +
Visitor for traversing scene graph and setting each osg::GeoSet's _useDisplayList flag, with option to immediately compile osg::GeoSet's OpenGL Display lists. +
+class OSGUTIL_EXPORT DriveManipulator: public CameraManipulator +
+class OSGUTIL_EXPORT FlightManipulator: public CameraManipulator +
+class GUIActionAdapter +
Pure virtual base class for adapting the GUI actions requested by CameraManipulators into actions which are handled by the GUI toolkit of the users application. +
+class GUIEventAdapter: public osg::Referenced +
Pure virtual base class for adapting platform specific events into generic keyboard and mouse events. +
+class OSGUTIL_EXPORT GUIEventHandler: public osg::Referenced +
+class OSGUTIL_EXPORT InsertImpostorsVisitor: public osg::NodeVisitor +
Insert impostor nodes into scene graph. +
+class OSGUTIL_EXPORT IntersectState: public osg::Referenced +
+class OSGUTIL_EXPORT Hit: public osg::Referenced +
+class OSGUTIL_EXPORT IntersectVisitor: public osg::NodeVisitor +
Basic visitor for ray based collisions of a scene. +
+class OSGUTIL_EXPORT RenderBin: public osg::Object +
RenderBin base class +
+template<class T> class RegisterRenderBinProxy +
Proxy class for automatic registration of renderbins with the RenderBin prototypelist +
+class OSGUTIL_EXPORT RenderGraph: public osg::Referenced +
+class OSGUTIL_EXPORT RenderLeaf: public osg::Referenced +
container class for all data required for rendering of drawables +
+class OSGUTIL_EXPORT RenderStage: public RenderBin +
RenderState base class. +
+class OSGUTIL_EXPORT RenderStageLighting: public osg::Object +
RenderBin base class +
+class OSGUTIL_EXPORT RenderToTextureStage: public RenderStage +
RenderBin base class +
+class OSGUTIL_EXPORT SceneView: public osg::Referenced +
SceneView is literaly a view of a scene, encapsulating the camera, global state, lights and the scene itself. +
+class OSGUTIL_EXPORT SceneViewManipulator: public GUIEventHandler +
+class OSGUTIL_EXPORT SmoothingVisitor: public osg::NodeVisitor +
A smoothing visitor for calculating smoothed normals for osg::GeoSet's which contains surface primitives +
+class OSGUTIL_EXPORT StateSetManipulator: public GUIEventHandler +
+class OSGUTIL_EXPORT Statistics: public osg::Object +
Statistics base class. +
+class OSGUTIL_EXPORT Tesselator +
A simple class for tesselating a single polygon boundary. +
+class OSGUTIL_EXPORT TrackballManipulator: public CameraManipulator +
+class OSGUTIL_EXPORT TriStripVisitor: public osg::NodeVisitor +
A tri stripping visitor for converting GeoSet primitives into tri strips. +
+class OSGUTIL_EXPORT VisualsRequirementsVisitor: public osg::NodeVisitor +
A visitor for traversing a scene graph establishing the OpenGL visuals are required to support rendering of that scene graph. +

+ + + +
+

Documentation

+
+
+

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgUtil/osgUtilGetLibraryName.html b/doc/doc++/osgUtil/osgUtilGetLibraryName.html new file mode 100644 index 000000000..8c62bd4f1 --- /dev/null +++ b/doc/doc++/osgUtil/osgUtilGetLibraryName.html @@ -0,0 +1,21 @@ + + + + + extern OSGUTIL_EXPORT const char* osgUtilGetLibraryName + + + + +

extern OSGUTIL_EXPORT const char* osgUtilGetLibraryName

()

getLibraryName_osgUtil() returns the library name in human friendly form
+ + +
+

Documentation

+
+getLibraryName_osgUtil() returns the library name in human friendly form
+

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgUtil/osgUtilGetVersion.html b/doc/doc++/osgUtil/osgUtilGetVersion.html new file mode 100644 index 000000000..45b1d7c2b --- /dev/null +++ b/doc/doc++/osgUtil/osgUtilGetVersion.html @@ -0,0 +1,34 @@ + + + + + extern OSGUTIL_EXPORT const char* osgUtilGetVersion + + + + +

extern OSGUTIL_EXPORT const char* osgUtilGetVersion

()

getVersion_osgUtil() returns the library version number.
+ + +
+

Documentation

+
+getVersion_osgUtil() returns the library version number. +Numbering conventon : osg_src-0.8-31 will return 0.8.31 from getVersion_osgUtil. + +

This C function can be also used to check for the existance of the OpenSceneGraph +library using autoconf and its m4 macro AC_CHECK_LIB. + +

Here is the code to add to your configure.in: +\verbatim +# +# Check for the OpenSceneGraph (OSG) utility library +# +AC_CHECK_LIB(osg, osgUtilGetVersion, , +[AC_MSG_ERROR(OpenSceneGraph utility library not found. See http://www.openscenegraph.org)],) +\endverbatim

+

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgWX/ClassGraph.class b/doc/doc++/osgWX/ClassGraph.class new file mode 100644 index 000000000..c6a7b6c79 Binary files /dev/null and b/doc/doc++/osgWX/ClassGraph.class differ diff --git a/doc/doc++/osgWX/ClassGraphPanel.class b/doc/doc++/osgWX/ClassGraphPanel.class new file mode 100644 index 000000000..94b21b47a Binary files /dev/null and b/doc/doc++/osgWX/ClassGraphPanel.class differ diff --git a/doc/doc++/osgWX/ClassLayout.class b/doc/doc++/osgWX/ClassLayout.class new file mode 100644 index 000000000..77fb9fa28 Binary files /dev/null and b/doc/doc++/osgWX/ClassLayout.class differ diff --git a/doc/doc++/osgWX/General.html b/doc/doc++/osgWX/General.html new file mode 100644 index 000000000..fb26724e1 --- /dev/null +++ b/doc/doc++/osgWX/General.html @@ -0,0 +1,34 @@ + + + + + General Bits + + + + +
+
+ +o#define +OSGWX_EXPORT_
+ +o#define +OSGWX_EXPORT(dllexport)
+ +o#define +OSGWX_EXPORT(dllimport)
+ +o#define +OSGWX_EXPORT
+ +o#define +OSGWX_VERSION
+ +o#define +OSGWX_WXEVENTADAPTER
+

Alphabetic index Hierarchy of classes


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgWX/HIER.html b/doc/doc++/osgWX/HIER.html new file mode 100644 index 000000000..94540c4fa --- /dev/null +++ b/doc/doc++/osgWX/HIER.html @@ -0,0 +1,17 @@ + + + + + Hierarchy of Classes + + + +

Hierarchy of Classes

+ +

Alphabetic index


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgWX/HIERjava.html b/doc/doc++/osgWX/HIERjava.html new file mode 100644 index 000000000..d23b2dd9d --- /dev/null +++ b/doc/doc++/osgWX/HIERjava.html @@ -0,0 +1,23 @@ + + + + + Hierarchy of Classes + + + +

Hierarchy of classes

+
    + + + + + + + +
+ alphabetic index


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgWX/NavigatorButton.class b/doc/doc++/osgWX/NavigatorButton.class new file mode 100644 index 000000000..5fa134ee0 Binary files /dev/null and b/doc/doc++/osgWX/NavigatorButton.class differ diff --git a/doc/doc++/osgWX/WXEventAdapter.html b/doc/doc++/osgWX/WXEventAdapter.html new file mode 100644 index 000000000..354eb03a9 --- /dev/null +++ b/doc/doc++/osgWX/WXEventAdapter.html @@ -0,0 +1,324 @@ + + + + + class OSGWX_EXPORT osgWX::WXEventAdapter + + + + +

class OSGWX_EXPORT osgWX::WXEventAdapter

Class for adapting WX events so that they can be used as input to osgUtil::CameraManipulators
+
+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Methods

+[more] WXEventAdapter() +
+[more]virtual ~WXEventAdapter() +
+[more]virtual EventType getEventType() const +
Get the EventType of the GUI event +
+[more]virtual int getKey() const +
key pressed, return -1 if inapropriate for this event. +
+[more]virtual int getButton() const +
button pressed/released, return -1 if inappropriate for this event +
+[more]virtual int getXmin() const +
window minimum x. +
+[more]virtual int getXmax() const +
window maximum x. +
+[more]virtual int getYmin() const +
window minimum y. +
+[more]virtual int getYmax() const +
window maximum y. +
+[more]virtual int getX() const +
current mouse x position +
+[more]virtual int getY() const +
current mouse y position +
+[more]virtual unsigned int getButtonMask() const +
current mouse button state +
+[more]virtual float time() const +
time in seconds of event. +
+[more]static void setWindowSize(int Xmin, int Ymin, int Xmax, int Ymax) +
static method for setting window dimensions +
+[more]static void setButtonMask(unsigned int buttonMask) +
static method for setting button state +
+[more]void adaptResize(float t, int Xmin, int Ymin, int Xmax, int Ymax) +
method for adapting resize events. +
+[more]void adaptMouseMotion(float t, int x, int y) +
method for adapting mouse motion events whilst mouse buttons are pressed +
+[more]void adaptMousePassiveMotion(float t, int x, int y) +
method for adapting mouse motion events whilst no mouse button are pressed +
+[more]void adaptMouse(float t, class wxMouseEvent* event) +
method for adapting mouse button pressed/released events +
+[more]void adaptKeyboard(float t, unsigned char key, int x, int y ) +
method for adapting keyboard events +
+[more]void adaptFrame(float t) +
method for adapting frame events, ie. +
+[more]void copyStaticVariables() +

+ +

+

Protected Fields

+[more]EventType _eventType +
+[more]int _key +
+[more]int _button +
+[more]int _Xmin +
+[more]int _Xmax +
+[more]int _Ymin +
+[more]int _Ymax +
+[more]int _mx +
+[more]int _my +
+[more]unsigned int _buttonMask +
+[more]float _time +
+[more]static unsigned int _s_accumulatedButtonMask +
+[more]static int _s_Xmin +
+[more]static int _s_Xmax +
+[more]static int _s_Ymin +
+[more]static int _s_Ymax +
+[more]static int _s_mx +
+[more]static int _s_my +

+ +
+ + +
+

Documentation

+
Class for adapting WX events so that they can be used as input to +osgUtil::CameraManipulators
+
+ + + +
o WXEventAdapter() +

+ + +

ovirtual ~WXEventAdapter() +

+ + +

ovirtual EventType getEventType() const +
Get the EventType of the GUI event +

+ + +

ovirtual int getKey() const +
key pressed, return -1 if inapropriate for this event. +

+ + +

ovirtual int getButton() const +
button pressed/released, return -1 if inappropriate for this event +

+ + +

ovirtual int getXmin() const +
window minimum x. +

+ + +

ovirtual int getXmax() const +
window maximum x. +

+ + +

ovirtual int getYmin() const +
window minimum y. +

+ + +

ovirtual int getYmax() const +
window maximum y. +

+ + +

ovirtual int getX() const +
current mouse x position +

+ + +

ovirtual int getY() const +
current mouse y position +

+ + +

ovirtual unsigned int getButtonMask() const +
current mouse button state +

+ + +

ovirtual float time() const +
time in seconds of event. +

+ + +

ostatic void setWindowSize(int Xmin, int Ymin, int Xmax, int Ymax) +
static method for setting window dimensions +

+ + +

ostatic void setButtonMask(unsigned int buttonMask) +
static method for setting button state +

+ + +

ovoid adaptResize(float t, int Xmin, int Ymin, int Xmax, int Ymax) +
method for adapting resize events. +

+ + +

ovoid adaptMouseMotion(float t, int x, int y) +
method for adapting mouse motion events whilst mouse buttons are pressed +

+ + +

ovoid adaptMousePassiveMotion(float t, int x, int y) +
method for adapting mouse motion events whilst no mouse button are pressed +

+ + +

ovoid adaptMouse(float t, class wxMouseEvent* event) +
method for adapting mouse button pressed/released events +

+ + +

ovoid adaptKeyboard(float t, unsigned char key, int x, int y ) +
method for adapting keyboard events +

+ + +

ovoid adaptFrame(float t) +
method for adapting frame events, ie. iddle/display callback. +

+ + +

ovoid copyStaticVariables() +

+ + +

oEventType _eventType +

+ + +

oint _key +

+ + +

oint _button +

+ + +

oint _Xmin +

+ + +

oint _Xmax +

+ + +

oint _Ymin +

+ + +

oint _Ymax +

+ + +

oint _mx +

+ + +

oint _my +

+ + +

ounsigned int _buttonMask +

+ + +

ofloat _time +

+ + +

ostatic unsigned int _s_accumulatedButtonMask +

+ + +

ostatic int _s_Xmin +

+ + +

ostatic int _s_Xmax +

+ + +

ostatic int _s_Ymin +

+ + +

ostatic int _s_Ymax +

+ + +

ostatic int _s_mx +

+ + +

ostatic int _s_my +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgWX/icon1.gif b/doc/doc++/osgWX/icon1.gif new file mode 100644 index 000000000..f78f30eb9 Binary files /dev/null and b/doc/doc++/osgWX/icon1.gif differ diff --git a/doc/doc++/osgWX/icon2.gif b/doc/doc++/osgWX/icon2.gif new file mode 100644 index 000000000..6cbe01a83 Binary files /dev/null and b/doc/doc++/osgWX/icon2.gif differ diff --git a/doc/doc++/osgWX/index.html b/doc/doc++/osgWX/index.html new file mode 100644 index 000000000..0d5fe30b7 --- /dev/null +++ b/doc/doc++/osgWX/index.html @@ -0,0 +1,36 @@ + + + + + Table of Contents + + + + +

Table of Contents

+

Namespaces

+ +

Functions

+ +

Macros

+ +

Hierarchy of classes


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgWX/osgWX.html b/doc/doc++/osgWX/osgWX.html new file mode 100644 index 000000000..89b194264 --- /dev/null +++ b/doc/doc++/osgWX/osgWX.html @@ -0,0 +1,28 @@ + + + + + namespace osgWX + + + + +

namespace osgWX

+
+

+
+class OSGWX_EXPORT WXEventAdapter: public osgUtil::GUIEventAdapter +
Class for adapting WX events so that they can be used as input to osgUtil::CameraManipulators +

+ + + +
+

Documentation

+
+
+

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgWX/osgWXGetLibraryName.html b/doc/doc++/osgWX/osgWXGetLibraryName.html new file mode 100644 index 000000000..3625b64f5 --- /dev/null +++ b/doc/doc++/osgWX/osgWXGetLibraryName.html @@ -0,0 +1,21 @@ + + + + + extern OSGWX_EXPORT const char* osgWXGetLibraryName + + + + +

extern OSGWX_EXPORT const char* osgWXGetLibraryName

()

getLibraryName_osgWX() returns the library name in human friendly form
+ + +
+

Documentation

+
+getLibraryName_osgWX() returns the library name in human friendly form
+

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osgWX/osgWXGetVersion.html b/doc/doc++/osgWX/osgWXGetVersion.html new file mode 100644 index 000000000..1c92e910a --- /dev/null +++ b/doc/doc++/osgWX/osgWXGetVersion.html @@ -0,0 +1,34 @@ + + + + + extern OSGWX_EXPORT const char* osgWXGetVersion + + + + +

extern OSGWX_EXPORT const char* osgWXGetVersion

()

osgWXGetVersion() returns the library version number.
+ + +
+

Documentation

+
+osgWXGetVersion() returns the library version number. +Numbering conventon : osg_src-0.8.31 will return 0.8.31. + +

This C function can be also used to check for the existance of the OpenSceneGraph +library using autoconf and its m4 macro AC_CHECK_LIB. + +

Here is the code to add to your configure.in: +\verbatim +# +# Check for the OpenSceneGraph (OSG) WX library +# +AC_CHECK_LIB(osg, osgWXGetVersion, , +[AC_MSG_ERROR(OpenSceneGraph WX library not found. See http://www.openscenegraph.org)],) +\endverbatim

+

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/sgv.html b/doc/sgv.html new file mode 100644 index 000000000..641fd193f --- /dev/null +++ b/doc/sgv.html @@ -0,0 +1,267 @@ + + + + + + + + +
 
+ +
+

+Scene Graph Viewer (sgv) keyboard bindings:

+ +


+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
KeyBinding
+
'1'
+
Select the trackball camera manipulator. +
Left mouse button - rotate, +
Middle (or Left & Right) mouse button - pan, +
Right mouse button - zoom.
+
+
'2'
+
Select the flight camera manipulator. +
Left mouse button - speed up, +
Middle (or Left & Right) mouse button - stop, +
Right mouse button - slow down, reverse. +
Move mouse left to roll left, right to roll right. +
Move mouse back (down) to pitch nose up, forward to pitch down. +
In mode Q, the default, selected by pressing 'q' +
The flight path is yawed automatically into the turn to produce +a similar effect as flying an aircaft.
+In mode A, selected by pressing 'a' +
The flight path is not yawed automatically into the turn, producing +a similar effect as space/marine flight.
+
+
+
'3'
+
Select the drive camera manipulator. +
  +
In mode Q, the default, selected by pressing 'q'
+ +
+
Move mouse left to turn left, right to turn right. +
Move mouse back (down) to reverse, forward to drive forward.
+In mode A, selected by pressing 'a' +
Move mouse left to turn left, right to turn right. +
Left mouse button - speed up, +
Middle (or Left & Right) mouse button - stop, +
Right mouse button - slow down, reverse.
+
+
+
'+'
+
Half the frame delay which speeds up the frame rate on Linux and +
Windows.
+
'-'
+
Double the frame delay and therefore reduce the frame rate on Linux +and Windows.
+
'/'
+
Divide the Level-Of-Detail (LOD) bias by 1.5, to encourage the selection +of more complex LOD children.
+
'*'
+
Multiple the Level-of-Detail (LOD) bias by 1.5, to encourage the +
selection of less complex LOD children.
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
'c' 
+
Toggle Small Feature Culling on or off.
+
'C'
+
Toggle View Frustum Culling on or off.
+
'd'
+
Toggle use of OpenGL's display lists.
+
'b'
+
Toggle OpenGL's backface culling.
+
't'
+
Toggle OpenGL texturing on or off.
+
'T'
+
Toggle OpenGL two-sided lighting on or off.
+
'l'
+
Toggle OpenGL lighting on or off.
+
'L'
+
Toggle SceneView lighting mode between HEADLIGHT, SKY_LIGHT and NO_SCENEVIEW_LIGHT.
+
's'
+
Toggle OpenGL shade model between flat and smooth shading.
+
'w'
+
Toggle OpenGL polygon mode between solid, wireframe and points modes.
+
'i'
+
Calculate and report the intersections with the scene under thecurrent +mouse x and mouse y position.
+
'r'
+
Calculate and report the intersections with the scene under the currentmouse +x and mouse y position and delete the nearest interesected geoset.
+
'p'
+
Print frame rate statistics on each frame.
+
'o'
+
Output the loaded scene to 'saved_model.osg'.
+
'?'/'h'
+
Print out sgv's keyboard bindings.
+
'f'
+
+
Toggle between fullscreen and the previous window size. Note GLUT +fullscreen works properly on Windows and Irix, but on Linux it just maximizes +the window and leaves the window's borders.
+
+
Space
+
Reset scene to the default view.
+
Esc 
+
  Exit sgv.
+ + + diff --git a/include/osg/BoundsChecking b/include/osg/BoundsChecking new file mode 100644 index 000000000..6b98f3a7c --- /dev/null +++ b/include/osg/BoundsChecking @@ -0,0 +1,195 @@ +#ifndef OSG_BOUNDSCHECKING +#define OSG_BOUNDSCHECKING 1 + +#include + +namespace osg { + + +/** if value is greater than or equal to minValue do nothing - legal value, + * otherise clamp value to specified maximum value and return warning + * with valueName specifying which variable was clamped.*/ +template +inline void clampGEQUAL(T& value,const T minValue,const char* valueName) +{ + if (value +inline void clampLEQUAL(T& value,const T maxValue,const char* valueName) +{ + if (value>maxValue) + { + notify(WARN) << "Warning: "< +inline void clampBetweenRange(T& value,const T minValue,const T maxValue,const char* valueName) +{ + if (valuemaxValue) + { + notify(WARN) << "Warning: "< +inline void clampArrayElementGEQUAL(A& value,const unsigned int i,const T minValue,const char* valueName) +{ + if (value[i] +inline void clampArrayElementLEQUAL(A& value,const unsigned int i,const T maxValue,const char* valueName) +{ + if (value[i]>maxValue) + { + notify(WARN) << "Warning: "< +inline void clampArrayElementBetweenRange(A& value,const unsigned int i,const T minValue,const T maxValue,const char* valueName) +{ + if (value[i]maxValue) + { + notify(WARN) << "Warning: "< +inline void clampArrayElementsGEQUAL(A& value,const unsigned int first,const unsigned int last,const T minValue,const char* valueName) +{ + for(unsigned int i=first;i<=last;++i) + clampArrayElementGEQUAL(value,i,minValue,valueName); +} + +/** if array elements are less than or equal to maxValue do nothing - legal value, + * otherise clamp value to specified maximum value and return warning + * with valueName specifying which variable was clamped.*/ +template +inline void clampArrayElementsLEQUAL(A& value,const unsigned int first,const unsigned int last,const T maxValue,const char* valueName) +{ + for(unsigned int i=first;i<=last;++i) + clampArrayElementLEQUAL(value,i,maxValue,valueName); +} + +/** if array elements are between or equal to minValue and maxValue do nothing - legal value, + * otherise clamp value to specified to range and return warning + * with valueName specifying which variable was clamped. Equivilant to + * calling clampGEQUAL(value,minValue,valueName); clampLEQUAL(value,maxValue,valueName); */ +template +inline void clampArrayElementsBetweenRange(A& value,const unsigned int first,const 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); +} + + +/** if array4 elements are greater than or equal to minValue do nothing - legal value, + * otherise clamp value to specified maximum value and return warning + * with valueName specifying which variable was clamped.*/ +template +inline void clampArray3GEQUAL(A& value,const T minValue,const char* valueName) +{ + clampArrayElementsGEQUAL(value,0u,2u,minValue,valueName); +} + +/** if array4 elements are is less than or equal to maxValue do nothing - legal value, + * otherise clamp value to specified maximum value and return warning + * with valueName specifying which variable was clamped.*/ +template +inline void clampArray3LEQUAL(A& value,const T maxValue,const char* valueName) +{ + clampArrayElementsLEQUAL(value,0u,2u,maxValue,valueName); +} + +/** if array4 elements are between or equal to minValue and maxValue do nothing - legal value, + * otherise clamp value to specified to range and return warning + * with valueName specifying which variable was clamped. Equivilant to + * calling clampGEQUAL(value,minValue,valueName); clampLEQUAL(value,maxValue,valueName); */ +template +inline void clampArray3BetweenRange(A& value,const T minValue,const T maxValue,const char* valueName) +{ + clampArrayElementsBetweenRange(value,0u,2u,minValue,maxValue,valueName); +} + + + +/** if array4 elements are greater than or equal to minValue do nothing - legal value, + * otherise clamp value to specified maximum value and return warning + * with valueName specifying which variable was clamped.*/ +template +inline void clampArray4GEQUAL(A& value,const T minValue,const char* valueName) +{ + clampArrayElementsGEQUAL(value,0u,3u,minValue,valueName); +} + +/** if array4 elements are is less than or equal to maxValue do nothing - legal value, + * otherise clamp value to specified maximum value and return warning + * with valueName specifying which variable was clamped.*/ +template +inline void clampArray4LEQUAL(A& value,const unsigned int first,const unsigned int last,const T maxValue,const char* valueName) +{ + clampArrayElementsLEQUAL(value,0u,3u,maxValue,valueName); +} + +/** if array4 elements are between or equal to minValue and maxValue do nothing - legal value, + * otherise clamp value to specified to range and return warning + * with valueName specifying which variable was clamped. Equivilant to + * calling clampGEQUAL(value,minValue,valueName); clampLEQUAL(value,maxValue,valueName); */ +template +inline void clampArray4BetweenRange(A& value,const T minValue,const T maxValue,const char* valueName) +{ + clampArrayElementsBetweenRange(value,0u,3u,minValue,maxValue,valueName); +} + +}; + +#endif diff --git a/include/osg/ClipPlane b/include/osg/ClipPlane new file mode 100644 index 000000000..f892f9e0c --- /dev/null +++ b/include/osg/ClipPlane @@ -0,0 +1,72 @@ +#ifndef OSG_CLIPPLANE +#define OSG_CLIPPLANE 1 + +#include +#include +#include + +namespace osg { + +/** ClipPlane state class which encapsulates OpenGL glClipPlane() functionality.*/ +class SG_EXPORT ClipPlane : public StateAttribute +{ + public : + + ClipPlane(); + + /** return a shallow copy of a node, with Object* return type.*/ + virtual Object* clone() const { return new ClipPlane(); } + + /** return true if this and obj are of the same kind of object.*/ + virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast(obj)!=NULL; } + + /** return the name of the node's class type.*/ + virtual const char* className() const { return "ClipPlane"; } + + virtual const Type getType() const { return (Type)(CLIPPLANE+_clipPlaneNum); } + + virtual void setStateSetModes(StateSet& ds,const GLModeValue value) const + { + ds.setMode((GLMode)(GL_CLIP_PLANE0+_clipPlaneNum),value); + } + + + /** Set the clip plane, using a Vec4 to define plane. */ + void setClipPlane(const Vec4& plane); + + /** Set the clip plane, using a Plane to define plane. */ + void setClipPlane(const Plane& plane); + + /** Set the clip plane, using a double[4] to define plane. */ + void setClipPlane(const double* plane); + + /** Get the clip plane, values entered into a Vec4 passed to the getClipPlane. */ + void getClipPlane(Vec4& plane) const; + + /** Get the clip plane, values entered into a Plane passed to the getClipPlane. */ + void getClipPlane(Plane& plane) const; + + /** Get the clip plane, values entered into a double[4] passed to the getClipPlane. */ + void getClipPlane(double* plane) const; + + /** Set the clip plane number. */ + void setClipPlaneNum(const unsigned int num); + + /** Get the clip plane number. */ + const unsigned int getClipPlaneNum() const; + + /** Apply the clip plane's state to the OpenGL state machine. */ + virtual void apply(State& state) const; + + protected : + + virtual ~ClipPlane(); + + double* _clipPlane; + unsigned int _clipPlaneNum; + +}; + +}; + +#endif diff --git a/include/osg/ClippingVolume b/include/osg/ClippingVolume new file mode 100644 index 000000000..5edcfc959 --- /dev/null +++ b/include/osg/ClippingVolume @@ -0,0 +1,177 @@ +#ifndef OSG_CLIPPINGVOLUME +#define OSG_CLIPPINGVOLUME 1 + +#include + +#include + +namespace osg { + +/** A ClippingVolume class for represecting convex clipping volumes made up.*/ +class SG_EXPORT ClippingVolume +{ + + public: + + typedef std::vector PlaneList; + + inline ClippingVolume() {setupMask();} + + inline ClippingVolume(const ClippingVolume& cv) : _localMask(cv._localMask), _planeList(cv._planeList) {} + + inline ClippingVolume(const PlaneList& pl) : _planeList(pl) {setupMask();} + + inline ~ClippingVolume() {} + + inline void clear() { _planeList.clear(); setupMask(); } + + inline ClippingVolume& operator = (const ClippingVolume& cv) + { + if (&cv==this) return *this; + _localMask = cv._localMask; + _planeList = cv._planeList; + return *this; + } + + inline void set(const ClippingVolume& cs) { _planeList = cs._planeList; setupMask(); } + + inline void set(const PlaneList& pl) { _planeList = pl; setupMask(); } + + inline void add(const osg::Plane& pl) { _planeList.push_back(pl); setupMask(); } + + inline PlaneList& getPlaneList() { return _planeList; } + + inline const PlaneList& getPlaneList() const { return _planeList; } + + inline void setupMask() + { + _localMask = 0; + for(unsigned int i=0;i<_planeList.size();++i) + { + _localMask = (_localMask<<1) | 1; + } + } + + + /** Check whether a vertex is contained with clipping set.*/ + inline const bool contains(const osg::Vec3& v) const + { + for(PlaneList::const_iterator itr=_planeList.begin(); + itr!=_planeList.end(); + ++itr) + { + if (itr->distance(v)<0.0f) return false; + } + return true; + } + + /** Check whether any part of a bounding sphere is contained within clipping set. + Using a mask to determine which planes should be used for the check, and + modifying the mask to turn off planes which wouldn't contribute to clipping + of any internal objects. This feature is used in osgUtil::CullVisitor + to prevent redundent plane checking.*/ + inline const bool contains(const osg::BoundingSphere& bs,unsigned int& mask) const + { + if (!(mask & _localMask)) return true; + + unsigned int selector_mask = 0x1; + for(PlaneList::const_iterator itr=_planeList.begin(); + itr!=_planeList.end(); + ++itr) + { + if (mask&selector_mask) + { + int res=itr->intersect(bs); + if (res<0) return false; // outside clipping set. + else if (res>0) mask ^= selector_mask; // subsequent checks against this plane not required. + } + selector_mask <<= 1; + } + return true; + } + + /** Check whether any part of a bounding sphere is contained within clipping set.*/ + inline const bool contains(const osg::BoundingSphere& bs) const + { + for(PlaneList::const_iterator itr=_planeList.begin(); + itr!=_planeList.end(); + ++itr) + { + if (itr->intersect(bs)<0) return false; // outside clipping set. + } + return true; + } + + /** Check whether any part of a bounding box is contained within clipping set. + Using a mask to determine which planes should be used for the check, and + modifying the mask to turn off planes which wouldn't contribute to clipping + of any internal objects. This feature is used in osgUtil::CullVisitor + to prevent redundent plane checking.*/ + inline const bool contains(const osg::BoundingBox& bb,unsigned int& mask) const + { + if (!(mask & _localMask)) return true; + + unsigned int selector_mask = 0x1; + for(PlaneList::const_iterator itr=_planeList.begin(); + itr!=_planeList.end(); + ++itr) + { + if (mask&selector_mask) + { + int res=itr->intersect(bb); + if (res<0) return false; // outside clipping set. + else if (res>0) mask ^= selector_mask; // subsequent checks against this plane not required. + } + selector_mask <<= 1; + } + return true; + } + + /** Check whether any part of a bounding box is contained within clipping set.*/ + inline const bool contains(const osg::BoundingBox& bb) const + { + for(PlaneList::const_iterator itr=_planeList.begin(); + itr!=_planeList.end(); + ++itr) + { + if (itr->intersect(bb)<0) return false; // outside clipping set. + } + return true; + } + + + /** Transform the clipping set by matrix. Note, this operations carries out + * the calculation of the inverse of the matrix since to transforms + * planes must be multiplied my the inverse transposed. This + * make this operation expensive. If the inverse has been already + * calculated elsewhere then use transformProvidingInverse() instead. + * See http://www.worldserver.com/turk/computergraphics/NormalTransformations.pdf*/ + inline void transform(const osg::Matrix& matrix) + { + osg::Matrix inverse; + inverse.invert(matrix); + transformProvidingInverse(inverse); + } + + /** Transform the clipping set by provide a pre inverted matrix. + * see transform for details. */ + inline void transformProvidingInverse(const osg::Matrix& matrix) + { + for(PlaneList::iterator itr=_planeList.begin(); + itr!=_planeList.end(); + ++itr) + { + itr->transformProvidingInverse(matrix); + } + } + + protected: + + + unsigned int _localMask; + PlaneList _planeList; + +}; + +}; // end of namespace +#endif diff --git a/include/osg/ColorMask b/include/osg/ColorMask new file mode 100644 index 000000000..18e7a3771 --- /dev/null +++ b/include/osg/ColorMask @@ -0,0 +1,56 @@ +#ifndef OSG_COLORMASK +#define OSG_COLORMASK 1 + +#include +#include +#include + +namespace osg { + +/** Encapsulte OpenGL glColorMaskFunc/Op/Mask functions. +*/ +class SG_EXPORT ColorMask : public StateAttribute +{ + public : + + + ColorMask(); + virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast(obj)!=0L; } + virtual Object* clone() const { return new ColorMask(); } + virtual const char* className() const { return "ColorMask"; } + + virtual const Type getType() const { return COLORMASK; } + + inline void setMask(bool red,bool green,bool blue,bool alpha) + { + _red = red; + _green = green; + _blue = blue; + _alpha = alpha; + + } + + inline const bool getRedMask() const { return _red; } + + inline const bool getGreenMask() const { return _green; } + + inline const bool getBlueMask() const { return _blue; } + + inline const bool getAlphaMask() const { return _alpha; } + + virtual void apply(State& state) const; + + protected: + + virtual ~ColorMask(); + + bool _red; + bool _green; + bool _blue; + bool _alpha; + +}; + +}; + +#endif diff --git a/include/osg/Depth b/include/osg/Depth new file mode 100644 index 000000000..7e1be73e1 --- /dev/null +++ b/include/osg/Depth @@ -0,0 +1,75 @@ +#ifndef OSG_DEPTH +#define OSG_DEPTH 1 + +#include +#include +#include + +namespace osg { + +/** Encapsulte OpenGL glDepthFunc/Mask/Range functions. +*/ +class SG_EXPORT Depth : public StateAttribute +{ + public : + + + Depth(); + virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast(obj)!=0L; } + virtual Object* clone() const { return new Depth(); } + virtual const char* className() const { return "Depth"; } + + virtual const Type getType() const { return DEPTH; } + + virtual void setStateSetModes(StateSet& ds,const GLModeValue value) const + { + ds.setMode(GL_DEPTH_TEST,value); + } + + enum Function + { + NEVER = GL_NEVER, + LESS = GL_LESS, + EQUAL = GL_EQUAL, + LEQUAL = GL_LEQUAL, + GREATER = GL_GREATER, + NOTEQUAL = GL_NOTEQUAL, + GEQUAL = GL_GEQUAL, + ALWAYS = GL_ALWAYS + }; + + inline void setFunction(const Function func) { _func = func; } + + inline const Function getFunction() const { return _func; } + + + inline void setWriteMask(const bool mask) { _depthWriteMask = mask; } + + inline const bool getWriteMask() const { return _depthWriteMask; } + + inline void setRange(const double zNear, const double zFar) + { + _zNear = zNear; + _zFar = zFar; + } + + inline const double getZNear() const { return _zNear; } + inline const double getZFar() const { return _zFar; } + + virtual void apply(State& state) const; + + protected: + + virtual ~Depth(); + + Function _func; + bool _depthWriteMask; + + double _zNear; + double _zFar; + +}; + +}; + +#endif diff --git a/include/osg/Drawable b/include/osg/Drawable new file mode 100644 index 000000000..146036053 --- /dev/null +++ b/include/osg/Drawable @@ -0,0 +1,174 @@ +#ifndef OSG_DRAWABLE +#define OSG_DRAWABLE 1 + +#include +#include +#include +#include + +#include +#include +#include + +namespace osg { + +/** Pure virtual base class for drawable Geomtery. Contains no drawing primitives + directly, these are provided by subclasses such as GeoSet. State attributes + for a Drawable are maintained in StateSet which the Drawable maintains + a referenced counted pointer to. Both Drawable's and StateSet's can + be shared for optimal memory usage and graphics performance. +*/ +class SG_EXPORT Drawable : public Object +{ + public: + + Drawable(); + + virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast(obj)!=NULL; } + virtual const char* className() const { return "Drawable"; } + + /** Set the StateSet attached to the Drawable. + Previously attached StateSet are automatically unreferenced on + assignment of a new drawstate.*/ + inline void setStateSet(StateSet *state) { _dstate = state; } + + /** Get the attached StateSet.*/ + inline StateSet* getStateSet() { return _dstate.get();} + + /** Get the attached const StateSet.*/ + inline const StateSet* getStateSet() const { return _dstate.get();} + + + /** Set the drawable to it can or cannot be used inconjunction with OpenGL + * display lists. With set to true, calls to Drawable::setUseDisplayList, + * whereas when set to false, no display lists can be created and calls + * to setUseDisplayList are ignored, and a warning is produced. The later + * is typically used to guard against the switching on of display lists + * on objects with dynamic internal data such as continuous Level of Detail + * algorithms.*/ + void setSupportsDisplayList(const bool flag); + + /** Get whether display lists are supportd for this drawable instance.*/ + inline const bool getSupportsDisplayList() const { return _supportsDisplayList; } + + + /** When set to true, force the draw method to use OpenGL Display List for rendering. + If false rendering directly. If the display list has not been already + compile the next call to draw will automatically create the display list.*/ + void setUseDisplayList(const bool flag); + + /** Return whether OpenGL display lists are being used for rendering.*/ + inline const bool getUseDisplayList() const { return _useDisplayList; } + + /** Force a recompile on next draw() of any OpenGL display list associated with this geoset.*/ + void dirtyDisplayList(); + + inline void dirtyBound() { _bbox_computed = false; } + + /** get bounding box of geoset. + * Note, now made virtual to make it possible to implement user-drawn + * objects albeit so what crudely, to be improved later. + */ + inline const BoundingBox& getBound() const + { + if( !_bbox_computed) + computeBound(); + return _bbox; + } + + /** draw OpenGL primitives. + * If the drawable has _useDisplayList set to true then use an OpenGL display + * list, automatically compiling one if required. + * Otherwise call drawImmediateMode(). + * Note, draw method should not be overriden in subclasses as it + * manages the optional display list. + */ + inline void draw(State& state) + { + if (_useDisplayList) + { + + // get the contextID (user defined ID of 0 upwards) for the + // current OpenGL context. + uint contextID = state.getContextID(); + + // fill in array if required. + while (_globjList.size()<=contextID) _globjList.push_back(0); + + // get the globj for the current contextID. + uint& globj = _globjList[contextID]; + + // call the globj if already set otherwise comple and execute. + if( globj != 0 ) + { + glCallList( globj ); + } + else if (_useDisplayList) + { + globj = glGenLists( 1 ); + glNewList( globj, GL_COMPILE_AND_EXECUTE ); + drawImmediateMode(state); + glEndList(); + } + + } + else + { + // draw object as nature intended.. + drawImmediateMode(state); + } + } + + /** Immediately compile this drawable into an OpenGL Display List. + Note, operation is ignored if _useDisplayList to false.*/ + void compile(State& state); + + /** draw directly ignoring an OpenGL display list which could be attached. + * This is the internal draw method which does the drawing itself, + * and is the method to override when deriving from Drawable. + */ + virtual void drawImmediateMode(State& state) = 0; + + /** use deleteDisplayList instead of glDeleteList to allow + * OpenGL display list to cached until they can be deleted + * by the OpenGL context in which they were created, specified + * by contextID.*/ + static void deleteDisplayList(uint contextID,uint globj); + + /** flush all the cached display list which need to be deleted + * in the OpenGL context related to contextID.*/ + static void flushDeletedDisplayLists(uint contextID); + + protected: + + Drawable(const Drawable&):Object() {} + Drawable& operator = (const Drawable&) { return *this;} + + virtual ~Drawable(); + + /** compute the bounding box of the drawable. Method must be + implementated by subclasses.*/ + virtual const bool computeBound() const = 0; + + ref_ptr _dstate; + + bool _supportsDisplayList; + bool _useDisplayList; + + typedef std::vector GLObjectList; + mutable GLObjectList _globjList; + + mutable BoundingBox _bbox; + mutable bool _bbox_computed; + + // static cache of deleted display lists which can only + // by completely deleted once the appropriate OpenGL context + // is set. + typedef std::map > DeletedDisplayListCache; + static DeletedDisplayListCache s_deletedDisplayListCache; + +}; + +}; + +#endif diff --git a/include/osg/FrontFace b/include/osg/FrontFace new file mode 100644 index 000000000..5b95a678b --- /dev/null +++ b/include/osg/FrontFace @@ -0,0 +1,42 @@ +#ifndef OSG_FRONTFACE +#define OSG_FRONTFACE 1 + +#include +#include + +namespace osg { + +/** Class to specifies the orientation of front-facing polygons. +*/ +class SG_EXPORT FrontFace : public StateAttribute +{ + public : + + FrontFace(); + virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast(obj)!=0L; } + virtual Object* clone() const { return new FrontFace(); } + virtual const char* className() const { return "FrontFace"; } + + virtual const Type getType() const { return FRONTFACE; } + + enum Mode { + CLOCKWISE = GL_CW, + COUNTER_CLOCKWISE = GL_CCW + }; + + inline void setMode(const Mode mode) { _mode = mode; } + inline const Mode getMode() const { return _mode; } + + virtual void apply(State& state) const; + + protected: + + virtual ~FrontFace(); + + Mode _mode; + +}; + +}; + +#endif diff --git a/include/osg/GLExtensions b/include/osg/GLExtensions new file mode 100644 index 000000000..996d23440 --- /dev/null +++ b/include/osg/GLExtensions @@ -0,0 +1,21 @@ +#ifndef OSG_GLEXTENSIONS +#define OSG_GLEXTENSIONS 1 + +#include + +namespace osg { + +/** return true if OpenGL "extension" is supported. + * note: Must only called within a valid OpenGL context, + * undefined behaviour may occur otherwise. + */ +SG_EXPORT extern const bool isGLExtensionSupported(const char *extension); + +/** return the address of the specified OpenGL function. + * return NULL if function not supported by OpenGL library. + */ +SG_EXPORT extern void* getGLExtensionFuncPtr(const char *funcName); + +}; + +#endif diff --git a/include/osg/Impostor b/include/osg/Impostor new file mode 100644 index 000000000..d777a5671 --- /dev/null +++ b/include/osg/Impostor @@ -0,0 +1,100 @@ +#ifndef OSG_IMPOSTOR +#define OSG_IMPOSTOR 1 + +#include +#include + +namespace osg { + +/** Impostor - is a form of Level Of Detail group node which allows both switching + * between children depending on distance from eye point and image caching. + * + * The principle behind Imposters is that they cache an image of real geometry and then the image is drawn + * in subsequent frames instead of the real geometry. Its a bit like a + * Billboard *but* is updated at runtime and w.r.t view point. By drawing + * just the texture mapped quad you can cut down scene complexity and + * improve performance. + * + * For more details have a look at: + * + * http://grail.cs.washington.edu/projects/hic/ + * + * The OSG doesn't implement exactly the same technique as above, but its + * should be a good starting place. The OSG's impostors are much less + * intrusive since you don't need to restructure your whole scene to use + * them. + * + * All you need to do to use Impostors is to set up the visible + * range values for each LOD child of the Impostor, as per osg::LOD, + * and set an Impostor threshold to tell the renderer at what distance + * the Impsotor's image caching should cut in. The osg::CullVisitor + * automatically handles all the setting of pre-rendering stages to + * calculate the required ImpostorSprites (which encapsulates the image + * cache and quad), and updates them as the view point changes. If you + * use osg::SceneView/CullVisitor all the complexity of supporting + * Impostor will be nicely hidden away. + * + * TODO: + * Various improvements are planned for the Impostor- + * 1) Estimation of how many frames an ImpostorSprite will be reused, if + * it won't be used more often than a minimum threshold then do not create + * ImpostorSprite - use the real geometry. + * 2) Sharing of texture memory between ImpostorSprites. + * 3) Simple 3D geometry for ImpostorSprite's rather than Billboarding. + * 4) Shrinking of the ImpostorSprite size to more closely fit the underlying + * geometry. + */ +class SG_EXPORT Impostor : public LOD +{ + public : + Impostor(); + + virtual Object* clone() const { return new Impostor(); } + virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast(obj)!=NULL; } + virtual const char* className() const { return "Impostor"; } + virtual void accept(NodeVisitor& nv) { nv.apply(*this); } + + typedef std::vector< ref_ptr > ImpostorSpriteList; + + /** Set the Impostor threshold distance. + * For eye points further than this threshold the Imposter is used if appropriate, + * otherwise the LOD children as chosen as per a standard LOD node.*/ + inline void setImpostorThreshold(float distance) { _impostorThreshold = distance; } + + /** Set the Impostor threshold distance relative to the node's bounding + * sphere's radius.*/ + inline void setImpostorThresholdToBound(float ratio=1.0f) { _impostorThreshold = getBound().radius()*ratio; } + + /* Get the Impostor threshold disntance.*/ + inline const float getImpostorThreshold() const { return _impostorThreshold; } + + /* Get the Impostor threshold disntance squared.*/ + inline const float getImpostorThreshold2() const { return _impostorThreshold*_impostorThreshold; } + + /** Find the ImposterSprite which fits the current eye point best.*/ + ImpostorSprite* findBestImpostorSprite(const osg::Vec3& currLocalEyePoint); + + /** Add an ImpostorSprite to the Impostor.*/ + void addImpostorSprite(ImpostorSprite* is); + + /** Get the list of ImpostorSprites attached to this Impostor.*/ + inline ImpostorSpriteList& getImpostorSpriteList() { return _impostorSpriteList; } + + /** Get a const list of ImpostorSprites attached to this const Impostor.*/ + inline const ImpostorSpriteList& getImpostorSpriteList() const { return _impostorSpriteList; } + + protected : + + virtual ~Impostor() {} + + virtual const bool computeBound() const; + + ImpostorSpriteList _impostorSpriteList; + + float _impostorThreshold; + +}; + +}; + +#endif diff --git a/include/osg/ImpostorSprite b/include/osg/ImpostorSprite new file mode 100644 index 000000000..34f6b52d1 --- /dev/null +++ b/include/osg/ImpostorSprite @@ -0,0 +1,176 @@ +#ifndef OSG_ImpostorSprite +#define OSG_ImpostorSprite 1 + +#include +#include +#include +#include +#include + +namespace osg { + +class Texture; +class Impostor; +class ImpostorSpriteManager; + +/** An ImposterSprite is a textured quad which is rendered in place a + * 3D geometry. The ImposterSprite is generated by rendering the original + * 3D geometry to a texture as an image cache. The ImpostorSprite is + * automatiacally generatated by the osgUtil::CullVisitor so it not + * necessary to deal with it directly. + */ +class SG_EXPORT ImpostorSprite : public Drawable +{ + public: + + ImpostorSprite(); + virtual Object* clone() const { return new ImpostorSprite(); } + virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast(obj)!=NULL; } + virtual const char* className() const { return "ImpostorSprite"; } + + /** Set the parent, which must be an Impostor. + * Unlike conventional Drawables, ImpostorSprite's can only ever have + * one parent. + */ + void setParent(Impostor* parent) { _parent = parent; } + + /** Get the parent, which is an Impostor. */ + Impostor* getParent() { return _parent; } + + /** Get the const parent, which is an Impostor. */ + const Impostor* getParent() const { return _parent; } + + /** Set the eye point for when the ImpsotorSprite was snapped.*/ + inline void setStoredLocalEyePoint(const Vec3& v) { _storedLocalEyePoint=v; } + + /** Get the eye point for when the ImpsotorSprite was snapped.*/ + inline const Vec3& getStoredLocalEyePoint() const { return _storedLocalEyePoint; } + + /** Set the frame number for when the ImpostorSprite was last used in rendering.*/ + inline void setLastFrameUsed(const int frameNumber) { _lastFrameUsed = frameNumber; } + + /** Get the frame number for when the ImpostorSprite was last used in rendering.*/ + inline int getLastFrameUsed() const { return _lastFrameUsed; } + + + /** Get the coordinates of the corners of the quad. + * Stored in the order, [0] - top_left, [1] - bottom_left, [2] - bottom_right, [3] - top_left. + */ + inline Vec3* getCoords() { return _coords; } + + /** Get the const coordinates of the corners of the quad. + */ + inline const Vec3* getCoords() const { return _coords; } + + + + /** Get the texture coordinates of the corners of the quad. + * Stored in the order, [0] - top_left, [1] - bottom_left, [2] - bottom_right, [3] - top_left. + */ + inline Vec2* getTexCoords() { return _texcoords; } + + /** Get the const texture coordinates of the corners of the quad.*/ + inline const Vec2* getTexCoords() const { return _texcoords; } + + /** Get the control coordinates of the corners of the quad. + * The control coordinates are the cornders of the quad projected + * out onto the front face of bounding box which enclosed the impostor + * geometry when it was pre-rendered into the impostor sprite's texture. + * At the point of creation/or update of the impostor sprite the control + * coords will lie ontop of the coorners of the quad in screen space - with a pixel error + * or zero. Once the camera moves relative to the impostor sprite the + * control coords will nolonger lie ontop of the corners of the quad in + * screen space - a pixel error will have accumulated. This pixel error + * can then be used to dertermine whether the impostor needs to be updated. + * Stored in the order, [0] - top_left, [1] - bottom_left, [2] - bottom_right, [3] - top_left. + */ + inline Vec3* getControlCoords() { return _controlcoords; } + + /** Get the const control coordinates of the corners of the quad.*/ + inline const Vec3* getControlCoords() const { return _controlcoords; } + + + /** calculate the pixel error value for current camera position and object position.*/ + const float calcPixelError(const Camera& camera,const int* viewport,const osg::Matrix* matrix) const; + + + void setTexture(Texture* tex,int s,int t); + + Texture* getTexture() { return _texture; } + const Texture* getTexture() const { return _texture; } + const int s() const { return _s; } + const int t() const { return _t; } + + + /** draw ImpostorSprite directly. */ + virtual void drawImmediateMode(State& state); + + + protected: + + ImpostorSprite(const ImpostorSprite&):Drawable() {} + ImpostorSprite& operator = (const ImpostorSprite&) { return *this;} + + virtual ~ImpostorSprite(); + + virtual const bool computeBound() const; + + Impostor* _parent; + + friend ImpostorSpriteManager; + + // support for a double linked list managed by the + // ImposotorSpriteManager. + ImpostorSpriteManager* _ism; + ImpostorSprite* _previous; + ImpostorSprite* _next; + + int _lastFrameUsed; + + Vec3 _storedLocalEyePoint; + + Vec3 _coords[4]; + Vec2 _texcoords[4]; + Vec3 _controlcoords[4]; + + Texture* _texture; + int _s; + int _t; + + +}; + +/** Helper class for managing the reuse of ImpostorSprite resources.*/ +class SG_EXPORT ImpostorSpriteManager : public Referenced +{ + public: + + ImpostorSpriteManager(); + + const bool empty() const { return _first==0; } + + ImpostorSprite* first() { return _first; } + + ImpostorSprite* last() { return _last; } + + void push_back(ImpostorSprite* is); + + void remove(ImpostorSprite* is); + + ImpostorSprite* createOrReuseImpostorSprite(int s,int t,int frameNumber); + + + protected: + + + ~ImpostorSpriteManager(); + + ImpostorSprite* _first; + ImpostorSprite* _last; + + +}; + +}; + +#endif diff --git a/include/osg/LineSegment b/include/osg/LineSegment new file mode 100644 index 000000000..754330227 --- /dev/null +++ b/include/osg/LineSegment @@ -0,0 +1,60 @@ +#ifndef OSG_LINESEGMENT +#define OSG_LINESEGMENT 1 + +#include +#include +#include + +namespace osg { + +/** LineSegmentment class for representing a line segment.*/ +class SG_EXPORT LineSegment : public Referenced +{ + public: + + LineSegment() {}; + LineSegment(const LineSegment& seg) : Referenced(),_s(seg._s),_e(seg._e) {} + LineSegment(const Vec3& s,const Vec3& e) : _s(s),_e(e) {} + virtual ~LineSegment() {} + + LineSegment& operator = (const LineSegment& seg) { _s = seg._s; _e = seg._e; return *this; } + + inline void set(const Vec3& s,const Vec3& e) { _s=s; _e=e; } + + inline Vec3& start() { return _s; } + inline const Vec3& start() const { return _s; } + + inline Vec3& end() { return _e; } + inline const Vec3& end() const { return _e; } + + /** return true if segment intersects BoundingBox.*/ + const bool intersect(const BoundingBox& bb) const; + + /** return true if segment intersects BoundingSphere and return the intersection ratio's.*/ + const bool intersect(const BoundingBox& bb,float& r1,float& r2) const; + + /** return true if segment intersects BoundingSphere.*/ + const bool intersect(const BoundingSphere& bs) const; + + /** return true if segment intersects BoundingSphere and return the intersection ratio's.*/ + const bool intersect(const BoundingSphere& bs,float& r1,float& r2) const; + + /** return true if segment intersects triangle and set ratio long segment. */ + const bool intersect(const Vec3& v1,const Vec3& v2,const Vec3& v3,float& r); + + /** post multiply a segment by matrix.*/ + inline void mult(const LineSegment& seg,const Matrix& m) { _s = seg._s*m; _e = seg._e*m; } + /** pre multiply a segment by matrix.*/ + inline void mult(const Matrix& m,const LineSegment& seg) { _s = m*seg._s; _e = m*seg._e; } + + protected: + + static const bool intersectAndClip(Vec3& s,Vec3& e,const BoundingBox& bb); + + Vec3 _s; + Vec3 _e; +}; + +}; + +#endif diff --git a/include/osg/MemoryAdapter b/include/osg/MemoryAdapter new file mode 100644 index 000000000..4bde56935 --- /dev/null +++ b/include/osg/MemoryAdapter @@ -0,0 +1,37 @@ +#ifndef OSG_MEMORYADAPTER +#define OSG_MEMORYADAPTER 1 + +#include + +namespace osg { + +/** Class for adapting the memory management of external data. + * Typically used to specify the memory management of user data + * which can be attached to osg::Node. + */ +class SG_EXPORT MemoryAdapter : public Referenced +{ + public: + MemoryAdapter() {} + + /** Increment the reference count of the userData.*/ + virtual void ref_data(void* /*userData*/) = 0; + + /** Decrement the reference count of the userData. + Is usually implemented such that if reference count + is decremented to zero the userData should be + deleted. However, this is entirely up to the + discression of the user who is extending this base class.*/ + virtual void unref_data(void* /*userData*/) = 0; + + /** not current used, but will be used in future.*/ + virtual void* clone_data(void* /*userData*/) { return 0L; } + + protected: + + virtual ~MemoryAdapter() {} +}; + +}; + +#endif diff --git a/include/osg/Plane b/include/osg/Plane new file mode 100644 index 000000000..90a7751d7 --- /dev/null +++ b/include/osg/Plane @@ -0,0 +1,165 @@ +#ifndef OSG_PLANE +#define OSG_PLANE 1 + +#include +#include +#include +#include +#include + +namespace osg { + +/** A plane class. It can be used to represent an infinite plane.*/ +class SG_EXPORT Plane +{ + + public: + + inline Plane():_fv(0.0f,0.0f,0.0f,0.0f) { _lowerBBCorner = 0; _upperBBCorner = 0; } + inline Plane(const Plane& pl):_fv(pl._fv) { calculateUpperLowerBBCorners(); } + inline Plane(const float a,const float b,const float c,const float d):_fv(a,b,c,d) { calculateUpperLowerBBCorners(); } + inline Plane(const Vec4& vec):_fv(vec) { calculateUpperLowerBBCorners(); } + inline Plane(const Vec3& norm,const float d):_fv(norm[0],norm[1],norm[2],d) { calculateUpperLowerBBCorners(); } + inline Plane(const Vec3& v1, const Vec3& v2, const Vec3& v3) { set(v1,v2,v3); calculateUpperLowerBBCorners(); } + + inline Plane& operator = (const Plane& pl) + { + if (&pl==this) return *this; + _fv = pl._fv; + _lowerBBCorner = pl._lowerBBCorner; + _upperBBCorner = pl._upperBBCorner; + return *this; + } + + inline void set(const Plane& pl) { _fv = pl._fv; calculateUpperLowerBBCorners(); } + inline void set(const float a,const float b,const float c,const float d) { _fv.set(a,b,c,d); calculateUpperLowerBBCorners(); } + inline void set(const Vec4& vec) { _fv = vec; calculateUpperLowerBBCorners(); } + inline void set(const Vec3& norm,const float d) { _fv.set(norm[0],norm[1],norm[2],d); calculateUpperLowerBBCorners(); } + inline void set(const Vec3& v1, const Vec3& v2, const Vec3& v3) + { + osg::Vec3 norm = (v2-v1)^(v3-v2); + float length = norm.length(); + if (length>1e-6) norm/= length; + else norm.set(0.0f,0.0f,0.0f); + _fv.set(norm[0],norm[1],norm[2],-(v1*norm)); + calculateUpperLowerBBCorners(); + } + + + inline void makeUnitLength() + { + float length = sqrtf(_fv[0]*_fv[0] + _fv[1]*_fv[1]+ _fv[2]*_fv[2]); + _fv /= length; + } + + /** calculate the upper and lower bounding box corners to be used + * in the intersect(BoundingBox&) method for speeding calculations.*/ + inline void calculateUpperLowerBBCorners() + { + _upperBBCorner = (_fv.x()>=0.0f?1:0) | + (_fv.y()>=0.0f?2:0) | + (_fv.z()>=0.0f?4:0); + + _lowerBBCorner = (~_upperBBCorner)&7; + + } + + inline const bool valid() const { return _fv[0]==0.0f && _fv[1]==0.0f && _fv[2]==0.0f; } + + inline Vec4& asVec4() { return _fv; } + + inline const Vec4& asVec4() const { return _fv; } + + inline float& operator [] (const int i) { return _fv[i]; } + inline float operator [] (const int i) const { return _fv[i]; } + + + /** calculate the distance between a point and the plane.*/ + inline const float distance(const osg::Vec3& v) const + { + return _fv[0]*v.x()+ + _fv[1]*v.y()+ + _fv[2]*v.z()+ + _fv[3]; + } + + /** interesection test between plane and bounding sphere. + return 1 if the bs is completely above plane, + return 0 if the bs intersects the plane, + return -1 if the bs is completely below the plane.*/ + inline const int intersect(const BoundingSphere& bs) const + { + float d = distance(bs.center()); + + if (d>bs.radius()) return 1; + else if (d<-bs.radius()) return -1; + else return 0; + } + + + /** interesection test between plane and bounding sphere. + return 1 if the bs is completely above plane, + return 0 if the bs intersects the plane, + return -1 if the bs is completely below the plane.*/ + inline const int intersect(const BoundingBox& bb) const + { + // if lowest point above plane than all above. + if (distance(bb.corner(_lowerBBCorner))>0.0f) return 1; + + // if highest point is below plane then all below. + if (distance(bb.corner(_upperBBCorner))<0.0f) return -1; + + // d_lower<=0.0f && d_upper>=0.0f + // therefore must be crossing plane. + return 0; + + } + + /** Transform the plane by matrix. Note, this operations carries out + * the calculation of the inverse of the matrix since to transforms + * planes must be multiplied my the inverse transposed. This + * make this operation expensive. If the inverse has been already + * calculated elsewhere then use transformProvidingInverse() instead. + * See http://www.worldserver.com/turk/computergraphics/NormalTransformations.pdf*/ + inline void transform(const osg::Matrix& matrix) + { + osg::Matrix inverse; + inverse.invert(matrix); + transformProvidingInverse(inverse); + } + + /** Transform the plane by provide a pre inverted matrix. + * see transform for details. */ + inline void transformProvidingInverse(const osg::Matrix& matrix) + { + // note pre multiplications, which effectively transposes matrix. + _fv = matrix * _fv; + makeUnitLength(); + calculateUpperLowerBBCorners(); + } + + friend inline ostream& operator << (ostream& output, const Plane& pl); + + + protected: + + Vec4 _fv; + + // variables cached to optimize calcs against bounding boxes. + unsigned int _upperBBCorner; + unsigned int _lowerBBCorner; + + +}; + +inline ostream& operator << (ostream& output, const Plane& pl) +{ + output << pl._fv[0] << " " + << pl._fv[1] << " " + << pl._fv[2] << " " + << pl._fv[3]; + return output; // to enable cascading +} + +}; // end of namespace +#endif diff --git a/include/osg/PolygonMode b/include/osg/PolygonMode new file mode 100644 index 000000000..6d481e620 --- /dev/null +++ b/include/osg/PolygonMode @@ -0,0 +1,54 @@ +#ifndef OSG_POLYGONMODE +#define OSG_POLYGONMODE 1 + +#include +#include + +namespace osg { + +/** Class to for setting OpenGL's polygon culling mode. +*/ +class SG_EXPORT PolygonMode : public StateAttribute +{ + public : + + PolygonMode(); + virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast(obj)!=0L; } + virtual Object* clone() const { return new PolygonMode(); } + virtual const char* className() const { return "PolygonMode"; } + + virtual const Type getType() const { return POLYGONMODE; } + + enum Face { + FRONT, + BACK, + FRONT_AND_BACK + }; + + enum Mode { + POINT = GL_POINT, + LINE = GL_LINE, + FILL = GL_FILL + }; + + void setMode(const Face face,const Mode mode); + + const Mode getMode(const Face face) const; + + inline const bool getFrontAndBack() const { return _frontAndBack; } + + virtual void apply(State& state) const; + + protected: + + virtual ~PolygonMode(); + + bool _frontAndBack; + Mode _modeFront; + Mode _modeBack; + +}; + +}; + +#endif diff --git a/include/osg/StateAttribute b/include/osg/StateAttribute new file mode 100644 index 000000000..13cae5a44 --- /dev/null +++ b/include/osg/StateAttribute @@ -0,0 +1,132 @@ +#ifndef OSG_STATEATTRIBUTE +#define OSG_STATEATTRIBUTE 1 + +#include +#include + +namespace osg { + +// forward declare State & StateSet +class State; +class StateSet; + +/** Base class for state attribues. +*/ +class SG_EXPORT StateAttribute : public Object +{ + public : + + /** GLMode is the value used in glEnable/glDisable(mode) */ + typedef GLenum GLMode; + /** GLModeValue is used to specified whether an mode is enabled (ON) or disabled (OFF). + * GLMoveValue is also used to speficy the override behavior of modes from parent to children. + * See enum Value description for more details.*/ + typedef unsigned int GLModeValue; + /** Override is used to specified the override behavior of StateAttributes + * from from parent to children. + * See enum Value description for more details.*/ + typedef unsigned int OverrideValue; + + /** list values which can be used in to set either GLModeValues + * or OverrideValues. When using in conjection with GLModeValues + * all Values have meaning. When using in conjection with + * StateAttribute OverrideValue only OFF,OVERRIDE and INHERIT + * are meaningful. However, they are useful when using GLModeValue + * and OverrideValue in conjunction with each other as when using + * StateSet::setAttributeAndModes(..).*/ + enum Values + { + /** means that associated GLMode and Override is disabled.*/ + OFF = 0x0, + /** means that associated GLMode is enabled and Override is disabled.*/ + ON = 0x1, + /** Overriding of GLMode's or StateAttributes is enabled.*/ + OVERRIDE = 0x2, + /** means that associated GLMode is disabled and Override is enabled.*/ + OVERRIDE_OFF = 0x2, + /** means that associated GLMode and Override is enabled.*/ + OVERRIDE_ON = 0x3, + /** means that GLMode or StateAttribute should in inherited from above.*/ + INHERIT = 0x4 + }; + + /** Values of StateAttribute::Type used to aid identification + * of diffenent StateAttribute subclasses. Each subclass defines + * it own value in the virtual Type getType() method. When + * extending the osg's StateAttribute's simply define your + * own Type value which is unique, using the StateAttribute::Type + * enum as a guide of what values to use. If your new subclass + * needs to override a standard StateAttriubte then simple use + * that types value. */ + enum Type + { + ALPHAFUNC =1, + ANTIALIAS =2, + COLORTABLE =3, + CULLFACE =4, + FOG =5, + FRONTFACE =6, + LIGHTING =7, + MATERIAL =8, + POINT =9, + POLYGONMODE =10, + POLYGONOFFSET =11, + TEXENV =12, + TEXGEN =13, + TEXMAT =14, + TEXTURE =15, + TEXTURE_0 =TEXTURE+0, + TEXTURE_1 =TEXTURE+1, + TEXTURE_2 =TEXTURE+2, + TEXTURE_3 =TEXTURE+3, + TRANSPARENCY =19, + STENCIL =20, + COLORMASK =21, + CLIPPLANE =23, + CLIPPLANE_0 =CLIPPLANE+0, + CLIPPLANE_1 =CLIPPLANE+1, + CLIPPLANE_2 =CLIPPLANE+2, + CLIPPLANE_3 =CLIPPLANE+3, + CLIPPLANE_4 =CLIPPLANE+4, + CLIPPLANE_5 =CLIPPLANE+5, + DEPTH =29 + }; + + StateAttribute() {} + + /** return a shallow copy of a node, with Object* return type.*/ + virtual Object* clone() const = 0; + + /** return true if this and obj are of the same kind of object.*/ + virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast(obj)!=NULL; } + + /** return the name of the attribute's class type.*/ + virtual const char* className() const { return "StateAttribute"; } + + /** return the Type idenitifer of the attribute's class type.*/ + virtual const Type getType() const = 0; + + virtual void setStateSetModes(StateSet&,const GLModeValue) const + { + // default to no GLMode's assocated with use of the StateAttribute. + } + + /** apply the OpenGL state attributes. + * The global state for the current OpenGL context is passed + * in to allow the StateAttribute to obtain details on the + * the current context and state. + */ + virtual void apply(State&) const = 0 ; + + /** default to nothing to compile - all state is applied immediately. */ + virtual void compile(State&) const {}; + + protected: + + virtual ~StateAttribute() {} + +}; + +}; + +#endif diff --git a/include/osg/StateSet b/include/osg/StateSet new file mode 100644 index 000000000..09f68c55f --- /dev/null +++ b/include/osg/StateSet @@ -0,0 +1,171 @@ +#ifndef OSG_STATESET +#define OSG_STATESET 1 + +#include +#include +#include + +#include +#include +#include + +namespace osg { + +/** +Encapsulates OpenGL state modes and attributes. +Used to specificy textures etc of osg::Drawable's which hold references +to a single osg::StateSet. StateSet can be shared between Drawable's +and is recommend if possible as it minimize expensive state changes +in the graphics pipeline. +*/ +class SG_EXPORT StateSet : public Object +{ + public : + + + StateSet(); + virtual Object* clone() const { return new StateSet(); } + virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast(obj)!=NULL; } + virtual const char* className() const { return "StateSet"; } + + /** set all the modes to on or off so that it defines a + complete state, typically used for a default global state.*/ + void setGlobalDefaults(); + + /** set all the modes to inherit, typically used to signifiy + nodes which inherit all of their modes for the global state.*/ + void setAllToInherit(); + + /** a container to map GLModes to their respective GLModeValues.*/ + typedef std::map ModeList; + + /** set this StateSet to contain specified GLMode and value.*/ + void setMode(const StateAttribute::GLMode mode, const StateAttribute::GLModeValue value); + /** set this StateSet to inherit specified GLMode type from parents. + * has the effect of deleting any GlMode of specified type from StateSet.*/ + void setModeToInherit(const StateAttribute::GLMode mode); + + /** get specified GLModeValue for specified GLMode. + * returns INHERIT if no GLModeValue is contained within StateSet.*/ + const StateAttribute::GLModeValue getMode(const StateAttribute::GLMode mode) const; + + /** return the list of all GLModes contained in this StateSet.*/ + inline ModeList& getModeList() { return _modeList; } + + /** return the const list of all GLModes contained in this const StateSet.*/ + inline const ModeList& getModeList() const { return _modeList; } + + + /** simple pairing between an attribute and its override flag.*/ + typedef std::pair,StateAttribute::OverrideValue> RefAttributePair; + /** a container to map StateAttribyte::Types to their respective RefAttributePair.*/ + typedef std::map AttributeList; + + /** set this StateSet to contain specified attribute and override flag.*/ + void setAttribute(StateAttribute *attribute, const StateAttribute::OverrideValue value=StateAttribute::OFF); + /** set this StateSet to contain specified attribute and set the associated GLMode's to specifed value.*/ + void setAttributeAndModes(StateAttribute *attribute, const StateAttribute::GLModeValue value=StateAttribute::ON); + /** set this StateSet to inherit specified attribute type from parents. + * has the effect of deleting any state attributes of specified type from StateSet.*/ + void setAttributeToInherit(const StateAttribute::Type type); + + /** get specified StateAttribute for specified type. + * returns NULL if no type is contained within StateSet.*/ + const StateAttribute* getAttribute(const StateAttribute::Type type) const; + + /** get specified RefAttributePair for specified type. + * returns NULL if no type is contained within StateSet.*/ + const RefAttributePair* getAttributePair(const StateAttribute::Type type) const; + + /** return the list of all StateAttributes contained in this StateSet.*/ + inline AttributeList& getAttributeList() { return _attributeList; } + + /** return the const list of all StateAttributes contained in this const StateSet.*/ + inline const AttributeList& getAttributeList() const { return _attributeList; } + + /** tempory type def to support tempory method getModeVector.*/ + typedef std::vector > ModeVector; + /** get method which copies this StateSet's osg::GLModeValues's into + * a std::vector. method is overlaps on the propper get method - + * getModeList and only exists to get round a crash under Windows. + * Will be removed once problem is fixed.*/ + const ModeVector getModeVector() const; + + /** tempory type def to support tempory method getAttributeVector.*/ + typedef std::vector AttributeVector; + /** get method which copies this StateSet's osg::StateAttribute's into + * a std::vector. method is overlaps on the propper get method - + * getAttributeList and only exists to get round a crash under Windows. + * Will be removed once problem is fixed.*/ + const AttributeVector getAttributeVector() const; + + enum RenderingHint + { + DEFAULT_BIN = 0, + OPAQUE_BIN = 1, + TRANSPARENT_BIN = 2 + }; + + /** set the RenderingHint of the StateSet. + * RenderingHint is used by osgUtil::Renderer to determine which + * draw bin to drop associated osg::Drawables in. For opaque + * objects OPAQUE_BIN would typical used, which TRANSPARENT_BIN + * should be used for objects which need to be depth sorted.*/ + void setRenderingHint(const int hint); + + /** get the RenderingHint of the StateSet.*/ + inline const int getRenderingHint() const { return _renderingHint; } + + enum RenderBinMode + { + INHERIT_RENDERBIN_DETAILS, + USE_RENDERBIN_DETAILS, + OVERRIDE_RENDERBIN_DETAILS, + ENCLOSE_RENDERBIN_DETAILS + }; + + /** set the render bin details.*/ + void setRenderBinDetails(const int binNum,const std::string& binName,const RenderBinMode mode=USE_RENDERBIN_DETAILS); + + /** set the render bin details to inherit.*/ + void setRendingBinToInherit(); + + /** get the render bin mode.*/ + inline const RenderBinMode getRenderBinMode() const { return _binMode; } + + /** get whether the render bin details are set and should be used.*/ + inline const bool useRenderBinDetails() const { return _binMode!=INHERIT_RENDERBIN_DETAILS; } + + /** get the render bin number.*/ + inline const int getBinNumber() const { return _binNum; } + + /** get the render bin name.*/ + inline const std::string& getBinName() const { return _binName; } + + + /** call compile on all StateAttributes contained within this StateSet.*/ + void compile(State& state) const; + + protected : + + + virtual ~StateSet(); + + StateSet(const StateSet&):Object() {} + StateSet& operator = (const StateSet&) { return *this; } + + + ModeList _modeList; + AttributeList _attributeList; + + int _renderingHint; + + RenderBinMode _binMode; + int _binNum; + std::string _binName; + +}; + +}; + +#endif diff --git a/include/osg/Stencil b/include/osg/Stencil new file mode 100644 index 000000000..405414ce6 --- /dev/null +++ b/include/osg/Stencil @@ -0,0 +1,114 @@ +#ifndef OSG_STENCIL +#define OSG_STENCIL 1 + +#include +#include +#include + +namespace osg { + +/** Encapsulte OpenGL glStencilFunc/Op/Mask functions. +*/ +class SG_EXPORT Stencil : public StateAttribute +{ + public : + + + Stencil(); + virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast(obj)!=0L; } + virtual Object* clone() const { return new Stencil(); } + virtual const char* className() const { return "Stencil"; } + + virtual const Type getType() const { return STENCIL; } + + virtual void setStateSetModes(StateSet& ds,const GLModeValue value) const + { + ds.setMode(GL_STENCIL_TEST,value); + } + + enum Function + { + NEVER = GL_NEVER, + LESS = GL_LESS, + EQUAL = GL_EQUAL, + LEQUAL = GL_LEQUAL, + GREATER = GL_GREATER, + NOTEQUAL = GL_NOTEQUAL, + GEQUAL = GL_GEQUAL, + ALWAYS = GL_ALWAYS + }; + + inline void setFunction(const Function func,int ref,uint mask) + { + _func = func; + _funcRef = ref; + _funcMask = mask; + } + + inline const Function getFunction() const { return _func; } + + inline const int getFunctionRef() const { return _funcRef; } + + inline const uint getFunctionMask() const { return _funcMask; } + + + enum Operation + { + KEEP = GL_KEEP, + ZERO = GL_ZERO, + REPLACE = GL_REPLACE, + INCR = GL_INCR, + DECR = GL_DECR, + INVERT = GL_INVERT + }; + + /** set the operations to apply when the various stencil and depth + * tests fail or pass. First paramater is to control the operation + * when the stencil test fails. The second paramter is to control the + * operatiorn when the stencil test passes, but depth test fails. The + * third parameter controls the operation when both the stencil test + * and depth pass. Ordering of parameter is the same as if using + * glStencilOp(,,).*/ + inline void setOperation(const Operation sfail, const Operation zfail, const Operation zpass) + { + _sfail = sfail; + _zfail = zfail; + _zpass = zpass; + } + + /** get the operation when the stencil test fails.*/ + inline const Operation getStencilFailOperation() const { return _sfail; } + + /** get the operation when the stencil test passes but the depth test fails*/ + inline const Operation getStencilPassAndDepthFailOperation() const { return _zfail; } + + /** get the operation when both the stencil test and the depth test pass*/ + inline const Operation getStencilPassAndDepthPassOperation() const { return _zpass; } + + + inline void setWriteMask(uint mask) { _writeMask = mask; } + + inline const uint getWriteMask() const { return _writeMask; } + + + virtual void apply(State& state) const; + + protected: + + virtual ~Stencil(); + + Function _func; + int _funcRef; + uint _funcMask; + + Operation _sfail; + Operation _zfail; + Operation _zpass; + + uint _writeMask; + +}; + +}; + +#endif diff --git a/include/osg/Transform b/include/osg/Transform new file mode 100644 index 000000000..9b886cb87 --- /dev/null +++ b/include/osg/Transform @@ -0,0 +1,46 @@ +#ifndef OSG_TRANSFORM +#define OSG_TRANSFORM 1 + +#include +#include + +namespace osg { + +/** Transform - is group which all children + are transformed by the the Transform's osg::Matrix. Typical uses + of the Transform is for positioning objects within a scene or + producing trakerball functionality or for animatiion. +*/ +class SG_EXPORT Transform : public Group +{ + public : + Transform(); + Transform(const Matrix& matix); + + virtual Object* clone() const { return new Transform(); } + virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast(obj)!=NULL; } + virtual const char* className() const { return "Transform"; } + virtual void accept(NodeVisitor& nv) { nv.apply(*this); } + + void setMatrix(const Matrix& mat ); + inline Matrix& getMatrix() { return *_matrix; } + inline const Matrix& getMatrix() const { return *_matrix; } + + void preMult( const Matrix& mat ); + void preScale( const float sx, const float sy, const float sz ); + void preTranslate( const float tx, const float ty, const float tz ); + void preRotate( const float deg, const float x, const float y, const float z ); + + + protected : + + virtual ~Transform(); + + virtual const bool computeBound() const; + + ref_ptr _matrix; +}; + +}; + +#endif diff --git a/include/osg/mem_ptr b/include/osg/mem_ptr new file mode 100644 index 000000000..0331cd989 --- /dev/null +++ b/include/osg/mem_ptr @@ -0,0 +1,202 @@ +#ifndef OSG_MEM_PTR +#define OSG_MEM_PTR 1 + +#include +#include + +#include + +namespace osg { + +/** Smart pointer for handling memory pointers via associated memory adapter.*/ +template +class mem_ptr +{ + + public: + mem_ptr() :_ptr(0L),_ma(0L) {} + + mem_ptr(T* t,MemoryAdapter* ma):_ptr(t),_ma(ma) + { + if (_ptr && _ma.valid()) _ma->ref_data(_ptr); + } + + mem_ptr(const mem_ptr& rp):_ptr(rp._ptr),_ma(rp._ma) + { + if (_ptr && _ma.valid()) _ma->unref_data(_ptr); + } + + ~mem_ptr() + { + if (_ptr && _ma.valid()) _ma->ref_data(_ptr); + } + + inline mem_ptr& operator = (const mem_ptr& rp) + { + if (_ptr==rp._ptr) return *this; + if (_ptr && _ma.valid()) _ma->unref_data(_ptr); + _ptr = rp._ptr; + _ma = rp._ma; + if (_ptr && _ma.valid()) _ma->ref_data(_ptr); + return *this; + } + + inline void set(T* t,MemoryAdapter* ma) + { + if (_ptr==t) + { + if (_ma==ma) return; + if (ma) + { + ma->ref(_ptr); + if (_ma.valid()) _ma->unref_data(_ptr); + } + _ma = ma; + } + else + { + if (_ptr && _ma.valid()) _ma->unref_data(_ptr); + _ptr = t; + _ma = rp._ma; + if (_ptr && _ma.valid()) _ma->ref_data(_ptr); + } + + } + + inline const bool operator == (const mem_ptr& rp) const + { + return (_ptr==rp._ptr); + } + + inline const bool operator == (const T* ptr) const + { + return (_ptr==ptr); + } + + inline const bool operator != (const mem_ptr& rp) const + { + return (_ptr!=rp._ptr); + } + + inline const bool operator != (const T* ptr) const + { + return (_ptr!=ptr); + } + + inline T& operator*() { return *_ptr; } + inline const T& operator*() const { return *_ptr; } + + inline T* operator->() { return _ptr; } + inline const T* operator->() const { return _ptr; } + + inline const bool operator!() const { return _ptr==0L; } + inline const bool valid() const { return _ptr!=0L; } + + inline T* get() { return _ptr; } + inline const T* get() const { return _ptr; } + + private: + T* _ptr; + ref_ptr _ma; +}; + + +// /** Exprimental memory adapter implmentation.*/ +// template +// class CppMemoryAdapter : public MemoryAdapter +// { +// public: +// +// virtual void ref_data(void* userData) +// { +// ++_memoryMap[(T*)userData]; +// } +// +// virtual void unref_data(void* userData) +// { +// --_memoryMap[(T*)userData]; +// if (_memoryMap[(T*)userData]<=0) delete userData; +// _memoryMap.erase((T*)userData); +// } +// +// protected: +// +// static std::map _memoryMap; +// +// }; +// +// /** Exprimental memory adapter implmentation.*/ +// class NewMemoryAdapter : public MemoryAdapter +// { +// public: +// +// static MemoryAdapter* instance(); +// +// virtual void ref_data(void* userData) +// { +// ++_memoryMap[userData]; +// } +// +// virtual void unref_data(void* userData) +// { +// --_memoryMap[userData]; +// if (_memoryMap[userData]<=0) delete userData; +// _memoryMap.erase(userData); +// } +// +// protected: +// +// NewMemoryAdapter() {} +// NewMemoryAdapter(NewMemoryAdapter&):MemoryAdapter() {} +// ~NewMemoryAdapter() {} +// +// std::map _memoryMap; +// +// }; +// +// /** Exprimental memory adapter implmentation.*/ +// template +// class newMemoryAdapter : public MemoryAdapter +// { +// public: +// +// static newMemoryAdapter* instance() +// { +// static ref_ptr > s_newMemoryAdapter = new newMemoryAdapter(); +// return s_newMemoryAdapter.get(); +// } +// +// T* allocate(int no) { cout<<"Allocating Memory"< _memoryMap; +// +// }; + + +}; + +#endif diff --git a/include/osg/ref_ptr b/include/osg/ref_ptr new file mode 100644 index 000000000..35f34339e --- /dev/null +++ b/include/osg/ref_ptr @@ -0,0 +1,87 @@ +#ifndef OSG_REF_PTR +#define OSG_REF_PTR 1 + +namespace osg { + +/** Smart pointer for handling referenced counted objects.*/ +template +class ref_ptr +{ + + public: + ref_ptr() :_ptr(0L) {} + ref_ptr(T* t):_ptr(t) { if (_ptr) _ptr->ref(); } + ref_ptr(const ref_ptr& rp):_ptr(rp._ptr) { if (_ptr) _ptr->ref(); } + ~ref_ptr() { if (_ptr) _ptr->unref(); } + + inline ref_ptr& operator = (const ref_ptr& rp) + { + if (_ptr==rp._ptr) return *this; + if (_ptr) _ptr->unref(); + _ptr = rp._ptr; + if (_ptr) _ptr->ref(); + return *this; + } + + inline ref_ptr& operator = (T* ptr) + { + if (_ptr==ptr) return *this; + if (_ptr) _ptr->unref(); + _ptr = ptr; + if (_ptr) _ptr->ref(); + return *this; + } + + inline const bool operator == (const ref_ptr& rp) const + { + return (_ptr==rp._ptr); + } + + inline const bool operator == (const T* ptr) const + { + return (_ptr==ptr); + } + + inline const bool operator != (const ref_ptr& rp) const + { + return (_ptr!=rp._ptr); + } + + inline const bool operator != (const T* ptr) const + { + return (_ptr!=ptr); + } + + inline const bool operator < (const ref_ptr& rp) const + { + return (_ptr() { return _ptr; } + + inline const T* operator->() const { return _ptr; } + + inline const bool operator!() const { return _ptr==0L; } + + inline const bool valid() const { return _ptr!=0L; } + + inline T* get() { return _ptr; } + + inline const T* get() const { return _ptr; } + + private: + T* _ptr; +}; + +}; + +#endif diff --git a/include/osgUtil/CullViewState b/include/osgUtil/CullViewState new file mode 100644 index 000000000..0d8c595f4 --- /dev/null +++ b/include/osgUtil/CullViewState @@ -0,0 +1,85 @@ +#ifndef OSGUTIL_CULLVIEWSTATE +#define OSGUTIL_CULLVIEWSTATE 1 + +#include +#include +#include +#include + +#include + +namespace osgUtil { + +/** Container class for encapsulating the viewing state in local + coordinates, during the cull traversal. +*/ +class OSGUTIL_EXPORT CullViewState : public osg::Referenced +{ + public: + + CullViewState(); + + osg::ref_ptr _matrix; + osg::ref_ptr _inverse; + osg::Vec3 _eyePoint; + osg::Vec3 _centerPoint; + osg::Vec3 _lookVector; + osg::Vec3 _upVector; + unsigned int _bbCornerFar; + unsigned int _bbCornerNear; + float _ratio2; + + osg::ClippingVolume _clippingVolume; + + + enum + { + NO_CULLING = 0x00, + FRUSTUM_LEFT_CULLING = 0x01, + FRUSTUM_RIGHT_CULLING = 0x02, + FRUSTUM_BOTTOM_CULLING = 0x04, + FRUSTUM_TOP_CULLING = 0x08, + FRUSTUM_NEAR_CULLING = 0x10, + FRUSTUM_FAR_CULLING = 0x20, + VIEW_FRUSTUM_CULLING = 0x3F, + SMALL_FEATURE_CULLING = 0x40, + ENALBE_ALL_CULLING = 0x7F + }; + + typedef unsigned int CullingMode; + + inline bool isCulled(const osg::BoundingSphere& sp,CullingMode& mode) const + { + if (!sp.isValid()) return true; + + if (!_clippingVolume.contains(sp,mode)) return true; + + if (mode&SMALL_FEATURE_CULLING) + { + osg::Vec3 delta(sp._center-_eyePoint); + if (sp.radius2() +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +namespace osgUtil { + +/** + * Basic NodeVisitor implementation for rendering a scene. + * This visitor traverses the scene graph, collecting transparent and + * opaque osg::Drawables into a depth sorted transparent bin and a state + * sorted opaque bin. The opaque bin is rendered first, and then the + * transparent bin in rendered in order from the furthest osg::Drawable + * from the eye to the one nearest the eye. + */ +class OSGUTIL_EXPORT CullVisitor : public osg::NodeVisitor +{ + public: + + CullVisitor(); + virtual ~CullVisitor(); + + void reset(); + + virtual void apply(osg::Node&); + virtual void apply(osg::Geode& node); + virtual void apply(osg::Billboard& node); + virtual void apply(osg::LightSource& node); + + virtual void apply(osg::Group& node); + virtual void apply(osg::Transform& node); + virtual void apply(osg::Switch& node); + virtual void apply(osg::LOD& node); + virtual void apply(osg::Impostor& node); + + void setCamera(const osg::Camera& camera); + + const osg::Camera* getCamera() const { return _camera.get(); } + + void setLODBias(const float bias) { _LODBias = bias; } + const float getLODBias() const { return _LODBias; } + + /** Switch the creation of Impostors on or off. + * Setting active to false forces the CullVisitor to use the Impostor + * LOD children for rendering. Setting active to true forces the + * CullVisitor to create the appropriate pre-rendering stages which + * render to the ImpostorSprite's texture.*/ + void setImpostorsActive(const bool active) { _impostorActive = active; } + + /** Get whether impostors are active or not. */ + const bool getImpostorsActive() const { return _impostorActive; } + + /** Set the impostor error threshold. + * Used in calculation of whether impostors remain valid.*/ + void setImpostorPixelErrorThreshold(const float numPixels) { _impostorPixelErrorThreshold=numPixels; } + + /** Get the impostor error threshold.*/ + const float getImpostorPixelErrorThreshold() const { return _impostorPixelErrorThreshold; } + + /** Set whether ImpsotorSprite's should be placed in a depth sorted bin for rendering.*/ + void setDepthSortImpostorSprites(const bool doDepthSort) { _depthSortImpostorSprites = doDepthSort; } + + /** Get whether ImpsotorSprite's are depth sorted bin for rendering.*/ + const bool setDepthSortImpostorSprites() const { return _depthSortImpostorSprites; } + + /** Set the number of frames that an ImpsotorSprite's is kept whilst not being beyond, + * before being recycled.*/ + void setNumberOfFrameToKeepImpostorSprites(const int numFrames) { _numFramesToKeepImpostorSprites = numFrames; } + + /** Get the number of frames that an ImpsotorSprite's is kept whilst not being beyond, + * before being recycled.*/ + const int getNumberOfFrameToKeepImpostorSprites() const { return _numFramesToKeepImpostorSprites; } + + enum TransparencySortMode { + LOOK_VECTOR_DISTANCE, + OBJECT_EYE_POINT_DISTANCE + }; + + void setTransparencySortMode(TransparencySortMode tsm) { _tsm = tsm; } + + /** Sets the current CullingMode.*/ + void setCullingMode(CullViewState::CullingMode mode); + + /** Returns the current CullingMode.*/ + CullViewState::CullingMode getCullingMode() const; + + /** Set the viewport. + * Used to enable the CullVisitor can make decision + * such as based on viewport dimensions,.*/ + void setViewport(int x,int y,int width,int height) + { + _view[0] = x; + _view[1] = y; + _view[2] = width; + _view[3] = height; + } + + /** Get the viewport. */ + void getViewport(int& x,int& y,int& width,int& height) + { + x = _view[0]; + y = _view[1]; + width = _view[2]; + height = _view[3]; + } + + + /** Set the frame number.*/ + inline void setFrameNumber(const int fn) { _frameNumber = fn; } + + /** Get the frame number.*/ + inline const int getFrameNumber() const { return _frameNumber; } + + + void pushCullViewState(const osg::Matrix* matrix=NULL); + void popCullViewState(); + + /** Push state set on the current state group. + * If the state exists in a child state group of the current + * state group then move the current state group to that child. + * Otherwise, create a new state group for the state set, add + * it to the current state group then move the current state + * group pointer to the new state group. + */ + inline void pushStateSet(const osg::StateSet* ss) + { + _currentRenderGraph = _currentRenderGraph->find_or_insert(ss); + if (ss->useRenderBinDetails()) + { + _currentRenderBin = _currentRenderBin->find_or_insert(ss->getBinNumber(),ss->getBinName()); + } + } + + /** Pop the top state set and hence associated state group. + * Move the current state group to the parent of the popped + * state group. + */ + inline void popStateSet() + { + if (_currentRenderGraph->_stateset->useRenderBinDetails()) + { + _currentRenderBin = _currentRenderBin->_parent; + } + _currentRenderGraph = _currentRenderGraph->_parent; + } + + void setRenderGraph(RenderGraph* rg) + { + _rootRenderGraph = rg; + _currentRenderGraph = rg; + } + + RenderGraph* getRenderGraph() + { + return _rootRenderGraph.get(); + } + + void setRenderStage(RenderStage* rg) + { + _rootRenderStage = rg; + _currentRenderBin = rg; + } + + RenderStage* getRenderStage() + { + return _rootRenderStage.get(); + } + + const float getCalculatedNearPlane() const { return _calculated_znear; } + + const float getCalculatedFarPlane() const { return _calculated_zfar; } + + protected: + + /** prevent unwanted copy construction.*/ + CullVisitor(const CullVisitor&):osg::NodeVisitor() {} + + /** prevent unwanted copy operator.*/ + CullVisitor& operator = (const CullVisitor&) { return *this; } + + inline osg::Matrix* getCurrentMatrix() + { + return _cvs->_matrix.get(); + } + + + inline osg::Matrix* getInverseCurrentMatrix() + { + return _cvs->_inverse.get(); + } + + inline const osg::Vec3& getEyeLocal() const + { + return _cvs->_eyePoint; + } + + + inline const osg::Vec3& getCenterLocal() const + { + return _cvs->_centerPoint; + } + + + inline const osg::Vec3& getLookVectorLocal() const + { + return _cvs->_lookVector; + } + + + inline bool isCulled(const osg::BoundingSphere& sp,CullViewState::CullingMode& mode) const + { + return _cvs->isCulled(sp,mode); + } + + inline const bool isCulled(const osg::BoundingBox& bb,const CullViewState::CullingMode mode) const + { + return _cvs->isCulled(bb,mode); + } + + void updateCalculatedNearFar(const osg::BoundingBox& bb); + + void updateCalculatedNearFar(const osg::Vec3& pos); + + + /** Add a drawable to current render graph.*/ + inline void addDrawable(osg::Drawable* drawable,osg::Matrix* matrix) + { + if (_currentRenderGraph->leaves_empty()) + { + // this is first leaf to be added to RenderGraph + // and therefore should not already know to current render bin, + // so need to add it. + _currentRenderBin->addRenderGraph(_currentRenderGraph); + } + //_currentRenderGraph->addLeaf(new RenderLeaf(drawable,matrix)); + _currentRenderGraph->addLeaf(createOrReuseRenderLeaf(drawable,matrix)); + } + + /** Add a drawable and depth to current render graph.*/ + inline void addDrawableAndDepth(osg::Drawable* drawable,osg::Matrix* matrix,const float depth) + { + if (_currentRenderGraph->leaves_empty()) + { + // this is first leaf to be added to RenderGraph + // and therefore should not already know to current render bin, + // so need to add it. + _currentRenderBin->addRenderGraph(_currentRenderGraph); + } + //_currentRenderGraph->addLeaf(new RenderLeaf(drawable,matrix,depth)); + _currentRenderGraph->addLeaf(createOrReuseRenderLeaf(drawable,matrix,depth)); + } + + /** Add a light to current render graph.*/ + inline void addLight(osg::Light* light,osg::Matrix* matrix) + { + _currentRenderBin->_stage->addLight(light,matrix); + } + + /** create an impostor sprite by setting up a pre-rendering stage + * to generate the impostor texture. */ + osg::ImpostorSprite* createImpostorSprite(osg::Impostor& node); + + int _frameNumber; + + typedef std::vector< osg::ref_ptr > CullViewStateStack; + CullViewStateStack _viewStateStack; + osg::ref_ptr _tvs; + osg::ref_ptr _cvs; + + osg::ref_ptr _rootRenderGraph; + RenderGraph* _currentRenderGraph; + + osg::ref_ptr _rootRenderStage; + RenderBin* _currentRenderBin; + + std::vector _cullingModeStack; + + float _LODBias; + + float _calculated_znear; + float _calculated_zfar; + + osg::ref_ptr _camera; + + TransparencySortMode _tsm; + + // viewport x,y,width,height respectiveyly. + int _view[4]; + + bool _impostorActive; + bool _depthSortImpostorSprites; + float _impostorPixelErrorThreshold; + int _numFramesToKeepImpostorSprites; + + typedef std::vector< osg::ref_ptr > MatrixList; + MatrixList _reuseMatrixList; + unsigned int _currentReuseMatrixIndex; + + inline osg::Matrix* createOrReuseMatrix() + { + // skip of any already reused matrix. + while (_currentReuseMatrixIndex<_reuseMatrixList.size() && + _reuseMatrixList[_currentReuseMatrixIndex]->referenceCount()>1) + { + osg::notify(osg::NOTICE)<<"Warning:createOrReuseMatrix() skipping multiply refrenced entry."<makeIdent(); + return matrix; + } + + // otherwise need to create new matrix. + osg::Matrix* matrix = new osg::Matrix(); + _reuseMatrixList.push_back(matrix); + ++_currentReuseMatrixIndex; + return matrix; + } + + typedef std::vector< osg::ref_ptr > RenderLeafList; + RenderLeafList _reuseRenderLeafList; + unsigned int _currentReuseRenderLeafIndex; + + inline RenderLeaf* createOrReuseRenderLeaf(osg::Drawable* drawable,osg::Matrix* matrix, float depth=0.0f) + { + // skip of any already reused renderleaf. + while (_currentReuseRenderLeafIndex<_reuseRenderLeafList.size() && + _reuseRenderLeafList[_currentReuseRenderLeafIndex]->referenceCount()>1) + { + osg::notify(osg::NOTICE)<<"Warning:createOrReuseRenderLeaf() skipping multiply refrenced entry."<set(drawable,matrix,depth); + return renderleaf; + } + + // otherwise need to create new renderleaf. + RenderLeaf* renderleaf = new RenderLeaf(drawable,matrix,depth); + _reuseRenderLeafList.push_back(renderleaf); + ++_currentReuseRenderLeafIndex; + return renderleaf; + } + + osg::ref_ptr _impostorSpriteManager; + +}; + +}; + +#endif + diff --git a/include/osgUtil/DepthSortedBin b/include/osgUtil/DepthSortedBin new file mode 100644 index 000000000..536ab9041 --- /dev/null +++ b/include/osgUtil/DepthSortedBin @@ -0,0 +1,46 @@ +#ifndef OSGUTIL_DEPTHSORTEDBIN +#define OSGUTIL_DEPTHSORTEDBIN 1 + +#include + +namespace osgUtil { + +class OSGUTIL_EXPORT DepthSortedBin : public RenderBin +{ + + public: + + DepthSortedBin(); + + virtual osg::Object* clone() const { return new DepthSortedBin(); } + virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast(obj)!=0L; } + virtual const char* className() const { return "DepthSortedBin"; } + + virtual void reset(); + + virtual void sort_local(); + + virtual void draw_local(osg::State& state,RenderLeaf*& previous); + + enum DrawOrder + { + FRONT_TO_BACK, + BACK_TO_FRONT + }; + + void setDrawOrder(const DrawOrder drawOrder) { _drawOrder = drawOrder; } + + const DrawOrder getDrawOrder() const { return _drawOrder; } + + protected: + + virtual ~DepthSortedBin(); + + DrawOrder _drawOrder; + RenderLeafList _renderLeafList; +}; + +}; + +#endif + diff --git a/include/osgUtil/GUIEventHandler b/include/osgUtil/GUIEventHandler new file mode 100644 index 000000000..be493ddbe --- /dev/null +++ b/include/osgUtil/GUIEventHandler @@ -0,0 +1,23 @@ +#ifndef OSGUTIL_GUIEVENTHANDLER +#define OSGUTIL_GUIEVENTHANDLER 1 + +#include + +#include +#include +#include + +namespace osgUtil{ + +class OSGUTIL_EXPORT GUIEventHandler : public osg::Referenced +{ + public: + + /** Handle events, return true if handled, false otherwise.*/ + virtual bool handle(const GUIEventAdapter& ea,GUIActionAdapter& us)=0; + +}; + +}; + +#endif diff --git a/include/osgUtil/InsertImpostorsVisitor b/include/osgUtil/InsertImpostorsVisitor new file mode 100644 index 000000000..6dd40a7bb --- /dev/null +++ b/include/osgUtil/InsertImpostorsVisitor @@ -0,0 +1,57 @@ +#ifndef OSGUTIL_INSERTIMPOSTORSVISITOR +#define OSGUTIL_INSERTIMPOSTORSVISITOR + +#include +#include + +#include + +namespace osgUtil { + +/** Insert impostor nodes into scene graph. + * For example of usage see src/Demos/osgimpostor. + */ +class OSGUTIL_EXPORT InsertImpostorsVisitor : public osg::NodeVisitor +{ + public: + + /// default to traversing all children. + InsertImpostorsVisitor(); + + void setImpostorThresholdRatio(const float ratio) { _impostorThresholdRatio = ratio; } + const float getImpostorThresholdRatio() const { return _impostorThresholdRatio; } + + void setMaximumNumberOfNestedImpostors(const unsigned int num) { _maximumNumNestedImpostors = num; } + const unsigned int getMaximumNumberOfNestedImpostors() const { return _maximumNumNestedImpostors; } + + /** empty visitor, make it ready for next traversal.*/ + void reset(); + + virtual void apply(osg::Node& node); + + virtual void apply(osg::Group& node); + + virtual void apply(osg::LOD& node); + + virtual void apply(osg::Impostor& node); + + /* insert the required impostors into the scene graph.*/ + void insertImpostors(); + + protected: + + typedef std::vector< osg::Group* > GroupList; + typedef std::vector< osg::LOD* > LODList; + + GroupList _groupList; + LODList _lodList; + + float _impostorThresholdRatio; + unsigned int _maximumNumNestedImpostors; + unsigned int _numNestedImpostors; + +}; + +}; + +#endif diff --git a/include/osgUtil/RenderBin b/include/osgUtil/RenderBin new file mode 100644 index 000000000..82f92b1e0 --- /dev/null +++ b/include/osgUtil/RenderBin @@ -0,0 +1,101 @@ +#ifndef OSGUTIL_RENDERBIN +#define OSGUTIL_RENDERBIN 1 + +#include +#include + +#include +#include +#include + +namespace osgUtil { + +class RenderStage; + +/** + * RenderBin base class. + */ +class OSGUTIL_EXPORT RenderBin : public osg::Object +{ + public: + + typedef std::vector RenderLeafList; + typedef std::vector RenderGraphList; + typedef std::map< int, osg::ref_ptr > RenderBinList; + + // static methods. + static RenderBin* createRenderBin(const std::string& binName); + static void addRenderBinPrototype(RenderBin* proto); + static void removeRenderBinPrototype(RenderBin* proto); + + + RenderBin(); + + virtual osg::Object* clone() const { return new RenderBin(); } + virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast(obj)!=0L; } + virtual const char* className() const { return "RenderBin"; } + + virtual void reset(); + + RenderBin* find_or_insert(int binNum,const std::string& binName); + + void addRenderGraph(RenderGraph* rg) + { + _renderGraphList.push_back(rg); + } + + + void sort(); + + virtual void sort_local() {} + + virtual void draw(osg::State& state,RenderLeaf*& previous); + + virtual void draw_local(osg::State& state,RenderLeaf*& previous); + + /** extract stats for current draw list. */ + void getPrims(Statistics *primStats); + + public: + + + int _binNum; + RenderBin* _parent; + RenderStage* _stage; + RenderBinList _bins; + RenderGraphList _renderGraphList; + + typedef std::map< std::string, osg::ref_ptr > RenderBinPrototypeList; + static RenderBinPrototypeList s_renderBinPrototypeList; + + protected: + + virtual ~RenderBin(); + +}; + +/** Proxy class for automatic registration of renderbins with the RenderBin prototypelist.*/ +template +class RegisterRenderBinProxy +{ + public: + RegisterRenderBinProxy() + { + _rb = new T; + RenderBin::addRenderBinPrototype(_rb.get()); + } + + ~RegisterRenderBinProxy() + { + RenderBin::removeRenderBinPrototype(_rb.get()); + } + + protected: + osg::ref_ptr _rb; +}; + + +}; + +#endif + diff --git a/include/osgUtil/RenderGraph b/include/osgUtil/RenderGraph new file mode 100644 index 000000000..50df850c6 --- /dev/null +++ b/include/osgUtil/RenderGraph @@ -0,0 +1,200 @@ +#ifndef OSGUTIL_RENDERGRAPH +#define OSGUTIL_RENDERGRAPH 1 + +#include +#include +#include +#include +#include + +#include + +#include +#include + +namespace osgUtil { + + +// beginings of a replacement for DrawBin. + +class OSGUTIL_EXPORT RenderGraph : public osg::Referenced +{ + public: + + + typedef std::map< const osg::StateSet*, osg::ref_ptr > ChildList; + typedef std::vector< osg::ref_ptr > LeafList; + + RenderGraph* _parent; + osg::ref_ptr _stateset; + + int _depth; + ChildList _children; + LeafList _leaves; + + + RenderGraph(): + _parent(NULL), + _stateset(NULL), + _depth(0) + { + } + + RenderGraph(RenderGraph* parent,const osg::StateSet* stateset): + _parent(parent), + _stateset(stateset) + { + if (_parent) _depth = _parent->_depth + 1; + else _depth = 0; + } + + ~RenderGraph() {} + + + /** return true if all of drawables, lights and chilren are empty.*/ + inline const bool empty() const + { + return _leaves.empty() && _children.empty(); + } + + inline const bool leaves_empty() const + { + return _leaves.empty(); + } + + /** reset the internal contents of a RenderGraph, including deleting all children.*/ + void reset(); + + /** recursively clean the RenderGraph of all its drawables, lights and depths. + * Leaves children intact, and ready to be populated again.*/ + void clean(); + + /** recursively prune the RenderGraph of empty children.*/ + void prune(); + + + inline RenderGraph* find_or_insert(const osg::StateSet* stateset) + { + // search for the appropriate state group, return it if found. + ChildList::iterator itr = _children.find(stateset); + if (itr!=_children.end()) return itr->second.get(); + + // create a state group and insert it into the chilren list + // then return the state group. + RenderGraph* sg = new RenderGraph(this,stateset); + _children[stateset] = sg; + return sg; + } + + /** add a render leaf.*/ + inline void addLeaf(RenderLeaf* leaf) + { + if (leaf) + { + _leaves.push_back(leaf); + leaf->_parent = this; + } + } + + static inline void moveRenderGraph(osg::State& state,RenderGraph* sg_curr,RenderGraph* sg_new) + { + if (sg_new==sg_curr || sg_new==NULL) return; + + if (sg_curr==NULL) + { + + // use return path to trace back steps to sg_new. + std::vector return_path; + + // need to pop back root render graph. + do + { + return_path.push_back(sg_new); + sg_new = sg_new->_parent; + } while (sg_new); + + for(std::vector::reverse_iterator itr=return_path.rbegin(); + itr!=return_path.rend(); + ++itr) + { + RenderGraph* rg = (*itr); + if (rg->_stateset.valid()) state.pushStateSet(rg->_stateset.get()); + } + return; + } + + + // first handle the typical case which is two state groups + // are neighbours. + if (sg_curr->_parent==sg_new->_parent) + { + + // state has changed so need to pop old state. + if (sg_curr->_stateset.valid()) state.popStateSet(); + // and push new state. + if (sg_new->_stateset.valid()) state.pushStateSet(sg_new->_stateset.get()); + return; + } + + + // need to pop back upto the same depth as the new state group. + while (sg_curr->_depth>sg_new->_depth) + { + if (sg_curr->_stateset.valid()) state.popStateSet(); + sg_curr = sg_curr->_parent; + } + + // use return path to trace back steps to sg_new. + std::vector return_path; + + // need to pop back upto the same depth as the curr state group. + while (sg_new->_depth>sg_curr->_depth) + { + return_path.push_back(sg_new); + sg_new = sg_new->_parent; + } + + // now pop back up both parent paths until they agree. + while (sg_curr->_parent!=sg_new->_parent) + { + if (sg_curr->_stateset.valid()) state.popStateSet(); + sg_curr = sg_curr->_parent; + + return_path.push_back(sg_new); + sg_new = sg_new->_parent; + } + + for(std::vector::reverse_iterator itr=return_path.rbegin(); + itr!=return_path.rend(); + ++itr) + { + RenderGraph* rg = (*itr); + if (rg->_stateset.valid()) state.pushStateSet(rg->_stateset.get()); + } + + } + + inline static void moveToRootRenderGraph(osg::State& state,RenderGraph* sg_curr) + { + // need to pop back all statesets and matrices. + while (sg_curr) + { + if (sg_curr->_stateset.valid()) state.popStateSet(); + sg_curr = sg_curr->_parent; + } + + } + + private: + + /// disallow copy construction. + RenderGraph(const RenderGraph&):osg::Referenced() {} + /// disallow copy operator. + RenderGraph& operator = (const RenderGraph&) { return *this; } + +}; + +}; + +#endif + diff --git a/include/osgUtil/RenderLeaf b/include/osgUtil/RenderLeaf new file mode 100644 index 000000000..1690750f6 --- /dev/null +++ b/include/osgUtil/RenderLeaf @@ -0,0 +1,77 @@ +#ifndef OSGUTIL_RENDERLEAF +#define OSGUTIL_RENDERLEAF 1 + +#include +#include +#include +#include + +#include + +namespace osgUtil { + +// forward declare RenderGraph +class RenderGraph; + +/** container class for all data required for rendering of drawables. + */ +class OSGUTIL_EXPORT RenderLeaf : public osg::Referenced +{ + public: + + + inline RenderLeaf(osg::Drawable* drawable,osg::Matrix* matrix, float depth=0.0f): + _parent(NULL), + _drawable(drawable), + _matrix(matrix), + _depth(depth) {} + + + inline void set(osg::Drawable* drawable,osg::Matrix* matrix, float depth=0.0f) + { + _parent = NULL; + _drawable = drawable; + _matrix = matrix; + _depth = depth; + } + + inline void reset() + { + _parent = NULL; + _drawable = NULL; + _matrix = NULL; + _depth = 0.0f; + } + + + virtual void render(osg::State& state,RenderLeaf* previous); + + /// allow RenderGraph to change the RenderLeaf's _parent. + friend RenderGraph; + + public: + + RenderGraph* _parent; + osg::Drawable* _drawable; + osg::ref_ptr _matrix; + float _depth; + + private: + + /// disallow creation of blank RenderLeaf as this isn't useful. + RenderLeaf(): + _parent(NULL), + _drawable(NULL), + _matrix(NULL), + _depth(0.0f) {} + + /// disallow copy construction. + RenderLeaf(const RenderLeaf&):osg::Referenced() {} + /// disallow copy operator. + RenderLeaf& operator = (const RenderLeaf&) { return *this; } + +}; + +}; + +#endif diff --git a/include/osgUtil/RenderStage b/include/osgUtil/RenderStage new file mode 100644 index 000000000..a7dffd51c --- /dev/null +++ b/include/osgUtil/RenderStage @@ -0,0 +1,154 @@ +#ifndef OSGUTIL_RENDERSTAGE +#define OSGUTIL_RENDERSTAGE 1 + +#include + +#include +#include + +namespace osgUtil { + +/** + * RenderState base class. Used for encapsulate a complete stage in + * rendering - setting up of viewport, the projection and model + * matrices and rendering the RenderBin's enclosed with this RenderStage. + * RenderStage also has a dependancy list of other RenderStages, each + * of which must be called before the rendering of this stage. These + * 'pre' rendering stages are used for advanced rendering techniques + * like multistage pixel shading or impostors. + */ +class OSGUTIL_EXPORT RenderStage : public RenderBin +{ + public: + + + RenderStage(); + virtual osg::Object* clone() const { return new RenderStage(); } + virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast(obj)!=0L; } + virtual const char* className() const { return "RenderStage"; } + + virtual void reset(); + + + /** Set the viewport of the scene view. */ + void setViewport(int x,int y,int width,int height) + { + _view[0] = x; + _view[1] = y; + _view[2] = width; + _view[3] = height; + } + + /** Get the viewport of the scene view. */ + void getViewport(int& x,int& y,int& width,int& height) const + { + x = _view[0]; + y = _view[1]; + width = _view[2]; + height = _view[3]; + } + + + /** Set the clear mask used in glClear(..). + * Defaults to GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT. */ + void setClearMask(const GLbitfield mask) { _clearMask = mask; } + + /** Get the clear mask.*/ + const GLbitfield getClearMask() const { return _clearMask; } + + + /** Set the clear color used in glClearColor(..). + * glClearColor is only called if mask & GL_COLOR_BUFFER_BIT is true*/ + void setClearColor(const osg::Vec4& color) { _clearColor=color; } + + /** Get the clear color.*/ + const osg::Vec4& getClearColor() const { return _clearColor; } + + + /** Set the clear accum used in glClearAccum(..). + * glClearAcumm is only called if mask & GL_ACCUM_BUFFER_BIT is true*/ + void setClearAccum(const osg::Vec4& color) { _clearAccum=color; } + + /** Get the clear accum.*/ + const osg::Vec4& getClearAccum() const { return _clearAccum; } + + + + /** Set the clear depth used in glClearDepth(..). Defaults to 1.0 + * glClearDepth is only called if mask & GL_DEPTH_BUFFER_BIT is true*/ + void setClearDepth(const double depth) { _clearDepth=depth; } + + /** Get the clear depth.*/ + const double getClearDepth() const { return _clearDepth; } + + + /** Set the clear stencil value used in glClearStencil(). Defaults to 1.0 + * glClearStencil is only called if mask & GL_STENCIL_BUFFER_BIT is true*/ + void setClearStencil(const int stencil) { _clearStencil=stencil; } + + /** Get the clear color.*/ + const int getClearStencil() const { return _clearStencil; } + + + void setCamera(osg::Camera* camera) { _camera = camera; } + osg::Camera* getCamera() { return _camera.get(); } + const osg::Camera* getCamera() const { return _camera.get(); } + + + void setRenderStageLighting(RenderStageLighting* rsl) { _renderStageLighting = rsl; } + + RenderStageLighting* getRenderStageLighting() const + { + if (!_renderStageLighting.valid()) _renderStageLighting = new RenderStageLighting; + return _renderStageLighting.get(); + } + + void setLightingMode(RenderStageLighting::Mode mode) { getRenderStageLighting()->setLightingMode(mode); } + RenderStageLighting::Mode getLightingMode() const { return getRenderStageLighting()->getLightingMode(); } + + void setLight(osg::Light* light) { getRenderStageLighting()->setLight(light); } + osg::Light* getLight() { return getRenderStageLighting()->getLight(); } + const osg::Light* getLight() const { return getRenderStageLighting()->getLight(); } + + virtual void addLight(osg::Light* light,osg::Matrix* matrix) + { + getRenderStageLighting()->addLight(light,matrix); + } + + virtual void draw(osg::State& state,RenderLeaf*& previous); + + void addToDependencyList(RenderStage* rs); + + /** extract stats for current draw list. */ + void getPrims(Statistics *primStats); + + public: + + typedef std::vector< osg::ref_ptr > DependencyList; + + bool _stageDrawnThisFrame; + DependencyList _dependencyList; + + osg::ref_ptr _camera; + + // viewport x,y,width,height. + GLint _view[4]; + + GLbitfield _clearMask; + osg::Vec4 _clearColor; + osg::Vec4 _clearAccum; + double _clearDepth; + int _clearStencil; + + mutable osg::ref_ptr _renderStageLighting; + + protected: + + virtual ~RenderStage(); + +}; + +}; + +#endif + diff --git a/include/osgUtil/RenderStageLighting b/include/osgUtil/RenderStageLighting new file mode 100644 index 000000000..37835d37b --- /dev/null +++ b/include/osgUtil/RenderStageLighting @@ -0,0 +1,67 @@ +#ifndef OSGUTIL_RENDERSTAGELIGHTING +#define OSGUTIL_RENDERSTAGELIGHTING 1 + +#include +#include +#include + +#include +#include + +namespace osgUtil { + +/** + * RenderBin base class. + */ +class OSGUTIL_EXPORT RenderStageLighting : public osg::Object +{ + public: + + + RenderStageLighting(); + virtual osg::Object* clone() const { return new RenderStageLighting(); } + virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast(obj)!=0L; } + virtual const char* className() const { return "RenderStageLighting"; } + + virtual void reset(); + + enum Mode { + HEADLIGHT, // default + SKY_LIGHT, + NO_SCENEVIEW_LIGHT + }; + + void setLightingMode(Mode mode) { _lightingMode=mode; } + Mode getLightingMode() const { return _lightingMode; } + + void setLight(osg::Light* light) { _light = light; } + osg::Light* getLight() { return _light.get(); } + const osg::Light* getLight() const { return _light.get(); } + + typedef std::pair< osg::Light*, osg::ref_ptr > LightMatrixPair; + typedef std::vector< LightMatrixPair > LightList; + + virtual void addLight(osg::Light* light,osg::Matrix* matrix) + { + _lightList.push_back(LightMatrixPair(light,matrix)); + } + + virtual void draw(osg::State& state,RenderLeaf*& previous); + + public: + + Mode _lightingMode; + osg::ref_ptr _light; + LightList _lightList; + + + protected: + + virtual ~RenderStageLighting(); + +}; + +}; + +#endif + diff --git a/include/osgUtil/RenderToTextureStage b/include/osgUtil/RenderToTextureStage new file mode 100644 index 000000000..26d1fe7f8 --- /dev/null +++ b/include/osgUtil/RenderToTextureStage @@ -0,0 +1,44 @@ +#ifndef OSGUTIL_RENDERTOTEXTURESTAGE +#define OSGUTIL_RENDERTOTEXTURESTAGE 1 + +#include + +#include + +namespace osgUtil { + +/** + * RenderBin base class. + */ +class OSGUTIL_EXPORT RenderToTextureStage : public RenderStage +{ + public: + + + RenderToTextureStage(); + virtual osg::Object* clone() const { return new RenderToTextureStage(); } + virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast(obj)!=0L; } + virtual const char* className() const { return "RenderToTextureStage"; } + + virtual void reset(); + + void setTexture(osg::Texture* texture) { _texture = texture; } + osg::Texture* getTexture() { return _texture.get(); } + + virtual void draw(osg::State& state,RenderLeaf*& previous); + + public: + + + protected: + + virtual ~RenderToTextureStage(); + + osg::ref_ptr _texture; + +}; + +}; + +#endif + diff --git a/include/osgUtil/SceneViewManipulator b/include/osgUtil/SceneViewManipulator new file mode 100644 index 000000000..8c5e79903 --- /dev/null +++ b/include/osgUtil/SceneViewManipulator @@ -0,0 +1,62 @@ +#ifndef OSGUTIL_SceneViewManipulator +#define OSGUTIL_SceneViewManipulator 1 + +#include +#include +#include +#include +#include +#include + +namespace osgUtil{ + +class OSGUTIL_EXPORT SceneViewManipulator : public GUIEventHandler +{ + public: + + SceneViewManipulator(); + virtual ~SceneViewManipulator(); + + /** attach a scene view to the manipulator. */ + virtual void setSceneView(SceneView*); + + /** get the attached a scene view.*/ + virtual SceneView * getSceneView(); + + /** get the attached a const scene view.*/ + virtual const SceneView * getSceneView() const; + + /** Set the camera manipulator on the object.*/ + virtual void setCameraManipulator(CameraManipulator *cm) {_cm=cm;} + + /** Get the camera manipulator on the object */ + virtual CameraManipulator *getCameraManipulator() {return _cm.get();} + + /** Get the const camera manipulator on the object */ + virtual const CameraManipulator *getCameraManipulator() const {return _cm.get();} + + /** Set the geostate manipulator on the object.*/ + virtual void setStateSetManipulator(StateSetManipulator *cm) {_gm=cm;} + + /** Get the geostate manipulator on the object */ + virtual StateSetManipulator *getStateSetManipulator() { return _gm.get();} + + /** Get the geostate manipulator on the object */ + virtual const StateSetManipulator *getStateSetManipulator() const {return _gm.get();} + + /** Handle events, return true if handled, false otherwise.*/ + virtual bool handle(const GUIEventAdapter& ea,GUIActionAdapter& us); + + protected: + + // Reference pointer to our scene view + osg::ref_ptr _sv; + + osg::ref_ptr _cm; + osg::ref_ptr _gm; + +}; + +} + +#endif diff --git a/include/osgUtil/SmoothingVisitor b/include/osgUtil/SmoothingVisitor new file mode 100644 index 000000000..679bb4178 --- /dev/null +++ b/include/osgUtil/SmoothingVisitor @@ -0,0 +1,35 @@ +#ifndef OSGUTIL_SMOOTHINGVISITOR +#define OSGUTIL_SMOOTHINGVISITOR 1 + +#include +#include +#include + +#include + +namespace osgUtil { + +/** A smoothing visitor for calculating smoothed normals for + * osg::GeoSet's which contains surface primitives. + */ +class OSGUTIL_EXPORT SmoothingVisitor : public osg::NodeVisitor +{ + public: + + /// default to traversing all children. + SmoothingVisitor() + { + setTraversalMode(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN); + } + + /// smooth geoset by creating per vertex normals. + static void smooth(osg::GeoSet& geoset); + + /// apply smoothing method to all geode geosets. + virtual void apply(osg::Geode& geode); + +}; + +}; + +#endif diff --git a/include/osgUtil/StateSetManipulator b/include/osgUtil/StateSetManipulator new file mode 100644 index 000000000..d8cfcc3fd --- /dev/null +++ b/include/osgUtil/StateSetManipulator @@ -0,0 +1,44 @@ +#ifndef OSGUTIL_GEOSTATE_MANIPULATOR +#define OSGUTIL_GEOSTATE_MANIPULATOR 1 + +#include + +#include +#include +#include +#include + +namespace osgUtil{ + +class OSGUTIL_EXPORT StateSetManipulator : public GUIEventHandler +{ + public: + + StateSetManipulator(); + virtual ~StateSetManipulator(); + + /** attach a geostate to the manipulator to be used for specifying view.*/ + virtual void setStateSet(osg::StateSet*); + + /** get the attached a geostate.*/ + virtual osg::StateSet * getStateSet(); + + /** get the attached a geostate.*/ + virtual const osg::StateSet * getStateSet() const; + + /** Handle events, return true if handled, false otherwise.*/ + virtual bool handle(const GUIEventAdapter& ea,GUIActionAdapter& us); + + protected: + + // Reference pointer to a geostate + osg::ref_ptr _drawState; + + bool _backface; + bool _lighting; + bool _texture; +}; + +} + +#endif diff --git a/include/osgUtil/Statistics b/include/osgUtil/Statistics new file mode 100644 index 000000000..9089d18c8 --- /dev/null +++ b/include/osgUtil/Statistics @@ -0,0 +1,141 @@ +#ifndef OSGUTIL_STATISTICS +#define OSGUTIL_STATISTICS 1 + +#include + +namespace osgUtil { + +/** + * Statistics base class. Used to extract primitive information from + * the renderBin(s). + */ + +class OSGUTIL_EXPORT Statistics : public osg::Object +{ + public: + + Statistics() { + numOpaque=0, nummat=0; + nprims=0, nlights=0; nbins=0; + reset(); + }; + ~Statistics() {}; // no dynamic allocations, so no need to free + void reset() { + for (int i=0; i<20; i++) primverts[i]=numprimtypes[i]=primlens[i]=primtypes[i]=0; + } + virtual osg::Object* clone() const { return new Statistics(); } + virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast(obj)!=0L; } + virtual const char* className() const { return "Statistics"; } + + void addstat(osg::GeoSet *gs) { // analyse the drawable GeoSet + const int np=gs->getNumPrims(); // number of primitives in this geoset + nprims += np; + const int type=gs->getPrimType(); + switch (type) { + case osg::GeoSet::POINTS: + case osg::GeoSet::LINES: + case osg::GeoSet::LINE_STRIP: + case osg::GeoSet::FLAT_LINE_STRIP: + case osg::GeoSet::LINE_LOOP: + case osg::GeoSet::TRIANGLE_STRIP: + case osg::GeoSet::FLAT_TRIANGLE_STRIP: + case osg::GeoSet::TRIANGLE_FAN: + case osg::GeoSet::FLAT_TRIANGLE_FAN: + case osg::GeoSet::QUAD_STRIP: + case osg::GeoSet::POLYGON: + primtypes[type]++; + primtypes[0]++; + break; + case osg::GeoSet::TRIANGLES: // should not have any lengths for tris & quads + primtypes[type]++; + primtypes[0]++; + primlens[0]+=np; + primlens[type]+=np; + numprimtypes[type]+=np; + primverts[type]+=3*np; + primverts[0]+=3*np; + break; + case osg::GeoSet::QUADS: + primtypes[type]++; + primtypes[0]++; + primlens[0]+=np*2; + primlens[type]+=np*2; // quad is equiv to 2 triangles + numprimtypes[type]+=np; + primverts[type]+=4*np; + primverts[0]+=4*np; + break; + case osg::GeoSet::NO_TYPE: + default: + break; + } + // now count the lengths, ie efficiency of triangulation + const int *lens=gs->getPrimLengths(); // primitive lengths + for (int i=0; i +#include + +#include + +#include + +namespace osgUtil { + +/** A simple class for tesselating a single polygon boundary. + * Currently uses old style glu tesselation functions for portablity. + * It be nice to use the modern glu tesselation functions or to find + * a small set of code for doing this job better.*/ +class OSGUTIL_EXPORT Tesselator +{ + public: + + Tesselator(); + ~Tesselator(); + + enum InputBoundaryDirection + { + CLOCK_WISE, + COUNTER_CLOCK_WISE + }; + + void tesselate(osg::Vec3* coords,int numIndices, int* indices,InputBoundaryDirection ibd=COUNTER_CLOCK_WISE); + void tesselate(osg::Vec3* coords,int numIndices, osg::ushort* indices,InputBoundaryDirection ibd=COUNTER_CLOCK_WISE); + void tesselate(osg::Vec3* coords,int numIndices, osg::uint* indices,InputBoundaryDirection ibd=COUNTER_CLOCK_WISE); + + typedef std::vector IndexVec; + + const IndexVec& getResult() const { return _tesselated_indices; } + + + void beginPrimitive(int primitiveType); + void endPrimitive(); + + int _errorCode; + + + struct VertexIndexSet + { + VertexIndexSet(Tesselator* tess,const osg::Vec3& vec,osg::uint index) + { + set(tess,vec,index); + } + + VertexIndexSet(const VertexIndexSet& vip) + { + _Tesselator = vip._Tesselator; + _vertex[0] = vip._vertex[0]; + _vertex[1] = vip._vertex[1]; + _vertex[2] = vip._vertex[2]; + _index = vip._index; + + } + + VertexIndexSet& operator = (const VertexIndexSet& vip) + { + if (&vip==this) return *this; + _Tesselator = vip._Tesselator; + _vertex[0] = vip._vertex[0]; + _vertex[1] = vip._vertex[1]; + _vertex[2] = vip._vertex[2]; + _index = vip._index; + return *this; + } + + void set(Tesselator* tess,const osg::Vec3& vec,osg::uint index) + { + _Tesselator = tess; + _vertex[0] = vec[0]; + _vertex[1] = vec[1]; + _vertex[2] = vec[2]; + _index = index; + } + + void accumulate() + { + _Tesselator->_acummulated_indices.push_back(_index); + } + // note,_vertex must be first so that callbacks can use a pointer + // to it to dereference the VertexIndexSet for it. + double _vertex[3]; + Tesselator* _Tesselator; + osg::uint _index; + }; + + protected: + + friend VertexIndexSet; + + typedef std::vector CoordVec; + + void init(); + void do_it(); + + + CoordVec _coordVec; + IndexVec _tesselated_indices; + int _currentPrimtiveType; + IndexVec _acummulated_indices; + +}; + +}; + +#endif diff --git a/include/osgUtil/TriStripVisitor b/include/osgUtil/TriStripVisitor new file mode 100644 index 000000000..602685676 --- /dev/null +++ b/include/osgUtil/TriStripVisitor @@ -0,0 +1,38 @@ +#ifndef OSGUTIL_TRISTRIPVISITOR +#define OSGUTIL_TRISTRIPVISITOR 1 + +#include +#include +#include + +#include + +namespace osgUtil { + +/** A tri stripping visitor for converting GeoSet primitives into tri strips. + * The current implemention is based up NVidia's NvTriStrip. + */ +class OSGUTIL_EXPORT TriStripVisitor : public osg::NodeVisitor +{ + public: + + /// default to traversing all children. + TriStripVisitor() + { + setTraversalMode(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN); + } + + /** convert mesh primitives in geoset into Tri Strips using + * NvTriStrip. Converts all primtive types except points + * and lines, linestrips which it leaves unchanged. + */ + static void stripify(osg::GeoSet& gset); + + /// apply stripify method to all geode geosets. + virtual void apply(osg::Geode& geode); + +}; + +}; + +#endif diff --git a/include/osgUtil/VisualsRequirementsVisitor b/include/osgUtil/VisualsRequirementsVisitor new file mode 100644 index 000000000..3a9ce34c9 --- /dev/null +++ b/include/osgUtil/VisualsRequirementsVisitor @@ -0,0 +1,76 @@ +#ifndef OSGUTIL_VISUALSREQUIREMENTSVISITOR +#define OSGUTIL_VISUALSREQUIREMENTSVISITOR 1 + +#include +#include +#include + +#include + +namespace osgUtil { + +/** A visitor for traversing a scene graph establishing the OpenGL visuals are required + * to support rendering of that scene graph. The results can then be used by + * applications to set up there windows with the corret visuals. Have a look at + * src/osgGLUT/Viewer.cpp's Viewer::open() method for an example how to use it. + */ +class OSGUTIL_EXPORT VisualsRequirementsVisitor : public osg::NodeVisitor +{ + public: + + /** Default to traversing all children, and reqiresDoubleBuffer, + * requiresRGB and requiresDepthBuffer to true and with + * alpha and stencil off.*/ + VisualsRequirementsVisitor(); + + + void setRequiresDoubleBuffer(const bool flag) { _requiresDoubleBuffer = flag; } + + const bool requiresDoubleBuffer() const { return _requiresDoubleBuffer; } + + + void setRequiresRGB(const bool flag) { _requiresRBG = flag; } + + const bool requiresRGB() const { return _requiresRBG; } + + + void setRequiresDepthBuffer(const bool flag) { _requiresDepthBuffer = flag; } + + const bool requiresDepthBuffer() const { return _requiresDepthBuffer; } + + + void setMinumumNumAlphaBits(const unsigned int bits) { _minimumNumberAlphaBits = bits; } + + const unsigned int getMinumumNumAlphaBits() const { return _minimumNumberAlphaBits; } + + const bool requiresAlphaBuffer() const { return _minimumNumberAlphaBits!=0; } + + + void setMinumumNumStencilBits(const unsigned int bits) { _minimumNumberStencilBits = bits; } + + const unsigned int getMinumumNumStencilBits() const { return _minimumNumberStencilBits; } + + const bool requiresStencilBuffer() const { return _minimumNumberStencilBits!=0; } + + + virtual void applyStateSet(osg::StateSet& stateset); + + virtual void apply(osg::Node& node); + + virtual void apply(osg::Geode& geode); + + virtual void apply(osg::Impostor& impostor); + + protected: + + bool _requiresDoubleBuffer; + bool _requiresRBG; + bool _requiresDepthBuffer; + unsigned int _minimumNumberAlphaBits; + unsigned int _minimumNumberStencilBits; + +}; + +}; + +#endif diff --git a/src/Demos/osgreflect/Makedepend b/src/Demos/osgreflect/Makedepend new file mode 100644 index 000000000..e69de29bb diff --git a/src/Demos/osgreflect/Makefile b/src/Demos/osgreflect/Makefile new file mode 100644 index 000000000..87fc9124f --- /dev/null +++ b/src/Demos/osgreflect/Makefile @@ -0,0 +1,20 @@ +#!smake +include ../../../Make/makedefs + +C++FILES = \ + osgreflect.cpp \ + +TARGET = ../../../bin/osgreflect + +TARGET_BIN_FILES = osgreflect + +#note, use this library list when using the Performer osgPlugin. +#LIBS = ${PFLIBS} -losgGLUT -losgUtil -losgDB -losg $(GLUTLIB) -lGLU -lGL -lm -lXmu -lX11 -lXi + +#note, standard library list. +LIBS = -losgGLUT -losgUtil -losgDB -losg $(GLUTLIB) -lGLU -lGL -lm -lXmu -lX11 -lXi + +C++FLAGS += -I../../../include +LDFLAGS += -L../../../lib + +include ../../../Make/makerules diff --git a/src/Demos/osgreflect/osgreflect.cpp b/src/Demos/osgreflect/osgreflect.cpp new file mode 100644 index 000000000..8c3a4b6a7 --- /dev/null +++ b/src/Demos/osgreflect/osgreflect.cpp @@ -0,0 +1,484 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include +#include + + + +// +// A simple demo demonstrating planer reflections using multiple renderings +// of a subgraph, overriding of state attribures and use of the stencil buffer. +// +// The multipass system implemented here is a variation if Mark Kilgard's +// paper "Improving Shadows and Reflections via the Stencil Buffer" which +// can be found on the developer parts of the NVidia web site. +// +// The variations comes from the fact that the mirrors stencil values +// are done on the first pass, rather than the second as in Mark's paper. +// The second pass is now Mark's first pass - drawing the unreflected scene, +// but also unsets the stencil buffer. This variation stops the unreflected +// world poking through the mirror to be seen in the final rendering and +// also obscures the world correctly when on the reverse side of the mirror. +// Although there is still some unresolved issue with the clip plane needing +// to be flipped when looking at the reverse side of the mirror. Niether +// of these issues are mentioned in the Mark's paper, but trip us up when +// we apply them. + + +// create an app visitor, to be used on each frame update, +// the below app visitor rotates the loaded model. +class AppVisitor : public osg::NodeVisitor { + public: + + bool _haveDoneTransformTransform; + float _delta_angle; + float _angular_velocity; + osg::Vec3 _pivotPoint; + osg::Transform* _modifyTransform; + osg::Timer _timer; + osg::Timer_t _previous_t; + + AppVisitor() : osg::NodeVisitor(TRAVERSE_ALL_CHILDREN) + { + _haveDoneTransformTransform = true; + _modifyTransform = NULL; + _delta_angle = 0; + _angular_velocity = 45; //degrees a sec. + _previous_t = _timer.tick(); + } + + virtual void reset() + { + // set to no transform done so far in this new traversal. + _haveDoneTransformTransform = false; + + // update angle of rotation. + osg::Timer_t new_t = _timer.tick(); + _delta_angle = _angular_velocity*_timer.delta_s(_previous_t,new_t); + _previous_t = new_t; + + } + + virtual void apply(osg::Transform& visitor_dcs) + { + + if (&visitor_dcs == _modifyTransform && !_haveDoneTransformTransform) + { + // update the specified dcs. + visitor_dcs.preTranslate(_pivotPoint[0],_pivotPoint[1],_pivotPoint[2]); + visitor_dcs.preRotate(_delta_angle,0.0f,0.0f,1.0f); + visitor_dcs.preTranslate(-_pivotPoint[0],-_pivotPoint[1],-_pivotPoint[2]); + + // set to true to prevent applying rotation more than once + // since the subgraph appears twice in the overall scene. + _haveDoneTransformTransform = true; + } + } +}; + +/* + * Function to read several files (typically one) as specified on the command + * line, and return them in an osg::Node + */ +osg::Node* getNodeFromFiles(int argc,char **argv) +{ + osg::Node *rootnode = new osg::Node; + + int i; + + typedef std::vector NodeList; + NodeList nodeList; + for( i = 1; i < argc; i++ ) + { + + if (argv[i][0]=='-') + { + switch(argv[i][1]) + { + case('l'): + ++i; + if (iloadLibrary(argv[i]); + } + break; + case('e'): + ++i; + if (icreateLibraryNameForExt(argv[i]); + osgDB::Registry::instance()->loadLibrary(libName); + } + break; + } + } else + { + osg::Node *node = osgDB::readNodeFile( argv[i] ); + + if( node != (osg::Node *)0L ) + { + if (node->getName().empty()) node->setName( argv[i] ); + nodeList.push_back(node); + } + } + + } + + if (nodeList.size()==0) + { + osg::notify(osg::WARN) << "No data loaded."<1 + { + osg::Group* group = new osg::Group(); + for(NodeList::iterator itr=nodeList.begin(); + itr!=nodeList.end(); + ++itr) + { + group->addChild(*itr); + } + + rootnode = group; + } + + return rootnode; +} + +osg::StateSet* createMirrorTexturedState(const std::string& filename) +{ + osg::StateSet* dstate = new osg::StateSet; + dstate->setMode(GL_CULL_FACE,osg::StateAttribute::OFF); + + // set up the texture. + osg::Image* image = osgDB::readImageFile(filename.c_str()); + if (image) + { + osg::Texture* texture = new osg::Texture; + texture->setImage(image); + dstate->setAttributeAndModes(texture,osg::StateAttribute::ON); + } + + return dstate; +} + + +osg::Drawable* createMirrorSurface(float xMin,float xMax,float yMin,float yMax,float z) +{ + + // set up the drawstate. + + // set up the geoset. + osg::GeoSet* gset = new osg::GeoSet; + + osg::Vec3* coords = new osg::Vec3 [4]; + coords[0].set(xMin,yMax,z); + coords[1].set(xMin,yMin,z); + coords[2].set(xMax,yMin,z); + coords[3].set(xMax,yMax,z); + gset->setCoords(coords); + + osg::Vec3* norms = new osg::Vec3 [1]; + norms[0].set(0.0f,0.0f,1.0f); + gset->setNormals(norms); + gset->setNormalBinding(osg::GeoSet::BIND_OVERALL); + + osg::Vec2* tcoords = new osg::Vec2 [4]; + tcoords[0].set(0.0f,1.0f); + tcoords[1].set(0.0f,0.0f); + tcoords[2].set(1.0f,0.0f); + tcoords[3].set(1.0f,1.0f); + gset->setTextureCoords(tcoords); + gset->setTextureBinding(osg::GeoSet::BIND_PERVERTEX); + + osg::Vec4* colours = new osg::Vec4; + colours->set(1.0f,1.0f,1.0,1.0f); + gset->setColors(colours); + gset->setColorBinding(osg::GeoSet::BIND_OVERALL); + + gset->setNumPrims(1); + gset->setPrimType(osg::GeoSet::QUADS); + + return gset; +} + +void write_usage() +{ + osg::notify(osg::NOTICE)<addChild(loadedModel); + + // calculate where to place the mirror according to the + // loaded models bounding sphere. + const osg::BoundingSphere& bs = loadedModelTransform->getBound(); + + float width_factor = 1.5; + float height_factor = 0.3; + + float xMin = bs.center().x()-bs.radius()*width_factor; + float xMax = bs.center().x()+bs.radius()*width_factor; + float yMin = bs.center().y()-bs.radius()*width_factor; + float yMax = bs.center().y()+bs.radius()*width_factor; + + float z = bs.center().z()-bs.radius()*height_factor; + + + // create a textured, transparent node at the appropriate place. + osg::Drawable* mirror = createMirrorSurface(xMin,xMax,yMin,yMax,z); + + + osg::Group* rootNode = new osg::Group; + + // make sure that the global color mask exists. + osg::ColorMask* rootColorMask = new osg::ColorMask; + rootColorMask->setMask(true,true,true,true); + + // set up depth so all writing to depth goes to maximum depth. + osg::Depth* rootDepth = new osg::Depth; + rootDepth->setFunction(osg::Depth::LESS); + rootDepth->setRange(0.0,1.0); + + osg::StateSet* rootStateSet = new osg::StateSet(); + rootStateSet->setAttribute(rootColorMask); + rootStateSet->setAttribute(rootDepth); + + rootNode->setStateSet(rootStateSet); + + + // bin1 - set up the stencil values and depth for mirror. + { + + // set up the stencil ops so that the stencil buffer get set at + // the mirror plane + osg::Stencil* stencil = new osg::Stencil; + stencil->setFunction(osg::Stencil::ALWAYS,1,~0); + stencil->setOperation(osg::Stencil::KEEP, osg::Stencil::KEEP, osg::Stencil::REPLACE); + + // switch off the writing to the color bit planes. + osg::ColorMask* colorMask = new osg::ColorMask; + colorMask->setMask(false,false,false,false); + + osg::StateSet* statesetBin1 = new osg::StateSet(); + statesetBin1->setRenderBinDetails(1,"RenderBin"); + statesetBin1->setMode(GL_CULL_FACE,osg::StateAttribute::OFF); + statesetBin1->setAttributeAndModes(stencil,osg::StateAttribute::ON); + statesetBin1->setAttribute(colorMask); + + // set up the mirror geode. + osg::Geode* geode = new osg::Geode; + geode->addDrawable(mirror); + geode->setStateSet(statesetBin1); + + rootNode->addChild(geode); + + } + + // bin one - draw scene without mirror or reflection, unset + // stencil values where scene is infront of mirror and hence + // occludes the mirror. + { + osg::Stencil* stencil = new osg::Stencil; + stencil->setFunction(osg::Stencil::ALWAYS,0,~0); + stencil->setOperation(osg::Stencil::KEEP, osg::Stencil::KEEP, osg::Stencil::REPLACE); + + osg::StateSet* statesetBin2 = new osg::StateSet(); + statesetBin2->setRenderBinDetails(2,"RenderBin"); + statesetBin2->setAttributeAndModes(stencil,osg::StateAttribute::ON); + + + osg::Group* groupBin2 = new osg::Group(); + groupBin2->setStateSet(statesetBin2); + groupBin2->addChild(loadedModelTransform); + + rootNode->addChild(groupBin2); + } + + // bin3 - set up the depth to the furthest depth value + { + + // set up the stencil ops so that only operator on this mirrors stencil value. + osg::Stencil* stencil = new osg::Stencil; + stencil->setFunction(osg::Stencil::EQUAL,1,~0); + stencil->setOperation(osg::Stencil::KEEP, osg::Stencil::KEEP, osg::Stencil::KEEP); + + // switch off the writing to the color bit planes. + osg::ColorMask* colorMask = new osg::ColorMask; + colorMask->setMask(false,false,false,false); + + // set up depth so all writing to depth goes to maximum depth. + osg::Depth* depth = new osg::Depth; + depth->setFunction(osg::Depth::ALWAYS); + depth->setRange(1.0,1.0); + + osg::StateSet* statesetBin3 = new osg::StateSet(); + statesetBin3->setRenderBinDetails(3,"RenderBin"); + statesetBin3->setMode(GL_CULL_FACE,osg::StateAttribute::OFF); + statesetBin3->setAttributeAndModes(stencil,osg::StateAttribute::ON); + statesetBin3->setAttribute(colorMask); + statesetBin3->setAttribute(depth); + + // set up the mirror geode. + osg::Geode* geode = new osg::Geode; + geode->addDrawable(mirror); + geode->setStateSet(statesetBin3); + + rootNode->addChild(geode); + + } + + // bin4 - draw the reflection. + { + + // now create the 'reflection' of the loaded model by applying + // create a Transform which flips the loaded model about the z axis + // relative to the mirror node, the loadedModel is added to the + // Transform so now appears twice in the scene, but is shared so there + // is negligable memory overhead. Also use an osg::StateSet + // attached to the Transform to override the face culling on the subgraph + // to prevert an 'inside' out view of the reflected model. + // set up the stencil ops so that only operator on this mirrors stencil value. + + osg::Stencil* stencil = new osg::Stencil; + stencil->setFunction(osg::Stencil::EQUAL,1,~0); + stencil->setOperation(osg::Stencil::KEEP, osg::Stencil::KEEP, osg::Stencil::KEEP); + + // this clip plane removes any of the scene which when mirror would + // poke through the mirror. However, this clip plane should really + // flip sides once the eye point goes to the back of the mirror... + osg::ClipPlane* clipplane = new osg::ClipPlane; + clipplane->setClipPlane(osg::Vec4(0.0f,0.0f,-1.0f,z)); + clipplane->setClipPlaneNum(0); + + osg::StateSet* dstate = new osg::StateSet; + dstate->setRenderBinDetails(4,"RenderBin"); + dstate->setMode(GL_CULL_FACE,osg::StateAttribute::OVERRIDE_OFF); + dstate->setAttributeAndModes(stencil,osg::StateAttribute::ON); + dstate->setAttributeAndModes(clipplane,osg::StateAttribute::ON); + + osg::Transform* dcs = new osg::Transform; + dcs->setStateSet(dstate); + dcs->preTranslate(0.0f,0.0f,z); + dcs->preScale(1.0f,1.0f,-1.0f); + dcs->preTranslate(0.0f,0.0f,-z); + + dcs->addChild(loadedModelTransform); + + rootNode->addChild(dcs); + + } + + + // bin5 - draw the textured mirror and blend it with the reflection. + { + + // set up depth so all writing to depth goes to maximum depth. + osg::Depth* depth = new osg::Depth; + depth->setFunction(osg::Depth::ALWAYS); + + osg::Stencil* stencil = new osg::Stencil; + stencil->setFunction(osg::Stencil::EQUAL,1,~0); + stencil->setOperation(osg::Stencil::KEEP, osg::Stencil::KEEP, osg::Stencil::ZERO); + + // set up additive blending. + osg::Transparency* trans = new osg::Transparency; + trans->setFunction(osg::Transparency::ONE,osg::Transparency::ONE); + + osg::StateSet* statesetBin5 = createMirrorTexturedState("tank.rgb"); + + statesetBin5->setRenderBinDetails(5,"RenderBin"); + statesetBin5->setMode(GL_CULL_FACE,osg::StateAttribute::OFF); + statesetBin5->setAttributeAndModes(stencil,osg::StateAttribute::ON); + statesetBin5->setAttributeAndModes(trans,osg::StateAttribute::ON); + statesetBin5->setAttribute(depth); + + // set up the mirror geode. + osg::Geode* geode = new osg::Geode; + geode->addDrawable(mirror); + geode->setStateSet(statesetBin5); + + rootNode->addChild(geode); + + } + + // initialize the viewer. + osgGLUT::Viewer viewer; + viewer.addViewport( rootNode ); + + + // create and register the app visitor. + AppVisitor* appVisitor = new AppVisitor(); + appVisitor->_modifyTransform = loadedModelTransform; + appVisitor->_pivotPoint = bs.center(); + + viewer.getViewportSceneView(0)->setAppVisitor(appVisitor); + + // register trackball, flight and drive. + viewer.registerCameraManipulator(new osgUtil::TrackballManipulator); + viewer.registerCameraManipulator(new osgUtil::FlightManipulator); + viewer.registerCameraManipulator(new osgUtil::DriveManipulator); + + viewer.open(); + + viewer.run(); + + return 0; +} diff --git a/src/Demos/sgv/README b/src/Demos/sgv/README new file mode 100644 index 000000000..6e2603a66 --- /dev/null +++ b/src/Demos/sgv/README @@ -0,0 +1,26 @@ +Note: Using sgv with Peformer (for IRIX and Linux users only) +============================================================= + +If you find problems with loading .pfb files its likely that its due to undefined +symbols. This isn't a problem with the OSG implementation, but alas the only +current solution is to directly link you app with the Performer libraries. The +Makefile contains two library list. In Makefile you'll see something like : + + #note, use this library list when using the Performer osgPlugin. + #LIBS = ${PFLIBS} -losgGLUT -losgDB -losg -lGLU -lGL -lm -lXmu -lX11 -lXi + + #note, standard library list. + LIBS = -losgGLUT -losgDB -losg -lGLU -lGL -lm -lXmu -lX11 -lXi + +Simple comment in the LIBS line with PFLIBS and comment out the standard LIBS, +then : + + make clean + make + +Hopefully the Performer distribution will eventually work as a dynamic plugin +but until that day we're stuck with this 'hack'... + + +Robert Osfield, +March 20001. diff --git a/src/osg/ClipPlane.cpp b/src/osg/ClipPlane.cpp new file mode 100644 index 000000000..d333c9ca6 --- /dev/null +++ b/src/osg/ClipPlane.cpp @@ -0,0 +1,98 @@ +#include +#include + +using namespace osg; + +ClipPlane::ClipPlane() +{ + _clipPlane = new double[4]; + _clipPlane[0] = 0.0; + _clipPlane[1] = 0.0; + _clipPlane[2] = 0.0; + _clipPlane[3] = 0.0; + _clipPlaneNum = 0; +} + + +ClipPlane::~ClipPlane() +{ + delete _clipPlane; +} + +void ClipPlane::setClipPlane(const Vec4& plane) +{ + _clipPlane[0] = plane[0]; + _clipPlane[1] = plane[1]; + _clipPlane[2] = plane[2]; + _clipPlane[3] = plane[3]; +} + +void ClipPlane::setClipPlane(const Plane& plane) +{ + _clipPlane[0] = plane[0]; + _clipPlane[1] = plane[1]; + _clipPlane[2] = plane[2]; + _clipPlane[3] = plane[3]; +} + +void ClipPlane::setClipPlane(const double* plane) +{ + if (plane) + { + _clipPlane[0] = plane[0]; + _clipPlane[1] = plane[1]; + _clipPlane[2] = plane[2]; + _clipPlane[3] = plane[3]; + } + else + { + notify(WARN)<<"Warning: ClipPlane::setClipPlane() passed NULL plane array, ignoring operation."< + +using namespace osg; + +ColorMask::ColorMask() +{ + // set up same defaults as glColorMask. + _red = true; + _green = true; + _blue = true; + _alpha = true; +} + + +ColorMask::~ColorMask() +{ +} + +void ColorMask::apply(State&) const +{ + glColorMask((GLboolean)_red,(GLboolean)_green,(GLboolean)_blue,(GLboolean)_alpha); +} + diff --git a/src/osg/Depth.cpp b/src/osg/Depth.cpp new file mode 100644 index 000000000..948d57890 --- /dev/null +++ b/src/osg/Depth.cpp @@ -0,0 +1,25 @@ +#include + +using namespace osg; + +Depth::Depth() +{ + _func = LESS; + _depthWriteMask = true; + + _zNear = 0.0; + _zFar = 1.0; +} + + +Depth::~Depth() +{ +} + +void Depth::apply(State&) const +{ + glDepthFunc((GLenum)_func); + glDepthMask((GLboolean)_depthWriteMask); + glDepthRange(_zNear,_zFar); +} + diff --git a/src/osg/Drawable.cpp b/src/osg/Drawable.cpp new file mode 100644 index 000000000..1ccb1ae5a --- /dev/null +++ b/src/osg/Drawable.cpp @@ -0,0 +1,159 @@ +#include +#include +#include + +#include +#include +#include + +using namespace osg; + +Drawable::DeletedDisplayListCache Drawable::s_deletedDisplayListCache; + +Drawable::Drawable() +{ + _bbox_computed = false; + + // Note, if your are defining a subclass from drawable which is + // dynamically updated then you should set both the following to + // to false in your constructor. This will prevent any display + // lists from being automatically created and safeguard the + // dynamic updating of data. + _supportsDisplayList = true; + _useDisplayList = true; + +} + + +Drawable::~Drawable() +{ + dirtyDisplayList(); +} + + +void Drawable::compile(State& state) +{ + if (!_useDisplayList) return; + + // get the contextID (user defined ID of 0 upwards) for the + // current OpenGL context. + uint contextID = state.getContextID(); + + // fill in array if required. + while (_globjList.size()<=contextID) _globjList.push_back(0); + + // get the globj for the current contextID. + uint& globj = _globjList[contextID]; + + // call the globj if already set otherwise comple and execute. + if( globj != 0 ) + { + glDeleteLists( globj, 1 ); + } + + + if (_dstate.valid()) + { + _dstate->compile(state); + } + + globj = glGenLists( 1 ); + glNewList( globj, GL_COMPILE ); + drawImmediateMode(state); + glEndList(); + +} + +void Drawable::setSupportsDisplayList(const bool flag) +{ + // if value unchanged simply return. + if (_supportsDisplayList==flag) return; + + // if previously set to true then need to check about display lists. + if (_supportsDisplayList) + { + if (_useDisplayList) + { + // used to support display lists and display lists switched + // on so now delete them and turn useDisplayList off. + dirtyDisplayList(); + _useDisplayList = false; + } + } + + // set with new value. + _supportsDisplayList=flag; +} + +void Drawable::setUseDisplayList(const bool flag) +{ + // if value unchanged simply return. + if (_useDisplayList==flag) return; + + // if was previously set to true, remove display list. + if (_useDisplayList) + { + dirtyDisplayList(); + } + + if (_supportsDisplayList) + { + + // set with new value. + _useDisplayList = flag; + + } + else // does not support display lists. + { + if (flag) + { + notify(WARN)<<"Warning: attempt to setUseDisplayList(true) on a drawable with does not support display lists."<& displayListSet = citr->second; + for(std::set::iterator gitr=displayListSet.begin(); + gitr!=displayListSet.end(); + ++gitr) + { + glDeleteLists(*gitr,1); + } + + s_deletedDisplayListCache.erase(citr); + } +} diff --git a/src/osg/FrontFace.cpp b/src/osg/FrontFace.cpp new file mode 100644 index 000000000..f361eefbb --- /dev/null +++ b/src/osg/FrontFace.cpp @@ -0,0 +1,19 @@ +#include "osg/GL" +#include "osg/FrontFace" + +using namespace osg; + +FrontFace::FrontFace() +{ + _mode = COUNTER_CLOCKWISE; +} + + +FrontFace::~FrontFace() +{ +} + +void FrontFace::apply(State&) const +{ + glFrontFace((GLenum)_mode); +} diff --git a/src/osg/GLExtensions.cpp b/src/osg/GLExtensions.cpp new file mode 100644 index 000000000..68a46b73c --- /dev/null +++ b/src/osg/GLExtensions.cpp @@ -0,0 +1,74 @@ +#ifdef _WIN32 +#include +#elif !defined macintosh +#include +#endif + +#include "osg/GL" +#include "osg/GLExtensions" +#include "osg/Notify" + + +#include +#include +#include + +#include +#include +#include + +const bool osg::isGLExtensionSupported(const char *extension) +{ + typedef std::set ExtensionSet; + static ExtensionSet s_extensionSet; + static const char* s_extensions = NULL; + if (s_extensions==NULL) + { + // get the extension list from OpenGL. + s_extensions = (const char*)glGetString(GL_EXTENSIONS); + if (s_extensions==NULL) return false; + + // insert the ' ' delimiated extensions words into the extensionSet. + const char *startOfWord = s_extensions; + const char *endOfWord; + while ((endOfWord = strchr(startOfWord,' '))!=NULL) + { + s_extensionSet.insert(std::string(startOfWord,endOfWord)); + startOfWord = endOfWord+1; + } + if (*startOfWord!=0) s_extensionSet.insert(std::string(startOfWord)); + + osg::notify(INFO)<<"OpenGL extensions supported by installed OpenGL drivers are:"< + +using namespace osg; + +Impostor::Impostor() +{ + _impostorThreshold = -1.0f; +} + + +ImpostorSprite* Impostor::findBestImpostorSprite(const osg::Vec3& currLocalEyePoint) +{ + float min_distance2 = FLT_MAX; + ImpostorSprite* impostorSprite = NULL; + for(ImpostorSpriteList::iterator itr=_impostorSpriteList.begin(); + itr!=_impostorSpriteList.end(); + ++itr) + { + float distance2 = (currLocalEyePoint-(*itr)->getStoredLocalEyePoint()).length2(); + if (distance2get(); + } + } + return impostorSprite; +} + +void Impostor::addImpostorSprite(ImpostorSprite* is) +{ + if (is && is->getParent()!=this) + { + // add it to my impostor list first, so it remains referenced + // when its reference in the previous_owner is removed. + _impostorSpriteList.push_back(is); + + if (is->getParent()) + { + Impostor* previous_owner = is->getParent(); + ImpostorSpriteList& isl = previous_owner->_impostorSpriteList; + + // find and erase reference to is. + for(ImpostorSpriteList::iterator itr=isl.begin(); + itr!=isl.end(); + ++itr) + { + if ((*itr)==is) + { + isl.erase(itr); + break; + } + } + } + is->setParent(this); + + } +} + +const bool Impostor::computeBound() const +{ + return LOD::computeBound(); +} diff --git a/src/osg/ImpostorSprite.cpp b/src/osg/ImpostorSprite.cpp new file mode 100644 index 000000000..d5ba472d3 --- /dev/null +++ b/src/osg/ImpostorSprite.cpp @@ -0,0 +1,273 @@ +#if defined(_MSC_VER) + #pragma warning( disable : 4786 ) +#endif + +#include +#include +#include + +#include +#include +#include +#include +#include + + +using namespace osg; + +ImpostorSprite::ImpostorSprite() +{ + // don't use display list since we will be updating the geometry. + _useDisplayList = false; + _parent = NULL; + + _ism = NULL; + _previous = NULL; + _next = NULL; + + _texture = NULL; + _s = 0; + _t = 0; + + +} + + +ImpostorSprite::~ImpostorSprite() +{ + if (_ism) + { + _ism->remove(this); + } +} + +const float ImpostorSprite::calcPixelError(const Camera& camera,const int* viewport,const osg::Matrix* matrix) const +{ + // find the maximum screen space pixel error between the control coords and the quad coners. + float max_error_sqrd = 0.0f; + for(int i=0;i<4;++i) + { + + Vec3 projected_coord; + Vec3 projected_control; + if (matrix) + { + // project the coords of the quad into screen space. + camera.project(_coords[i]*(*matrix),viewport,projected_coord); + + // project the controls coords into screen space. + camera.project(_controlcoords[i]*(*matrix),viewport,projected_control); + } + else + { + // project the coords of the quad into screen space. + camera.project(_coords[i],viewport,projected_coord); + + // project the controls coords into screen space. + camera.project(_controlcoords[i],viewport,projected_control); + } + + float dx = (projected_coord.x()-projected_control.x()); + float dy = (projected_coord.y()-projected_control.y()); + + float error_sqrd = dx*dx+dy*dy; + + if (error_sqrd > max_error_sqrd) max_error_sqrd = error_sqrd; + + } + + return sqrtf(max_error_sqrd); +} + +void ImpostorSprite::drawImmediateMode(State&) +{ + // when the tex env is set to REPLACE, and the + // texture is set up correctly the color has no effect. + glColor4f( 1.0f, 1.0f, 1.0f, 1.0f ); + + glBegin( GL_QUADS ); + + glTexCoord2fv( (GLfloat *)&_texcoords[0] ); + glVertex3fv( (GLfloat *)&_coords[0] ); + + glTexCoord2fv( (GLfloat *)&_texcoords[1] ); + glVertex3fv( (GLfloat *)&_coords[1] ); + + glTexCoord2fv( (GLfloat *)&_texcoords[2] ); + glVertex3fv( (GLfloat *)&_coords[2] ); + + glTexCoord2fv( (GLfloat *)&_texcoords[3] ); + glVertex3fv( (GLfloat *)&_coords[3] ); + + glEnd(); + +} + +const bool ImpostorSprite::computeBound() const +{ + _bbox.init(); + _bbox.expandBy(_coords[0]); + _bbox.expandBy(_coords[1]); + _bbox.expandBy(_coords[2]); + _bbox.expandBy(_coords[3]); + + _bbox_computed=true; + + if (!_bbox.isValid()) + { + cout << "******* ImpostorSprite::computeBound() problem"<bb.xMax()) return false; + + if (s.x()bb.xMax()) + { + // clip e to xMax. + e = s+(e-s)*(bb.xMax()-s.x())/(e.x()-s.x()); + } + } + else + { + if (s.x()bb.xMax()) return false; + + if (e.x()bb.xMax()) + { + // clip e to xMax. + s = s+(e-s)*(bb.xMax()-s.x())/(e.x()-s.x()); + } + } + + // compate s and e against the yMin to yMax range of bb. + if (s.y()<=e.y()) + { + + // trivial reject of segment wholely outside. + if (e.y()bb.yMax()) return false; + + if (s.y()bb.yMax()) + { + // clip e to yMax. + e = s+(e-s)*(bb.yMax()-s.y())/(e.y()-s.y()); + } + } + else + { + if (s.y()bb.yMax()) return false; + + if (e.y()bb.yMax()) + { + // clip e to yMax. + s = s+(e-s)*(bb.yMax()-s.y())/(e.y()-s.y()); + } + } + + // compate s and e against the zMin to zMax range of bb. + if (s.z()<=e.z()) + { + + // trivial reject of segment wholely outside. + if (e.z()bb.zMax()) return false; + + if (s.z()bb.zMax()) + { + // clip e to zMax. + e = s+(e-s)*(bb.zMax()-s.z())/(e.z()-s.z()); + } + } + else + { + if (s.z()bb.zMax()) return false; + + if (e.z()bb.zMax()) + { + // clip e to zMax. + s = s+(e-s)*(bb.zMax()-s.z())/(e.z()-s.z()); + } + } + + return true; +} + + +const bool LineSegment::intersect(const BoundingBox& bb) const +{ + if (!bb.isValid()) return false; + + Vec3 s=_s,e=_e; + return intersectAndClip(s,e,bb); +} + + +const bool LineSegment::intersect(const BoundingBox& bb,float& r1,float& r2) const +{ + if (!bb.isValid()) return false; + + Vec3 s=_s,e=_e; + bool result = intersectAndClip(s,e,bb); + if (result) + { + float len = (_e-_s).length(); + if (len>0.0f) + { + float inv_len = 1.0f/len; + r1 = (s-_s).length()*inv_len; + r2 = (e-_e).length()*inv_len; + } + else + { + r1 = 0.0f; + r2 = 0.0f; + } + } + return result; +} + + +const bool LineSegment::intersect(const BoundingSphere& bs,float& r1,float& r2) const +{ + Vec3 sm = _s-bs._center; + float c = sm.length2()-bs._radius*bs._radius; + + Vec3 se = _e-_s; + float a = se.length2(); + + float b = sm*se*2.0f; + + float d = b*b-4.0f*a*c; + + if (d<0.0f) return false; + + d = sqrtf(d); + + float div = 1.0f/(2.0f*a); + + r1 = (-b-d)*div; + r2 = (-b+d)*div; + + if (r1<=0.0f && r2<=0.0f) return false; + + if (r1>=1.0f && r2>=1.0f) return false; + + return true; +} + + +const bool LineSegment::intersect(const BoundingSphere& bs) const +{ + Vec3 sm = _s-bs._center; + float c = sm.length2()-bs._radius*bs._radius; + if (c<0.0f) return true; + + Vec3 se = _e-_s; + float a = se.length2(); + + float b = (sm*se)*2.0f; + + float d = b*b-4.0f*a*c; + + if (d<0.0f) return false; + + d = sqrtf(d); + + float div = 1.0f/(2.0f*a); + + float r1 = (-b-d)*div; + float r2 = (-b+d)*div; + + if (r1<=0.0f && r2<=0.0f) return false; + + if (r1>=1.0f && r2>=1.0f) return false; + + return true; +} + + +const bool LineSegment::intersect(const Vec3& v1,const Vec3& v2,const Vec3& v3,float& r) +{ + if (v1==v2 || v2==v3 || v1==v3) return false; + + Vec3 vse = _e-_s; + + Vec3 v12 = v2-v1; + Vec3 n12 = v12^vse; + float ds12 = (_s-v1)*n12; + float d312 = (v3-v1)*n12; + if (d312>=0.0f) + { + if (ds12<0.0f) return false; + if (ds12>d312) return false; + } + else // d312 < 0 + { + if (ds12>0.0f) return false; + if (ds12=0.0f) + { + if (ds23<0.0f) return false; + if (ds23>d123) return false; + } + else // d123 < 0 + { + if (ds23>0.0f) return false; + if (ds23=0.0f) + { + if (ds31<0.0f) return false; + if (ds31>d231) return false; + } + else // d231 < 0 + { + if (ds31>0.0f) return false; + if (ds31length) return false; + + r = d/length; + + return true; +} diff --git a/src/osg/Makedepend b/src/osg/Makedepend new file mode 100644 index 000000000..e69de29bb diff --git a/src/osg/PolygonMode.cpp b/src/osg/PolygonMode.cpp new file mode 100644 index 000000000..7ad33c43a --- /dev/null +++ b/src/osg/PolygonMode.cpp @@ -0,0 +1,68 @@ +#include "osg/GL" +#include "osg/PolygonMode" +#include "osg/Notify" + +using namespace osg; + +PolygonMode::PolygonMode() +{ + _frontAndBack = true; + _modeFront = FILL; + _modeBack = FILL; +} + + +PolygonMode::~PolygonMode() +{ +} + +void PolygonMode::setMode(const Face face,const Mode mode) +{ + switch(face) + { + case(FRONT): + _frontAndBack = false; + _modeFront = mode; + break; + case(BACK): + _frontAndBack = false; + _modeBack = mode; + break; + case(FRONT_AND_BACK): + _frontAndBack = true; + _modeFront = mode; + _modeBack = mode; + break; + } +} + +const PolygonMode::Mode PolygonMode::getMode(const Face face) const +{ + switch(face) + { + case(FRONT): + return _modeFront; + break; + case(BACK): + return _modeBack; + break; + case(FRONT_AND_BACK): + return _modeFront; + } + notify(WARN)<<"Warning : invalid Face passed to PolygonMode::getMode(Face face)"< +#include + +#include + +using namespace osg; + +State::State() +{ + _contextID = 0; + _frameNumber = 0; + _fineGrainedErrorDetection = true; +} + +State::~State() +{ +} + +void State::reset() +{ + _modeMap.clear(); + _attributeMap.clear(); + _drawStateStack.clear(); +} + +void State::pushStateSet(const StateSet* dstate) +{ + _drawStateStack.push_back(dstate); + if (dstate) + { + // iterator through all OpenGL modes in incomming StateSet + // for each GLMode entry push it to the back of the appropriate + // mode stack, taking into consideration current override status. + const StateSet::ModeList& ds_modeList = dstate->getModeList(); + for(StateSet::ModeList::const_iterator mitr=ds_modeList.begin(); + mitr!=ds_modeList.end(); + ++mitr) + { + // get the mode stack for incomming GLmode {mitr->first}. + ModeStack& ms = _modeMap[mitr->first]; + if (ms.valueVec.empty()) + { + // first pair so simply push incomming pair to back. + ms.valueVec.push_back(mitr->second); + } + else if (ms.valueVec.back() & StateAttribute::OVERRIDE) // check the existing override flag + { + // push existing back since override keeps the previoius value. + ms.valueVec.push_back(ms.valueVec.back()); + } + else + { + // no override on so simply push incomming pair to back. + ms.valueVec.push_back(mitr->second); + } + ms.changed = true; + } + + // iterator through all StateAttribute's in incomming StateSet + // for each Type entry push it to the back of the appropriate + // attribute stack, taking into consideration current override status. + const StateSet::AttributeList& ds_attributeList = dstate->getAttributeList(); + for(StateSet::AttributeList::const_iterator aitr=ds_attributeList.begin(); + aitr!=ds_attributeList.end(); + ++aitr) + { + // get the attribute stack for incomming type {aitr->first}. + AttributeStack& as = _attributeMap[aitr->first]; + if (as.attributeVec.empty()) + { + // first pair so simply push incomming pair to back. + as.attributeVec.push_back( + AttributePair(aitr->second.first.get(),aitr->second.second)); + } + else if (as.attributeVec.back().second & StateAttribute::OVERRIDE) // check the existing override flag + { + // push existing back since override keeps the previoius value. + as.attributeVec.push_back(as.attributeVec.back()); + } + else + { + // no override on so simply push incomming pair to back. + as.attributeVec.push_back( + AttributePair(aitr->second.first.get(),aitr->second.second)); + } + as.changed = true; + } + + } +} + +void State::popStateSet() +{ + if (_drawStateStack.empty()) return; + + const StateSet* dstate = _drawStateStack.back().get(); + + if (dstate) + { + // iterator through all OpenGL modes in incomming StateSet + // for each GLMode entry pop_back of the appropriate + // mode stack. + const StateSet::ModeList& ds_modeList = dstate->getModeList(); + for(StateSet::ModeList::const_iterator mitr=ds_modeList.begin(); + mitr!=ds_modeList.end(); + ++mitr) + { + // get the mode stack for incomming GLmode {mitr->first}. + ModeStack& ms = _modeMap[mitr->first]; + if (!ms.valueVec.empty()) + { + ms.valueVec.pop_back(); + } + ms.changed = true; + } + + // iterator through all StateAttribute's in incomming StateSet + // for each Type entry pop_back of the appropriate + // attribute stack. + const StateSet::AttributeList& ds_attributeList = dstate->getAttributeList(); + for(StateSet::AttributeList::const_iterator aitr=ds_attributeList.begin(); + aitr!=ds_attributeList.end(); + ++aitr) + { + // get the attribute stack for incomming type {aitr->first}. + AttributeStack& as = _attributeMap[aitr->first]; + if (!as.attributeVec.empty()) + { + as.attributeVec.pop_back(); + } + as.changed = true; + } + + } + + // remove the top draw state from the stack. + _drawStateStack.pop_back(); +} + +void State::apply(const StateSet* dstate) +{ + // equivilant to: + //pushStateSet(dstate); + //apply(); + //popStateSet(); + + if (dstate) + { + + + // first handle mode changes. + { + const StateSet::ModeList& ds_modeList = dstate->getModeList(); + + StateSet::ModeList::const_iterator ds_mitr = ds_modeList.begin(); + ModeMap::iterator this_mitr=_modeMap.begin(); + + while (this_mitr!=_modeMap.end() && ds_mitr!=ds_modeList.end()) + { + if (this_mitr->firstfirst) + { + + // note GLMode = this_mitr->first + ModeStack& ms = this_mitr->second; + if (ms.changed) + { + ms.changed = false; + if (!ms.valueVec.empty()) + { + bool new_value = ms.valueVec.back() & StateAttribute::ON; + apply_mode(this_mitr->first,new_value,ms); + } + else + { + // assume default of disabled. + apply_mode(this_mitr->first,false,ms); + + } + + } + + ++this_mitr; + + } + else if (ds_mitr->firstfirst) + { + + // ds_mitr->first is a new mode, therefore + // need to insert a new mode entry for ds_mistr->first. + ModeStack& ms = _modeMap[ds_mitr->first]; + + bool new_value = ds_mitr->second & StateAttribute::ON; + apply_mode(ds_mitr->first,new_value,ms); + + // will need to disable this mode on next apply so set it to changed. + ms.changed = true; + + ++ds_mitr; + + } + else + { + // this_mitr & ds_mitr refer to the same mode, check the overide + // if any otherwise just apply the incomming mode. + + ModeStack& ms = this_mitr->second; + + if (!ms.valueVec.empty() && ms.valueVec.back() & StateAttribute::OVERRIDE) + { + // override is on, there just treat as a normal apply on modes. + + if (ms.changed) + { + ms.changed = false; + bool new_value = ms.valueVec.back() & StateAttribute::ON; + apply_mode(this_mitr->first,new_value,ms); + + } + } + else + { + // no override on or no previous entry, therefore consider incomming mode. + bool new_value = ds_mitr->second & StateAttribute::ON; + if (apply_mode(ds_mitr->first,new_value,ms)) + { + ms.changed = true; + } + } + + ++this_mitr; + ++ds_mitr; + } + } + + // iterator over the remaining state modes to apply any previous changes. + for(; + this_mitr!=_modeMap.end(); + ++this_mitr) + { + // note GLMode = this_mitr->first + ModeStack& ms = this_mitr->second; + if (ms.changed) + { + ms.changed = false; + if (!ms.valueVec.empty()) + { + bool new_value = ms.valueVec.back() & StateAttribute::ON; + apply_mode(this_mitr->first,new_value,ms); + } + else + { + // assume default of disabled. + apply_mode(this_mitr->first,false,ms); + + } + + } + } + + // iterator over the remaining incomming modes to apply any new mode. + for(; + ds_mitr!=ds_modeList.end(); + ++ds_mitr) + { + ModeStack& ms = _modeMap[ds_mitr->first]; + + bool new_value = ds_mitr->second & StateAttribute::ON; + apply_mode(ds_mitr->first,new_value,ms); + + // will need to disable this mode on next apply so set it to changed. + ms.changed = true; + } + } + + + + // now handle attribute changes + { + const StateSet::AttributeList& ds_attributeList = dstate->getAttributeList(); + StateSet::AttributeList::const_iterator ds_aitr=ds_attributeList.begin(); + + AttributeMap::iterator this_aitr=_attributeMap.begin(); + + while (this_aitr!=_attributeMap.end() && ds_aitr!=ds_attributeList.end()) + { + if (this_aitr->firstfirst) + { + + // note attribute type = this_aitr->first + AttributeStack& as = this_aitr->second; + if (as.changed) + { + as.changed = false; + if (!as.attributeVec.empty()) + { + const StateAttribute* new_attr = as.attributeVec.back().first; + apply_attribute(new_attr,as); + } + else + { + // this is really an error state, in theory we *should* have a + // global state attribute set for all types. + //notify(WARN)<<" No global StateAttribute set for type"<<(int)aitr->first<firstfirst) + { + + // ds_mitr->first is a new attribute, therefore + // need to insert a new attribute entry for ds_aistr->first. + AttributeStack& as = _attributeMap[ds_aitr->first]; + + const StateAttribute* new_attr = ds_aitr->second.first.get(); + apply_attribute(new_attr,as); + + // will need to disable this mode on next apply so set it to changed. + as.changed = true; + + ++ds_aitr; + + } + else + { + // this_mitr & ds_mitr refer to the same mode, check the overide + // if any otherwise just apply the incomming mode. + + AttributeStack& as = this_aitr->second; + + if (!as.attributeVec.empty() && as.attributeVec.back().second) + { + // override is os, there just treat as a normal apply on modes. + + if (as.changed) + { + as.changed = false; + const StateAttribute* new_attr = as.attributeVec.back().first; + apply_attribute(new_attr,as); + } + } + else + { + // no override on or no previous entry, therefore consider incomming mode. + const StateAttribute* new_attr = ds_aitr->second.first.get(); + if (apply_attribute(new_attr,as)) + { + as.changed = true; + } + } + + ++this_aitr; + ++ds_aitr; + } + } + + // iterator over the remaining state modes to apply any previous changes. + for(; + this_aitr!=_attributeMap.end(); + ++this_aitr) + { + // note attribute type = this_aitr->first + AttributeStack& as = this_aitr->second; + if (as.changed) + { + as.changed = false; + if (!as.attributeVec.empty()) + { + const StateAttribute* new_attr = as.attributeVec.back().first; + apply_attribute(new_attr,as); + } + else + { + // this is really an error state, in theory we *should* have a + // global state attribute set for all types. + //notify(WARN)<<" No global StateAttribute set for type"<<(int)aitr->first<first is a new attribute, therefore + // need to insert a new attribute entry for ds_aistr->first. + AttributeStack& as = _attributeMap[ds_aitr->first]; + + const StateAttribute* new_attr = ds_aitr->second.first.get(); + apply_attribute(new_attr,as); + + // will need to update this attribute on next apply so set it to changed. + as.changed = true; + } + } + + } + else + { + // no incomming stateset, so simply apply state. + apply(); + } + +} + +void State::apply() +{ + + // go through all active OpenGL modes, enabling/disable where + // appropriate. + for(ModeMap::iterator mitr=_modeMap.begin(); + mitr!=_modeMap.end(); + ++mitr) + { + // note GLMode = mitr->first + ModeStack& ms = mitr->second; + if (ms.changed) + { + ms.changed = false; + if (!ms.valueVec.empty()) + { + bool new_value = ms.valueVec.back() & StateAttribute::ON; + apply_mode(mitr->first,new_value,ms); + } + else + { + // assume default of disabled. + apply_mode(mitr->first,false,ms); + } + + } + } + + // go through all active StateAttribute's, applying where appropriate. + for(AttributeMap::iterator aitr=_attributeMap.begin(); + aitr!=_attributeMap.end(); + ++aitr) + { + AttributeStack& as = aitr->second; + if (as.changed) + { + as.changed = false; + if (!as.attributeVec.empty()) + { + const StateAttribute* new_attr = as.attributeVec.back().first; + apply_attribute(new_attr,as); + } + else + { + // this is really an error state, in theory we *should* have a + // global state attribute set for all types. + //notify(WARN)<<" No global StateAttribute set for type"<<(int)aitr->first<getType()]; + + as.last_applied_attribute = attribute; + + // will need to update this attribute on next apply so set it to changed. + as.changed = true; + } +} + diff --git a/src/osg/StateSet.cpp b/src/osg/StateSet.cpp new file mode 100644 index 000000000..807ab719f --- /dev/null +++ b/src/osg/StateSet.cpp @@ -0,0 +1,208 @@ +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +using namespace osg; + +StateSet::StateSet() +{ + _renderingHint = DEFAULT_BIN; + + setRendingBinToInherit(); +} + + +StateSet::~StateSet() +{ + // note, all attached state attributes will be automatically + // unreferenced by ref_ptr<> and therefore there is no need to + // delete the memory manually. +} + + +void StateSet::setGlobalDefaults() +{ + _renderingHint = DEFAULT_BIN; + + setRendingBinToInherit(); + + setMode(GL_LIGHTING,StateAttribute::OFF); + setMode(GL_FOG,StateAttribute::OFF); + setMode(GL_POINT_SMOOTH,StateAttribute::OFF); + + setMode(GL_TEXTURE_2D,StateAttribute::OFF); + + setMode(GL_TEXTURE_GEN_S,StateAttribute::OFF); + setMode(GL_TEXTURE_GEN_T,StateAttribute::OFF); + setMode(GL_TEXTURE_GEN_R,StateAttribute::OFF); + setMode(GL_TEXTURE_GEN_Q,StateAttribute::OFF); + + setAttributeAndModes(new AlphaFunc,StateAttribute::OFF); + setAttributeAndModes(new CullFace,StateAttribute::ON); + setAttributeAndModes(new FrontFace,StateAttribute::ON); + + Material *material = new Material; + material->setColorMode(Material::AMBIENT_AND_DIFFUSE); + setAttributeAndModes(material,StateAttribute::ON); + + setAttributeAndModes(new PolygonMode,StateAttribute::OFF); + setAttributeAndModes(new Transparency,StateAttribute::OFF); +} + + +void StateSet::setAllToInherit() +{ + _renderingHint = DEFAULT_BIN; + + setRendingBinToInherit(); + + _modeList.clear(); + _attributeList.clear(); +} + +void StateSet::setMode(const StateAttribute::GLMode mode, const StateAttribute::GLModeValue value) +{ + if ((value&StateAttribute::INHERIT)) setModeToInherit(mode); + else _modeList[mode] = value; +} + +void StateSet::setModeToInherit(const StateAttribute::GLMode mode) +{ + ModeList::iterator itr = _modeList.find(mode); + if (itr!=_modeList.end()) + { + _modeList.erase(itr); + } +} + +const StateAttribute::GLModeValue StateSet::getMode(const StateAttribute::GLMode mode) const +{ + ModeList::const_iterator itr = _modeList.find(mode); + if (itr!=_modeList.end()) + { + return itr->second; + } + else + return StateAttribute::INHERIT; +} + +void StateSet::setAttribute(StateAttribute *attribute, const StateAttribute::OverrideValue value) +{ + if (attribute) + { + if ((value&StateAttribute::INHERIT)) setAttributeToInherit(attribute->getType()); + else _attributeList[attribute->getType()] = RefAttributePair(attribute,value&StateAttribute::OVERRIDE); + } +} + +void StateSet::setAttributeAndModes(StateAttribute *attribute, const StateAttribute::GLModeValue value) +{ + if (attribute) + { + _attributeList[attribute->getType()] = RefAttributePair(attribute,value&StateAttribute::OVERRIDE); + attribute->setStateSetModes(*this,value); + } +} + +void StateSet::setAttributeToInherit(const StateAttribute::Type type) +{ + AttributeList::iterator itr = _attributeList.find(type); + if (itr!=_attributeList.end()) + { + itr->second.first->setStateSetModes(*this,StateAttribute::INHERIT); + _attributeList.erase(itr); + } +} + +const StateAttribute* StateSet::getAttribute(const StateAttribute::Type type) const +{ + AttributeList::const_iterator itr = _attributeList.find(type); + if (itr!=_attributeList.end()) + { + return itr->second.first.get(); + } + else + return NULL; +} + +const StateSet::RefAttributePair* StateSet::getAttributePair(const StateAttribute::Type type) const +{ + AttributeList::const_iterator itr = _attributeList.find(type); + if (itr!=_attributeList.end()) + { + return &(itr->second); + } + else + return NULL; +} + +void StateSet::compile(State& state) const +{ + for(AttributeList::const_iterator itr = _attributeList.begin(); + itr!=_attributeList.end(); + ++itr) + { + itr->second.first->compile(state); + } +} + + +const StateSet::ModeVector StateSet::getModeVector() const +{ + ModeVector vec; + for (ModeList::const_iterator itr = _modeList.begin(); + itr!=_modeList.end(); + ++itr) + { + vec.push_back(*itr); + } + return vec; +} + +const StateSet::AttributeVector StateSet::getAttributeVector() const +{ + AttributeVector vec; + for (AttributeList::const_iterator itr = _attributeList.begin(); + itr!=_attributeList.end(); + ++itr) + { + vec.push_back(itr->second.first.get()); + } + return vec; +} + +void StateSet::setRenderingHint(const int hint) +{ + _renderingHint = hint; + // temporary hack to get new render bins working. + if (_renderingHint==TRANSPARENT_BIN) + { + _binMode = USE_RENDERBIN_DETAILS; + _binNum = 1; + _binName = "DepthSortedBin"; +// _binName = "RenderBin"; + } +} + +void StateSet::setRenderBinDetails(const int binNum,const std::string& binName,const RenderBinMode mode) +{ + _binMode = mode; + _binNum = binNum; + _binName = binName; +} + +void StateSet::setRendingBinToInherit() +{ + _binMode = INHERIT_RENDERBIN_DETAILS; + _binNum = 0; + _binName = ""; +} diff --git a/src/osg/Stencil.cpp b/src/osg/Stencil.cpp new file mode 100644 index 000000000..8372207b2 --- /dev/null +++ b/src/osg/Stencil.cpp @@ -0,0 +1,32 @@ +#include + +using namespace osg; + +Stencil::Stencil() +{ + // set up same defaults as glStencilFunc. + _func = ALWAYS; + _funcRef = 0; + _funcMask = ~0; + + // set up same defaults as glStencilOp. + _sfail = KEEP; + _zfail = KEEP; + _zpass = KEEP; + + // set up same defaults as glStencilMask. + _writeMask = ~0; +} + + +Stencil::~Stencil() +{ +} + +void Stencil::apply(State&) const +{ + glStencilFunc((GLenum)_func,_funcRef,_funcMask); + glStencilOp((GLenum)_sfail,(GLenum)_zfail,(GLenum)_zpass); + glStencilMask(_writeMask); +} + diff --git a/src/osg/Transform.cpp b/src/osg/Transform.cpp new file mode 100644 index 000000000..c79f9bce9 --- /dev/null +++ b/src/osg/Transform.cpp @@ -0,0 +1,87 @@ +#include "osg/Transform" + +using namespace osg; + +Transform::Transform() +{ + _matrix = new osg::Matrix(); + _matrix->makeIdent(); +} + + +Transform::Transform(const Matrix& mat ) +{ + (*_matrix) = mat; +} + + +Transform::~Transform() +{ +} + + +void Transform::setMatrix(const Matrix& mat ) +{ + (*_matrix) = mat; + dirtyBound(); +} + + +void Transform::preMult( const Matrix& mat ) +{ + _matrix->preMult( mat ); + dirtyBound(); +} + +void Transform::preScale( const float sx, const float sy, const float sz ) +{ + _matrix->preScale( sx, sy, sz ); + dirtyBound(); +} + +void Transform::preTranslate( const float tx, const float ty, const float tz ) +{ + _matrix->preTrans( tx, ty, tz ); + dirtyBound(); +} + + +void Transform::preRotate( const float deg, const float x, const float y, const float z ) +{ + _matrix->preRot( deg, x, y, z ); + dirtyBound(); +} + +const bool Transform::computeBound() const +{ + if (!Group::computeBound()) return false; + + Vec3 xdash = _bsphere._center; + xdash.x() += _bsphere._radius; + xdash = xdash*(*_matrix); + + Vec3 ydash = _bsphere._center; + ydash.y() += _bsphere._radius; + ydash = ydash*(*_matrix); + + Vec3 zdash = _bsphere._center; + zdash.y() += _bsphere._radius; + zdash = zdash*(*_matrix); + + _bsphere._center = _bsphere._center*(*_matrix); + + xdash -= _bsphere._center; + float len_xdash = xdash.length(); + + ydash -= _bsphere._center; + float len_ydash = ydash.length(); + + zdash -= _bsphere._center; + float len_zdash = zdash.length(); + + _bsphere._radius = len_xdash; + if (_bsphere._radius g_OldMaterialPaletteProxy; + +OldMaterialPaletteRecord::OldMaterialPaletteRecord() +{ +} + + +// virtual +OldMaterialPaletteRecord::~OldMaterialPaletteRecord() +{ +} + + +// virtual +void OldMaterialPaletteRecord::endian() +{ + SOldMaterial *pSMaterial = (SOldMaterial*)getData(); + + for (int i=0; i < 64; i++) + { + pSMaterial->mat[i].Ambient.endian(); + pSMaterial->mat[i].Diffuse.endian(); + pSMaterial->mat[i].Specular.endian(); + pSMaterial->mat[i].Emissive.endian(); + ENDIAN( pSMaterial->mat[i].sfShininess ); + ENDIAN( pSMaterial->mat[i].sfAlpha ); + ENDIAN( pSMaterial->mat[i].diFlags ); + } +} diff --git a/src/osgPlugins/flt/OldMaterialPaletteRecord.h b/src/osgPlugins/flt/OldMaterialPaletteRecord.h new file mode 100644 index 000000000..baf4938f0 --- /dev/null +++ b/src/osgPlugins/flt/OldMaterialPaletteRecord.h @@ -0,0 +1,61 @@ +// OldMaterialPaletteRecord.h + +#ifndef __FLT_OLD_MATERIAL_PALETTE_RECORD_H +#define __FLT_OLD_MATERIAL_PALETTE_RECORD_H + + +#include "opcodes.h" +#include "Record.h" +#include "RecordVisitor.h" + + +namespace flt { + + +struct SOldMaterial +{ + SRecHeader RecHeader; + struct + { + float32x3 Ambient; // Ambient component of material + float32x3 Diffuse; // Diffuse component of material + float32x3 Specular; // Specular component of material + float32x3 Emissive; // Emissive component of material + float32 sfShininess; // Shininess. [0.0-128.0] + float32 sfAlpha; // Alpha. [0.0-1.0], where 1.0 is opaque + uint32 diFlags; // bit 0 Materials used + // bit 1-31 Spare + uint32 spares[31]; // Spares for material + } mat[64]; +}; + + +class OldMaterialPaletteRecord : public AncillaryRecord +{ + public: + + OldMaterialPaletteRecord(); + + virtual Record* clone() const { return new OldMaterialPaletteRecord(); } + virtual const char* className() const { return "OldMaterialPaletteRecord"; } + virtual int classOpcode() const { return OLD_MATERIAL_PALETTE_OP; } + virtual int sizeofData() const { return sizeof(SOldMaterial); } + virtual void accept(RecordVisitor& rv) { rv.apply(*this); } +// virtual void traverse(RecordVisitor& rv); + + protected: + + virtual ~OldMaterialPaletteRecord(); + + virtual void endian(); +// virtual void decode(); + +// virtual bool readLocalData(Input& fr); +// virtual bool writeLocalData(Output& fw); + +}; + + +}; // end namespace flt + +#endif diff --git a/src/osgPlugins/osgtgz/ReaderWriterOSGTGZ.cpp b/src/osgPlugins/osgtgz/ReaderWriterOSGTGZ.cpp new file mode 100644 index 000000000..4835e274c --- /dev/null +++ b/src/osgPlugins/osgtgz/ReaderWriterOSGTGZ.cpp @@ -0,0 +1,114 @@ +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include + +#ifdef _WIN32 +#include +#else +#include +#endif + +using namespace osg; + +class sgReaderWriterOSGTGZ : public osgDB::ReaderWriter +{ + public: + virtual const char* className() { return "OSGTGZ Database Reader/Writer"; } + virtual bool acceptsExtension(const std::string& extension) + { + return osgDB::equalCaseInsensitive(extension,"osgtgz"); + } + + virtual Node* readNode(const std::string& fileName) + { + std::string ext = osgDB::getFileExtension(fileName); + if (!acceptsExtension(ext)) return NULL; + + osg::notify(osg::INFO)<<"sgReaderWriterOSGTGZ::readNode( "<addChild( node ); + } + } + + #ifdef _WIN32 + // note, is this the right command for windows? + // is there any way of overiding the Y/N option? RO. + sprintf( command, "erase %s", dirname ); + system( command ); + #else + + sprintf( command, "rm -rf %s", dirname ); + system( command ); + #endif + + if( grp->getNumChildren() == 0 ) + { + grp->unref(); + return NULL; + } + + return grp; + + } + +}; + +// now register with sgRegistry to instantiate the above +// reader/writer. +osgDB::RegisterReaderWriterProxy g_readerWriter_OSGTGZ_Proxy; diff --git a/src/osgPlugins/png/new_ReaderWriterPNG.cpp b/src/osgPlugins/png/new_ReaderWriterPNG.cpp new file mode 100644 index 000000000..42e9c4846 --- /dev/null +++ b/src/osgPlugins/png/new_ReaderWriterPNG.cpp @@ -0,0 +1,330 @@ +#include +#include +#include +#include + +#include +#include + +/**************************************************************************** + * + * Follows is code extracted from the simage library. Original Authors: + * + * Systems in Motion, + * + * + * Peder Blekken + * Morten Eriksen + * Marius Bugge Monsen + * + * The original COPYING notice + * + * All files in this library are public domain, except simage_rgb.cpp which is + * Copyright (c) Mark J Kilgard . I will contact Mark + * very soon to hear if this source also can become public domain. + * + * Please send patches for bugs and new features to: . + * + * Peder Blekken + * + * + * Ported into the OSG as a plugin, Robert Osfield Decemeber 2000. + * Note, reference above to license of simage_rgb is not relevent to the OSG + * as the OSG does not use it. Also for patches, bugs and new features + * please send them direct to the OSG dev team rather than address above. + * + **********************************************************************/ + +/* + * Based on example code found in the libjpeg archive + * + */ + +using namespace osg; + +extern "C" +{ + #include +} + +#define ERR_NO_ERROR 0 +#define ERR_OPEN 1 +#define ERR_MEM 2 +#define ERR_PNGLIB 3 + +static int pngerror = ERR_NO_ERROR; + +/* my setjmp buffer */ +static jmp_buf setjmp_buffer; + +/* called my libpng */ +static void +warn_callback(png_structp /*ps*/, png_const_charp pc) +{ + /*FIXME: notify? */ + osg::notify(osg::WARN)<<"Warning in .png reader: "; + if (pc) osg::notify(osg::WARN)<< pc; + osg::notify(osg::WARN)<setFileName(fileName.c_str()); + pOsgImage->setImage(s,t,r, + internalFormat, + pixelFormat, + dataType, + imageData); + + return pOsgImage; + + } +}; + +// now register with Registry to instantiate the above +// reader/writer. +osgDB::RegisterReaderWriterProxy g_readerWriter_PNG_Proxy; diff --git a/src/osgPlugins/png/prev_ReaderWriterPNG.cpp b/src/osgPlugins/png/prev_ReaderWriterPNG.cpp new file mode 100644 index 000000000..03ee1da1e --- /dev/null +++ b/src/osgPlugins/png/prev_ReaderWriterPNG.cpp @@ -0,0 +1,170 @@ +#include +#include "osg/Notify" +#include +#include "osg/GL" + +#include "osgDB/Registry" + +using namespace osg; + +extern "C" +{ + #include +} + + +/* Transparency parameters */ +#define PNG_ALPHA -2 /* Use alpha channel in PNG file, if there is one */ +#define PNG_SOLID -1 /* No transparency */ +#define PNG_STENCIL 0 /* Sets alpha to 0 for r=g=b=0, 1 otherwise */ + +typedef struct +{ + unsigned int Width; + unsigned int Height; + unsigned int Depth; + unsigned int Alpha; +} pngInfo; + +class ReaderWriterPNG : public osgDB::ReaderWriter +{ + public: + virtual const char* className() { return "PNG Image Reader/Writer"; } + virtual bool acceptsExtension(const std::string& extension) { return extension=="png"; } + + virtual Image* readImage(const std::string& fileName) + { + + int trans = PNG_ALPHA; + FILE *fp = NULL; + pngInfo pInfo; + pngInfo *pinfo = &pInfo; + + unsigned char header[8]; + png_structp png; + png_infop info; + png_infop endinfo; + png_bytep data; //, data2; + png_bytep *row_p; + double fileGamma; + + png_uint_32 width, height; + int depth, color; + + png_uint_32 i; + png = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); + info = png_create_info_struct(png); + endinfo = png_create_info_struct(png); + + fp = fopen(fileName.c_str(), "rb"); + if (fp && fread(header, 1, 8, fp) && png_check_sig(header, 8)) + png_init_io(png, fp); + else + { + png_destroy_read_struct(&png, &info, &endinfo); + return NULL; + } + png_set_sig_bytes(png, 8); + + png_read_info(png, info); + png_get_IHDR(png, info, &width, &height, &depth, &color, NULL, NULL, NULL); + + if (pinfo != NULL) + { + pinfo->Width = width; + pinfo->Height = height; + pinfo->Depth = depth; + } + + if (color == PNG_COLOR_TYPE_GRAY || color == PNG_COLOR_TYPE_GRAY_ALPHA) + png_set_gray_to_rgb(png); + + if (color&PNG_COLOR_MASK_ALPHA && trans != PNG_ALPHA) + { + png_set_strip_alpha(png); + color &= ~PNG_COLOR_MASK_ALPHA; + } + + // if (!(PalettedTextures && mipmap >= 0 && trans == PNG_SOLID)) + if (color == PNG_COLOR_TYPE_PALETTE) + png_set_expand(png); + + /*--GAMMA--*/ + // checkForGammaEnv(); + double screenGamma = 2.2 / 1.0; + if (png_get_gAMA(png, info, &fileGamma)) + png_set_gamma(png, screenGamma, fileGamma); + else + png_set_gamma(png, screenGamma, 1.0/2.2); + + png_read_update_info(png, info); + + data = (png_bytep) malloc(png_get_rowbytes(png, info)*height); + row_p = (png_bytep *) malloc(sizeof(png_bytep)*height); + + bool StandardOrientation = false; + for (i = 0; i < height; i++) + { + if (StandardOrientation) + row_p[height - 1 - i] = &data[png_get_rowbytes(png, info)*i]; + else + row_p[i] = &data[png_get_rowbytes(png, info)*i]; + } + + png_read_image(png, row_p); + free(row_p); + + int iBitCount; + + if (trans == PNG_SOLID || trans == PNG_ALPHA || color == PNG_COLOR_TYPE_RGB_ALPHA || color == PNG_COLOR_TYPE_GRAY_ALPHA) + { + switch (color) + { + case PNG_COLOR_TYPE_GRAY: + case PNG_COLOR_TYPE_RGB: + case PNG_COLOR_TYPE_PALETTE: + iBitCount = 24; + if (pinfo != NULL) pinfo->Alpha = 0; + break; + + case PNG_COLOR_TYPE_GRAY_ALPHA: + case PNG_COLOR_TYPE_RGB_ALPHA: + iBitCount = 32; + if (pinfo != NULL) pinfo->Alpha = 8; + break; + + default: + return NULL; + } + } + + png_read_end(png, endinfo); + png_destroy_read_struct(&png, &info, &endinfo); + + // free(data); + + if (fp) + fclose(fp); + + osg::Image* pOsgImage = new osg::Image(); + + pOsgImage->setFileName(fileName.c_str()); + if (iBitCount == 24) + pOsgImage->setImage(width, height, 1, + iBitCount / 8,// int internalFormat, + GL_RGB, // unsigned int pixelFormat + GL_UNSIGNED_BYTE,// unsigned int dataType + data); + else + pOsgImage->setImage(width, height, 1, + iBitCount / 8,// int internalFormat, + GL_RGBA, // unsigned int pixelFormat + GL_UNSIGNED_BYTE,// unsigned int dataType + data); + return pOsgImage; + } +}; + +// now register with Registry to instantiate the above +// reader/writer. +osgDB::RegisterReaderWriterProxy g_readerWriter_PNG_Proxy; diff --git a/src/osgUtil/CullViewState.cpp b/src/osgUtil/CullViewState.cpp new file mode 100644 index 000000000..5c0104dd4 --- /dev/null +++ b/src/osgUtil/CullViewState.cpp @@ -0,0 +1,32 @@ + +#include "osg/Transform" +#include "osg/Geode" +#include "osg/LOD" +#include "osg/Billboard" +#include "osg/LightSource" +#include "osg/Impostor" +#include "osg/Notify" + +#include "osgUtil/CullViewState" + +#include + +using namespace osg; +using namespace osgUtil; + +//#define USE_OLD_CULL + +CullViewState::CullViewState() +{ + _matrix = NULL; + _inverse = NULL; + _ratio2 = 0.002f*0.002f; + _bbCornerNear = 8; // note this is an error value, valid range is 0..7 + _bbCornerFar = 8; // these error values are used to show a unset corner. +} + + +CullViewState::~CullViewState() +{ +} + diff --git a/src/osgUtil/CullVisitor.cpp b/src/osgUtil/CullVisitor.cpp new file mode 100644 index 000000000..bdb07d98d --- /dev/null +++ b/src/osgUtil/CullVisitor.cpp @@ -0,0 +1,1209 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include +#include + +#ifndef OSG_USE_IO_DOT_H +#include +using namespace std; +#endif + +using namespace osg; +using namespace osgUtil; + +#define DEG2RAD(x) ((x)*M_PI/180.0) + +static bool g_debugging2 = false; + +inline float MAX_F(float a, float b) + { return a>b?a:b; } +inline int EQUAL_F(float a, float b) + { return a == b || fabsf(a-b) <= MAX_F(fabsf(a),fabsf(b))*1e-3f; } + + +class PrintVisitor : public NodeVisitor +{ + + public: + + PrintVisitor():NodeVisitor(NodeVisitor::TRAVERSE_ALL_CHILDREN) + { + _indent = 0; + _step = 4; + } + + inline void moveIn() { _indent += _step; } + inline void moveOut() { _indent -= _step; } + inline void writeIndent() + { + for(int i=0;i<_indent;++i) cout << " "; + } + + virtual void apply(Node& node) + { + moveIn(); + writeIndent(); cout << node.className() <_eyePoint.set(0.0f,0.0f,1.0f); + _tvs->_centerPoint.set(0.0f,0.0f,0.0f); + _tvs->_lookVector.set(0.0f,0.0f,-1.0f); + _tvs->_upVector.set(0.0f,1.0f,0.0f); + + _cvs = _tvs; + + _tsm = LOOK_VECTOR_DISTANCE; + _tsm = OBJECT_EYE_POINT_DISTANCE; + + + _calculated_znear = FLT_MAX; + _calculated_zfar = -FLT_MAX; + + _view[0] = 0; + _view[1] = 0; + _view[2] = 1024; + _view[3] = 768; + + _impostorActive = true; + _depthSortImpostorSprites = false; + _impostorPixelErrorThreshold = 4.0f; + _numFramesToKeepImpostorSprites = 10; + _impostorSpriteManager = new ImpostorSpriteManager; + +} + + +CullVisitor::~CullVisitor() +{ + reset(); +} + + +void CullVisitor::reset() +{ + + // + // first unref all referenced objects and then empty the containers. + // + _viewStateStack.clear(); + + if (_cvs!=_tvs) + { + _cvs = _tvs; + } + + // reset the calculated near far planes. + _calculated_znear = FLT_MAX; + _calculated_zfar = -FLT_MAX; + + + // remove all accept the first element of the stack. + _cullingModeStack.erase(_cullingModeStack.begin()+1,_cullingModeStack.end()); + + // reset the resuse lists. + _currentReuseMatrixIndex = 0; + _currentReuseRenderLeafIndex = 0; + + for(RenderLeafList::iterator itr=_reuseRenderLeafList.begin(); + itr!=_reuseRenderLeafList.end(); + ++itr) + { + (*itr)->reset(); + } + +} + +void CullVisitor::setCamera(const Camera& camera) +{ + _camera = &camera; + + _tvs->_clippingVolume = camera.getClippingVolume(); + + _tvs->_eyePoint = camera.getEyePoint_Model(); + + _tvs->_centerPoint = camera.getCenterPoint_Model(); + + _tvs->_lookVector = _tvs->_centerPoint-_tvs->_eyePoint; + _tvs->_lookVector.normalize(); + + _tvs->_upVector = camera.getUpVector_Model(); + + _tvs->_bbCornerFar = (_tvs->_lookVector.x()>=0?1:0) | + (_tvs->_lookVector.y()>=0?2:0) | + (_tvs->_lookVector.z()>=0?4:0); + + _tvs->_bbCornerNear = (~_tvs->_bbCornerFar)&7; + +} + +void CullVisitor::pushCullViewState(const Matrix* matrix) +{ + + osg::ref_ptr nvs = new CullViewState; + + Matrix* inverse_world = NULL; + + if (matrix) + { + if (_cvs.valid() && _cvs->_matrix.valid()) + { + nvs->_matrix = new Matrix; + nvs->_matrix->mult(*matrix,*(_cvs->_matrix)); + } + else + { + nvs->_matrix = new Matrix(*matrix); + } + + inverse_world = new Matrix; + inverse_world->invert(*(nvs->_matrix)); + nvs->_inverse = inverse_world; + } + else + { + if (_cvs.valid()) + { + nvs->_matrix = _cvs->_matrix; + nvs->_inverse = _cvs->_inverse; + inverse_world = nvs->_inverse.get(); + + } + else + { + nvs->_matrix = NULL; + nvs->_inverse = NULL; + inverse_world = NULL; + } + } + + if (inverse_world) + { + nvs->_eyePoint = _tvs->_eyePoint*(*inverse_world); + + nvs->_centerPoint = _tvs->_centerPoint*(*inverse_world); + + nvs->_lookVector = nvs->_centerPoint - nvs->_eyePoint; + nvs->_lookVector.normalize(); + + Vec3 zero_transformed = Vec3(0.0f,0.0f,0.0f)*(*inverse_world); + nvs->_upVector = (_tvs->_upVector)*(*inverse_world) - zero_transformed; + nvs->_upVector.normalize(); + + nvs->_clippingVolume = _tvs->_clippingVolume; + nvs->_clippingVolume.transformProvidingInverse(*(nvs->_matrix)); + + } + else + { + nvs->_eyePoint = _tvs->_eyePoint; + + nvs->_lookVector = _tvs->_lookVector; + + nvs->_centerPoint = _tvs->_centerPoint; + + nvs->_upVector = _tvs->_upVector; + + nvs->_clippingVolume = _tvs->_clippingVolume; + } + + + nvs->_bbCornerFar = (nvs->_lookVector.x()>=0?1:0) | + (nvs->_lookVector.y()>=0?2:0) | + (nvs->_lookVector.z()>=0?4:0); + + nvs->_bbCornerNear = (~nvs->_bbCornerFar)&7; + + _cvs = nvs; + + _viewStateStack.push_back(nvs); +} + + +void CullVisitor::popCullViewState() +{ + // pop the top of the view stack and unref it. + _viewStateStack.pop_back(); + + // to new cvs and ref it. + if (_viewStateStack.empty()) + { + _cvs = _tvs; + } + else + { + _cvs = _viewStateStack.back().get(); + } + +} + +void CullVisitor::updateCalculatedNearFar(const osg::BoundingBox& bb) +{ + + if (!bb.isValid()) + { + osg::notify(osg::WARN)<<"Warning: CullVisitor::updateCalculatedNearFar(..) passed a null bounding box."<_eyePoint; // note world eye point. + const osg::Vec3& lookVector = _tvs->_lookVector; // world look vector. + + float d_near,d_far; + + if (_cvs->_matrix.valid()) + { + + const osg::Matrix& matrix = *(_cvs->_matrix); + // calculate the offset from the eye in local coords then transform + // the offset into world and then compare against the world look vector. + d_near = ((bb.corner(_cvs->_bbCornerNear)*matrix) - eyePoint)*lookVector; + d_far = ((bb.corner(_cvs->_bbCornerFar)*matrix) - eyePoint)*lookVector; + + } + else + { + d_near = (bb.corner(_cvs->_bbCornerNear)-eyePoint)*lookVector; + d_far = (bb.corner(_cvs->_bbCornerFar)-eyePoint)*lookVector; + } + + if (d_near<=d_far) + { + if (d_near<_calculated_znear) _calculated_znear = d_near; + if (d_far>_calculated_zfar) _calculated_zfar = d_far; + } + else + { + if ( !EQUAL_F(d_near, d_far) ) + { + osg::notify(osg::WARN)<<"Warning: CullVisitor::updateCalculatedNearFar(.) near>far in range calculation,"<_lookVector.x()<<","<<_tvs->_lookVector.y()<<","<<_tvs->_lookVector.z()<<"]"<_lookVector*delta_center;break; + case(OBJECT_EYE_POINT_DISTANCE): + default: depth = delta_center.length2();break; + } + + if (stateset) pushStateSet(stateset); + addDrawableAndDepth(drawable,matrix,depth); + if (stateset) popStateSet(); + + } + else + { + if (stateset) pushStateSet(stateset); + addDrawable(drawable,matrix); + if (stateset) popStateSet(); + } + + } + + // pop the node's state off the geostate stack. + if (node_state) popStateSet(); + +} + + +void CullVisitor::apply(Billboard& node) +{ + // return if object's bounding sphere is culled. + CullViewState::CullingMode mode = _cullingModeStack.back(); + if (isCulled(node.getBound(),mode)) return; + + // push the node's state. + StateSet* node_state = node.getStateSet(); + if (node_state) pushStateSet(node_state); + + Vec3 eye_local = getEyeLocal(); + Matrix* matrix = getCurrentMatrix(); + + for(int i=0;igetBound())) continue; + + updateCalculatedNearFar(pos); + + Matrix* billboard_matrix = createOrReuseMatrix(); + node.calcTransform(eye_local,pos,*billboard_matrix); + + StateSet* stateset = drawable->getStateSet(); + + bool isTransparent = stateset && stateset->getRenderingHint()==osg::StateSet::TRANSPARENT_BIN; + if (isTransparent) + { + + if (matrix) + { + billboard_matrix->mult(*billboard_matrix,*matrix); + } + + Vec3 center; + if (matrix) + { + center = pos*(*matrix); + } + else + { + center = pos; + } + Vec3 delta_center = center-_tvs->_eyePoint; + + if (g_debugging2) + { + notify(INFO) << "center ["<_lookVector.x()<<","<<_tvs->_lookVector.y()<<","<<_tvs->_lookVector.z()<<"]"<_lookVector*delta_center;break; + case(OBJECT_EYE_POINT_DISTANCE): + default: depth = delta_center.length2();break; + } + + if (stateset) pushStateSet(stateset); + addDrawableAndDepth(drawable,billboard_matrix,depth); + if (stateset) popStateSet(); + + } + else + { + if (stateset) pushStateSet(stateset); + addDrawable(drawable,billboard_matrix); + if (stateset) popStateSet(); + } + + } + + // pop the node's state off the geostate stack. + if (node_state) popStateSet(); + +} + + +void CullVisitor::apply(LightSource& node) +{ + // push the node's state. + StateSet* node_state = node.getStateSet(); + if (node_state) pushStateSet(node_state); + + Matrix* matrix = getCurrentMatrix(); + Light* light = node.getLight(); + if (light) + { + addLight(light,matrix); + } + + // pop the node's state off the geostate stack. + if (node_state) popStateSet(); +} + + +void CullVisitor::apply(Group& node) +{ + // return if object's bounding sphere is culled. + CullViewState::CullingMode mode = _cullingModeStack.back(); + if (isCulled(node.getBound(),mode)) return; + + // push the culling mode. + _cullingModeStack.push_back(mode); + + // push the node's state. + StateSet* node_state = node.getStateSet(); + if (node_state) pushStateSet(node_state); + + traverse(node); + + // pop the node's state off the render graph stack. + if (node_state) popStateSet(); + + // pop the culling mode. + _cullingModeStack.pop_back(); +} + + +void CullVisitor::apply(Transform& node) +{ + // return if object's bounding sphere is culled. + CullViewState::CullingMode mode = _cullingModeStack.back(); + if (isCulled(node.getBound(),mode)) return; + + // push the culling mode. + _cullingModeStack.push_back(mode); + + // push the node's state. + StateSet* node_state = node.getStateSet(); + if (node_state) pushStateSet(node_state); + + pushCullViewState(&node.getMatrix()); + + traverse(node); + + popCullViewState(); + + // pop the node's state off the render graph stack. + if (node_state) popStateSet(); + + // pop the culling mode. + _cullingModeStack.pop_back(); +} + + +void CullVisitor::apply(Switch& node) +{ + apply((Group&)node); +} + + +void CullVisitor::apply(LOD& node) +{ + // return if object's bounding sphere is culled. + CullViewState::CullingMode mode = _cullingModeStack.back(); + if (isCulled(node.getBound(),mode)) return; + + int eval = node.evaluate(getEyeLocal(),_LODBias); + if (eval<0) return; + + // push the culling mode. + _cullingModeStack.push_back(mode); + + // push the node's state. + StateSet* node_state = node.getStateSet(); + if (node_state) pushStateSet(node_state); + + //notify(INFO) << "selecting child "<accept(*this); + + // pop the node's state off the render graph stack. + if (node_state) popStateSet(); + + // pop the culling mode. + _cullingModeStack.pop_back(); +} + +void CullVisitor::apply(Impostor& node) +{ + const BoundingSphere& bs = node.getBound(); + + // return if object's bounding sphere is culled. + CullViewState::CullingMode mode = _cullingModeStack.back(); + if (isCulled(bs,mode)) return; + + osg::Vec3 eyeLocal = getEyeLocal(); + + int eval = node.evaluate(eyeLocal,_LODBias); + if (eval<0){ + return; + } + + // push the culling mode. + _cullingModeStack.push_back(mode); + + // push the node's state. + StateSet* node_state = node.getStateSet(); + if (node_state) pushStateSet(node_state); + + + float distance2 = (eyeLocal-bs.center()).length2(); + if (!_impostorActive || + distance2*_LODBias*_LODBiasaccept(*this); + } + else + { + // within the impostor distance threshold therefore attempt + // to use impostor instead. + + Matrix* matrix = getCurrentMatrix(); + + // search for the best fit ImpostorSprite; + ImpostorSprite* impostorSprite = node.findBestImpostorSprite(eyeLocal); + + if (impostorSprite) + { + // impostor found, now check to see if it is good enough to use + float error = impostorSprite->calcPixelError(*_camera,_view,matrix); + + if (error>_impostorPixelErrorThreshold) + { + // chosen impostor sprite pixel error is too great to use + // from this eye point, therefore invalidate it. + impostorSprite=NULL; + } + } + + +// need to think about sprite reuse and support for multiple context's. + + if (impostorSprite==NULL) + { + // no appropriate sprite has been found therefore need to create + // one for use. + + // create the impostor sprite. + impostorSprite = createImpostorSprite(node); + + } + + if (impostorSprite) + { + + updateCalculatedNearFar(impostorSprite->getBound()); + + StateSet* stateset = impostorSprite->getStateSet(); + + if (stateset) pushStateSet(stateset); + + if (_depthSortImpostorSprites) + { + Vec3 center; + if (matrix) + { + center = node.getCenter()*(*matrix); + } + else + { + center = node.getCenter(); + } + Vec3 delta_center = center-_tvs->_eyePoint; + + if (g_debugging2) + { + notify(INFO) << "center ["<_lookVector.x()<<","<<_tvs->_lookVector.y()<<","<<_tvs->_lookVector.z()<<"]"<_lookVector*delta_center;break; + case(OBJECT_EYE_POINT_DISTANCE): + default: depth = delta_center.length2();break; + } + + addDrawableAndDepth(impostorSprite,matrix,depth); + } + else + { + addDrawable(impostorSprite,matrix); + } + + if (stateset) popStateSet(); + + // update frame number to show that impostor is in action. + impostorSprite->setLastFrameUsed(_frameNumber); + + } + else + { + // no impostor has been selected or created so default to + // traversing the usual LOD selected child. + node.getChild(eval)->accept(*this); + } + + } + + // pop the node's state off the render graph stack. + if (node_state) popStateSet(); + + // pop the culling mode. + _cullingModeStack.pop_back(); +} + +ImpostorSprite* CullVisitor::createImpostorSprite(Impostor& node) +{ + if (!_camera.valid()) return NULL; + + bool isPerspectiveCamera = _camera->getProjectionType()==Camera::FRUSTUM || + _camera->getProjectionType()==Camera::PERSPECTIVE; + + Matrix* matrix = getCurrentMatrix(); + const BoundingSphere& bs = node.getBound(); + osg::Vec3 eye_local = getEyeLocal(); + int eval = node.evaluate(eye_local,_LODBias); + + if (!bs.isValid()) + { + return NULL; + } + + + // no appropriate sprite has been found therefore need to create + // one for use. + + // create the render to texture stage. + ref_ptr rtts = new RenderToTextureStage; + + + // set up the camera, note, in world coordinates, as if + // at the root of the scene graph as in the cullvisitor's original. + // this is required since we are simply inheriting all the + // transforms above this impostor node, rather than creating + // a local version and starting with a clean slate. We could + // do this, but then lights and clipping planes would need to + // transformed accordingly. This way we avoid this. + Vec3 eye_world = _tvs->_eyePoint; + + Vec3 center_world = bs.center(); + if (matrix) center_world = center_world*(*matrix); + + Vec3 lv_world = center_world-eye_world; + + Vec3 side_world = lv_world ^ _tvs->_upVector; + Vec3 up_world = side_world ^ lv_world; + up_world.normalize(); + + ref_ptr camera = new Camera; + camera->setLookAt(eye_world,center_world,up_world); + + rtts->setCamera(camera.get()); + + + // set up lighting. + // currently ignore lights in the scene graph itself.. + // will do later. + RenderStage* previous_stage = _currentRenderBin->_stage; + + // set up the background color and clear mask. + osg::Vec4 clear_color = previous_stage->getClearColor(); + clear_color[3] = 0.0f; // set the alpha to zero. + rtts->setClearColor(clear_color); + rtts->setClearMask(previous_stage->getClearMask()); + + // set up to charge the same RenderStageLighting is the parent previous stage. + rtts->setRenderStageLighting(previous_stage->getRenderStageLighting()); + + // record the render bin, to be restored after creation + // of the render to text + RenderBin* previousRenderBin = _currentRenderBin; + + // set the current renderbin to be the newly created stage. + _currentRenderBin = rtts.get(); + + // what shall we do about the cull view stack? + // need to craete a new _tvs and save the previous one. + // need to create a push a new _cvs to set up for new camera position. + + ref_ptr previous_tvs = _tvs; + + _tvs = new CullViewState; + + // store the previous camera setting + ref_ptr previous_camera = _camera; + + // sets up the _tvs to reflect the new camera. + setCamera(*camera); + + // pushing the cull view state will update it so it takes + // into account the new camera orientation. + pushCullViewState(); + + // what shall we do about the near far? + // we could need to save the near and far, or switch it off. + // simplicist to save near and far. will do this for now. + + float previous_znear = _calculated_znear; + float previous_zfar = _calculated_zfar; + + _calculated_znear = FLT_MAX; + _calculated_zfar = -FLT_MAX; + + ref_ptr dummyState = new StateSet; + + +// dummyState->setMode(GL_BLEND,osg::StateAttribute::OVERRIDE_OFF); + + pushStateSet(dummyState.get()); + + + // switch off the view frustum culling, since we will have + // the whole subgraph in view. + _cullingModeStack.push_back((_cullingModeStack.back() & ~CullViewState::VIEW_FRUSTUM_CULLING)); + + { + + // traversing the usual LOD selected child. + node.getChild(eval)->accept(*this); + + } + + popStateSet(); + + // restore the culling mode. + _cullingModeStack.pop_back(); + + float local_znear = _calculated_znear; + float local_zfar = _calculated_zfar; + + // restore the previous near and far. + _calculated_znear = previous_znear; + _calculated_zfar = previous_zfar; + + // restor the previous renderbin. + _currentRenderBin = previousRenderBin; + + // restore the previous _tvs and _cvs; + _tvs = previous_tvs; + popCullViewState(); + + + // restore the previous camera. + _camera = previous_camera; + + + if (rtts->_renderGraphList.size()==0 && rtts->_bins.size()==0) + { + // getting to this point means that all the subgraph has been + // culled by small feature culling or is beyond LOD ranges. + return NULL; + } + + if (local_znear>local_zfar) + { + notify(WARN) << "Warning : problem with osg::CullVisitor::creatImpostorSprite() local_znear ("< ("<_upVector; + Vec3 lv_local = center_local-eye_local; + + float distance_local = lv_local.length(); + lv_local /= distance_local; + + Vec3 sv_local = lv_local^camera_up_local; + sv_local.normalize(); + + Vec3 up_local = sv_local^lv_local; + + + + float width = bs.radius(); + if (isPerspectiveCamera) + { + // expand the width to account for projection onto sprite. + width *= (distance_local/sqrtf(distance_local*distance_local-bs.radius2())); + } + + // scale up and side vectors to sprite width. + up_local *= width; + sv_local *= width; + + // create the corners of the sprite. + Vec3 c00(center_local - sv_local - up_local); + Vec3 c10(center_local + sv_local - up_local); + Vec3 c01(center_local - sv_local + up_local); + Vec3 c11(center_local + sv_local + up_local); + +// adjust camera left,right,up,down to fit (in world coords) + +#define USE_SPHERE_NEAR_FAR + +#ifdef USE_SPHERE_NEAR_FAR + Vec3 near_local ( center_local-lv_local*width ); + Vec3 far_local ( center_local+lv_local*width ); +#endif + Vec3 top_local ( center_local+up_local); + Vec3 right_local ( center_local+sv_local); + +#ifdef USE_SPHERE_NEAR_FAR + Vec3 near_world; + Vec3 far_world; +#endif + Vec3 top_world; + Vec3 right_world; + + if (matrix) + { +#ifdef USE_SPHERE_NEAR_FAR + near_world = near_local * (*matrix); + far_world = far_local * (*matrix); +#endif + top_world = top_local * (*matrix); + right_world = right_local * (*matrix); + } + else + { +#ifdef USE_SPHERE_NEAR_FAR + near_world = near_local; + far_world = far_local; +#endif + top_world = top_local; + right_world = right_local; + } + +#ifdef USE_SPHERE_NEAR_FAR + float znear = (near_world-eye_world).length(); + float zfar = (far_world-eye_world).length(); +#else + float znear = local_znear; + float zfar = local_zfar; +#endif + + if (local_zfar>=local_znear) + { + znear = local_znear; + zfar = local_zfar; + } + + + + + float top = (top_world-center_world).length(); + float right = (right_world-center_world).length(); + + znear *= 0.9f; + zfar *= 1.1f; + + if (isPerspectiveCamera) + { + // deal with projection issue move the top and right points + // onto the near plane. + float ratio = znear/(center_world-eye_world).length(); + top *= ratio; + right *= ratio; + camera->setFrustum(-right,right,-top,top,znear,zfar); + + } + else + { + // othographic projection. + + camera->setOrtho(-right,right,-top,top,znear,zfar); + } + + if (local_znearzfar) + { + zfar = local_zfar; + } + + // restore the previous near and far. + local_znear = previous_znear; + local_zfar = previous_zfar; + + +// calc texture size for eye, bs. + + Vec3 c00_world; + Vec3 c11_world; + + if (matrix) + { + c00_world = c00 * (*matrix); + c11_world = c11 * (*matrix); + } + else + { + c00_world = c00; + c11_world = c11; + } + + + // convert the corners of the sprite (in world coords) into their + // equivilant window coordinates by using the camera's project method. + Vec3 c00_win; + Vec3 c11_win; + _camera->project(c00_world,_view,c00_win); + _camera->project(c11_world,_view,c11_win); + + +// adjust texture size to be nearest power of 2. + + float s = c11_win.x()-c00_win.x(); + float t = c11_win.y()-c00_win.y(); + + // may need to reverse sign of width or height if a matrix has + // been applied which flips the orientation of this subgraph. + if (s<0.0f) s = -s; + if (t<0.0f) t = -t; + + // bias value used to assist the rounding up or down of + // the texture dimensions to the nearest power of two. + // bias near 0.0 will almost always round down. + // bias near 1.0 will almost always round up. + float bias = 0.7f; + + float sp2 = logf((float)s)/logf(2.0f); + float rounded_sp2 = floorf(sp2+bias); + int new_s = (int)(powf(2.0f,rounded_sp2)); + + float tp2 = logf((float)t)/logf(2.0f); + float rounded_tp2 = floorf(tp2+bias); + int new_t = (int)(powf(2.0f,rounded_tp2)); + + // if dimension is bigger than window divide it down. + while (new_s>_view[2]) new_s /= 2; + + // if dimension is bigger than window divide it down. + while (new_t>_view[3]) new_t /= 2; + + rtts->setViewport(_view[0],_view[1],new_s,new_t); + +// create the impostor sprite. + + ImpostorSprite* impostorSprite = + _impostorSpriteManager->createOrReuseImpostorSprite(new_s,new_t,_frameNumber-_numFramesToKeepImpostorSprites); + + if (impostorSprite==NULL) return NULL; + + // have successfully created an impostor sprite so now need to + // add it into the impostor. + node.addImpostorSprite(impostorSprite); + + if (_depthSortImpostorSprites) + { + // the depth sort bin should probably be user definable, + // will look into this later. RO July 2001. + StateSet* stateset = impostorSprite->getStateSet(); + stateset->setRenderBinDetails(1,"DepthSortedBin"); + } + + Texture* texture = impostorSprite->getTexture(); + + // update frame number to show that impostor is in action. + impostorSprite->setLastFrameUsed(_frameNumber); + + Vec3* coords = impostorSprite->getCoords(); + Vec2* texcoords = impostorSprite->getTexCoords(); + + coords[0] = c01; + texcoords[0].set(0.0f,1.0f); + + coords[1] = c00; + texcoords[1].set(0.0f,0.0f); + + coords[2] = c10; + texcoords[2].set(1.0f,0.0f); + + coords[3] = c11; + texcoords[3].set(1.0f,1.0f); + + impostorSprite->dirtyBound(); + + Vec3* controlcoords = impostorSprite->getControlCoords(); + + if (isPerspectiveCamera) + { + // deal with projection issue by moving the coorners of the quad + // towards the eye point. + float ratio = width/(center_local-eye_local).length(); + float one_minus_ratio = 1.0f-ratio; + Vec3 eye_local_ratio = eye_local*ratio; + + controlcoords[0] = coords[0]*one_minus_ratio + eye_local_ratio; + controlcoords[1] = coords[1]*one_minus_ratio + eye_local_ratio; + controlcoords[2] = coords[2]*one_minus_ratio + eye_local_ratio; + controlcoords[3] = coords[3]*one_minus_ratio + eye_local_ratio; + } + else + { + // project the control points forward towards the eyepoint, + // but since this an othographics projection this projection is + // parallel. + Vec3 dv = lv_local*width; + + controlcoords[0] = coords[0]-dv; + controlcoords[1] = coords[1]-dv; + controlcoords[2] = coords[2]-dv; + controlcoords[3] = coords[3]-dv; + } + + impostorSprite->setStoredLocalEyePoint(eye_local); + + + // and the render to texture stage to the current stages + // dependancy list. + _currentRenderBin->_stage->addToDependencyList(rtts.get()); + + // attach texture to the RenderToTextureStage. + rtts->setTexture(texture); + + // must sort the RenderToTextureStage so that all leaves are + // accounted correctly in all renderbins i.e depth sorted bins. + rtts->sort(); + + return impostorSprite; + +} diff --git a/src/osgUtil/DepthSortedBin.cpp b/src/osgUtil/DepthSortedBin.cpp new file mode 100644 index 000000000..c73946a6c --- /dev/null +++ b/src/osgUtil/DepthSortedBin.cpp @@ -0,0 +1,97 @@ +#include +#include + +#include + +using namespace osg; +using namespace osgUtil; + +// register a RenderStage prototype with the RenderBin prototype list. +RegisterRenderBinProxy s_registerDepthSortedBinProxy; + +DepthSortedBin::DepthSortedBin() +{ + _drawOrder = BACK_TO_FRONT; +} + +DepthSortedBin::~DepthSortedBin() +{ +} + +void DepthSortedBin::reset() +{ + RenderBin::reset(); + + _renderLeafList.clear(); +} + +struct DepthSortFunctor2 +{ + const bool operator() (const RenderLeaf* lhs,const RenderLeaf* rhs) + { + return (lhs->_depth_depth); + } +}; + + + +void DepthSortedBin::sort_local() +{ + _renderLeafList.clear(); + + int totalsize=0; + RenderGraphList::iterator itr; + for(itr=_renderGraphList.begin(); + itr!=_renderGraphList.end(); + ++itr) + { + totalsize += (*itr)->_leaves.size(); + } + + _renderLeafList.reserve(totalsize); + + // first copy all the leaves from the render graphs into the leaf list. + for(itr=_renderGraphList.begin(); + itr!=_renderGraphList.end(); + ++itr) + { + for(RenderGraph::LeafList::iterator dw_itr = (*itr)->_leaves.begin(); + dw_itr != (*itr)->_leaves.end(); + ++dw_itr) + { + _renderLeafList.push_back(dw_itr->get()); + } + } + + // now sort the list into acending depth order. + std::sort(_renderLeafList.begin(),_renderLeafList.end(),DepthSortFunctor2()); + +} + +void DepthSortedBin::draw_local(osg::State& state,RenderLeaf*& previous) +{ + if (_drawOrder==BACK_TO_FRONT) + { + // render the bin from back to front. + for(RenderLeafList::reverse_iterator itr= _renderLeafList.rbegin(); + itr!= _renderLeafList.rend(); + ++itr) + { + RenderLeaf* rl = *itr; + rl->render(state,previous); + previous = rl; + } + } + else + { + // render the from front to back. + for(RenderLeafList::iterator itr= _renderLeafList.begin(); + itr!= _renderLeafList.end(); + ++itr) + { + RenderLeaf* rl = *itr; + rl->render(state,previous); + previous = rl; + } + } +} diff --git a/src/osgUtil/InsertImpostorsVisitor.cpp b/src/osgUtil/InsertImpostorsVisitor.cpp new file mode 100644 index 000000000..30914050c --- /dev/null +++ b/src/osgUtil/InsertImpostorsVisitor.cpp @@ -0,0 +1,176 @@ +#if defined(_MSC_VER) + #pragma warning( disable : 4786 ) +#endif + +#include + +#include + +using namespace osg; +using namespace osgUtil; + +InsertImpostorsVisitor::InsertImpostorsVisitor() +{ + setTraversalMode(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN); + _impostorThresholdRatio = 10.0f; + _maximumNumNestedImpostors = 3; + _numNestedImpostors = 0; +} + +void InsertImpostorsVisitor::reset() +{ + _groupList.clear(); + _lodList.clear(); + _numNestedImpostors = 0; +} + +void InsertImpostorsVisitor::apply(Node& node) +{ + traverse(node); +} + +void InsertImpostorsVisitor::apply(Group& node) +{ + _groupList.push_back(&node); + + ++_numNestedImpostors; + if (_numNestedImpostors<_maximumNumNestedImpostors) + { + traverse(node); + } + --_numNestedImpostors; +} + +void InsertImpostorsVisitor::apply(LOD& node) +{ + _lodList.push_back(&node); + + ++_numNestedImpostors; + if (_numNestedImpostors<_maximumNumNestedImpostors) + { + traverse(node); + } + --_numNestedImpostors; +} + +void InsertImpostorsVisitor::apply(Impostor& node) +{ + ++_numNestedImpostors; + if (_numNestedImpostors<_maximumNumNestedImpostors) + { + traverse(node); + } + --_numNestedImpostors; +} + +/* insert the required impostors into the scene graph.*/ +void InsertImpostorsVisitor::insertImpostors() +{ + + bool _insertImpostorsAboveGroups = true; + bool _replaceLODsByImpostors = true; + + // handle group's + if (_insertImpostorsAboveGroups) + { + std::sort(_groupList.begin(),_groupList.end()); + + Group* previousGroup = NULL; + for(GroupList::iterator itr=_groupList.begin(); + itr!=_groupList.end(); + ++itr) + { + Group* group = (*itr); + if (group!=previousGroup) + { + const BoundingSphere& bs = group->getBound(); + if (bs.isValid()) + { + + // take a copy of the original parent list + // before we change it around by adding the group + // to an impostor. + Node::ParentList parentList = group->getParents(); + + Impostor* impostor = new Impostor; + + // standard LOD settings + impostor->addChild(group); + impostor->setRange(0,0.0f); + impostor->setRange(1,1e7f); + impostor->setCenter(bs.center()); + + // impostor specfic settings. + impostor->setImpostorThresholdToBound(_impostorThresholdRatio); + + // now replace the group by the new impostor in all of the + // group's original parent list. + for(Node::ParentList::iterator pitr=parentList.begin(); + pitr!=parentList.end(); + ++pitr) + { + (*pitr)->replaceChild(group,impostor); + } + + } + } + } + + } + + + // handle LOD's + if (_replaceLODsByImpostors) + { + std::sort(_lodList.begin(),_lodList.end()); + + LOD* previousLOD = NULL; + for(LODList::iterator itr=_lodList.begin(); + itr!=_lodList.end(); + ++itr) + { + osg::LOD* lod = (*itr); + if (lod!=previousLOD) + { + const osg::BoundingSphere& bs = lod->getBound(); + if (bs.isValid()) + { + + // take a copy of the original parent list + // before we change it around by adding the lod + // to an impostor. + Node::ParentList parentList = lod->getParents(); + + osg::Impostor* impostor = new Impostor; + + // standard LOD settings + for(int ci=0;cigetNumChildren();++ci) + { + impostor->addChild(lod->getChild(ci)); + } + + for(int ri=0;rigetNumRanges();++ri) + { + impostor->setRange(ri,lod->getRange(ri)); + } + + impostor->setCenter(lod->getCenter()); + + // impostor specfic settings. + impostor->setImpostorThresholdToBound(_impostorThresholdRatio); + + // now replace the lod by the new impostor in all of the + // lod's original parent list. + for(Node::ParentList::iterator pitr=parentList.begin(); + pitr!=parentList.end(); + ++pitr) + { + (*pitr)->replaceChild(lod,impostor); + } + + } + } + } + + } +} diff --git a/src/osgUtil/NvTriStripObjects.cpp b/src/osgUtil/NvTriStripObjects.cpp new file mode 100644 index 000000000..9052c6fa3 --- /dev/null +++ b/src/osgUtil/NvTriStripObjects.cpp @@ -0,0 +1,1638 @@ + +#if defined(_MSC_VER) + #pragma warning( disable : 4786 ) +#endif + +#include +#include +#include "NvTriStripObjects.h" + +#include + +VertexCache::VertexCache() +{ + VertexCache(16); +} + + +VertexCache::VertexCache(int size) +{ + numEntries = size; + + entries = new int[numEntries]; + + for(int i = 0; i < numEntries; i++) + entries[i] = -1; +} + + +VertexCache::~VertexCache() +{ + delete[] entries; +} + + +int VertexCache::At(int index) +{ + return entries[index]; +} + + +void VertexCache::Set(int index, int value) +{ + entries[index] = value; +} + + +void VertexCache::Clear() +{ + for(int i = 0; i < numEntries; i++) + entries[i] = -1; +} + + +void VertexCache::Copy(VertexCache* inVcache) +{ + for(int i = 0; i < numEntries; i++) + { + inVcache->Set(i, entries[i]); + } +} + + +NvStripifier::NvStripifier() +{ + +} + + +NvStripifier::~NvStripifier() +{ + +} + + +/////////////////////////////////////////////////////////////////////////////////////////// +// FindEdgeInfo() +// +// find the edge info for these two indices +// +NvEdgeInfo * NvStripifier::FindEdgeInfo(NvEdgeInfoVec &edgeInfos, int v0, int v1) +{ + + // we can get to it through either array + // because the edge infos have a v0 and v1 + // and there is no order except how it was + // first created. + NvEdgeInfo *infoIter = edgeInfos[v0]; + while (infoIter != NULL) + { + if (infoIter->m_v0 == v0) + { + if (infoIter->m_v1 == v1) + return infoIter; + else + infoIter = infoIter->m_nextV0; + } + else + { + assert(infoIter->m_v1 == v0); + if (infoIter->m_v0 == v1) + return infoIter; + else + infoIter = infoIter->m_nextV1; + } + } + return NULL; +} + + +/////////////////////////////////////////////////////////////////////////////////////////// +// FindOtherFace +// +// find the other face sharing these vertices +// exactly like the edge info above +// +NvFaceInfo * NvStripifier::FindOtherFace(NvEdgeInfoVec &edgeInfos, int v0, int v1, NvFaceInfo *faceInfo) +{ + NvEdgeInfo *edgeInfo = FindEdgeInfo(edgeInfos, v0, v1); + assert(edgeInfo != NULL); + return (edgeInfo->m_face0 == faceInfo ? edgeInfo->m_face1 : edgeInfo->m_face0); +} + + +bool NvStripifier::AlreadyExists(NvFaceInfo* faceInfo, NvFaceInfoVec& faceInfos) +{ + for(unsigned int i = 0; i < faceInfos.size(); i++) + { + if( (faceInfos[i]->m_v0 == faceInfo->m_v0) && + (faceInfos[i]->m_v1 == faceInfo->m_v1) && + (faceInfos[i]->m_v2 == faceInfo->m_v2) ) + return true; + } + + return false; +} + + +/////////////////////////////////////////////////////////////////////////////////////////// +// BuildStripifyInfo() +// +// Builds the list of all face and edge infos +// +void NvStripifier::BuildStripifyInfo(NvFaceInfoVec &faceInfos, NvEdgeInfoVec &edgeInfos, const int numVertices) +{ + + // reserve space for the face infos, but do not resize them. + int numIndices = indices.size(); + int numTriangles = numIndices / 3; + + faceInfos.reserve(numTriangles); + + // we actually resize the edge infos, so we must initialize to NULL + edgeInfos.resize (numVertices); + int i; + for (i = 0; i < numVertices; i++) + edgeInfos[i] = NULL; + + + // iterate through the triangles of the triangle list + int index = 0; + for (i = 0; i < numTriangles; i++) + { + // grab the indices + int v0 = indices[index++]; + int v1 = indices[index++]; + int v2 = indices[index++]; + + // create the face info and add it to the list of faces, but only if this exact face doesn't already + // exist in the list + NvFaceInfo *faceInfo = new NvFaceInfo(v0, v1, v2); + if(!AlreadyExists(faceInfo, faceInfos)) + { + faceInfos.push_back(faceInfo); + + // grab the edge infos, creating them if they do not already exist + NvEdgeInfo *edgeInfo01 = FindEdgeInfo(edgeInfos, v0, v1); + if (edgeInfo01 == NULL) + { + + // create the info + edgeInfo01 = new NvEdgeInfo(v0, v1); + + // update the linked list on both + edgeInfo01->m_nextV0 = edgeInfos[v0]; + edgeInfo01->m_nextV1 = edgeInfos[v1]; + edgeInfos[v0] = edgeInfo01; + edgeInfos[v1] = edgeInfo01; + + // set face 0 + edgeInfo01->m_face0 = faceInfo; + } + else + { + if (edgeInfo01->m_face1 != NULL) + osg::notify(osg::WARN)<<"BuildStripifyInfo: > 2 triangles on an edge... uncertain consequences\n"<m_face1 = faceInfo; + } + + // grab the edge infos, creating them if they do not already exist + NvEdgeInfo *edgeInfo12 = FindEdgeInfo(edgeInfos, v1, v2); + if (edgeInfo12 == NULL) + { + + // create the info + edgeInfo12 = new NvEdgeInfo(v1, v2); + + // update the linked list on both + edgeInfo12->m_nextV0 = edgeInfos[v1]; + edgeInfo12->m_nextV1 = edgeInfos[v2]; + edgeInfos[v1] = edgeInfo12; + edgeInfos[v2] = edgeInfo12; + + // set face 0 + edgeInfo12->m_face0 = faceInfo; + } + else + { + if (edgeInfo12->m_face1 != NULL) + osg::notify(osg::WARN)<<"BuildStripifyInfo: > 2 triangles on an edge... uncertain consequences\n"<m_face1 = faceInfo; + } + + // grab the edge infos, creating them if they do not already exist + NvEdgeInfo *edgeInfo20 = FindEdgeInfo(edgeInfos, v2, v0); + if (edgeInfo20 == NULL) + { + + // create the info + edgeInfo20 = new NvEdgeInfo(v2, v0); + + // update the linked list on both + edgeInfo20->m_nextV0 = edgeInfos[v2]; + edgeInfo20->m_nextV1 = edgeInfos[v0]; + edgeInfos[v2] = edgeInfo20; + edgeInfos[v0] = edgeInfo20; + + // set face 0 + edgeInfo20->m_face0 = faceInfo; + } + else + { + if (edgeInfo20->m_face1 != NULL) + osg::notify(osg::WARN)<<"BuildStripifyInfo: > 2 triangles on an edge... uncertain consequences\n"<m_face1 = faceInfo; + } + + } + } +} + + +/////////////////////////////////////////////////////////////////////////////////////////// +// FindStartPoint() +// +// Finds a good starting point, namely one which has only one neighbor +// +int NvStripifier::FindStartPoint(NvFaceInfoVec &faceInfos, NvEdgeInfoVec &edgeInfos) +{ + for(unsigned int i = 0; i < faceInfos.size(); i++) + { + int ctr = 0; + + if(FindOtherFace(edgeInfos, faceInfos[i]->m_v0, faceInfos[i]->m_v1, faceInfos[i]) == NULL) + ctr++; + if(FindOtherFace(edgeInfos, faceInfos[i]->m_v1, faceInfos[i]->m_v2, faceInfos[i]) == NULL) + ctr++; + if(FindOtherFace(edgeInfos, faceInfos[i]->m_v2, faceInfos[i]->m_v0, faceInfos[i]) == NULL) + ctr++; + if(ctr > 1) + return i; + } + return -1; +} + + +/////////////////////////////////////////////////////////////////////////////////////////// +// FindGoodResetPoint() +// +// A good reset point is one near other commited areas so that +// we know that when we've made the longest strips its because +// we're stripifying in the same general orientation. +// +NvFaceInfo* NvStripifier::FindGoodResetPoint(NvFaceInfoVec &faceInfos, NvEdgeInfoVec &edgeInfos) +{ + // we hop into different areas of the mesh to try to get + // other large open spans done. Areas of small strips can + // just be left to triangle lists added at the end. + NvFaceInfo *result = NULL; + + if(result == NULL) + { + int numFaces = faceInfos.size(); + int startPoint; + if(bFirstTimeResetPoint) + { + //first time, find a face with few neighbors (look for an edge of the mesh) + startPoint = FindStartPoint(faceInfos, edgeInfos); + bFirstTimeResetPoint = false; + } + else + startPoint = (int)(((float) numFaces - 1) * meshJump); + + if(startPoint == -1) + startPoint = (int)(((float) numFaces - 1) * meshJump); + + int i = startPoint; + do + { + + // if this guy isn't visited, try him + if (faceInfos[i]->m_stripId < 0) + { + result = faceInfos[i]; + break; + } + + // update the index and clamp to 0-(numFaces-1) + if (++i >= numFaces) + i = 0; + + } while (i != startPoint); + + // update the meshJump + meshJump += 0.1f; + if (meshJump > 1.0f) + meshJump = .05f; + } + + // return the best face we found + return result; +} + + +/////////////////////////////////////////////////////////////////////////////////////////// +// GetUniqueVertexInB() +// +// Returns the vertex unique to faceB +// +int NvStripifier::GetUniqueVertexInB(NvFaceInfo *faceA, NvFaceInfo *faceB) +{ + + int facev0 = faceB->m_v0; + if (facev0 != faceA->m_v0 && + facev0 != faceA->m_v1 && + facev0 != faceA->m_v2) + return facev0; + + int facev1 = faceB->m_v1; + if (facev1 != faceA->m_v0 && + facev1 != faceA->m_v1 && + facev1 != faceA->m_v2) + return facev1; + + int facev2 = faceB->m_v2; + if (facev2 != faceA->m_v0 && + facev2 != faceA->m_v1 && + facev2 != faceA->m_v2) + return facev2; + + // nothing is different + return -1; +} + + +/////////////////////////////////////////////////////////////////////////////////////////// +// GetSharedVertex() +// +// Returns the vertex shared between the two input faces +// +int NvStripifier::GetSharedVertex(NvFaceInfo *faceA, NvFaceInfo *faceB) +{ + + int facev0 = faceB->m_v0; + if (facev0 == faceA->m_v0 || + facev0 == faceA->m_v1 || + facev0 == faceA->m_v2) + return facev0; + + int facev1 = faceB->m_v1; + if (facev1 == faceA->m_v0 || + facev1 == faceA->m_v1 || + facev1 == faceA->m_v2) + return facev1; + + int facev2 = faceB->m_v2; + if (facev2 == faceA->m_v0 || + facev2 == faceA->m_v1 || + facev2 == faceA->m_v2) + return facev2; + + // nothing is shared + return -1; +} + + +/////////////////////////////////////////////////////////////////////////////////////////// +// GetNextIndex() +// +// Returns vertex of the input face which is "next" in the input index list +// +inline int NvStripifier::GetNextIndex(const WordVec &indices, NvFaceInfo *face) +{ + + int numIndices = indices.size(); + assert(numIndices >= 2); + + int v0 = indices[numIndices-2]; + int v1 = indices[numIndices-1]; + + int fv0 = face->m_v0; + int fv1 = face->m_v1; + int fv2 = face->m_v2; + + if (fv0 != v0 && fv0 != v1) + { + if ((fv1 != v0 && fv1 != v1) || (fv2 != v0 && fv2 != v1)) + { + osg::notify(osg::WARN)<<"GetNextIndex: Triangle doesn't have all of its vertices\n"<m_stripId >= 0) || (IsExperiment() && faceInfo->m_experimentId == m_experimentId); +} + + +/////////////////////////////////////////////////////////////////////////////////////////// +// MarkTriangle() +// +// Marks the face with the current strip ID +// +inline void NvStripInfo::MarkTriangle(NvFaceInfo *faceInfo) +{ + assert(!IsMarked(faceInfo)); + if (IsExperiment()) + { + faceInfo->m_experimentId = m_experimentId; + faceInfo->m_testStripId = m_stripId; + } + else + { + assert(faceInfo->m_stripId == -1); + faceInfo->m_experimentId = -1; + faceInfo->m_stripId = m_stripId; + } +} + + +bool NvStripInfo::Unique(NvFaceInfoVec& faceVec, NvFaceInfo* face) +{ + bool bv0, bv1, bv2; //bools to indicate whether a vertex is in the faceVec or not + bv0 = bv1 = bv2 = false; + + for(unsigned int i = 0; i < faceVec.size(); i++) + { + if(!bv0) + { + if( (faceVec[i]->m_v0 == face->m_v0) || + (faceVec[i]->m_v1 == face->m_v0) || + (faceVec[i]->m_v2 == face->m_v0) ) + bv0 = true; + } + + if(!bv1) + { + if( (faceVec[i]->m_v0 == face->m_v1) || + (faceVec[i]->m_v1 == face->m_v1) || + (faceVec[i]->m_v2 == face->m_v1) ) + bv1 = true; + } + + if(!bv2) + { + if( (faceVec[i]->m_v0 == face->m_v2) || + (faceVec[i]->m_v1 == face->m_v2) || + (faceVec[i]->m_v2 == face->m_v2) ) + bv2 = true; + } + + //the face is not unique, all it's vertices exist in the face vector + if(bv0 && bv1 && bv2) + return false; + } + + //if we get out here, it's unique + return true; +} + + +/////////////////////////////////////////////////////////////////////////////////////////// +// Build() +// +// Builds a strip forward as far as we can go, then builds backwards, and joins the two lists +// +void NvStripInfo::Build(NvEdgeInfoVec &edgeInfos, NvFaceInfoVec &) +{ + // parameters : void NvStripInfo::Build(NvEdgeInfoVec &edgeInfos, NvFaceInfoVec &faceInfos) + + // used in building the strips forward and backward + static WordVec scratchIndices; + scratchIndices.resize(0); + + // build forward... start with the initial face + NvFaceInfoVec forwardFaces, backwardFaces; + forwardFaces.push_back(m_startInfo.m_startFace); + + MarkTriangle(m_startInfo.m_startFace); + + int v0 = (m_startInfo.m_toV1 ? m_startInfo.m_startEdge->m_v0 : m_startInfo.m_startEdge->m_v1); + int v1 = (m_startInfo.m_toV1 ? m_startInfo.m_startEdge->m_v1 : m_startInfo.m_startEdge->m_v0); + + // easiest way to get v2 is to use this function which requires the + // other indices to already be in the list. + scratchIndices.push_back(v0); + scratchIndices.push_back(v1); + int v2 = NvStripifier::GetNextIndex(scratchIndices, m_startInfo.m_startFace); + scratchIndices.push_back(v2); + + // + // build the forward list + // + int nv0 = v1; + int nv1 = v2; + + NvFaceInfo *nextFace = NvStripifier::FindOtherFace(edgeInfos, nv0, nv1, m_startInfo.m_startFace); + while (nextFace != NULL && !IsMarked(nextFace)) + { + //this tests to see if a face is "unique", meaning that its vertices aren't already in the list + // so, strips which "wrap-around" are not allowed + if(!Unique(forwardFaces, nextFace)) + break; + + // add this to the strip + forwardFaces.push_back(nextFace); + + MarkTriangle(nextFace); + + // add the index + nv0 = nv1; + nv1 = NvStripifier::GetNextIndex(scratchIndices, nextFace); + scratchIndices.push_back(nv1); + + // and get the next face + nextFace = NvStripifier::FindOtherFace(edgeInfos, nv0, nv1, nextFace); + + } + + // tempAllFaces is going to be forwardFaces + backwardFaces + // it's used for Unique() + NvFaceInfoVec tempAllFaces; + for(unsigned int i = 0; i < forwardFaces.size(); i++) + tempAllFaces.push_back(forwardFaces[i]); + + // + // reset the indices for building the strip backwards and do so + // + scratchIndices.resize(0); + scratchIndices.push_back(v2); + scratchIndices.push_back(v1); + scratchIndices.push_back(v0); + nv0 = v1; + nv1 = v0; + nextFace = NvStripifier::FindOtherFace(edgeInfos, nv0, nv1, m_startInfo.m_startFace); + while (nextFace != NULL && !IsMarked(nextFace)) + { + //this tests to see if a face is "unique", meaning that its vertices aren't already in the list + // so, strips which "wrap-around" are not allowed + if(!Unique(tempAllFaces, nextFace)) + break; + + // add this to the strip + backwardFaces.push_back(nextFace); + + //this is just so Unique() will work + tempAllFaces.push_back(nextFace); + + MarkTriangle(nextFace); + + // add the index + nv0 = nv1; + nv1 = NvStripifier::GetNextIndex(scratchIndices, nextFace); + scratchIndices.push_back(nv1); + + // and get the next face + nextFace = NvStripifier::FindOtherFace(edgeInfos, nv0, nv1, nextFace); + } + + // Combine the forward and backwards stripification lists and put into our own face vector + Combine(forwardFaces, backwardFaces); +} + + +/////////////////////////////////////////////////////////////////////////////////////////// +// Combine() +// +// Combines the two input face vectors and puts the result into m_faces +// +void NvStripInfo::Combine(const NvFaceInfoVec &forward, const NvFaceInfoVec &backward) +{ + + // add backward faces + int numFaces = backward.size(); + int i; + for (i = numFaces - 1; i >= 0; i--) + m_faces.push_back(backward[i]); + + // add forward faces + numFaces = forward.size(); + for (i = 0; i < numFaces; i++) + m_faces.push_back(forward[i]); +} + + +/////////////////////////////////////////////////////////////////////////////////////////// +// SharesEdge() +// +// Returns true if the input face and the current strip share an edge +// +bool NvStripInfo::SharesEdge(const NvFaceInfo* faceInfo, NvEdgeInfoVec &edgeInfos) +{ + //check v0->v1 edge + NvEdgeInfo* currEdge = NvStripifier::FindEdgeInfo(edgeInfos, faceInfo->m_v0, faceInfo->m_v1); + + if(IsInStrip(currEdge->m_face0) || IsInStrip(currEdge->m_face1)) + return true; + + //check v1->v2 edge + currEdge = NvStripifier::FindEdgeInfo(edgeInfos, faceInfo->m_v1, faceInfo->m_v2); + + if(IsInStrip(currEdge->m_face0) || IsInStrip(currEdge->m_face1)) + return true; + + //check v2->v0 edge + currEdge = NvStripifier::FindEdgeInfo(edgeInfos, faceInfo->m_v2, faceInfo->m_v0); + + if(IsInStrip(currEdge->m_face0) || IsInStrip(currEdge->m_face1)) + return true; + + return false; + +} + + +/////////////////////////////////////////////////////////////////////////////////////////// +// CommitStrips() +// +// "Commits" the input strips by setting their m_experimentId to -1 and adding to the allStrips +// vector +// +void NvStripifier::CommitStrips(NvStripInfoVec &allStrips, const NvStripInfoVec &strips) +{ + // Iterate through strips + int numStrips = strips.size(); + for (int i = 0; i < numStrips; i++) + { + + // Tell the strip that it is now real + NvStripInfo *strip = strips[i]; + strip->m_experimentId = -1; + + // add to the list of real strips + allStrips.push_back(strip); + + // Iterate through the faces of the strip + // Tell the faces of the strip that they belong to a real strip now + const NvFaceInfoVec &faces = strips[i]->m_faces; + int numFaces = faces.size(); + + if( (faces[0]->m_v0 == 2302) && + (faces[0]->m_v1 == 3215) && + (faces[0]->m_v2 == 2603) ) + osg::notify(osg::WARN)<<"BLEH"<MarkTriangle(faces[j]); + } + } +} + + +/////////////////////////////////////////////////////////////////////////////////////////// +// FindTraversal() +// +// Finds the next face to start the next strip on. +// +bool NvStripifier::FindTraversal(NvFaceInfoVec &, +NvEdgeInfoVec &edgeInfos, +NvStripInfo *strip, +NvStripStartInfo &startInfo) +{ + + // if the strip was v0->v1 on the edge, then v1 will be a vertex in the next edge. + int v = (strip->m_startInfo.m_toV1 ? strip->m_startInfo.m_startEdge->m_v1 : strip->m_startInfo.m_startEdge->m_v0); + + NvFaceInfo *untouchedFace = NULL; + NvEdgeInfo *edgeIter = edgeInfos[v]; + while (edgeIter != NULL) + { + NvFaceInfo *face0 = edgeIter->m_face0; + NvFaceInfo *face1 = edgeIter->m_face1; + if ((face0 != NULL && !strip->IsInStrip(face0)) && face1 != NULL && !strip->IsMarked(face1)) + { + untouchedFace = face1; + break; + } + if ((face1 != NULL && !strip->IsInStrip(face1)) && face0 != NULL && !strip->IsMarked(face0)) + { + untouchedFace = face0; + break; + } + + // find the next edgeIter + edgeIter = (edgeIter->m_v0 == v ? edgeIter->m_nextV0 : edgeIter->m_nextV1); + } + + startInfo.m_startFace = untouchedFace; + startInfo.m_startEdge = edgeIter; + if (edgeIter != NULL) + { + if(strip->SharesEdge(startInfo.m_startFace, edgeInfos)) + //note! used to be m_v1 + startInfo.m_toV1 = (edgeIter->m_v0 == v); + else + startInfo.m_toV1 = (edgeIter->m_v1 == v); + } + return (startInfo.m_startFace != NULL); +} + + +//////////////////////////////////////////////////////////////////////////////////////// +// RemoveSmallStrips() +// +// allStrips is the whole strip vector...all small strips will be deleted from this list, to avoid leaking mem +// allBigStrips is an out parameter which will contain all strips above minStripLength +// faceList is an out parameter which will contain all faces which were removed from the striplist +// +void NvStripifier::RemoveSmallStrips(NvStripInfoVec& allStrips, NvStripInfoVec& allBigStrips, NvFaceInfoVec& faceList) +{ + faceList.clear(); + allBigStrips.clear(); //make sure these are empty + NvFaceInfoVec tempFaceList; + + for(unsigned int i = 0; i < allStrips.size(); i++) + { + if(allStrips[i]->m_faces.size() < minStripLength) + { + //strip is too small, add faces to faceList + for(unsigned int j = 0; j < allStrips[i]->m_faces.size(); j++) + tempFaceList.push_back(allStrips[i]->m_faces[j]); + + //and free memory + delete allStrips[i]; + } + else + { + allBigStrips.push_back(allStrips[i]); + } + } + + bool *bVisitedList = new bool[tempFaceList.size()]; + memset(bVisitedList, 0, tempFaceList.size()*sizeof(bool)); + + VertexCache* vcache = new VertexCache(cacheSize); + + int bestNumHits = -1; + int numHits; + int bestIndex = 0; + + while(1) + { + bestNumHits = -1; + + //find best face to add next, given the current cache + for(unsigned int i = 0; i < tempFaceList.size(); i++) + { + if(bVisitedList[i]) + continue; + + numHits = CalcNumHitsFace(vcache, tempFaceList[i]); + if(numHits > bestNumHits) + { + bestNumHits = numHits; + bestIndex = i; + } + } + + if(bestNumHits == -1.0) + break; + bVisitedList[bestIndex] = true; + UpdateCacheFace(vcache, tempFaceList[bestIndex]); + faceList.push_back(tempFaceList[bestIndex]); + } + + delete vcache; + delete[] bVisitedList; +} + + +/////////////////////////////////////////////////////////////////////////////////////////// +// Stripify() +// +// +// in_indices are the input indices of the mesh to stripify +// in_cacheSize is the target cache size +// +void NvStripifier::Stripify(const WordVec &in_indices, const int in_numVertices, const int in_cacheSize, + const int in_minStripLength, NvStripInfoVec &outStrips, NvFaceInfoVec& outFaceList) +{ + meshJump = 0.0f; + bFirstTimeResetPoint = true; //used in FindGoodResetPoint() + + //the number of times to run the experiments + int numSamples = 10; + cacheSize = in_cacheSize; + //this is the strip size threshold below which we dump the strip into a list + minStripLength = in_minStripLength; + + indices = in_indices; + + // build the stripification info + NvFaceInfoVec allFaceInfos; + NvEdgeInfoVec allEdgeInfos; + + BuildStripifyInfo(allFaceInfos, allEdgeInfos, in_numVertices); + + NvStripInfoVec allStrips; + + // stripify + FindAllStrips(allStrips, allFaceInfos, allEdgeInfos, numSamples); + + //split up the strips into cache friendly pieces, optimize them, then dump these into outStrips + SplitUpStripsAndOptimize(allStrips, outStrips, allEdgeInfos, outFaceList); + + //clean up + int i; + for(i = 0; i < (int)allStrips.size(); i++) + { + delete allStrips[i]; + } + + for (i = 0; i < (int)allEdgeInfos.size(); i++) + { + NvEdgeInfo *info = allEdgeInfos[i]; + while (info != NULL) + { + NvEdgeInfo *next = (info->m_v0 == i ? info->m_nextV0 : info->m_nextV1); + info->Unref(); + info = next; + } + } + +} + + +/////////////////////////////////////////////////////////////////////////////////////////// +// SplitUpStripsAndOptimize() +// +// Splits the input vector of strips (allBigStrips) into smaller, cache friendly pieces, then +// reorders these pieces to maximize cache hits +// The final strips are output through outStrips +// +void NvStripifier::SplitUpStripsAndOptimize(NvStripInfoVec &allStrips, NvStripInfoVec &outStrips, +NvEdgeInfoVec& edgeInfos, NvFaceInfoVec& outFaceList) +{ + int threshold = cacheSize - 4; + NvStripInfoVec tempStrips; + + //split up strips into threshold-sized pieces + unsigned int i; + for(i = 0; i < allStrips.size(); i++) + { + NvStripInfo* currentStrip; + NvStripStartInfo startInfo(NULL, NULL, false); + + if((int)(allStrips[i]->m_faces.size()) > threshold) + { + + int numTimes = allStrips[i]->m_faces.size() / threshold; + int numLeftover = allStrips[i]->m_faces.size() % threshold; + + int j; + for(j = 0; j < numTimes; j++) + { + currentStrip = new NvStripInfo(startInfo, 0, -1); + + for(int faceCtr = j*threshold; faceCtr < threshold+(j*threshold); faceCtr++) + { + currentStrip->m_faces.push_back(allStrips[i]->m_faces[faceCtr]); + } + + tempStrips.push_back(currentStrip); + } + + int leftOff = j * threshold; + + if(numLeftover != 0) + { + currentStrip = new NvStripInfo(startInfo, 0, -1); + + for(int k = 0; k < numLeftover; k++) + { + currentStrip->m_faces.push_back(allStrips[i]->m_faces[leftOff++]); + } + + tempStrips.push_back(currentStrip); + } + } + else + { + //we're not just doing a tempStrips.push_back(allBigStrips[i]) because + // this way we can delete allBigStrips later to free the memory + currentStrip = new NvStripInfo(startInfo, 0, -1); + + for(unsigned int j = 0; j < allStrips[i]->m_faces.size(); j++) + currentStrip->m_faces.push_back(allStrips[i]->m_faces[j]); + + tempStrips.push_back(currentStrip); + } + } + + //add small strips to face list + NvStripInfoVec tempStrips2; + RemoveSmallStrips(tempStrips, tempStrips2, outFaceList); + + outStrips.clear(); + if(tempStrips2.size() != 0) + { + //Optimize for the vertex cache + VertexCache* vcache = new VertexCache(cacheSize); + + float bestNumHits = -1.0f; + float numHits; + int bestIndex=0; + + int firstIndex = 0; + float minCost = 10000.0f; + + for(i = 0; i < tempStrips2.size(); i++) + { + int numNeighbors = 0; + + //find strip with least number of neighbors per face + for(unsigned int j = 0; j < tempStrips2[i]->m_faces.size(); j++) + { + numNeighbors += NumNeighbors(tempStrips2[i]->m_faces[j], edgeInfos); + } + + float currCost = (float)numNeighbors / (float)tempStrips2[i]->m_faces.size(); + if(currCost < minCost) + { + minCost = currCost; + firstIndex = i; + } + } + + UpdateCacheStrip(vcache, tempStrips2[firstIndex]); + outStrips.push_back(tempStrips2[firstIndex]); + + tempStrips2[firstIndex]->visited = true; + + //this n^2 algo is what slows down stripification so much.... + // needs to be improved + while(1) + { + bestNumHits = -1.0f; + + //find best strip to add next, given the current cache + for(unsigned int i = 0; i < tempStrips2.size(); i++) + { + if(tempStrips2[i]->visited) + continue; + + numHits = CalcNumHitsStrip(vcache, tempStrips2[i]); + if(numHits > bestNumHits) + { + bestNumHits = numHits; + bestIndex = i; + } + } + + if(bestNumHits == -1.0f) + break; + tempStrips2[bestIndex]->visited = true; + UpdateCacheStrip(vcache, tempStrips2[bestIndex]); + outStrips.push_back(tempStrips2[bestIndex]); + } + + delete vcache; + } +} + + +/////////////////////////////////////////////////////////////////////////////////////////// +// UpdateCacheStrip() +// +// Updates the input vertex cache with this strip's vertices +// +void NvStripifier::UpdateCacheStrip(VertexCache* vcache, NvStripInfo* strip) +{ + for(unsigned int i = 0; i < strip->m_faces.size(); i++) + { + if(!vcache->InCache(strip->m_faces[i]->m_v0)) + vcache->AddEntry(strip->m_faces[i]->m_v0); + + if(!vcache->InCache(strip->m_faces[i]->m_v1)) + vcache->AddEntry(strip->m_faces[i]->m_v1); + + if(!vcache->InCache(strip->m_faces[i]->m_v2)) + vcache->AddEntry(strip->m_faces[i]->m_v2); + } +} + + +/////////////////////////////////////////////////////////////////////////////////////////// +// UpdateCacheFace() +// +// Updates the input vertex cache with this face's vertices +// +void NvStripifier::UpdateCacheFace(VertexCache* vcache, NvFaceInfo* face) +{ + if(!vcache->InCache(face->m_v0)) + vcache->AddEntry(face->m_v0); + + if(!vcache->InCache(face->m_v1)) + vcache->AddEntry(face->m_v1); + + if(!vcache->InCache(face->m_v2)) + vcache->AddEntry(face->m_v2); +} + + +/////////////////////////////////////////////////////////////////////////////////////////// +// CalcNumHitsStrip() +// +// returns the number of cache hits per face in the strip +// +float NvStripifier::CalcNumHitsStrip(VertexCache* vcache, NvStripInfo* strip) +{ + int numHits = 0; + int numFaces = 0; + + for(unsigned int i = 0; i < strip->m_faces.size(); i++) + { + if(vcache->InCache(strip->m_faces[i]->m_v0)) + numHits++; + + if(vcache->InCache(strip->m_faces[i]->m_v1)) + numHits++; + + if(vcache->InCache(strip->m_faces[i]->m_v2)) + numHits++; + + numFaces++; + + } + + return ((float)numHits / (float)numFaces); +} + + +/////////////////////////////////////////////////////////////////////////////////////////// +// CalcNumHitsFace() +// +// returns the number of cache hits in the face +// +int NvStripifier::CalcNumHitsFace(VertexCache* vcache, NvFaceInfo* face) +{ + int numHits = 0; + + if(vcache->InCache(face->m_v0)) + numHits++; + + if(vcache->InCache(face->m_v1)) + numHits++; + + if(vcache->InCache(face->m_v2)) + numHits++; + + return numHits; +} + + +/////////////////////////////////////////////////////////////////////////////////////////// +// NumNeighbors() +// +// Returns the number of neighbors that this face has +// +int NvStripifier::NumNeighbors(NvFaceInfo* face, NvEdgeInfoVec& edgeInfoVec) +{ + int numNeighbors = 0; + + if(FindOtherFace(edgeInfoVec, face->m_v0, face->m_v1, face) != NULL) + { + numNeighbors++; + } + + if(FindOtherFace(edgeInfoVec, face->m_v1, face->m_v2, face) != NULL) + { + numNeighbors++; + } + + if(FindOtherFace(edgeInfoVec, face->m_v2, face->m_v0, face) != NULL) + { + numNeighbors++; + } + + return numNeighbors; +} + + +/////////////////////////////////////////////////////////////////////////////////////////// +// AvgStripSize() +// +// Finds the average strip size of the input vector of strips +// +float NvStripifier::AvgStripSize(const NvStripInfoVec &strips) +{ + int sizeAccum = 0; + int numStrips = strips.size(); + for (int i = 0; i < numStrips; i++) + { + NvStripInfo *strip = strips[i]; + sizeAccum += strip->m_faces.size(); + } + return ((float)sizeAccum) / ((float)numStrips); +} + + +/////////////////////////////////////////////////////////////////////////////////////////// +// FindAllStrips() +// +// Does the stripification, puts output strips into vector allStrips +// +// Works by setting runnning a number of experiments in different areas of the mesh, and +// accepting the one which results in the longest strips. It then accepts this, and moves +// on to a different area of the mesh. We try to jump around the mesh some, to ensure that +// large open spans of strips get generated. +// +void NvStripifier::FindAllStrips(NvStripInfoVec &allStrips, +NvFaceInfoVec &allFaceInfos, +NvEdgeInfoVec &allEdgeInfos, +int numSamples) +{ + // the experiments + int experimentId = 0; + int stripId = 0; + bool done = false; + + int loopCtr = 0; + + while (!done) + { + loopCtr++; + + // + // PHASE 1: Set up numSamples * numEdges experiments + // + NvStripInfoVec *experiments = new NvStripInfoVec [numSamples * 6]; + int experimentIndex = 0; + std::set resetPoints; + int i; + for (i = 0; i < numSamples; i++) + { + + // Try to find another good reset point. + // If there are none to be found, we are done + NvFaceInfo *nextFace = FindGoodResetPoint(allFaceInfos, allEdgeInfos); + if (nextFace == NULL) + { + done = true; + break; + } + + // If we have already evaluated starting at this face in this slew + // of experiments, then skip going any further + else if (resetPoints.find(nextFace) != resetPoints.end()) + { + continue; + } + + // trying it now... + resetPoints.insert(nextFace); + + // otherwise, we shall now try experiments for starting on the 01,12, and 20 edges + assert(nextFace->m_stripId < 0); + + // build the strip off of this face's 0-1 edge + NvEdgeInfo *edge01 = FindEdgeInfo(allEdgeInfos, nextFace->m_v0, nextFace->m_v1); + NvStripInfo *strip01 = new NvStripInfo(NvStripStartInfo(nextFace, edge01, true), stripId++, experimentId++); + experiments[experimentIndex++].push_back(strip01); + + // build the strip off of this face's 1-0 edge + NvEdgeInfo *edge10 = FindEdgeInfo(allEdgeInfos, nextFace->m_v0, nextFace->m_v1); + NvStripInfo *strip10 = new NvStripInfo(NvStripStartInfo(nextFace, edge10, false), stripId++, experimentId++); + experiments[experimentIndex++].push_back(strip10); + + // build the strip off of this face's 1-2 edge + NvEdgeInfo *edge12 = FindEdgeInfo(allEdgeInfos, nextFace->m_v1, nextFace->m_v2); + NvStripInfo *strip12 = new NvStripInfo(NvStripStartInfo(nextFace, edge12, true), stripId++, experimentId++); + experiments[experimentIndex++].push_back(strip12); + + // build the strip off of this face's 2-1 edge + NvEdgeInfo *edge21 = FindEdgeInfo(allEdgeInfos, nextFace->m_v1, nextFace->m_v2); + NvStripInfo *strip21 = new NvStripInfo(NvStripStartInfo(nextFace, edge21, false), stripId++, experimentId++); + experiments[experimentIndex++].push_back(strip21); + + // build the strip off of this face's 2-0 edge + NvEdgeInfo *edge20 = FindEdgeInfo(allEdgeInfos, nextFace->m_v2, nextFace->m_v0); + NvStripInfo *strip20 = new NvStripInfo(NvStripStartInfo(nextFace, edge20, true), stripId++, experimentId++); + experiments[experimentIndex++].push_back(strip20); + + // build the strip off of this face's 0-2 edge + NvEdgeInfo *edge02 = FindEdgeInfo(allEdgeInfos, nextFace->m_v2, nextFace->m_v0); + NvStripInfo *strip02 = new NvStripInfo(NvStripStartInfo(nextFace, edge02, false), stripId++, experimentId++); + experiments[experimentIndex++].push_back(strip02); + } + + // + // PHASE 2: Iterate through that we setup in the last phase + // and really build each of the strips and strips that follow to see how + // far we get + // + int numExperiments = experimentIndex; + for (i = 0; i < numExperiments; i++) + { + + // get the strip set + + // build the first strip of the list + experiments[i][0]->Build(allEdgeInfos, allFaceInfos); + int experimentId = experiments[i][0]->m_experimentId; + + NvStripInfo *stripIter = experiments[i][0]; + NvStripStartInfo startInfo(NULL, NULL, false); + while (FindTraversal(allFaceInfos, allEdgeInfos, stripIter, startInfo)) + { + + // create the new strip info + stripIter = new NvStripInfo(startInfo, stripId++, experimentId); + + // build the next strip + stripIter->Build(allEdgeInfos, allFaceInfos); + + // add it to the list + experiments[i].push_back(stripIter); + } + } + + // + // Phase 3: Find the experiment that has the most promise + // + int bestIndex = 0; + double bestValue = 0; + for (i = 0; i < numExperiments; i++) + { + const float avgStripSizeWeight = 1.0f; + const float numTrisWeight = 1.0f; + float avgStripSize = AvgStripSize(experiments[i]); + float numStrips = (float) experiments[i].size(); + float value = avgStripSize * avgStripSizeWeight + (avgStripSize * numStrips * numTrisWeight); + + if (value > bestValue) + { + bestValue = value; + bestIndex = i; + } + } + + // + // Phase 4: commit the best experiment of the bunch + // + CommitStrips(allStrips, experiments[bestIndex]); + + // and destroy all of the others + for (i = 0; i < numExperiments; i++) + { + if (i != bestIndex) + { + int numStrips = experiments[i].size(); + for (int j = 0; j < numStrips; j++) + { + delete experiments[i][j]; + } + } + } + + // delete the array that we used for all experiments + delete [] experiments; + } +} + + +/////////////////////////////////////////////////////////////////////////////////////////// +// CountRemainingTris() +// +// This will count the number of triangles left in the +// strip list starting at iter and finishing up at end +// +int NvStripifier::CountRemainingTris(std::list::iterator iter, +std::list::iterator end) +{ + int count = 0; + while (iter != end) + { + count += (*iter)->m_faces.size(); + iter++; + } + return count; +} + + +/////////////////////////////////////////////////////////////////////////////////////////// +// NextIsCW() +// +// Returns true if the next face should be ordered in CW fashion +// +bool NvStripifier::NextIsCW(const int numIndices) +{ + return ((numIndices % 2) == 0); +} + + +/////////////////////////////////////////////////////////////////////////////////////////// +// IsCW() +// +// Returns true if the face is ordered in CW fashion +// +bool NvStripifier::IsCW(NvFaceInfo *faceInfo, int v0, int v1) +{ + if (faceInfo->m_v0 == v0) + return (faceInfo->m_v1 == v1); + + else if (faceInfo->m_v1 == v0) + return (faceInfo->m_v2 == v1); + + else + return (faceInfo->m_v0 == v1); + + // shouldn't get here + assert(0); + return false; +} + + +//used in CreateStrips +template +inline void SWAP(T& first, T& second) +{ + T temp = first; + first = second; + second = temp; +} + + +/////////////////////////////////////////////////////////////////////////////////////////// +// CreateStrips() +// +// Up until now, the strips had been strips at heart, but tri lists in reality. +// Now, remove redundant indices, and stitch together strips to form one, huge uber-strip +// using degenerate tris. +// +void NvStripifier::CreateStrips( +NvStripInfoVec& strips, +NvFaceInfoVec&, +WordVec& stripIndices) +{ + // parameters: + // void NvStripifier::CreateStrips( + // NvStripInfoVec& strips, + // NvFaceInfoVec& leftoverFaces, + // WordVec& stripIndices) + // { + + NvFaceInfo tLastFace(0, 0, 0); + int nStripCount = strips.size(); + assert(nStripCount > 0); + + for (int i = 0; i < nStripCount; i++) + { + NvStripInfo *strip = strips[i]; + unsigned int nStripFaceCount = strip->m_faces.size(); + // unsigned int stripIndicesSize = stripIndices.size(); + assert(nStripFaceCount > 0); + + // Handle the first face in the strip + { + NvFaceInfo tFirstFace(strip->m_faces[0]->m_v0, strip->m_faces[0]->m_v1, strip->m_faces[0]->m_v2); + + // If there is a second face, reorder vertices such that the + // unique vertex is first + if (nStripFaceCount > 1) + { + int nUnique = NvStripifier::GetUniqueVertexInB(strip->m_faces[1], &tFirstFace); + if (nUnique == tFirstFace.m_v1) + { + SWAP(tFirstFace.m_v0, tFirstFace.m_v1); + } + else if (nUnique == tFirstFace.m_v2) + { + SWAP(tFirstFace.m_v0, tFirstFace.m_v2); + } + + // If there is a third face, reorder vertices such that the + // shared vertex is last + if (nStripFaceCount > 2) + { + int nShared = NvStripifier::GetSharedVertex(strip->m_faces[2], &tFirstFace); + if (nShared == tFirstFace.m_v1) + { + SWAP(tFirstFace.m_v1, tFirstFace.m_v2); + } + } + } + + if (i != 0) + { + // Double tap the first in the new strip + stripIndices.push_back(tFirstFace.m_v0); + + // Check CW/CCW ordering + if (NextIsCW(stripIndices.size()) != IsCW(strip->m_faces[0], tFirstFace.m_v0, tFirstFace.m_v1)) + { + stripIndices.push_back(tFirstFace.m_v0); + } + } + else + { + if(!IsCW(strip->m_faces[0], tFirstFace.m_v0, tFirstFace.m_v1)) + stripIndices.push_back(tFirstFace.m_v0); + } + + stripIndices.push_back(tFirstFace.m_v0); + stripIndices.push_back(tFirstFace.m_v1); + stripIndices.push_back(tFirstFace.m_v2); + + // Update last face info + tLastFace = tFirstFace; + } + + for (unsigned int j = 1; j < nStripFaceCount; j++) + { + int nUnique = NvStripifier::GetUniqueVertexInB(&tLastFace, strip->m_faces[j]); + if (nUnique != -1) + { + stripIndices.push_back(nUnique); + + // Update last face info + tLastFace.m_v0 = tLastFace.m_v1; + tLastFace.m_v1 = tLastFace.m_v2; + tLastFace.m_v2 = nUnique; + } + } + + // Double tap between strips. + stripIndices.push_back(tLastFace.m_v2); + + // Update last face info + tLastFace.m_v0 = tLastFace.m_v1; + tLastFace.m_v1 = tLastFace.m_v2; + tLastFace.m_v2 = tLastFace.m_v2; + } +} + + +/////////////////////////////////////////////////////////////////////////////////////////// +// OptimizeVertices() +// +// Function which optimizes the vertices in the mesh to minimize page misses +// +// Puts output verts into optimizedVerts vector +// +// +void NvStripifier::OptimizeVertices(NvStripInfoVec& strips, +NvFaceInfoVec& leftoverFaces, +WordVec& , +MyVertexVec& vertices, +MyVertexVec& optimizedVerts) +{ + // parameters. + // void NvStripifier::OptimizeVertices(NvStripInfoVec& strips, + // NvFaceInfoVec& leftoverFaces, + // WordVec& stripIndices, + // MyVertexVec& vertices, + // MyVertexVec& optimizedVerts) + + //caches oldIndex --> newIndex conversion + int *indexCache; + indexCache = new int[vertices.size()]; + + memset(indexCache, -1, sizeof(int)*vertices.size()); + + //first do the strips + unsigned int i; + for(i = 0; i < strips.size(); i++) + { + for(unsigned int j = 0; j < strips[i]->m_faces.size(); j++) + { + int v0 = strips[i]->m_faces[j]->m_v0; + int v1 = strips[i]->m_faces[j]->m_v1; + int v2 = strips[i]->m_faces[j]->m_v2; + + //v0 + int index = indexCache[v0]; + if(index == -1) + { + optimizedVerts.push_back(vertices[v0]); + strips[i]->m_faces[j]->m_v0 = optimizedVerts.size() - 1; + + indexCache[v0] = strips[i]->m_faces[j]->m_v0; + } + else + { + strips[i]->m_faces[j]->m_v0 = index; + } + + //v1 + index = indexCache[v1]; + if(index == -1) + { + optimizedVerts.push_back(vertices[v1]); + strips[i]->m_faces[j]->m_v1 = optimizedVerts.size() - 1; + + indexCache[v1] = strips[i]->m_faces[j]->m_v1; + } + else + { + strips[i]->m_faces[j]->m_v1 = index; + } + + //v2 + index = indexCache[v2]; + if(index == -1) + { + optimizedVerts.push_back(vertices[v2]); + strips[i]->m_faces[j]->m_v2 = optimizedVerts.size() - 1; + + indexCache[v2] = strips[i]->m_faces[j]->m_v2; + } + else + { + strips[i]->m_faces[j]->m_v2 = index; + } + + } + } + + //now do the leftover list + for(i = 0; i < leftoverFaces.size(); i++) + { + int v0 = leftoverFaces[i]->m_v0; + int v1 = leftoverFaces[i]->m_v1; + int v2 = leftoverFaces[i]->m_v2; + + //v0 + int index = indexCache[v0]; + if(index == -1) + { + optimizedVerts.push_back(vertices[v0]); + leftoverFaces[i]->m_v0 = optimizedVerts.size() - 1; + + indexCache[v0] = leftoverFaces[i]->m_v0; + } + else + { + leftoverFaces[i]->m_v0 = index; + } + + //v1 + index = indexCache[v1]; + if(index == -1) + { + optimizedVerts.push_back(vertices[v1]); + leftoverFaces[i]->m_v1 = optimizedVerts.size() - 1; + + indexCache[v1] = leftoverFaces[i]->m_v1; + } + else + { + leftoverFaces[i]->m_v1 = index; + } + + //v2 + index = indexCache[v2]; + if(index == -1) + { + optimizedVerts.push_back(vertices[v2]); + leftoverFaces[i]->m_v2 = optimizedVerts.size() - 1; + + indexCache[v2] = leftoverFaces[i]->m_v2; + } + else + { + leftoverFaces[i]->m_v2 = index; + } + } + + delete[] indexCache; + + assert(optimizedVerts.size() == vertices.size()); +} diff --git a/src/osgUtil/NvTriStripObjects.h b/src/osgUtil/NvTriStripObjects.h new file mode 100644 index 000000000..99fc08c9e --- /dev/null +++ b/src/osgUtil/NvTriStripObjects.h @@ -0,0 +1,296 @@ + +#ifndef NV_TRISTRIP_OBJECTS_H +#define NV_TRISTRIP_OBJECTS_H + +#include +#include +#include + +///////////////////////////////////////////////////////////////////////////////// +// +// Types defined for stripification +// +///////////////////////////////////////////////////////////////////////////////// + +typedef int WORD; +typedef unsigned int UINT; + +struct MyVertex +{ + float x, y, z; + float nx, ny, nz; +}; + +typedef MyVertex MyVector; + +struct MyFace +{ + int v1, v2, v3; + float nx, ny, nz; +}; + +class VertexCache +{ + + public: + + VertexCache(int size); + VertexCache(); + ~VertexCache(); + + bool InCache(int entry); + int AddEntry(int entry); + void Clear(); + + void Copy(VertexCache* inVcache); + int At(int index); + void Set(int index, int value); + + private: + + int *entries; + int numEntries; + +}; + +inline bool VertexCache::InCache(int entry) +{ + bool returnVal = false; + + for(int i = 0; i < numEntries; i++) + { + if(entries[i] == entry) + { + returnVal = true; + break; + } + } + + return returnVal; +} + + +inline int VertexCache::AddEntry(int entry) +{ + int removed; + + removed = entries[numEntries - 1]; + + //push everything right one + for(int i = numEntries - 2; i >= 0; i--) + { + entries[i + 1] = entries[i]; + } + + entries[0] = entry; + + return removed; +} + + +class NvFaceInfo +{ + public: + + // vertex indices + NvFaceInfo(int v0, int v1, int v2) + { + m_v0 = v0; m_v1 = v1; m_v2 = v2; + m_stripId = -1; + m_testStripId = -1; + m_experimentId = -1; + } + + // data members are left public + int m_v0, m_v1, m_v2; + int m_stripId; // real strip Id + int m_testStripId; // strip Id in an experiment + int m_experimentId; // in what experiment was it given an experiment Id? +}; + +// nice and dumb edge class that points knows its +// indices, the two faces, and the next edge using +// the lesser of the indices +class NvEdgeInfo +{ + public: + + // constructor puts 1 ref on us + NvEdgeInfo (int v0, int v1) + { + m_v0 = v0; + m_v1 = v1; + m_face0 = NULL; + m_face1 = NULL; + m_nextV0 = NULL; + m_nextV1 = NULL; + + // we will appear in 2 lists. this is a good + // way to make sure we delete it the second time + // we hit it in the edge infos + m_refCount = 2; + + } + + // ref and unref + void Unref () { if (--m_refCount == 0) delete this; } + + // data members are left public + UINT m_refCount; + NvFaceInfo *m_face0, *m_face1; + int m_v0, m_v1; + NvEdgeInfo *m_nextV0, *m_nextV1; +}; + +// This class is a quick summary of parameters used +// to begin a triangle strip. Some operations may +// want to create lists of such items, so they were +// pulled out into a class +class NvStripStartInfo +{ + public: + NvStripStartInfo(NvFaceInfo *startFace, NvEdgeInfo *startEdge, bool toV1) + { + m_startFace = startFace; + m_startEdge = startEdge; + m_toV1 = toV1; + } + NvFaceInfo *m_startFace; + NvEdgeInfo *m_startEdge; + bool m_toV1; +}; + +typedef std::vector NvFaceInfoVec; +typedef std::list NvFaceInfoList; +typedef std::list NvStripList; +typedef std::vector NvEdgeInfoVec; + +typedef std::vector WordVec; +typedef std::vector MyVertexVec; +typedef std::vector MyFaceVec; + +// This is a summary of a strip that has been built +class NvStripInfo +{ + public: + + // A little information about the creation of the triangle strips + NvStripInfo(const NvStripStartInfo &startInfo, int stripId, int experimentId = -1) : + m_startInfo(startInfo) + { + m_stripId = stripId; + m_experimentId = experimentId; + visited = false; + } + + // This is an experiment if the experiment id is >= 0 + inline bool IsExperiment () const { return m_experimentId >= 0; } + + inline bool IsInStrip (const NvFaceInfo *faceInfo) const + { + if(faceInfo == NULL) + return false; + + return (m_experimentId >= 0 ? faceInfo->m_testStripId == m_stripId : faceInfo->m_stripId == m_stripId); + } + + bool SharesEdge(const NvFaceInfo* faceInfo, NvEdgeInfoVec &edgeInfos); + + // take the given forward and backward strips and combine them together + void Combine(const NvFaceInfoVec &forward, const NvFaceInfoVec &backward); + + //returns true if the face is "unique", i.e. has a vertex which doesn't exist in the faceVec + bool Unique(NvFaceInfoVec& faceVec, NvFaceInfo* face); + + // mark the triangle as taken by this strip + bool IsMarked (NvFaceInfo *faceInfo); + void MarkTriangle(NvFaceInfo *faceInfo); + + // build the strip + void Build(NvEdgeInfoVec &edgeInfos, NvFaceInfoVec &faceInfos); + + // public data members + NvStripStartInfo m_startInfo; + NvFaceInfoVec m_faces; + int m_stripId; + int m_experimentId; + + bool visited; +}; + +typedef std::vector NvStripInfoVec; + +//The actual stripifier +class NvStripifier +{ + public: + + // Constructor + NvStripifier(); + ~NvStripifier(); + + //the target vertex cache size, the structure to place the strips in, and the input indices + void Stripify(const WordVec &in_indices, const int in_numVertices, const int in_cacheSize, const int in_minStripLength, + NvStripInfoVec &allStrips, NvFaceInfoVec &allFaces); + + static int GetUniqueVertexInB(NvFaceInfo *faceA, NvFaceInfo *faceB); + static int GetSharedVertex(NvFaceInfo *faceA, NvFaceInfo *faceB); + + static bool NextIsCW(const int numIndices); + static bool IsCW(NvFaceInfo *faceInfo, int v0, int v1); + + void CreateStrips(NvStripInfoVec& strips, + NvFaceInfoVec& leftoverFaces, + WordVec& stripIndices); + + void OptimizeVertices(NvStripInfoVec& strips, + NvFaceInfoVec& leftoverFaces, + WordVec& stripIndices, + MyVertexVec& vertices, + MyVertexVec& optimizedVerts); + + protected: + + WordVec indices; + int cacheSize; + unsigned int minStripLength; + float meshJump; + bool bFirstTimeResetPoint; + + ///////////////////////////////////////////////////////////////////////////////// + // + // Big mess of functions called during stripification + // + ///////////////////////////////////////////////////////////////////////////////// + + static int GetNextIndex(const WordVec &indices, NvFaceInfo *face); + static NvEdgeInfo *FindEdgeInfo(NvEdgeInfoVec &edgeInfos, int v0, int v1); + static NvFaceInfo *FindOtherFace(NvEdgeInfoVec &edgeInfos, int v0, int v1, NvFaceInfo *faceInfo); + NvFaceInfo *FindGoodResetPoint(NvFaceInfoVec &faceInfos, NvEdgeInfoVec &edgeInfos); + + void FindAllStrips(NvStripInfoVec &allStrips, NvFaceInfoVec &allFaceInfos, NvEdgeInfoVec &allEdgeInfos, int numSamples); + void SplitUpStripsAndOptimize(NvStripInfoVec &allStrips, NvStripInfoVec &outStrips, NvEdgeInfoVec& edgeInfos, NvFaceInfoVec& outFaceList); + void RemoveSmallStrips(NvStripInfoVec& allStrips, NvStripInfoVec& allBigStrips, NvFaceInfoVec& faceList); + + bool FindTraversal(NvFaceInfoVec &faceInfos, NvEdgeInfoVec &edgeInfos, NvStripInfo *strip, NvStripStartInfo &startInfo); + int CountRemainingTris(std::list::iterator iter, std::list::iterator end); + + void CommitStrips(NvStripInfoVec &allStrips, const NvStripInfoVec &strips); + + float AvgStripSize(const NvStripInfoVec &strips); + int FindStartPoint(NvFaceInfoVec &faceInfos, NvEdgeInfoVec &edgeInfos); + + void UpdateCacheStrip(VertexCache* vcache, NvStripInfo* strip); + void UpdateCacheFace(VertexCache* vcache, NvFaceInfo* face); + float CalcNumHitsStrip(VertexCache* vcache, NvStripInfo* strip); + int CalcNumHitsFace(VertexCache* vcache, NvFaceInfo* face); + int NumNeighbors(NvFaceInfo* face, NvEdgeInfoVec& edgeInfoVec); + + void BuildStripifyInfo(NvFaceInfoVec &faceInfos, NvEdgeInfoVec &edgeInfos, const int numVertices); + bool AlreadyExists(NvFaceInfo* faceInfo, NvFaceInfoVec& faceInfos); + + // let our strip info classes and the other classes get + // to these protected stripificaton methods if they want + friend NvStripInfo; +}; +#endif diff --git a/src/osgUtil/RenderBin.cpp b/src/osgUtil/RenderBin.cpp new file mode 100644 index 000000000..26c5a76b3 --- /dev/null +++ b/src/osgUtil/RenderBin.cpp @@ -0,0 +1,179 @@ +#include +#include + +using namespace osg; +using namespace osgUtil; + + +// register a RenderStage prototype with the RenderBin prototype list. +RegisterRenderBinProxy s_registerRenderBinProxy; + +typedef std::map< std::string, osg::ref_ptr > RenderBinPrototypeList; + +RenderBinPrototypeList* renderBinPrototypeList() +{ + static RenderBinPrototypeList s_renderBinPrototypeList; + return &s_renderBinPrototypeList; +} + +RenderBin* RenderBin::createRenderBin(const std::string& binName) +{ +// cout << "creating RB "<find(binName); + if (itr != renderBinPrototypeList()->end()) return dynamic_cast(itr->second->clone()); + else return NULL; +} + +void RenderBin::addRenderBinPrototype(RenderBin* proto) +{ + if (proto) + { + (*renderBinPrototypeList())[proto->className()] = proto; +// cout << "Adding RB "<className()<find(proto->className()); + if (itr != renderBinPrototypeList()->end()) renderBinPrototypeList()->erase(itr); + } +} + +RenderBin::RenderBin() +{ + _binNum = 0; + _parent = NULL; + _stage = NULL; +} + +RenderBin::~RenderBin() +{ +} + +void RenderBin::reset() +{ + _renderGraphList.clear(); + _bins.clear(); +} + +void RenderBin::sort() +{ + for(RenderBinList::iterator itr = _bins.begin(); + itr!=_bins.end(); + ++itr) + { + itr->second->sort(); + } + sort_local(); +} + +RenderBin* RenderBin::find_or_insert(int binNum,const std::string& binName) +{ + // search for appropriate bin. + RenderBinList::iterator itr = _bins.find(binNum); + if (itr!=_bins.end()) return itr->second.get(); + + // create a renderin bin and insert into bin list. + RenderBin* rb = RenderBin::createRenderBin(binName); + if (rb) + { + + RenderStage* rs = dynamic_cast(rb); + if (rs) + { + rs->_binNum = binNum; + rs->_parent = NULL; + rs->_stage = rs; + _stage->addToDependencyList(rs); + } + else + { + rb->_binNum = binNum; + rb->_parent = this; + rb->_stage = _stage; + _bins[binNum] = rb; + } + } + return rb; +} + +void RenderBin::draw(osg::State& state,RenderLeaf*& previous) +{ + // draw first set of draw bins. + RenderBinList::iterator itr; + for(itr = _bins.begin(); + itr->first<0 && itr!=_bins.end(); + ++itr) + { + itr->second->draw(state,previous); + } + + draw_local(state,previous); + + for(; + itr!=_bins.end(); + ++itr) + { + itr->second->draw(state,previous); + } +} + +void RenderBin::draw_local(osg::State& state,RenderLeaf*& previous) +{ + // draw local bin. + for(RenderGraphList::iterator oitr=_renderGraphList.begin(); + oitr!=_renderGraphList.end(); + ++oitr) + { + + for(RenderGraph::LeafList::iterator dw_itr = (*oitr)->_leaves.begin(); + dw_itr != (*oitr)->_leaves.end(); + ++dw_itr) + { + RenderLeaf* rl = dw_itr->get(); + rl->render(state,previous); + previous = rl; + + } + } +} +// stats +#include +void RenderBin::getPrims(Statistics *primStats) +{ + for(RenderBinList::iterator itr = _bins.begin(); + itr!=_bins.end(); + ++itr) + { + primStats->nbins++; + } + + for(RenderGraphList::iterator oitr=_renderGraphList.begin(); + oitr!=_renderGraphList.end(); + ++oitr) + { + + for(RenderGraph::LeafList::iterator dw_itr = (*oitr)->_leaves.begin(); + dw_itr != (*oitr)->_leaves.end(); + ++dw_itr) + { + RenderLeaf* rl = dw_itr->get(); + Drawable* dw= rl->_drawable; + primStats->numOpaque++; // number of geosets + if (rl->_matrix.get()) primStats->nummat++; // number of matrices + if (dw) { // then tot up the types 1-14 + GeoSet *gs=dynamic_cast(dw); + if (gs) + { + primStats->addstat(gs); + // rl->getPrims(state,previous);?? + // previous = rl; + } + } + } + } +} diff --git a/src/osgUtil/RenderGraph.cpp b/src/osgUtil/RenderGraph.cpp new file mode 100644 index 000000000..7f30feaad --- /dev/null +++ b/src/osgUtil/RenderGraph.cpp @@ -0,0 +1,62 @@ +#include "osgUtil/RenderGraph" + +#include "osg/Notify" + +using namespace osg; +using namespace osgUtil; + +void RenderGraph::reset() +{ + _parent = NULL; + _stateset = NULL; + + _depth = 0; + + _children.clear(); + _leaves.clear(); +} + +/** recursively clean the RenderGraph of all its drawables, lights and depths. + * Leaves children intact, and ready to be populated again.*/ +void RenderGraph::clean() +{ + + // clean local drawables etc. + _leaves.clear(); + + // call clean on all children. + for(ChildList::iterator itr=_children.begin(); + itr!=_children.end(); + ++itr) + { + itr->second->clean(); + } + +} + +/** recursively prune the RenderGraph of empty children.*/ +void RenderGraph::prune() +{ + std::vector toEraseList; + + // call prune on all children. + for(ChildList::iterator citr=_children.begin(); + citr!=_children.end(); + ++citr) + { + citr->second->prune(); + + if (citr->second->empty()) + { + toEraseList.push_back(citr->first); + } + } + + for(std::vector::iterator eitr=toEraseList.begin(); + eitr!=toEraseList.end(); + ++eitr) + { + _children.erase(*eitr); + } + +} diff --git a/src/osgUtil/RenderLeaf.cpp b/src/osgUtil/RenderLeaf.cpp new file mode 100644 index 000000000..4df35781c --- /dev/null +++ b/src/osgUtil/RenderLeaf.cpp @@ -0,0 +1,63 @@ +#include +#include + +using namespace osg; +using namespace osgUtil; + +void RenderLeaf::render(State& state,RenderLeaf* previous) +{ + + if (previous) + { + + RenderGraph* prev_rg = previous->_parent; + RenderGraph* prev_rg_parent = prev_rg->_parent; + RenderGraph* rg = _parent; + + if (prev_rg_parent!=rg->_parent) + { + RenderGraph::moveRenderGraph(state,prev_rg_parent,rg->_parent); + + // send state changes and matrix changes to OpenGL. + state.apply(rg->_stateset.get()); + + } + else if (rg!=prev_rg) + { + + // send state changes and matrix changes to OpenGL. + state.apply(rg->_stateset.get()); + + } + + Matrix* prev_matrix = previous->_matrix.get(); + if (_matrix != prev_matrix) + { + if (prev_matrix) glPopMatrix(); + + if (_matrix.valid()) + { + glPushMatrix(); + glMultMatrixf((GLfloat*)_matrix->_mat); + } + + } + + _drawable->draw(state); + } + else + { + RenderGraph::moveRenderGraph(state,NULL,_parent->_parent); + + // send state changes and matrix changes to OpenGL. + state.apply(_parent->_stateset.get()); + + if (_matrix.valid()) + { + glPushMatrix(); + glMultMatrixf((GLfloat*)_matrix->_mat); + } + + _drawable->draw(state); + } +} diff --git a/src/osgUtil/RenderStage.cpp b/src/osgUtil/RenderStage.cpp new file mode 100644 index 000000000..8e48aee06 --- /dev/null +++ b/src/osgUtil/RenderStage.cpp @@ -0,0 +1,134 @@ +#include + +using namespace osg; +using namespace osgUtil; + +// register a RenderStage prototype with the RenderBin prototype list. +//RegisterRenderBinProxy s_registerRenderStageProxy; + +RenderStage::RenderStage() +{ + // point RenderBin's _stage to this to ensure that references to + // stage don't go tempted away to any other stage. + _stage = this; + _stageDrawnThisFrame = false; + + _clearMask = GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT; + _clearColor.set(0.0f,0.0f,0.0f,0.0f); + _clearAccum.set(0.0f,0.0f,0.0f,0.0f); + _clearDepth = 1.0; + _clearStencil = 0; + + +} + +RenderStage::~RenderStage() +{ +} + +void RenderStage::reset() +{ + _dependencyList.clear(); + _stageDrawnThisFrame = false; + + if (_renderStageLighting.valid()) _renderStageLighting->reset(); + + RenderBin::reset(); +} + +void RenderStage::addToDependencyList(RenderStage* rs) +{ + if (rs) _dependencyList.push_back(rs); +} +void RenderStage::draw(osg::State& state,RenderLeaf*& previous) +{ + if (_stageDrawnThisFrame) return; + + _stageDrawnThisFrame = true; + + for(DependencyList::iterator itr=_dependencyList.begin(); + itr!=_dependencyList.end(); + ++itr) + { + (*itr)->draw(state,previous); + } + + // set up the back buffer. + +#define USE_SISSOR_TEST +#ifdef USE_SISSOR_TEST + glScissor( _view[0], _view[1], _view[2], _view[3] ); + glEnable( GL_SCISSOR_TEST ); +#endif + + glViewport( _view[0], _view[1], _view[2], _view[3] ); + + // glEnable( GL_DEPTH_TEST ); + + if (_clearMask & GL_COLOR_BUFFER_BIT) + glClearColor( _clearColor[0], _clearColor[1], _clearColor[2], _clearColor[3]); + + if (_clearMask & GL_DEPTH_BUFFER_BIT) + glClearDepth( _clearDepth); + + if (_clearMask & GL_STENCIL_BUFFER_BIT) + glClearStencil( _clearStencil); + + if (_clearMask & GL_ACCUM_BUFFER_BIT) + glClearAccum( _clearAccum[0], _clearAccum[1], _clearAccum[2], _clearAccum[3]); + + // clear a color bit planes - osg::ColorMask could also be used here. + glColorMask(GL_TRUE,GL_TRUE,GL_TRUE,GL_TRUE); + + glClear( _clearMask ); + +#ifdef USE_SISSOR_TEST + glDisable( GL_SCISSOR_TEST ); +#endif + + // set up projection + const Matrix& projectionMat = _camera->getProjectionMatrix(); + glMatrixMode( GL_PROJECTION ); + glLoadIdentity(); + glMultMatrixf((GLfloat*)projectionMat._mat); + + glMatrixMode( GL_MODELVIEW ); + glLoadIdentity(); + + Light* light = getLight(); + if (getLightingMode()==RenderStageLighting::HEADLIGHT && light) + { + light->apply(state); + } + + // set up camera modelview. + const Matrix& modelView = _camera->getModelViewMatrix(); + glMultMatrixf((GLfloat*)modelView._mat); + + if (getLightingMode()==RenderStageLighting::SKY_LIGHT && light) + { + light->apply(state); + } + + // apply the lights. + if (_renderStageLighting.valid()) _renderStageLighting->draw(state,previous); + + // draw the children and local. + RenderBin::draw(state,previous); + + // now reset the state so its back in its default state. + if (previous) + { + RenderGraph::moveToRootRenderGraph(state,previous->_parent); + state.apply(); + if (previous->_matrix.valid()) glPopMatrix(); + previous = NULL; + } + +} +// Statistics features +void RenderStage::getPrims(Statistics *primStats) +{ + if (_renderStageLighting.valid()) primStats->nlights+=_renderStageLighting->_lightList.size(); + RenderBin::getPrims(primStats); +} diff --git a/src/osgUtil/RenderStageLighting.cpp b/src/osgUtil/RenderStageLighting.cpp new file mode 100644 index 000000000..4287a2d05 --- /dev/null +++ b/src/osgUtil/RenderStageLighting.cpp @@ -0,0 +1,61 @@ +#include + +using namespace osg; +using namespace osgUtil; + +// register a RenderStageLighting prototype with the RenderBin prototype list. +//RegisterRenderBinProxy s_registerRenderStageLightingProxy; + +RenderStageLighting::RenderStageLighting() +{ +} + +RenderStageLighting::~RenderStageLighting() +{ +} + +void RenderStageLighting::reset() +{ + _lightList.clear(); +} + +void RenderStageLighting::draw(osg::State& state,RenderLeaf*& previous) +{ + + if (previous) + { + RenderGraph::moveToRootRenderGraph(state,previous->_parent); + state.apply(); + if (previous->_matrix.valid()) glPopMatrix(); + previous = NULL; + } + + Matrix* prev_matrix = NULL; + + // apply the light list. + for(LightList::iterator litr=_lightList.begin(); + litr!=_lightList.end(); + ++litr) + { + Matrix* matrix = (*litr).second.get(); + if (matrix != prev_matrix) + { + if (prev_matrix) glPopMatrix(); + + if (matrix) + { + glPushMatrix(); + glMultMatrixf((GLfloat*)matrix->_mat); + } + + prev_matrix = matrix; + } + + // apply the light source. + litr->first->apply(state); + + } + // clean up matrix stack. + if (prev_matrix) glPopMatrix(); + +} diff --git a/src/osgUtil/RenderToTextureStage.cpp b/src/osgUtil/RenderToTextureStage.cpp new file mode 100644 index 000000000..471ee9594 --- /dev/null +++ b/src/osgUtil/RenderToTextureStage.cpp @@ -0,0 +1,32 @@ +#include + +#include + +using namespace osg; +using namespace osgUtil; + +// register a RenderToTextureStage prototype with the RenderBin prototype list. +//RegisterRenderBinProxy s_registerRenderToTextureStageProxy; + +RenderToTextureStage::RenderToTextureStage() +{ +} + +RenderToTextureStage::~RenderToTextureStage() +{ +} + +void RenderToTextureStage::reset() +{ + RenderStage::reset(); +} + +void RenderToTextureStage::draw(osg::State& state,RenderLeaf*& previous) +{ + + RenderStage::draw(state,previous); + + // now copy the rendered image to attached texture. + if (_texture.valid()) _texture->copyTexImage2D(state,_view[0],_view[1],_view[2],_view[3]); + +} diff --git a/src/osgUtil/SceneViewManipulator.cpp b/src/osgUtil/SceneViewManipulator.cpp new file mode 100644 index 000000000..b64acfb7f --- /dev/null +++ b/src/osgUtil/SceneViewManipulator.cpp @@ -0,0 +1,39 @@ +#include +#include + +using namespace osgUtil; + +SceneViewManipulator::SceneViewManipulator(): + _cm(new TrackballManipulator), + _gm(new StateSetManipulator) +{ +} + +SceneViewManipulator::~SceneViewManipulator() +{ +} + +void SceneViewManipulator::setSceneView(SceneView* sv) +{ + _sv=sv; + _cm->setNode(sv->getSceneData()); + _cm->setCamera(sv->getCamera()); + _gm->setStateSet(sv->getGlobalState()); +} + +SceneView *SceneViewManipulator::getSceneView() +{ + return _sv.get(); +} + +const SceneView *SceneViewManipulator::getSceneView() const +{ + return _sv.get(); +} + +bool SceneViewManipulator::handle(const GUIEventAdapter& ea,GUIActionAdapter& aa) +{ + if(_cm->handle(ea,aa)) return true; + if(_gm->handle(ea,aa)) return true; + return false; +} diff --git a/src/osgUtil/SmoothingVisitor.cpp b/src/osgUtil/SmoothingVisitor.cpp new file mode 100644 index 000000000..e43e6b135 --- /dev/null +++ b/src/osgUtil/SmoothingVisitor.cpp @@ -0,0 +1,155 @@ +#if defined(_MSC_VER) + #pragma warning( disable : 4786 ) +#endif + +#include +#include +#include + +#include + +#include + +using namespace osg; +using namespace osgUtil; + +struct LessPtr +{ + inline bool operator() (const osg::Vec3* lhs,const osg::Vec3* rhs) const + { + return *lhs<*rhs; + } +}; + +// triangle functor. +struct TriangleFunctor +{ + + osg::Vec3 *_coordBase; + osg::Vec3 *_normalBase; + + typedef std::multiset CoordinateSet; + CoordinateSet _coordSet; + + TriangleFunctor(osg::Vec3 *cb,int noVertices, osg::Vec3 *nb) : _coordBase(cb),_normalBase(nb) + { + osg::Vec3* vptr = cb; + for(int i=0;i p = + _coordSet.equal_range(vptr); + + for(CoordinateSet::iterator itr=p.first; + itr!=p.second; + ++itr) + { + osg::Vec3* nptr = _normalBase + (*itr-_coordBase); + (*nptr) += normal; + } + } + + inline void operator() ( const osg::Vec3 &v1, const osg::Vec3 &v2, const osg::Vec3 &v3 ) + { + // calc orientation of triangle. + osg::Vec3 normal = (v2-v1)^(v3-v1); + // normal.normalize(); + + updateNormal(normal,&v1); + updateNormal(normal,&v2); + updateNormal(normal,&v3); + + } +}; + +void SmoothingVisitor::smooth(osg::GeoSet& gset) +{ + GeoSet::PrimitiveType primTypeIn = gset.getPrimType(); + GeoSet::PrimitiveType primTypeOut = gset.getPrimType(); + + // determine whether to do smoothing or not, and if + // the primitive type needs to be modified enable smoothed normals. + bool doSmoothing; + switch(primTypeIn) + { + case(GeoSet::TRIANGLES): + case(GeoSet::TRIANGLE_STRIP): + case(GeoSet::TRIANGLE_FAN): + doSmoothing = true; + break; + case(GeoSet::FLAT_TRIANGLE_STRIP): + primTypeOut = GeoSet::TRIANGLE_STRIP; + doSmoothing = true; + break; + case(GeoSet::FLAT_TRIANGLE_FAN): + primTypeOut = GeoSet::TRIANGLE_FAN; + doSmoothing = true; + break; + case(GeoSet::QUADS): + case(GeoSet::QUAD_STRIP): + case(GeoSet::POLYGON): + doSmoothing = true; + break; + default: // points and lines etc. + doSmoothing = false; + break; + } + + if (doSmoothing) + { + gset.computeNumVerts(); + int ncoords = gset.getNumCoords(); + osg::Vec3 *coords = gset.getCoords(); + osg::GeoSet::IndexPointer cindex = gset.getCoordIndices(); + osg::Vec3 *norms = new osg::Vec3[ncoords]; + + int j; + for(j = 0; j < ncoords; j++ ) + { + norms[j].set(0.0f,0.0f,0.0f); + } + + TriangleFunctor tf(coords,ncoords,norms); + for_each_triangle( gset, tf ); + + for(j = 0; j < ncoords; j++ ) + { + norms[j].normalize(); + } + + gset.setNormalBinding(osg::GeoSet::BIND_PERVERTEX); + + if (cindex.valid()) + { + if (cindex._is_ushort) + gset.setNormals( norms, cindex._ptr._ushort ); + else + gset.setNormals( norms, cindex._ptr._uint ); + } + else + { + gset.setNormals( norms ); + } + + if (primTypeIn!=primTypeOut) + gset.setPrimType( primTypeOut ); + + gset.dirtyDisplayList(); + + } +} + + +void SmoothingVisitor::apply(osg::Geode& geode) +{ + for(int i = 0; i < geode.getNumDrawables(); i++ ) + { + osg::GeoSet* gset = dynamic_cast(geode.getDrawable(i)); + if (gset) smooth(*gset); + } +} diff --git a/src/osgUtil/StateSetManipulator.cpp b/src/osgUtil/StateSetManipulator.cpp new file mode 100644 index 000000000..dec2b38f5 --- /dev/null +++ b/src/osgUtil/StateSetManipulator.cpp @@ -0,0 +1,68 @@ +#include + +using namespace osg; +using namespace osgUtil; + +StateSetManipulator::StateSetManipulator(): _drawState(NULL) +{ +} + +StateSetManipulator::~StateSetManipulator() +{ +} + +void StateSetManipulator::setStateSet(StateSet *drawState) +{ + _drawState=drawState; + if(!_drawState.valid()) return; + _backface = (_drawState->getMode(GL_CULL_FACE)==osg::StateAttribute::ON); + _lighting =(_drawState->getMode(GL_LIGHTING)==osg::StateAttribute::ON); + _texture =(_drawState->getMode(GL_TEXTURE_2D)==osg::StateAttribute::ON); +} + +StateSet *StateSetManipulator::getStateSet() +{ + return _drawState.get(); +} + +const StateSet *StateSetManipulator::getStateSet() const +{ + return _drawState.get(); +} + +bool StateSetManipulator::handle(const GUIEventAdapter& ea,GUIActionAdapter& aa) +{ + if(!_drawState.valid()) return false; + + if(ea.getEventType()==GUIEventAdapter::KEYBOARD){ + + switch( ea.getKey() ){ + + case 'b' : + _backface = !_backface; + if( _backface ) _drawState->setMode(GL_CULL_FACE,osg::StateAttribute::ON); + else _drawState->setMode(GL_CULL_FACE,osg::StateAttribute::OVERRIDE_OFF); + aa.requestRedraw(); + return true; + break; + + case 'l' : + _lighting = !_lighting ; + if( _lighting ) _drawState->setMode(GL_LIGHTING,osg::StateAttribute::ON); + else _drawState->setMode(GL_LIGHTING,osg::StateAttribute::OVERRIDE_OFF); + aa.requestRedraw(); + return true; + break; + + case 't' : + _texture = !_texture; + if (_texture) _drawState->setMode(GL_TEXTURE_2D,osg::StateAttribute::INHERIT); + else _drawState->setMode(GL_TEXTURE_2D,osg::StateAttribute::OVERRIDE_OFF); + aa.requestRedraw(); + return true; + break; + + } + } + return false; +} diff --git a/src/osgUtil/Tesselator.cpp b/src/osgUtil/Tesselator.cpp new file mode 100644 index 000000000..094fd5a3f --- /dev/null +++ b/src/osgUtil/Tesselator.cpp @@ -0,0 +1,262 @@ +#include +#include +#include + +#include + + +using namespace osg; +using namespace osgUtil; + +/* Win32 calling conventions. (or a least thats what the GLUT example tess.c uses.)*/ +#ifndef CALLBACK +#define CALLBACK +#endif + +static Tesselator* s_tesselator = NULL; + +void CALLBACK beginCallback(GLenum which) +{ + s_tesselator->beginPrimitive(which); +} + +void CALLBACK errorCallback(GLenum errorCode) +{ + s_tesselator->_errorCode = errorCode; +} + +void CALLBACK endCallback() +{ + s_tesselator->endPrimitive(); +} + +void CALLBACK vertexCallback(GLvoid *data) +{ + Tesselator::VertexIndexSet* vip = (Tesselator::VertexIndexSet*)data; + vip->accumulate(); +} + + +Tesselator::Tesselator() +{ +} + +Tesselator::~Tesselator() +{ +} + +void Tesselator::tesselate(osg::Vec3* coords,int numIndices, int* indices,InputBoundaryDirection ibd) +{ + init(); + _coordVec.reserve(numIndices); + if (ibd==COUNTER_CLOCK_WISE) + { + for(int i=0;i=0;--i) + { + _coordVec.push_back(VertexIndexSet(this,coords[indices[i]],indices[i])); + } + } + do_it(); +} + +void Tesselator::tesselate(osg::Vec3* coords,int numIndices, osg::ushort* indices,InputBoundaryDirection ibd) +{ + init(); + _coordVec.reserve(numIndices); + if (ibd==COUNTER_CLOCK_WISE) + { + for(int i=0;i=0;--i) + { + _coordVec.push_back(VertexIndexSet(this,coords[indices[i]],indices[i])); + } + } + do_it(); +} + +void Tesselator::tesselate(osg::Vec3* coords,int numIndices, osg::uint* indices,InputBoundaryDirection ibd) +{ + init(); + _coordVec.reserve(numIndices); + if (ibd==COUNTER_CLOCK_WISE) + { + for(int i=0;i=0;--i) + { + _coordVec.push_back(VertexIndexSet(this,coords[indices[i]],indices[i])); + } + } + do_it(); +} + +void Tesselator::init() +{ + _errorCode = 0; + _coordVec.clear(); + _acummulated_indices.clear(); + _tesselated_indices.clear(); + _currentPrimtiveType=0; +} + +#ifdef GLU_VERSION_1_2 +void Tesselator::do_it() +{ + GLUtesselator *tobj = gluNewTess(); + + gluTessCallback(tobj, (GLenum)GLU_TESS_VERTEX, + (GLvoid (CALLBACK*) ()) (&vertexCallback)); + gluTessCallback(tobj, (GLenum)GLU_TESS_BEGIN, + (GLvoid (CALLBACK*) ()) (&beginCallback)); + gluTessCallback(tobj, (GLenum)GLU_TESS_END, + (GLvoid (CALLBACK*) ()) (&endCallback)); + gluTessCallback(tobj, (GLenum)GLU_TESS_ERROR, + (GLvoid (CALLBACK*) ()) (&errorCallback)); + + s_tesselator = this; + + gluTessBeginPolygon(tobj,NULL); + gluTessBeginContour(tobj); + + for(CoordVec::iterator itr=_coordVec.begin(); + itr!=_coordVec.end(); + ++itr) + { + gluTessVertex(tobj,itr->_vertex,itr->_vertex); + } + + gluTessEndContour(tobj); + gluTessEndPolygon(tobj); + + gluDeleteTess(tobj); + + if (_errorCode!=0) + { + const GLubyte *estring = gluErrorString((GLenum)_errorCode); + osg::notify(osg::WARN)<<"Tessellation Error: "< 0); + + noPrims = strips.size()+leftoverFaces.size(); + *lens = new int [noPrims]; + + int* lensPtr = *lens; + + unsigned int i; + int noIndices = 0; + for (i = 0; i < strips.size(); i++) + { + noIndices += strips[i]->m_faces.size()+2; + } + + noIndices += leftoverFaces.size()*3; + + *osg_indices = new osg::ushort[noIndices]; + osg::ushort *osg_indicesPtr = *osg_indices; + + for (i = 0; i < strips.size(); i++) + { + NvStripInfo *strip = strips[i]; + int nStripFaceCount = strip->m_faces.size(); + + *(lensPtr++) = nStripFaceCount+2; + + NvFaceInfo tLastFace(0, 0, 0); + + // Handle the first face in the strip + { + NvFaceInfo tFirstFace(strip->m_faces[0]->m_v0, strip->m_faces[0]->m_v1, strip->m_faces[0]->m_v2); + + // If there is a second face, reorder vertices such that the + // unique vertex is first + if (nStripFaceCount > 1) + { + int nUnique = NvStripifier::GetUniqueVertexInB(strip->m_faces[1], &tFirstFace); + if (nUnique == tFirstFace.m_v1) + { + std::swap(tFirstFace.m_v0, tFirstFace.m_v1); + } + else if (nUnique == tFirstFace.m_v2) + { + std::swap(tFirstFace.m_v0, tFirstFace.m_v2); + } + + // If there is a third face, reorder vertices such that the + // shared vertex is last + if (nStripFaceCount > 2) + { + int nShared = NvStripifier::GetSharedVertex(strip->m_faces[2], &tFirstFace); + if (nShared == tFirstFace.m_v1) + { + std::swap(tFirstFace.m_v1, tFirstFace.m_v2); + } + } + } + + *(osg_indicesPtr++) = tFirstFace.m_v0; + *(osg_indicesPtr++) = tFirstFace.m_v1; + *(osg_indicesPtr++) = tFirstFace.m_v2; + + // Update last face info + tLastFace = tFirstFace; + } + + for (int j = 1; j < nStripFaceCount; j++) + { + int nUnique = NvStripifier::GetUniqueVertexInB(&tLastFace, strip->m_faces[j]); + if (nUnique != -1) + { + *(osg_indicesPtr++) = nUnique; + + // Update last face info + tLastFace.m_v0 = tLastFace.m_v1; + tLastFace.m_v1 = tLastFace.m_v2; + tLastFace.m_v2 = nUnique; + } + } + + } + + for (i = 0; i < leftoverFaces.size(); ++i) + { + + *(lensPtr++) = 3; + + *(osg_indicesPtr++) = leftoverFaces[i]->m_v0; + *(osg_indicesPtr++) = leftoverFaces[i]->m_v1; + *(osg_indicesPtr++) = leftoverFaces[i]->m_v2; + + } + +} + + +void TriStripVisitor::stripify(GeoSet& gset) +{ + GeoSet::PrimitiveType primTypeIn = gset.getPrimType(); + GeoSet::PrimitiveType primTypeOut = gset.getPrimType(); + + // determine whether to do smoothing or not, and if + // the primitive type needs to be modified enable smoothed normals. + bool doStripify; + switch(primTypeIn) + { + case(GeoSet::QUADS): + case(GeoSet::QUAD_STRIP): + case(GeoSet::POLYGON): + case(GeoSet::TRIANGLES): + case(GeoSet::TRIANGLE_STRIP): + case(GeoSet::TRIANGLE_FAN): + primTypeOut = GeoSet::TRIANGLE_STRIP; + doStripify = true; + break; + case(GeoSet::FLAT_TRIANGLE_STRIP): + case(GeoSet::FLAT_TRIANGLE_FAN): +// comment out for time being since per vertex colors and normals need +// to take account of the osg::GeoSet::_flat_shaded_skip +// primTypeOut = GeoSet::FLAT_TRIANGLE_STRIP; +// doStripify = true; +// break; + default: // points and lines etc. + doStripify = false; + break; + } + + if (doStripify) + { + + TriangleAcumulatorFunctor tt(gset.getCoords()); + for_each_triangle( gset, tt ); + + if (!tt.in_indices.empty()) + { + int in_numVertices = -1; + for(WordVec::iterator itr=tt.in_indices.begin(); + itr!=tt.in_indices.end(); + ++itr) + { + if (*itr>in_numVertices) in_numVertices=*itr; + } + // the largest indice is in_numVertices, but indices start at 0 + // so increment to give to the corrent number of verticies. + ++in_numVertices; + + int in_cacheSize = 16; + int in_minStripLength = 1; + NvStripInfoVec strips; + NvFaceInfoVec leftoverFaces; + + NvStripifier stripifier; + stripifier.Stripify(tt.in_indices, + in_numVertices, + in_cacheSize, + in_minStripLength, + strips, + leftoverFaces); + + int noPrims; + int *lens; + osg::ushort* osg_indices; + + createStrips(strips,leftoverFaces,noPrims,&lens,&osg_indices); + + if (primTypeIn!=primTypeOut) + gset.setPrimType( primTypeOut ); + + gset.setPrimLengths(lens); + gset.setNumPrims(noPrims); + + gset.setCoords(gset.getCoords(),osg_indices); + + if (gset.getTextureCoords()) + { + switch(gset.getTextureBinding()) + { + case(GeoSet::BIND_OVERALL): + // leave as before + break; + case(GeoSet::BIND_PERPRIM): + // switch off tex coords.. + gset.setTextureBinding(GeoSet::BIND_OFF); + gset.setTextureCoords(NULL); + break; + case(GeoSet::BIND_PERVERTEX): + // set up the indexing. + gset.setTextureCoords(gset.getTextureCoords(),osg_indices); + break; + case(GeoSet::BIND_OFF): + case(GeoSet::BIND_DEFAULT): + // switch off tex coords.. + gset.setTextureCoords(NULL); + break; + } + } + + if (gset.getColors()) + { + switch(gset.getColorBinding()) + { + case(GeoSet::BIND_OVERALL): + // leave as before + break; + case(GeoSet::BIND_PERPRIM): + // switch off colors.. + gset.setColorBinding(GeoSet::BIND_OFF); + gset.setColors(NULL); + break; + case(GeoSet::BIND_PERVERTEX): + // set up the indexing. + gset.setColors(gset.getColors(),osg_indices); + break; + case(GeoSet::BIND_OFF): + case(GeoSet::BIND_DEFAULT): + // switch off colors.. + gset.setColors(NULL); + break; + } + } + + if (gset.getNormals()) + { + switch(gset.getNormalBinding()) + { + case(GeoSet::BIND_OVERALL): + // leave as before + break; + case(GeoSet::BIND_PERPRIM): + // switch off normals.. + gset.setNormalBinding(GeoSet::BIND_OFF); + gset.setNormals(NULL); + break; + case(GeoSet::BIND_PERVERTEX): + // set up the indexing. + gset.setNormals(gset.getNormals(),osg_indices); + break; + case(GeoSet::BIND_OFF): + case(GeoSet::BIND_DEFAULT): + // switch off normals.. + gset.setNormals(NULL); + break; + } + } + + gset.dirtyDisplayList(); + } + else + { + cout << "No triangles to stripify"<(geode.getDrawable(i)); + if (gset) stripify(*gset); + } +} diff --git a/src/osgUtil/VisualsRequirementsVisitor.cpp b/src/osgUtil/VisualsRequirementsVisitor.cpp new file mode 100644 index 000000000..50d555716 --- /dev/null +++ b/src/osgUtil/VisualsRequirementsVisitor.cpp @@ -0,0 +1,64 @@ +#if defined(_MSC_VER) + #pragma warning( disable : 4786 ) +#endif + +#include +#include +#include + +#include + +#include + +using namespace osg; +using namespace osgUtil; + +VisualsRequirementsVisitor::VisualsRequirementsVisitor() +{ + setTraversalMode(NodeVisitor::TRAVERSE_ALL_CHILDREN); + _requiresDoubleBuffer = true; + _requiresRBG = true; + _requiresDepthBuffer = true; + _minimumNumberAlphaBits = 0; + _minimumNumberStencilBits = 0; + +} + +void VisualsRequirementsVisitor::applyStateSet(StateSet& stateset) +{ + if (stateset.getMode(GL_STENCIL_TEST) & StateAttribute::ON) + { + _minimumNumberStencilBits = 1; + } + + if (stateset.getAttribute(StateAttribute::STENCIL)) + { + _minimumNumberStencilBits = 1; + } +} + +void VisualsRequirementsVisitor::apply(Node& node) +{ + osg::StateSet* stateset = node.getStateSet(); + if (stateset) applyStateSet(*stateset); + + traverse(node); +} + +void VisualsRequirementsVisitor::apply(Geode& geode) +{ + osg::StateSet* geode_stateset = geode.getStateSet(); + if (geode_stateset) applyStateSet(*geode_stateset); + + for(int i = 0; i < geode.getNumDrawables(); i++ ) + { + osg::StateSet* stateset = geode.getDrawable(i)->getStateSet(); + if (stateset) applyStateSet(*stateset); + } +} + +void VisualsRequirementsVisitor::apply(Impostor& impostor) +{ + _minimumNumberAlphaBits = 1; + apply((Node&)impostor); +}