5 #ifndef BALL_VIEW_KERNEL_MAINCONTROL_H
6 #define BALL_VIEW_KERNEL_MAINCONTROL_H
8 #ifndef BALL_CONCEPT_EMBEDDABLE_H
12 #ifndef BALL_DATATYPE_HASHMAP_H
16 #ifndef BALL_VIEW_KERNEL_CONNECTIONOBJECT_H
20 #ifndef BALL_VIEW_KERNEL_REPRESENTATIONMANAGER_H
24 #ifndef BALL_VIEW_KERNEL_COMPOSITEMANAGER_H
28 #ifndef BALL_VIEW_KERNEL_SHORTCUTREGISTRY_H
32 #ifndef BALL_FORMAT_INIFILE_H
36 #ifndef BALL_SYSTEM_FILE_H
40 #ifndef BALL_STRUCTURE_FRAGMENTDB_H
44 #include <QtGui/QKeySequence>
45 #include <QtGui/QMainWindow>
46 #include <QtGui/QApplication>
47 #include <QtGui/QMenuBar>
48 #include <QtGui/QLabel>
49 #include <QtCore/QTimer>
55 class ModelInformation;
58 class MainControlPreferences;
59 class OpenSavePreferences;
60 class NetworkPreferences;
61 class GeometricObjectSelectionMessage;
62 class SimulationThread;
168 MOLECULARMECHANICS = 10400,
227 virtual void clear();
242 {
return primitive_manager_;}
278 bool updateRepresentationsOf(
const Composite& composite,
bool rebuild =
true,
bool force =
false);
284 void redrawAllRepresentations(
bool rebuild_display_lists =
false);
306 {
return composite_manager_;}
322 bool remove(
Composite& composite,
bool to_delete =
true,
bool update =
true);
332 void update(
Composite& composite,
bool changed_hierarchy =
true);
341 std::list<Composite*>& getMolecularControlSelection();
344 System* getSelectedSystem();
347 void selectCompositeRecursive(
Composite* composite,
bool first_call=
false);
350 void deselectCompositeRecursive(
Composite* composite,
bool first_call=
false);
360 void printSelectionInfos();
369 void saveBALLViewProjectFile(
const String& filename,
bool binary =
true);
372 void loadBALLViewProjectFile(
const String& filename);
380 virtual void fetchPreferences(
INIFile &inifile);
389 virtual void writePreferences(
INIFile &inifile);
392 virtual void restoreWindows();
395 virtual void restoreWindows(
const INIFile& inifile);
403 const INIFile& getINIFile()
const;
418 virtual void applyPreferences();
465 virtual void onNotify(
Message *message);
472 void sendMessage(
Message& message);
492 const char* slot = 0,
const String& description =
"", QKeySequence accel = QKeySequence());
495 void removeMenuEntry (
Index parent_id, QAction* action);
504 virtual QMenu* initPopupMenu(
int ID);
511 void insertPopupMenuSeparator(
int ID);
514 void setMenuHint(QAction*
id,
const String& hint);
517 String getMenuHint(QAction*
id)
const;
522 void setDeleteEntryEnabled(
bool state);
527 void insertDeleteEntry();
540 bool compositesAreLocked()
const;
556 bool updateOfRepresentationRunning();
585 bool useMultithreading();
588 void setMultithreading(
bool state)
589 {multi_threading_mode_ = state;}
598 void processEvents(
Size ms);
613 void setStatusbarText(
const String& text,
bool important =
false,
bool beep =
false);
616 void setStatusbarText(
const QString& text,
bool important =
false,
bool beep =
false);
619 String getStatusbarText()
const;
623 {
return fragment_db_;}
636 {
return working_dir_;}
639 void setWorkingDir(
const String& dir);
643 void enableLoggingToFile();
647 void disableLoggingToFile();
652 void setLoggingFilename(
const String&
string);
655 const String& getLoggingFilename()
const;
672 virtual void dump(std::ostream& s = std::cout,
Size depth = 0)
const;
681 virtual void openFile(
const String& file) ;
718 virtual void checkMenus();
721 void stopSimulation();
724 void complementSelection();
729 void clearSelection();
743 virtual void aboutToExit();
750 void menuItemHighlighted(QAction* action);
753 virtual bool event(
QEvent* e);
756 virtual void quit(
int return_value = 0);
759 virtual void resize(
int w,
int h );
762 void setContentSize(
int w,
int h);
765 void toggleFullScreen();
774 void saveBALLViewProjectFile();
777 void loadBALLViewProjectFile();
780 void quickLoadConfirm();
790 virtual void applyPreferencesClicked_();
796 virtual void okPreferencesClicked_();
799 void clearStatusBarText_();
802 virtual void deleteClicked();
804 void updateRepLabel_();
808 virtual void initializePreferencesTab_();
811 void stopedSimulation_();
814 void lockComposites_();
822 bool remove_(
Composite& composite,
bool update_representations_of_parent =
true,
823 bool to_delete =
true);
830 void reduceSelection_(
Composite*
const composite);
835 void complementSelectionHelper_(
Composite&
c);
839 void setBusyMode_(
bool state);
842 void setPreferencesEnabled_(
bool state);
892 static const char *simulation_running_xpm_[];
893 static const char *simulation_stoped_xpm_[];
926 # ifndef BALL_NO_INLINE_FUNCTIONS
927 # include <BALL/VIEW/KERNEL/mainControl.iC>
933 #endif // BALL_VIEW_KERNEL_MAINCONTROL_H