NCBI C++ ToolKit
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
CSeqGlyph Class Referenceabstract

Search Toolkit Book for CSeqGlyph

class CSeqGlyph defines an interface that wraps a rectilinear abstract object. More...

#include <gui/widgets/seq_graphic/seq_glyph.hpp>

+ Inheritance diagram for CSeqGlyph:
+ Collaboration diagram for CSeqGlyph:

Classes

class  IGlyphRenderer
 Layout renderer interface. More...
 

Public Types

enum  ENeighbours { eNghbrs_None = 0x0, eNghbrs_Left = 0x1, eNghbrs_Right = 0x2, eNghbrs_Both = 0x3 }
 
typedef vector< CHTMLActiveAreaTAreaVector
 
typedef list< CRef< CSeqGlyph > > TObjects
 
typedef list< CConstRef< CSeqGlyph > > TConstObjects
 
- 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 CAtomicCounter TCounter
 Counter type is CAtomiCounter. More...
 
typedef TCounter::TValue TCount
 Alias for value type of counter. More...
 

Public Member Functions

 CSeqGlyph ()
 
virtual ~CSeqGlyph ()
 
virtual CRef< CSeqGlyphHitTest (const TModelPoint &p)
 Hit testing. More...
 
virtual bool Intersects (const TModelRect &rect, TConstObjects &objs) const
 Intersect testing. More...
 
virtual bool NeedTooltip (const TModelPoint &, ITooltipFormatter &, string &) const
 Check if need to show tooltip. More...
 
virtual void GetTooltip (const TModelPoint &, ITooltipFormatter &tt, string &t_title) const
 Get the tooltip if available. More...
 
virtual void GetHTMLActiveAreas (TAreaVector *) const
 Get html active areas. More...
 
virtual void Update (bool)
 Update content and layout including the bounding box. More...
 
virtual TSeqRange GetRange (void) const
 get the total range of this object. More...
 
virtual bool Accept (IGlyphVisitor *visitor)
 Interface for accepting an IGlyphVisitor. More...
 
virtual bool SetSelected (bool flag)
 Select or deselect this glyph. More...
 
virtual void SetHideLabel (bool)
 Force to hide label. More...
 
virtual bool HasSideLabel () const
 Query if there is label and label is on the side. More...
 
virtual bool IsClickable () const
 Query if this glyph is clickable. More...
 
virtual bool LessBySeqPos (const CSeqGlyph &obj) const
 compare this object to another based on glyph sequence position. More...
 
bool LessByPos (const CSeqGlyph &obj) const
 compare this object to another, based on glyph geometry position. More...
 
bool LessBySeqSize (const CSeqGlyph &obj) const
 compare this object to another, based on sequence size. More...
 
bool LessBySize (const CSeqGlyph &obj) const
 compare this object to another, based on geometry size. More...
 
void Draw () const
 render the layout. More...
 
TModelRect GetModelRect () const
 get the bounding box. More...
 
bool IsIn (const TModelPoint &p) const
 Hit test for points in PARENT COORD. More...
 
bool IsIn (TModelUnit x, TModelUnit y) const
 
void SetRender (IGlyphRenderer *renderer)
 set customized renderer for this layout objects. More...
 
void SetRenderingContext (CRenderingContext *context)
 Set the rendering context. More...
 
const CRenderingContextGetRenderingContext () const
 Get the rendering context. More...
 
void SetTearline (size_t Tearline)
 tearline text – used if a list of glyphs is truncated for some reason More...
 
size_t GetTearline () const
 
int GetLevel () const
 
void SetLevel (int Level)
 
virtual string GetPName () const
 persistent name of the glyph should not depend on the instance of the glyph, but should uniquely reflect its contents so two glyphs having the same contents will have the same name currently used to track isDrawn() status for expandable glyphs default implementation returns an empty string implementations exist for CFeatGlyph (name of the contained feature) and CLayoutGroup (concatenation of all sorted children names) More...
 
Mouse event handlers

Each layout object may have customized handlers on the following mouse events.

The x and y are in 'world' coord system which is the coord. system for the uppermost layout object. Return true if event is consumed and false if not

virtual bool OnLeftDown (const TModelPoint &)
 
virtual bool OnLeftUp (const TModelPoint &)
 
virtual bool OnLeftDblClick (const TModelPoint &)
 
virtual bool OnContextMenu (wxContextMenuEvent &event)
 
Accessors
bool IsSelected () const
 
bool IsHighlighted () const
 
CRgbaColorGetHighlightsColor () const
 
virtual TModelUnit GetHeight () const
 
virtual TModelUnit GetWidth () const
 
virtual TModelUnit GetLeft () const
 
virtual TModelUnit GetTop () const
 
virtual TModelUnit GetRight () const
 
virtual TModelUnit GetBottom () const
 
const TModelPointGetPos () const
 
void GetPosInWorld (TModelPoint &pos) const
 Get top left position in world coordinate. More...
 
const CSeqGlyphGetParent (void) const
 
CSeqGlyphGetParent (void)
 
ENeighbours GetNeighbours () const
 
Mutators
void SetHighlighted (bool flag)
 
void SetHighlightsColor (const CRgbaColor &hl_color)
 
void SetHighlightsColor (const string &hl_color_str)
 
virtual void SetWidth (TModelUnit w)
 
virtual void SetHeight (TModelUnit h)
 
virtual void SetLeft (TModelUnit l)
 
virtual void SetTop (TModelUnit b)
 
virtual void SetPos (const TModelPoint &upper_left)
 
void SetParent (CSeqGlyph *p)
 
CSeqGlyphSetParent (void)
 
void SetNeighbours (ENeighbours neighbours)
 
- Public Member Functions inherited from CObjectEx
 CObjectEx (void)
 
virtual ~CObjectEx (void)
 
- Public Member Functions inherited from CObject
 CObject (void)
 Constructor. More...
 
 CObject (const CObject &src)
 Copy constructor. More...
 
