NCBI C++ ToolKit
hit_clustering.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 #ifndef __GUI_WIDGETS_HIT_MATRIX___HIT_CLUSTERING__HPP
2 #define __GUI_WIDGETS_HIT_MATRIX___HIT_CLUSTERING__HPP
3 
4 /* $Id: hit_clustering.hpp 14973 2007-09-14 12:11:32Z dicuccio $
5  * ===========================================================================
6  *
7  * PUBLIC DOMAIN NOTICE
8  * National Center for Biotechnology Information
9  *
10  * This software/database is a "United States Government Work" under the
11  * terms of the United States Copyright Act. It was written as part of
12  * the author's official duties as a United States Government employee and
13  * thus cannot be copyrighted. This software/database is freely available
14  * to the public for use. The National Library of Medicine and the U.S.
15  * Government have not placed any restriction on its use or reproduction.
16  *
17  * Although all reasonable efforts have been taken to ensure the accuracy
18  * and reliability of the software and data, the NLM and the U.S.
19  * Government do not and cannot warrant the performance or results that
20  * may be obtained by using this software or data. The NLM and the U.S.
21  * Government disclaim all warranties, express or implied, including
22  * warranties of performance, merchantability or fitness for any particular
23  * purpose.
24  *
25  * Please cite the author in any work or product based on this material.
26  *
27  * ===========================================================================
28  *
29  * Authors: Andrey Yazhuk
30  *
31  * File Description:
32  *
33  */
34 
35 #include <corelib/ncbistl.hpp>
36 
37 #include <gui/utils/vect2.hpp>
38 
40 
41 class CHitGlyph;
42 class CHitElemGlyph;
43 
45 
46 struct TVector {
49 
50  TVector() : m_From(0, 0), m_To(0, 0) {}
51  TVector(double from_x, double from_y, double to_x, double to_y)
52  : m_From(from_x, from_y), m_To(to_x, to_y) {}
53 };
54 
55 
56 ///////////////////////////////////////////////////////////////////////////////
57 ///
59 {
60 public:
61  typedef vector<CHitElemGlyph*> TElemVector;
62  //typedef vector<CHitCluster*> TClusterVector;
63 
64  CHitCluster(const TElemVector& elems, const TVector v)
65  : m_Elems(elems), m_Vector(v) {}
66  //~CHitCluster()
67 
68 public:
69  // suboptimal, replace with pointers?
71  //TClusterVector m_Clusters; // subclusters
72 
74 };
75 
76 
77 ///////////////////////////////////////////////////////////////////////////////
78 ///
80 {
81 public:
82  typedef vector<CHitCluster*> TClusterVector;
83 
85  {
86  Clear();
87  }
88 
89  void Build(vector<CHitGlyph*>& glyphs, double scale_x, double scale_y);
90  void Clear();
91 
92  const TClusterVector& GetClusters() const { return m_Clusters;}
93 protected:
94  bool x_CanCombine(const TVector& a, const TVector& b, TVector& res,
95  double scale_x, double scale_y);
96 
97 protected:
98  static double m_MinSize;
99  static double m_Width;
100 
102 };
103 
104 
106 
107 #endif // __GUI_WIDGETS_HIT_MATRIX___HIT_CLUSTERING__HPP
TElemVector m_Elems
vector< CHitElemGlyph * > TElemVector
TVector m_Vector
CHitCluster(const TElemVector &elems, const TVector v)
vector< CHitCluster * > TClusterVector
bool x_CanCombine(const TVector &a, const TVector &b, TVector &res, double scale_x, double scale_y)
const TClusterVector & GetClusters() const
TClusterVector m_Clusters
static double m_MinSize
void Build(vector< CHitGlyph * > &glyphs, double scale_x, double scale_y)
static double m_Width
CHitElemGlyph is a simple graphical object representing a Hit Element.
CHitGlyph is a simple graphical object representing a Hit as a set of corresponding Hit Elements.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
CVect2< double > TVect
unsigned int a
Definition: ncbi_localip.c:102
The NCBI C++/STL use hints.
TVect m_From
TVector(double from_x, double from_y, double to_x, double to_y)
Modified on Wed Feb 21 09:58:23 2024 by modify_doxy.py rev. 669887