void SlaveControl::SetReference(int i, RefTargetHandle rtarg) { DbgAssert( i >= 0); DbgAssert( i < NumRefs()); if (i==0) sub = (Control*) rtarg; else if (i==1) { if ((rtarg == NULL) && (master)) { //tell the master that I am being removed int ct = blockID.Count(); for (int i = 0; i < ct; i++) RemoveControl(0); } master = (MasterBlockControl*) rtarg; if (master == NULL) masterPresent = FALSE; else masterPresent = TRUE; } else DebugPrint(_T("set reference error occurred\n")); }
RefTargetHandle SlaveControl::GetReference(int i) { DbgAssert( i >= 0); DbgAssert( i < NumRefs()); if (i==0) return (RefTargetHandle) sub; else if (i==1) return (RefTargetHandle) master; else { // DebugPrint(_T("get reference error occurred\n")); return NULL; } }
void Texmaps::RescaleWorldUnits(float f) { if (TestAFlag(A_WORK1)) return; SetAFlag(A_WORK1); // This code will be replaced in particular implementations for (int i=0; i<NumRefs(); i++) { if ( (i&1) ==0) continue; // skip the amount controllers ReferenceMaker *srm = GetReference(i); if (srm) { srm->RescaleWorldUnits(f); } } }
RefTargetHandle mrTwoSidedShader::Clone(RemapDir &remap) { mrTwoSidedShader* pNew = new mrTwoSidedShader(true); int count = NumRefs(); for(int i = 0; i < count; ++i) { ReferenceTarget* refTarg = GetReference(i); pNew->ReplaceReference(i, ((refTarg != NULL) ? remap.CloneRef(refTarg) : NULL)); } pNew->MtlBase::operator=(*this); BaseClone(this, pNew, remap); return pNew; }
// World scaling void EditPatchMod::RescaleWorldUnits(float f) { if (TestAFlag(A_WORK1)) return; SetAFlag(A_WORK1); // rescale all our references for (int i = 0; i < NumRefs(); i++) { ReferenceMaker *srm = GetReference(i); if (srm) srm->RescaleWorldUnits(f); } // Now rescale stuff inside our data structures EPModContextEnumProc proc(f); EnumModContexts(&proc); NotifyDependents(FOREVER, PART_GEOM, REFMSG_CHANGE); }