1 / 4

Cloning NiObject

Cloning NiObject. NiObject* NiObject::Clone() { NiCloningProcess kCloning; NiObject* pClone = CreateClone(kCloning); ProcessClone(kCloning); return pClone; }. NiObject* NiObject::Clone(NiCloningProcess& kCloning) { NiObject* pClone = CreateClone(kCloning);

tejana
Download Presentation

Cloning NiObject

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CloningNiObject NiObject* NiObject::Clone() { NiCloningProcess kCloning; NiObject* pClone = CreateClone(kCloning); ProcessClone(kCloning); return pClone; } NiObject* NiObject::Clone(NiCloningProcess& kCloning) { NiObject* pClone = CreateClone(kCloning); ProcessClone(kCloning); return pClone; }

  2. Cloning (cont.)NiObject void NiObject::CopyMembers(NiObject* pDest, NiCloningProcess& kCloning) { kCloning.m_pkCloneMap->SetAt(this, pDest); } NiObject* NiObject::CreateSharedClone(NiCloningProcess& kCloning) { NiObject* pkClone; if (kCloning.m_pkCloneMap->GetAt(this, pkClone)) return pkClone; else return CreateClone(kCloning); }

  3. Cloning (cont.)NiAVObject • NiCloningProcess가 필요한 이유 • Property를 다수의 NiAVObject가 공유할 수 있기 때문 void NiAVObject::CloneProperties(NiAVObject* pkDest, NiPropertyList* pkList, NiCloningProcess& kCloning) { NiTListIterator kPos = pkList->GetTailPos(); while (kPos) { NiProperty* pkProperty = pkList->GetPrev(kPos); pkDest->AttachProperty((NiProperty*)pkProperty->CreateSharedClone( kCloning)); } }

  4. Clone (cont.)NiNode void NiNode::ProcessClone( NiCloningProcess& kCloning) { NiAVObject::ProcessClone(kCloning); NiObject* pkClone; bool bCloned = kCloning.m_pkCloneMap->GetAt(this, pkClone); NiNode* pkNode = (NiNode*) pkClone; const NiDynamicEffectList *pkList = &GetEffectList(); if (!pkList->IsEmpty()) pkNode->CopyEffectListClones(pkList, kCloning); … }

More Related