Changeset 1156
- Timestamp:
- 04/14/08 08:19:04 (1 month ago)
- Files:
-
- trunk/Source/System/Image/WS/OSGImageBase.cpp (modified) (1 diff)
- trunk/Source/System/Image/WS/OSGImageBase.h (modified) (1 diff)
- trunk/Source/System/NodeCores/Drawables/Geometry/Base/ES/OSGGeometryBase.cpp (modified) (4 diffs)
- trunk/Source/System/NodeCores/Drawables/Geometry/Base/ES/OSGGeometryBase.h (modified) (2 diffs)
- trunk/Source/System/NodeCores/Drawables/Geometry/Base/WS/OSGGeometryBase.cpp (modified) (8 diffs)
- trunk/Source/System/NodeCores/Drawables/Geometry/Base/WS/OSGGeometryBase.h (modified) (2 diffs)
- trunk/Source/System/NodeCores/Drawables/Particles/OSGParticlesBase.cpp (modified) (8 diffs)
- trunk/Source/System/NodeCores/Drawables/Particles/OSGParticlesBase.h (modified) (2 diffs)
- trunk/Source/System/NodeCores/Groups/Misc/OSGMultiCoreBase.cpp (modified) (5 diffs)
- trunk/Source/System/NodeCores/Groups/Misc/OSGMultiCoreBase.h (modified) (2 diffs)
- trunk/Source/System/State/Base/WS/OSGTextureObjChunkBase.cpp (modified) (5 diffs)
- trunk/Source/System/State/Base/WS/OSGTextureObjChunkBase.h (modified) (2 diffs)
- trunk/Source/System/State/SHL/OSGShaderParameterChunkBase.cpp (modified) (5 diffs)
- trunk/Source/System/State/SHL/OSGShaderParameterChunkBase.h (modified) (2 diffs)
- trunk/Source/System/State/SHL/Parameter/OSGShaderParameterBase.cpp (modified) (1 diff)
- trunk/Source/System/State/SHL/Parameter/OSGShaderParameterBase.h (modified) (1 diff)
- trunk/Source/System/Window/Base/OSGViewportBase.cpp (modified) (1 diff)
- trunk/Source/System/Window/Base/OSGViewportBase.h (modified) (1 diff)
- trunk/Source/System/Window/Base/OSGWindowBase.cpp (modified) (5 diffs)
- trunk/Source/System/Window/Base/OSGWindowBase.h (modified) (2 diffs)
- trunk/Source/Test/SystemLib/OSGFCDPtrTestFCBase.cpp (modified) (4 diffs)
- trunk/Source/Test/SystemLib/OSGFCDPtrTestFCBase.h (modified) (2 diffs)
- trunk/Source/Test/SystemLib/OSGFCDSParTestFCBase.cpp (modified) (1 diff)
- trunk/Source/Test/SystemLib/OSGFCDSParTestFCBase.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/Source/System/Image/WS/OSGImageBase.cpp
r1127 r1156 1682 1682 { 1683 1683 } 1684 /*-------------------------------------------------------------------------*/ 1685 /* Parent linking */ 1686 1687 bool ImageBase::linkParent( 1688 const FieldContainerPtr pParent, 1689 const UInt16 childFieldId, 1690 const UInt16 parentFieldId ) 1691 { 1692 if(parentFieldId == ParentsFieldId) 1693 { 1694 FieldContainerPtr pTypedParent = 1695 dynamic_cast< FieldContainerPtr >(pParent); 1696 1697 if(pTypedParent != NullFC) 1698 { 1699 editMField(ParentsFieldMask, _mfParents); 1700 1701 _mfParents.push_back(pParent, childFieldId); 1702 1703 return true; 1704 } 1705 1706 return false; 1707 } 1708 1709 return Inherited::linkParent(pParent, childFieldId, parentFieldId); 1710 } 1711 1712 bool ImageBase::unlinkParent( 1713 const FieldContainerPtr pParent, 1714 const UInt16 parentFieldId) 1715 { 1716 if(parentFieldId == ParentsFieldId) 1717 { 1718 FieldContainerPtr pTypedParent = 1719 dynamic_cast< FieldContainerPtr >(pParent); 1720 1721 if(pTypedParent != NullFC) 1722 { 1723 MFParentFieldContainerPtr::iterator pI = 1724 _mfParents.find_nc(pParent); 1725 1726 if(pI != _mfParents.end()) 1727 { 1728 editMField(ParentsFieldMask, _mfParents); 1729 1730 _mfParents.erase(pI); 1731 1732 return true; 1733 } 1734 1735 FWARNING(("ImageBase::unlinkParent: " 1736 "Child <-> Parent link inconsistent.\n")); 1737 1738 return false; 1739 } 1740 1741 return false; 1742 } 1743 1744 return Inherited::unlinkParent(pParent, parentFieldId); 1745 } 1746 1684 1747 1685 1748 void ImageBase::onCreate(const Image *source) trunk/Source/System/Image/WS/OSGImageBase.h
r1116 r1156 623 623 /*! \} */ 624 624 /*---------------------------------------------------------------------*/ 625 /*! \name Parent linking */ 626 /*! \{ */ 627 628 virtual bool linkParent (const FieldContainerPtr pParent, 629 const UInt16 childFieldId, 630 const UInt16 parentFieldId); 631 virtual bool unlinkParent(const FieldContainerPtr pParent, 632 const UInt16 parentFieldId); 633 634 /*! \} */ 635 /*---------------------------------------------------------------------*/ 625 636 /*! \name Generic Field Access */ 626 637 /*! \{ */ trunk/Source/System/NodeCores/Drawables/Geometry/Base/ES/OSGGeometryBase.cpp
r1117 r1156 736 736 } 737 737 738 void GeometryBase::subChildPointer(FieldContainerPtr pObj,739 UInt16 usFieldPos)740 {741 if(usFieldPos == TypesFieldId)742 {743 if(_sfTypes.getValue() == pObj)744 {745 editSField(TypesFieldMask);746 747 _sfTypes.setValue(NullFC);748 }749 }750 else if(usFieldPos == LengthsFieldId)751 {752 if(_sfLengths.getValue() == pObj)753 {754 editSField(LengthsFieldMask);755 756 _sfLengths.setValue(NullFC);757 }758 }759 else if(usFieldPos == PropertiesFieldId)760 {761 GeoVectorPropertyPtr pChild = dynamic_cast<GeoVectorPropertyPtr>(pObj);762 763 if(pChild != NullFC)764 removeFromProperties(pChild);765 }766 else if(usFieldPos == PropIndicesFieldId)767 {768 GeoIntegralPropertyPtr pChild = dynamic_cast<GeoIntegralPropertyPtr>(pObj);769 770 if(pChild != NullFC)771 removeFromPropIndices(pChild);772 }773 else774 {775 Inherited::subChildPointer(pObj, usFieldPos);776 }777 }778 779 780 738 //! create a new instance of the class 781 739 GeometryTransitPtr GeometryBase::create(void) … … 869 827 GeometryBase::GeometryBase(void) : 870 828 Inherited(), 871 _sfTypes (this, TypesFieldId), 872 _sfLengths (this, LengthsFieldId), 873 _mfProperties (this, PropertiesFieldId), 874 _mfPropIndices (this, PropIndicesFieldId), 829 _sfTypes (this, 830 TypesFieldId, 831 GeoIntegralProperty::XXFieldId), 832 _sfLengths (this, 833 LengthsFieldId, 834 GeoIntegralProperty::XXFieldId), 835 _mfProperties (this, 836 PropertiesFieldId, 837 GeoVectorProperty::XXFieldId), 838 _mfPropIndices (this, 839 PropIndicesFieldId, 840 GeoIntegralProperty::XXFieldId), 875 841 _sfClassicGLId (Int32(0)), 876 842 _sfAttGLId (Int32(0)) … … 880 846 GeometryBase::GeometryBase(const GeometryBase &source) : 881 847 Inherited(source), 882 _sfTypes (this, TypesFieldId), 883 _sfLengths (this, LengthsFieldId), 884 _mfProperties (this, PropertiesFieldId), 885 _mfPropIndices (this, PropIndicesFieldId), 848 _sfTypes (this, 849 TypesFieldId, 850 GeoIntegralProperty::XXFieldId), 851 _sfLengths (this, 852 LengthsFieldId, 853 GeoIntegralProperty::XXFieldId), 854 _mfProperties (this, 855 PropertiesFieldId, 856 GeoVectorProperty::XXFieldId), 857 _mfPropIndices (this, 858 PropIndicesFieldId, 859 GeoIntegralProperty::XXFieldId), 886 860 _sfClassicGLId (source._sfClassicGLId ), 887 861 _sfAttGLId (source._sfAttGLId ) … … 894 868 GeometryBase::~GeometryBase(void) 895 869 { 870 } 871 872 /*-------------------------------------------------------------------------*/ 873 /* Child linking */ 874 875 bool GeometryBase::unlinkChild( 876 const FieldContainerPtr pChild, 877 const UInt16 childFieldId) 878 { 879 if(childFieldId == TypesFieldId) 880 { 881 GeoIntegralPropertyPtr pTypedChild = 882 dynamic_cast<GeoIntegralPropertyPtr>(pChild); 883 884 if(pTypedChild != NullFC) 885 { 886 if(pTypedChild == getTypes()) 887 { 888 editSField(TypesFieldMask); 889 890 _sfTypes.setValue(NullFC); 891 892 return true; 893 } 894 895 FWARNING(("GeometryBase::unlinkParent: Child <-> " 896 "Parent link inconsistent.\n")); 897 898 return false; 899 } 900 901 return false; 902 } 903 904 if(childFieldId == LengthsFieldId) 905 { 906 GeoIntegralPropertyPtr pTypedChild = 907 dynamic_cast<GeoIntegralPropertyPtr>(pChild); 908 909 if(pTypedChild != NullFC) 910 { 911 if(pTypedChild == getLengths()) 912 { 913 editSField(LengthsFieldMask); 914 915 _sfLengths.setValue(NullFC); 916 917 return true; 918 } 919 920 FWARNING(("GeometryBase::unlinkParent: Child <-> " 921 "Parent link inconsistent.\n")); 922 923 return false; 924 } 925 926 return false; 927 } 928 929 if(childFieldId == PropertiesFieldId) 930 { 931 GeoVectorPropertyPtr pTypedChild = 932 dynamic_cast<GeoVectorPropertyPtr>(pChild); 933 934 if(pTypedChild != NullFC) 935 { 936 MFUnrecFieldContainerChildGeoVectorPropertyPtr::iterator pI = 937 _mfProperties.find_nc(pTypedChild); 938 939 if(pI != _mfProperties.end()) 940 { 941 editMField(PropertiesFieldMask, _mfProperties); 942 943 _mfProperties.erase(pI); 944 945 return true; 946 } 947 948 FWARNING(("GeometryBase::unlinkParent: Child <-> " 949 "Parent link inconsistent.\n")); 950 951 return false; 952 } 953 954 return false; 955 } 956 957 if(childFieldId == PropIndicesFieldId) 958 { 959 GeoIntegralPropertyPtr pTypedChild = 960 dynamic_cast<GeoIntegralPropertyPtr>(pChild); 961 962 if(pTypedChild != NullFC) 963 { 964 MFUnrecFieldContainerChildGeoIntegralPropertyPtr::iterator pI = 965 _mfPropIndices.find_nc(pTypedChild); 966 967 if(pI != _mfPropIndices.end()) 968 { 969 editMField(PropIndicesFieldMask, _mfPropIndices); 970 971 _mfPropIndices.erase(pI); 972 973 return true; 974 } 975 976 FWARNING(("GeometryBase::unlinkParent: Child <-> " 977 "Parent link inconsistent.\n")); 978 979 return false; 980 } 981 982 return false; 983 } 984 985 986 return Inherited::unlinkChild(pChild, childFieldId); 896 987 } 897 988 trunk/Source/System/NodeCores/Drawables/Geometry/Base/ES/OSGGeometryBase.h
r1116 r1156 224 224 /*! \{ */ 225 225 226 virtual void subChildPointer(FieldContainerPtr pObj,227 UInt16 usFieldPos);228 229 /*! \} */230 /*---------------------------------------------------------------------*/231 /*! \name Construction */232 /*! \{ */233 234 226 static GeometryTransitPtr create (void); 235 227 static GeometryPtr createEmpty (void); … … 293 285 void onCreate(const Geometry *source = NULL); 294 286 287 /*! \} */ 288 /*---------------------------------------------------------------------*/ 289 /*! \name Child linking */ 290 /*! \{ */ 291 292 virtual bool unlinkChild(const FieldContainerPtr pChild, 293 const UInt16 childFieldId); 294 295 295 /*! \} */ 296 296 /*---------------------------------------------------------------------*/ trunk/Source/System/NodeCores/Drawables/Geometry/Base/WS/OSGGeometryBase.cpp
r1117 r1156 247 247 " category=\"childpointer\"\n" 248 248 " childParentType=\"FieldContainer\"\n" 249 " linkParentField=\"Parents\"\n" 249 250 "\t>\n" 250 251 " The types property contains the primitive's types. Legal values are \n" … … 260 261 " category=\"childpointer\"\n" 261 262 " childParentType=\"FieldContainer\"\n" 263 " linkParentField=\"Parents\"\n" 262 264 "\t>\n" 263 265 " The lengths property contains the number of vertices to use for the \n" … … 273 275 " childParentType=\"FieldContainer\"\n" 274 276 " checkNilPtr=\"false\"\n" 277 " linkParentField=\"Parents\"\n" 275 278 "\t>\n" 276 279 " The attributes used to render the geometry. The order is based on the \n" … … 286 289 " childParentType=\"FieldContainer\"\n" 287 290 " checkNilPtr=\"false\"\n" 291 " linkParentField=\"Parents\"\n" 288 292 "\t>\n" 289 293 " The indices property contains the index data. See \\ref \n" … … 793 797 } 794 798 795 void GeometryBase::subChildPointer(FieldContainerPtr pObj,796 UInt16 usFieldPos)797 {798 if(usFieldPos == TypesFieldId)799 {800 if(_sfTypes.getValue() == pObj)801 {802 editSField(TypesFieldMask);803 804 _sfTypes.setValue(NullFC);805 }806 }807 else if(usFieldPos == LengthsFieldId)808 {809 if(_sfLengths.getValue() == pObj)810 {811 editSField(LengthsFieldMask);812 813 _sfLengths.setValue(NullFC);814 }815 }816 else if(usFieldPos == PropertiesFieldId)817 {818 GeoVectorPropertyPtr pChild = dynamic_cast<GeoVectorPropertyPtr>(pObj);819 820 if(pChild != NullFC)821 removeFromProperties(pChild);822 }823 else if(usFieldPos == PropIndicesFieldId)824 {825 GeoIntegralPropertyPtr pChild = dynamic_cast<GeoIntegralPropertyPtr>(pObj);826 827 if(pChild != NullFC)828 removeFromPropIndices(pChild);829 }830 else831 {832 Inherited::subChildPointer(pObj, usFieldPos);833 }834 }835 836 837 799 //! create a new instance of the class 838 800 GeometryTransitPtr GeometryBase::create(void) … … 926 888 GeometryBase::GeometryBase(void) : 927 889 Inherited(), 928 _sfTypes (this, TypesFieldId), 929 _sfLengths (this, LengthsFieldId), 930 _mfProperties (this, PropertiesFieldId), 931 _mfPropIndices (this, PropIndicesFieldId), 890 _sfTypes (this, 891 TypesFieldId, 892 GeoIntegralProperty::ParentsFieldId), 893 _sfLengths (this, 894 LengthsFieldId, 895 GeoIntegralProperty::ParentsFieldId), 896 _mfProperties (this, 897 PropertiesFieldId, 898 GeoVectorProperty::ParentsFieldId), 899 _mfPropIndices (this, 900 PropIndicesFieldId, 901 GeoIntegralProperty::ParentsFieldId), 932 902 _sfDlistCache (bool(true)), 933 903 _sfClassicGLId (Int32(0)), … … 938 908 GeometryBase::GeometryBase(const GeometryBase &source) : 939 909 Inherited(source), 940 _sfTypes (this, TypesFieldId), 941 _sfLengths (this, LengthsFieldId), 942 _mfProperties (this, PropertiesFieldId), 943 _mfPropIndices (this, PropIndicesFieldId), 910 _sfTypes (this, 911 TypesFieldId, 912 GeoIntegralProperty::ParentsFieldId), 913 _sfLengths (this, 914 LengthsFieldId, 915 GeoIntegralProperty::ParentsFieldId), 916 _mfProperties (this, 917 PropertiesFieldId, 918 GeoVectorProperty::ParentsFieldId), 919 _mfPropIndices (this, 920 PropIndicesFieldId, 921 GeoIntegralProperty::ParentsFieldId), 944 922 _sfDlistCache (source._sfDlistCache ), 945 923 _sfClassicGLId (source._sfClassicGLId ), … … 953 931 GeometryBase::~GeometryBase(void) 954 932 { 933 } 934 935 /*-------------------------------------------------------------------------*/ 936 /* Child linking */ 937 938 bool GeometryBase::unlinkChild( 939 const FieldContainerPtr pChild, 940 const UInt16 childFieldId) 941 { 942 if(childFieldId == TypesFieldId) 943 { 944 GeoIntegralPropertyPtr pTypedChild = 945 dynamic_cast<GeoIntegralPropertyPtr>(pChild); 946 947 if(pTypedChild != NullFC) 948 { 949 if(pTypedChild == getTypes()) 950 { 951 editSField(TypesFieldMask); 952 953 _sfTypes.setValue(NullFC); 954 955 return true; 956 } 957 958 FWARNING(("GeometryBase::unlinkParent: Child <-> " 959 "Parent link inconsistent.\n")); 960 961 return false; 962 } 963 964 return false; 965 } 966 967 if(childFieldId == LengthsFieldId) 968 { 969 GeoIntegralPropertyPtr pTypedChild = 970 dynamic_cast<GeoIntegralPropertyPtr>(pChild); 971 972 if(pTypedChild != NullFC) 973 { 974 if(pTypedChild == getLengths()) 975 { 976 editSField(LengthsFieldMask); 977 978 _sfLengths.setValue(NullFC); 979 980 return true; 981 } 982 983 FWARNING(("GeometryBase::unlinkParent: Child <-> " 984 "Parent link inconsistent.\n")); 985 986 return false; 987 } 988 989 return false; 990 } 991 992 if(childFieldId == PropertiesFieldId) 993 { 994 GeoVectorPropertyPtr pTypedChild = 995 dynamic_cast<GeoVectorPropertyPtr>(pChild); 996 997 if(pTypedChild != NullFC) 998 { 999 MFUnrecFieldContainerChildGeoVectorPropertyPtr::iterator pI = 1000 _mfProperties.find_nc(pTypedChild); 1001 1002 if(pI != _mfProperties.end()) 1003 { 1004 editMField(PropertiesFieldMask, _mfProperties); 1005 1006 _mfProperties.erase(pI); 1007 1008 return true; 1009 } 1010 1011 FWARNING(("GeometryBase::unlinkParent: Child <-> " 1012 "Parent link inconsistent.\n")); 1013 1014 return false; 1015 } 1016 1017 return false; 1018 } 1019 1020 if(childFieldId == PropIndicesFieldId) 1021 { 1022 GeoIntegralPropertyPtr pTypedChild = 1023 dynamic_cast<GeoIntegralPropertyPtr>(pChild); 1024 1025 if(pTypedChild != NullFC) 1026 { 1027 MFUnrecFieldContainerChildGeoIntegralPropertyPtr::iterator pI = 1028 _mfPropIndices.find_nc(pTypedChild); 1029 1030 if(pI != _mfPropIndices.end()) 1031 { 1032 editMField(PropIndicesFieldMask, _mfPropIndices); 1033 1034 _mfPropIndices.erase(pI); 1035 1036 return true; 1037 } 1038 1039 FWARNING(("GeometryBase::unlinkParent: Child <-> " 1040 "Parent link inconsistent.\n")); 1041 1042 return false; 1043 } 1044 1045 return false; 1046 } 1047 1048 1049 return Inherited::unlinkChild(pChild, childFieldId); 955 1050 } 956 1051 trunk/Source/System/NodeCores/Drawables/Geometry/Base/WS/OSGGeometryBase.h
r1116 r1156 241 241 /*! \{ */ 242 242 243 virtual void subChildPointer(FieldContainerPtr pObj,244 UInt16 usFieldPos);245 246 /*! \} */247 /*---------------------------------------------------------------------*/248 /*! \name Construction */249 /*! \{ */250 251 243 static GeometryTransitPtr create (void); 252 244 static GeometryPtr createEmpty (void); … … 311 303 void onCreate(const Geometry *source = NULL); 312 304 305 /*! \} */ 306 /*---------------------------------------------------------------------*/ 307 /*! \name Child linking */ 308 /*! \{ */ 309 310 virtual bool unlinkChild(const FieldContainerPtr pChild, 311 const UInt16 childFieldId); 312 313 313 /*! \} */ 314 314 /*---------------------------------------------------------------------*/ trunk/Source/System/NodeCores/Drawables/Particles/OSGParticlesBase.cpp
r1117 r1156 375 375 " category=\"childpointer\"\n" 376 376 " childParentType=\"FieldContainer\"\n" 377 " linkParentField=\"Parents\"\n" 377 378 "\t>\n" 378 379 " The positions of the particles. This is the primary defining\n" … … 400 401 " category=\"childpointer\"\n" 401 402 " childParentType=\"FieldContainer\"\n" 403 " linkParentField=\"Parents\"\n" 402 404 "\t>\n" 403 405 " The secondary position of the particle. This information is only used\n" … … 413 415 " category=\"childpointer\"\n" 414 416 " childParentType=\"FieldContainer\"\n" 417 " linkParentField=\"Parents\"\n" 415 418 "\t>\n" 416 419 "\tThe particle colors (optional).\n" … … 424 427 " category=\"childpointer\"\n" 425 428 " childParentType=\"FieldContainer\"\n" 429 " linkParentField=\"Parents\"\n" 426 430 "\t>\n" 427 431 " Most particles will be automatically aligned to the view\n" … … 904 908 } 905 909 906 void ParticlesBase::subChildPointer(FieldContainerPtr pObj,907 UInt16 usFieldPos)908 {909 if(usFieldPos == PositionsFieldId)910 {911 if(_sfPositions.getValue() == pObj)912 {913 editSField(PositionsFieldMask);914 915 _sfPositions.setValue(NullFC);916 }917 }918 else if(usFieldPos == SecPositionsFieldId)919 {920 if(_sfSecPositions.getValue() == pObj)921 {922 editSField(SecPositionsFieldMask);923 924 _sfSecPositions.setValue(NullFC);925 }926 }927 else if(usFieldPos == ColorsFieldId)928 {929 if(_sfColors.getValue() == pObj)930 {931 editSField(ColorsFieldMask);932 933 _sfColors.setValue(NullFC);934 }935 }936 else if(usFieldPos == NormalsFieldId)937 {938 if(_sfNormals.getValue() == pObj)939 {940 editSField(NormalsFieldMask);941 942 _sfNormals.setValue(NullFC);943 }944 }945 else946 {947 Inherited::subChildPointer(pObj, usFieldPos);948 }949 }950 951 952 910 //! create a new instance of the class 953 911 ParticlesTransitPtr ParticlesBase::create(void) … … 1042 1000 Inherited(), 1043 1001 _sfMode (UInt32(2)), 1044 _sfPositions (this, PositionsFieldId), 1002 _sfPositions (this, 1003 PositionsFieldId, 1004 GeoVectorProperty::ParentsFieldId), 1045 1005 _mfSizes (), 1046 _sfSecPositions (this, SecPositionsFieldId), 1047 _sfColors (this, ColorsFieldId), 1048 _sfNormals (this, NormalsFieldId), 1006 _sfSecPositions (this, 1007 SecPositionsFieldId, 1008 GeoVectorProperty::ParentsFieldId), 1009 _sfColors (this, 1010 ColorsFieldId, 1011 GeoVectorProperty::ParentsFieldId), 1012 _sfNormals (this, 1013 NormalsFieldId, 1014 GeoVectorProperty::ParentsFieldId), 1049 1015 _mfIndices (), 1050 1016 _mfTextureZs (), … … 1060 1026 Inherited(source), 1061 1027 _sfMode (source._sfMode ), 1062 _sfPositions (this, PositionsFieldId), 1028 _sfPositions (this, 1029 PositionsFieldId, 1030 GeoVectorProperty::ParentsFieldId), 1063 1031 _mfSizes (source._mfSizes ), 1064 _sfSecPositions (this, SecPositionsFieldId), 1065 _sfColors (this, ColorsFieldId), 1066 _sfNormals (this, NormalsFieldId), 1032 _sfSecPositions (this, 1033 SecPositionsFieldId, 1034 GeoVectorProperty::ParentsFieldId), 1035 _sfColors (this, 1036 ColorsFieldId, 1037 GeoVectorProperty::ParentsFieldId), 1038 _sfNormals (this, 1039 NormalsFieldId, 1040 GeoVectorProperty::ParentsFieldId), 1067 1041 _mfIndices (source._mfIndices ), 1068 1042 _mfTextureZs (source._mfTextureZs ), … … 1080 1054 ParticlesBase::~ParticlesBase(void) 1081 1055 { 1056 } 1057 1058 /*-------------------------------------------------------------------------*/ 1059 /* Child linking */ 1060 1061 bool ParticlesBase::unlinkChild( 1062 const FieldContainerPtr pChild, 1063 const UInt16 childFieldId) 1064 { 1065 if(childFieldId == PositionsFieldId) 1066 { 1067 GeoVectorPropertyPtr pTypedChild = 1068 dynamic_cast<GeoVectorPropertyPtr>(pChild); 1069 1070 if(pTypedChild != NullFC) 1071 { 1072 if(pTypedChild == getPositions()) 1073 { 1074 editSField(PositionsFieldMask); 1075 1076 _sfPositions.setValue(NullFC); 1077 1078 return true; 1079 } 1080 1081 FWARNING(("ParticlesBase::unlinkParent: Child <-> " 1082 "Parent link inconsistent.\n")); 1083 1084 return false; 1085 } 1086 1087 return false; 1088 } 1089 1090 if(childFieldId == SecPositionsFieldId) 1091 { 1092 GeoVectorPropertyPtr pTypedChild = 1093 dynamic_cast<GeoVectorPropertyPtr>(pChild); 1094 1095 if(pTypedChild != NullFC) 1096 { 1097 if(pTypedChild == getSecPositions()) 1098 { 1099 editSField(SecPositionsFieldMask); 1100 1101 _sfSecPositions.setValue(NullFC); 1102 1103 return true; 1104 } 1105 1106 FWARNING(("ParticlesBase::unlinkParent: Child <-> " 1107 "Parent link inconsistent.\n")); 1108 1109 return false; 1110 } 1111 1112 return false; 1113 } 1114 1115 if(childFieldId == ColorsFieldId) 1116 { 1117 GeoVectorPropertyPtr pTypedChild = 1118 dynamic_cast<GeoVectorPropertyPtr>(pChild); 1119 1120 if(pTypedChild != NullFC) 1121 { 1122 if(pTypedChild == getColors()) 1123 { 1124 editSField(ColorsFieldMask); 1125 1126 _sfColors.setValue(NullFC); 1127 1128 return true; 1129 } 1130 1131 FWARNING(("ParticlesBase::unlinkParent: Child <-> " 1132 "Parent link inconsistent.\n")); 1133 1134 return false; 1135 } 1136 1137 return false; 1138 } 1139 1140 if(childFieldId == NormalsFieldId) 1141 { 1142 GeoVectorPropertyPtr pTypedChild = 1143 dynamic_cast<GeoVectorPropertyPtr>(pChild); 1144 1145 if(pTypedChild != NullFC) 1146 { 1147 if(pTypedChild == getNormals()) 1148 { 1149 editSField(NormalsFieldMask); 1150 1151 _sfNormals.setValue(NullFC); 1152 1153
