added: travMask to csm viewport
[opensg.git] / Source / Base / Field / OSGMField.ins
blobb5245e164b2f65c5c5f05104001f074313d5405b
1 /*---------------------------------------------------------------------------*\
2  *                                OpenSG                                     *
3  *                                                                           *
4  *                                                                           *
5  *           Copyright (C) 2003 by the OpenSG Forum                          *
6  *                                                                           *
7  *                            www.opensg.org                                 *
8  *                                                                           *
9  *   contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de          *
10  *                                                                           *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
13  *                                License                                    *
14  *                                                                           *
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.                               *
18  *                                                                           *
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.                          *
23  *                                                                           *
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.                 *
27  *                                                                           *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
30  *                                Changes                                    *
31  *                                                                           *
32  *                                                                           *
33  *                                                                           *
34  *                                                                           *
35  *                                                                           *
36  *                                                                           *
37 \*---------------------------------------------------------------------------*/
39 OSG_BEGIN_NAMESPACE
41 template <class ValueT, Int32 iNamespace, class AllocT> inline
42 FieldDescriptionBase *MField<ValueT, 
43                              iNamespace, 
44                              AllocT    >::createFieldDescription(
45     const Char8           *szFieldname,
46           UInt32           uiFieldFlags,
47           FieldEditMethod  fEditMethod,
48           FieldGetMethod   fGetMethod)
50     if(szFieldname == NULL)
51     {
52         FWARNING(("createFieldDescription no fieldname given"));
54         return NULL;
55     }
57     if(uiFieldFlags == FieldDescFactoryBase::AutoFlags)
58     {
59         uiFieldFlags = MFDefaultFlags;
60     }
62     FieldDescriptionBase *returnValue = new typename Self::Description(
63         _fieldType, 
64         szFieldname,
65         "",
66         0,
67         0,
68         false,
69         uiFieldFlags,
70         fEditMethod,
71         fGetMethod);
73     return returnValue;
76 template <class ValueT, Int32 iNamespace, class AllocT> inline
77 FieldDescriptionBase *MField<ValueT, 
78                              iNamespace,
79                              AllocT    >::createIdxFieldDescription(
80     const Char8                *szFieldname,
81           UInt32                uiFieldFlags,
82           FieldIndexEditMethod  fEditMethod,
83           FieldIndexGetMethod   fGetMethod)
85     if(szFieldname == NULL)
86     {
87         FWARNING(("createFieldDescriptionIdx no fieldname given"));
89         return NULL;
90     }
92     if(uiFieldFlags == FieldDescFactoryBase::AutoFlags)
93     {
94         uiFieldFlags = MFDefaultFlags;
95     }
97     FieldDescriptionBase *returnValue = new typename Self::Description(
98         _fieldType, 
99         szFieldname,
100         "",
101         0,
102         0,
103         false,
104         uiFieldFlags,
105         fEditMethod,
106         fGetMethod);
108     return returnValue;
111 #if defined(OSG_STATIC_MEMEBER_NEEDS_COPY_ASIGN_INIT)
113 template <class ValueT, Int32 iNamespace, class AllocT>
114 FieldType MField<ValueT, iNamespace, AllocT>::_fieldType = FieldType(
115      MFieldTraits::getMName (),
116      MFieldTraits::getMPName(),
117      MFieldTraits::getType  (),
118      FieldType::MultiField,
119      Self::Class,
120     &Self::createFieldDescription,
121     &Self::createIdxFieldDescription);
123 #else
125 template <class ValueT, Int32 iNamespace, class AllocT>
126 FieldType MField<ValueT, iNamespace, AllocT>::_fieldType(
127      MFieldTraits::getMName (),
128      MFieldTraits::getMPName(),
129      MFieldTraits::getType  (),
130      FieldType::MultiField,
131      Self::Class,
132     &Self::createFieldDescription,
133     &Self::createIdxFieldDescription);
135 #endif
137 #if defined(OSG_TMPL_STATIC_MEMBER_NEEDS_HELPER_FCT)
138 template <class ValueT, Int32 iNamespace, class AllocT>
139 const FieldType &MField<ValueT, 
140                         iNamespace, 
141                         AllocT    >::fieldTypeExportHelper(void)
143     return _fieldType;
145 #endif
147 OSG_END_NAMESPACE