This contains the .osg plugin support for OcclusionQueryNode. Both files go
in src/osgPlugins/osg.
 
(BTW, I'll show my ignorance and admit that I have never encountered the
code for writing .ive files. If you could point me to where that's handled,
I'd be glad to add .ive support for OcclusionQueryNode.)
 
Paul Martz
Skew Matrix Software LLC
http://www.skew-matrix.com <http://www.skew-matrix.com/> 
303 859 9466
 
#this file is automatically generated 


SET(TARGET_SRC
AlphaFunc.cpp
AnimationPath.cpp
AutoTransform.cpp
Billboard.cpp
BlendColor.cpp
BlendFunc.cpp
Camera.cpp
CameraView.cpp
ClearNode.cpp
ClipNode.cpp
ClipPlane.cpp
ClusterCullingCallback.cpp
ColorMask.cpp
ColorMatrix.cpp
ConvexPlanarOccluder.cpp
CoordinateSystemNode.cpp
CullFace.cpp
Depth.cpp
Drawable.cpp
EllipsoidModel.cpp
Fog.cpp
FragmentProgram.cpp
FrontFace.cpp
Geode.cpp
Geometry.cpp
Group.cpp
Image.cpp
LOD.cpp
Light.cpp
LightModel.cpp
LightSource.cpp
LineStipple.cpp
LineWidth.cpp
Material.cpp
Matrix.cpp
MatrixTransform.cpp
Node.cpp
NodeCallback.cpp
Object.cpp
OccluderNode.cpp
OcclusionQueryNode.cpp
PagedLOD.cpp
Point.cpp
PointSprite.cpp
PolygonMode.cpp
PolygonOffset.cpp
PositionAttitudeTransform.cpp
Program.cpp
Projection.cpp
ProxyNode.cpp
ReaderWriterOSG.cpp
Scissor.cpp
Sequence.cpp
ShadeModel.cpp
Shader.cpp
Shape.cpp
ShapeDrawable.cpp
StateSet.cpp
Stencil.cpp
Switch.cpp
TessellationHints.cpp
TexEnv.cpp
TexEnvCombine.cpp
TexEnvFilter.cpp
TexGen.cpp
TexGenNode.cpp
TexMat.cpp
Texture.cpp
Texture1D.cpp
Texture2D.cpp
Texture3D.cpp
TextureCubeMap.cpp
TextureRectangle.cpp
Transform.cpp
Uniform.cpp
VertexProgram.cpp
Viewport.cpp
)
SET(TARGET_H Matrix.h )
SET(TARGET_ADDED_LIBRARIES osgSim osgFX osgText )
#### end var setup  ###
SETUP_PLUGIN(osg)
//
// Copyright (C) 2007 Skew Matrix Software LLC (http://www.skew-matrix.com)
//
// This library is open source and may be redistributed and/or modified under  
// the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 
// (at your option) any later version.  The full license is in LICENSE file
// included with this distribution, and on the openscenegraph.org website.
// 
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
// OpenSceneGraph Public License for more details.
//

#include <osg/OcclusionQueryNode>

#include <iostream>
#include <string>

#include <osg/io_utils>

#include <osgDB/Registry>
#include <osgDB/Input>
#include <osgDB/Output>
#include <osgDB/ParameterOutput>

bool OQN_readLocalData( osg::Object &obj, osgDB::Input &fr );
bool OQN_writeLocalData( const osg::Object &obj, osgDB::Output &fw );

osgDB::RegisterDotOsgWrapperProxy OcclusionQueryNode_Proxy
(
    new osg::OcclusionQueryNode,
    "OcclusionQueryNode",
    "Object Node OcclusionQueryNode Group",
    OQN_readLocalData,
    OQN_writeLocalData
);

bool OQN_readLocalData( osg::Object &obj, osgDB::Input &fr )
{
    osg::OcclusionQueryNode& oqn = static_cast<osg::OcclusionQueryNode&>( obj );
    bool advanced( false );

        if (fr[0].matchWord( "QueriesEnabled" ))
        {
        bool enable( fr[1].getStr() == std::string("TRUE") );
                oqn.setQueriesEnabled( enable );
        fr+=2;
                advanced = true;
    }

    return advanced;
}

bool OQN_writeLocalData( const osg::Object &obj, osgDB::Output &fw )
{
    const osg::OcclusionQueryNode& oqn = static_cast<const 
osg::OcclusionQueryNode&>( obj );

    //fw.writeObject( oqn.getOQN(i));

    fw.indent() << "QueriesEnabled " <<
                (oqn.getQueriesEnabled() ? "TRUE" : "FALSE")
                << std::endl;

    return true;
}
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to