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 <QtGui/QMainWindow>
54 #include <QtGui/QApplication>
55 #include <QtGui/QMenuBar>
56 #include <QtGui/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,
241 virtual void clear();
256 {
return primitive_manager_;}
292 bool updateRepresentationsOf(
const Composite& composite,
bool rebuild =
true,
bool force =
false);
298 void redrawAllRepresentations(
bool rebuild_display_lists =
false);
320 {
return composite_manager_;}
328 bool insert(
Composite& composite,
String name =
"",
bool normalize =
true);
336 bool remove(
Composite& composite,
bool to_delete =
true,
bool update =
true);
346 void update(
Composite& composite,
bool changed_hierarchy =
true);
355 std::list<Composite*>& getMolecularControlSelection();
358 System* getSelectedSystem();
361 void selectCompositeRecursive(
Composite* composite,
bool first_call=
false);
364 void deselectCompositeRecursive(
Composite* composite,
bool first_call=
false);
374 void printSelectionInfos();
383 void saveBALLViewProjectFile(
const String& filename,
bool binary =
true);
386 void loadBALLViewProjectFile(
const String& filename);
394 virtual void fetchPreferences(
INIFile &inifile);
403 virtual void writePreferences(
INIFile &inifile);
406 virtual void restoreWindows();
409 virtual void restoreWindows(
const INIFile& inifile);
417 const INIFile& getINIFile()
const;
432 virtual void applyPreferences();
479 virtual void onNotify(
Message *message);
486 void sendMessage(
Message& message);
507 const char* slot = 0,
const String& description =
"", QKeySequence accel = QKeySequence(),
522 QAction* insertMenuEntry(
Position parent_id,
const QString& name,
const QObject* receiver = 0,
523 const char* slot = 0,
const QString& description =
"", QKeySequence accel = QKeySequence(),
530 void removeMenuEntry (
Index parent_id, QAction* action);
549 void setMenuHint(QAction*
id,
const String& hint);
552 String getMenuHint(QAction*
id)
const;
557 void setDeleteEntryEnabled(
bool state);
562 void insertDeleteEntry();
575 bool compositesAreLocked()
const;
591 bool updateOfRepresentationRunning();
620 bool useMultithreading();
624 {multi_threading_mode_ = state;}
633 void processEvents(
Size ms);
648 void setStatusbarText(
const String& text,
bool important =
false,
bool beep =
false);
651 void setStatusbarText(
const QString& text,
bool important =
false,
bool beep =
false);
654 String getStatusbarText()
const;
658 {
return fragment_db_;}
671 {
return working_dir_;}
674 void setWorkingDir(
const String& dir);
678 void enableLoggingToFile();
682 void disableLoggingToFile();
687 void setLoggingFilename(
const String&
string);
690 const String& getLoggingFilename()
const;
707 virtual void dump(std::ostream& s = std::cout,
Size depth = 0)
const;
716 virtual void openFile(
const String& file) ;
721 virtual QMenu* createPopupMenu();
757 virtual void checkMenus();
760 void stopSimulation();
763 void complementSelection();
768 void clearSelection();
782 virtual void aboutToExit();
789 void menuItemHighlighted(QAction* action);
792 virtual bool event(
QEvent* e);
795 virtual void quit(
int return_value = 0);
798 virtual void resize(
int w,
int h );
801 void setContentSize(
int w,
int h);
804 void toggleFullScreen();
813 void saveBALLViewProjectFile();
816 void loadBALLViewProjectFile();
819 void quickLoadConfirm();
829 virtual void applyPreferencesClicked_();
835 virtual void okPreferencesClicked_();
838 void clearStatusBarText_();
841 virtual void deleteClicked();
843 void updateRepLabel_();
847 virtual void initializePreferencesTab_();
850 void stopedSimulation_();
853 void lockComposites_();
861 bool remove_(
Composite& composite,
bool update_representations_of_parent =
true,
862 bool to_delete =
true);
869 void reduceSelection_(
Composite*
const composite);
874 void complementSelectionHelper_(
Composite&
c);
878 void setBusyMode_(
bool state);
881 void setPreferencesEnabled_(
bool state);
885 virtual void closeEvent(QCloseEvent* evt);
933 static const char *simulation_running_xpm_[];
934 static const char *simulation_stoped_xpm_[];
967 # ifndef BALL_NO_INLINE_FUNCTIONS
968 # include <BALL/VIEW/KERNEL/mainControl.iC>
974 #endif // BALL_VIEW_KERNEL_MAINCONTROL_H
CompositeManager composite_manager_
Molmec submenu for force field selection.
RepresentationManager & getRepresentationManager()
String logging_file_name_
QAction * preferences_action_
OpenSavePreferences * open_save_preferences_
std::list< ModularWidget * > modular_widgets_
QAction * last_highlighted_menu_entry_
Mutex composites_locked_mutex_
ModelInformation * model_information_
INIFile preferences_file_
Display Viewpoint submenu.
QAction * fullscreen_action_
QAction * clear_selection_action_
String getWorkingDir() const
QAction * stop_simulation_action_
const FragmentDB & getFragmentDB() const
Get a const reference for the fragment database.
bool multi_threading_mode_
ModularWidget * locking_widget_
bool stopedSimulation()
Returns true, if the simulation was told to stop, but hasnt done this so far.
BALL_EXTERN_VARIABLE const double h
BALL_VIEW_EXPORT MainControl * getMainControl()
QLabel * simulation_icon_
BALL_EXTERN_VARIABLE const double c
QAction * complement_selection_action_
NetworkPreferences * network_preferences_
File menu sub menu export.
Preferences * preferences_dialog_
bool important_text_in_statusbar_
SimulationThread * simulation_thread_
File menu sub menu import [currently unused].
File menu sub menu open grid.
#define BALL_EMBEDDABLE(TYPE, BASE)
ShortcutRegistry & getShortcutRegistry()
HashSet< Composite * > selection_
RepresentationManager primitive_manager_
void setMultithreading(bool state)
See above.
MainControlPreferences * main_control_preferences_
QAction * getLastHighLightedMenuEntry()
Get the ID of the last highlighted menu entry (used for the HelpViewer)
Display Animation submenu.
ShortcutRegistry shortcut_registry_
std::list< Composite * > control_selection_
HashMap class based on the STL map (containing serveral convenience functions)
QAction * save_project_action_
HashMap< Position, QMenu * > id_to_menu_
CompositeManager & getCompositeManager()