Go to the documentation of this file.
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_VIEW_KERNEL_UIOPERATIONMODE_H
36 #ifndef BALL_VIEW_KERNEL_UIOPERATIONMODE_H
40 #ifndef BALL_FORMAT_INIFILE_H
44 #ifndef BALL_SYSTEM_FILE_H
48 #ifndef BALL_STRUCTURE_FRAGMENTDB_H
52 #include <QtGui/QKeySequence>
53 #include <QtWidgets/QMainWindow>
54 #include <QtWidgets/QApplication>
55 #include <QtWidgets/QMenuBar>
56 #include <QtWidgets/QLabel>
57 #include <QtCore/QTimer>
65 class ModelInformation;
68 class MainControlPreferences;
69 class OpenSavePreferences;
70 class NetworkPreferences;
71 class GeometricObjectSelectionMessage;
72 class SimulationThread;
177 #ifdef BALL_HAS_RTFACT
178 DISPLAY_CONTINUOUSLOOP,
181 MOLECULARMECHANICS = 10400,
242 virtual void clear();
257 {
return primitive_manager_;}
293 bool updateRepresentationsOf(
const Composite& composite,
bool rebuild =
true,
bool force =
false);
299 void redrawAllRepresentations(
bool rebuild_display_lists =
false);
321 {
return composite_manager_;}
329 bool insert(
Composite& composite,
String name =
"",
bool normalize =
true);
337 bool remove(
Composite& composite,
bool to_delete =
true,
bool update =
true);
347 void update(
Composite& composite,
bool changed_hierarchy =
true);
356 std::list<Composite*>& getMolecularControlSelection();
359 System* getSelectedSystem();
362 void selectCompositeRecursive(
Composite* composite,
bool first_call=
false);
365 void deselectCompositeRecursive(
Composite* composite,
bool first_call=
false);
375 void printSelectionInfos();
384 void saveBALLViewProjectFile(
const String& filename,
bool binary =
true);
387 void loadBALLViewProjectFile(
const String& filename);
395 virtual void fetchPreferences(
INIFile &inifile);
404 virtual void writePreferences(
INIFile &inifile);
407 virtual void restoreWindows();
410 virtual void restoreWindows(
const INIFile& inifile);
418 const INIFile& getINIFile()
const;
433 virtual void applyPreferences();
480 virtual void onNotify(
Message *message);
487 void sendMessage(
Message& message);
508 const char* slot = 0,
const String& description =
"", QKeySequence accel = QKeySequence(),
523 QAction* insertMenuEntry(
Position parent_id,
const QString& name,
const QObject* receiver = 0,
524 const char* slot = 0,
const QString& description =
"", QKeySequence accel = QKeySequence(),
531 void removeMenuEntry (
Index parent_id, QAction* action);
550 void setMenuHint(QAction*
id,
const String& hint);
553 String getMenuHint(QAction*
id)
const;
558 void setDeleteEntryEnabled(
bool state);
563 void insertDeleteEntry();
576 bool compositesAreLocked()
const;
592 bool updateOfRepresentationRunning();
621 bool useMultithreading();
625 {multi_threading_mode_ = state;}
634 void processEvents(
Size ms);
649 void setStatusbarText(
const String& text,
bool important =
false,
bool beep =
false);
652 void setStatusbarText(
const QString& text,
bool important =
false,
bool beep =
false);
655 String getStatusbarText()
const;
659 {
return fragment_db_;}
672 {
return working_dir_;}
675 void setWorkingDir(
const String& dir);
679 void enableLoggingToFile();
683 void disableLoggingToFile();
688 void setLoggingFilename(
const String&
string);
691 const String& getLoggingFilename()
const;
708 virtual void dump(std::ostream& s = std::cout,
Size depth = 0)
const;
717 virtual void openFile(
const String& file) ;
722 virtual QMenu* createPopupMenu();
758 virtual void checkMenus();
761 void stopSimulation();
764 void complementSelection();
769 void clearSelection();
783 virtual void aboutToExit();
790 void menuItemHighlighted(QAction* action);
793 virtual bool event(
QEvent* e);
796 virtual void quit(
int return_value = 0);
799 virtual void resize(
int w,
int h );
802 void setContentSize(
int w,
int h);
805 void toggleFullScreen();
814 void saveBALLViewProjectFile();
817 void loadBALLViewProjectFile();
820 void quickLoadConfirm();
830 virtual void applyPreferencesClicked_();
836 virtual void okPreferencesClicked_();
839 void clearStatusBarText_();
842 virtual void deleteClicked();
844 void updateRepLabel_();
848 virtual void initializePreferencesTab_();
851 void stopedSimulation_();
854 void lockComposites_();
862 bool remove_(
Composite& composite,
bool update_representations_of_parent =
true,
863 bool to_delete =
true);
870 void reduceSelection_(
Composite*
const composite);
875 void complementSelectionHelper_(
Composite&
c);
879 void setBusyMode_(
bool state);
882 void setPreferencesEnabled_(
bool state);
886 virtual void closeEvent(QCloseEvent* evt);
934 static const char *simulation_running_xpm_[];
935 static const char *simulation_stoped_xpm_[];
966 # ifndef BALL_NO_INLINE_FUNCTIONS
967 # include <BALL/VIEW/KERNEL/mainControl.iC>
973 #endif // BALL_VIEW_KERNEL_MAINCONTROL_H
RepresentationManager primitive_manager_
@ DISPLAY_VIEWPOINT
Display Viewpoint submenu.
QAction * getLastHighLightedMenuEntry()
Get the ID of the last highlighted menu entry.
@ TOOLS_GRID
Grid submenu in Tools.
CompositeManager composite_manager_
@ DISPLAY_CREATE
Display Create submenu.
bool multi_threading_mode_
QAction * stop_simulation_action_
const FragmentDB & getFragmentDB() const
Get a const reference for the fragment database.
@ FILE_EXPORT
File menu sub menu export.
bool important_text_in_statusbar_
@ TOOLS_PYTHON
Python submenu in Tools.
ModelInformation * model_information_
HashMap class based on the STL map (containing serveral convenience functions)
INIFile preferences_file_
String getWorkingDir() const
OpenSavePreferences * open_save_preferences_
QAction * last_highlighted_menu_entry_
QAction * fullscreen_action_
@ FILE_IMPORT
File menu sub menu import [currently unused].
@ DISPLAY_ANIMATION
Display Animation submenu.
QAction * complement_selection_action_
const BALL_EXTERN_VARIABLE double h
SimulationThread * simulation_thread_
RepresentationManager & getRepresentationManager()
#define BALL_EMBEDDABLE(TYPE, BASE)
bool stopedSimulation()
Returns true, if the simulation was told to stop, but hasnt done this so far.
@ FILE_OPEN_GRID
File menu sub menu open grid.
BALL_VIEW_EXPORT MainControl * getMainControl()
@ FILE_OPEN
File menu sub menu open.
QAction * clear_selection_action_
ShortcutRegistry shortcut_registry_
void setMultithreading(bool state)
See above.
QLabel * simulation_icon_
HashSet< Composite * > selection_
ModularWidget * locking_widget_
const BALL_EXTERN_VARIABLE double c
CompositeManager & getCompositeManager()
Mutex composites_locked_mutex_
MainControlPreferences * main_control_preferences_
String logging_file_name_
Preferences * preferences_dialog_
ShortcutRegistry & getShortcutRegistry()
std::list< ModularWidget * > modular_widgets_
NetworkPreferences * network_preferences_
QAction * preferences_action_
std::list< Composite * > control_selection_
@ CHOOSE_FF
Molmec submenu for force field selection.
@ DISPLAY_STEREO
Display Stereo submenu.
HashMap< Position, QMenu * > id_to_menu_