NCBI C++ ToolKit
taxtree_tool.cpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: taxtree_tool.cpp 47080 2022-07-22 18:11:54Z 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: Roman Katargin
27 *
28 */
29 
30 #include <ncbi_pch.hpp>
31 
34 #include "taxtree_tool_panel.hpp"
35 
37 
38 #include <serial/typeinfo.hpp>
39 
41 
44 
45 ///////////////////////////////////////////////////////////////////////////////
46 /// CCommonTaxTreeTool
48 : CAlgoToolManagerBase("Common taxonomic tree for sequences",
49  "",
50  "Common taxonomic tree for sequences",
51  "Create a bio-tree object of common taxonomic tree",
52  "https://www.ncbi.nlm.nih.gov/tools/gbench/",
53  "Alignment Creation"),
54  m_Panel()
55 {
56 }
57 
59 {
60  return "common_taxtree_tool";
61 }
62 
63 
65 {
66  return "Common TaxTree Tool";
67 }
68 
70 {
72 
73  m_Panel = NULL;
74 }
75 
77 {
78  m_Panel = NULL;
80 }
81 
83 {
84  if (m_Panel == NULL) {
86 
88  wxDefaultPosition, wxSize(0, 0), SYMBOL_CTAXTREETOOLPANEL_STYLE, false);
91 
92  m_Panel->SetRegistryPath(m_RegPath + ".ParamsPanel");
94  }
95  return true;
96 }
97 
99 {
100  return true;
101 }
102 
104 {
105  x_ConvertInputObjects(CSeq_id::GetTypeInfo(), m_Objects);
106 }
107 
109 {
110  CTaxTreeToolPanel* panel = new CTaxTreeToolPanel();
111  panel->Create(m_ParentWindow);
112  return panel;
113 }
114 
116 {
117  return m_Panel;
118 }
119 
121 {
122  return &m_Params;
123 }
124 
126 {
127  if (m_Panel) m_Params = m_Panel->GetData();
129  return job;
130 }
131 
CAlgoToolManagerBase This is base class for simple algorithmic tool managers.
virtual void InitUI()
override this function in a derived class and initialize extra members
string m_RegPath
registry path to the settings
wxWindow * m_ParentWindow
a window that will serve as a parent for our panels
virtual void CleanUI()
override this function in a derived class and clean extra members
void x_ConvertInputObjects(const CTypeInfo *typeInfo, map< string, TConstScopedObjects > &results)
CAlgoToolManagerParamsPanel.
CDataLoadingAppJob - a base class for Jobs loading data into projects.
CTaxTreeToolJob.
IRegSettings An interface for objects that save / restore settings using CGuiRegistry.
#define NULL
Definition: ncbistd.hpp:225
void SetObjects(map< string, TConstScopedObjects > *objects)
CTaxTreeToolParams m_Params
virtual void CleanUI()
override this function in a derived class and clean extra members
CTaxTreeToolParams & GetData()
virtual string GetExtensionLabel() const
returns a displayable label for this extension ( please capitalize the key words - "My Extension" )
void x_SelectCompatibleInputObjects()
bool Create(wxWindow *parent, wxWindowID id=ID_CTAXTREETOOLPANEL, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxTAB_TRAVERSAL, bool visibale=true)
virtual bool x_ValidateParams()
validates user input in Parameters panel, report errors if any
void SetData(const CTaxTreeToolParams &data)
virtual void SetRegistryPath(const string &path)
CAlgoToolManagerParamsPanel.
virtual void InitUI()
override this function in a derived class and initialize extra members
virtual wxPanel * GetMaxPanel()
Return the panel that occupies max size on display, to calculate dialog window size.
CCommonTaxTreeTool()
CCommonTaxTreeTool.
CTaxTreeToolPanel * m_Panel
virtual string GetExtensionIdentifier() const
returns the unique human-readable identifier for the extension the id should use lowercase letters se...
virtual bool x_CreateParamsPanelIfNeeded()
returns / creates Parameters panel, override in derived classes see cpp file for example
virtual CAlgoToolManagerParamsPanel * x_GetParamsPanel()
returns a pointer to the parameters panel, override in derived classes
virtual IRegSettings * x_GetParamsAsRegSetting()
return a pointer to Parameters object as IRegSettings interface
virtual CDataLoadingAppJob * x_CreateLoadingJob()
factory method for creating the job that executes the tool algorithm override in derived classes
virtual void LoadSettings()
#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 static static wxID_ANY
USING_SCOPE(ncbi::objects)
#define SYMBOL_CTAXTREETOOLPANEL_STYLE
Modified on Wed Apr 24 14:16:29 2024 by modify_doxy.py rev. 669887