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>
57 class ModelInformation;
60 class MainControlPreferences;
61 class OpenSavePreferences;
62 class NetworkPreferences;
63 class GeometricObjectSelectionMessage;
64 class SimulationThread;
170 MOLECULARMECHANICS = 10400,
229 virtual void clear();
244 {
return primitive_manager_;}
280 bool updateRepresentationsOf(
const Composite& composite,
bool rebuild =
true,
bool force =
false);
286 void redrawAllRepresentations(
bool rebuild_display_lists =
false);
308 {
return composite_manager_;}
324 bool remove(
Composite& composite,
bool to_delete =
true,
bool update =
true);
334 void update(
Composite& composite,
bool changed_hierarchy =
true);
343 std::list<Composite*>& getMolecularControlSelection();
346 System* getSelectedSystem();
349 void selectCompositeRecursive(
Composite* composite,
bool first_call=
false);
352 void deselectCompositeRecursive(
Composite* composite,
bool first_call=
false);
362 void printSelectionInfos();
371 void saveBALLViewProjectFile(
const String& filename,
bool binary =
true);
374 void loadBALLViewProjectFile(
const String& filename);
382 virtual void fetchPreferences(
INIFile &inifile);
391 virtual void writePreferences(
INIFile &inifile);
394 virtual void restoreWindows();
397 virtual void restoreWindows(
const INIFile& inifile);
405 const INIFile& getINIFile()
const;
420 virtual void applyPreferences();
467 virtual void onNotify(
Message *message);
474 void sendMessage(
Message& message);
494 const char* slot = 0,
const String& description =
"", QKeySequence accel = QKeySequence());
497 void removeMenuEntry (
Index parent_id, QAction* action);
506 virtual QMenu* initPopupMenu(
int ID);
513 void insertPopupMenuSeparator(
int ID);
516 void setMenuHint(QAction*
id,
const String& hint);
519 String getMenuHint(QAction*
id)
const;
524 void setDeleteEntryEnabled(
bool state);
529 void insertDeleteEntry();
542 bool compositesAreLocked()
const;
558 bool updateOfRepresentationRunning();
587 bool useMultithreading();
590 void setMultithreading(
bool state)
591 {multi_threading_mode_ = state;}
600 void processEvents(
Size ms);
615 void setStatusbarText(
const String& text,
bool important =
false,
bool beep =
false);
618 void setStatusbarText(
const QString& text,
bool important =
false,
bool beep =
false);
621 String getStatusbarText()
const;
625 {
return fragment_db_;}
638 {
return working_dir_;}
641 void setWorkingDir(
const String& dir);
645 void enableLoggingToFile();
649 void disableLoggingToFile();
654 void setLoggingFilename(
const String&
string);
657 const String& getLoggingFilename()
const;
674 virtual void dump(std::ostream& s = std::cout,
Size depth = 0)
const;
683 virtual void openFile(
const String& file) ;
720 virtual void checkMenus();
723 void stopSimulation();
726 void complementSelection();
731 void clearSelection();
745 virtual void aboutToExit();
752 void menuItemHighlighted(QAction* action);
755 virtual bool event(
QEvent* e);
758 virtual void quit(
int return_value = 0);
761 virtual void resize(
int w,
int h );
764 void setContentSize(
int w,
int h);
767 void toggleFullScreen();
776 void saveBALLViewProjectFile();
779 void loadBALLViewProjectFile();
782 void quickLoadConfirm();
792 virtual void applyPreferencesClicked_();
798 virtual void okPreferencesClicked_();
801 void clearStatusBarText_();
804 virtual void deleteClicked();
806 void updateRepLabel_();
810 virtual void initializePreferencesTab_();
813 void stopedSimulation_();
816 void lockComposites_();
824 bool remove_(
Composite& composite,
bool update_representations_of_parent =
true,
825 bool to_delete =
true);
832 void reduceSelection_(
Composite*
const composite);
837 void complementSelectionHelper_(
Composite&
c);
841 void setBusyMode_(
bool state);
844 void setPreferencesEnabled_(
bool state);
848 virtual void closeEvent(QCloseEvent* evt);
896 static const char *simulation_running_xpm_[];
897 static const char *simulation_stoped_xpm_[];
930 # ifndef BALL_NO_INLINE_FUNCTIONS
931 # include <BALL/VIEW/KERNEL/mainControl.iC>
937 #endif // BALL_VIEW_KERNEL_MAINCONTROL_H