/***************************************************************************** # Copyright (C) 1994-2008 by David Gordon. # All rights reserved. # # This software is part of a beta-test version of the Consed/Autofinish # package. It should not be redistributed or # used for any commercial purpose, including commercially funded # sequencing, without written permission from the author and the # University of Washington. # # This software is provided ``AS IS'' and any express or implied # warranties, including, but not limited to, the implied warranties of # merchantability and fitness for a particular purpose, are disclaimed. # In no event shall the authors or the University of Washington be # liable for any direct, indirect, incidental, special, exemplary, or # consequential damages (including, but not limited to, procurement of # substitute goods or services; loss of use, data, or profits; or # business interruption) however caused and on any theory of liability, # whether in contract, strict liability, or tort (including negligence # or otherwise) arising in any way out of the use of this software, even # if advised of the possibility of such damage. # # Building Consed from source is error prone and not simple which is # why I provide executables. Due to time limitations I cannot # provide any assistance in building Consed. Even if you do not # modify the source, you may introduce errors due to using a # different version of the compiler, a different version of motif, # different versions of other libraries than I used, etc. For this # reason, if you discover Consed bugs, I can only offer help with # those bugs if you first reproduce those bugs with an executable # provided by me--not an executable you have built. # # Modifying Consed is also difficult. Although Consed is modular, # some modules are used by many other modules. Thus making a change # in one place can have unforeseen effects on many other features. # It may takes months for you to notice these other side-effects # which may not seen connected at all. It is not feasable for me to # provide help with modifying Consed sources because of the # potentially huge amount of time involved. # #*****************************************************************************/ // // teditor.h // // #ifndef TEDITOR_INCLUDED #define TEDITOR_INCLUDED #ifdef SCCS_ID static const char* teditorSccsId = "@(#)teditor.h 1.56 02/19/99 02:00:56"; #endif #include #include "rwcstring.h" #include "rwtptrorderedvector.h" #include "sysdepend.h" #include "locatedFragment.h" #include "contig.h" //#include "guiteditor.h" #include "teditor_types.h" #include "guicolortext.h" #include "filename.h" #include "whatToDoWithSelectionTypes.h" #include "tedwin.h" const int nDefaultMagnification = 50; // do not include these because of circularity class ConsEd; class ContigWin; class GuiTeditor; class GuiTedWin; class Teditor { public: Teditor(ContigWin*, const int nStartWithThisManyTraces, const bool bShowTracesInScrollingWindow ); ~Teditor(); void dummyFixForSGIBug() { dapTedWin_.clearAndDestroy(); } // for benefit of dynamic arrays. you can only equal yourself. bool operator == (const Teditor& rTeditor) const { return (this == &rTeditor); } // get pointer to your companion GuiTedWin GuiTeditor* pGuiTeditorGet() { return pGuiTeditor_; } // get pointer to ContigWin that created you ContigWin* pContigWinGet() { return pContigWin_; } // get pointer to Contig to which you apply Contig* pGetContig(); // catch a refresh message from consed. crude first cut void refreshAllTedWins( const bool bRecalculateBasePositions ); // special case refresh after complementation. requires scrolling // first. void refreshAllTedWinsAfterCompContig(); // draw cursor on all child TedWins void drawCursors(const bool bMakeVisible); // set the Undo buttons on child TedWins to active or inactive // on each TedWin according to whether or not that TedWin initiated // the last edit void setTedWinsUndoButtonState(); TedWin* pGetTedWinByLocatedFragment( const LocatedFragment* pLocatedFragment ); // add the TedWin to the dynamic array of pointers // you keep for the purpose of refreshes, etc. void addNewTedWinToTeditorList( TedWin* pTedWin ) { dapTedWin_.append( pTedWin ); } void removeTedWinFromTeditorList( TedWin* pTedWin ) { dapTedWin_.remove( pTedWin ); } int nNumberOfTedWins() { return( dapTedWin_.length() ); } TedWin* pGetTedWin( const int nTedWinIndex ) { return( dapTedWin_[ nTedWinIndex ] ); } bool bTedWinsScrollTogether() {return( bTedWinsScrollTogether_ ); } void changeAllTedWinsScrollTogether( const bool bScrollTogether, GuiTedWin* pGuiTedWinScrollMaster); void setGuiTedWinScrollMaster( GuiTedWin* pGuiTedWin ) { pGuiTedWinScrollMaster_ = pGuiTedWin; } GuiTedWin* pGetGuiTedWinScrollMaster() { return( pGuiTedWinScrollMaster_ ); } void changeToADifferentScrollMaster(); void alignAllTracesToMaster(); void alignToThisTraceIfScrollingTogether( TedWin* pTedWin ); void drawTracesOfAllTedWins(); void drawVerticalLineThroughTracesOfAllTedWins( const int nConsPos ); void deleteTedWinsIfTooMany( const int nNumberOfTedWinsToAdd ); void deleteAllTedWins(); void raiseTracesWindow(); void prepareToShowAllTraces(); void drawScaleAndConsensusForShowAllTraces(); void userPushedUpDownArrowKey( const bool bUpNotDown ); void showAllTraces( const int nInitialConsPos ); enum { cNextTraces = 'c', cPrevTraces = 'p' }; void showNextPrevTraces( const char cNextPrev ); void showAllTraces2( const int nStartingReadLine, const bool bUpNotDown, bool& bDisplayedSomeTraces ); void removeAllTraces(); void reAlignTracesSinceCursorChanged( LocatedFragment* pLocFrag ); // int nGetApproxPixelsPerBase(); void loadConsensusGuiColorTextArray( const int nConsPosMin, const int nConsPosMax ); public: // your companion GuiTeditor object GuiTeditor* pGuiTeditor_; // Teditor maintains pointer to ContigWin that created it ContigWin* pContigWin_; // keep an array of pointers to all your child TedWins RWTPtrOrderedVector dapTedWin_; bool bTedWinsScrollTogether_; // true if TedWins scroll together GuiTedWin* pGuiTedWinScrollMaster_; // the tedwin that the other tedwins // must match /* these are for displaying all traces in batches */ ContigView* pContigView_; int nTopDisplayedTrace_; int nBottomDisplayedTrace_; int nConsPos_; mbtPtrVector aConsensusGuiColorTextArray_; }; // class Teditor #endif // TEDITOR_INCLUDED