bool OrientConstRotation::SvCanDetachRel(IGraphObjectManager *gom, IGraphNode *gNodeTarget, int id, IGraphNode *gNodeMaker) { if(GetLocked()==false) return true; else return false; }
//! Updates the camera in a RTS fashion. void CameraRTS::Update(Input* pInput, float dt) { if(GetLocked()) return; XMFLOAT3 mousePos = pInput->MousePosition(); // Temp [NOTE] //if(pInput->KeyDown(VK_MBUTTON)) { int scrollBarSize = 5.0f; if(mousePos.x < scrollBarSize || mousePos.x > 65000) // [NOTE] For some reason mousePos.x can be 65 534 when outside the window. Move(XMFLOAT3(0, 0, 1) * GetMovementSpeed()); else if(mousePos.x > GlobalApp::GetClientWidth() - scrollBarSize) Move(XMFLOAT3(0, 0, -1) * GetMovementSpeed()); if(mousePos.y < scrollBarSize) Move(XMFLOAT3(1, 0, 0) * GetMovementSpeed()); else if(mousePos.y > GlobalApp::GetClientHeight() - scrollBarSize) Move(XMFLOAT3(-1, 0, 0) * GetMovementSpeed()); Move(GetDirection() * pInput->MouseDz() * 0.10f); // Update the view matrix. UpdateViewMatrix(); //} }
void OrientConstRotation::Copy(Control *from) { if(GetLocked()==false) { Quat fvalRot; if (from->ClassID()==ClassID()) { OrientConstRotation *ctrl = (OrientConstRotation*)from; // a copy will construct its own pblock to keep the pblock-to-owner 1-to-1. ReplaceReference(ORIENT_ROT_PBLOCK_REF, CloneRefHierarchy(ctrl->pblock)); curRot = ctrl->curRot; baseRotQuatLocal = ctrl->baseRotQuatLocal; baseRotQuatWorld = ctrl->baseRotQuatWorld; flags = ctrl->flags; mLocked = ctrl->mLocked; } else { if(from&&GetLockedTrackInterface(from)) mLocked = GetLockedTrackInterface(from)->GetLocked(); from->GetValue(GetCOREInterface()->GetTime(), &fvalRot, Interval(0, 0)); // to know the object orientation before the firstTimeFlag = 1; baseRotQuatLocal = fvalRot; baseRotQuatLocal.Normalize(); // current controller was active } ivalid.SetEmpty(); NotifyDependents(FOREVER,PART_ALL,REFMSG_CHANGE); } }
void BaseLimitCtrl::CloneSelectedKeys(BOOL offset) { if(GetLocked()==false) { Control *limitedCtrl = GetLimitedControl(); if (limitedCtrl) return limitedCtrl->CloneSelectedKeys(offset); } }
void BaseLimitCtrl::DeleteKeys(DWORD flags) { if(GetLocked()==false) { Control *limitedCtrl = GetLimitedControl(); if (limitedCtrl) return limitedCtrl->DeleteKeys(flags); } }
void BaseLimitCtrl::CopyKeysFromTime(TimeValue src, TimeValue dst, DWORD flags) { if(GetLocked()==false) { Control *limitedCtrl = GetLimitedControl(); if (limitedCtrl) return limitedCtrl->CopyKeysFromTime(src, dst, flags); } }
void BaseLimitCtrl::DeleteKeyAtTime(TimeValue t) { if(GetLocked()==false) { Control *limitedCtrl = GetLimitedControl(); if (limitedCtrl) return limitedCtrl->DeleteKeyAtTime(t); } }
void BaseLimitCtrl::AddNewKey(TimeValue t, DWORD flags) { if(GetLocked()==false) { Control *limitedCtrl = GetLimitedControl(); if (limitedCtrl) return limitedCtrl->AddNewKey(t, flags); } }
bool OrientConstRotation::SvCanConcludeLink(IGraphObjectManager *gom, IGraphNode *gNode, IGraphNode *gNodeChild) { if(GetLocked()==false) { Animatable *pChildAnim = gNodeChild->GetAnim(); if( pChildAnim->SuperClassID() == BASENODE_CLASS_ID ) return true; return Control::SvCanConcludeLink(gom, gNode, gNodeChild); } return false; }
bool OrientConstRotation::SvDetachRel(IGraphObjectManager *gom, IGraphNode *gNodeTarget, int id, IGraphNode *gNodeMaker) { if(GetLocked()==false) { for( int i=0; i<GetNumTargets(); i++ ) { if( GetNode(i) == gNodeTarget->GetAnim() ) { DeleteTarget(i); return true; } } } return false; }
bool OrientConstRotation::SvLinkChild(IGraphObjectManager *gom, IGraphNode *gNodeThis, IGraphNode *gNodeChild) { if(GetLocked()==false) { Animatable *pChildAnim = gNodeChild->GetAnim(); if( pChildAnim->SuperClassID() == BASENODE_CLASS_ID ) { if( AppendTarget( (INode*)pChildAnim ) ) { NotifyDependents(FOREVER,PART_ALL,REFMSG_CHANGE); GetCOREInterface()->RedrawViews(GetCOREInterface()->GetTime()); return true; } } return Control::SvLinkChild(gom, gNodeThis, gNodeChild); } return false; }
void BaseLimitCtrl::Copy(Control *in_from) { if(GetLocked()==false) { // This is called from Assign Controller, with the former controller as parameter if (in_from) { if (in_from->ClassID() != Class_ID(DUMMYCHANNEL_CLASS_ID, 0) && in_from->ClassID() != Class_ID(DUMMY_CONTROL_CLASS_ID, 0)) { // Use the former control as the limited control SetLimitedControl(static_cast<Control*>(in_from)); } else SetLimitedControl(NULL); } } }
void BaseLimitCtrl::SetValue(TimeValue in_t, void *in_val, int in_commit, GetSetMethod in_method) { if(GetLocked()==false) { if (IsEnabled()) { if (in_method == CTRL_RELATIVE) GetTypedValueAbsolute(in_t, in_val); ClampTypedValue(in_t, in_val); } // Check if we have a controller assigned. If so, SetValue on it, if it's not locked! Control *limitedCtrl = GetLimitedControl(); if (limitedCtrl) { limitedCtrl->SetValue(in_t, in_val, in_commit, IsEnabled()? CTRL_ABSOLUTE: in_method); } else { // If in AutoKey or SetKey mode, ParamBlock::SetValue() and ParamBlock2::SetValue() // create a default controller (an fcurve) and then set key on that // controller. So if there is no limited controller, I'll do the same: // create one, and set key on it. if (GetSetKeyMode() || (Animating() && GetCOREInterface10()->GetAutoKeyDefaultKeyOn() && (in_t!=0) && (in_t!=GetCOREInterface10()->GetAutoKeyDefaultKeyTime()))) { // Create the proper default controller according to type Control *newLimitedCtrl = GetDefaultControlForDataType(); if (newLimitedCtrl) { void* ptrVal = CreateTempValue(); GetStaticValue(ptrVal, in_method); SetLimitedControl(newLimitedCtrl); if (GetSetKeyMode()) { ISetKey *skey = (ISetKey *)newLimitedCtrl->GetInterface(I_SETKEYCONTROL); if (skey) skey->SetCurrentValue(ptrVal); newLimitedCtrl->SetValue(in_t, in_val); } else { newLimitedCtrl->SetValue(TimeValue(GetCOREInterface10()->GetAutoKeyDefaultKeyTime()), ptrVal); newLimitedCtrl->SetValue(in_t, in_val); } DeleteTempValue(ptrVal); } } // Set the limit controller static value SetStaticValue(in_val, CTRL_ABSOLUTE); } } }
BOOL BaseLimitCtrl::AssignController(Animatable *in_control, int in_subAnim) { if(GetLocked()==false) { if (in_subAnim == BASELIMIT_LIMITEDCTRL_SUBANIM) { Animatable *cont = SubAnim(in_subAnim); if(cont&&GetLockedTrackInterface(cont)&&GetLockedTrackInterface(cont)->GetLocked()==true)//the control is locked, don't assign over it. return FALSE; // Accept and replace the previous limited controller with the new one ReplaceReference(SubNumToRefNum(in_subAnim), (RefTargetHandle)in_control); NotifyDependents(FOREVER, 0, REFMSG_CHANGE); NotifyDependents(FOREVER, 0, REFMSG_SUBANIM_STRUCTURE_CHANGED); return TRUE; } return TRUE; } return FALSE; }
void FloatLimitCtrl::EditTrackParams( TimeValue t, ParamDimensionBase *dim, const TCHAR *pname, HWND hParent, IObjParam *ip, DWORD flags) { if(GetLocked()==false) { FloatLimitControlDlg *dlg = LimitControlDlgManager::GetLimitCtrlDlgManager()->FindDialogFromCtrl(this); if (dlg) { SetActiveWindow(dlg->GetHWnd()); return; } dlg = LimitControlDlgManager::GetLimitCtrlDlgManager()->CreateLimitDialog(); dlg->Set(ip, dim, this); dlg->Init(hParent); } }
void OrientConstRotation::BeginEditParams( IObjParam *ip, ULONG flags,Animatable *prev ) { if(GetLocked()==false) { this->ip = ip; editCont = this; if (flags & BEGIN_EDIT_HIERARCHY) { InterpCtrlUI *ui; ui = new InterpCtrlUI(NULL,ip,this); DWORD f=0; SetProperty(PROPID_INTERPUI,ui); } else { orientCD.BeginEditParams(ip, this, flags, prev); } ip->RegisterTimeChangeCallback(&orientConstTimeChangeCallback); orientConstTimeChangeCallback.orient_controller = this; IParamMap2* pmap = pblock->GetMap(); if (pmap) hWnd = pmap->GetHWnd(); if (last_selection < 0){ RedrawListbox(GetCOREInterface()->GetTime()); } else { RedrawListbox(GetCOREInterface()->GetTime(), last_selection); ISpinnerControl* spin = GetISpinner(GetDlgItem(hWnd, IDC_ORIENT_CONS_WEIGHT_SPINNER)); if (spin != NULL){ float value = pblock->GetFloat(orientation_target_weight, GetCOREInterface()->GetTime(), last_selection); spin->SetValue(value, FALSE); } ReleaseISpinner(spin); } } }
BOOL IsReplaceable() {return !GetLocked();}
void SpeedDialThumbnail::OnMouseMove(const OpPoint& point) { if (g_widget_globals->captured_widget != this || !m_mouse_down_active || m_entry->IsEmpty() || GetLocked()) return GenericThumbnail::OnMouseMove(point); if (!IsDragging()) { const int drag_treshold = 5; const bool treshold_reached = ((labs(point.x - m_mousedown_point.x) > drag_treshold) || (labs(point.y - m_mousedown_point.y) > drag_treshold)); if (treshold_reached) { if (StartDragging(point.x, point.y)) { SetZ(Z_TOP); } } } if (IsDragging()) { OpPoint parent_point = point; parent_point.x += rect.x; parent_point.y += rect.y; if (!GetParent()->GetBounds().Contains(parent_point) && !g_drag_manager->IsDragging()) { if(g_input_manager->GetTouchInputState() & TOUCH_INPUT_ACTIVE) { // if this is caused by inertia, we don't want it flying off the viewport, nor // do we want to start an drag and drop outside Opera with touch StopDragging(); return; } // Stop dragging and start drag'n'drop when we move it out from the viewport. StopDragging(); if (StartDragging(parent_point.x, parent_point.y) && m_drag_object) { // Yes, that's on purpose: reset member first, then call StartDrag(). DesktopDragObject* object = m_drag_object; m_drag_object = NULL; // This transfers drag object ownership to OpDragManager: g_drag_manager->StartDrag(object, NULL, FALSE); } return; } // Drag the floating thumbnail widget. int x = rect.x + point.x - m_mousedown_point.x; int y = rect.y + point.y - m_mousedown_point.y; SetRect(OpRect(x, y, rect.width, rect.height)); // See if we are hovering over another thumbnail, and if so, // move the thumbnails to the new positions. SpeedDialThumbnail *other_sdt = GetDropThumbnail(); if (other_sdt && other_sdt->GetContent()->AcceptsDragDrop(*m_drag_object)) { other_sdt->GetContent()->HandleDragDrop(*m_drag_object); int target_pos = g_speeddial_manager->FindSpeedDial(m_entry); m_drag_object->SetID(target_pos); GetParent()->Relayout(true, false); } } }