virtual ~CObject (void)
 Destructor. More...
 
CObjectoperator= (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
 
- Public Member Functions inherited from CWeakObject
 CWeakObject (void)
 
virtual ~CWeakObject (void)
 
CPtrToObjectProxyGetPtrProxy (void) const
 Get pointer to proxy object containing pointer to this object. More...
 

Static Public Member Functions

static bool PointInRect (const TModelPoint &p, const TModelRect &rc)
 
static bool PointInRect (TModelUnit x, TModelUnit y, const TModelRect &rc)
 
- Static Public Member Functions inherited from CObject
static NCBI_NORETURN void ThrowNullPointerException (void)
 Define method to throw null pointer exception. More...
 
static NCBI_NORETURN 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)
 

Protected Member Functions

virtual void x_Draw () const =0
 The default renderer for this layout object. More...
 
virtual void x_UpdateBoundingBox ()=0
 Update the bounding box assuming children's sizes are fixed if any. More...
 
virtual void x_DrawHighlight () const
 
void x_DrawInnerLabelColumns (TModelUnit base, const string &label, const CRgbaColor &color, const CGlTextureFont &font, bool side_label_visible) const
 
void x_DrawInnerLabels (TModelUnit base, const string &label, const CRgbaColor &color, const CGlTextureFont &font, bool side_label_visible, vector< TModelRange > *labels_ranges=nullptr, TSeqRange *interval=nullptr, bool XOR_mode=false) const
 
void x_DrawTruncatedLabel (const string &label, const CGlTextureFont &font, TModelUnit width, TModelUnit x, TModelUnit y, vector< TModelRange > *labels_ranges=nullptr) const
 
virtual void x_OnLayoutChanged ()
 update the layout. More...
 
void x_Parent2Local (TModelPoint &pnt) const
 Transform the coordiante from parent coord. to local coord. More...
 
void x_Parent2Local (TModelUnit &, TModelUnit &y) const
 Transform the coordiante from parent coord. to local coord. More...
 
void x_Parent2Local (TModelRect &rect) const
 Transform the coordiante from parent coord. to local coord. More...
 
void x_World2Local (TModelPoint &p) const
 Transform the coordiante from world coord. to local coord. More...
 
void x_World2Local (TModelUnit &x, TModelUnit &y) const
 
void x_Local2World (TModelPoint &p) const
 Transform the coordiantes from local coord. to world coord. More...
 
void x_Local2World (TModelUnit &x, TModelUnit &y) const
 
void x_InitHTMLActiveArea (CHTMLActiveArea &area) const
 initialize the basic information for a given active area. More...
 
bool x_Visible_V () const
 is this glyph visible in vertical direction? More...
 
- Protected Member Functions inherited from CObject
virtual void DeleteThis (void)
 Virtual method "deleting" this object. More...
 
- Protected Member Functions inherited from CWeakObject
void CleanWeakRefs (void) const
 Method cleaning all CWeakRefs referencing at this moment to the object After calling to this method all existing CWeakRefs referencing to the object will return NULL, so it effectively will be equal to deleting the object. More...
 

Protected Attributes

CSeqGlyphm_Parent
 parent/child relationships for this feature More...
 
CRenderingContextm_Context
 the rendering context More...
 
unique_ptr< CRgbaColorm_HighlightsColor
 Highlight color. More...
 
ENeighbours m_Neighbours
 Indicates whether the glyph has neighbours. More...
 

Private Attributes

TModelUnit m_Height
 object height More...
 
TModelUnit m_Width
 object width More...
 
TModelPoint m_Pos
 upper left corner position in parent coord More...
 
CIRef< IGlyphRendererm_Renderer
 user-defined renderer More...
 
bool m_Selected
 
bool m_Highlighted
 
size_t m_Tearline
 
int m_Level
 shows how deep is the glyph in an hierarchy (0 being closer to root, -1 undefined) More...
 

Additional Inherited Members

- 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...
 

Detailed Description

class CSeqGlyph defines an interface that wraps a rectilinear abstract object.

CSeqGlyph defines how an axis-aligned rectilinear object appears to a layout algorithm. The basic concepts supported include: – querying rectilnear position or interval as a total range – functors for sorting – Draw() for rendering the object

Comments on the coordinate system for a layout object: 1. For most of the layout objects, the x coordinate (in horizontal mode) is predetermined and it is in the top sequence coordinate. So for a given layout object, we define the x origin of the local coord. system the same as the x origin of the 'world' coordinate system. 2. And y origin of the local coordinate will always be at the upper left corner (in horizontal mode) of the layout object. 3. From a developer's perspective, one can assume the sequence is in horizontal mode with no flipping strand.

Definition at line 79 of file seq_glyph.hpp.

Member Typedef Documentation

Definition at line 82 of file seq_glyph.hpp.

Definition at line 84 of file seq_glyph.hpp.

Definition at line 83 of file seq_glyph.hpp.

Member Enumeration Documentation

Enumerator
eNghbrs_None 
eNghbrs_Left 
eNghbrs_Right 
eNghbrs_Both 

Definition at line 93 of file seq_glyph.hpp.

Constructor & Destructor Documentation

CSeqGlyph::CSeqGlyph ( )

Definition at line 46 of file seq_glyph.cpp.

virtual CSeqGlyph::~CSeqGlyph ( )
inlinevirtual

Definition at line 102 of file seq_glyph.hpp.

Member Function Documentation

bool CSeqGlyph::Accept ( IGlyphVisitor visitor)
inlinevirtual

Interface for accepting an IGlyphVisitor.

The visitor will be passed to its child glyphs for composite glyph.

Returns
true if continue the traversal and false, otherwise.

Reimplemented in CLinkedFeatsGroup, CLayoutGroup, CGlyphContainer, and CGeneGroup.

Definition at line 488 of file seq_glyph.hpp.

References IGlyphVisitor::Visit().

