NodeVisitor
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (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/NodeVisitor> #include <osg/Billboard>
#include <osg/ClearNode>
#include <osg/ClipNode>
#include <osg/CoordinateSystemNode>
#include <osg/Geode>
#include <osg/Group>
#include <osg/LightSource>
#include <osg/LOD>
#include <osg/MatrixTransform>
#include <osg/OccluderNode>
#include <osg/OcclusionQueryNode>
#include <osg/PagedLOD>
#include <osg/PositionAttitudeTransform>
#include <osg/Projection>
#include <osg/ProxyNode>
#include <osg/Sequence>
#include <osg/Switch>
#include <osg/TexGenNode>
#include <osg/Transform>
#include <osg/Camera>
#include <osg/CameraView>
#include <osg/Geometry> #include <stdlib.h> using namespace osg; NodeVisitor::NodeVisitor(TraversalMode tm):
Object(true)
{
_visitorType = NODE_VISITOR;
_traversalNumber = osg::UNINITIALIZED_FRAME_NUMBER; _traversalMode = tm;
_traversalMask = 0xffffffff;
_nodeMaskOverride = 0x0;
} NodeVisitor::NodeVisitor(VisitorType type,TraversalMode tm):
Object(true)
{
_visitorType = type;
_traversalNumber = osg::UNINITIALIZED_FRAME_NUMBER; _traversalMode = tm;
_traversalMask = 0xffffffff;
_nodeMaskOverride = 0x0;
} NodeVisitor::NodeVisitor(const NodeVisitor& nv, const osg::CopyOp& copyop):
Object(nv, copyop),
_visitorType(nv._visitorType),
_traversalNumber(nv._traversalNumber),
_traversalMode(nv._traversalMode),
_traversalMask(nv._traversalMask),
_nodeMaskOverride(nv._nodeMaskOverride)
{
} NodeVisitor::~NodeVisitor()
{
// if (_traversalVisitor) detach from _traversalVisitor;
} void NodeVisitor::apply(Node& node)
{
traverse(node);
} void NodeVisitor::apply(Drawable& drawable)
{
apply(static_cast<Node&>(drawable));
} void NodeVisitor::apply(Geometry& drawable)
{
apply(static_cast<Drawable&>(drawable));
} void NodeVisitor::apply(Geode& node)
{
apply(static_cast<Group&>(node));
} void NodeVisitor::apply(Billboard& node)
{
apply(static_cast<Geode&>(node));
} void NodeVisitor::apply(Group& node)
{
apply(static_cast<Node&>(node));
} void NodeVisitor::apply(ProxyNode& node)
{
apply(static_cast<Group&>(node));
} void NodeVisitor::apply(Projection& node)
{
apply(static_cast<Group&>(node));
} void NodeVisitor::apply(CoordinateSystemNode& node)
{
apply(static_cast<Group&>(node));
} void NodeVisitor::apply(ClipNode& node)
{
apply(static_cast<Group&>(node));
} void NodeVisitor::apply(TexGenNode& node)
{
apply(static_cast<Group&>(node));
} void NodeVisitor::apply(LightSource& node)
{
apply(static_cast<Group&>(node));
} void NodeVisitor::apply(Transform& node)
{
apply(static_cast<Group&>(node));
} void NodeVisitor::apply(Camera& node)
{
apply(static_cast<Transform&>(node));
} void NodeVisitor::apply(CameraView& node)
{
apply(static_cast<Transform&>(node));
} void NodeVisitor::apply(MatrixTransform& node)
{
apply(static_cast<Transform&>(node));
} void NodeVisitor::apply(PositionAttitudeTransform& node)
{
apply(static_cast<Transform&>(node));
} void NodeVisitor::apply(Switch& node)
{
apply(static_cast<Group&>(node));
} void NodeVisitor::apply(Sequence& node)
{
apply(static_cast<Group&>(node));
} void NodeVisitor::apply(LOD& node)
{
apply(static_cast<Group&>(node));
} void NodeVisitor::apply(PagedLOD& node)
{
apply(static_cast<LOD&>(node));
} void NodeVisitor::apply(ClearNode& node)
{
apply(static_cast<Group&>(node));
} void NodeVisitor::apply(OccluderNode& node)
{
apply(static_cast<Group&>(node));
} void NodeVisitor::apply(OcclusionQueryNode& node)
{
apply(static_cast<Group&>(node));
}
NodeVisitor的更多相关文章
- NodeVisitor的使用-遍历Geode节点下的Geometry并获取顶点、法向量等数据
struct Subset { std::vector<float> vertexs;//位置 std::vector<float> normals;//法向 std::vec ...
- NodeVisitor的使用-遍历Geode节点并在它与父节点之间添加一个LOD节点
#include <osg\NodeVisitor>#include <osg\MatrixTransform>#include <osg\PagedLOD>#in ...
- osg::NodeVisitor中计算一个节点对应的世界变换矩阵、法向量、顶点坐标
class MyNodeVisitor:public osg::NodeVisitor { pulic: MyNodeVisitor():osg::NodeVisitor(osg::NodeVisit ...
- osg探究补充:Node::accept(NodeVisitor& nv)及NodeVisitor简介
前言 在前几节中,我自己觉得讲的比较粗糙,因为实在是时间上不是很充足,今天我想弥补一下,希望不是亡羊补牢.我们在osgViewer::Viewer::eventTraversal()函数中经常看到这么 ...
- [osg]节点遍历nodevisitor浅析
参考:https://www.cnblogs.com/hzhg/archive/2010/12/17/1908764.html OSG中节点的访问使用的是一种访问器模式.一个典型的访问器涉及抽象访问者 ...
- osg::NodeVisitor example
[0]osg::Group [1]osg::MatrixTransform [1] osg::MatrixTransform [1]osg::MatrixTransform [2] osg::Geod ...
- osg::NodeVisitor
[1]osg::Group [2]osg::PositionAttitudeTransform [2]osg::MatrixTransform [3]osg::Geode [2]osg::Matrix ...
- osg::NodeVisitor osg3.4.0
x:-89.4588 y:-12.1245 z:-11.7807x:-89.4588 y:-6.44823 z:-11.7807x:-89.2164 y:-9.07239 z:-11.811x:-89 ...
- OSG程序设计之osg::NodeVisitor
本文所有内容来自<OpenSceneGraph三维渲染引擎设计与实践>一书. 本文主要讨论的是OSG中节点的访问. 对于节点的访问是从节点接收一个访问器开始的,用户执行某个节点的accep ...
随机推荐
- 错误信息: Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException:
这个错误主要原因是:数据库的配置出问题,比如写错库名什么的,仔细检查下.
- 【DP】 路面修整 usaco 2008 feb_gold
题目描述: ``` FJ打算好好修一下农场中某条凹凸不平的土路.按奶牛们的要求,修好后的路面高度应当单调上升或单调下降,也就是说,高度上升与高度下降的路段不能同时出现在修好的路中. 整条路被分成了N段 ...
- mysqldump 原理(转载)
mysqldump 备份过程可以描述为: (1) 先发出一条 flush tables 关闭实例上所有打开的表(2) 创建一个全局锁,FLUSH TABLES WITH READ LOCK获得 db ...
- CDH 大数据平台搭建
一.概述 Cloudera版本(Cloudera’s Distribution Including Apache Hadoop,简称“CDH”),基于Web的用户界面,支持大多数Hadoop组件,包括 ...
- npm 删除指定的某个包以及再次安装
npm uninstall xxxx --save-dev //删除包及删除配置项 npm install xxx@version //安装指定版本 npm install //覆盖
- Kindle Touch 修砖手札
首先是网上的修砖教程: 最近有多人反映按照修砖程序走过后依然板砖,和碎平联系和WA沟通后对帖子作新的修改. 新教程直接使用5.1.2的镜像,特别说明. 特别感谢kn007的专业指导 小白帖子现为简化过 ...
- nodejs新工具-cypress和testcofe的崛起
今天咨询一个自动化 工具问题,偶然间有人提起了这个可能以后会很火的工具,在此找到一篇很好的参考文章 记录并为以后做准备 cypress和testcofe https://www.jianshu.com ...
- sudo 命令
su命令和su -命令最大的本质区别就是: 前者只是切换了root身份,但Shell环境仍然是普通用户的Shell: 而后者连用户和Shell环境一起切换成root身份了.只有切换了Shell环境才不 ...
- [WEB安全]PHP伪协议总结
0x01 简介 首先来看一下有哪些文件包含函数: include.require.include_once.require_once.highlight_file show_source .readf ...
- 关于SQL中的ROWNUM问题
前言 昨天改小程序的后台,看见之前写的分页很奇怪,startIndex和endIndex两个下标, endIndex 总是在里面层,而startIndex总是在外层,我随后改了,直接Where row ...