NCBI C++ ToolKit
Classes | Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
StyleManager Class Reference

Search Toolkit Book for StyleManager

#include "style_manager.hpp"
(Private to src/app/cn3d.)

+ Collaboration diagram for StyleManager:

Classes

class  UserAnnotation
 

Public Types

enum  eDisplayStyle {
  eSolidAtom , eTransparentAtom , eLineBond , eCylinderBond ,
  eLineWormBond , eThickWormBond , eObjectWithArrow , eObjectWithoutArrow ,
  eNotDisplayed
}
 
typedef std::map< const MoleculeIdentifier *, std::vector< bool > > ResidueMap
 
typedef std::list< ncbi::CRef< UserAnnotation > > UserAnnotationList
 

Public Member Functions

 StyleManager (const StructureSet *set)
 
const VectorGetBackgroundColor (void) const
 
bool GetAtomStyle (const Residue *residue, const AtomPntr &atom, const AtomCoord *coord, AtomStyle *atomStyle, const StyleSettings::BackboneStyle **saveBackboneStyle=NULL, const StyleSettings::GeneralStyle **saveGeneralStyle=NULL) const
 
bool GetBondStyle (const Bond *bond, const AtomPntr &atom1, const AtomCoord *coord1, const AtomPntr &atom2, const AtomCoord *coord2, double bondLength, BondStyle *bondStyle) const
 
bool GetHelixStyle (const StructureObject *object, const Helix3D &helix, HelixStyle *helixStyle) const
 
bool GetStrandStyle (const StructureObject *object, const Strand3D &strand, StrandStyle *strandStyle) const
 
bool EditGlobalStyle (wxWindow *parent)
 
bool EditUserAnnotations (wxWindow *parent)
 
bool CheckStyleSettings (StyleSettings *settings)
 
bool CheckGlobalStyleSettings (void)
 
ncbi::objects::CCn3d_style_dictionary * CreateASNStyleDictionary (void) const
 
bool LoadFromASNStyleDictionary (const ncbi::objects::CCn3d_style_dictionary &styleDictionary)
 
bool AddUserStyle (int *id, StyleSettings **newStyle)
 
bool RemoveUserStyle (int id)
 
const StyleSettingsGetGlobalStyle (void) const
 
const StyleSettingsGetStyleForResidue (const StructureObject *object, int moleculeID, int residueID) const
 
const VectorGetObjectColor (const Molecule *molecule) const
 
const StyleSettingsGetUserStyle (int id) const
 
StyleSettingsGetUserStyle (int id)
 
bool MoleculeHasUserStyle (const StructureObject *object, int moleculeID) const
 
bool ResidueHasUserStyle (const StructureObject *object, int moleculeID, int residueID) const
 
void SetGlobalColorScheme (StyleSettings::ePredefinedColorScheme scheme)
 
void SetGlobalRenderingStyle (StyleSettings::ePredefinedRenderingStyle style)
 
bool SetGlobalStyle (const ncbi::objects::CCn3d_style_settings &styleASN)
 
bool SaveToASNUserAnnotations (ncbi::objects::CCn3d_user_annotations *annotations) const
 
bool LoadFromASNUserAnnotations (const ncbi::objects::CCn3d_user_annotations &annotations)
 
UserAnnotationAddUserAnnotation (void)
 
bool RemoveUserAnnotation (UserAnnotation *annotation)
 
bool DisplayUserAnnotation (UserAnnotation *annotation, bool display)
 
bool MoveUserAnnotation (UserAnnotation *annotation, bool moveUp)
 
UserAnnotationListGetUserAnnotations (void)
 
const UserAnnotationListGetUserAnnotations (void) const
 

Private Types

typedef std::map< int, StyleSettingsStyleMap
 

Private Member Functions

bool GetObjectStyle (const StructureObject *object, const Object3D &object3D, const StyleSettings::GeneralStyle &generalStyle, ObjectStyle *objectStyle) const
 

Private Attributes

const StructureSetstructureSet
 
StyleSettings globalStyle
 
StyleMap userStyles
 
UserAnnotationList userAnnotations
 

Detailed Description

Definition at line 247 of file style_manager.hpp.

Member Typedef Documentation

◆ ResidueMap

typedef std::map< const MoleculeIdentifier * , std::vector < bool > > StyleManager::ResidueMap

Definition at line 334 of file style_manager.hpp.

◆ StyleMap

typedef std::map< int , StyleSettings > StyleManager::StyleMap
private

Definition at line 367 of file style_manager.hpp.

◆ UserAnnotationList

typedef std::list< ncbi::CRef < UserAnnotation > > StyleManager::UserAnnotationList

Definition at line 342 of file style_manager.hpp.

Member Enumeration Documentation

◆ eDisplayStyle