Referenced by CSelectionVisitor::GetSelectedLayoutObjects(), CSelectionVisitor::ResetObjectSelection(), CGlyphSearchVisitor::Search(), and CSelectionVisitor::UpdateSelection().

void CSeqGlyph::Draw ( void  ) const
TModelUnit CSeqGlyph::GetBottom ( ) const
inlinevirtual
TModelUnit CSeqGlyph::GetHeight ( void  ) const
inlinevirtual

Definition at line 556 of file seq_glyph.hpp.

References m_Height.

Referenced by CCompactLayout::BuildLayout(), CSeqGraphicRenderer::GetHeight(), CMatePairGlyph::GetHTMLActiveAreas(), CHistogramGlyph::GetHTMLActiveAreas(), CSeqGraphicRenderer::GetLayoutHeight(), CHistogramGlyph::GetTooltip(), CSequenceTrack::InitHTMLActiveArea(), CAlnVecRow::UpdateOnStyleChanged(), CInlineLayout::x_BuildLayout1Row(), CInlineLayout::x_BuildLayoutMultiRows(), CCdsGlyph::x_Draw(), CGeneGroup::x_Draw(), CCommentGlyph::x_Draw(), CSegmentSmearGlyph::x_Draw(), CLDBlockGlyph::x_Draw(), CTraceGlyph::x_Draw(), CClonePlacementGlyph::x_Draw(), CSeqGraphicRenderer::x_Draw(), CHistogramGlyph::x_Draw(), CFeatGlyph::x_Draw(), CLayoutGroup::x_DrawBoundary(), CHistogramGlyph::x_DrawDataPoints(), CSegmentSmearGlyph::x_DrawGaps(), CHistogramGlyph::x_DrawGraph(), CHistogramGlyph::x_DrawGraphMap(), CHistogramGlyph::x_DrawHeatMap(), CLDBlockLine::x_DrawLabel(), CHistogramGlyph::x_DrawLinearRuler(), CHistogramGlyph::x_DrawLogRuler(), CTraceGlyph::x_GetConfGraphH(), CTraceGlyph::x_GetSignalGraphH(), x_InitHTMLActiveArea(), CLayoutTrackHandler::x_MoveTrackDownRecursive(), CHistogramGlyph::x_PointToWorld(), CTraceGraphTrack::x_RenderContent(), CGraphOverlay::x_RenderContent(), CGraphTrack::x_RenderContent(), CLayoutTrack::x_RenderTitleBar(), CLayoutTrackHandler::x_StartMoving(), CCdsGlyph::x_UpdateBoundingBox(), CNamedGroup::x_UpdateBoundingBox(), CAlignSmearGlyph::x_UpdateBoundingBox(), CSequenceTrack::x_UpdateBoundingBox(), CGraphOverlay::x_UpdateBoundingBox(), CSegmentGlyph::x_UpdateBoundingBox(), CGlyphContainer::x_UpdateBoundingBox(), CMatePairGlyph::x_UpdateBoundingBox(), CAlignGlyph::x_UpdateBoundingBox(), CGraphTrack::x_UpdateBoundingBox(), CClonePlacementGlyph::x_UpdateBoundingBox(), CLinkedFeatsGroup::x_UpdateBoundingBox(), CLayoutGroup::x_UpdateBoundingBox(), CFeatGlyph::x_UpdateBoundingBox(), CLayoutTrack::x_UpdateBoundingBox(), CDummyTrack::x_UpdateBoundingBox(), CGlyphContainer::x_UpdateComments(), CGraphOverlay::x_UpdateLegend(), CHistogramGlyph::x_UpdateLegend(), CAlnVecRow::x_UpdateRowHeight(), and x_Visible_V().

CRgbaColor * CSeqGlyph::GetHighlightsColor ( ) const
inline

Definition at line 550 of file seq_glyph.hpp.

References m_HighlightsColor.

virtual void CSeqGlyph::GetHTMLActiveAreas ( TAreaVector ) const
inlinevirtual
TModelUnit CSeqGlyph::GetLeft ( ) const
inlinevirtual

Definition at line 564 of file seq_glyph.hpp.

References m_Pos, and CGlPoint< T >::X().

Referenced by CColumnLayout::BuildLayout(), CCompactLayout::BuildLayout(), CRenderingContext::IntersectVisible(), IsIn(), LessByPos(), SGlyphSorter::operator()(), CTranslationGlyph::SetStop(), CInlineLayout::x_BuildLayout1Row(), CInlineLayout::x_BuildLayoutMultiRows(), CLegendItemGlyph::x_Draw(), CNamedGroup::x_Draw(), CGeneGroup::x_Draw(), CCommentGlyph::x_Draw(), CScatterPlotGlyph::x_Draw(), CSegmentGlyph::x_Draw(), CClonePlacementGlyph::x_Draw(), CLayoutGroup::x_Draw(), CFeatGlyph::x_Draw(), CFeatGlyph::x_DrawAdditionalInfo(), CAlnStatGlyph::x_DrawBarGraph(), CLayoutGroup::x_DrawBoundary(), CAlnStatGlyph::x_DrawDensityTable(), CLinkedFeatsGroup::x_DrawLabels(), CFeatGlyph::x_DrawLabelWithYPinned(), CHistogramGlyph::x_DrawLinearRuler(), CHistogramGlyph::x_DrawLogRuler(), CAlignGlyph::x_DrawMultiAlignLabel(), CAlignGlyph::x_DrawPWAlign(), CTranslationGlyph::x_DrawSequence(), CLayoutTrack::x_GetTBRect(), x_InitHTMLActiveArea(), CLinkedFeatsGroup::x_LabelFirst(), CLayeredLayout::x_LayerByPos(), CLayeredLayout::x_LayerBySize(), CLayoutTrack::x_RenderTitleBar(), CLayoutTrackHandler::x_StartMoving(), CGraphOverlay::x_UpdateBoundingBox(), CSegmentGlyph::x_UpdateBoundingBox(), CGlyphContainer::x_UpdateBoundingBox(), CAlignGlyph::x_UpdateBoundingBox(), CGraphTrack::x_UpdateBoundingBox(), CClonePlacementGlyph::x_UpdateBoundingBox(), CLinkedFeatsGroup::x_UpdateBoundingBox(), CLayoutGroup::x_UpdateBoundingBox(), CFeatGlyph::x_UpdateBoundingBox(), CDummyTrack::x_UpdateBoundingBox(), CGlyphContainer::x_UpdateComments(), CGraphOverlay::x_UpdateLegend(), and CHistogramGlyph::x_UpdateLegend().

