source: osgVisual/include/cluster/dataIO_clusterUDP.h @ 37

Last change on this file since 37 was 32, checked in by Torben Dannhauer, 15 years ago

Adding first version of osgVisual!!

File size: 2.2 KB
RevLine 
[32]1#pragma once
2/* -*-c++-*- osgVisual - Copyright (C) 2009-2010 Torben Dannhauer
3 *
4 * This library is based on OpenSceneGraph, open source and may be redistributed and/or modified under
5 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
6 * (at your option) any later version.  The full license is in LICENSE file
7 * included with this distribution, and on the openscenegraph.org website.
8 *
9 * osgVisual requires for some proprietary modules a license from the correspondig manufacturer.
10 * You have to aquire licenses for all used proprietary modules.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 * OpenSceneGraph Public License for more details.
16*/
17
18#include "dataIO_cluster.h"
19
20#include <osg/notify>
21#include <osg/ArgumentParser>
22#include <osgDB/Registry>
23#include <osgDB/ReaderWriter>
24#include <iostream>
25
26#include "dataIO_clusterUDP_Transmission.h"
27
28namespace osgVisual
29{
30
31/**
32 * \brief This is a UDP implementation of dataIO_cluster..
33 *
34 * This class uses UDP to fullfil the functions of dataIO_cluster.
35 * It sends the clusterdata via UDP Broadcast into the network to any listening client.
36 *
37 *
38 * \todo Add getHorizonColor to transport it to slave for consistent fog.
39 * @author Torben Dannhauer
40 * @date  Feb 2010
41 */ 
42class dataIO_clusterUDP :       public dataIO_cluster
43{
44public:
45        dataIO_clusterUDP();
46        virtual ~dataIO_clusterUDP(void);
47
48        void init( osg::ArgumentParser& arguments_, osgVisual::dataIO_transportContainer* sendContainer_, bool compressionEnabled_, bool asAscii_ );
49        void shutdown();
50
51        bool sendTO_OBJvaluesToSlaves();
52        bool readTO_OBJvaluesFromMaster();
53        void reportAsReadyToSwap();
54        bool waitForSwap();
55        bool waitForAllReadyToSwap();
56        bool sendSwapCommand();
57
58private:
59        bool compressionEnabled;
60        osg::ref_ptr<osgDB::Options> readOptions;
61        osg::ref_ptr<osgDB::Options> writeOptions;
62        osg::ref_ptr<osgDB::ReaderWriter> rw;
63        osg::ref_ptr<osgVisual::Broadcaster> broadcaster;
64        osg::ref_ptr<osgVisual::Receiver> receiver;
65};
66
67}       // END NAMESPACE
Note: See TracBrowser for help on using the repository browser.