added samples
[windows-sources.git] / sdk / samples / WPFSamples / CompositionTargetRenderingAnimations / cpp / particleeffectexamples / magnetismcanvas.h
blob72a76722cf222852e52b510242453c7a95ada622
1 //MagnetismCanvas.h file
3 #pragma once
5 #include "TimeTracker.h"
8 using namespace System;
9 using namespace System::Windows;
10 using namespace System::Windows::Media;
11 using namespace System::Windows::Media::Animation;
12 using namespace System::Windows::Controls;
13 using namespace System::Collections::Generic;
14 using namespace System::Windows::Input;
16 namespace Microsoft {
17 namespace Samples {
18 namespace PerFrameAnimations {
19 public ref class MagnitismCanvas : Canvas {
21 public:
22 MagnitismCanvas () ;
24 public:
25 property double BorderForce {
26 double get () ;
27 void set (double value) ;
30 property double ChildForce {
31 double get () ;
32 void set (double value) ;
35 property double Drag {
36 double get () ;
37 void set (double value) ;
40 private:
41 TimeTracker^ _timeTracker;
42 System::Collections::Generic::Dictionary<System::Windows::UIElement^,System::Windows::Vector>^ _childrenVelocities;
43 double _borderforce;
44 double _childforce;
45 double _drag;
48 protected:
49 void UpdateChildren (System::Object^ sender, System::EventArgs^ e) ;
51 private:
52 void _initFields () ;
53 bool AreRectsOverlapping (System::Windows::Rect r1, System::Windows::Rect r2) ;
54 System::Windows::Point IntersectInsideRect (System::Windows::Rect r, System::Windows::Point raystart, System::Windows::Vector raydir) ;
55 System::Windows::Vector VectorBetweenRects (System::Windows::Rect r1, System::Windows::Rect r2) ;
56 System::Windows::Point GetRenderTransformOffset (System::Windows::UIElement^ e) ;
57 void SetRenderTransformOffset (System::Windows::UIElement^ e, System::Windows::Point offset) ;
58 System::Windows::Point GetTruePosition (System::Windows::UIElement^ e) ;
59 void SetTruePosition (System::Windows::UIElement^ e, System::Windows::Point p) ;
60 System::Windows::Point GetCenter (System::Windows::Rect r) ;