int CSeqGlyph::GetLevel ( ) const
inline
TModelRect CSeqGlyph::GetModelRect ( ) const
inline
CSeqGlyph::ENeighbours CSeqGlyph::GetNeighbours ( ) const
inline

Definition at line 599 of file seq_glyph.hpp.

References m_Neighbours.

const CSeqGlyph * CSeqGlyph::GetParent ( void  ) const
inline
CSeqGlyph * CSeqGlyph::GetParent ( void  )
inline

Definition at line 595 of file seq_glyph.hpp.

References m_Parent.

virtual string CSeqGlyph::GetPName ( ) const
inlinevirtual

persistent name of the glyph should not depend on the instance of the glyph, but should uniquely reflect its contents so two glyphs having the same contents will have the same name currently used to track isDrawn() status for expandable glyphs default implementation returns an empty string implementations exist for CFeatGlyph (name of the contained feature) and CLayoutGroup (concatenation of all sorted children names)

Reimplemented in CFeatGlyph.

Definition at line 282 of file seq_glyph.hpp.

const TModelPoint & CSeqGlyph::GetPos ( void  ) const
inline

Definition at line 580 of file seq_glyph.hpp.

References m_Pos.

void CSeqGlyph::GetPosInWorld ( TModelPoint pos) const
inline
TSeqRange CSeqGlyph::GetRange ( void  ) const
inlinevirtual
const CRenderingContext * CSeqGlyph::GetRenderingContext ( ) const
inline
TModelUnit CSeqGlyph::GetRight ( ) const
inlinevirtual
size_t CSeqGlyph::GetTearline ( ) const
inline

Definition at line 705 of file seq_glyph.hpp.

References m_Tearline.

Referenced by CFeatGlyph::GetLabel().

void CSeqGlyph::GetTooltip ( const TModelPoint ,
ITooltipFormatter tt,
string t_title 
) const
virtual
TModelUnit CSeqGlyph::GetTop ( ) const
inlinevirtual
TModelUnit CSeqGlyph::GetWidth ( void  ) const
inlinevirtual
virtual bool CSeqGlyph::HasSideLabel ( ) const
inlinevirtual

Query if there is label and label is on the side.

This method may not be applicable to all different types of glyphs. It is up to the concrete glyph to implement. By default, it returns false. Putting this in this base class is just for the sake of inline layout policy to determine if special actions need to take if there is sided label.

Reimplemented in CFeatGlyph, CClonePlacementGlyph, and CSegmentGlyph.

Definition at line 184 of file seq_glyph.hpp.

CRef< CSeqGlyph > CSeqGlyph::HitTest ( const TModelPoint p)
virtual

Hit testing.

Test whether a given point in PARENT's COORD. SYSTEM falls inside this layout object. Recursive hit testing may happen if this layout object is a container of other layout objects.

Returns
the object that gets hit.

Reimplemented in CLinkedFeatsGroup, CLayoutGroup, CGraphOverlay, CGlyphContainer, CSequenceTrack, and CFeaturePanel.

Definition at line 104 of file seq_glyph.cpp.

References IsIn(), and CRef< C, Locker >::Reset().

Referenced by CLayoutGroup::HitTest().

bool CSeqGlyph::Intersects ( const TModelRect rect,
TConstObjects objs 
) const
virtual

Intersect testing.

Test weather a given rectangular area intersects with this layout object. Recursive intersect testing is necessary if the layout object is a container of other containers. All the intersected leaf objects will be added into objs. The rect is in parent's coord system.

Reimplemented in CLinkedFeatsGroup, CLayoutGroup, and CGlyphContainer.

Definition at line 114 of file seq_glyph.cpp.

References GetModelRect(), and CGlRect< T >::Intersects().

virtual bool CSeqGlyph::IsClickable ( ) const
inlinevirtual

Query if this glyph is clickable.

Mainly for chaging mouse cursor for clickable glyph. By default, it returns false. If a glyph is clickable, but there is no need to change mouse cursor due to any other reason, such as there is already other visual hint, then don't need to override this function.

Reimplemented in CAlnStatGlyph, CHistogramGlyph, CFeatGlyph, CLinkedFeatsGroup, CBinsGlyph, CClonePlacementGlyph, CTraceGlyph, CSegmentSmearGlyph, CGeneMarkerGlyph, CAlignGlyph, CLDBlockGlyph, CSegmentGlyph, CTranslationGlyph, CScatterPlotGlyph, CAlignSmearGlyph, CLegendItemGlyph, CMatePairGlyph, and CVisRangeGlyph.

Definition at line 192 of file seq_glyph.hpp.

Referenced by CSeqGraphicPane::OnMotion(), and CAlnVecRow::OnMouseEvent().

bool CSeqGlyph::IsHighlighted ( ) const
inline
bool CSeqGlyph::IsIn ( const TModelPoint p) const
inline
bool CSeqGlyph::IsIn ( TModelUnit  x,
TModelUnit  y 
) const
bool CSeqGlyph::IsSelected ( ) const
inline
bool CSeqGlyph::LessByPos ( const CSeqGlyph obj) const
inline

compare this object to another, based on glyph geometry position.

Notice that glyph geometry position may be the same as sequence position if there is not additional visual features showing up at the start and the end of the glyph. E.g. the possible visual featue can be the side label.

