1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2008 by the OpenSG Forum *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
15 * This library is free software; you can redistribute it and/or modify it *
16 * under the terms of the GNU Library General Public License as published *
17 * by the Free Software Foundation, version 2. *
19 * This library is distributed in the hope that it will be useful, but *
20 * WITHOUT ANY WARRANTY; without even the implied warranty of *
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
22 * Library General Public License for more details. *
24 * You should have received a copy of the GNU Library General Public *
25 * License along with this library; if not, write to the Free Software *
26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
37 \*---------------------------------------------------------------------------*/
39 #ifndef _OSGFIELDCONNECTOR_H_
40 #define _OSGFIELDCONNECTOR_H_
42 #include "OSGBaseDef.h"
48 /*! \ingroup GrpBaseFieldContainerConnector
49 \ingroup GrpLibOSGBase
52 class OSG_BASE_DLLMAPPING BasicFieldConnector
56 BasicFieldConnector(BitVector bSrcMask
,
59 virtual ~BasicFieldConnector(void);
61 void setTargetContainer(FieldContainer
*pDst
);
63 bool match(BitVector fieldMask
);
65 bool match( BitVector bSrcMask
,
66 const FieldContainer
*pDst
,
69 virtual void process(void) = 0;
71 FieldContainer
*getDst(void) const;
73 virtual BasicFieldConnector
*clone(const Field
*pSrcField
,
76 BitVector bDstMask
) = 0;
83 FieldContainer
*_pDst
;
87 BasicFieldConnector(const BasicFieldConnector
&other
);
88 void operator =(const BasicFieldConnector
&rhs
);
91 /*! \ingroup GrpBaseFieldContainerConnector
92 \ingroup GrpLibOSGBase
95 template <class SrcFieldT
, class DstFieldT
>
96 class SFieldConnector
: public BasicFieldConnector
98 typedef BasicFieldConnector Inherited
;
99 typedef SFieldConnector
<SrcFieldT
, DstFieldT
> Self
;
103 SFieldConnector(const SrcFieldT
*pSrcField
,
105 DstFieldT
*pDstField
,
108 virtual ~SFieldConnector(void);
110 virtual void process(void);
112 virtual BasicFieldConnector
*clone(const Field
*pSrcField
,
119 const SrcFieldT
*_pSrcField
;
120 DstFieldT
*_pDstField
;
124 SFieldConnector(const SFieldConnector
&other
);
125 void operator =(const SFieldConnector
&rhs
);
128 /*! \ingroup GrpBaseFieldContainerConnector
129 \ingroup GrpLibOSGBase
132 template <class SrcFieldT
, class DstFieldT
>
133 class MFieldConnector
: public BasicFieldConnector
135 typedef BasicFieldConnector Inherited
;
136 typedef MFieldConnector
<SrcFieldT
, DstFieldT
> Self
;
140 MFieldConnector(const SrcFieldT
*pSrcField
,
142 DstFieldT
*pDstField
,
145 virtual ~MFieldConnector(void);
147 virtual void process(void);
149 virtual BasicFieldConnector
*clone(const Field
*pSrcField
,
156 const SrcFieldT
*_pSrcField
;
157 DstFieldT
*_pDstField
;
161 MFieldConnector(const MFieldConnector
&other
);
162 void operator =(const MFieldConnector
&rhs
);
166 bool addConnection( OSG::AttachmentContainer
*pSrcContainer
,
167 const OSG::Char8
*szSrcName
,
168 OSG::FieldContainer
*pDstContainer
,
169 const OSG::Char8
*szDstName
);
172 bool subConnection( OSG::AttachmentContainer
*pSrcContainer
,
173 const OSG::Char8
*szSrcName
,
174 OSG::FieldContainer
*pDstContainer
,
175 const OSG::Char8
*szDstName
);
180 #include "OSGFieldConnector.inl"