/* -*-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的更多相关文章

  1. NodeVisitor的使用-遍历Geode节点下的Geometry并获取顶点、法向量等数据

    struct Subset { std::vector<float> vertexs;//位置 std::vector<float> normals;//法向 std::vec ...

  2. NodeVisitor的使用-遍历Geode节点并在它与父节点之间添加一个LOD节点

    #include <osg\NodeVisitor>#include <osg\MatrixTransform>#include <osg\PagedLOD>#in ...

  3. osg::NodeVisitor中计算一个节点对应的世界变换矩阵、法向量、顶点坐标

    class MyNodeVisitor:public osg::NodeVisitor { pulic: MyNodeVisitor():osg::NodeVisitor(osg::NodeVisit ...

  4. osg探究补充:Node::accept(NodeVisitor& nv)及NodeVisitor简介

    前言 在前几节中,我自己觉得讲的比较粗糙,因为实在是时间上不是很充足,今天我想弥补一下,希望不是亡羊补牢.我们在osgViewer::Viewer::eventTraversal()函数中经常看到这么 ...

  5. [osg]节点遍历nodevisitor浅析

    参考:https://www.cnblogs.com/hzhg/archive/2010/12/17/1908764.html OSG中节点的访问使用的是一种访问器模式.一个典型的访问器涉及抽象访问者 ...

  6. osg::NodeVisitor example

    [0]osg::Group [1]osg::MatrixTransform [1] osg::MatrixTransform [1]osg::MatrixTransform [2] osg::Geod ...

  7. osg::NodeVisitor

    [1]osg::Group [2]osg::PositionAttitudeTransform [2]osg::MatrixTransform [3]osg::Geode [2]osg::Matrix ...

  8. 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 ...

  9. OSG程序设计之osg::NodeVisitor

    本文所有内容来自<OpenSceneGraph三维渲染引擎设计与实践>一书. 本文主要讨论的是OSG中节点的访问. 对于节点的访问是从节点接收一个访问器开始的,用户执行某个节点的accep ...

随机推荐

  1. Maven02 -学习总结&学习文档 -踩坑123

    maven在开发中的作用 ①自动添加第三方 jar 包 在今天的 JavaEE 开发领域,有大量的第三方框架和工具可以供我们使用.要使用这些 jar 包最简单的方法就是复制粘贴到 WEB-INF/li ...

  2. python网络-静态Web服务器案例(29)

    一.静态Web服务器案例代码static_web_server.py # coding:utf-8 # 导入socket模块 import socket # 导入正则表达式模块 import re # ...

  3. maven基础整理

    转载:https://www.cnblogs.com/hzg110/p/6936101.html maven官网:http://maven.apache.org/index.html 一.为什么使用M ...

  4. lstm-bp过程的手工源码实现

    近些年来,随着深度学习的崛起,RNN模型也变得非常热门.如果把RNN模型按照时间轴展开,它也类似其它的深度神经网络模型结构.因此,我们可以参照已有的方法训练RNN模型. 现在最流行的一种RNN模型是L ...

  5. Hbase节点及原理

    1.Hbase架构:Clinet.Zookeeper.Master.RegionServer.Region.Store.MemStore.HLog 1.读过程 2.写过程 https://www.cn ...

  6. 使用unsafe改善性能

    这种方式是Go所推荐的,优点就是安全,尽管这种操作会发生内存拷贝,导致性能上会有所损耗,这在处理一般业务时这种损耗是可以忽略的.但如果是拷贝频繁的情况下,想要进行性能优化时,就需要引入unsafe.P ...

  7. easyui-datagrid统计

    <script> //打印指定的table function dayin() { var tableToPrint = document.getElementById("dg&q ...

  8. php自定义函数之变量函数

    在之前的变量部份,我们学习了可变变量.可变函数仅仅是可变变量的一个变种.变形表达.大理石平台价格表 可变函数,我们也会称呼为变量函数.简单回顾一下之前的知识点: <?php  $hello =  ...

  9. PHPStorm启动问题--Failed to load JVM DLL

    一.问题 启动PHPStorm时突然遇到PHPStorm无法启动的问题,提示:Failed to load JVM DLL,如图所示:

  10. LibreOJ #524. 「LibreOJ β Round #4」游戏

    二次联通门 : LibreOJ #524. 「LibreOJ β Round #4」游戏 /* LibreOJ #524. 「LibreOJ β Round #4」游戏 找找规律就会发现.. 当有X的 ...