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

Go to the SVN repository for this file.

1 /* $Id: show_hide_manager.hpp 59476 2013-08-28 11:25:58Z thiessen $
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: Paul Thiessen
27 *
28 * File Description:
29 * manager object to track show/hide status of objects at various levels
30 *
31 * ===========================================================================
32 */
33 
34 #ifndef CN3D_SHOW_HIDE_MANAGER__HPP
35 #define CN3D_SHOW_HIDE_MANAGER__HPP
36 
37 #include <corelib/ncbistl.hpp>
38 
39 #include <vector>
40 #include <map>
41 
42 #include "structure_base.hpp"
43 #include "show_hide_callback.hpp"
44 
45 
46 BEGIN_SCOPE(Cn3D)
47 
48 class Residue;
49 class StructureSet;
50 class ShowHideInfo;
51 class StructureObject;
52 
54 {
55 public:
56  virtual ~ShowHideManager();
57 
58  // eventually this will be tied to a GUI element or something...
59  bool OverlayConfEnsembles(void) const { return true; }
60 
61  // set show/hide status of an entity - must be StructureObject, Molecule, or Residue.
62  void Show(const StructureBase *entity, bool isShown);
63 
64  void MakeAllVisible(void);
65 
66  // query whether an entity is visible
67  bool IsHidden(const StructureBase *entity) const;
68  bool IsVisible(const StructureBase *entity) const { return !IsHidden(entity); }
69 
70  // used for show/hide dialog to get list of names and visibility status
71  void GetShowHideInfo(std::vector < std::string > *names, std::vector < bool > *visibilities) const;
72  void ShowHideCallbackFunction(const std::vector < bool >& itemsEnabled);
73  bool SelectionChangedCallback(const std::vector < bool >& original, std::vector < bool >& itemsEnabled);
74  void ConstructShowHideArray(const StructureSet *structureSet);
75 
76  // functions to show/hide more complex groups of stuff
77  void ShowAlignedDomains(const StructureSet *set);
79  void ShowAlignedChains(const StructureSet *set);
80  void ShowResidues(const StructureSet *set, bool showAligned);
84 
85 private:
86  typedef std::map < const StructureBase *, bool > EntitiesHidden;
88 
89  // holds info on objects in this StructureSet
90  std::vector < const ShowHideInfo * > structureInfo;
91 
92  void PrivateShowResidues(const StructureSet *set, bool showAligned);
93  void UnHideEntityAndChildren(const StructureBase *entity);
94 
95 public:
96 };
97 
98 END_SCOPE(Cn3D)
99 
100 #endif // CN3D_SHOW_HIDE_MANAGER__HPP
void ShowDomainsWithHighlights(const StructureSet *set)
bool OverlayConfEnsembles(void) const
std::vector< const ShowHideInfo * > structureInfo
void ShowSelectedResidues(const StructureSet *set)
void ShowResidues(const StructureSet *set, bool showAligned)
void ShowHideCallbackFunction(const std::vector< bool > &itemsEnabled)
void ConstructShowHideArray(const StructureSet *structureSet)
void UnHideEntityAndChildren(const StructureBase *entity)
void Show(const StructureBase *entity, bool isShown)
bool IsHidden(const StructureBase *entity) const
EntitiesHidden entitiesHidden
void ShowAlignedDomains(const StructureSet *set)
void ShowAlignedOrAnnotatedDomains(const StructureSet *set)
void PrivateShowResidues(const StructureSet *set, bool showAligned)
bool SelectionChangedCallback(const std::vector< bool > &original, std::vector< bool > &itemsEnabled)
void ShowAlignedChains(const StructureSet *set)
void ShowUnalignedResiduesInAlignedDomains(const StructureSet *set)
bool IsVisible(const StructureBase *entity) const
std::map< const StructureBase *, bool > EntitiesHidden
void GetShowHideInfo(std::vector< std::string > *names, std::vector< bool > *visibilities) const
Definition: set.hpp:45
static const struct name_t names[]
#define END_SCOPE(ns)
End the previously defined scope.
Definition: ncbistl.hpp:75
#define BEGIN_SCOPE(ns)
Define a new scope.
Definition: ncbistl.hpp:72
The NCBI C++/STL use hints.
Modified on Sun Apr 14 05:26:19 2024 by modify_doxy.py rev. 669887