Show
Ignore:
Timestamp:
04/02/08 14:18:07 (8 months ago)
Author:
cneumann
Message:

replaced pointer field implementation
split FieldContainer/Fields? directory into Base and Handle subdir

Status: - ref counting seems to work (mt, cluster)

  • new OSB loader works (well, the unittest does)
  • VRML loader is deactivated
  • get/edit handle for dynamic (pointer) fields missing
  • need to remove some more old files - they get moved in this commit
  • generated (i.e. base) code in following commit
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/Carsten_PtrWork2/Source/System/FieldContainer/Base/OSGAttachmentContainer.cpp

    r1070 r1072  
    6767        "Attachments attached to this container.", 
    6868        OSG_RC_FIELD_DESC(AttachmentContainer::Attachments), 
    69         FieldContainerAttachment::ParentsFieldId, 
    7069        false, 
    7170        Field::MFDefaultFlags, 
     
    108107    _mfAttachmentBindings() 
    109108{ 
    110     _mfAttachments.setEnclosingFC(this); 
    111     _mfAttachments.setFieldDescription( 
    112         dynamic_cast<AttachmentsFieldType::Description *>( 
    113             getClassType().getFieldDesc(AttachmentsFieldId))); 
     109    _mfAttachments.setEnclosingObject(this); 
     110    _mfAttachments.setChildFieldId   (AttachmentsFieldId); 
     111    _mfAttachments.setParentFieldId  (MFFieldContainerAttachmentChildPtr::ObjectType::ParentsFieldId); 
    114112} 
    115113 
     
    119117    _mfAttachmentBindings(      ) 
    120118{ 
    121     _mfAttachments.setEnclosingFC(this); 
    122     _mfAttachments.setFieldDescription( 
    123         dynamic_cast<AttachmentsFieldType::Description *>( 
    124             getClassType().getFieldDesc(AttachmentsFieldId))); 
     119    _mfAttachments.setEnclosingObject(this); 
     120    _mfAttachments.setChildFieldId   (AttachmentsFieldId); 
     121    _mfAttachments.setParentFieldId  (MFFieldContainerAttachmentChildPtr::ObjectType::ParentsFieldId); 
    125122} 
    126123 
     
    349346{ 
    350347    return _mfAttachmentBindings; 
     348} 
     349 
     350/*-------------------------------------------------------------------------*/ 
     351/*  Child Linking                                                          */ 
     352 
     353bool 
     354    AttachmentContainer::unlinkChild( 
     355        FieldContainerPtrConst pChild, 
     356        UInt16 const           childFieldId) 
     357{ 
     358    if(childFieldId == AttachmentsFieldId) 
     359    { 
     360        FieldContainerAttachmentPtr pTypedChild = 
     361            dynamic_cast< FieldContainerAttachmentPtr >(pChild); 
     362             
     363        if(pTypedChild != NullFC) 
     364        { 
     365            Int32 index = _mfAttachments.findIndex(pTypedChild); 
     366                             
     367            if(index != -1) 
     368            { 
     369                subAttachment(pTypedChild); 
     370                 
     371                return true; 
     372            } 
     373             
     374            FWARNING(("AttachmentContainer::unlinkParent: Child <-> Parent link inconsistent.\n")); 
     375             
     376            return false; 
     377        } 
     378         
     379        return false; 
     380    } 
     381         
     382    return Inherited::unlinkChild(pChild, childFieldId); 
    351383} 
    352384