NCBI C++ ToolKit
|
Search Toolkit Book for CRulerPanel
CRulerPanel – the ruler panel class. More...
#include <gui/widgets/seq_graphic/ruler_panel.hpp>
Public Member Functions | |
CRulerPanel () | |
virtual | ~CRulerPanel () |
void | SetSeqLength (TSeqPos len) |
CRulerPanel inline methods. More... | |
void | SetOrientation (bool horz, bool flip) |
void | SetShown (bool f) |
bool | IsShown () const |
TVPPoint | GetSize (int max_num=0) const |
int | GetMainRulerLabelStep () const |
void | SetRulerSeqStart (TSeqPos pos) |
bool | HitTest (const TModelPoint &p) |
void | Render (CGlPane &pane) |
void | GetHTMLActiveAreas (CSeqGlyph::TAreaVector *p_areas) const |
void | LoadSettings (const CSeqGraphicConfig &g_config) |
void | SaveSettings () const |
Public Member Functions inherited from CObject | |
CObject (void) | |
Constructor. More... | |
CObject (const CObject &src) | |
Copy constructor. More... | |
virtual | ~CObject (void) |
Destructor. More... | |
CObject & | operator= (const CObject &src) THROWS_NONE |
Assignment operator. More... | |
bool | CanBeDeleted (void) const THROWS_NONE |
Check if object can be deleted. More... | |
bool | IsAllocatedInPool (void) const THROWS_NONE |
Check if object is allocated in memory pool (not system heap) More... | |
bool | Referenced (void) const THROWS_NONE |
Check if object is referenced. More... | |
bool | ReferencedOnlyOnce (void) const THROWS_NONE |
Check if object is referenced only once. More... | |
void | AddReference (void) const |
Add reference to object. More... | |
void | RemoveReference (void) const |
Remove reference to object. More... | |
void | ReleaseReference (void) const |
Remove reference without deleting object. More... | |
virtual void | DoNotDeleteThisObject (void) |
Mark this object as not allocated in heap – do not delete this object. More... | |
virtual void | DoDeleteThisObject (void) |
Mark this object as allocated in heap – object can be deleted. More... | |
void * | operator new (size_t size) |
Define new operator for memory allocation. More... | |
void * | operator new[] (size_t size) |
Define new[] operator for 'array' memory allocation. More... | |
void | operator delete (void *ptr) |
Define delete operator for memory deallocation. More... | |
void | operator delete[] (void *ptr) |
Define delete[] operator for memory deallocation. More... | |
void * | operator new (size_t size, void *place) |
Define new operator. More... | |
void | operator delete (void *ptr, void *place) |
Define delete operator. More... | |
void * | operator new (size_t size, CObjectMemoryPool *place) |
Define new operator using memory pool. More... | |
void | operator delete (void *ptr, CObjectMemoryPool *place) |
Define delete operator. More... | |
virtual void | DebugDump (CDebugDumpContext ddc, unsigned int depth) const |
Define method for dumping debug information. More... | |
Public Member Functions inherited from CDebugDumpable | |
CDebugDumpable (void) | |
virtual | ~CDebugDumpable (void) |
void | DebugDumpText (ostream &out, const string &bundle, unsigned int depth) const |
void | DebugDumpFormat (CDebugDumpFormatter &ddf, const string &bundle, unsigned int depth) const |
void | DumpToConsole (void) const |
Private Member Functions | |
void | x_ReversePane (CGlPane &pane) const |
void | x_UpdateMappingRanges () |
void | x_InitRulerSpecs () |
Private Attributes | |
CRuler | m_MainRuler |
unique_ptr< CRuler > | m_ExtraRuler |
extra ruler. More... | |
unique_ptr< CRuler > | m_ExtraNegRuler |
TSeqPos | m_SeqLength |
the total sequence length in bases. More... | |
TSignedSeqPos | m_RulerStart |
bool | m_Flipped |
bool | m_Horz |
bool | m_Shown |
configuration | |
CRgbaColor | m_BG |
CRgbaColor | m_GridColor |
CRgbaColor | m_LabelColor |
CGlTextureFont | m_LabelFont |
CGlTextureFont | m_SmallLabelFont |
int | m_MajorTickSize |
int | m_MinorTickSize |
int | m_LabelTickSize |
int | m_OppMajorTickSize |
int | m_OppMinorTickSize |
int | m_OppLabelTickSize |
CRuler::ELabelAlign | m_LabelAln |
Additional Inherited Members | |
Public Types inherited from CObject | |
enum | EAllocFillMode { eAllocFillNone = 1 , eAllocFillZero , eAllocFillPattern } |
Control filling of newly allocated memory. More... | |
typedef CObjectCounterLocker | TLockerType |
Default locker type for CRef. More... | |
typedef atomic< Uint8 > | TCounter |
Counter type is CAtomiCounter. More... | |
typedef Uint8 | TCount |
Alias for value type of counter. More... | |
Static Public Member Functions inherited from CObject | |
static NCBI_XNCBI_EXPORT void | ThrowNullPointerException (void) |
Define method to throw null pointer exception. More... | |
static NCBI_XNCBI_EXPORT void | ThrowNullPointerException (const type_info &type) |
static EAllocFillMode | GetAllocFillMode (void) |
static void | SetAllocFillMode (EAllocFillMode mode) |
static void | SetAllocFillMode (const string &value) |
Set mode from configuration parameter value. More... | |
Static Public Member Functions inherited from CDebugDumpable | |
static void | EnableDebugDump (bool on) |
Static Public Attributes inherited from CObject | |
static const TCount | eCounterBitsCanBeDeleted = 1 << 0 |
Define possible object states. More... | |
static const TCount | eCounterBitsInPlainHeap = 1 << 1 |
Heap signature was found. More... | |
static const TCount | eCounterBitsPlaceMask |
Mask for 'in heap' state flags. More... | |
static const int | eCounterStep = 1 << 2 |
Skip over the "in heap" bits. More... | |
static const TCount | eCounterValid = TCount(1) << (sizeof(TCount) * 8 - 2) |
Minimal value for valid objects (reference counter is zero) Must be a single bit value. More... | |
static const TCount | eCounterStateMask |
Valid object, and object in heap. More... | |
Protected Member Functions inherited from CObject | |
virtual void | DeleteThis (void) |
Virtual method "deleting" this object. More... | |
CRulerPanel – the ruler panel class.
Definition at line 47 of file ruler_panel.hpp.
CRulerPanel::CRulerPanel | ( | ) |
Definition at line 47 of file ruler_panel.cpp.
References x_InitRulerSpecs().
|
virtual |
Definition at line 71 of file ruler_panel.cpp.
void CRulerPanel::GetHTMLActiveAreas | ( | CSeqGlyph::TAreaVector * | p_areas | ) | const |
Definition at line 227 of file ruler_panel.cpp.
References CHTMLActiveArea::fNoHighlight, CHTMLActiveArea::fNoPin, CHTMLActiveArea::fNoSelection, CHTMLActiveArea::fNoTooltip, CHTMLActiveArea::fRuler, GetSize(), CGlRect< T >::Init(), CHTMLActiveArea::m_Bounds, CHTMLActiveArea::m_Flags, m_Shown, CHTMLActiveArea::m_Signature, and ncbi::grid::netcache::search::fields::size.
Referenced by CSeqGraphicRenderer::x_Draw(), and CSeqGraphicRenderer::x_DrawVectorGraphics().
|
inline |
Definition at line 126 of file ruler_panel.hpp.
References CRuler::GetLabelStep(), and m_MainRuler.
Referenced by CSeqGraphicRenderer::x_Draw(), and CSeqGraphicRenderer::x_DrawVectorGraphics().
Definition at line 93 of file ruler_panel.cpp.
References CRuler::GetPreferredSize(), m_ExtraRuler, m_Horz, m_MainRuler, m_RulerStart, m_Shown, CGlPoint< T >::m_X, CGlPoint< T >::m_Y, max(), CGlPoint< T >::X(), and CGlPoint< T >::Y().
Referenced by CSeqGraphicRenderer::GetHeight(), GetHTMLActiveAreas(), CSeqGraphicRenderer::GetLayoutHeight(), and CSeqGraphicRenderer::x_SetupViewPorts().
bool CRulerPanel::HitTest | ( | const TModelPoint & | p | ) |
|
inline |
Definition at line 57 of file ruler_panel.hpp.
References m_Shown.
Referenced by CSeqGraphicRenderer::x_Draw(), and CSeqGraphicRenderer::x_DrawVectorGraphics().
void CRulerPanel::LoadSettings | ( | const CSeqGraphicConfig & | g_config | ) |
Definition at line 246 of file ruler_panel.cpp.
References CRuler::eAln_Center, CRuler::eAln_Left, CRuler::eAln_Right, NStr::EqualNocase(), CSGConfigUtils::GetColor(), CSGConfigUtils::GetColorReadView(), CSeqGraphicConfig::GetColorTheme(), CGuiRegistry::GetInstance(), CRegistryReadView::GetInt(), CSeqGraphicConfig::GetSizeLevel(), CSGConfigUtils::GetSizeReadView(), CRegistryReadView::GetString(), CSGConfigUtils::GetTexFont(), kRulerPanelKey, m_BG, m_GridColor, m_LabelAln, m_LabelColor, m_LabelFont, m_LabelTickSize, m_MajorTickSize, m_MinorTickSize, m_OppLabelTickSize, m_OppMajorTickSize, m_OppMinorTickSize, registry, and x_InitRulerSpecs().
Referenced by CSeqGraphicRenderer::UpdateConfig().
void CRulerPanel::Render | ( | CGlPane & | pane | ) |
Definition at line 153 of file ruler_panel.cpp.
References IRender::BlendFunc(), CGlPane::Close(), IRender::Color4f(), IRender::ColorC(), IRender::Disable(), IRender::Enable(), CGlPane::eOrtho, CGlResMgr::GetCurrentRenderer(), CRef< C, Locker >::GetObject(), CGlPane::GetOffsetX(), CGlPane::GetOffsetY(), CRuler::GetPreferredSize(), CGlPane::GetVisibleRect(), CGlResMgr::Instance(), IRender::LoadIdentity(), m_BG, m_ExtraNegRuler, m_ExtraRuler, m_Flipped, m_Horz, m_LabelTickSize, m_MainRuler, m_RulerStart, m_SeqLength, m_Shown, CGlRect< T >::Offset(), CGlPane::OpenOrtho(), IRender::RectC(), CRuler::Render(), IRender::Translatef(), CRuler::Update(), CGlPoint< T >::X(), x_ReversePane(), and CGlPoint< T >::Y().
Referenced by CSeqGraphicRenderer::x_DoLensZoom(), CSeqGraphicRenderer::x_Draw(), and CSeqGraphicRenderer::x_DrawVectorGraphics().
void CRulerPanel::SaveSettings | ( | ) | const |
Definition at line 282 of file ruler_panel.cpp.
Definition at line 76 of file ruler_panel.cpp.
References CRuler::eBottom, CRuler::eLeft, CRuler::eRight, CRuler::eTop, m_ExtraNegRuler, m_ExtraRuler, m_Flipped, m_Horz, m_LabelAln, m_MainRuler, m_RulerStart, CRuler::SetHorizontal(), and x_UpdateMappingRanges().
Referenced by CSeqGraphicRenderer::SetHorizontal().
void CRulerPanel::SetRulerSeqStart | ( | TSeqPos | pos | ) |
Definition at line 113 of file ruler_panel.cpp.
References CRuler::eAln_Right, CRuler::eBackground, CRuler::eBottom, CRuler::eLabelTickHeight, CRuler::eMajorTickHeight, CRuler::eMinorTickHeight, CRuler::eOppLabelTickHeight, CRuler::eOppMajorTickHeight, CRuler::eOppMinorTickHeight, CRuler::eRuler, CRuler::eText, CRuler::fHideLastLabel, CGlTextureFont::GetFontFace(), CGlTextureFont::GetFontSize(), m_BG, m_ExtraNegRuler, m_ExtraRuler, m_GridColor, m_LabelColor, m_RulerStart, m_SmallLabelFont, and x_UpdateMappingRanges().
Referenced by CSeqGraphicRenderer::SetRulerSeqStart().
|
inline |
CRulerPanel inline methods.
Definition at line 119 of file ruler_panel.hpp.
References len, m_SeqLength, and x_UpdateMappingRanges().
Referenced by CSeqGraphicRenderer::SetInputObject().
|
inline |
Definition at line 130 of file ruler_panel.hpp.
Referenced by CSeqGraphicRenderer::HideRuler().
|
private |
Definition at line 341 of file ruler_panel.cpp.
References CRuler::eBackground, CRuler::eBottom, CRuler::eLabelTickHeight, CRuler::eLeft, CRuler::eMajorTickHeight, CRuler::eMinorTickHeight, CRuler::eOppLabelTickHeight, CRuler::eOppMajorTickHeight, CRuler::eOppMinorTickHeight, CRuler::eRight, CRuler::eRuler, CRuler::eText, CRuler::eTop, CGlTextureFont::GetFontFace(), CGlTextureFont::GetFontSize(), m_BG, m_ExtraRuler, m_GridColor, m_Horz, m_LabelAln, m_LabelColor, m_LabelFont, m_LabelTickSize, m_MainRuler, m_MajorTickSize, m_MinorTickSize, m_OppLabelTickSize, m_OppMajorTickSize, m_OppMinorTickSize, m_SmallLabelFont, CRuler::SetColor(), CRuler::SetDisplayOptions(), CRuler::SetFont(), CRuler::SetGeometryParam(), and CRuler::SetHorizontal().
Referenced by CRulerPanel(), and LoadSettings().
|
private |
Definition at line 290 of file ruler_panel.cpp.
References CGlRect< T >::Bottom(), CGlPane::GetViewport(), CGlPane::GetVisibleRect(), CGlRect< T >::Height(), CGlRect< T >::Left(), m_Horz, m_SeqLength, CGlRect< T >::Right(), CGlPane::SetVisibleRect(), CGlRect< T >::Top(), and CGlRect< T >::Width().
Referenced by Render().
|
private |
Definition at line 308 of file ruler_panel.cpp.
References m_ExtraNegRuler, m_ExtraRuler, m_Flipped, m_MainRuler, m_RulerStart, m_SeqLength, and CRuler::SetRange().
Referenced by SetOrientation(), SetRulerSeqStart(), and SetSeqLength().
|
private |
Definition at line 100 of file ruler_panel.hpp.
Referenced by LoadSettings(), Render(), SetRulerSeqStart(), and x_InitRulerSpecs().
|
private |
Definition at line 88 of file ruler_panel.hpp.
Referenced by Render(), SetOrientation(), SetRulerSeqStart(), and x_UpdateMappingRanges().
|
private |
extra ruler.
The extra ruler is available only when reseting the origin. It appears right under the main ruler, and count up on the right always regardless of the flip strand mode.
Definition at line 87 of file ruler_panel.hpp.
Referenced by GetSize(), Render(), SetOrientation(), SetRulerSeqStart(), x_InitRulerSpecs(), and x_UpdateMappingRanges().
|
private |
Definition at line 94 of file ruler_panel.hpp.
Referenced by Render(), SetOrientation(), and x_UpdateMappingRanges().
|
private |
Definition at line 101 of file ruler_panel.hpp.
Referenced by LoadSettings(), SetRulerSeqStart(), and x_InitRulerSpecs().
|
private |
Definition at line 95 of file ruler_panel.hpp.
Referenced by GetSize(), Render(), SetOrientation(), x_InitRulerSpecs(), and x_ReversePane().
|
private |
Definition at line 111 of file ruler_panel.hpp.
Referenced by LoadSettings(), SetOrientation(), and x_InitRulerSpecs().
|
private |
Definition at line 102 of file ruler_panel.hpp.
Referenced by LoadSettings(), SetRulerSeqStart(), and x_InitRulerSpecs().
|
private |
Definition at line 103 of file ruler_panel.hpp.
Referenced by LoadSettings(), and x_InitRulerSpecs().
|
private |
Definition at line 107 of file ruler_panel.hpp.
Referenced by LoadSettings(), Render(), and x_InitRulerSpecs().
|
private |
Definition at line 81 of file ruler_panel.hpp.
Referenced by GetMainRulerLabelStep(), GetSize(), Render(), SetOrientation(), x_InitRulerSpecs(), and x_UpdateMappingRanges().
|
private |
Definition at line 105 of file ruler_panel.hpp.
Referenced by LoadSettings(), and x_InitRulerSpecs().
|
private |
Definition at line 106 of file ruler_panel.hpp.
Referenced by LoadSettings(), and x_InitRulerSpecs().
|
private |
Definition at line 110 of file ruler_panel.hpp.
Referenced by LoadSettings(), and x_InitRulerSpecs().
|
private |
Definition at line 108 of file ruler_panel.hpp.
Referenced by LoadSettings(), and x_InitRulerSpecs().
|
private |
Definition at line 109 of file ruler_panel.hpp.
Referenced by LoadSettings(), and x_InitRulerSpecs().
|
private |
Definition at line 93 of file ruler_panel.hpp.
Referenced by GetSize(), Render(), SetOrientation(), SetRulerSeqStart(), and x_UpdateMappingRanges().
|
private |
the total sequence length in bases.
Definition at line 91 of file ruler_panel.hpp.
Referenced by Render(), SetSeqLength(), x_ReversePane(), and x_UpdateMappingRanges().
|
private |
Definition at line 96 of file ruler_panel.hpp.
Referenced by GetHTMLActiveAreas(), GetSize(), IsShown(), Render(), and SetShown().
|
private |
Definition at line 104 of file ruler_panel.hpp.
Referenced by SetRulerSeqStart(), and x_InitRulerSpecs().