Show
Ignore:
Timestamp:
10/20/07 18:11:52 (11 months ago)
Author:
cneumann
Message:

added: RootObjectT template paremter for ReferenceCountPointer?

and ParentPointer? templates - allows use for FieldBundles?

compile fixes - but still not done

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/Carsten_PtrWork/Source/Contrib/Manipulators/OSGManipulatorFields.h

    r969 r976  
    5858#include "OSGContribGUIDef.h" 
    5959 
    60 #include "OSGParentContainer.h" 
    61 #include "OSGInternalRefPtr.h" 
     60#include "OSGReferenceCountPointer.h" 
     61#include "OSGParentPointer.h" 
    6262 
    6363#include "OSGTransformFields.h" 
    6464 
    65 #include "OSGSFieldAdaptor.h" 
    66 #include "OSGMFieldAdaptor.h" 
    67  
     65#include "OSGSPointerFieldAdapter.h" 
     66#include "OSGMPointerFieldAdapter.h" 
    6867 
    6968OSG_BEGIN_NAMESPACE 
    70  
    71 class Manipulator; 
    72  
    73 OSG_GEN_CONTAINERPTR(Manipulator); 
    74  
    75 typedef RefPtr<Manipulator>         ManipulatorRefPtr; 
    76 typedef MTRefPtr<Manipulator>       ManipulatorMTRefPtr; 
    77  
    78 typedef InternalRefPtr<Manipulator>       ManipulatorInternalRefPtr; 
    79 typedef InternalRefPtr<Manipulator> const ManipulatorInternalRefPtrConst; 
    80 typedef InternalRefPtr<Manipulator> const ManipulatorInternalRefPtrConstArg; 
    81  
    82 typedef PtrWrapper<Manipulator, 
    83                    ManipulatorPtr>        ParentManipulatorPtr; 
    84 typedef PtrWrapper<Manipulator, 
    85                    ManipulatorPtr> const  ParentManipulatorPtrConst; 
    8669 
    8770#if !defined(OSG_DO_DOC) // created as a dummy class, remove to prevent doubles 
    8871//! ManipulatorPtr 
    8972 
     73class Manipulator; 
     74 
    9075OSG_GEN_CONTAINERPTR(Manipulator); 
     76 
     77typedef RefCountPtrBuilder<Manipulator>::Ptr         ManipulatorRefPtr; 
     78typedef MTRefCountPtrBuilder<Manipulator>::Ptr       ManipulatorMTRefPtr; 
     79typedef WeakRefCountPtrBuilder<Manipulator>::Ptr     ManipulatorWeakRefPtr; 
     80typedef InternalRefCountPtrBuilder<Manipulator>::Ptr ManipulatorInternalRefPtr; 
     81 
     82typedef ParentPtrBuilder<Manipulator>::Ptr           ManipulatorParentPtr; 
    9183 
    9284#endif 
     
    10092 
    10193template <> 
    102 struct FieldTraits<ManipulatorPtr> : 
    103     public FieldTraitsFCPtrBase<ManipulatorPtr> 
     94struct FieldTraits<ManipulatorInternalRefPtr> : 
     95    public FieldTraitsFCReferenceCountPointerBase<ManipulatorInternalRefPtr> 
    10496{ 
    10597  private: 
    10698 
    107     static DataType             _type; 
     99    static DataType _type; 
    108100 
    109101  public: 
    110102 
    111     typedef FieldTraits<ManipulatorPtr>  Self; 
    112  
    113     enum                        { Convertible = NotConvertible }; 
     103    typedef FieldTraits<ManipulatorInternalRefPtr>  Self; 
     104 
     105    enum { Convertible = NotConvertible }; 
    114106 
    115107    static OSG_CONTRIBGUI_DLLMAPPING DataType &getType(void); 
    116108 
    117     static const char *getSName(void) { return "SFManipulatorPtr"; } 
    118     static const char *getMName(void) { return "MFManipulatorPtr"; } 
     109    static const char *getSName(void) 
     110    { 
     111        return "SFManipulatorInternalRefPtr"; 
     112    } 
     113    static const char *getMName(void) 
     114    { 
     115        return "MFManipulatorInternalRefPtr"; 
     116    } 
     117}; 
     118 
     119/*! \ingroup GrpContribGUIFieldTraits 
     120 */ 
     121#if !defined(OSG_DOC_DEV_TRAITS) 
     122/*! \hideinhierarchy */ 
     123#endif 
     124 
     125template <> 
     126struct FieldTraits<ManipulatorWeakRefPtr> : 
     127    public FieldTraitsFCReferenceCountPointerBase<ManipulatorWeakRefPtr> 
     128
     129  private: 
     130 
     131    static DataType _type; 
     132 
     133  public: 
     134 
     135    typedef FieldTraits<ManipulatorWeakRefPtr>  Self; 
     136 
     137    enum { Convertible = NotConvertible }; 
     138 
     139    static OSG_CONTRIBGUI_DLLMAPPING DataType &getType(void); 
     140 
     141    static const char *getSName(void) 
     142    { 
     143        return "SFManipulatorWeakRefPtr"; 
     144    } 
     145    static const char *getMName(void) 
     146    { 
     147        return "MFManipulatorWeakRefPtr"; 
     148    } 
     149}; 
     150 
     151/*! \ingroup GrpContribGUIFieldTraits 
     152 */ 
     153#if !defined(OSG_DOC_DEV_TRAITS) 
     154/*! \hideinhierarchy */ 
     155#endif 
     156 
     157template <> 
     158struct FieldTraits<ManipulatorParentPtr> : 
     159    public FieldTraitsFCParentPointerBase<ManipulatorParentPtr> 
     160
     161  private: 
     162 
     163    static DataType _type; 
     164 
     165  public: 
     166 
     167    typedef FieldTraits<ManipulatorParentPtr>  Self; 
     168 
     169    enum { Convertible = NotConvertible }; 
     170 
     171    static OSG_CONTRIBGUI_DLLMAPPING DataType &getType(void); 
     172 
     173    static const char *getSName(void) 
     174    { 
     175        return "SFManipulatorParentPtr"; 
     176    } 
     177    static const char *getMName(void) 
     178    { 
     179        return "MFManipulatorParentPtr"; 
     180    } 
    119181}; 
    120182 
     
    127189#endif // !defined(OSG_DO_DOC) || (OSG_DOC_LEVEL >= 3) 
    128190 
    129 #if !defined(OSG_DO_DOC) || (OSG_DOC_LEVEL >= 3) 
    130 /*! \ingroup GrpContribGUIFieldTraits 
    131  */ 
    132 #if !defined(OSG_DOC_DEV_TRAITS) 
    133 /*! \hideinhierarchy */ 
    134 #endif 
    135  
    136 template <> 
    137 struct FieldTraits<ManipulatorInternalRefPtr> : 
    138     public FieldTraitsFCPtrBase<ManipulatorInternalRefPtr> 
    139 { 
    140   private: 
    141  
    142     static DataType             _type; 
    143  
    144   public: 
    145  
    146     typedef FieldTraits<ManipulatorInternalRefPtr>  Self; 
    147  
    148     enum                        { Convertible = NotConvertible }; 
    149  
    150     static OSG_CONTRIBGUI_DLLMAPPING DataType &getType(void); 
    151  
    152     static const char *getSName(void) { return "SFManipulatorInternalRefPtr"; } 
    153     static const char *getMName(void) { return "MFManipulatorInternalRefPtr"; } 
    154 }; 
    155  
    156 #if !defined(OSG_DOC_DEV_TRAITS) 
    157 /*! \class  FieldTraitsTemplateBase<ManipulatorPtr, 0> 
    158     \hideinhierarchy 
    159  */ 
    160 #endif 
    161  
    162 #endif // !defined(OSG_DO_DOC) || (OSG_DOC_LEVEL >= 3) 
    163  
    164 #if !defined(OSG_DO_DOC) || (OSG_DOC_LEVEL >= 3) 
    165 /*! \ingroup GrpContribGUIFieldTraits 
    166  */ 
    167 #if !defined(OSG_DOC_DEV_TRAITS) 
    168 /*! \hideinhierarchy */ 
    169 #endif 
    170  
    171 template <> 
    172 struct FieldTraits<ParentManipulatorPtr> : 
    173     public FieldTraitsFCPtrBase<ParentManipulatorPtr> 
    174 { 
    175   private: 
    176  
    177     static DataType             _type; 
    178  
    179   public: 
    180  
    181     typedef FieldTraits<ParentManipulatorPtr>  Self; 
    182  
    183     enum                        { Convertible = NotConvertible }; 
    184  
    185     static OSG_CONTRIBGUI_DLLMAPPING DataType &getType(void); 
    186  
    187     static const char *getSName(void) { return "SFParentManipulatorPtr"; } 
    188     static const char *getMName(void) { return "MFParentManipulatorPtr"; } 
    189 }; 
    190  
    191 #if !defined(OSG_DOC_DEV_TRAITS) 
    192 /*! \class  FieldTraitsTemplateBase<ManipulatorPtr, 0> 
    193     \hideinhierarchy 
    194  */ 
    195 #endif 
    196  
    197 #endif // !defined(OSG_DO_DOC) || (OSG_DOC_LEVEL >= 3) 
    198  
    199191#if !defined(OSG_DO_DOC) || defined(OSG_DOC_FIELD_TYPEDEFS) 
    200192/*! \ingroup GrpContribGUIFieldSingle */ 
    201193 
    202 typedef SFieldAdaptor<ManipulatorPtr, SFFieldContainerPtr> SFManipulatorPtr; 
    203  
    204 typedef SFieldAdaptor<ManipulatorInternalRefPtr, SFFieldContainerPtr> SFManipulatorInternalRefPtr; 
    205  
    206 typedef SFieldAdaptor<ParentManipulatorPtr, SFParentFieldContainerPtr> SFParentManipulatorPtr; 
     194     
     195typedef SPointerFieldAdapter<ManipulatorInternalRefPtr, 
     196                             SFFieldContainerInternalRefPtr> SFManipulatorInternalRefPtr; 
     197typedef SPointerFieldAdapter<ManipulatorWeakRefPtr, 
     198                             SFFieldContainerWeakRefPtr    > SFManipulatorWeakRefPtr; 
     199typedef SPointerFieldAdapter<ManipulatorParentPtr, 
     200                             SFFieldContainerParentPtr     > SFManipulatorParentPtr; 
    207201#endif 
    208202 
     
    211205/*! \ingroup GrpContribGUIFieldMulti */ 
    212206 
    213 typedef MFieldAdaptor<ManipulatorPtr, MFFieldContainerPtr> MFManipulatorPtr; 
    214  
    215 typedef MFieldAdaptor<ManipulatorInternalRefPtr, MFFieldContainerPtr> MFManipulatorInternalRefPtr; 
    216  
    217 typedef MFieldAdaptor<ParentManipulatorPtr, MFParentFieldContainerPtr> MFParentManipulatorPtr; 
     207typedef MPointerFieldAdapter<ManipulatorInternalRefPtr, 
     208                             MFFieldContainerInternalRefPtr> MFManipulatorInternalRefPtr; 
     209typedef MPointerFieldAdapter<ManipulatorWeakRefPtr, 
     210                             MFFieldContainerWeakRefPtr    > MFManipulatorWeakRefPtr; 
     211typedef MPointerFieldAdapter<ManipulatorParentPtr, 
     212                             MFFieldContainerParentPtr     > MFManipulatorParentPtr; 
    218213#endif 
    219214