(sSet->
IsCDD())
117 else if(sSet->
objects.size() > 0) {
119 if(sSet->
objects.size() > 1)
158wxFrame(
NULL, wxID_HIGHEST + 1, title, pos,
size, wxDEFAULT_FRAME_STYLE),
159glCanvas(
NULL), cddAnnotateDialog(
NULL),
cddDescriptionDialog(
NULL), cddNotesDialog(
NULL),
160cddRefDialog(
NULL), cddBookRefDialog(
NULL), cddOverview(
NULL),
161spinIncrement(3.0), helpController(
NULL), helpConfig(
NULL),
162fileMessagingManager("Cn3D"), fileMessenger(
NULL)
165animationTimer.SetOwner(
this, MID_ANIMATE);
166SetSizeHints(150, 150);
167SetIcon(wxICON(cn3d));
172menuBar =
newwxMenuBar;
173fileMenu =
newwxMenu;
174fileMenu->Append(MID_OPEN,
"&Open\tCtrl+O");
176fileMenu->Append(MID_NETWORK_OPEN,
"&Network Load\tCtrl+L");
178fileMenu->Append(MID_NETWORK_OPEN,
"&Network Load\tCtrl+N");
180fileMenu->Append(MID_SAVE_SAME,
"&Save\tCtrl+S");
181fileMenu->Append(MID_SAVE_AS,
"Save &As...");
182fileMenu->Append(MID_PNG,
"&Export PNG");
183fileMenu->AppendSeparator();
184fileMenu->Append(MID_REFIT_ALL,
"&Realign Structures");
185fileMenu->AppendSeparator();
186fileMenu->Append(MID_PREFERENCES,
"&Preferences...");
187wxMenu *subMenu =
newwxMenu;
188subMenu->Append(MID_OPENGL_FONT,
"S&tructure Window");
189subMenu->Append(MID_SEQUENCE_FONT,
"Se&quence Windows");
190fileMenu->Append(MID_FONTS,
"Set &Fonts...", subMenu);
191fileMenu->AppendSeparator();
192fileMenu->Append(MID_EXIT,
"E&xit");
193menuBar->Append(fileMenu,
"&File");
196wxMenu *menu =
newwxMenu;
197menu->Append(MID_ZOOM_IN,
"Zoom &In\tz");
198menu->Append(MID_ZOOM_OUT,
"Zoom &Out\tx");
199menu->Append(MID_RESTORE,
"&Restore");
200menu->Append(MID_RESET,
"Rese&t");
201menu->AppendSeparator();
203menu->Append(MID_NEXT_FRAME,
"&Next Frame\tRight");
204menu->Append(MID_PREV_FRAME,
"Pre&vious Frame\tLeft");
205menu->Append(MID_FIRST_FRAME,
"&First Frame\tDown");
206menu->Append(MID_LAST_FRAME,
"&Last Frame\tUp");
209menu->Append(MID_NEXT_FRAME,
"&Next Frame");
210menu->Append(MID_PREV_FRAME,
"Pre&vious Frame");
211menu->Append(MID_FIRST_FRAME,
"&First Frame");
212menu->Append(MID_LAST_FRAME,
"&Last Frame");
214menu->Append(MID_ALL_FRAMES,
"&All Frames\ta");
215menu->AppendSeparator();
216subMenu =
newwxMenu;
217subMenu->Append(MID_PLAY,
"&Play Frames\tp",
"",
true);
218subMenu->Check(MID_PLAY,
false);
219subMenu->Append(MID_SPIN,
"Spi&n\tn",
"",
true);
220subMenu->Check(MID_SPIN,
false);
221subMenu->Append(MID_STOP,
"&Stop\ts",
"",
true);
222subMenu->Check(MID_STOP,
true);
223subMenu->AppendSeparator();
224subMenu->Append(MID_ANIM_CONTROLS,
"Set Spee&d");
225menu->Append(MID_ANIMATE,
"Ani&mation", subMenu);
226menu->AppendSeparator();
227menu->Append(MID_STEREO,
"St&ereo",
"",
true);
228menuBar->Append(menu,
"&View");
232menu->Append(MID_SHOW_HIDE,
"&Pick Structures...");
233menu->AppendSeparator();
234menu->Append(MID_SHOW_ALL,
"Show &Everything\te");
235menu->Append(MID_SHOW_CHAINS,
"Show Aligned C&hains");
236menu->Append(MID_SHOW_DOMAINS,
"Show Aligned &Domains\td");
237menu->Append(MID_SHOW_ALIGNED,
"Show &Aligned Residues");
238subMenu =
newwxMenu;
239subMenu->Append(MID_SHOW_UNALIGNED_ALL,
"Show &All");
240subMenu->Append(MID_SHOW_UNALIGNED_ALN_DOMAIN,
"Show in Aligned &Domains");
241menu->Append(MID_SHOW_UNALIGNED,
"&Unaligned Residues", subMenu);
242menu->AppendSeparator();
243menu->Append(MID_SHOW_SELECTED_DOMAINS,
"Show Selected Do&mains");
244menu->Append(MID_SHOW_SELECTED_RESIDUES,
"Show &Selected Residues");
245menu->AppendSeparator();
246menu->Append(MID_DIST_SELECT,
"Select by Dis&tance...");
247menu->Append(MID_SELECT_CHAIN,
"Toggle &Chain...");
248menu->Append(MID_SELECT_MOLECULE,
"Select M&olecule...\tm");
249menuBar->Append(menu,
"Se&lect");
253menu->Append(MID_EDIT_STYLE,
"Edit &Global Style");
255favoritesMenu =
newwxMenu;
256favoritesMenu->Append(MID_ADD_FAVORITE,
"&Add/Replace");
257favoritesMenu->Append(MID_REMOVE_FAVORITE,
"&Remove");
258favoritesMenu->Append(MID_FAVORITES_FILE,
"&Change File");
259favoritesMenu->AppendSeparator();
261SetupFavoritesMenu();
262menu->Append(MID_FAVORITES,
"&Favorites", favoritesMenu);
264subMenu =
newwxMenu;
265subMenu->Append(MID_WORM,
"&Worms",
"",
true);
266subMenu->Append(MID_TUBE,
"&Tubes",
"",
true);
267subMenu->Append(MID_WIRE,
"Wir&e",
"",
true);
268subMenu->Append(MID_BNS,
"&Ball and Stick",
"",
true);
269subMenu->Append(MID_SPACE,
"&Space Fill",
"",
true);
270subMenu->AppendSeparator();
271subMenu->Append(MID_SC_TOGGLE,
"&Toggle Sidechains");
272menu->Append(MID_RENDER,
"&Rendering Shortcuts", subMenu);
274subMenu =
newwxMenu;
275subMenu->Append(MID_SECSTRUC,
"&Secondary Structure",
"",
true);
276subMenu->Append(MID_ALIGNED,
"&Aligned",
"",
true);
277wxMenu *subMenu2 =
newwxMenu;
278subMenu2->Append(MID_IDENTITY,
"I&dentity",
"",
true);
279subMenu2->Append(MID_VARIETY,
"&Variety",
"",
true);
280subMenu2->Append(MID_WGHT_VAR,
"&Weighted Variety",
"",
true);
281subMenu2->Append(MID_INFO,
"&Information Content",
"",
true);
282subMenu2->Append(MID_FIT,
"&Fit",
"",
true);
283subMenu2->Append(MID_BLOCK_FIT,
"&Block Fit",
"",
true);
284subMenu2->Append(MID_BLOCK_Z_FIT,
"&Normalized Block Fit",
"",
true);
285subMenu2->Append(MID_BLOCK_ROW_FIT,
"Block &Row Fit",
"",
true);
286subMenu->Append(MID_CONS,
"Sequence &Conservation", subMenu2);
287subMenu->Append(MID_OBJECT,
"&Object",
"",
true);
288subMenu->Append(MID_DOMAIN,
"&Domain",
"",
true);
289subMenu->Append(MID_MOLECULE,
"&Molecule",
"",
true);
290subMenu->Append(MID_RESIDUE,
"Res&idue",
"",
true);
291subMenu->Append(MID_RAINBOW,
"&Rainbow",
"",
true);
292subMenu->Append(MID_HYDROPHOB,
"&Hydrophobicity",
"",
true);
293subMenu->Append(MID_CHARGE,
"Char&ge",
"",
true);
294subMenu->Append(MID_TEMP,
"&Temperature",
"",
true);
295subMenu->Append(MID_ELEMENT,
"&Element",
"",
true);
296menu->Append(MID_COLORS,
"&Coloring Shortcuts", subMenu);
298menu->AppendSeparator();
299menu->Append(MID_ANNOTATE,
"A&nnotate");
300menuBar->Append(menu,
"&Style");
303windowMenu =
newwxMenu;
304windowMenu->Append(MID_SHOW_SEQ_V,
"Show &Sequence Viewer");
305windowMenu->Append(MID_SHOW_LOG,
"Show Message &Log");
306windowMenu->Append(MID_SHOW_LOG_START,
"Show Log on Start&up",
"",
true);
307 boolshowLog =
false;
309windowMenu->Check(MID_SHOW_LOG_START, showLog);
312menuBar->Append(windowMenu,
"Show ...");
314menuBar->Append(windowMenu,
"&Window");
321menu->Append(MID_CDD_OVERVIEW,
"CDD &Overview");
322menu->AppendSeparator();
323menu->Append(MID_EDIT_CDD_NAME,
"Edit &Name");
324menu->Enable(MID_EDIT_CDD_NAME, !readOnly);
325menu->Append(MID_EDIT_CDD_DESCR,
"Edit &Description");
326menu->Enable(MID_EDIT_CDD_DESCR, !readOnly);
327menu->Append(MID_EDIT_CDD_NOTES,
"Edit No&tes");
328menu->Enable(MID_EDIT_CDD_NOTES, !readOnly);
329menu->Append(MID_EDIT_CDD_REFERENCES,
"Edit PubMed &References");
331menu->Append(MID_EDIT_CDD_BOOK_REFERENCES,
"Edit &Book References");
333menu->Append(MID_ANNOT_CDD,
"Edit &Annotations");
334menu->Enable(MID_ANNOT_CDD, !readOnly);
335menu->AppendSeparator();
338menu->AppendSeparator();
339menu->Append(MID_CDD_REJECT_SEQ,
"Re&ject Sequence");
340menu->Enable(MID_CDD_REJECT_SEQ, !readOnly);
341menu->Append(MID_CDD_SHOW_REJECTS,
"&Show Rejects");
342menuBar->Append(menu,
"&CDD");
346menu->Append(MID_HELP_COMMANDS,
"&Commands");
347menu->Append(MID_ONLINE_HELP,
"Online &Help...");
348menu->Append(MID_ABOUT,
"&About");
349menuBar->Append(menu,
"&Help");
352wxAcceleratorEntry
entries[12];
353 entries[0].Set(wxACCEL_NORMAL, WXK_RIGHT, MID_NEXT_FRAME);
354 entries[1].Set(wxACCEL_NORMAL, WXK_LEFT, MID_PREV_FRAME);
355 entries[2].Set(wxACCEL_NORMAL, WXK_DOWN, MID_FIRST_FRAME);
356 entries[3].Set(wxACCEL_NORMAL, WXK_UP, MID_LAST_FRAME);
357 entries[4].Set(wxACCEL_NORMAL,
'z', MID_ZOOM_IN);
358 entries[5].Set(wxACCEL_NORMAL,
'x', MID_ZOOM_OUT);
359 entries[6].Set(wxACCEL_NORMAL,
'a', MID_ALL_FRAMES);
360 entries[7].Set(wxACCEL_NORMAL,
'p', MID_PLAY);
361 entries[8].Set(wxACCEL_NORMAL,
'n', MID_SPIN);
362 entries[9].Set(wxACCEL_NORMAL,
's', MID_STOP);
363 entries[10].Set(wxACCEL_NORMAL,
'e', MID_SHOW_ALL);
364 entries[11].Set(wxACCEL_NORMAL,
'd', MID_SHOW_DOMAINS);
365wxAcceleratorTable accel(12,
entries);
366SetAcceleratorTable(accel);
370menuBar->EnableTop(menuBar->FindMenu(
"CDD"),
false);
371menuBar->Check(MID_STEREO,
false);
374 #if defined(__WXMSW__) 375 int*attribList =
NULL;
376 #elif defined(__WXGTK__) 377 int*attribList =
NULL;
378 #elif defined(__WXMAC__) 379 int*attribList =
NULL;
385glCanvas->SetCurrent();
386glCanvas->SetGLFontFromRegistry();
418wxConfig::Set(
NULL);
452 INFOMSG(
"received command "<<
id<<
" from "<< fromApp <<
": "<<
command);
456 stringreplyData =
"failed to process\n";
463 if(replyData.size() > 0)
464 TRACEMSG(
"data:\n"<< replyData.substr(0, replyData.size() - 1));
467 fileMessenger->SendReply(fromApp,
id, replyStatus, replyData);
475 INFOMSG(fromApp <<
": got OKAY from "<< fromApp <<
" (command "<<
id<<
"), data: "<<
data);
477 ERRORMSG(fromApp <<
": got ERROR from "<< fromApp <<
" (command "<<
id<<
"), data: "<<
data);
484 ERRORMSG(
"SendCommand: no message file active!");
489 static unsigned longnextCommandID = 1;
490 INFOMSG(
"sending command "<< nextCommandID+1 <<
" to "<< toApp <<
": "<<
command);
497 ERRORMSG(
"Can't send messages when return messaging is off");
515wxString path = wxString(
GetPrefsDir().c_str()) +
"help_cache";
516 if(!wxDirExists(path)) {
517 INFOMSG(
"trying to create help cache folder "<< path.c_str());
522path = path + wxFILE_SEP_PATH +
"Config";
523 INFOMSG(
"saving help config in "<< path.c_str());
524 helpConfig=
newwxFileConfig(
"Cn3D",
"NCBI", path);
528path = wxString(
GetProgramDir().c_str()) +
"../Resources/cn3d_commands.htb";
530path = wxString(
GetProgramDir().c_str()) +
"cn3d_commands.htb";
533 ERRORMSG(
"Can't load help book at "<< path.c_str());
540 LaunchWebPage(
"https://www.ncbi.nlm.nih.gov/Structure/CN3D/cn3d.shtml");
548 "Produced by the National Center for Biotechnology Information\n" 549 " https://www.ncbi.nlm.nih.gov\n\n" 550 "Please direct all questions and comments to:\n" 551 " info@ncbi.nlm.nih.gov" 553wxMessageBox(message,
"About Cn3D", wxOK | wxICON_INFORMATION,
this);
564wxString idStr = wxGetTextFromUser(
"Enter an MMDB molecule ID or PDB chain:",
"Select molecule");
565 if(idStr.size() == 0)
568 boolisNum = idStr.ToULong(&num);
572ChemicalGraph::MoleculeMap::const_iterator m, me =
575 if((isNum && m->second->id == (
int)num) ||
579&& idStr.Cmp(m->second->name.c_str()) == 0) ||
582&& m->second->residues.size() == 1
583&& (((wxString) m->second->residues.begin()->second->
584nameGraph.c_str()).Strip(wxString::both) == idStr)))))
586 if(m->second->sequence) {
589Molecule::ResidueMap::const_iterator
r, re = m->second->residues.end();
590 for(
r=m->second->residues.begin();
r!=re; ++
r)
598vector < string >
names;
599vector < const Molecule * > molecules;
602ChemicalGraph::MoleculeMap::const_iterator m, me = (*o)->graph->molecules.end();
603 for(m=(*o)->graph->molecules.begin(); m!=me; ++m) {
604 if(m->second->residues.size() > 1) {
605 names.push_back((*o)->GetPDBID() +
'_'+ m->second->name);
606molecules.push_back(m->second);
610wxArrayString aChoices;
611 for(
unsigned int i=0;
i<
names.size(); ++
i)
612aChoices.Add(
names[
i].c_str());
613wxArrayInt selections;
614 intnSelected = wxGetSelectedChoices(selections,
"Choose chain(s) to toggle:",
"Select Chain", aChoices);
617 for(
size_t i=0;
i<selections.GetCount(); ++
i) {
618 const Molecule*molecule = molecules[selections.Item(
i)];
619Molecule::ResidueMap::const_iterator
r, re = molecule->
residues.end();
620 for(
r=molecule->
residues.begin();
r!=re; ++
r)
627 static doublelatestCutoff = 5.0;
641 if(dialog.ShowModal() == wxID_OK && dialog.
fpSpinCtrl->GetDouble(&cutoff)) {
642latestCutoff = cutoff;
652 if(dialog.
m_Other->GetValue())
699 else if(event.GetId() ==
MID_STOP) {
732 stringsection, faceName;
743unique_ptr<wxFont> initialFont(wxFont::New(wxString(nativeFont.c_str())));
744 if(!initialFont.get() || !initialFont->Ok())
746 ERRORMSG(
"StructureWindow::OnSetFont() - error setting up initial font");
749wxFontData initialFontData;
750initialFontData.SetInitialFont(*initialFont);
753wxFontDialog dialog(
this, initialFontData);
754 int result= dialog.ShowModal();
760wxFontData& fontData = dialog.GetFontData();
761wxFont font = fontData.GetChosenFont();
764 ERRORMSG(
"StructureWindow::OnSetFont() - error setting registry data");
769 INFOMSG(
"setting new font");
788 file= wxFileSelector(
"Select a file for favorites:",
790(forRead ? wxFD_OPEN : (wxFD_SAVE | wxFD_OVERWRITE_PROMPT))).c_str();
791 if(
file.size() > 0)
793 ERRORMSG(
"Error setting favorites file in registry");
803 stringfavoritesFile;
806 if(wxFile::Exists(favoritesFile.c_str())) {
807 INFOMSG(
"loading favorites from "<< favoritesFile);
813 ERRORMSG(
"Error loading from favorites file "<< favoritesFile);
816 WARNINGMSG(
"Favorites file does not exist: "<< favoritesFile);
826 intchoice = wxMessageBox(
"Do you want to save changes to your current Favorites file?",
827 "Save favorites?", wxYES_NO);
828 if(choice == wxYES) {
833 ERRORMSG(
"Error saving Favorites to "<< favoritesFile <<
'\n'<< err);
846wxString name = wxGetTextFromUser(
"Enter a name for this style:",
"Input name",
"",
this);
847 if(name.size() == 0)
return;
854settings =
f->GetPointer();
861 ERRORMSG(
"Already have max # Favorites");
871 ERRORMSG(
"Error converting global style to asn");
881choices[
i++] = (*f)->GetName().c_str();
882 intpicked = wxGetSingleChoiceIndex(
"Choose a style to remove from the Favorites list:",
901 ERRORMSG(
"Error loading Favorites from "<< newFavorites.c_str());
917CCn3d_style_settings_set::Tdata::const_iterator
f, fe =
favoriteStyles.
Get().end();
928CCn3d_style_settings_set::Tdata::const_iterator
f, fe =
favoriteStyles.
Get().end();
932 INFOMSG(
"using favorite: "<< (*f)->GetName());
944 switch(event.GetId()) {
966 ERRORMSG(
"Error saving CDD notes");
972 ERRORMSG(
"Error saving CDD description");
978 TRACEMSG(
"MultiTextDialog destroyed");
1010 option= wxYES_NO | wxYES_DEFAULT | wxICON_EXCLAMATION | wxCENTRE;
1011 if(canCancel)
option|= wxCANCEL;
1013wxMessageDialog dialog(
NULL,
"Do you want to save your work to a file?",
"",
option);
1014 option= dialog.ShowModal();
1016 if(
option== wxID_CANCEL)
return false;
1019 if(
option== wxID_YES) {
1020wxCommandEvent event;
1034 a.first->identifier,
b.first->identifier);
1042 this, -1,
"CDD Descriptive Items", wxPoint(200,50));
1084 switch(event.GetId()) {
1091wxString newName = wxGetTextFromUser(
"Enter or edit the CDD name:",
1093 if(newName.size() > 0) {
1095 ERRORMSG(
"Error saving CDD name");
1145GetCurrentMultipleAlignment()->GetSequenceOfRow(0)->identifier;
1147SequenceSet::SequenceList::const_iterator
1150 if((*s)->identifier != master) {
1153 boolrejected =
false;
1155StructureSet::RejectList::const_iterator
r, re = rejects->end();
1156 for(
r=rejects->begin();
r!=re; ++
r) {
1157CReject_id::TIds::const_iterator
i, ie = (*r)->GetIds().end();
1158 for(
i=(*r)->GetIds().begin();
i!=ie; ++
i) {
1159 if((*s)->identifier->MatchesSeqId(**
i)) {
1164 if(rejected)
break;
1167 if(rejected)
continue;
1169wxString description((*s)->identifier->ToString().c_str());
1170 stringdescr = (*s)->GetDescription();
1171 if(descr.size() > 0)
1172description += wxString(
" ") + descr.c_str();
1173seqsDescrs.resize(seqsDescrs.size() + 1);
1174seqsDescrs.back().first = *s;
1175seqsDescrs.back().second = description;
1182wxString *choices =
newwxString[seqsDescrs.size()];
1184 for(choice=0; choice<(
int)seqsDescrs.size(); ++choice) choices[choice] = seqsDescrs[choice].second;
1185choice = wxGetSingleChoiceIndex(
"Reject which sequence?",
"Reject Sequence",
1186seqsDescrs.size(), choices,
this);
1188wxString message =
"Are you sure you want to reject this sequence?\n\n";
1189message += choices[choice];
1190message +=
"\n\nIf so, enter a brief reason why:";
1191wxString reason = wxGetTextFromUser(message,
"Reject Sequence",
"",
this);
1192 if(reason.size() == 0) {
1193wxMessageBox(
"Reject action cancelled!",
"", wxOK | wxICON_INFORMATION,
this);
1195 intpurge = wxMessageBox(
"Do you want to purge all instances of this sequence " 1196 " from the multiple alignment and update list?",
1197 "", wxYES_NO | wxICON_QUESTION,
this);
1200RejectAndPurgeSequence(seqsDescrs[choice].
first,
WX_TO_STD(reason), purge == wxYES);
1211 switch(event.GetId()) {
1232 switch(event.GetId()) {
1236vector < string > structureNames;
1237vector < bool > structureVisibilities;
1239wxString *titles =
newwxString[structureNames.size()];
1240 for(
unsigned int i=0;
i<structureNames.size(); ++
i) titles[
i] = structureNames[
i].c_str();
1244 this, -1,
"Show/Hide Structures", wxPoint(200, 50));
1287BlockMultipleAlignment::UngappedAlignedBlockList::const_iterator
b, be =
blocks.end();
1288 intnAligned = 0, nHighlighted = 0;
1289 for(
b=
blocks.begin();
b!=be; ++
b) {
1290nAligned += (*b)->width;
1292 for(
unsigned int i=0;
i<(*b)->width; ++
i)
1298 boolhighlightedOnly =
false;
1299 if(nHighlighted > 0 && nHighlighted < nAligned) {
1301message.Printf(
"Do you want to do the alignment using only the %i highlighted+aligned residues (on the master)? " 1302 "Answering 'no' will use all %i aligned residues regardless of highlights.", nHighlighted, nAligned);
1303 intanswer = wxMessageBox(message,
"Use highlighted+aligned residues?", wxYES_NO | wxCANCEL | wxICON_QUESTION,
this);
1304 if(answer == wxCANCEL)
1306highlightedOnly = (answer == wxYES);
1315 #define RENDERING_SHORTCUT(type, menu) \ 1316 glCanvas->structureSet->styleManager->SetGlobalRenderingStyle(StyleSettings::type); \ 1317 SetRenderingMenuFlag(menu); \ 1319 #define COLORING_SHORTCUT(type, menu) \ 1320 glCanvas->structureSet->styleManager->SetGlobalColorScheme(StyleSettings::type); \ 1321 SetColoringMenuFlag(menu); \ 1328 switch(event.GetId()) {
1407wxString choices[3];
1409choices[0] =
"Single model";
1411choices[1] =
"Alpha only";
1413choices[2] =
"PDB model(s)";
1416wxSingleChoiceDialog dialog(parent,
"Please select which type of model you'd like to load",
1417 "Select model", 3, choices, (
void**)
NULL, (wxCAPTION | wxSYSTEM_MENU | wxOK | wxCENTRE));
1418 if(dialog.ShowModal() != wxID_OK) {
1419 ERRORMSG(
"Oops, somehow dialog failed to return OK");
1423 returnmodels[dialog.GetSelection()];
1432 if(wxIsAbsolutePath(filename))
1433 userDir=
string(wxPathOnly(filename).c_str()) + wxFILE_SEP_PATH;
1434 else if(wxPathOnly(filename) ==
"")
1448 WARNINGMSG(
"Can't get structure limit from registry");
1456 ERRORMSG(
"Cannot open file '"<< filename <<
"' for reading");
1463*inStream >> firstWord;
1467asciiMimeFirstWord =
"Ncbi-mime-asn1",
1468asciiCDDFirstWord =
"Cdd",
1469asciiBiostrucFirstWord =
"Biostruc";
1470 boolisMime =
false, isCDD =
false, isBiostruc =
false;
1472 if(firstWord == asciiMimeFirstWord) {
1475}
else if(firstWord == asciiCDDFirstWord) {
1478}
else if(firstWord == asciiBiostrucFirstWord) {
1486 boolreadOK =
false;
1488 if(!isCDD && !isBiostruc) {
1489 TRACEMSG(
"trying to read file '"<< filename <<
"' as "<<
1496*sset =
new StructureSet(mime, structureLimit, renderer);
1498 if(window && (*sset)->IsCDD())
1505 if(!readOK && !isMime && !isBiostruc) {
1506 TRACEMSG(
"trying to read file '"<< filename <<
"' as "<<
1513*sset =
new StructureSet(cdd, structureLimit, renderer);
1519 if(!readOK && !isMime && !isCDD) {
1520 TRACEMSG(
"trying to read file '"<< filename <<
"' as "<<
1533 ERRORMSG(
"File not found, not readable, or is not a recognized data type");
1540*sset =
new StructureSet(mimeData, structureLimit, renderer);
1545 boolfoundPreferred =
false;
1546 if(favoriteStyle.size() > 0) {
1549CCn3d_style_settings_set::Tdata::const_iterator
f, fe =
favoriteStyles.
Get().end();
1551 if((*f)->GetName() == favoriteStyle) {
1552 INFOMSG(
"using favorite: "<< (*f)->GetName());
1553(*sset)->styleManager->SetGlobalStyle(**
f);
1558foundPreferred =
true;
1564 if(!foundPreferred) {
1567 if((*sset)->hasUserStyle) {
1568 TRACEMSG(
"Using global style from incoming data...");
1577 if((*sset)->alignmentSet) {
1580 if((*sset)->IsCDD()) {
1605SetCursor(*wxHOURGLASS_CURSOR);
1627SetCursor(wxNullCursor);
1632SetCursor(wxNullCursor);
1633 ERRORMSG(
"StructureWindow::LoadData() - MonitorAlignments() returned error");
1649SetCursor(wxNullCursor);
1662 constwxString& filestr = wxFileSelector(
"Choose a text or binary ASN1 file to open",
userDir.c_str(),
1663 "",
"",
"All Files|*.*|Cn3D Files (*.cn3)|*.cn3",
1665wxFD_OPEN | wxFD_FILE_MUST_EXIST,
this);
1667wxFD_OPEN | wxFD_FILE_MUST_EXIST);
1669 if(!filestr.IsEmpty())
1670 LoadData(filestr.c_str(),
false,
false);
1674wxString
id= wxGetTextFromUser(
"Please enter a PDB or MMDB id",
"Input id");
1675 if(
id.
size() == 0)
1691wxString dir = wxString(
userDir.c_str()).MakeLower();
1693 if(dir.Contains(
"cache") || dir.Contains(
"temp") || dir.Contains(
"tmp"))
1700wxString outputFolder = wxString(
userDir.c_str(),
userDir.size() - 1);
1701wxString outputFilename;
1707wxFileDialog dialog(
this,
"Choose a filename and type for output", outputFolder,
1713 "All Files|*.*|Binary (*.cn3)|*.cn3|Text (*.cn3)|*.cn3|Text CDD (*.cn3)|*.cn3",
1714wxFD_SAVE | wxFD_OVERWRITE_PROMPT);
1716 if(dialog.ShowModal() == wxID_OK)
1717outputFilename = dialog.GetPath();
1718outputBinary = (dialog.GetFilterIndex() == 1);
1719outputCDD = (dialog.GetFilterIndex() == 3);
1724 if(!outputFilename.IsEmpty()) {
1726 TRACEMSG(
"binary = "<< outputBinary <<
", cdd = "<< outputCDD);
1727 INFOMSG(
"save file: '"<< outputFilename.c_str() <<
"'");
1736cddName = wxGetTextFromUser(
"Enter a name for this CD",
"Input Name");
1738 ERRORMSG(
"Conversion to Cdd failed");
1744 unsigned intchangeFlags;
1748 string data(outputFilename.c_str());
1750 TRACEMSG(
"changeFlags: "<< changeFlags);
1752 data+=
"AlignmentChanged\n";
1754 data+=
"RowOrderChanged\n";
1756 data+=
"PSSMChanged\n";
1758 data+=
"DescriptionChanged\n";
1760 data+=
"PendingAlignmentsChanged\n";
1764 #if defined(__WXMAC__) && !defined(__WXOSX_COCOA__) 1767wxFileName wxfn(outputFilename);
1768 if(wxfn.FileExists())
1769 if(!wxfn.MacSetTypeAndCreator(
'TEXT',
'Cn3D'))
1770 WARNINGMSG(
"Unable to set Mac file type/creator");
1774 if(wxIsAbsolutePath(outputFilename))
1775 userDir=
string(wxPathOnly(outputFilename).c_str()) + wxFILE_SEP_PATH;
1776 else if(wxPathOnly(outputFilename) ==
"")
User-defined methods of the data storage class.
User-defined methods of the data storage class.
void ShowSequenceViewer(bool showNow) const
void RealignAllDependentStructures(bool highlightedOnly) const
const BlockMultipleAlignment * GetCurrentMultipleAlignment(void) const
const Sequence * GetMaster(void) const
std::vector< const UngappedAlignedBlock * > UngappedAlignedBlockList
void GetUngappedAlignedBlocks(UngappedAlignedBlockList *blocks) const
CCn3d_style_settings_set â.
CCn3d_style_settings â.
OpenGLRenderer * renderer
void SetGLFontFromRegistry(double fontScale=1.0)
StructureSet * structureSet
void ProcessCommand(const std::string &command, const std::string &dataIn, ncbi::MessageResponder::ReplyStatus *status, std::string *dataOut)
wxCheckBox * m_Nucleotide
ncbi::FloatingPointSpinCtrl * fpSpinCtrl
void SetAllWindowTitles(void) const
void NewSequenceViewerFont(void)
void SequenceWindowsSave(bool prompt)
void RemoveStructureWindow(const StructureWindow *structureWindow)
bool RemoveAllHighlights(bool postRedraws)
void ToggleHighlight(const Molecule *molecule, int residueID, bool scrollViewersTo=false)
void PostRedrawAllStructures(void)
void AddStructureWindow(StructureWindow *window)
void PostRedrawAllSequenceViewers(void)
void AddHighlights(const Sequence *sequence, unsigned int seqIndexFrom, unsigned int seqIndexTo)
void CacheHighlights(void)
static bool CompareIdentifiers(const MoleculeIdentifier *a, const MoleculeIdentifier *b)
bool GetLine(std::string *singleString) const
bool GetLines(TextLines *lines) const
void ShowPreviousFrame(void)
void AttachStructureSet(StructureSet *targetStructureSet)
void ShowFirstFrame(void)
double GetRotateSpeed(void) const
void ChangeView(eViewAdjust control, int dX=0, int dY=0, int X2=0, int Y2=0)
void RestoreSavedView(void)
void EnableStereo(bool enableStereo)
bool HasASNViewSettings(void) const
void ComputeBestView(void)
void ShowDomainsWithHighlights(const StructureSet *set)
void ShowSelectedResidues(const StructureSet *set)
void ShowResidues(const StructureSet *set, bool showAligned)
void ShowAlignedDomains(const StructureSet *set)
void MakeAllVisible(void)
void ShowAlignedChains(const StructureSet *set)
void GetShowHideInfo(std::vector< std::string > *names, std::vector< bool > *visibilities) const
bool IsCDDInMime(void) const
static const unsigned int eRowOrderData
std::vector< std::string > TextLines
const RejectList * GetRejects(void) const
void ShowRejects(void) const
void SelectByDistance(double cutoff, unsigned int options) const
static const unsigned int eAnyAlignmentData
const SequenceSet * sequenceSet
bool SetCDDDescription(const std::string &descr)
static const unsigned int eSelectProtein
static const unsigned int eSelectNucleotide
static const unsigned int eSelectHeterogen
static const unsigned int eCDDData
bool SaveASNData(const char *filename, bool doBinary, unsigned int *changeFlags)
bool SetCDDName(const std::string &name)
bool SetCDDNotes(const TextLines &lines)
bool MonitorAlignments(void) const
AlignmentManager * alignmentManager
ShowHideManager * showHideManager
bool ConvertMimeDataToCDD(const std::string &cddName)
static const unsigned int eUpdateData
const std::string & GetCDDName(void) const
bool HasDataChanged(void) const
static const unsigned int eSelectSolvent
StyleManager * styleManager
static const unsigned int eSelectOtherMoleculesOnly
const std::string & GetCDDDescription(void) const
static const unsigned int ePSSMData
std::list< ncbi::CRef< ncbi::objects::CReject_id > > RejectList
bool GetCDDNotes(TextLines *lines) const
CDDRefDialog * cddRefDialog
bool SaveDialog(bool prompt, bool canCancel)
void OnShowWindow(wxCommandEvent &event)
CDDBookRefDialog * cddBookRefDialog
std::string preferredFavoriteStyle
void ShowCDDReferences(void)
wxTimer fileMessagingTimer
void OnPNG(wxCommandEvent &event)
void OnSetStyle(wxCommandEvent &event)
ncbi::FileMessagingManager fileMessagingManager
void OnShowHide(wxCommandEvent &event)
void OnAlignStructures(wxCommandEvent &event)
void OnAnimationTimer(wxTimerEvent &event)
void OnExit(wxCommandEvent &event)
void ReceivedReply(const std::string &fromApp, unsigned long id, ncbi::MessageResponder::ReplyStatus status, const std::string &data)
void ShowCDDOverview(void)
void SetWindowTitle(void)
void OnCloseWindow(wxCloseEvent &event)
void SetRenderingMenuFlag(int which)
void SendCommand(const std::string &toApp, const std::string &command, const std::string &data)
bool IsFileMessengerActive(void) const
void OnSelectFavorite(wxCommandEvent &event)
void OnFileMessagingTimer(wxTimerEvent &event)
void SetupFavoritesMenu(void)
void OnCDD(wxCommandEvent &event)
void OnPreferences(wxCommandEvent &event)
void DialogTextChanged(const MultiTextDialog *changed)
void ShowCDDBookReferences(void)
void OnHelp(wxCommandEvent &event)
void OnSelect(wxCommandEvent &event)
CommandProcessor * commandProcessor
void OnSave(wxCommandEvent &event)
void SetupFileMessenger(const std::string &messageFilename, const std::string &messageApp, bool readOnly)
void ReceivedCommand(const std::string &fromApp, unsigned long id, const std::string &command, const std::string &data)
MultiTextDialog * cddDescriptionDialog
void OnEditFavorite(wxCommandEvent &event)
void ShowCDDAnnotations(void)
void OnSetFont(wxCommandEvent &event)
wxFileConfig * helpConfig
ncbi::FileMessenger * fileMessenger
wxHtmlHelpController * helpController
void OnOpen(wxCommandEvent &event)
void SetColoringMenuFlag(int which)
void DialogDestroyed(const MultiTextDialog *destroyed)
CDDAnnotateDialog * cddAnnotateDialog
CDDSplashDialog * cddOverview
@ MID_EDIT_CDD_REFERENCES
@ MID_EDIT_CDD_BOOK_REFERENCES
@ MID_SHOW_SELECTED_RESIDUES
@ MID_SHOW_SELECTED_DOMAINS
@ MID_SHOW_UNALIGNED_ALN_DOMAIN
bool LoadData(const char *filename, bool force, bool noAlignmentWindow, ncbi::objects::CNcbi_mime_asn1 *mimeData=NULL)
void OnAnimate(wxCommandEvent &event)
void DestroyNonModalDialogs(void)
void OnAdjustView(wxCommandEvent &event)
void OnSendSelection(wxCommandEvent &event)
MultiTextDialog * cddNotesDialog
std::string messageTargetApp
const StyleSettings & GetGlobalStyle(void) const
bool SetGlobalStyle(const ncbi::objects::CCn3d_style_settings &styleASN)
bool EditUserAnnotations(wxWindow *parent)
bool EditGlobalStyle(wxWindow *parent)
bool CheckGlobalStyleSettings(void)
@ eInformationContentShortcut
@ eSecondaryStructureShortcut
bool SaveSettingsToASN(ncbi::objects::CCn3d_style_settings *styleASN) const
void RaiseLogWindow(void)
bool IsWindowedMode(void)
CNcbi_mime_asn1 * LoadStructureViaCache(const std::string &uid, ncbi::objects::EModel_type modelType, int assemblyId)
bool ExportPNG(Cn3DGLCanvas *glCanvas, OpenGLRenderer *renderer, const string &outputFilename, int outputWidth, int outputHeight, bool interlaced)
Include a standard set of the NCBI C++ Toolkit most basic headers.
static bool ReadASNFromFile(const char *filename, ASNClass *ASNobject, bool isBinary, std::string *err)
static bool WriteASNToFile(const char *filename, const ASNClass &ASNobject, bool isBinary, std::string *err, ncbi::EFixNonPrint fixNonPrint=ncbi::eFNP_Default)
CNcbi_mime_asn1 * CreateMimeFromBiostruc(const string &filename, EModel_type model)
static const struct name_t names[]
static DLIST_TYPE *DLIST_NAME() first(DLIST_LIST_TYPE *list)
EDiagSev SetDiagPostLevel(EDiagSev post_sev=eDiag_Error)
Set the threshold severity for posting the messages.
@ eDiag_Info
Informational message.
@ eDiag_Fatal
Fatal error â guarantees exit(or abort)
TObjectType * GetPointer(void) THROWS_NONE
Get pointer,.
#define END_SCOPE(ns)
End the previously defined scope.
#define BEGIN_SCOPE(ns)
Define a new scope.
IO_PREFIX::istream CNcbiIstream
Portable alias for istream.
IO_PREFIX::ifstream CNcbiIfstream
Portable alias for ifstream.
static int CompareNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-insensitive compare of a substring with another string.
EModel_type
Access to EModel_type's attributes (values, names) as defined in spec.
@ eModel_type_ncbi_all_atom
@ eModel_type_ncbi_backbone
void SetName(const TName &value)
Assign a value to Name data member.
const Tdata & Get(void) const
Get the member data.
void Reset(void)
Reset data member.
Tdata & Set(void)
Assign a value to data member.
unsigned int
A callback function used to compare two keys in a database.
Messenger * GlobalMessenger(void)
const TYPE & Get(const CNamedParameterList *param)
const struct ncbi::grid::netcache::search::fields::SIZE size
Defines: CTimeFormat - storage class for time format.
std::istream & in(std::istream &in_, double &x_)
double r(size_t dimension_, const Int4 *score_, const double *prob_, double theta_)
EVT_MENU_RANGE(MID_SHOW_TITLES, MID_HIDE_TITLES, ViewerWindowBase::OnTitleView) EVT_MENU_RANGE(MID_ENABLE_EDIT
ViewerWindowBase::OnEditMenu ViewerWindowBase::OnJustification EVT_MENU(MID_SHOW_GEOM_VLTNS, ViewerWindowBase::OnShowGeomVltns) EVT_MENU(MID_FIND_PATTERN
static DP_BlockInfo * blocks
#define RENDERING_SHORTCUT(type, menu)
static CCn3d_style_settings_set favoriteStyles
static void SetWorkingTitle(StructureSet *sSet)
pair< const Sequence *, wxString > SeqAndDescr
static bool CompareSequencesByIdentifier(const SeqAndDescr &a, const SeqAndDescr &b)
static void SaveFavorites(void)
static string currentFile
static bool LoadFavorites(void)
#define COLORING_SHORTCUT(type, menu)
static bool currentFileIsBinary
static string GetFavoritesFile(bool forRead)
bool LoadDataOnly(StructureSet **sset, OpenGLRenderer *renderer, const char *filename, CNcbi_mime_asn1 *mimeData, const string &favoriteStyle, EModel_type model, StructureWindow *window)
const string & GetUserDir(void)
const string & GetWorkingFilename(void)
vector< SeqAndDescr > SeqAndDescrList
static bool favoriteStylesChanged
static EModel_type GetModelTypeFromUser(wxWindow *parent)
const string & GetWorkingTitle(void)
static string workingTitle
static void SetTitle(CRef< CSeq_entry > entry, string title)
static wxAcceleratorEntry entries[3]
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