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

Go to the SVN repository for this file.

1 /* $Id: remove_features_dlg.hpp 47479 2023-05-02 13:24:02Z ucko $
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 _REMOVE_FEATURES_DLG_H_
29 #define _REMOVE_FEATURES_DLG_H_
30 
31 #include <corelib/ncbistd.hpp>
36 
37 #include <wx/dialog.h>
39 
40 /*!
41  * Includes
42  */
43 
44 ////@begin includes
45 ////@end includes
46 #include <wx/sizer.h>
47 #include <wx/listctrl.h>
48 #include <wx/radiobut.h>
49 #include <wx/checkbox.h>
50 #include <wx/textctrl.h>
51 #include <wx/choice.h>
53 
54 /*!
55  * Forward declarations
56  */
57 
58 ////@begin forward declarations
59 class wxBoxSizer;
60 ////@end forward declarations
61 
63 using namespace objects;
64 
65 /*!
66  * Control identifiers
67  */
68 
69 ////@begin control identifiers
70 #define ID_CREMOVE_FEATURES_DLG 11000
71 #define SYMBOL_CREMOVE_FEATURES_DLG_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL
72 #define SYMBOL_CREMOVE_FEATURES_DLG_TITLE _("Remove Features")
73 #define SYMBOL_CREMOVE_FEATURES_DLG_IDNAME ID_CREMOVE_FEATURES_DLG
74 #define SYMBOL_CREMOVE_FEATURES_DLG_SIZE wxDefaultSize
75 #define SYMBOL_CREMOVE_FEATURES_DLG_POSITION wxDefaultPosition
76 ////@end control identifiers
77 #define ID_LISTCTRL_FTR 11001
78 #define ID_REMOVE_FEATURES_RADIOBUTTON 11002
79 #define ID_REMOVE_FEATURES_RADIOBUTTON1 11003
80 #define ID_REMOVE_FEATURES_TEXTCTRL 11004
81 #define ID_REMOVE_FEATURES_CHECKBOX 11005
82 #define ID_REMOVE_FEATURES_RADIOBUTTON2 11006
83 #define ID_REMOVE_FEATURES_RADIOBUTTON3 11007
84 #define ID_REMOVE_FEATURES_TEXTCTRL1 11008
85 #define ID_REMOVE_FEATURES_CHECKBOX1 11009
86 #define ID_REMOVE_FEATURES_CHOICE1 11010
87 #define ID_REMOVE_FEATURES_CHOICE2 11011
88 #define ID_REMOVE_FEATURES_OKCANCEL 11012
89 
91 {
92  DECLARE_DYNAMIC_CLASS( CRemoveFeaturesDlg )
93  DECLARE_EVENT_TABLE()
94 
95 public:
96  /// Constructors
98  CRemoveFeaturesDlg( wxWindow* parent, IWorkbench *wb, wxWindowID id = SYMBOL_CREMOVE_FEATURES_DLG_IDNAME, const wxString& caption = SYMBOL_CREMOVE_FEATURES_DLG_TITLE, const wxPoint& pos = SYMBOL_CREMOVE_FEATURES_DLG_POSITION, const wxSize& size = SYMBOL_CREMOVE_FEATURES_DLG_SIZE, long style = SYMBOL_CREMOVE_FEATURES_DLG_STYLE );
99 
100  /// Creation
101  bool Create( wxWindow* parent, wxWindowID id = SYMBOL_CREMOVE_FEATURES_DLG_IDNAME, const wxString& caption = SYMBOL_CREMOVE_FEATURES_DLG_TITLE, const wxPoint& pos = SYMBOL_CREMOVE_FEATURES_DLG_POSITION, const wxSize& size = SYMBOL_CREMOVE_FEATURES_DLG_SIZE, long style = SYMBOL_CREMOVE_FEATURES_DLG_STYLE );
102 
103  /// Destructor
105 
106  /// Initialises member variables
107  void Init();
108 
109  /// Creates the controls and sizers
110  void CreateControls();
111 
112  /// Retrieves bitmap resources
113  wxBitmap GetBitmapResource( const wxString& name );
114 
115  /// Retrieves icon resources
116  wxIcon GetIconResource( const wxString& name );
117 
118  /// Should we show tooltips?
119  static bool ShowToolTips();
120 
121  virtual CRef<CCmdComposite> GetCommand();
122  virtual string GetErrorMessage(){ return m_ErrorMessage;}
123  static void RemoveAllFeatures(CSeq_entry_Handle seh, ICommandProccessor* processor);
124  static void RemoveDuplicateFeatures(objects::CSeq_entry_Handle tse, ICommandProccessor* processor);
125 private:
127  vector<string> m_Descriptions;
128  vector<bool> m_SubtypeAnyFlag;
129  wxListCtrl* m_ListCtrl;
130  wxTextCtrl* m_TextCtrl;
131  wxRadioButton* m_RadioButton;
132  wxCheckBox* m_CheckBox;
133  wxTextCtrl* m_TextCtrl_id;
134  wxRadioButton* m_RadioButton_id;
135  wxCheckBox* m_CheckBox_id;
136  wxChoice* m_ChoiceStrand;
137  wxChoice* m_ChoiceType;
138  void ApplyToCSeq_entry (objects::CSeq_entry_Handle tse, CCmdComposite* composite, string name, bool subtypeAnyFlag, bool &modified,
139  map<objects::CBioseq_Handle, set<objects::CSeq_feat_Handle> > &product_to_cds);
140  static int CountProteinsBeforeRemoval(objects::CSeq_entry_Handle seh);
141  static int CountOrphanedProteins(objects::CSeq_entry_Handle seh);
142  static CSeq_id_Handle GetProductId(objects::CSeq_feat_Handle fh);
143  static void AskUser(int num_proteins, int num_orphans, bool &remove_proteins, bool &remove_orphans);
144  static CRef<CCmdComposite> RemoveOrphansRenormalizeNucProtSets(objects::CSeq_entry_Handle seh);
148 
149 };
150 
151 
152 ////@begin control identifiers
153 #define ID_CASKTOREMOVEORPHANSANDPROTEINS wxID_ANY
154 #define ID_RMVPROTEINS_CHECKBOX wxID_ANY
155 #define ID_RMVPROTEINS_CHECKBOX1 wxID_ANY
156 #define SYMBOL_CASKTOREMOVEORPHANSANDPROTEINS_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL
157 #define SYMBOL_CASKTOREMOVEORPHANSANDPROTEINS_TITLE _("Warning")
158 #define SYMBOL_CASKTOREMOVEORPHANSANDPROTEINS_IDNAME ID_CASKTOREMOVEORPHANSANDPROTEINS
159 #define SYMBOL_CASKTOREMOVEORPHANSANDPROTEINS_SIZE wxSize(400, 300)
160 #define SYMBOL_CASKTOREMOVEORPHANSANDPROTEINS_POSITION wxDefaultPosition
161 ////@end control identifiers
162 
163 
164 /*!
165  * CAskToRemoveOrphansAndProteins class declaration
166  */
167 
168 class CAskToRemoveOrphansAndProteins: public wxDialog
169 {
170  DECLARE_DYNAMIC_CLASS( CAskToRemoveOrphansAndProteins )
171  DECLARE_EVENT_TABLE()
172 
173 public:
174  /// Constructors
177 
178  /// Creation
180 
181  /// Destructor
183 
184  /// Initialises member variables
185  void Init();
186 
187  /// Creates the controls and sizers
188  void CreateControls();
189 
190 ////@begin CAskToRemoveOrphansAndProteins event handler declarations
191 
192 ////@end CAskToRemoveOrphansAndProteins event handler declarations
193 
194 ////@begin CAskToRemoveOrphansAndProteins member function declarations
195 
196  /// Retrieves bitmap resources
197  wxBitmap GetBitmapResource( const wxString& name );
198 
199  /// Retrieves icon resources
200  wxIcon GetIconResource( const wxString& name );
201 ////@end CAskToRemoveOrphansAndProteins member function declarations
202 
203  /// Should we show tooltips?
204  static bool ShowToolTips();
205 
206  bool GetProteins() {return m_Proteins->GetValue();}
207  bool GetOrphans() {return m_Orphans->GetValue();}
208  void SetProteinsLabel(const wxString &label) {m_Proteins->SetLabel(label);}
209  void SetOrphansLabel(const wxString &label) {m_Orphans->SetLabel(label);}
210 private:
211 ////@begin CAskToRemoveOrphansAndProteins member variables
212  wxCheckBox* m_Proteins;
213  wxCheckBox* m_Orphans;
214 ////@end CAskToRemoveOrphansAndProteins member variables
215 };
216 
218 
219 #endif
220  // _REMOVE_FEATURES_DLG_H_
void SetOrphansLabel(const wxString &label)
void SetProteinsLabel(const wxString &label)
map< pair< int, int >, string > m_Types
vector< bool > m_SubtypeAnyFlag
wxRadioButton * m_RadioButton_id
virtual string GetErrorMessage()
wxRadioButton * m_RadioButton
vector< string > m_Descriptions
CSeq_entry_Handle –.
Undo/Redo interface for editing operations.
IWorkbench is the central interface in the application framework.
Definition: workbench.hpp:113
Definition: map.hpp:338
Definition: set.hpp:45
Include a standard set of the NCBI C++ Toolkit most basic headers.
static void Init(void)
Definition: cursor6.c:76
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
static const char label[]
const struct ncbi::grid::netcache::search::fields::SIZE size
#define SYMBOL_CREMOVE_FEATURES_DLG_IDNAME
#define SYMBOL_CASKTOREMOVEORPHANSANDPROTEINS_STYLE
#define SYMBOL_CREMOVE_FEATURES_DLG_STYLE
#define SYMBOL_CREMOVE_FEATURES_DLG_POSITION
#define SYMBOL_CASKTOREMOVEORPHANSANDPROTEINS_SIZE
#define SYMBOL_CREMOVE_FEATURES_DLG_SIZE
#define SYMBOL_CASKTOREMOVEORPHANSANDPROTEINS_IDNAME
#define SYMBOL_CASKTOREMOVEORPHANSANDPROTEINS_POSITION
#define SYMBOL_CREMOVE_FEATURES_DLG_TITLE
#define SYMBOL_CASKTOREMOVEORPHANSANDPROTEINS_TITLE
Modified on Mon Apr 22 04:03:04 2024 by modify_doxy.py rev. 669887