VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtSplitBackfacePolyVisitor.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2013 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvOsg/vrvOsg.h>
13 
14 #include <osg/CullFace>
15 #include <osg/Group>
16 #include <osg/NodeVisitor>
17 #include <osg/Referenced>
18 
19 
20 namespace osg
21 {
22  class Geode;
23  class Node;
24  class StateSet;
25 };
26 
27 
28 namespace makVrv
29 {
30 
38  class DT_DLL_VRVOSG DtSplitBackfacePolyVisitor : public osg::NodeVisitor
39  {
40  public:
43  DtSplitBackfacePolyVisitor(bool transparentOnly = false);
44 
46  virtual ~DtSplitBackfacePolyVisitor();
47 
52  virtual void apply(osg::Node& node);
53 
58  virtual void apply(osg::Geode& geode);
59 
62  void processGeometry();
63 
68  void setTransparentOnly(bool enable);
69 
73  bool transparentOnly() const;
74 
75  protected:
78  void splitGeometry(osg::Geode& geode) const;
79 
84  bool isDoubleSided(const osg::Node& node) const;
85 
90  bool isTransparentMaterial(const osg::StateSet& ss) const;
91 
96  bool isTransparentTextures(const osg::StateSet& ss) const;
97 
100  osg::CullFace* getOrCreateCullFaceAttribute();
101 
102  protected:
104  osg::NodeList myGeodes;
106  };
107 
108 }
osg::ref_ptr< osg::CullFace > myCullFace
Definition: DtSplitBackfacePolyVisitor.h:103
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
DtSplitBackfacePolyVisitor identifies two-sided polygons and duplicates the geometry as a set of two ...
Definition: DtSplitBackfacePolyVisitor.h:38
Contains DLL export macros.
bool myTransparentOnly
Definition: DtSplitBackfacePolyVisitor.h:105
osg::NodeList myGeodes
Definition: DtSplitBackfacePolyVisitor.h:104

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)