Definition at line 512 of file seq_glyph.hpp.

References GetLeft(), and GetRight().

Referenced by SGlyphByPos::operator()(), and operator<().

bool CSeqGlyph::LessBySeqPos ( const CSeqGlyph obj) const
inlinevirtual
bool CSeqGlyph::LessBySeqSize ( const CSeqGlyph obj) const
inline

compare this object to another, based on sequence size.

Definition at line 519 of file seq_glyph.hpp.

References GetLength(), COpenRange< Position >::GetLength(), and GetRange().

Referenced by SGlyphBySeqSize::operator()(), and SGlyphBySeqSize::s_CompareCRefs().

bool CSeqGlyph::LessBySize ( const CSeqGlyph obj) const
inline

compare this object to another, based on geometry size.

Notice that sequence size and glyph geometry size may be the same for some cases.

Definition at line 525 of file seq_glyph.hpp.

References GetWidth(), and m_Width.

Referenced by SGlyphBySize::operator()().

bool CSeqGlyph::NeedTooltip ( const TModelPoint ,
ITooltipFormatter ,
string t_title 
) const
virtual

Check if need to show tooltip.

If the tooltip retrieval is trivial, the derived glyph may decide to fill out the tooltip (info object) in this call.

Reimplemented in CAlnStatGlyph, CLayoutTrack, CHistogramGlyph, CFeatGlyph, CLinkedFeatsGroup, CBinsGlyph, CClonePlacementGlyph, CTraceGlyph, CSegmentSmearGlyph, CGeneMarkerGlyph, CAlignGlyph, CLDBlockGlyph, CSequenceTrack, CSegmentGlyph, CTranslationGlyph, CScatterPlotGlyph, CAlignSmearGlyph, CCommentGlyph, CMatePairGlyph, CVisRangeGlyph, and CRsitesGlyph.

Definition at line 124 of file seq_glyph.cpp.

bool CSeqGlyph::OnContextMenu ( wxContextMenuEvent &  event)
virtual

Reimplemented in CLegendItemGlyph.

Definition at line 79 of file seq_glyph.cpp.

Referenced by CSeqGraphicPane::OnContextMenu().

bool CSeqGlyph::OnLeftDblClick ( const TModelPoint )
virtual
bool CSeqGlyph::OnLeftDown ( const TModelPoint )
virtual

Reimplemented in CLayoutTrack.

Definition at line 62 of file seq_glyph.cpp.

Referenced by CSeqGraphicPane::OnLeftDown(), and CAlnVecRow::OnMouseEvent().

bool CSeqGlyph::OnLeftUp ( const TModelPoint )
virtual

Definition at line 68 of file seq_glyph.cpp.

Referenced by CAlnVecRow::OnMouseEvent().

bool CSeqGlyph::PointInRect ( const TModelPoint p,
const TModelRect rc 
)
inlinestatic
bool CSeqGlyph::PointInRect ( TModelUnit  x,
TModelUnit  y,
const TModelRect rc 
)
inlinestatic
void CSeqGlyph::SetHeight ( TModelUnit  h)
inlinevirtual
virtual void CSeqGlyph::SetHideLabel ( bool  )
inlinevirtual

Force to hide label.

This method may not be applicable to all different types of glyphs. It is up to the concrete glyph to implement. By default, it does nothing. Putting this in the base class is just for the sake of inline layout policy to make sure not overlaping between glyph's label and other glyphs or lables.

Reimplemented in CFeatGlyph, CClonePlacementGlyph, and CSegmentGlyph.

Definition at line 176 of file seq_glyph.hpp.

Referenced by CInlineLayout::x_BuildLayout1Row(), CInlineLayout::x_BuildLayoutMultiRows(), and CFeatureTrack::x_InitGlyphs_Recursive().

void CSeqGlyph::SetHighlighted ( bool  flag)
inline
void CSeqGlyph::SetHighlightsColor ( const CRgbaColor hl_color)
inline
void CSeqGlyph::SetHighlightsColor ( const string hl_color_str)

Definition at line 144 of file seq_glyph.cpp.

References Error(), LOG_POST, and m_HighlightsColor.

void CSeqGlyph::SetLeft ( TModelUnit  l)
inlinevirtual
void CSeqGlyph::SetLevel ( int  Level)
inline
void CSeqGlyph::SetNeighbours ( CSeqGlyph::ENeighbours  neighbours)
inline

Definition at line 643 of file seq_glyph.hpp.

References m_Neighbours.

Referenced by CInlineLayout::x_BuildLayoutMultiRows().

void CSeqGlyph::SetParent ( CSeqGlyph p)
inline
CSeqGlyph * CSeqGlyph::SetParent ( void  )
inline

Definition at line 635 of file seq_glyph.hpp.

References m_Parent.

void CSeqGlyph::SetPos ( const TModelPoint upper_left)
inlinevirtual

Definition at line 631 of file seq_glyph.hpp.

References m_Pos.

Referenced by CLayoutTrackHandler::x_StartMoving().

void CSeqGlyph::SetRender ( IGlyphRenderer renderer)
inline

set customized renderer for this layout objects.

Definition at line 649 of file seq_glyph.hpp.

References m_Renderer.

void CSeqGlyph::SetRenderingContext ( CRenderingContext context)
inline
bool CSeqGlyph::SetSelected ( bool  flag)
inlinevirtual

Select or deselect this glyph.

By default, it only set/unset m_Selected flag. Some concrete glyphs may need to override this method to change other glyph properties and layout when selected or deselected, e.g. show additional features. returns true if a layout update (ePUA_CallLayoutChanged) is required after all selections are processed

Reimplemented in CFeatGlyph, and CLinkedFeatsGroup.

Definition at line 494 of file seq_glyph.hpp.

References m_Selected.

Referenced by CLinkedFeatsGroup::SetSelected(), CFeatGlyph::SetSelected(), CSelectionVisitor::Visit(), and CSelectionVisitor::x_DoSelection().

