Scope
d2d::D2HistogramRender Class Reference

#include <D2HistogramRender.h>

Public Member Functions

 D2HistogramRender (const uint32_t &_width, const uint32_t &_channels, scope::ScopeMultiHistogramPtr _hist)
 
 ~D2HistogramRender ()
 
void Create (const HWND &_hwnd)
 
void SetHistogram (scope::ScopeMultiHistogramPtr _hist)
 
void Render ()
 
void Size (const CSize &size)
 
bool ClickedAt (const CPoint _clickpoint, uint32_t &_channel, bool &_uplo)
 
void SetLowerLimitPosition (const uint32_t &_channel, const FLOAT &_pos)
 
void SetUpperLimitPosition (const uint32_t &_channel, const FLOAT &_pos)
 

Protected Member Functions

void DiscardDeviceResources ()
 
 D2HistogramRender (const D2HistogramRender &)
 
D2HistogramRender operator= (const D2HistogramRender &)
 

Protected Attributes

std::mutex mutex
 
const uint32_t width
 
const uint32_t channels
 
std::unique_ptr< RenderTargetrender_target
 
ID2D1SolidColorBrush * brushwhite
 
ID2D1SolidColorBrush * brushred
 
ID2D1SolidColorBrush * brushyellow
 
HWND hwnd
 
std::vector< FLOAT > llpos
 
std::vector< FLOAT > ulpos
 
scope::ScopeMultiHistogramPtr hist
 

Detailed Description

Handles all Direct2D rendering in a CHistogramView.

Renders a histogram made up of single lines. Its size is fixed to 'width'. Also renders and repositions limit lines. Also can test for click hits on limit lines. All mutex protected.

Definition at line 16 of file D2HistogramRender.h.

Constructor & Destructor Documentation

d2d::D2HistogramRender::D2HistogramRender ( const D2HistogramRender )
protected

Disable copy.

d2d::D2HistogramRender::D2HistogramRender ( const uint32_t &  _width,
const uint32_t &  _channels,
scope::ScopeMultiHistogramPtr  _hist 
)

Initialize all to nullptr.

Definition at line 8 of file D2HistogramRender.cpp.

d2d::D2HistogramRender::~D2HistogramRender ( )

Discard device resources.

Definition at line 21 of file D2HistogramRender.cpp.

Member Function Documentation

void d2d::D2HistogramRender::DiscardDeviceResources ( )
protected

Safely release all Direct2D resources.

Definition at line 25 of file D2HistogramRender.cpp.

D2HistogramRender d2d::D2HistogramRender::operator= ( const D2HistogramRender )
protected

Disable assignment.

void d2d::D2HistogramRender::Create ( const HWND &  _hwnd)

Creates the render target for a hwnd, the brushes for painting, and sets the limit position to the window edges.

Definition at line 31 of file D2HistogramRender.cpp.

void d2d::D2HistogramRender::SetHistogram ( scope::ScopeMultiHistogramPtr  _hist)

Sets the pointer to the current multi histogram.

Definition at line 49 of file D2HistogramRender.cpp.

void d2d::D2HistogramRender::Render ( )

Draws the current multi histogram with the limit lines.

Definition at line 54 of file D2HistogramRender.cpp.

void d2d::D2HistogramRender::Size ( const CSize &  size)

Resizes the renderer and the limit positions.

Definition at line 144 of file D2HistogramRender.cpp.

bool d2d::D2HistogramRender::ClickedAt ( const CPoint  _clickpoint,
uint32_t &  _channel,
bool &  _uplo 
)

Checks if click hit a limit (+-5 pixel) and if yes, on which channel and upper or lower limit line.

Parameters
[in]_clickpointthe point (in window coordinates) to test
[out]_channelhistogram of which channel was hit
[out]_uploif lower limit was hit false, if upper limit line was hit true
Returns
is the _clickpoint on (+-5 pixel) a limitline

Definition at line 99 of file D2HistogramRender.cpp.

void d2d::D2HistogramRender::SetLowerLimitPosition ( const uint32_t &  _channel,
const FLOAT &  _pos 
)

Set position of a lower limit line.

Definition at line 134 of file D2HistogramRender.cpp.

void d2d::D2HistogramRender::SetUpperLimitPosition ( const uint32_t &  _channel,
const FLOAT &  _pos 
)

Set position of an upper limit line.

Definition at line 139 of file D2HistogramRender.cpp.

Member Data Documentation

std::mutex d2d::D2HistogramRender::mutex
mutableprotected

mutex for protection

Definition at line 20 of file D2HistogramRender.h.

const uint32_t d2d::D2HistogramRender::width
protected

constant width of the renderer

Definition at line 23 of file D2HistogramRender.h.

const uint32_t d2d::D2HistogramRender::channels
protected

number of channels

Definition at line 26 of file D2HistogramRender.h.

std::unique_ptr<RenderTarget> d2d::D2HistogramRender::render_target
protected

Direct2D render target.

Definition at line 29 of file D2HistogramRender.h.

ID2D1SolidColorBrush* d2d::D2HistogramRender::brushwhite
protected

Direct2D white brush.

Definition at line 32 of file D2HistogramRender.h.

ID2D1SolidColorBrush* d2d::D2HistogramRender::brushred
protected

Direct2D red brush.

Definition at line 35 of file D2HistogramRender.h.

ID2D1SolidColorBrush* d2d::D2HistogramRender::brushyellow
protected

Direct2D yellow brush.

Definition at line 38 of file D2HistogramRender.h.

HWND d2d::D2HistogramRender::hwnd
protected

windows handle

Definition at line 41 of file D2HistogramRender.h.

std::vector<FLOAT> d2d::D2HistogramRender::llpos
protected

Keeps track of the lower limit positions in screen coordinates.

Definition at line 44 of file D2HistogramRender.h.

std::vector<FLOAT> d2d::D2HistogramRender::ulpos
protected

Keeps track of the upper limit positions in screen coordinates.

Definition at line 47 of file D2HistogramRender.h.

scope::ScopeMultiHistogramPtr d2d::D2HistogramRender::hist
protected

Pointer to the currently rendered multi histogram.

Definition at line 50 of file D2HistogramRender.h.


The documentation for this class was generated from the following files: