Changeset 1156

Show
Ignore:
Timestamp:
04/14/08 08:19:04 (1 month ago)
Author:
vossg
Message:

changed: base rebuild child handling merge

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Source/System/Image/WS/OSGImageBase.cpp

    r1127 r1156  
    16821682{ 
    16831683} 
     1684/*-------------------------------------------------------------------------*/ 
     1685/* Parent linking                                                          */ 
     1686 
     1687bool 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 
     1712bool 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 
    16841747 
    16851748void ImageBase::onCreate(const Image *source) 
  • trunk/Source/System/Image/WS/OSGImageBase.h

    r1116 r1156  
    623623    /*! \}                                                                 */ 
    624624    /*---------------------------------------------------------------------*/ 
     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    /*---------------------------------------------------------------------*/ 
    625636    /*! \name                    Generic Field Access                      */ 
    626637    /*! \{                                                                 */ 
  • trunk/Source/System/NodeCores/Drawables/Geometry/Base/ES/OSGGeometryBase.cpp

    r1117 r1156  
    736736} 
    737737 
    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     else 
    774     { 
    775         Inherited::subChildPointer(pObj, usFieldPos); 
    776     } 
    777 } 
    778  
    779  
    780738//! create a new instance of the class 
    781739GeometryTransitPtr GeometryBase::create(void) 
     
    869827GeometryBase::GeometryBase(void) : 
    870828    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), 
    875841    _sfClassicGLId            (Int32(0)), 
    876842    _sfAttGLId                (Int32(0)) 
     
    880846GeometryBase::GeometryBase(const GeometryBase &source) : 
    881847    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), 
    886860    _sfClassicGLId            (source._sfClassicGLId            ), 
    887861    _sfAttGLId                (source._sfAttGLId                ) 
     
    894868GeometryBase::~GeometryBase(void) 
    895869{ 
     870} 
     871 
     872/*-------------------------------------------------------------------------*/ 
     873/* Child linking                                                           */ 
     874 
     875bool 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); 
    896987} 
    897988 
  • trunk/Source/System/NodeCores/Drawables/Geometry/Base/ES/OSGGeometryBase.h

    r1116 r1156  
    224224    /*! \{                                                                 */ 
    225225 
    226     virtual void subChildPointer(FieldContainerPtr pObj,  
    227                                  UInt16            usFieldPos); 
    228  
    229     /*! \}                                                                 */ 
    230     /*---------------------------------------------------------------------*/ 
    231     /*! \name                   Construction                               */ 
    232     /*! \{                                                                 */ 
    233  
    234226    static  GeometryTransitPtr create          (void); 
    235227    static  GeometryPtr        createEmpty     (void); 
     
    293285    void onCreate(const Geometry *source = NULL); 
    294286 
     287    /*! \}                                                                 */ 
     288    /*---------------------------------------------------------------------*/ 
     289    /*! \name Child linking                                                */ 
     290    /*! \{                                                                 */ 
     291     
     292    virtual bool unlinkChild(const FieldContainerPtr pChild, 
     293                             const UInt16            childFieldId); 
     294     
    295295    /*! \}                                                                 */ 
    296296    /*---------------------------------------------------------------------*/ 
  • trunk/Source/System/NodeCores/Drawables/Geometry/Base/WS/OSGGeometryBase.cpp

    r1117 r1156  
    247247    "        category=\"childpointer\"\n" 
    248248    "        childParentType=\"FieldContainer\"\n" 
     249    "        linkParentField=\"Parents\"\n" 
    249250    "\t>\n" 
    250251    "        The types property contains the primitive's types. Legal values are \n" 
     
    260261    "        category=\"childpointer\"\n" 
    261262    "        childParentType=\"FieldContainer\"\n" 
     263    "        linkParentField=\"Parents\"\n" 
    262264    "\t>\n" 
    263265    "        The lengths property contains the number of vertices to use for the \n" 
     
    273275    "        childParentType=\"FieldContainer\"\n" 
    274276    "        checkNilPtr=\"false\"\n" 
     277    "        linkParentField=\"Parents\"\n" 
    275278    "\t>\n" 
    276279    "        The attributes used to render the geometry. The order is based on the \n" 
     
    286289    "        childParentType=\"FieldContainer\"\n" 
    287290    "        checkNilPtr=\"false\"\n" 
     291    "        linkParentField=\"Parents\"\n" 
    288292    "\t>\n" 
    289293    "        The indices property contains the index data. See \\ref \n" 
     
    793797} 
    794798 
    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     else 
    831     { 
    832         Inherited::subChildPointer(pObj, usFieldPos); 
    833     } 
    834 } 
    835  
    836  
    837799//! create a new instance of the class 
    838800GeometryTransitPtr GeometryBase::create(void) 
     
    926888GeometryBase::GeometryBase(void) : 
    927889    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), 
    932902    _sfDlistCache             (bool(true)), 
    933903    _sfClassicGLId            (Int32(0)), 
     
    938908GeometryBase::GeometryBase(const GeometryBase &source) : 
    939909    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), 
    944922    _sfDlistCache             (source._sfDlistCache             ), 
    945923    _sfClassicGLId            (source._sfClassicGLId            ), 
     
    953931GeometryBase::~GeometryBase(void) 
    954932{ 
     933} 
     934 
     935/*-------------------------------------------------------------------------*/ 
     936/* Child linking                                                           */ 
     937 
     938bool 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); 
    9551050} 
    9561051 
  • trunk/Source/System/NodeCores/Drawables/Geometry/Base/WS/OSGGeometryBase.h

    r1116 r1156  
    241241    /*! \{                                                                 */ 
    242242 
    243     virtual void subChildPointer(FieldContainerPtr pObj,  
    244                                  UInt16            usFieldPos); 
    245  
    246     /*! \}                                                                 */ 
    247     /*---------------------------------------------------------------------*/ 
    248     /*! \name                   Construction                               */ 
    249     /*! \{                                                                 */ 
    250  
    251243    static  GeometryTransitPtr create          (void); 
    252244    static  GeometryPtr        createEmpty     (void); 
     
    311303    void onCreate(const Geometry *source = NULL); 
    312304 
     305    /*! \}                                                                 */ 
     306    /*---------------------------------------------------------------------*/ 
     307    /*! \name Child linking                                                */ 
     308    /*! \{                                                                 */ 
     309     
     310    virtual bool unlinkChild(const FieldContainerPtr pChild, 
     311                             const UInt16            childFieldId); 
     312     
    313313    /*! \}                                                                 */ 
    314314    /*---------------------------------------------------------------------*/ 
  • trunk/Source/System/NodeCores/Drawables/Particles/OSGParticlesBase.cpp

    r1117 r1156  
    375375    "        category=\"childpointer\"\n" 
    376376    "        childParentType=\"FieldContainer\"\n" 
     377    "        linkParentField=\"Parents\"\n" 
    377378    "\t>\n" 
    378379    "        The positions of the particles. This is the primary defining\n" 
     
    400401    "        category=\"childpointer\"\n" 
    401402    "        childParentType=\"FieldContainer\"\n" 
     403    "        linkParentField=\"Parents\"\n" 
    402404    "\t>\n" 
    403405    "        The secondary position of the particle. This information is only used\n" 
     
    413415    "        category=\"childpointer\"\n" 
    414416    "        childParentType=\"FieldContainer\"\n" 
     417    "        linkParentField=\"Parents\"\n" 
    415418    "\t>\n" 
    416419    "\tThe particle colors (optional).\n" 
     
    424427    "        category=\"childpointer\"\n" 
    425428    "        childParentType=\"FieldContainer\"\n" 
     429    "        linkParentField=\"Parents\"\n" 
    426430    "\t>\n" 
    427431    "        Most particles will be automatically aligned to the view\n" 
     
    904908} 
    905909 
    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     else 
    946     { 
    947         Inherited::subChildPointer(pObj, usFieldPos); 
    948     } 
    949 } 
    950  
    951  
    952910//! create a new instance of the class 
    953911ParticlesTransitPtr ParticlesBase::create(void) 
     
    10421000    Inherited(), 
    10431001    _sfMode                   (UInt32(2)), 
    1044     _sfPositions              (this, PositionsFieldId), 
     1002    _sfPositions              (this,  
     1003                          PositionsFieldId, 
     1004                          GeoVectorProperty::ParentsFieldId), 
    10451005    _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), 
    10491015    _mfIndices                (), 
    10501016    _mfTextureZs              (), 
     
    10601026    Inherited(source), 
    10611027    _sfMode                   (source._sfMode                   ), 
    1062     _sfPositions              (this, PositionsFieldId), 
     1028    _sfPositions              (this,  
     1029                          PositionsFieldId, 
     1030                          GeoVectorProperty::ParentsFieldId), 
    10631031    _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), 
    10671041    _mfIndices                (source._mfIndices                ), 
    10681042    _mfTextureZs              (source._mfTextureZs              ), 
     
    10801054ParticlesBase::~ParticlesBase(void) 
    10811055{ 
     1056} 
     1057 
     1058/*-------------------------------------------------------------------------*/ 
     1059/* Child linking                                                           */ 
     1060 
     1061bool 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