void CSeqGlyph::SetTearline ( size_t  Tearline)
inline

tearline text – used if a list of glyphs is truncated for some reason

Definition at line 699 of file seq_glyph.hpp.

References m_Tearline.

Referenced by CSGFeatureJob::x_CreateFeature_Recursive().

void CSeqGlyph::SetTop ( TModelUnit  b)
inlinevirtual
void CSeqGlyph::SetWidth ( TModelUnit  w)
inlinevirtual
void CSeqGlyph::Update ( bool  )
virtual

Update content and layout including the bounding box.

Parameters
layout_onlyif true only update the layout not the content. May need to update the layout only under certain situation, e.g. selection. The update is recursive if this is a container layout. By default, it updates the bounding box only.

Reimplemented in CDummyTrack, CSixFramesTransTrack, CLinkedFeatsGroup, CLayoutGroup, CGlyphContainer, CFeaturePanel, CGeneGroup, and CDataTrack.

Definition at line 84 of file seq_glyph.cpp.

References x_UpdateBoundingBox().

Referenced by CTrackContainer::AddTracks(), CGraphTrack::SetLayout(), CGeneGroup::Update(), CFeaturePanel::Update(), CInlineLayout::x_BuildLayout1Row(), CInlineLayout::x_BuildLayoutMultiRows(), CLayoutTrack::x_Expand(), CLayoutTrackHandler::x_StartMoving(), and CGraphOverlay::x_UpdateTrackSettings().

virtual void CSeqGlyph::x_Draw ( ) const
protectedpure virtual
void CSeqGlyph::x_DrawHighlight ( ) const
protectedvirtual
void CSeqGlyph::x_DrawInnerLabelColumns ( TModelUnit  base,
const string label,
const CRgbaColor color,
const CGlTextureFont font,
bool  side_label_visible 
) const
protected
void CSeqGlyph::x_DrawInnerLabels ( TModelUnit  base,
const string label,
const CRgbaColor color,
const CGlTextureFont font,
bool  side_label_visible,
vector< TModelRange > *  labels_ranges = nullptr,
TSeqRange interval = nullptr,
bool  XOR_mode = false 
) const
protected
void CSeqGlyph::x_DrawTruncatedLabel ( const string label,
const CGlTextureFont font,
TModelUnit  width,
TModelUnit  x,
TModelUnit  y,
vector< TModelRange > *  labels_ranges = nullptr 
) const
protected
void CSeqGlyph::x_InitHTMLActiveArea ( CHTMLActiveArea area) const
protected
void CSeqGlyph::x_Local2World ( TModelPoint p) const
inlineprotected
void CSeqGlyph::x_Local2World ( TModelUnit x,
TModelUnit y 
) const
protected

Definition at line 335 of file seq_glyph.cpp.

References GetTop(), m_Parent, and x_Local2World().

void CSeqGlyph::x_OnLayoutChanged ( )
protectedvirtual
void CSeqGlyph::x_Parent2Local ( TModelPoint pnt) const
inlineprotected
void CSeqGlyph::x_Parent2Local ( TModelUnit ,
TModelUnit y 
) const
inlineprotected

Transform the coordiante from parent coord. to local coord.

Definition at line 683 of file seq_glyph.hpp.

References m_Pos, and CGlPoint< T >::Y().

void CSeqGlyph::x_Parent2Local ( TModelRect rect) const
inlineprotected

Transform the coordiante from parent coord. to local coord.

Definition at line 687 of file seq_glyph.hpp.

References m_Pos, CGlRect< T >::Offset(), and CGlPoint< T >::Y().

virtual void CSeqGlyph::x_UpdateBoundingBox ( )
protectedpure virtual
bool CSeqGlyph::x_Visible_V ( ) const
protected
void CSeqGlyph::x_World2Local ( TModelPoint p) const
inlineprotected
void CSeqGlyph::x_World2Local ( TModelUnit x,
TModelUnit y 
) const
protected

Definition at line 326 of file seq_glyph.cpp.

References m_Parent, x_Parent2Local(), and x_World2Local().

Member Data Documentation

CRenderingContext* CSeqGlyph::m_Context
protected

the rendering context

Definition at line 325 of file seq_glyph.hpp.