Enumerator
eSolidAtom 
eTransparentAtom 
eLineBond 
eCylinderBond 
eLineWormBond 
eThickWormBond 
eObjectWithArrow 
eObjectWithoutArrow 
eNotDisplayed 

Definition at line 253 of file style_manager.hpp.

Constructor & Destructor Documentation

◆ StyleManager()

StyleManager::StyleManager ( const StructureSet set)

Definition at line 488 of file style_manager.cpp.

Member Function Documentation

◆ AddUserAnnotation()

StyleManager::UserAnnotation * StyleManager::AddUserAnnotation ( void  )

◆ AddUserStyle()

bool StyleManager::AddUserStyle ( int id,
StyleSettings **  newStyle 
)

◆ CheckGlobalStyleSettings()

bool StyleManager::CheckGlobalStyleSettings ( void  )

◆ CheckStyleSettings()

bool StyleManager::CheckStyleSettings ( StyleSettings settings)

◆ CreateASNStyleDictionary()

CCn3d_style_dictionary * StyleManager::CreateASNStyleDictionary ( void  ) const

Definition at line 1346 of file style_manager.cpp.

References globalStyle, i, NULL, StyleSettings::SaveSettingsToASN(), and userStyles.

Referenced by StructureSet::SaveASNData().

◆ DisplayUserAnnotation()

bool StyleManager::DisplayUserAnnotation ( UserAnnotation annotation,
bool  display 
)

◆ EditGlobalStyle()

bool StyleManager::EditGlobalStyle ( wxWindow *  parent)

Definition at line 1340 of file style_manager.cpp.

References globalStyle, and structureSet.

Referenced by StructureWindow::OnSetStyle().

◆ EditUserAnnotations()

bool StyleManager::EditUserAnnotations ( wxWindow *  parent)

Definition at line 1392 of file style_manager.cpp.

References structureSet.

Referenced by StructureWindow::OnSetStyle().

◆ GetAtomStyle()

bool StyleManager::GetAtomStyle ( const Residue residue,
const AtomPntr atom,
const AtomCoord coord,
AtomStyle atomStyle,
const StyleSettings::BackboneStyle **  saveBackboneStyle = NULL,
const StyleSettings::GeneralStyle **  saveGeneralStyle = NULL 
) const

Definition at line 580 of file style_manager.cpp.

References AtomPntr::aID, StructureSet::alignmentManager, AtomStyle::alpha, ATOM_NOT_DISPLAYED, AtomCoord::averageTemperature, StyleSettings::ballRadius, AtomStyle::centerLabel, Residue::code, Element::color, AtomStyle::color, color, StyleSettings::BackboneStyle::colorScheme, StyleSettings::GeneralStyle::colorScheme, StyleSettings::eAligned, Residue::eAlphaBackboneAtom, StyleSettings::eBallAndStick, StyleSettings::eBlockFit, StyleSettings::eBlockRowFit, StyleSettings::eBlockZFit, StyleSettings::eCharge, Colors::eCoil, StyleSettings::eComplete, Residue::eCompleteBackboneAtom, Colors::eCycle1, StyleSettings::eDomain, StyleSettings::eElement, StyleSettings::eFit, Colors::eHelix, StyleSettings::eHydrophobicity, Colors::eHydrophobicityMap, StyleSettings::eIdentity, StyleSettings::eInformationContent, BlockMultipleAlignment::eLeft, StyleSettings::eMolecule, Colors::eNegative, Colors::eNeutral, Colors::eNoDomain, Colors::eNoHydrophobicity, Colors::eNoTemperature, Colors::eNuc_A, Colors::eNuc_C, Colors::eNuc_G, Colors::eNuc_T_U, Colors::eNuc_X, StyleSettings::eObject, StyleSettings::eOff, StyleSettings::ePartial, Residue::ePartialBackboneAtom, Colors::ePositive, StyleSettings::eRainbow, Colors::eRainbowMap, StyleSettings::eResidue, ERRORMSG, StyleSettings::eSecondaryStructure, Residue::eSideChainAtom, eSolidAtom, StyleSettings::eSpaceFill, Colors::eStrand, StyleSettings::eTemperature, Colors::eTemperatureMap, StyleSettings::eTrace, eTransparentAtom, StyleSettings::eTubes, StyleSettings::eTubeWorm, Colors::eUnaligned, Residue::eUnknownAtom, StyleSettings::eUserSelect, StyleSettings::eVariety, StyleSettings::eWeightedVariety, StyleSettings::eWire, StyleSettings::eWireWorm, Colors::Get(), BlockMultipleAlignment::GetAlignmentIndex(), Residue::GetAtomInfo(), GetCharge(), AlignmentManager::GetCurrentMultipleAlignment(), PeriodicTableClass::GetElement(), GetHydrophobicity(), StructureBase::GetParentOfType(), BlockMultipleAlignment::GetRelativeAlignmentFraction(), BlockMultipleAlignment::GetRowForSequence(), GetStyleForResidue(), GlobalColors(), GlobalMessenger(), StyleSettings::heterogens, StyleSettings::hydrogensOn, Molecule::id, Residue::id, StructureObject::id, info, StyleSettings::ionLabelsOn, IsAligned(), AlignmentManager::IsAligned(), Residue::IsAminoAcid(), ShowHideManager::IsHidden(), Messenger::IsHighlighted(), AtomStyle::isHighlighted, IsMetal(), Residue::IsNucleotide(), StyleSettings::GeneralStyle::isOn, Molecule::IsResidueInHelix(), Molecule::IsResidueInStrand(), Molecule::IsSolvent(), AtomPntr::mID, StructureObject::minTemperature, AtomStyle::name, Residue::NAtomsInGraph(), Molecule::NO_DOMAIN_SET, AtomCoord::NO_TEMPERATURE, Molecule::NResidues(), StyleSettings::nucleotideBackbone, StyleSettings::nucleotideSidechains, NULL, AtomCoord::occupancy, StructureBase::parentSet, PeriodicTable, StyleSettings::proteinBackbone, StyleSettings::proteinSidechains, AtomStyle::radius, Molecule::residueDomains, AtomPntr::rID, Molecule::sequence, StructureSet::showHideManager, StyleSettings::solvents, StyleSettings::spaceFillProportion, StyleSettings::BackboneStyle::style, StyleSettings::GeneralStyle::style, AtomStyle::style, Element::symbol, toupper(), StyleSettings::tubeRadius, StyleSettings::BackboneStyle::type, UNKNOWN_HYDROPHOBICITY, StyleSettings::BackboneStyle::userColor, StyleSettings::GeneralStyle::userColor, and Element::vdWRadius.

Referenced by Residue::Draw(), GetBondStyle(), and Molecule::GetResidueColor().

◆ GetBackgroundColor()

const Vector& StyleManager::GetBackgroundColor ( void  ) const
inline

Definition at line 265 of file style_manager.hpp.

References StyleSettings::backgroundColor, and globalStyle.

Referenced by OpenGLRenderer::Display().

◆ GetBondStyle()

bool StyleManager::GetBondStyle ( const Bond bond,
const AtomPntr atom1,
const AtomCoord coord1,
const AtomPntr atom2,
const AtomCoord coord2,
double  bondLength,
BondStyle bondStyle 
) const

Definition at line 923 of file style_manager.cpp.

References Bond::atom1, Bond::atom2, BondStyle::EndStyle::atomCap, BOND_NOT_DISPLAYED, Residue::AtomInfo::classification, Residue::AtomInfo::code, AtomStyle::color, BondStyle::EndStyle::color, StyleSettings::connections, Residue::eAlphaBackboneAtom, Residue::eCompleteBackboneAtom, eCylinderBond, Colors::eHighlight, eLineBond, eLineWormBond, BondStyle::end1, BondStyle::end2, eNotDisplayed, Residue::ePartialBackboneAtom, Bond::eRealDisulfide, ERRORMSG, Residue::eSideChainAtom, eThickWormBond, StyleSettings::eTrace, StyleSettings::eTubes, Bond::eVirtual, Bond::eVirtualDisulfide, StyleSettings::eWire, Colors::Get(), AtomSet::GetAtom(), ChemicalGraph::GetAtomInfo(), GetAtomStyle(), StructureBase::GetParentOfType(), GetStyleForResidue(), Residue::AtomInfo::glName, GlobalColors(), GlobalMessenger(), globalStyle, StructureObject::graph, Molecule::id, Residue::id, Residue::IsAminoAcid(), Messenger::IsHighlighted(), AtomStyle::isHighlighted, StyleSettings::GeneralStyle::isOn, AtomPntr::mID, BondStyle::midCap, BondStyle::EndStyle::name, Residue::nameGraph, Bond::nextVirtual, NULL, Bond::order, ShowHideManager::OverlayConfEnsembles(), StructureBase::parentSet, Bond::previousVirtual, AtomStyle::radius, BondStyle::EndStyle::radius, Residue::AtomInfo::residue, AtomPntr::rID, SetBondStyleFromResidueStyle(), StructureSet::showHideManager, StyleSettings::BackboneStyle::style, StyleSettings::GeneralStyle::style, AtomStyle::style, BondStyle::EndStyle::style, BondStyle::tension, StyleSettings::tubeRadius, StyleSettings::BackboneStyle::type, StyleSettings::GeneralStyle::userColor, StyleSettings::virtualDisulfideColor, and StyleSettings::virtualDisulfidesOn.

Referenced by Bond::Draw().

◆ GetGlobalStyle()

const StyleSettings& StyleManager::GetGlobalStyle ( void  ) const
inline

◆ GetHelixStyle()

bool StyleManager::GetHelixStyle ( const StructureObject object,
const Helix3D helix,
HelixStyle helixStyle 
) const

◆ GetObjectColor()

const Vector & StyleManager::GetObjectColor ( const Molecule molecule) const

◆ GetObjectStyle()

bool StyleManager::GetObjectStyle ( const StructureObject object,
const Object3D object3D,
const StyleSettings::GeneralStyle generalStyle,
ObjectStyle objectStyle 
) const
private

◆ GetStrandStyle()

bool StyleManager::GetStrandStyle ( const StructureObject object,
const Strand3D strand,
StrandStyle strandStyle 
) const

◆ GetStyleForResidue()

const StyleSettings & StyleManager::GetStyleForResidue ( const StructureObject object,
int  moleculeID,
int  residueID 
) const

◆ GetUserAnnotations() [1/2]

UserAnnotationList& StyleManager::GetUserAnnotations ( void  )
inline

Definition at line 359 of file style_manager.hpp.

References userAnnotations.

Referenced by AnnotateDialog::ResetListBoxes().

◆ GetUserAnnotations() [2/2]

const UserAnnotationList& StyleManager::GetUserAnnotations ( void  ) const
inline

Definition at line 360 of file style_manager.hpp.

References userAnnotations.

◆ GetUserStyle() [1/2]

StyleSettings* StyleManager::GetUserStyle ( int  id)
inline

Definition at line 312 of file style_manager.hpp.

References NULL, and userStyles.

◆ GetUserStyle() [2/2]

const StyleSettings* StyleManager::GetUserStyle ( int  id) const
inline

Definition at line 307 of file style_manager.hpp.

References NULL, and userStyles.

Referenced by AnnotateDialog::EditAnnotation().

◆ LoadFromASNStyleDictionary()

bool StyleManager::LoadFromASNStyleDictionary ( const ncbi::objects::CCn3d_style_dictionary &  styleDictionary)

◆ LoadFromASNUserAnnotations()

bool StyleManager::LoadFromASNUserAnnotations ( const ncbi::objects::CCn3d_user_annotations &  annotations)

◆ MoleculeHasUserStyle()

bool StyleManager::MoleculeHasUserStyle ( const StructureObject object,
int  moleculeID 
) const

Definition at line 1298 of file style_manager.cpp.

References Molecule::identifier, and userAnnotations.

◆ MoveUserAnnotation()

bool StyleManager::MoveUserAnnotation ( UserAnnotation annotation,
bool  moveUp 
)

◆ RemoveUserAnnotation()

bool StyleManager::RemoveUserAnnotation ( UserAnnotation annotation)

◆ RemoveUserStyle()

bool StyleManager::RemoveUserStyle ( int  id)

◆ ResidueHasUserStyle()

bool StyleManager::ResidueHasUserStyle ( const StructureObject object,
int  moleculeID,
int  residueID 
) const

Definition at line 1315 of file style_manager.cpp.

References Molecule::identifier, and userAnnotations.

◆ SaveToASNUserAnnotations()

bool StyleManager::SaveToASNUserAnnotations ( ncbi::objects::CCn3d_user_annotations *  annotations) const

Definition at line 1589 of file style_manager.cpp.

References a, CreateObjectLocation(), ERRORMSG, and userAnnotations.

Referenced by StructureSet::SaveASNData().

◆ SetGlobalColorScheme()

void StyleManager::SetGlobalColorScheme ( StyleSettings::ePredefinedColorScheme  scheme)

Definition at line 1694 of file style_manager.cpp.

References globalStyle, and StyleSettings::SetColorScheme().

◆ SetGlobalRenderingStyle()

void StyleManager::SetGlobalRenderingStyle ( StyleSettings::ePredefinedRenderingStyle  style)

Definition at line 1700 of file style_manager.cpp.

References globalStyle, and StyleSettings::SetRenderingStyle().

◆ SetGlobalStyle()

bool StyleManager::SetGlobalStyle ( const ncbi::objects::CCn3d_style_settings &  styleASN)

Member Data Documentation

◆ globalStyle

StyleSettings StyleManager::globalStyle
private

◆ structureSet

const StructureSet* StyleManager::structureSet
private

◆ userAnnotations

UserAnnotationList StyleManager::userAnnotations
private

◆ userStyles

StyleMap StyleManager::userStyles
private

The documentation for this class was generated from the following files:
Modified on Wed Sep 04 15:06:29 2024 by modify_doxy.py rev. 669887