1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2003 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 _OSGVECFIELDTRAITS_H_
40 #define _OSGVECFIELDTRAITS_H_
45 #include "OSGFieldTraits.h"
46 #include "OSGDataType.h"
47 #include "OSGVector.h"
54 #define doDefineTrait(base, dim, type) \
55 /*! \ingroup GrpBaseFieldTraits \
56 \ingroup GrpLibOSGBase
59 struct FieldTraits<base##dim##type> : \
60 public FieldTraitsVec##dim##TemplateBase<base##dim##type> \
64 static DataType _type; \
68 typedef FieldTraits<base##dim##type> Self; \
71 enum { Convertible = (Self::ToStreamConvertible | \
72 Self::FromStringConvertible) }; \
74 enum { bHasParent = 0x01 }; \
76 static OSG_BASE_DLLMAPPING \
77 DataType &getType (void); \
79 static const Char8 *getSName(void) { return "SF"#base #dim #type; } \
80 static const Char8 *getMName(void) { return "MF"#base #dim #type; } \
82 static base##dim##type getDefault (void) { return base##dim##type();} \
87 #define defineTrait(base, dim, type) \
88 doDefineTrait(base, dim, type);
93 #define defineBTrait(dim, type) \
94 defineTrait(Vec, dim, type) \
95 defineTrait(Pnt, dim, type)
98 #define defineBTraitV(dim, type) \
99 defineTrait(Vec, dim, type)
102 #define defineDTrait(type) \
103 defineBTrait(1, type) \
104 defineBTrait(2, type) \
105 defineBTrait(3, type) \
106 defineBTrait(4, type)
109 #define defineDTraitV(type) \
110 defineBTraitV(1, type) \
111 defineBTraitV(2, type) \
112 defineBTraitV(3, type) \
113 defineBTraitV(4, type)
116 // Actual Instantiations
119 #ifndef OSG_NO_INT8_PNT
134 #endif /* _OSGVECFIELDTRAITS_H_ */