objects::CSeq_loc;
42 usingobjects::CSeq_loc_CI;
49, m_Neighbours(eNghbrs_None)
54, m_Highlighted(
false)
158 if(hl_color_str.empty())
165 LOG_POST(
Error<<
"Invalid highlighting color specified, falling back to default. "<< err);
186 unsignedlabelsCount(1);
197 stringsLabelTextOut(
label);
202 if(label_width > max_width) {
203label_width = max_width;
204sLabelTextOut = font.
Truncate(sLabelTextOut.c_str(), label_width);
208 TModelUnitlabel_base = base + (font_height * 0.5);
214 for(
unsigned i= 0;
i< labelsCount; ++
i) {
216 TModelRangelabel_range(label_x - label_width / 2.0, label_x + label_width / 2.0);
218 if(label_range != label_range2)
220 m_Context->
TextOut(&font, sLabelTextOut.c_str(), label_x, label_base,
true,
true);
239 if(0 == labelsCount) {
253 stringsLabelTextOut(
label);
258 if(label_width > max_width) {
259label_width = max_width;
260sLabelTextOut = font.
Truncate(sLabelTextOut.c_str(), label_width);
265 TModelUnitlabel_base = base + (font_height * 0.5);
268glAlphaFunc(GL_GREATER, 0.2f);
269glEnable(GL_ALPHA_TEST);
270glEnable(GL_COLOR_LOGIC_OP);
278 stringsTruncatedLabel(sLabelTextOut);
280 if(!labelsPerExon) {
288 for(
int i= 0;
i< labelsPerExon; ++
i) {
289label_x = interval->
GetFrom() + part_size / 2.0 +
i*part_size;
297 for(
int i= 0;
i< labelsCount; ++
i) {
298label_x = visible_bar.
GetFrom() + part_size / 2.0 +
i*part_size;
299 m_Context->
TextOut(&font, sLabelTextOut.c_str(), label_x, label_base,
true,
true);
301labels_ranges->push_back(
TModelRange(label_x - half_label, label_x + half_label));
306glDisable(GL_COLOR_LOGIC_OP);
307glDisable(GL_ALPHA_TEST);
313 if(width < m_Context->GetMinLabelWidthPos())
316 stringlabel_text(
label);
321 if(label_width > available_width) {
322label_width = available_width;
326 const size_tmin_length = 7;
327 if(label_text.size() < min_length)
333labels_ranges->push_back(
TModelRange(x - half_label, x + half_label));
341gl.
Color4f(0.3f, 0.21f, 0.07f, 0.25f);
416to = SeqRange.
GetTo() > visible_range.
GetTo() ? visible_range.
GetTo() : SeqRange.
GetTo();
417 if(visible_range.
Empty())
void TextOut(const CGlTextureFont *font, const char *text, TModelUnit x, TModelUnit y, bool center, bool adjust_flip=true) const
void DrawHighlight(const TModelRect &rect, const CRgbaColor *color=0) const
CGlPane * GetGlPane()
inline method implementations
const TModelRange & GetVisibleRange() const
TModelRange IntersectVisible_Y(const TModelRange &r) const
inttersect with the vertical visible screen space.
TModelRange IntersectVisible(const CSeqGlyph *obj) const
TModelUnit GetMinLabelWidthPos() const
TVPUnit SeqToScreenXClipped(const TModelUnit &size) const
void DrawQuad(const TModelRect &rc, bool border=false) const
TModelUnit SeqToScreen(const TModelUnit &size) const
convert from sequence positions to screen pixels
TModelUnit GetMaxLabelWidth(const CGlBitmapFont &font) const
In screen pixel..
TModelUnit ScreenToSeq(const TModelUnit &size) const
convert from screen pixels to sequence positions
bool IsFlippedStrand() const
TSeqPos GetViewWidth() const
class CRgbaColor provides a simple abstraction for managing colors.
void SetHighlightsColor(const CRgbaColor &hl_color)
void x_InitHTMLActiveArea(CHTMLActiveArea &area) const
initialize the basic information for a given active area.
CRenderingContext * m_Context
the rendering context
virtual bool HitTestHor(TSeqPos x, const CObject *obj)
virtual void x_OnLayoutChanged()
update the layout.
void x_Parent2Local(TModelPoint &pnt) const
Transform the coordiante from parent coord. to local coord.
virtual TModelUnit GetRight() const
void x_DrawInnerLabelColumns(TModelUnit base, const string &label, const CRgbaColor &color, const CGlTextureFont &font, bool side_label_visible) const
virtual void x_Draw() const =0
The default renderer for this layout object.
void x_DrawInnerLabels(TModelUnit base, const string &label, const CRgbaColor &color, const CGlTextureFont &font, bool side_label_visible, bool inside_only, vector< TModelRange > *labels_ranges=nullptr, TSeqRange *interval=nullptr, bool XOR_mode=false) const
virtual void GetTooltip(const TModelPoint &, ITooltipFormatter &tt, string &t_title) const
Get the tooltip if available.
virtual bool NeedTooltip(const TModelPoint &, ITooltipFormatter &, string &) const
Check if need to show tooltip.
bool IsInHor(TModelUnit x) const
void x_DrawException() const
Draw a shading background to indicate exception.
bool IsIn(const TModelPoint &p) const
Hit test for points in PARENT COORD.
virtual CRef< CSeqGlyph > HitTest(const TModelPoint &p)
Hit testing.
virtual bool OnLeftUp(const TModelPoint &)
virtual bool OnLeftDblClick(const TModelPoint &)
virtual TSeqRange GetRange(void) const
get the total range of this object.
CSeqGlyph * m_Parent
parent/child relationships for this feature
virtual TModelUnit GetTop() const
virtual TModelUnit GetHeight() const
virtual bool OnLeftDown(const TModelPoint &)
unique_ptr< CRgbaColor > m_HighlightsColor
Highlight color.
virtual void Update(bool)
Update content and layout including the bounding box.
bool x_IntersectVisible(const CRange< T > &SeqRange, T &from, T &to) const
void Draw() const
render the layout.
bool x_Visible_V() const
is this glyph visible in vertical direction?
void x_DrawTruncatedLabel(const string &label, const CGlTextureFont &font, TModelUnit width, TModelUnit x, TModelUnit y, vector< TModelRange > *labels_ranges=nullptr) const
virtual void x_DrawHighlight() const
void x_Local2World(TModelPoint &p) const
Transform the coordiantes from local coord. to world coord.
virtual bool Intersects(const TModelRect &rect, TConstObjects &objs) const
Intersect testing.
CIRef< IGlyphRenderer > m_Renderer
user-defined renderer
virtual void x_UpdateBoundingBox()=0
Update the bounding box assuming children's sizes are fixed if any.
virtual TModelUnit GetLeft() const
TModelRect GetModelRect() const
get the bounding box.
void x_World2Local(TModelPoint &p) const
Transform the coordiante from world coord. to local coord.
virtual TModelUnit GetBottom() const
virtual bool OnContextMenu(wxContextMenuEvent &event)
list< CConstRef< CSeqGlyph > > TConstObjects
bool IsHighlighted() const
unsigned int TSeqPos
Type for sequence locations and lengths.
#define LOG_POST(message)
This macro is deprecated and it's strongly recomended to move in all projects (except tests) to macro...
void Error(CExceptionArgs_Base &args)
IRender & GetGl()
convenience function for getting current render manager
TVPRect & GetViewport(void)
virtual TModelUnit TextHeight(const CGlTextureFont *font) const =0
virtual TModelUnit TextWidth(const CGlTextureFont *font, const char *text) const =0
CRange< TModelUnit > TModelRange
void Color4f(GLfloat r, GLfloat g, GLfloat b, GLfloat a)
virtual void ColorC(const CRgbaColor &c)=0
Set current color (glColor{3,4}{f,d}{v,})
bool Intersects(const CGlRect &R) const
string Truncate(const char *text, TModelUnit w, ETruncate trunc=eTruncate_Ellipsis) const
Truncate text to the secified width.
void Reset(void)
Reset reference object.
position_type GetLength(void) const
TThisType IntersectionWith(const TThisType &r) const
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static const char label[]
TTo GetTo(void) const
Get the To member data.
TFrom GetFrom(void) const
Get the From member data.
Useful/utility classes and methods.
static const TModelUnit kUndefined
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4