root/OpenSceneGraph/trunk/src/osgPlugins/pfb/ConvertFromPerformer.h @ 13557

Revision 13557, 2.4 kB (checked in by robert, 25 hours ago)

Improved handling of setting of the depth of the UI.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1// -*-c++-*-
2
3#ifndef __CONVERTFROMPERFORMER_H
4#define __CONVERTFROMPERFORMER_H
5
6#include <map>
7#include <vector>
8#include <string>
9#include <iostream>
10
11// Open Scene Graph includes.
12#include <osg/Node>
13#include <osg/Group>
14#include <osg/StateSet>
15#include <osg/Geometry>
16#include <osg/Texture2D>
17#include <osg/Material>
18
19// Performer includes.
20#include <Performer/pf/pfNode.h>
21
22class ConvertFromPerformer {
23    public:
24
25        ConvertFromPerformer();
26        ~ConvertFromPerformer();
27
28        osg::Node* convert(pfNode* node);
29
30        void setSaveImageDirectory(const std::string& directory) { _saveImageDirectory = directory; }
31        void setSaveImagesAsRGB(bool b) { _saveImagesAsRGB=b; }
32        void setSaveAbsoluteImagePath(bool b) { _saveAbsoluteImagePath = b; }
33
34    private:
35
36        osg::Object* getOsgObject(pfObject* pfObj);
37        void registerPfObjectForOsgObject(pfObject* pfObj,osg::Object* osgObj);
38
39        osg::Node* visitNode(osg::Group* osgParent,pfNode* node);
40        osg::Node* visitScene(osg::Group* osgParent,pfScene* scene);
41        osg::Node* visitGroup(osg::Group* osgParent,pfGroup* group);
42        osg::Node* visitDCS(osg::Group* osgParent,pfDCS* dcs);
43        osg::Node* visitLOD(osg::Group* osgParent,pfLOD* lod);
44        osg::Node* visitSwitch(osg::Group* osgParent,pfSwitch* switchNode);
45        osg::Node* visitSequence(osg::Group* osgParent,pfSequence* sequence);
46        osg::Node* visitSCS(osg::Group* osgParent,pfSCS* scs);
47        osg::Node* visitGeode(osg::Group* osgParent,pfGeode* geode);
48        osg::Node* visitBillboard(osg::Group* osgParent,pfBillboard* billboard);
49
50        int getNumVerts(pfGeoSet *gset);
51        osg::Drawable* visitGeoSet(osg::Geode* osgParent,pfGeoSet* geoset);
52        osg::StateSet* visitGeoState(osg::Drawable* osgDrawble,pfGeoState* geostate);
53        osg::Material* visitMaterial(osg::StateSet* osgStateSet,pfMaterial* front_mat,pfMaterial* back_mat);
54        osg::Texture2D* visitTexture(osg::StateSet* osgStateSet,pfTexture* tex);
55
56        typedef std::map<int,deprecated_osg::Geometry::AttributeBinding> GSetBindingMap;
57
58        GSetBindingMap      _gsetBindMap;
59
60        bool _saveImagesAsRGB;
61        bool _saveAbsoluteImagePath;
62        std::string _saveImageDirectory;
63
64        typedef std::map<pfObject*,osg::Object*> PfObjectToOsgObjectMap;
65        PfObjectToOsgObjectMap _pfToOsgMap;
66
67        osg::Node* _osgRoot;
68
69};
70
71#endif
Note: See TracBrowser for help on using the browser.