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

Go to the SVN repository for this file.

1 /* $Id: sequester_sets.hpp 46446 2021-05-18 14:59:06Z asztalos $
2  * ===========================================================================
3  *
4  * PUBLIC DOMAIN NOTICE
5  * National Center for Biotechnology Information
6  *
7  * This software/database is a "United States Government Work" under the
8  * terms of the United States Copyright Act. It was written as part of
9  * the author's official duties as a United States Government employee and
10  * thus cannot be copyrighted. This software/database is freely available
11  * to the public for use. The National Library of Medicine and the U.S.
12  * Government have not placed any restriction on its use or reproduction.
13  *
14  * Although all reasonable efforts have been taken to ensure the accuracy
15  * and reliability of the software and data, the NLM and the U.S.
16  * Government do not and cannot warrant the performance or results that
17  * may be obtained by using this software or data. The NLM and the U.S.
18  * Government disclaim all warranties, express or implied, including
19  * warranties of performance, merchantability or fitness for any particular
20  * purpose.
21  *
22  * Please cite the author in any work or product based on this material.
23  *
24  * ===========================================================================
25  *
26  * Authors: Igor Filippov
27  */
28 #ifndef _SEQUESTER_SETS_H_
29 #define _SEQUESTER_SETS_H_
30 
31 #include <corelib/ncbistd.hpp>
33 #include <objmgr/blob_id.hpp>
41 
42 #include <wx/dialog.h>
43 #include <wx/notebook.h>
44 #include <wx/sizer.h>
45 #include <wx/listctrl.h>
46 #include <wx/treectrl.h>
47 #include <wx/bmpbuttn.h>
48 
50 
51 /*!
52  * Control identifiers
53  */
54 
55 ////@begin control identifiers
56 #define ID_CSEQUESTER_SETS wxID_ANY
57 #define SYMBOL_CSEQUESTER_SETS_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL
58 #define SYMBOL_CSEQUESTER_SETS_TITLE _("Sequester Sets")
59 #define SYMBOL_CSEQUESTER_SETS_IDNAME ID_CSEQUESTER_SETS
60 #define SYMBOL_CSEQUESTER_SETS_SIZE wxDefaultSize
61 #define SYMBOL_CSEQUESTER_SETS_POSITION wxDefaultPosition
62 ////@end control identifiers
63 #define ID_SEQUESTER_BUTTON 11202
64 #define ID_CANCEL_BUTTON 11203
65 #define ID_ACCEPT_BUTTON 11204
66 
67 
68 class CSequesterSets : public CSegregateSetsBase, public wxFrame
69 {
70  DECLARE_DYNAMIC_CLASS( CSequesterSets )
71  DECLARE_EVENT_TABLE()
72 
73 public:
74  /// Constructors
76  CSequesterSets( wxWindow* parent,
77  objects::CSeq_entry_Handle seh,
78  CConstRef<CSeq_submit> seq_submit,
79  IWorkbench* wb,
80  wxWindowID id = SYMBOL_CSEQUESTER_SETS_IDNAME,
81  const wxString& caption = SYMBOL_CSEQUESTER_SETS_TITLE,
82  const wxPoint& pos = SYMBOL_CSEQUESTER_SETS_POSITION,
83  const wxSize& size = SYMBOL_CSEQUESTER_SETS_SIZE,
84  long style = SYMBOL_CSEQUESTER_SETS_STYLE );
85 
86  /// Creation
87  bool Create( wxWindow* parent,
88  wxWindowID id = SYMBOL_CSEQUESTER_SETS_IDNAME,
89  const wxString& caption = SYMBOL_CSEQUESTER_SETS_TITLE,
90  const wxPoint& pos = SYMBOL_CSEQUESTER_SETS_POSITION,
91  const wxSize& size = SYMBOL_CSEQUESTER_SETS_SIZE,
92  long style = SYMBOL_CSEQUESTER_SETS_STYLE );
93 
94  /// Destructor
95  virtual ~CSequesterSets();
96 
97  /// Initialises member variables
98  void Init();
99 
100  /// Creates the controls and sizers
101  void CreateControls();
102 
103  /// Retrieves bitmap resources
104  wxBitmap GetBitmapResource( const wxString& name );
105 
106  /// Retrieves icon resources
107  wxIcon GetIconResource( const wxString& name );
108 
109  /// Should we show tooltips?
110  static bool ShowToolTips();
111 
112  vector<vector<int>> & GetSubsets();
113  void SetSubsets(const set<objects::CBioseq_Handle> &selected);
114  void OnSequester( wxCommandEvent& event );
115  void OnCancel( wxCommandEvent& event );
116  void OnAccept( wxCommandEvent& event );
118  void RestoreTextView();
119 
120 private:
121  void RecursiveCollectSets(const objects::CBioseq_set_Handle &bssh, vector<objects::CBioseq_set_Handle> &set_vec, set<objects::CBioseq_set_Handle> &unique_set);
122  void RecursivePropagateDown(void);
123  void RecursivePropagateUp(void);
124  void BioseqSetDescriptorPropagateUp(objects::CBioseq_set_Handle set);
125  void BioseqSetDescriptorPropagateDown( const objects::CBioseq_set_Handle & bioseq_set_h);
126  void EnableSmartPackageDone(bool enable);
127  bool ShoudStayInPlace(const objects::CSeqdesc& desc);
128 
129  wxNotebook *m_Notebook;
133 
135 
136  wxButton* m_SequesterButton;
137  wxButton* m_AcceptButton;
138 };
139 
141 
142 #endif
143  // _SEQUESTER_SETS_H_
CSequesterSets()
Constructors.
vector< vector< int > > & GetSubsets()
void BioseqSetDescriptorPropagateUp(objects::CBioseq_set_Handle set)
bool Create(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &caption=_("Sequester Sets"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL)
Creation.
bool ShoudStayInPlace(const objects::CSeqdesc &desc)
IWorkbench * m_Workbench
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
void RecursiveCollectSets(const objects::CBioseq_set_Handle &bssh, vector< objects::CBioseq_set_Handle > &set_vec, set< objects::CBioseq_set_Handle > &unique_set)
void OnAccept(wxCommandEvent &event)
void OnCancel(wxCommandEvent &event)
void SetSubsets(const set< objects::CBioseq_Handle > &selected)
void EnableSmartPackageDone(bool enable)
CIRef< IProjectView > m_TextView
void BioseqSetDescriptorPropagateDown(const objects::CBioseq_set_Handle &bioseq_set_h)
void Init()
Initialises member variables.
void CreateControls()
Creates the controls and sizers.
wxButton * m_AcceptButton
void RecursivePropagateUp(void)
void RecursivePropagateDown(void)
virtual ~CSequesterSets()
Destructor.
static bool ShowToolTips()
Should we show tooltips?
wxButton * m_SequesterButton
CRef< objects::CUser_object > GetParams()
void OnSequester(wxCommandEvent &event)
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
wxNotebook * m_Notebook
CConstRef< objects::CSeq_submit > m_SeqSubmit
CRef< objects::CSeq_entry > m_SavedEntry
IWorkbench is the central interface in the application framework.
Definition: workbench.hpp:113
Include a standard set of the NCBI C++ Toolkit most basic headers.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
const struct ncbi::grid::netcache::search::fields::SIZE size
#define SYMBOL_CSEQUESTER_SETS_IDNAME
#define SYMBOL_CSEQUESTER_SETS_POSITION
#define SYMBOL_CSEQUESTER_SETS_TITLE
#define SYMBOL_CSEQUESTER_SETS_SIZE
#define SYMBOL_CSEQUESTER_SETS_STYLE
Modified on Thu Feb 29 12:17:11 2024 by modify_doxy.py rev. 669887