Passive & Active tracing (#638)
* Plumebd with data transfer * Getting mainpage to talk to getbitmap. moving share callbacks from mainpage to graphingcalculator * Trying to get bitmap from renderer. * work * Share worked * cleanups * Cleanups progressing * Share working, need loc for title string and user notification incase of a failure. Then add the equations key. * More cleanup, now using share icon image and resources for strings. Still need to do the graph equation key. * Change share to html based start. * Key working, with UL but going to try changing to table. * Fix a html formating error, generating a new UL for each equation. * Switched over to a table for equation key and have color block formating * Updates from PR feedback, using Graphing::IBitmap abstraction. * Update src/Calculator/Views/GraphingCalculator/GraphingCalculator.xaml.h Fixed Co-Authored-By: Pepe Rivera <joseartrivera@gmail.com> * PR Updates. * Add variables to the graph key. * eod * Passive graph value tracing working. * Basic active tracing cursor working. * Move active tracing from graphingcalculator to grapher to save some hops. Also block tracking of the active tracing key's when in the EquationTextBox. * Active tracing working, need to put button on screen for activation. * Added active tracing control button (placeholder image) * Eod * Popup trace value now tracks the highlighted point. * Popup skined * PR Updates. * Update certificate thumbnail so VS2019 doesn't have a build error. * PR comments in process. * PR Updates * PR Updates, change tracing value to use tooltip static resource so we automatically change depending on system values. And changed text formatting of the value to be generic (x,y) value. * PR updates, changed how we detect who has focus so we don't eat keys when not in active tracing. * Additional filtering for the Key Up/Down in the grapher.
This commit is contained in:
committed by
Stephanie Anderl
parent
7864fe6413
commit
18f80a89db
@@ -4,6 +4,7 @@
|
||||
|
||||
#include "DeviceResources.h"
|
||||
#include "NearestPointRenderer.h"
|
||||
#include "ActiveTracingPointRenderer.h"
|
||||
#include "IGraph.h"
|
||||
|
||||
// Renders Direct2D and 3D content on the screen.
|
||||
@@ -18,12 +19,11 @@ namespace GraphControl::DX
|
||||
virtual void OnDeviceLost();
|
||||
virtual void OnDeviceRestored();
|
||||
|
||||
internal:
|
||||
RenderMain(Windows::UI::Xaml::Controls::SwapChainPanel^ panel);
|
||||
internal : RenderMain(Windows::UI::Xaml::Controls::SwapChainPanel ^ panel);
|
||||
|
||||
property std::shared_ptr< Graphing::IGraph > Graph
|
||||
property std::shared_ptr<Graphing::IGraph> Graph
|
||||
{
|
||||
void set(std::shared_ptr< Graphing::IGraph > graph);
|
||||
void set(std::shared_ptr<Graphing::IGraph> graph);
|
||||
}
|
||||
|
||||
property Windows::UI::Color BackgroundColor
|
||||
@@ -40,48 +40,103 @@ namespace GraphControl::DX
|
||||
{
|
||||
void set(Windows::Foundation::Point location);
|
||||
}
|
||||
|
||||
|
||||
void CreateWindowSizeDependentResources();
|
||||
|
||||
void RunRenderPass();
|
||||
|
||||
// Indicates if we are in active tracing mode (the tracing box is being used and controlled through keyboard input)
|
||||
property bool ActiveTracing
|
||||
{
|
||||
bool get();
|
||||
void set(bool value);
|
||||
}
|
||||
|
||||
property Windows::Foundation::Point ActiveTraceCursorPosition
|
||||
{
|
||||
Windows::Foundation::Point get()
|
||||
{
|
||||
return m_activeTracingPointerLocation;
|
||||
}
|
||||
|
||||
void set(Windows::Foundation::Point newValue)
|
||||
{
|
||||
if (m_activeTracingPointerLocation != newValue)
|
||||
{
|
||||
m_activeTracingPointerLocation = newValue;
|
||||
m_ActiveTracingPointRenderer.Render(m_activeTracingPointerLocation);
|
||||
RunRenderPass();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
property Windows::Foundation::Point TraceValue
|
||||
{
|
||||
Windows::Foundation::Point get()
|
||||
{
|
||||
return m_TraceValue;
|
||||
}
|
||||
}
|
||||
|
||||
property Windows::Foundation::Point TraceLocation
|
||||
{
|
||||
Windows::Foundation::Point get()
|
||||
{
|
||||
return m_TraceLocation;
|
||||
}
|
||||
}
|
||||
|
||||
// Any time we should be showing the tracing popup (either active or passive tracing)
|
||||
property bool Tracing
|
||||
{
|
||||
bool get()
|
||||
{
|
||||
return m_Tracing;
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
bool Render();
|
||||
|
||||
// Loaded/Unloaded
|
||||
void OnLoaded(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
|
||||
void OnLoaded(Platform::Object ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ e);
|
||||
|
||||
// Dependent event registration
|
||||
void RegisterEventHandlers();
|
||||
void UnregisterEventHandlers();
|
||||
|
||||
// Window event handlers.
|
||||
void OnVisibilityChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::VisibilityChangedEventArgs^ args);
|
||||
void OnVisibilityChanged(Windows::UI::Core::CoreWindow ^ sender, Windows::UI::Core::VisibilityChangedEventArgs ^ args);
|
||||
|
||||
// DisplayInformation event handlers.
|
||||
void OnDpiChanged(Windows::Graphics::Display::DisplayInformation^ sender, Platform::Object^ args);
|
||||
void OnOrientationChanged(Windows::Graphics::Display::DisplayInformation^ sender, Platform::Object^ args);
|
||||
void OnDisplayContentsInvalidated(Windows::Graphics::Display::DisplayInformation^ sender, Platform::Object^ args);
|
||||
void OnDpiChanged(Windows::Graphics::Display::DisplayInformation ^ sender, Platform::Object ^ args);
|
||||
void OnOrientationChanged(Windows::Graphics::Display::DisplayInformation ^ sender, Platform::Object ^ args);
|
||||
void OnDisplayContentsInvalidated(Windows::Graphics::Display::DisplayInformation ^ sender, Platform::Object ^ args);
|
||||
|
||||
// Other event handlers.
|
||||
void OnCompositionScaleChanged(Windows::UI::Xaml::Controls::SwapChainPanel^ sender, Object^ args);
|
||||
void OnSizeChanged(Platform::Object^ sender, Windows::UI::Xaml::SizeChangedEventArgs^ e);
|
||||
void OnCompositionScaleChanged(Windows::UI::Xaml::Controls::SwapChainPanel ^ sender, Object ^ args);
|
||||
void OnSizeChanged(Platform::Object ^ sender, Windows::UI::Xaml::SizeChangedEventArgs ^ e);
|
||||
|
||||
private:
|
||||
DX::DeviceResources m_deviceResources;
|
||||
NearestPointRenderer m_nearestPointRenderer;
|
||||
ActiveTracingPointRenderer m_ActiveTracingPointRenderer;
|
||||
|
||||
// Cached Graph object with Renderer property.
|
||||
std::shared_ptr< Graphing::IGraph > m_graph = nullptr;
|
||||
std::shared_ptr<Graphing::IGraph> m_graph = nullptr;
|
||||
|
||||
// Track current input pointer position.
|
||||
bool m_drawNearestPoint = false;
|
||||
Windows::Foundation::Point m_pointerLocation;
|
||||
|
||||
// Track current active tracing pointer position.
|
||||
bool m_drawActiveTracing = false;
|
||||
Windows::Foundation::Point m_activeTracingPointerLocation;
|
||||
|
||||
float m_backgroundColor[4];
|
||||
|
||||
// The SwapChainPanel^ surface.
|
||||
Windows::UI::Xaml::Controls::SwapChainPanel^ m_swapChainPanel = nullptr;
|
||||
// The SwapChainPanel^ surface.
|
||||
Windows::UI::Xaml::Controls::SwapChainPanel ^ m_swapChainPanel = nullptr;
|
||||
Windows::Foundation::EventRegistrationToken m_tokenLoaded;
|
||||
Windows::Foundation::EventRegistrationToken m_tokenCompositionScaleChanged;
|
||||
Windows::Foundation::EventRegistrationToken m_tokenSizeChanged;
|
||||
@@ -90,13 +145,22 @@ namespace GraphControl::DX
|
||||
Platform::Agile<Windows::UI::Core::CoreWindow> m_coreWindow = nullptr;
|
||||
Windows::Foundation::EventRegistrationToken m_tokenVisibilityChanged;
|
||||
|
||||
Windows::Graphics::Display::DisplayInformation^ m_displayInformation = nullptr;
|
||||
Windows::Graphics::Display::DisplayInformation ^ m_displayInformation = nullptr;
|
||||
Windows::Foundation::EventRegistrationToken m_tokenDpiChanged;
|
||||
Windows::Foundation::EventRegistrationToken m_tokenOrientationChanged;
|
||||
Windows::Foundation::EventRegistrationToken m_tokenDisplayContentsInvalidated;
|
||||
|
||||
// Track our independent input on a background worker thread.
|
||||
Windows::Foundation::IAsyncAction^ m_inputLoopWorker = nullptr;
|
||||
Windows::UI::Core::CoreIndependentInputSource^ m_coreInput = nullptr;
|
||||
Windows::Foundation::IAsyncAction ^ m_inputLoopWorker = nullptr;
|
||||
Windows::UI::Core::CoreIndependentInputSource ^ m_coreInput = nullptr;
|
||||
|
||||
// What is the current trace value
|
||||
Windows::Foundation::Point m_TraceValue;
|
||||
|
||||
// And where is it located on screen
|
||||
Windows::Foundation::Point m_TraceLocation;
|
||||
|
||||
// Are we currently showing the tracing value
|
||||
bool m_Tracing;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user