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 <osg/Matrixd> |
---|
20 | |
---|
21 | #include <dataIO_executer.h> |
---|
22 | #include <dataIO_slot.h> |
---|
23 | |
---|
24 | #include <vector> |
---|
25 | |
---|
26 | namespace osgVisual { |
---|
27 | |
---|
28 | class dataIO_transportContainer : public osg::Object |
---|
29 | { |
---|
30 | public: |
---|
31 | META_Object(osgVisual,dataIO_transportContainer); // Required for serializer |
---|
32 | dataIO_transportContainer(const osgVisual::dataIO_transportContainer& tC_, const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY): // Required for serializer |
---|
33 | Object(tC_,copyop), |
---|
34 | frameID(tC_.frameID), |
---|
35 | viewMatrix(tC_.viewMatrix), |
---|
36 | projectionMatrix(tC_.projectionMatrix), |
---|
37 | executer(tC_.executer), |
---|
38 | ioSlots(tC_.ioSlots){} |
---|
39 | dataIO_transportContainer(){} |
---|
40 | virtual ~dataIO_transportContainer(){} |
---|
41 | |
---|
42 | |
---|
43 | |
---|
44 | |
---|
45 | typedef std::vector<osg::ref_ptr<dataIO_executer> > executerList; |
---|
46 | typedef std::vector<osg::ref_ptr<dataIO_slot> > slotList; |
---|
47 | |
---|
48 | private: |
---|
49 | int frameID; |
---|
50 | osg::Matrixd viewMatrix; |
---|
51 | osg::Matrixd projectionMatrix; |
---|
52 | executerList executer; |
---|
53 | slotList ioSlots; |
---|
54 | |
---|
55 | // Access functions for Serializer |
---|
56 | public: |
---|
57 | int getFrameID() const {return frameID;} |
---|
58 | void setFrameID(int frameID_ ){frameID=frameID_;} |
---|
59 | |
---|
60 | void setViewMatrix(const osg::Matrixd& viewMatrix_){viewMatrix=viewMatrix_;} |
---|
61 | const osg::Matrixd& getViewMatrix() const {return viewMatrix;} |
---|
62 | |
---|
63 | void setProjectionMatrix(const osg::Matrixd& projectionMatrix_){projectionMatrix=projectionMatrix_;} |
---|
64 | const osg::Matrixd& getProjectionMatrix() const {return projectionMatrix;} |
---|
65 | |
---|
66 | void setExecuter(const executerList& executer_) {executer=executer_;} |
---|
67 | const executerList& getExecuter() const {return executer;} |
---|
68 | |
---|
69 | void setIOSlots(const slotList& ioSlots_) {ioSlots=ioSlots_;} |
---|
70 | const slotList& getIOSlots() const {return ioSlots;} |
---|
71 | |
---|
72 | |
---|
73 | |
---|
74 | // Usage functions |
---|
75 | void addExecuter( osg::ref_ptr<dataIO_executer> executerToAdd_ ) {executer.push_back(executerToAdd_);} |
---|
76 | void removeAllExecuter() { executer.clear();} |
---|
77 | |
---|
78 | void addSlot( osg::ref_ptr<dataIO_slot> slotToAdd_ ) {ioSlots.push_back(slotToAdd_);} |
---|
79 | void removeAllSlots() {ioSlots.clear();} |
---|
80 | |
---|
81 | }; |
---|
82 | |
---|
83 | } // END NAMESPACE |
---|