bool CurveCreateTool::MouseDown( const MouseButtonInput& e ) { if ( m_Instance.ReferencesObject() && m_Scene->IsEditable() ) { Math::Vector3 position; PickPosition( e.GetPosition().x, e.GetPosition().y, position ); PointPtr point = new Core::Point( m_Scene, new Content::Point( position ) ); point->SetParent( m_Instance ); point->SetTransient( true ); m_Scene->AddObject( point ); m_Instance->Dirty(); m_Scene->Execute( true ); } return __super::MouseDown( e ); }
void CurveCreateTool::CreateInstance( const Math::Vector3& position ) { if (m_Instance.ReferencesObject()) { // remove temp reference m_Scene->RemoveObject( m_Instance ); } m_Instance = new Core::Curve( m_Scene, new Content::Curve() ); m_Instance->SetSelected( true ); m_Instance->SetTransient( true ); m_Instance->SetCurveType( s_CurveType ); m_Scene->AddObject( m_Instance ); PointPtr point = new Core::Point( m_Scene, new Content::Point( position ) ); point->SetParent( m_Instance ); point->SetTransient( true ); m_Scene->AddObject( point ); m_Instance->Evaluate( GraphDirections::Downstream ); }