Referenced by CLayoutGroup::Append(), CHistogramGlyph::DrawGrid(), CAlignGlyph::DrawPWAlignElem(), CFeatGlyph::GetBarCenter(), CRsitesGlyph::GetHTMLActiveAreas(), CMatePairGlyph::GetHTMLActiveAreas(), CGeneMarkerGlyph::GetHTMLActiveAreas(), CBinsGlyph::GetHTMLActiveAreas(), CFeatGlyph::GetHTMLActiveAreas(), CHistogramGlyph::GetHTMLActiveAreas(), CSegmentGlyph::GetLabel(), CClonePlacementGlyph::GetLabel(), CFeatGlyph::GetRelatedGlyphSelected(), GetRenderingContext(), CSegmentGlyph::GetSignature(), CAlignGlyph::GetSignature(), CClonePlacementGlyph::GetSignature(), CFeatGlyph::GetSignature(), CAlignGlyph::GetTitle(), CSegmentGlyph::GetTooltip(), CSequenceTrack::GetTooltip(), CAlignGlyph::GetTooltip(), CAlnStatGlyph::GetTooltip(), CRsitesGlyph::HasVisibleRsite(), CSequenceTrack::InitHTMLActiveArea(), CLayoutGroup::Insert(), CLayoutGroup::InsertAft(), IsIn(), CRsitesGlyph::NeedTooltip(), CSequenceTrack::NeedTooltip(), CAllOtherFeaturesTrack::NoSubtrackEver(), CTrackContainer::NoSubtrackEver(), CLDBlockGlyph::OnLeftDblClick(), CLayoutTrack::OnLeftDown(), CFeaturePanel::OnTrackInitFinished(), CLayoutGroup::PushBack(), CLayoutGroup::PushFront(), CTrackContainer::RemoveEmptyTracks(), CLayoutGroup::Replace(), CLayoutGroup::Set(), CGlyphContainer::SetCommentGlyphs(), CGlyphContainer::SetComments(), CFeaturePanel::SetExternalGlyphs(), CFeaturePanel::SetInputObject(), CGlyphContainer::SetLabelGlyphs(), CGraphTrack::SetLayout(), CFeatGlyph::SetRelatedGlyphSelected(), SetRenderingContext(), CFeaturePanel::Update(), CGlyphContainer::Update(), CSixFramesTransTrack::Update(), CAlignmentTrack::x_AddAlignFeat_Recursive(), CAlignmentTrack::x_AddAlignmentLayout(), CFeatureTrack::x_AddFeaturesLayout(), CGeneModelTrack::x_AddLandMarkFeaturesLayout(), CGeneModelTrack::x_AddMainFeaturesLayout(), CAlignGlyph::x_CalcIntervals(), CFeaturePanel::x_ConfigureSubtracks(), CTrackContainer::x_ConvertToContainer(), CFeaturePanel::x_CreateLevelTrack(), CCdsGlyph::x_Draw(), CVisRangeGlyph::x_Draw(), CLegendItemGlyph::x_Draw(), CRsitesGlyph::x_Draw(), CNamedGroup::x_Draw(), CAlignSmearGlyph::x_Draw(), CCommentGlyph::x_Draw(), CGeneGroup::x_Draw(), CSegmentSmearGlyph::x_Draw(), CScatterPlotGlyph::x_Draw(), CTranslationGlyph::x_Draw(), CLDBlockGlyph::x_Draw(), CGeneMarkerGlyph::x_Draw(), CSegmentGlyph::x_Draw(), CFeaturePanel::x_Draw(), CMatePairGlyph::x_Draw(), CTraceGlyph::x_Draw(), CBinsGlyph::x_Draw(), CClonePlacementGlyph::x_Draw(), CLinkedFeatsGroup::x_Draw(), CLayoutGroup::x_Draw(), CHistogramGlyph::x_Draw(), CFeatGlyph::x_Draw(), CLayoutTrack::x_Draw(), CFeatGlyph::x_DrawAdditionalInfo(), CAlignGlyph::x_DrawAlignRowSequence(), CAlnStatGlyph::x_DrawBarGraph(), CLayoutGroup::x_DrawBoundary(), CLinkedFeatsGroup::x_DrawChildrenOnParent(), CFeatGlyph::x_DrawDeletion(), CAlnStatGlyph::x_DrawDensityTable(), CLinkedFeatsGroup::x_DrawFeatureBar(), CFeatGlyph::x_DrawFeatureBar(), CFeatGlyph::x_DrawFeatureBar_sv(), CSegmentSmearGlyph::x_DrawGaps(), CAlignGlyph::x_DrawGaps(), CHistogramGlyph::x_DrawGraph(), CFeaturePanel::x_DrawHairLine(), CHistogramGlyph::x_DrawHeatMap(), x_DrawHighlight(), x_DrawInnerLabelColumns(), CFeatGlyph::x_DrawInnerLabels(), x_DrawInnerLabels(), CFeatGlyph::x_DrawInsertion(), CAlignGlyph::x_DrawInserts(), CLDBlockLine::x_DrawLabel(), CLinkedFeatsGroup::x_DrawLabels(), CFeatGlyph::x_DrawLabelWithXPinned(), CFeatGlyph::x_DrawLabelWithYPinned(), CHistogramGlyph::x_DrawLinearRuler(), CHistogramGlyph::x_DrawLogRuler(), CAlignGlyph::x_DrawMultiAlign(), CAlignGlyph::x_DrawMultiAlignLabel(), CAlignGlyph::x_DrawNonConsensusSpliceSites(), CAlignGlyph::x_DrawNoScoreAlign(), CCdsGlyph::x_DrawProjectedProtSeq(), CFeatGlyph::x_DrawProjectedRuler(), CCdsGlyph::x_DrawProtSeqWithMapping(), CAlignGlyph::x_DrawPWAlign(), CFeatGlyph::x_DrawRNAProductSequence(), CFeatGlyph::x_DrawRSites(), CFeatGlyph::x_DrawRuler(), CTranslationGlyph::x_DrawSequence(), CAlignGlyph::x_DrawSimplified(), CAlignGlyph::x_DrawStrandIndicators(), CAlignGlyph::x_DrawTailGlyphs(), x_DrawTruncatedLabel(), CAlignGlyph::x_DrawUnalignedBar(), CAlignGlyph::x_DrawUnalignedRowSequence(), CSequenceTrack::x_GetBarHeight(), CFeatGlyph::x_GetBarHeight(), CClonePlacementGlyph::x_GetBarSize(), CSixFramesTransTrack::x_GetCurrentTransRange(), CLayoutTrack::x_GetIconRect(), CAlignGlyph::x_GetTailLabelWidth(), CFeaturePanel::x_GetTBRect(), CLayoutTrack::x_GetTBRect(), CLayoutTrack::x_HitTitleBar(), CGeneModelTrack::x_InitFeature_Recursive(), CFeatureTrack::x_InitGlyphs_Recursive(), CGraphTrack::x_InitGrid(), x_InitHTMLActiveArea(), CLDBlockTrack::x_IsOverviewMode(), CHapmapTrack::x_IsOverviewMode(), CBinsTrack::x_IsOverviewMode(), CLinkedFeatsGroup::x_LabelFirst(), CAlignmentTrack::x_LoadAlignedSeqFeats(), CAllOtherFeaturesTrack::x_OnAllJobsFinished(), CFeaturePanel::x_OnColorIconClicked(), CSequenceTrack::x_OnJobCompleted(), CTrackContainer::x_OnJobCompleted(), CCdsGlyph::x_PutCodon(), CAllOtherFeaturesTrack::x_ReinitSubtracks(), CTrackContainer::x_ReinitTrack(), CAlignGlyph::x_RenderAveragableScores(), CTraceGlyph::x_RenderConfGraph(), CTraceGraphTrack::x_RenderContent(), CSequenceTrack::x_RenderContent(), CGraphOverlay::x_RenderContent(), CGraphTrack::x_RenderContent(), CTraceGlyph::x_RenderCurveSegment(), CFeaturePanel::x_RenderFeatureGrid(), CFeaturePanel::x_RenderHairLineSelections(), CLayoutTrack::x_RenderIcon(), CTraceGlyph::x_RenderIntensityGraphs(), CAlignGlyph::x_RenderNonAveragableScores(), CLayoutTrack::x_RenderProgressBar(), CSequenceTrack::x_RenderSequence(), CTraceGlyph::x_RenderSignalGraph(), CFeaturePanel::x_RenderTitleBar(), CLayoutTrack::x_RenderTitleBar(), CGeneGroup::x_ShowGeneLabel(), CSegmentGlyph::x_ShowLabel(), CAlignGlyph::x_ShowLabel(), CClonePlacementGlyph::x_ShowLabel(), CFeatGlyph::x_ShowLabel(), CFeatGlyph::x_ShowRuler(), CAlignGlyph::x_ShowScore(), CSequenceTrack::x_ShowSegMap(), CAlignGlyph::x_ShowUnalignedTails(), CRsitesGlyph::x_UpdateBoundingBox(), CAlignSmearGlyph::x_UpdateBoundingBox(), CNamedGroup::x_UpdateBoundingBox(), CCommentGlyph::x_UpdateBoundingBox(), CSegmentSmearGlyph::x_UpdateBoundingBox(), CSequenceTrack::x_UpdateBoundingBox(), CGraphOverlay::x_UpdateBoundingBox(), CSegmentGlyph::x_UpdateBoundingBox(), CMatePairGlyph::x_UpdateBoundingBox(), CAlignGlyph::x_UpdateBoundingBox(), CGraphTrack::x_UpdateBoundingBox(), CTraceGlyph::x_UpdateBoundingBox(), CClonePlacementGlyph::x_UpdateBoundingBox(), CLinkedFeatsGroup::x_UpdateBoundingBox(), CLayoutGroup::x_UpdateBoundingBox(), CAlnStatGlyph::x_UpdateBoundingBox(), CFeatGlyph::x_UpdateBoundingBox(), CLayoutTrack::x_UpdateBoundingBox(), CGlyphContainer::x_UpdateComments(), CLDBlockTrack::x_UpdateData(), CHapmapTrack::x_UpdateData(), CBinsTrack::x_UpdateData(), CSnpTrack::x_UpdateData(), CSegmentMapTrack::x_UpdateData(), CGeneModelTrack::x_UpdateData(), CGraphTrack::x_UpdateData(), CSequenceTrack::x_UpdateData(), CFeatureTrack::x_UpdateData(), CEpigenomicsTrack::x_UpdateData(), CAlignmentTrack::x_UpdateData(), CSixFramesTransTrack::x_UpdateData(), CGraphOverlay::x_UpdateLegend(), CHistogramGlyph::x_UpdateLegend(), CSixFramesTransTrack::x_UpdateTitle(), x_Visible_V(), and CCdsGlyph::x_WillFit().

