void Wood::Reset() { woodCD.Reset(this, TRUE); // reset pb2 params DeleteReference(2); DeleteReference(3); Init(); }
void CellTex::Reset(){ cellTexCD.Reset(this, TRUE); // reset all pb2's DeleteReference(3); DeleteReference(4); DeleteReference(5); Init(); }
void Water::Reset() { waterCD.Reset(this, TRUE); // reset all pb2's // Delete the references to the two sub-texture maps DeleteReference(2); DeleteReference(3); Init(); }
void Speckle::Reset() { speckleCD.Reset(this, TRUE); // reset all pb2's // Delete the references to the two sub-texture maps DeleteReference(2); DeleteReference(3); Init(); }
void Gradient::Reset() { gradCD.Reset(this, TRUE); // reset all pb2's Init(); DeleteReference(MAP1_REF); DeleteReference(MAP2_REF); DeleteReference(MAP3_REF); }
void M3Mat::Reset() { // char s[25]; DeleteReference(101); for(int i=0;i<100;i++) { DeleteReference(i); mTex[i] = NULL; // ReplaceReference(i,NewDefaultStdMat()); // sprintf(s,GetString(IDS_MTL_CNAME),i+1); // mTex[i]->SetName(s); } ReplaceReference(100,NewDefaultStdMat()); mTex[100]->SetName(GetString(IDS_MTL_BASE)); ParamBlockDescID *descVer = new ParamBlockDescID[101]; for(int x=0;x<100;x++){ ParamBlockDescID add; add.type=TYPE_FLOAT; add.user=NULL; add.animatable=TRUE; add.id=x; descVer[x] = add; } ParamBlockDescID add; add.type=TYPE_INT; add.user=NULL; add.animatable=FALSE; add.id=x; descVer[x] = add; // x == 100 we guess? IParamBlock *pblockMat = (IParamBlock*)CreateParameterBlock(descVer,101,1); ReplaceReference(101,pblockMat); //ReplaceReference(102,NULL); delete [] descVer; pblockMat->SetValue(100,0,0); // set param [100], the mystery param }
//TapeHelpCreationManager::~TapeHelpCreationManager void TapeHelpCreationManager::End() { if ( tapeObject ) { tapeObject->ClearAFlag(A_OBJ_LONG_CREATE); #ifndef NO_CREATE_TASK // russom - 12/04/01 tapeObject->EndEditParams( (IObjParam*)createInterface, END_EDIT_REMOVEUI, NULL); #endif if ( !attachedToNode ) { // RB 4-9-96: Normally the hold isn't holding when this // happens, but it can be in certain situations (like a track view paste) // Things get confused if it ends up with undo... theHold.Suspend(); tapeObject->DeleteAllRefsFromMe(); tapeObject->DeleteAllRefsToMe(); tapeObject->DeleteThis(); tapeObject = NULL; theHold.Resume(); // RB 7/28/97: If something has been put on the undo stack since this object was created, we have to flush the undo stack. if (theHold.GetGlobalPutCount()!=lastPutCount) { GetSystemSetting(SYSSET_CLEAR_UNDO); } macroRec->Cancel(); } else if ( tapeNode ) { // Get rid of the reference. DeleteReference(0); // sets tapeNode = NULL } } }
//From MtlBase void VDM::Reset() { // Nuke the VDM sub-map DeleteReference( 1 ); Init(); ivalid.SetEmpty(); }
int BlockControl::DeleteControl(int Index) { if ((Index < 0) || (Index >= controls.Count())) return 0; //notify all back pointer that there block is about to be deleted DeleteReference(Index); controls.Delete(Index,1); if (tempControls[Index] != NULL) { HoldSuspend hs; RefResult res = tempControls[Index]->MaybeAutoDelete(); DbgAssert(REF_SUCCEED == res); } tempControls.Delete(Index,1); names.Delete(Index,1); for (int i = 0;i <backPointers.Count();i++) { // lock at the blockid table // int subCount = Blocks[whichBlock]->backPointers[i]->blockID.Count(); for (int j=0; j< backPointers[i]->blockID.Count(); j++) { if (backPointers[i]->subID[j] == Index) { backPointers[i]->blockID.Delete(j,1); backPointers[i]->subID.Delete(j,1); j--; } else if (backPointers[i]->subID[j] > Index) { backPointers[i]->subID[j] -= 1; } } } backPointers.Delete(Index,1); for (int i = 0;i < externalBackPointers.Count();i++) { for (int j=0; j< externalBackPointers[i]->blockID.Count(); j++) { if (externalBackPointers[i]->subID[j] == Index) { externalBackPointers[i]->blockID.Delete(j,1); externalBackPointers[i]->subID.Delete(j,1); j--; } else if (externalBackPointers[i]->subID[j] > Index) { externalBackPointers[i]->subID[j] -= 1; } } } NotifyDependents(FOREVER,0,REFMSG_CHANGE); NotifyDependents(FOREVER,0,REFMSG_SUBANIM_STRUCTURE_CHANGED); return 1; }
// Exported function that let someone remove a reference. BOOL NotifyMgr::RemoveReference() { if (ref0) { DeleteReference(0); ref0 = NULL; } return TRUE; }
//LACamCreationManager::~LACamCreationManager void CreateSWrapObjectProc::End() { if ( SWrapObj ) { #ifdef _OSNAP SWrapObj->ClearAFlag(A_OBJ_LONG_CREATE); #endif #ifndef NO_CREATE_TASK // russom - 12/04/01 SWrapObj->EndEditParams( (IObjParam*)createInterface, END_EDIT_REMOVEUI, NULL); #endif if ( !attachedToNode ) { // RB 4-9-96: Normally the hold isn't holding when this // happens, but it can be in certain situations (like a track view paste) // Things get confused if it ends up with undo... theHold.Suspend(); delete SWrapObj; SWrapObj = NULL; theHold.Resume(); if (theHold.GetGlobalPutCount()!=lastPutCount) GetSystemSetting(SYSSET_CLEAR_UNDO); } else if ( SWrapNode ) { // Get rid of the reference. theHold.Suspend(); DeleteReference(0); // sets camNode = NULL theHold.Resume(); } } }
void Mask::Reset() { for (int i=0; i<NSUBTEX; i++) { DeleteReference(i); // get rid of maps mapOn[i] = 1; } maskCD.Reset(this, TRUE); // reset all pb2's Init(); }
void NotifyMgr::RemoveAllReferences() { for(int i=0;i<mpReferences.Count();++i) { DeleteReference(i); mpReferences[i] = NULL; } mpReferences.ZeroCount(); }
// Exported function that let someone remove a reference. BOOL NotifyMgr::RemoveReference(int i) { if(i>=0&&i<mpReferences.Count()) { DeleteReference(i); mpReferences[i] = NULL; } return TRUE; }
int BlockControl::DeleteControl(int Index) { //names.Delete(1,whichBlock); if ((Index < 0) || (Index >= controls.Count())) return 0; //notify all back pointer that there block is about to be deleted DeleteReference(Index); controls.Delete(Index,1); tempControls.Delete(Index,1); names.Delete(Index,1); for (int i = 0;i <backPointers.Count();i++) { //lock at the bockid table // int subCount = Blocks[whichBlock]->backPointers[i]->blockID.Count(); for (int j=0; j< backPointers[i]->blockID.Count(); j++) { if (backPointers[i]->subID[j] == Index) { backPointers[i]->blockID.Delete(j,1); backPointers[i]->subID.Delete(j,1); j--; } else if (backPointers[i]->subID[j] > Index) { backPointers[i]->subID[j] -= 1; } } } backPointers.Delete(Index,1); for (i = 0;i < externalBackPointers.Count();i++) { for (int j=0; j< externalBackPointers[i]->blockID.Count(); j++) { if (externalBackPointers[i]->subID[j] == Index) { externalBackPointers[i]->blockID.Delete(j,1); externalBackPointers[i]->subID.Delete(j,1); j--; } else if (externalBackPointers[i]->subID[j] > Index) { externalBackPointers[i]->subID[j] -= 1; } } } NotifyDependents(FOREVER,0,REFMSG_CHANGE); NotifyDependents(FOREVER,0,REFMSG_SUBANIM_STRUCTURE_CHANGED); return 1; }
void StressTexmap::Reset() { ivalid.SetEmpty(); for (int i=0; i<NSUBTEX; i++) { DeleteReference(i); mapOn[i] = 1; } SkelTexmapCD.MakeAutoParamBlocks(this); // make and intialize paramblock2 }
bool PFOperatorMaterialStatic::SetMaterial(Mtl* mtl) { if (mtl == NULL) { return DeleteReference(kMaterialStatic_reference_material) == REF_SUCCEED; } else { if (material()) return ReplaceReference(kMaterialStatic_reference_material, mtl) == REF_SUCCEED; else return MakeRefByID(FOREVER, kMaterialStatic_reference_material, mtl) == REF_SUCCEED; } }
//From MtlBase void BerconWood::Reset() { TimeValue t = GetCOREInterface()->GetTime(); if (texout) texout->Reset(); else ReplaceReference( OUTPUT_REF, GetNewDefaultTextureOutput()); if (curve) curve->DeleteMe(); curve = (ICurveCtl *) CreateInstance(REF_MAKER_CLASS_ID,CURVE_CONTROL_CLASS_ID); curve->RegisterResourceMaker(static_cast<ReferenceMaker*>(this)); CurveCtrl::init(curve); pbCurve->SetValue(enable_curve, t, FALSE); for (int i=0; i<NSUBTEX; i++) { DeleteReference(i+2); } pblock->SetValue( noise_color1, t, Color(0.768f, 0.568f, 0.25f) ); pblock->SetValue( noise_color2, t, Color(0.392f , 0.243f, 0.0f) ); pblock->SetValue( noise_color3, t, Color(0.549f, 0.337f, 0.0f) ); pblock->SetValue( noise_map1_on, t, TRUE ); pblock->SetValue( noise_map2_on, t, TRUE ); pblock->SetValue( noise_map3_on, t, TRUE ); pblock->SetValue( distortion_str, t, .1f ); pblock->SetValue( use_distortion, t, FALSE ); pblock->SetValue( grain_amount, t, .2f ); pblock->SetValue( grain_freq, t, 5.f ); pblock->SetValue( lock_grain, t, FALSE ); pblock->SetValue( wood_size, t, 3.f ); pblock->SetValue( wood_type, t, 0 ); pblock->SetValue( trunk_str, t, 1.f ); pblock->SetValue( trunk_freq, t, .04f ); pblock->SetValue( radial_str, t, .25f ); pblock->SetValue( radial_freq, t, .1f ); pblock->SetValue( radial_z, t, .01f ); pblock->SetValue( angle_str, t, .1f ); pblock->SetValue( angle_freq, t, 1.f ); pblock->SetValue( angle_rad, t, 15.f ); pblock->SetValue( width_var, t, .5f ); pblock->SetValue( gain_var, t, .75f ); pblock->SetValue( low_tresh, t, .3f ); pblock->SetValue( high_tresh, t, 1.f ); pblock->SetValue( wood_skew, t, .75f ); pblock->SetValue( rand_seed, t, 12.345f ); pblock->SetValue( pb_samples, t, 4 ); // Maps for (int i=16; i<32; i++) pbMap->SetValue(i, t, TRUE); berconXYZ.reset(pbXYZ, ivalid, 2, 0, 0, 0); ivalid.SetEmpty(); }
/*virtual*/ void Texture::SetImage(const Image& image) { if(!image.IsValid()) { return; } DeleteReference(m_identifier); glGenTextures(1, &m_identifier); glBindTexture(GL_TEXTURE_2D, m_identifier); glTexImage2D(GL_TEXTURE_2D, 0, 3, image.GetWidth(), image.GetHeight(), 0, ((image.GetBPP() == 24)?GL_RGB:GL_RGBA), GL_UNSIGNED_BYTE, image.GetPixels()); AddReference(m_identifier); }
//From MtlBase void BerconNoise::Reset() { TimeValue t = GetCOREInterface()->GetTime(); if (texout) texout->Reset(); else ReplaceReference( OUTPUT_REF, GetNewDefaultTextureOutput()); if (curve) curve->DeleteMe(); curve = (ICurveCtl *) CreateInstance(REF_MAKER_CLASS_ID,CURVE_CONTROL_CLASS_ID); curve->RegisterResourceMaker(static_cast<ReferenceMaker*>(this)); CurveCtrl::init(curve); pbCurve->SetValue(enable_curve, t, FALSE); for (int i=0; i<NOISE_NSUBTEX; i++) DeleteReference(i+2); pblock->SetValue( noise_color1, t, Color(0.f, 0.f, 0.f)); pblock->SetValue( noise_color2, t, Color(1.f, 1.f, 1.f)); pblock->SetValue( noise_map1_on, t, TRUE); pblock->SetValue( noise_map2_on, t, TRUE); pblock->SetValue( distortion_str, t, .1f); pblock->SetValue( use_distortion, t, FALSE); pblock->SetValue( uvw_dist, t, 0); pblock->SetValue( noise_function_type, t, 1); pblock->SetValue( fractal_type, t, 0); pblock->SetValue( worley_distance, t, 0); pblock->SetValue( noise_lowthresh, t, 0.f); pblock->SetValue( noise_hithresh, t, 1.f); pblock->SetValue( worley_spread, t, 3.f); pblock->SetValue( worley_F1, t, 1.f); pblock->SetValue( worley_F2, t, 0.f); pblock->SetValue( worley_F3, t, 0.f); pblock->SetValue( worley_F4, t, 0.f); pblock->SetValue( noise_phase, t, 0.f); pblock->SetValue( noise_size, t, 25.f); pblock->SetValue( fractal_gain, t, 5.f); pblock->SetValue( fractal_offset, t, 0.f); pblock->SetValue( fractal_h, t, .5f); pblock->SetValue( fractal_lacunarity, t, 2.f); pblock->SetValue( fractal_levels, t, 3.f); // Maps for (int i=14; i<28; i++) pbMap->SetValue(i, t, TRUE); berconXYZ.reset(pbXYZ, ivalid, 2, 0, 0, 0); ivalid.SetEmpty(); }
void SceneState::List_PostRenderObject_TrackRef_Type::OnRefDeleted(IRefObject* rm) { if(DeleteReference(rm) == REF_SUCCEED && !empty()) { SceneState::List_PostRenderObject_Type::iterator itCurCP, itEndCP = end(); for( itCurCP = begin(); itCurCP != itEndCP; ++ itCurCP ) { IRefObject* pObj = (IRefObject*)((*itCurCP).m_pRenderObject); if( pObj == rm ) { // clear it, instead of delete it. (*itCurCP).m_pRenderObject = NULL; } } } }
SceneManager::~SceneManager(void) { if(_renderWindow != NULL && _renderWindow->IsOpened()) _renderWindow->Close(); DeleteReference(_sceneImageSprite); DeleteReference(_eventListener); DeleteReference(_environementProvider); DeleteReference(_renderWindow); DeleteReference(_dashboard); DeleteReference(_sceneView); }
RefResult CreateSWrapObjectProc::NotifyRefChanged( Interval changeInt, RefTargetHandle hTarget, PartID& partID, RefMessage message) { switch (message) { case REFMSG_PRENOTIFY_PASTE: case REFMSG_TARGET_SELECTIONCHANGE: if ( ignoreSelectionChange ) { break; } if ( SWrapObj && SWrapNode==hTarget ) { // this will set camNode== NULL; theHold.Suspend(); DeleteReference(0); theHold.Resume(); goto endEdit; } // fall through case REFMSG_TARGET_DELETED: if (SWrapObj && SWrapNode==hTarget ) { endEdit: if (createInterface->GetCommandMode()->ID() == CID_STDPICK) { if (SWrapObj->creating) { theCreateSWrapObjectMode.JumpStart(SWrapObj->ip,SWrapObj); createInterface->SetCommandMode(&theCreateSWrapObjectMode); } else {createInterface->SetStdCommandMode(CID_OBJMOVE);} } #ifdef _OSNAP SWrapObj->ClearAFlag(A_OBJ_LONG_CREATE); #endif SWrapObj->EndEditParams( (IObjParam*)createInterface, 0, NULL); SWrapObj = NULL; SWrapNode = NULL; CreateNewObject(); attachedToNode = FALSE; } break; } return REF_SUCCEED; }
RefResult TapeHelpCreationManager::NotifyRefChanged( const Interval& changeInt, RefTargetHandle hTarget, PartID& partID, RefMessage message, BOOL propagate) { switch (message) { case REFMSG_PRENOTIFY_PASTE: case REFMSG_TARGET_SELECTIONCHANGE: if ( ignoreSelectionChange ) { break; } if ( tapeObject && tapeNode==hTarget ) { // this will set tapeNode== NULL; DeleteReference(0); goto endEdit; } // fall through case REFMSG_TARGET_DELETED: if ( tapeObject && tapeNode==hTarget ) { endEdit: tapeObject->EndEditParams( (IObjParam*)createInterface, 0, NULL); tapeObject = NULL; tapeNode = NULL; CreateNewObject(); attachedToNode = FALSE; } else if (targNode==hTarget) { targNode = NULL; targObject = NULL; } break; } return REF_SUCCEED; }
void Smoke::Reset() { smokeCD.Reset(this, TRUE); // reset all pb2's DeleteReference(2); DeleteReference(3); Init(); }
RefResult StdDualVSImp::NotifyRefChanged(const Interval& changeInt, RefTargetHandle hTarget, PartID& partID, RefMessage message, BOOL propagate) { switch (message) { case REFMSG_TARGET_DELETED: { int i = FindNodeIndex((INode*)hTarget); assert(i >= 0); callb->DeleteRenderMeshCache(caches[i]->GetNode()); delete caches[i]; caches[i] = NULL; // NH 07|11|02 The cache is no longer dynamic - it will only grow but not shrink, // so there could be null entries. This was causing a problem in SetReference // caches.Delete(i,1); // caches.Shrink(); } break; case REFMSG_NODE_MATERIAL_CHANGED: { int i = FindNodeIndex((INode*)hTarget); assert(i >= 0); DeleteReference(i); } break; case REFMSG_NODE_WSCACHE_UPDATED: { int i = FindNodeIndex((INode*)hTarget); //NH:06|11|02 I removed this, as in an undo situation the node reference may not be restored yet // as the viewport shader has not been initialised and thus not set the node. In this case -1 is valid // assert(i >= 0); if(i >= 0) caches[i]->SetValid(false); } break; case REFMSG_SUBANIM_STRUCTURE_CHANGED: case REFMSG_REF_DELETED: { BOOL del = TRUE; int i = FindNodeIndex((INode*)hTarget); INode * n = (INode*)hTarget; Mtl * m = n->GetMtl(); if(m) { // NH|06|11|02 check for the Viewport Manager - if the Effect is the same as the callback then keep it ICustAttribContainer *cont = m->GetCustAttribContainer(); if (cont && cont->GetNumCustAttribs()) { IDXShaderManagerInterface *sm = GetDXShaderManager(); if (!sm) { break; } for (int kk = 0; kk < cont->GetNumCustAttribs(); kk++) { CustAttrib *ca = cont->GetCustAttrib(kk); IViewportShaderManager *manager = (IViewportShaderManager*)ca->GetInterface(VIEWPORT_SHADER_MANAGER_INTERFACE); if (manager) { ReferenceTarget *rt = manager->GetActiveEffect(); if(rt == callb->GetRefTarg()) del = FALSE; } } } } // Check, if there's still a reference path from the node to the MtlBase if(!DependsOn(hTarget,callb->GetRefTarg()) && del) { DeleteReference(i); } forceInvalid = true; } } return REF_SUCCEED; }
void Noise::Reset() { noiseCD.Reset(this, TRUE); // reset all pb2's Init(); for (int i=0; i<NSUBTEX; i++) DeleteReference(i+2); }
void Output::Reset() { DeleteReference(0); // get rid of map Init(); maskCD.Reset(this, TRUE); // reset all pb2's }
//From MtlBase void BerconTile::Reset() { TimeValue t = GetCOREInterface()->GetTime(); if (texout) texout->Reset(); else ReplaceReference( OUTPUT_REF, GetNewDefaultTextureOutput()); for (int i=0; i<TILE_NSUBTEX; i++) DeleteReference(i+2); pblock->SetValue( noise_color1, t, Color(1.f, 1.f, 1.f)); pblock->SetValue( noise_color2, t, Color(0.f, 0.f, 0.f)); pblock->SetValue( noise_color3, t, Color(.5f, .5f, .5f)); pblock->SetValue( noise_map1_on, t, TRUE); pblock->SetValue( noise_map2_on, t, TRUE); pblock->SetValue( noise_map2_on, t, TRUE); pblock->SetValue( distortion_str, t, .1f); pblock->SetValue( use_distortion, t, FALSE); pblock->SetValue( lock_edge, t, TRUE); pblock->SetValue( tile_style, t, 3); pblock->SetValue( tile_size, t, 1.0f); pblock->SetValue( tile_width, t, 4.f); pblock->SetValue( tile_height, t, 2.f); pblock->SetValue( edge_width, t, .1f); pblock->SetValue( edge_height, t, .1f); pblock->SetValue( tile_width2, t, 0.f); pblock->SetValue( tile_height2, t, 0.f); pblock->SetValue( edge_width2, t, 0.f); pblock->SetValue( edge_height2, t, 0.f); pblock->SetValue( soften, t, 2); pblock->SetValue( soften_rad, t, .1f); pblock->SetValue( pb_round, t, TRUE); pblock->SetValue( round_rad, t, .1f); pblock->SetValue( pb_map_uv, t, FALSE); pblock->SetValue( pb_uv_channel, t, 1); pblock->SetValue( pb_auto, t, 2); pblock->SetValue( pb_randX, t, 0.f); pblock->SetValue( pb_randY, t, 0.f); pblock->SetValue( pb_randSX, t, 0.f); pblock->SetValue( pb_randSY, t, 0.f); pblock->SetValue( pb_lock, t, 1); pblock->SetValue( pb_rotUV, t, 0); pblock->SetValue( pb_randRot, t, 180.f); pblock->SetValue( pb_center, t, 0); pblock->SetValue( pb_center_channel, t, 2); pblock->SetValue( pb_flipX, t, 1); pblock->SetValue( pb_flipY, t, 1); pblock->SetValue( pb_randZ, t, 1); pblock->SetValue(pb_pattern, t, L"0,1,1/.5,.5,1"); // Maps for (int i=2; i<4; i++) pbMap->SetValue(i, t, TRUE); berconXYZ.reset(pbXYZ, ivalid, 1, 0, 0, 0); ivalid.SetEmpty(); }
int TapeHelpCreationManager::proc( HWND hwnd, int msg, int point, int flag, IPoint2 m ) { int res = TRUE; TSTR targName; ViewExp& vpx = createInterface->GetViewExp(hwnd); assert( vpx.IsAlive() ); DWORD hideflags; switch ( msg ) { case MOUSE_POINT: switch ( point ) { case 0: { pt0 = m; assert( tapeObject ); if ( createInterface->SetActiveViewport(hwnd) ) { return FALSE; } if (createInterface->IsCPEdgeOnInView()) { res = FALSE; goto done; } // if helpers were hidden by category, re-display them hideflags = GetCOREInterface()->GetHideByCategoryFlags(); if(hideflags & (HIDE_HELPERS)) { hideflags = hideflags & ~(HIDE_HELPERS); GetCOREInterface()->SetHideByCategoryFlags(hideflags); hideflags = GetCOREInterface()->GetHideByCategoryFlags(); } if ( attachedToNode ) { // send this one on its way tapeObject->EndEditParams( (IObjParam*)createInterface, 0, NULL); macroRec->EmitScript(); // Get rid of the reference. if (tapeNode) DeleteReference(0); // new object CreateNewObject(); // creates tapeObject } needToss = theHold.GetGlobalPutCount()!=lastPutCount; theHold.Begin(); // begin hold for undo mat.IdentityMatrix(); // link it up INode *l_tapeNode = createInterface->CreateObjectNode( tapeObject); attachedToNode = TRUE; assert( l_tapeNode ); createCB = tapeObject->GetCreateMouseCallBack(); createInterface->SelectNode( l_tapeNode ); // Create target object and node targObject = (Object*) createInterface->CreateInstance(GEOMOBJECT_CLASS_ID,Class_ID(TARGET_CLASS_ID,0)); targObject->SetAFlag(A_OBJ_LONG_CREATE); assert(targObject); targNode = createInterface->CreateObjectNode( targObject); assert(targNode); targName = l_tapeNode->GetName(); targName += GetString(IDS_DB_DOT_TARGET); macroRec->Disable(); targNode->SetName(targName); macroRec->Enable(); // hook up camera to target using lookat controller. createInterface->BindToTarget(l_tapeNode,targNode); // Reference the new node so we'll get notifications. theHold.Suspend(); ReplaceReference( 0, l_tapeNode); theHold.Resume(); // Position camera and target at first point then drag. mat.IdentityMatrix(); //mat[3] = vpx.GetPointOnCP(m); #ifdef _3D_CREATE mat.SetTrans( vpx.SnapPoint(m,m,NULL,SNAP_IN_3D) ); #else mat.SetTrans(vpx.SnapPoint(m,m,NULL,SNAP_IN_PLANE)); #endif createInterface->SetNodeTMRelConstPlane(tapeNode, mat); createInterface->SetNodeTMRelConstPlane(targNode, mat); tapeObject->Enable(1); ignoreSelectionChange = TRUE; createInterface->SelectNode( targNode,0); ignoreSelectionChange = FALSE; res = TRUE; } break; case 1: if (Length(m-pt0)<2) goto abort; //mat[3] = vpx.GetPointOnCP(m); #ifdef _3D_CREATE mat.SetTrans( vpx.SnapPoint(m,m,NULL,SNAP_IN_3D) ); #else mat.SetTrans(vpx.SnapPoint(m,m,NULL,SNAP_IN_PLANE)); #endif macroRec->Disable(); createInterface->SetNodeTMRelConstPlane(targNode, mat); macroRec->Enable(); ignoreSelectionChange = TRUE; createInterface->SelectNode( tapeNode); ignoreSelectionChange = FALSE; createInterface->RedrawViews(createInterface->GetTime()); theHold.Accept(IDS_DS_CREATE); targObject->ClearAFlag(A_OBJ_LONG_CREATE); res = FALSE; // We're done break; } break; case MOUSE_MOVE: //mat[3] = vpx.GetPointOnCP(m); #ifdef _3D_CREATE mat.SetTrans( vpx.SnapPoint(m,m,NULL,SNAP_IN_3D) ); #else mat.SetTrans(vpx.SnapPoint(m,m,NULL,SNAP_IN_PLANE)); #endif macroRec->Disable(); createInterface->SetNodeTMRelConstPlane(targNode, mat); macroRec->Enable(); createInterface->RedrawViews(createInterface->GetTime()); macroRec->SetProperty(tapeObject, _T("target"), // JBW 4/23/99 mr_create, Class_ID(TARGET_CLASS_ID, 0), GEOMOBJECT_CLASS_ID, 1, _T("transform"), mr_matrix3, &mat); res = TRUE; break; case MOUSE_FREEMOVE: SetCursor(LoadCursor(hInstance, MAKEINTRESOURCE(IDC_CROSS_HAIR))); #ifdef _OSNAP //Snap Preview #ifdef _3D_CREATE vpx.SnapPreview(m,m,NULL, SNAP_IN_3D); #else vpx.SnapPreview(m,m,NULL, SNAP_IN_PLANE); #endif #endif break; case MOUSE_PROPCLICK: // right click while between creations createInterface->RemoveMode(NULL); break; case MOUSE_ABORT: abort: assert( tapeObject ); tapeObject->EndEditParams( (IObjParam*)createInterface,0,NULL); macroRec->Cancel(); theHold.Cancel(); // deletes both the camera and target. // Toss the undo stack if param changes have been made if (needToss) GetSystemSetting(SYSSET_CLEAR_UNDO); tapeNode = NULL; targNode = NULL; createInterface->RedrawViews(createInterface->GetTime()); CreateNewObject(); attachedToNode = FALSE; res = FALSE; } done: return res; }