1 #ifndef __GUI_WIDGETS_ALNMULTI___ALNMULTI_RENDERER__HPP
2 #define __GUI_WIDGETS_ALNMULTI___ALNMULTI_RENDERER__HPP
64 fShownElement_Header = 1,
65 fShownElement_Ruler = 2,
68 fShownElement_MasterRow = 4,
69 fShownElement_Alignment = 8,
70 fShownElement_Track = 16,
71 fShownElement_Main = 32,
72 fShownElement_All = 0xffff
137 virtual void SetupColumns(
const TVPRect& rc);
150 virtual void Resize(
const TVPRect& rc);
151 virtual TVPRect GetRect()
const;
153 virtual void Update(
bool layout_only =
false);
154 virtual void UpdateOnDataChanged();
157 virtual void Render();
160 virtual void Render(TAreaVector& areas);
162 virtual bool NeedTooltip(
int vp_x,
int vp_y);
163 virtual string GetTooltip();
165 virtual string GetAlignmentTooltip(
int x,
int y,
IAlignRow*
row,
bool master);
178 int GetListTop()
const;
179 int GetColumnIndexByType(TColumnType
type)
const;
180 TVPRect GetColumnRect(
int i_col,
bool include_header)
const;
181 TVPRect GetColumnRectByType(TColumnType
type,
bool include_header)
const;
182 TColumnType GetColumnTypeByIndex(
int i_col)
const;
183 TColumnType GetColumnTypeByX(
int vp_x)
const;
186 int GetVPListTop()
const;
196 virtual int HitTest(
int vp_x,
int vp_y,
int& col);
198 void SetupPaneForColumn(
CGlPane& pane,
int i_col)
const;
199 void AutoFitColumns(
const CGlTextureFont& font,
bool for_printer);
204 virtual int GetColumnsCount()
const;
205 virtual const SColumn& GetColumn(
int index)
const;
206 virtual SColumn& GetColumn(
int index);
207 virtual int GetColumnIndexByX(
int x)
const;
208 virtual int GetResizableColumnIndex()
const;
218 int AddColumn(
int width,
const string&
label,
int data);
219 int InsertColumn(
int pos,
int width,
const string&
label,
int data);
220 void SetResizableColumn(
int index);
222 void SetColumns(
const vector<SColumn>&
columns,
int resizable_index);
224 void SetColumnWidth(
int index,
int width);
225 void SetColumnPos(
int index,
int pos);
226 void SetColumnUserData(
int index,
int data);
227 void SetColumnVisible(
int index,
bool b_visible);
228 bool IsColumnVisible(
int index)
const;
232 void GetVisibleColumns(vector<string>& labels);
234 void UpdateColumns();
246 void x_Render(TAreaVector* p_areas);
247 void x_RenderHeader(TAreaVector* p_areas);
248 void x_RenderRuler(TAreaVector* p_areas);
249 void x_RenderItems(TAreaVector* p_areas);
250 void x_RenderItemsRange(
int iFisrt,
int iLast, TAreaVector* p_areas);
252 void x_RenderMasterRow(TAreaVector* p_areas);
253 void x_PrepareMasterPane(
CGlPane& pane);
254 void x_RenderAlignAreaTopLine();
256 void x_ResetRowListMap();
257 void x_InvalidateRows(
bool layout_only =
false);
258 void x_PurgeRowListMap();
260 int x_GetLineByWindowY(
int WinY)
const;
261 int x_GetLineByVPY(
int vp_y)
const;
262 TVPRect x_GetLineRect(
int Index);
269 void x_LayoutColumns();
271 string x_GetRowTooltip(
const TVPPoint& pt,
IAlignRow* p_row,
int i_col,
int vp_top_y);
301 bool m_bCgiMode =
false;
class CAlnMultiRenderer - renders multiple alignment represented by IAlnMultiRendererContext (the Mod...
int m_ResizableColumnIndex
TVPPoint m_TooltipVPPos
is it invoked by alnmulti.cgi
const IAlnMultiRendererContext * x_GetContext() const
TColumnType x_GetColumnType(const SColumn &C)
int GetHeaderAreaHeight() const
vector< SColumn > TColumnVector
IAlignRow::TColumnType TColumnType
CRgbaColor m_MasterBackColor
CAlnMultiRenderer()
Empty object constructor – for two-phase construction call SetupColums() to finish the class construc...
IAlnMultiRendererContext * m_Context
IAlnMultiRendererContext * x_GetContext()
void SetFocused(bool b_set)
int GetMasterAreaHeight() const
CWeakIRef< IAlignRow > m_TooltipRow
int GetListAreaHeight() const
void SetCgiMode(bool b_set)
int GetRulerAreaHeight() const
vector< CHTMLActiveArea > TAreaVector
map< IAlignRow *, bool > TRowToList
class CRgbaColor provides a simple abstraction for managing colors.
CRuler is a renderable object drawing a scale with position labels.
Interface IAlignRow - abstracts row rendering in Multiple Alignment Widget.
IAlnMultiRendererContext - this interface represents context in which CAlnMultiRenderer lives.
virtual IAlignRow * GetConsensusRow()=0
virtual int GetLineByRowNum(TNumrow row) const =0
virtual int GetShownElements()=0
virtual bool IsRendererFocused()=0
virtual bool IsItemSelected(int index) const =0
virtual const CGlPane & GetAlignPort() const =0
virtual bool SortByColumn(TColumnType type, bool ascending)=0
virtual ~IAlnMultiRendererContext()
virtual int GetFocusedItemIndex() const =0
virtual IAlignRow * GetRowByLine(int index)=0
all Y coordinates are OpenGL Viewport coordinates (not widget coords) "index" is a line index (not ro...
virtual int GetLinePosY(int index) const =0
IAlnExplorer::TNumrow TNumrow
virtual int GetLineHeight(int index) const =0
virtual IAlnExplorer::ESortState GetColumnSortState(TColumnType type)=0
IAlignRow::TColumnType TColumnType
virtual IAlignRow * GetMasterRow()=0
virtual int GetLineByModelY(int y) const =0
virtual TNumrow GetLinesCount() const =0
static const column_t columns[]
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
#define NCBI_GUIWIDGETS_ALNMULTIPLE_EXPORT
static const char label[]
The NCBI C++/STL use hints.
#define row(bind, expected)
SColumn describes a single column.