📄 style_manager.hpp
字号:
bool EditGlobalStyle(wxWindow *parent); // edit user annotations; returns true if any style changed bool EditUserAnnotations(wxWindow *parent); // check style option consistency bool CheckStyleSettings(StyleSettings *settings); bool CheckGlobalStyleSettings(void); // load/save asn style dictionary to/from current styles ncbi::objects::CCn3d_style_dictionary * CreateASNStyleDictionary(void) const; bool LoadFromASNStyleDictionary(const ncbi::objects::CCn3d_style_dictionary& styleDictionary); // add a new user style with default settings; returns true if successful, // and sets style ID assigned to the new style and pointer to the new style structure bool AddUserStyle(int *id, StyleSettings **newStyle); // remove a style; returns false if a user style of the given ID is not found bool RemoveUserStyle(int id); // load/save asn user annotations bool SaveToASNUserAnnotations(ncbi::objects::CCn3d_user_annotations *annotations) const; bool LoadFromASNUserAnnotations(const ncbi::objects::CCn3d_user_annotations& annotations); // various typedefs typedef std::map < const MoleculeIdentifier * , std::vector < bool > > ResidueMap; typedef struct { std::string name, description; int styleID; ResidueMap residues; } UserAnnotation; typedef std::vector < UserAnnotation * > AnnotationPtrList; // add a new (empty) annotation; returns a pointer to the new UserAnnotation structure, // or NULL on error; does *not* display the new annotation by default UserAnnotation * AddUserAnnotation(void); // remove an annotation; returns false if the given annotation isn't found bool RemoveUserAnnotation(UserAnnotation *annotation); // sets the displayed status of the given annotation; returns false if annotation not found bool DisplayAnnotation(UserAnnotation *annotation, bool display); // moves the priority of annotation up (moveUp==true) or down (moveUp==false); // returns false if annotation not found bool ReprioritizeDisplayOrder(UserAnnotation *annotation, bool moveUp);private: const StructureSet *structureSet; StyleSettings globalStyle; // a set of user styles, each with its own unique integer id typedef std::map < int , StyleSettings > StyleMap; StyleMap userStyles; // storage for user annotations typedef std::list < UserAnnotation > AnnotationList; AnnotationList userAnnotations; // the priority-ordered list of annotations that are currently displayed; // lowest-indexed annotation has highest priority (to reflect GUI list where the // annotation on top of the stack has priority) AnnotationPtrList userAnnotationsDisplayed; // map from molecule -> user annotation(s); for fast lookup of which annotations cover // a particular molecule typedef std::map < const MoleculeIdentifier * , AnnotationPtrList > AnnotationMap; AnnotationMap userAnnotationMap; bool GetObjectStyle(const StructureObject *object, const Object3D& object3D, const StyleSettings::GeneralStyle& generalStyle, ObjectStyle *objectStyle) const;public: // StyleSettings accessors const StyleSettings& GetGlobalStyle(void) const { return globalStyle; } const StyleSettings& GetStyleForResidue(const StructureObject *object, int moleculeID, int residueID) const; const Vector& GetObjectColor(const Molecule *molecule) const; const StyleSettings * GetUserStyle(int id) const { StyleMap::const_iterator style = userStyles.find(id); return ((style != userStyles.end()) ? &(style->second) : NULL); } StyleSettings * GetUserStyle(int id) { StyleMap::iterator style = userStyles.find(id); return ((style != userStyles.end()) ? &(style->second) : NULL); } // annotation list accessors void GetUserAnnotations(AnnotationPtrList *annotationList); const AnnotationPtrList& GetUserAnnotationsDisplayed(void) const { return userAnnotationsDisplayed; } // predefined styles void SetGlobalColorScheme(StyleSettings::ePredefinedColorScheme scheme); void SetGlobalRenderingStyle(StyleSettings::ePredefinedRenderingStyle style); // set global style bool SetGlobalStyle(const ncbi::objects::CCn3d_style_settings& styleASN);};// the following are convenience containers to tell the Draw functions how// to render various individual objectsclass AtomStyle{public: StyleManager::eDisplayStyle style; Vector color; double radius, alpha; unsigned int name; std::string centerLabel; bool isHighlighted;};class BondStyle{public: typedef struct { StyleManager::eDisplayStyle style; Vector color; double radius; bool atomCap; unsigned int name; } EndStyle; EndStyle end1, end2; bool midCap; double tension;};class ObjectStyle{public: StyleManager::eDisplayStyle style; Vector color; double arrowLength, arrowBaseWidthProportion;};class HelixStyle : public ObjectStyle{public: double radius, arrowTipWidthProportion;};class StrandStyle : public ObjectStyle{public: double width, thickness;};END_SCOPE(Cn3D)#endif // CN3D_STYLE_MANAGER__HPP/** ---------------------------------------------------------------------------* $Log: style_manager.hpp,v $* Revision 1000.1 2004/04/12 17:34:27 gouriano* PRODUCTION: UPGRADED [CATCHUP_003] Dev-tree R1.41** Revision 1.41 2004/02/19 17:05:20 thiessen* remove cn3d/ from include paths; add pragma to disable annoying msvc warning** Revision 1.40 2003/02/06 16:39:53 thiessen* add block row fit coloring** Revision 1.39 2003/02/03 19:20:08 thiessen* format changes: move CVS Log to bottom of file, remove std:: from .cpp files, and use new diagnostic macros** Revision 1.38 2003/01/30 14:00:23 thiessen* add Block Z Fit coloring** Revision 1.37 2003/01/28 21:07:56 thiessen* add block fit coloring algorithm; tweak row dragging; fix style bug** Revision 1.36 2001/10/17 17:46:27 thiessen* save camera setup and rotation center in files** Revision 1.35 2001/09/04 14:40:26 thiessen* add rainbow and charge coloring** Revision 1.34 2001/08/21 01:10:13 thiessen* add labeling** Revision 1.33 2001/08/10 14:27:23 thiessen* fix typo** Revision 1.32 2001/08/09 19:07:20 thiessen* add temperature and hydrophobicity coloring** Revision 1.31 2001/08/03 13:41:24 thiessen* add registry and style favorites** Revision 1.30 2001/07/04 19:38:55 thiessen* finish user annotation system** Revision 1.29 2001/06/29 18:12:53 thiessen* initial (incomplete) user annotation system** Revision 1.28 2001/06/15 14:06:20 thiessen* save/load asn styles now complete** Revision 1.27 2001/06/14 17:44:46 thiessen* progress in styles<->asn ; add structure limits** Revision 1.26 2001/06/14 00:33:24 thiessen* asn additions** Revision 1.25 2001/06/07 19:04:50 thiessen* functional (although incomplete) render settings panel** Revision 1.24 2001/05/31 18:46:28 thiessen* add preliminary style dialog; remove LIST_TYPE; add thread single and delete all; misc tweaks** Revision 1.23 2001/03/29 15:49:32 thiessen* use disulfide color only for virtual disulfides** Revision 1.22 2001/03/29 15:32:21 thiessen* change disulfide, connection colors to not-yellow** Revision 1.21 2001/03/23 04:18:21 thiessen* parse and display disulfides** Revision 1.20 2001/03/09 15:48:44 thiessen* major changes to add initial update viewer** Revision 1.19 2001/02/13 20:31:45 thiessen* add information content coloring** Revision 1.18 2000/12/01 19:34:43 thiessen* better domain assignment** Revision 1.17 2000/10/16 14:25:20 thiessen* working alignment fit coloring** Revision 1.16 2000/10/04 17:40:48 thiessen* rearrange STL #includes** Revision 1.15 2000/09/20 22:22:03 thiessen* working conservation coloring; split and center unaligned justification** Revision 1.14 2000/09/11 22:57:56 thiessen* working highlighting** Revision 1.13 2000/09/11 14:06:03 thiessen* working alignment coloring** Revision 1.12 2000/08/24 23:39:54 thiessen* add 'atomic ion' labels** Revision 1.11 2000/08/24 18:43:15 thiessen* tweaks for transparent sphere display** Revision 1.10 2000/08/21 19:31:17 thiessen* add style consistency checking** Revision 1.9 2000/08/21 17:22:45 thiessen* add primitive highlighting for testing** Revision 1.8 2000/08/18 18:57:44 thiessen* added transparent spheres** Revision 1.7 2000/08/17 18:32:38 thiessen* minor fixes to StyleManager** Revision 1.6 2000/08/17 14:22:01 thiessen* added working StyleManager** Revision 1.5 2000/08/13 02:42:13 thiessen* added helix and strand objects** Revision 1.4 2000/08/11 12:59:13 thiessen* added worm; get 3d-object coords from asn1** Revision 1.3 2000/08/07 00:20:19 thiessen* add display list mechanism** Revision 1.2 2000/08/04 22:49:11 thiessen* add backbone atom classification and selection feedback mechanism** Revision 1.1 2000/08/03 15:14:18 thiessen* add skeleton of style and show/hide managers**/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -