oss <<
" d"<< labelNum;
122 boolisVisible =
false;
162ChemicalGraph::MoleculeMap::const_iterator m, me =
object->graph->molecules.end();
164 if(m->second->IsProtein() || m->second->IsNucleotide())
178 if(!entity || !(
object|| molecule || residue)) {
179 ERRORMSG(
"ShowHideManager::Show() - must be a StructureObject, Molecule, or Residue");
202 if(!entity || !
IsHidden(entity))
return;
220 if(
object&& !hObj)
223 if(molecule && hObj != h->first && !hMol)
226 if(entity == h->first ||
227(
object&& hObj ==
object) ||
228(molecule && hMol == molecule))
230EntitiesHidden::iterator d(h);
255 else if((molecule =
dynamic_cast<const Molecule*
>(entity)) !=
NULL) {
261 else if((residue =
dynamic_cast<const Residue*
>(entity)) !=
NULL) {
269 ERRORMSG(
"ShowHideManager::IsHidden() - must be a StructureObject, Molecule, or Residue");
276 intobjectIndex, moleculeIndex;
278StructureSet::ObjectList::const_iterator o, oe = structureSet->
objects.end();
279 for(o=structureSet->
objects.begin(); o!=oe; ++o) {
285ChemicalGraph::MoleculeMap::const_iterator m, me = (*o)->graph->molecules.end();
286 for(m=(*o)->graph->molecules.begin(); m!=me; ++m) {
289 if(m->second->IsProtein() || m->second->IsNucleotide()) {
292 info->parentIndexes.push_back(objectIndex);
296 if(m->second->nDomains >= 1) {
297StructureObject::DomainMap::const_iterator d, de = (*o)->domainMap.end();
298 for(d=(*o)->domainMap.begin(); d!=de; ++d) {
299 if(d->second == m->second) {
301 info->parentIndexes.push_back(objectIndex);
302 info->parentIndexes.push_back(moleculeIndex);
313vector < string > *
names, vector < bool > *visibilities)
const 326 ERRORMSG(
"ShowHideManager::ShowHideCallbackFunction() - wrong size list");
330 for(
unsigned int i=0;
i<itemsEnabled.size(); ++
i)
336 constvector < bool >& original, vector < bool >& itemsEnabled)
339 unsigned int i, nChanges = 0, itemChanged = 0, nEnabled = 0, itemEnabled = 0;
340 for(
i=0;
i<itemsEnabled.size(); ++
i) {
341 if(itemsEnabled[
i] != original[
i]) {
345 if(itemsEnabled[
i]) {
352 boolanyChange =
false;
353 if(nChanges == 1 || nEnabled == 1) {
354 intitem = (nChanges == 1) ? itemChanged : itemEnabled;
356 for(
unsigned intj=0; j<
structureInfo[
i]->parentIndexes.size(); ++j) {
358 if(itemsEnabled[
i] != itemsEnabled[item]) {
359itemsEnabled[
i] = itemsEnabled[item];
368 for(
i=0;
i<itemsEnabled.size(); ++
i) {
369 if(itemsEnabled[
i]) {
370 for(
unsigned intj=0; j<
structureInfo[
i]->parentIndexes.size(); ++j) {
390StructureSet::ObjectList::const_iterator o, oe =
set->objects.
end();
391 for(o=
set->objects.
begin(); o!=oe; ++o) {
392ChemicalGraph::MoleculeMap::const_iterator m, me = (*o)->graph->molecules.end();
393 for(m=(*o)->graph->molecules.begin(); m!=me; ++m) {
395 if(m->second->IsNucleotide()) {
396 Show(m->second,
false);
400 if(!m->second->IsProtein())
continue;
402 if(!
set->alignmentManager->IsInAlignment(m->second->sequence)) {
403 Show(m->second,
false);
408Molecule::ResidueMap::const_iterator
r, re = m->second->residues.end();
411 for(
r=m->second->residues.begin();
r!=re; ++
r)
412 if(
set->alignmentManager->IsAligned(m->second->sequence,
r->first - 1))
413domains[m->second->residueDomains[
r->first - 1]] =
true;
416 for(
r=m->second->residues.begin();
r!=re; ++
r)
417 if(domains.
find(m->second->residueDomains[
r->first - 1]) == domains.
end())
418 Show(
r->second,
false);
426StructureSet::ObjectList::const_iterator o, oe =
set->objects.
end();
427 for(o=
set->objects.
begin(); o!=oe; ++o) {
428ChemicalGraph::MoleculeMap::const_iterator m, me = (*o)->graph->molecules.end();
429 for(m=(*o)->graph->molecules.begin(); m!=me; ++m) {
431 if(!(m->second->IsProtein() || m->second->IsNucleotide()))
434 if(!(
set->alignmentManager->IsInAlignment(m->second->sequence) ||
set->styleManager->MoleculeHasUserStyle(*o, m->second->id))) {
435 Show(m->second,
false);
440Molecule::ResidueMap::const_iterator
r, re = m->second->residues.end();
443 for(
r=m->second->residues.begin();
r!=re; ++
r)
444 if(
set->alignmentManager->IsAligned(m->second->sequence,
r->first - 1) ||
set->styleManager->ResidueHasUserStyle(*o, m->second->id,
r->first))
445domains[m->second->residueDomains[
r->first - 1]] =
true;
448 for(
r=m->second->residues.begin();
r!=re; ++
r)
449 if(domains.
find(m->second->residueDomains[
r->first - 1]) == domains.
end())
450 Show(
r->second,
false);
458StructureSet::ObjectList::const_iterator o, oe =
set->objects.
end();
459 for(o=
set->objects.
begin(); o!=oe; ++o) {
460ChemicalGraph::MoleculeMap::const_iterator m, me = (*o)->graph->molecules.end();
461 for(m=(*o)->graph->molecules.begin(); m!=me; ++m) {
464 if(m->second->IsNucleotide() ||
465(m->second->IsProtein() && !
set->alignmentManager->IsInAlignment(m->second->sequence)))
467 Show(m->second,
false);
475StructureSet::ObjectList::const_iterator o, oe =
set->objects.
end();
476 for(o=
set->objects.
begin(); o!=oe; ++o) {
477ChemicalGraph::MoleculeMap::const_iterator m, me = (*o)->graph->molecules.end();
478 for(m=(*o)->graph->molecules.begin(); m!=me; ++m) {
480 if(m->second->IsNucleotide()) {
481 Show(m->second,
false);
484 if(!m->second->IsProtein())
continue;
486 if(!
set->alignmentManager->IsInAlignment(m->second->sequence)) {
487 if(showAligned)
Show(m->second,
false);
491Molecule::ResidueMap::const_iterator
r, re = m->second->residues.end();
492 for(
r=m->second->residues.begin();
r!=re; ++
r) {
493 boolaligned =
set->alignmentManager->IsAligned(m->second->sequence,
r->first - 1);
494 if((showAligned && !aligned) || (!showAligned && aligned))
495 Show(
r->second,
false);
518StructureSet::ObjectList::const_iterator o, oe =
set->objects.
end();
519 for(o=
set->objects.
begin(); o!=oe; ++o) {
520 boolanyResidueInObjectVisible =
false;
521ChemicalGraph::MoleculeMap::const_iterator m, me = (*o)->graph->molecules.end();
522 for(m=(*o)->graph->molecules.begin(); m!=me; ++m) {
523Molecule::ResidueMap::const_iterator
r, re = m->second->residues.end();
524 boolanyResidueInMoleculeVisible =
false;
525 for(
r=m->second->residues.begin();
r!=re; ++
r) {
527 Show(
r->second,
false);
529anyResidueInMoleculeVisible = anyResidueInObjectVisible =
true;
531 if(!anyResidueInMoleculeVisible) {
532 for(
r=m->second->residues.begin();
r!=re; ++
r)
533 Show(
r->second,
true);
534 Show(m->second,
false);
537 if(!anyResidueInObjectVisible) {
538 for(m=(*o)->graph->molecules.begin(); m!=me; ++m)
539 Show(m->second,
true);
553StructureSet::ObjectList::const_iterator o, oe =
set->objects.
end();
554 for(o=
set->objects.
begin(); o!=oe; ++o) {
555ChemicalGraph::MoleculeMap::const_iterator m, me = (*o)->graph->molecules.end();
556 for(m=(*o)->graph->molecules.begin(); m!=me; ++m) {
557Molecule::ResidueMap::const_iterator
r, re = m->second->residues.end();
562 for(
r=m->second->residues.begin();
r!=re; ++
r) {
564domain = m->second->residueDomains[
r->first - 1];
566domains[domain] =
true;
571 for(
r=m->second->residues.begin();
r!=re; ++
r) {
572domain = m->second->residueDomains[
r->first - 1];
574 Show(
r->second,
true);
CNcbiOstrstreamToString class helps convert CNcbiOstrstream to a string Sample usage:
void PostRedrawMolecule(const Molecule *molecule)
void PostRedrawAllSequenceViewers(void)
std::vector< int > residueDomains
static const int NO_DOMAIN_SET
const MoleculeIdentifier * identifier
unsigned int NResidues(void) const
virtual ~ShowHideDomain(void)
void Show(ShowHideManager *shm, bool isShown) const
bool IsVisible(const ShowHideManager *shm) const
const Molecule * molecule
ShowHideDomain(const Molecule *m, int d, int labelNum)
virtual void Show(ShowHideManager *shm, bool isShown) const =0
virtual bool IsVisible(const ShowHideManager *shm) const =0
void GetLabel(string *str) const
vector< int > parentIndexes
virtual ~ShowHideInfo(void)
void ShowDomainsWithHighlights(const StructureSet *set)
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)
virtual ~ShowHideManager()
bool SelectionChangedCallback(const std::vector< bool > &original, std::vector< bool > &itemsEnabled)
void MakeAllVisible(void)
void ShowAlignedChains(const StructureSet *set)
void ShowUnalignedResiduesInAlignedDomains(const StructureSet *set)
bool IsVisible(const StructureBase *entity) const
void GetShowHideInfo(std::vector< std::string > *names, std::vector< bool > *visibilities) const
ShowHideMolecule(const Molecule *m)
const Molecule * molecule
void Show(ShowHideManager *shm, bool isShown) const
bool IsVisible(const ShowHideManager *shm) const
virtual ~ShowHideMolecule(void)
void Show(ShowHideManager *shm, bool isShown) const
virtual ~ShowHideObject(void)
ShowHideObject(const StructureObject *o)
const StructureObject * object
bool IsVisible(const ShowHideManager *shm) const
bool GetParentOfType(const T **ptr, bool warnIfNotFound=true) const
std::string GetPDBID(char separator='_') const
const ChemicalGraph * graph
OpenGLRenderer * renderer
const_iterator end() const
const_iterator find(const key_type &key) const
const_iterator begin() const
const_iterator end() const
Include a standard set of the NCBI C++ Toolkit most basic headers.
static const struct name_t names[]
static const char * str(char *buf, int n)
#define END_SCOPE(ns)
End the previously defined scope.
#define BEGIN_SCOPE(ns)
Define a new scope.
static const char label[]
Messenger * GlobalMessenger(void)
NCBI C++ stream class wrappers for triggering between "new" and "old" C++ stream libraries.
double r(size_t dimension_, const Int4 *score_, const double *prob_, double theta_)
static void PostRedrawEntity(const StructureObject *object, const Molecule *molecule, const Residue *residue)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4