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
179 DISPLAY_CONTINUOUSLOOP,
182 MOLECULARMECHANICS = 10400,
257 {
return primitive_manager_;}
321 {
return composite_manager_;}
508 const char* slot = 0,
const String& description =
"", QKeySequence accel = QKeySequence(),
524 const char* slot = 0,
const QString& description =
"", QKeySequence accel = QKeySequence(),
625 {multi_threading_mode_ = state;}
659 {
return fragment_db_;}
672 {
return working_dir_;}
708 virtual void dump(std::ostream& s = std::cout,
Size depth = 0)
const;
796 virtual void quit(
int return_value = 0);
863 bool to_delete =
true);
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>
#define BALL_EMBEDDABLE(TYPE, BASE)
BALL_EXTERN_VARIABLE const double h
BALL_EXTERN_VARIABLE const double c
HashMap class based on the STL map (containing serveral convenience functions)
virtual QMenu * createPopupMenu()
QAction * stop_simulation_action_
virtual void restoreWindows(const INIFile &inifile)
Restore the positions the main window and of all DockWindow's from a given inifile.
System * getSelectedSystem()
If exactly one System is selected in the Control, return a pointer to this system,...
virtual void openFile(const String &file)
virtual void dump(std::ostream &s=std::cout, Size depth=0) const
String getStatusbarText() const
QLabel * simulation_icon_
void update(Composite &composite, bool changed_hierarchy=true)
ShortcutRegistry & getShortcutRegistry()
bool remove(Composite &composite, bool to_delete=true, bool update=true)
bool insert(Representation &rep)
RepresentationManager primitive_manager_
bool update(Representation &rep)
QAction * last_highlighted_menu_entry_
bool important_text_in_statusbar_
ModularWidget * getLockingWidget()
Get the ModularWidget with excluse access to the Composites.
void loadBALLViewProjectFile(const String &filename)
Load a BALLView project file.
void setContentSize(int w, int h)
OpenSavePreferences * open_save_preferences_
void selectComposites_(GeometricObjectSelectionMessage &message)
virtual void fetchPreferences(INIFile &inifile)
virtual void resize(int w, int h)
overloaded from QT for Python Interface
void stopSimulation()
Stop a currently running calculation.
void setStatusbarText(const String &text, bool important=false, bool beep=false)
void wait()
Wait until the MainControl is not busy anymore.
void sendMessage(Message &message)
virtual void applyPreferences()
NetworkPreferences * network_preferences_
void quickSave()
Create a BALLView project file with the name quick.bvp in the users home dir.
QAction * clear_selection_action_
bool stopedSimulation()
Returns true, if the simulation was told to stop, but hasnt done this so far.
INIFile preferences_file_
QAction * getLastHighLightedMenuEntry()
Get the ID of the last highlighted menu entry.
void enableLoggingToFile()
Preferences * preferences_dialog_
virtual QMenu * initPopupMenu(int ID, UIOperationMode::OperationMode mode=UIOperationMode::MODE_ALL)
QAction * fullscreen_action_
void redrawAllRepresentations(bool rebuild_display_lists=false)
void saveBALLViewProjectFile()
Mutex composites_locked_mutex_
QAction * complement_selection_action_
RepresentationManager & getRepresentationManager()
Preferences * getPreferences()
bool compositesAreLocked() const
bool lockCompositesFor(ModularWidget *widget)
virtual void restoreWindows()
Restore the positions the main window and of all DockWindow's from the INIFile assigned to this insta...
SimulationThread * simulation_thread_
void complementSelectionHelper_(Composite &c)
HashMap< Position, QMenu * > id_to_menu_
bool remove(Representation &rep)
void saveBALLViewProjectFile(const String &filename, bool binary=true)
Save the current configuration, structures and representations to a BALLView project file (*....
QAction * insertMenuEntry(Position parent_id, const QString &name, const QObject *receiver=0, const char *slot=0, const QString &description="", QKeySequence accel=QKeySequence(), UIOperationMode::OperationMode minimal_mode=UIOperationMode::MODE_ALL)
QAction * insertMenuEntry(Position parent_id, const String &name, const QObject *receiver=0, const char *slot=0, const String &description="", QKeySequence accel=QKeySequence(), UIOperationMode::OperationMode minimal_mode=UIOperationMode::MODE_ALL)
void clearStatusBarText_()
virtual void okPreferencesClicked_()
void removeModularWidget(ModularWidget *widget)
bool insert(Composite &composite, String name="", bool normalize=true)
void addModularWidget(ModularWidget *widget)
void setBusyMode_(bool state)
virtual bool event(QEvent *e)
Interface to QT events, e.g. to communicate with other threads.
void menuItemHighlighted(QAction *action)
bool remove_(Composite &composite, bool update_representations_of_parent=true, bool to_delete=true)
void insertPopupMenuSeparator(int ID, UIOperationMode::OperationMode mode=UIOperationMode::MODE_ALL)
void setMenuHint(QAction *id, const String &hint)
Set a hint for a menu entry.
virtual void closeEvent(QCloseEvent *evt)
virtual void aboutToExit()
String logging_file_name_
HashSet< Composite * > selection_
virtual void quit(int return_value=0)
Make the program exit.
HashSet< Composite * > & getSelection()
Get the HashSet with the selected (e.g. picked) Composite objects.
const INIFile & getINIFile() const
void processEvents(Size ms)
Added overloaded method from QApplication for access in Python.
SimulationThread * getSimulationThread()
const FragmentDB & getFragmentDB() const
Get a const reference for the fragment database.
QAction * preferences_action_
bool unlockCompositesFor(ModularWidget *widget)
Lock the Composites for a given Modular Widget.
ShortcutRegistry shortcut_registry_
ModelInformation * model_information_
virtual QMenu * addMenu(const QString &title, UIOperationMode::OperationMode mode=UIOperationMode::MODE_ALL)
std::list< Composite * > control_selection_
virtual void writePreferences(INIFile &inifile)
void setDeleteEntryEnabled(bool state)
MainControl(const MainControl &main_control)
virtual void deleteClicked()
void loadBALLViewProjectFile()
virtual void onNotify(Message *message)
void reduceSelection_(Composite *const composite)
CompositeManager & getCompositeManager()
MainControlPreferences * main_control_preferences_
void setModelInformation(ModelInformation *mi)
virtual void initializePreferencesTab_()
const ModelInformation & getModelInformation() const
std::list< Composite * > & getMolecularControlSelection()
Get the selection (highlighted items) of the MolecularControl (not the selection with checkboxes)
void disableLoggingToFile()
const HashSet< Composite * > & getSelection() const
Get the HashSet with the selected (e.g. picked) Composite objects (const)
String getMenuHint(QAction *id) const
Get the hint for a menu entry.
virtual void applyPreferencesClicked_()
bool multi_threading_mode_
void deselectCompositeRecursive(Composite *composite, bool first_call=false)
Select a Composite recursive and add all Atom and AtomContainer objects to the selection.
bool updateRepresentationsOf(const Composite &composite, bool rebuild=true, bool force=false)
void setWorkingDir(const String &dir)
Set the working directory for the next file dialog and file operation to the given directory.
ModularWidget * locking_widget_
bool setSimulationThread(SimulationThread *thread)
String getWorkingDir() const
void selectCompositeRecursive(Composite *composite, bool first_call=false)
Select a Composite recursive and add all Atom and AtomContainer objects to the selection.
void complementSelection()
const String & getLoggingFilename() const
See above.
@ CHOOSE_FF
Molmec submenu for force field selection.
@ DISPLAY_STEREO
Display Stereo submenu.
@ FILE_OPEN
File menu sub menu open.
@ FILE_IMPORT
File menu sub menu import [currently unused].
@ DISPLAY_ANIMATION
Display Animation submenu.
@ FILE_OPEN_GRID
File menu sub menu open grid.
@ TOOLS_PYTHON
Python submenu in Tools.
@ FILE_EXPORT
File menu sub menu export.
@ DISPLAY_CREATE
Display Create submenu.
@ TOOLS_GRID
Grid submenu in Tools.
@ DISPLAY_VIEWPOINT
Display Viewpoint submenu.
void setMultithreading(bool state)
See above.
void removeMenuEntry(Index parent_id, QAction *action)
void printSelectionInfos()
virtual void checkMenus()
MainControl(QWidget *parent=0, const char *name=0, String inifile=".BALL.preferences")
void setLoggingFilename(const String &string)
void setStatusbarText(const QString &text, bool important=false, bool beep=false)
CompositeManager composite_manager_
bool updateOfRepresentationRunning()
Return true if Representations are (re)calculated.
static MainControl * getMainControl(const QObject *object)
void setPreferencesEnabled_(bool state)
void quickLoad()
Quickload quick.bvp in the users home die (see above)
std::list< ModularWidget * > modular_widgets_