added: travMask to csm viewport
[opensg.git] / Source / Base / Field / OSGSField.ins
blob87b5aea57a3dfd48b18cc73fe413dcdf77714ca4
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> inline
42 FieldDescriptionBase *SField<ValueT, iNamespace>::createFieldDescription(
43     const Char8           *szFieldname,
44           UInt32           uiFieldFlags,
45           FieldEditMethod  fEditMethod,
46           FieldGetMethod   fGetMethod)
48     if(szFieldname == NULL)
49     {
50         FWARNING(("createFieldDescription no fieldname given"));
52         return NULL;
53     }
55     if(uiFieldFlags == FieldDescFactoryBase::AutoFlags)
56     {
57         uiFieldFlags = SFDefaultFlags;
58     }
60     FieldDescriptionBase *returnValue = new typename Self::Description(
61         _fieldType, 
62         szFieldname,
63         "",
64         0,
65         0,
66         false,
67         uiFieldFlags,
68         fEditMethod,
69         fGetMethod);
71     return returnValue;
74 template <class ValueT, Int32 iNamespace> inline
75 FieldDescriptionBase *SField<ValueT, iNamespace>::createIdxFieldDescription(
76     const Char8                *szFieldname,
77           UInt32                uiFieldFlags,
78           FieldIndexEditMethod  fEditMethod,
79           FieldIndexGetMethod   fGetMethod)
81     if(szFieldname == NULL)
82     {
83         FWARNING(("createFieldDescriptionIdx no fieldname given"));
85         return NULL;
86     }
88     if(uiFieldFlags == FieldDescFactoryBase::AutoFlags)
89     {
90         uiFieldFlags = SFDefaultFlags;
91     }
93     FieldDescriptionBase *returnValue = new typename Self::Description(
94         _fieldType, 
95         szFieldname,
96         "",
97         0,
98         0,
99         false,
100         uiFieldFlags,
101         fEditMethod,
102         fGetMethod);
104     return returnValue;
107 #if defined(OSG_STATIC_MEMEBER_NEEDS_COPY_ASIGN_INIT)
109 template <class ValueT, Int32 iNamespace>
110 FieldType SField<ValueT, iNamespace>::_fieldType = FieldType(
111      SFieldTraits::getSName (),
112      SFieldTraits::getSPName(),
113      SFieldTraits::getType  (),
114      FieldType::SingleField,
115      Self::Class,
116     &Self::createFieldDescription,
117     &Self::createIdxFieldDescription);
119 #else
121 template <class ValueT, Int32 iNamespace>
122 FieldType SField<ValueT, iNamespace>::_fieldType(
123      SFieldTraits::getSName (),
124      SFieldTraits::getSPName(),
125      SFieldTraits::getType  (),
126      FieldType::SingleField,
127      Self::Class,
128     &Self::createFieldDescription,
129     &Self::createIdxFieldDescription);
131 #endif
133 #if defined(OSG_TMPL_STATIC_MEMBER_NEEDS_HELPER_FCT)
134 template <class ValueT, Int32 iNamespace>
135 const FieldType &SField<ValueT, iNamespace>::fieldTypeExportHelper(void)
137     return _fieldType;
139 #endif
141 OSG_END_NAMESPACE