source: osgVisual/include/dataIO/dataIO_slot.h @ 83

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

Adding first version of osgVisual!!

File size: 2.6 KB
Line 
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 <osg/Object>
19#include <osgDB/ObjectWrapper>
20#include <osgDB/InputStream>
21#include <osgDB/OutputStream>
22
23#include <string>
24
25
26namespace osgVisual {
27
28class dataIO_slot : public osg::Object
29{
30public:
31        META_Object(osgVisual,dataIO_slot);
32        dataIO_slot(const osgVisual::dataIO_slot& slot_, const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY):
33            Object(slot_,copyop),
34                        direction(slot_.direction),
35                        variableType(slot_.variableType),
36                        variableName(slot_.variableName),
37                        value(slot_.value),
38                        sValue(slot_.sValue){}
39
40        dataIO_slot(){};
41        ~dataIO_slot(){};
42
43        dataIO_slot & operator=(const dataIO_slot &rhs)
44        {
45                direction=rhs.direction;
46                variableType=rhs.variableType;
47                variableName=rhs.variableName;
48                value=rhs.value;
49                sValue=rhs.sValue;     
50
51                return *this;
52        }
53
54
55        /**
56         * This enums defines the data flow direction of a slot.
57         */ 
58        enum dataDirection {TO_OBJ, FROM_OBJ};
59
60        /**
61         * This enum defines the two valid valuetypes.
62         */ 
63        enum varType {DOUBLE, STRING};
64
65        dataDirection direction;
66        varType variableType;
67        std::string variableName;
68        double value;
69        std::string sValue;
70
71
72// Access functions for Serializer
73        void setdataDirection(dataDirection direction_){direction=direction_;}
74        dataDirection getdataDirection() const {return direction;}
75
76        void setvarType(varType variableType_){variableType=variableType_;}
77        varType getvarType() const {return variableType;}
78
79        const std::string& getVariableName() const {return variableName;}
80        void setVariableName(const std::string& variableName_){variableName=variableName_;}
81
82        double getValue() const {return value;}
83        void setValue(double value_){value=value_;}
84
85        const std::string& getSValue() const {return sValue;}
86        void setSValue(const std::string& sValue_){sValue=sValue_;}
87};
88
89}       // END NAMESPACE
Note: See TracBrowser for help on using the repository browser.