58 m_BackColor(1.0f, 1.0f, 1.0f),
61 m_HitColoringParams(
NULL)
183 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
243 string s_label, q_label;
253 s_label += sequence::CDeflineGenerator().GenerateDefline(s_handle);
264 q_label += sequence::CDeflineGenerator().GenerateDefline(q_handle);
281 for(
size_t ct = 0;
ct <
n;
ct++ ) {
333 int left, right, top, bottom;
341 int s_to = s_from + s_len;
342 int q_to = q_from + q_len;
350 left = s_from; right = s_to;
351 bottom = q_from; top = q_to;
354 left =
min(left, s_from);
355 right =
max(right, s_to);
356 bottom =
min(bottom, q_from);
357 top =
max(top, q_to);
397 vector<string>
types;
415 types.push_back(*it);
424 if(it->m_Type == name) {
437 for(
size_t ct = 0;
ct <
n;
ct++ ) {
443 std::reverse(graphs.begin(), graphs.end());
462 for(
size_t ct = 0;
ct <
n;
ct++ ) {
471 for(
int ct = (
int) graphs.size() - 1;
ct >= 0;
ct-- ) {
472 const string& name = graphs[
ct];
473 TMap::iterator it = name_to_graph.find(name);
476 if(it != name_to_graph.end()) {
479 name_to_graph.erase(it);
485 const string&
type = iter->m_Type;
508 if(it->m_Type == name) {
536 TVPPoint sz_left_ruler, sz_bottom_ruler;
539 int max_num_y = (
int) ceil(rc_m.
Top());
541 int max_num_x = (
int) ceil(rc_m.
Right());
546 int mx_left = query_cont_size.
X()+ sz_left_ruler.
X();
547 int mx_bottom = subj_cont_size.
Y() + sz_bottom_ruler.
Y() + 2;
static void GetGraphTypes(vector< string > &types)
CGraphContainer CGraphContainer a composite IRenderable that manages several child IRenderable graphs...
virtual void RemoveAllGraphs()
virtual void SetVPRect(const TVPRect &rect)
virtual string GetTooltip()
virtual bool NeedTooltip(CGlPane &pane, int vp_x, int vp_y)
virtual void SetModelRect(const TModelRect &rc)
virtual size_t GetGraphsCount() const
virtual void Render(CGlPane &pane)
virtual bool AddGraph(TGraph *graph, bool front=false)
virtual TGraph * GetGraph(size_t index)
virtual TVPPoint PreferredSize()
void SetProperties(const SProperties &props)
virtual IHistogramGraphDS * GetDataSource()
virtual void SetDataSource(IHistogramGraphDS *ds)
const SProperties & GetProperties() const
const TElemGlyphSet & GetSelectedGlyphs() const
void AssignColorsByScore(const SHitColoringParams *params)
void Render(CGlPane &pane)
virtual void DeleteGlyphs()
virtual void CreateGlyph(const IHit &hit_elem)
void SetGraphColor(const string &name, const CRgbaColor &color)
void x_RenderContainers(const CGlPane &port)
void GetGraphTypes(vector< SGraphDescr > &types) const
TVPRect m_rcBottomContainer
virtual void ShowRulers(bool show)
CGraphContainer m_LeftContainer
const SHitColoringParams * m_HitColoringParams
CRegularGridRenderer m_Grid
virtual bool NeedTooltip(int area, int vp_x, int vp_y)
void x_SetGraphs(ESequence seq, const vector< string > &graphs)
IHitMatrixDataSource * m_DataSource
CGlPane & GetSubjectPane()
void x_SetRulerText(IHitMatrixDataSource *ds)
virtual int GetAreaByVPPos(TVPUnit vp_x, TVPUnit vp_y)
CGlPane & GetMatrixPane()
void SetGraphs(ESequence seq, const vector< string > &graphs)
CGraphContainer m_BottomContainer
virtual void ShowGrid(bool show)
void Layout(const CGlPane &pane)
recalculates recatngles for all intrnal objects so that they are positioned correctly with regard to ...
void x_UpdateGraphColor(IRenderable *graph)
TVPRect m_rcLeftContainer
CHistogramGraph * x_CreateHistogram(ESequence seq, const SGraphDescr &descr)
ESequence
identifies one of the two sequences in the pane
void GetGraphs(ESequence seq, vector< string > &graphs) const
virtual ~CHitMatrixRenderer()
vector< SGraphDescr > TGraphTypes
CRef< CGlTextureFont > m_SeqFont
virtual void Update(IHitMatrixDataSource *ds, const CGlPane &port)
TVPRect GetRect(EArea area)
CRef< CHitMatrixSeqGraph > m_QueryGraph
void x_DestroyGraphs(CGraphContainer &cont)
virtual void Render(const CGlPane &port, bool pdf=false)
CRef< CHitMatrixSeqGraph > m_SubjectGraph
void x_RenderAxisAndGrid(const CGlPane &port, CGlPane &gr_pane)
TModelRect GetSelectedHitElemsRect() const
virtual void SetBackgroundColor(CRgbaColor &color)
void ColorByScore(const SHitColoringParams *params)
virtual string GetTooltip(int area)
const string & GetScoreName() const
virtual void Resize(int w, int h, const CGlPane &port)
void x_AdjsutToMasterPane(const CGlPane &port, CGlPane &pane, bool b_model_x, bool b_model_y)
adjusts limits and visible rect of the given pane to the master pane
void SetBioseqHandle(objects::CBioseq_Handle &handle)
void SetFonts(CGlTextureFont *seq_font)
class CRgbaColor provides a simple abstraction for managing colors.
void SetColor(EColorType type, const CRgbaColor &color)
void SetTextLabel(const string &label)
TVPPoint GetPreferredSize(int max_num=0) const
void SetHorizontal(bool b_horz, ELabelPlacement place=eDefault, ELabelAlign aln=eAln_Center)
void SetLabelOrientation(CGlTextureFont::EFontRotateFlags rotate, int rotate_degrees)
void SetDisplayOptions(int options)
virtual void Render(CGlPane &pane)
virtual string GetLabel() const =0
virtual TSeqPos GetQueryLength() const =0
virtual TSignedSeqPos GetQueryStart() const =0
virtual TSeqPos GetSubjectLength() const =0
virtual TSignedSeqPos GetSubjectStart() const =0
IHitMatrixDataSource - abstract Data Source for Hit Matrix Widget.
virtual const THitAdapterCont & GetHits() const =0
virtual IHitSeqId & GetSubjectId() const =0
virtual IHitSeqId & GetQueryId() const =0
vector< IHit * > THitAdapterCont
virtual objects::CBioseq_Handle GetQueryHandle()=0
virtual string GetLabel(const IHitSeqId &id)=0
virtual objects::CBioseq_Handle GetSubjectHandle()=0
IRenderable class IRenderable defines an abstract interface required for rendering graphical panels i...
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
#define NON_CONST_ITERATE(Type, Var, Cont)
Non constant version of ITERATE macro.
void swap(NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair1, NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair2)
void Render(CGlPane *pAreaPane, CGlPane *pPane, CRegularGridGen *pGenerator) const
void EnableOneBased(bool en_x, bool en_y)
plus/minus one base to align grid to ruler bars.
void SetIntegerMode(bool IntegerX, bool IntegerY)
CRegularGridGen inline methods.
void EnableIntegerCentering(bool b_en)
void SetModelLimitsRect(const TModelRect &R)
void SetViewport(const TVPRect &R)
CGlPoint< TVPUnit > TVPPoint
CGlRect & CombineWith(const CGlRect &r)
TVPRect & GetViewport(void)
CGlRect< TVPUnit > TVPRect
TModelRect & GetModelLimitsRect(void)
bool PtInRect(T x, T y) const
void SetVert(T bottom, T top)
void SetVisibleRect(const TModelRect &R)
TModelRect & GetVisibleRect(void)
CGlRect< TModelUnit > TModelRect
void SetHorz(T left, T right)
void EnableOffset(bool b_en=true)
Offset is used as a workaround for OpenGL precision problems emerging when size of visible range is s...
@ fFontRotateBase
Rotate around lower-left corner of unrotated text box.
float GetBlue(void) const
float GetGreen(void) const
float GetAlpha(void) const
float GetRed(void) const
Get specific channels in floating point values.
TObjectType * GetPointer(void) THROWS_NONE
Get pointer,.
void Reset(void)
Reset reference object.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
unsigned int
A callback function used to compare two keys in a database.
static const size_t kMaxRulerLabel
static const char * kSeqGraph
double r(size_t dimension_, const Int4 *score_, const double *prob_, double theta_)
static const struct type types[]