TModelUnit CSeqGlyph::m_Height
private

object height

Definition at line 332 of file seq_glyph.hpp.

Referenced by GetBottom(), GetHeight(), GetModelRect(), and SetHeight().

bool CSeqGlyph::m_Highlighted
private

Definition at line 337 of file seq_glyph.hpp.

Referenced by IsHighlighted(), and SetHighlighted().

unique_ptr<CRgbaColor> CSeqGlyph::m_HighlightsColor
protected
int CSeqGlyph::m_Level
private

shows how deep is the glyph in an hierarchy (0 being closer to root, -1 undefined)

Definition at line 343 of file seq_glyph.hpp.

Referenced by GetLevel(), and SetLevel().

ENeighbours CSeqGlyph::m_Neighbours
protected

Indicates whether the glyph has neighbours.

Definition at line 327 of file seq_glyph.hpp.

Referenced by GetNeighbours(), SetNeighbours(), and CFeatGlyph::x_DrawFeatureBar().

CSeqGlyph* CSeqGlyph::m_Parent
protected

parent/child relationships for this feature

Definition at line 324 of file seq_glyph.hpp.

Referenced by GetParent(), SetParent(), x_Local2World(), x_OnLayoutChanged(), CFeatGlyph::x_RedundantLabelCheck(), and x_World2Local().

TModelPoint CSeqGlyph::m_Pos
private

upper left corner position in parent coord

Definition at line 334 of file seq_glyph.hpp.

Referenced by GetBottom(), GetLeft(), GetModelRect(), GetPos(), GetPosInWorld(), GetRange(), GetRight(), GetTop(), SetLeft(), SetPos(), SetTop(), and x_Parent2Local().

CIRef<IGlyphRenderer> CSeqGlyph::m_Renderer
private

user-defined renderer

Definition at line 335 of file seq_glyph.hpp.

Referenced by Draw(), and SetRender().

bool CSeqGlyph::m_Selected
private

Definition at line 336 of file seq_glyph.hpp.

Referenced by IsSelected(), and SetSelected().

size_t CSeqGlyph::m_Tearline
private

Definition at line 340 of file seq_glyph.hpp.

Referenced by GetTearline(), and SetTearline().

TModelUnit CSeqGlyph::m_Width
private

object width

Definition at line 333 of file seq_glyph.hpp.

Referenced by GetModelRect(), GetRange(), GetRight(), GetWidth(), LessBySize(), and SetWidth().


The documentation for this class was generated from the following files:
Modified on Fri Sep 22 15:42:37 2017 by modify_doxy.py rev. 546573