5#ifndef BALL_VIEW_WIDGETS_SCENE_H
6#define BALL_VIEW_WIDGETS_SCENE_H
8#ifndef BALL_VIEW_KERNEL_MODULARWIDGET_H
12#ifndef BALL_VIEW_RENDERING_RENDERERSGLRENDERER_H
16#ifndef BALL_VIEW_KERNEL_COMMON_H
20#ifndef BALL_VIEW_RENDERING_RENDERWINDOW_H
24#ifndef BALL_VIEW_RENDERING_GLRENDERWINDOW_H
28#ifndef BALL_VIEW_RENDERING_RENDERSETUP_H
32#ifndef BALL_VIEW_DIALOGS_EDITSETTINGS_H
36#ifndef BALL_VIEW_KERNEL_EDITOPERATION_H
40#ifndef BALL_VIEW_KERNEL_MODES_INTERACTIONMODEMANAGER_H
44#include <QtCore/QThread>
45#include <QtCore/QTimer>
46#include <QtGui/QDragEnterEvent>
47#include <QtGui/QDropEvent>
48#include <QtWidgets/QToolBar>
50#include <QtGui/QPicture>
52#include <boost/shared_ptr.hpp>
56#ifndef BALL_VIEW_RENDERING_RAYTRACINGRENDERER_H
79 class InteractionMode;
83 class MaterialSettings;
84 class AnimationThread;
86 class CompositeMessage;
87 class ControlSelectionMessage;
88 class RepresentationMessage;
92 class TransformationEvent6D;
93 class MotionTrackingEvent;
95 class RenderToBufferFinishedEvent;
145#ifdef BALL_HAS_RTFACT
146 typedef boost::shared_ptr<RaytracingRenderer> RaytracingRendererPtr;
147 typedef boost::shared_ptr<RenderWindow> RaytracingWindowPtr;
190 Scene(
QWidget* parent_widget = 0,
const char* name = NULL, Qt::WindowFlags w_flags = 0);
277 virtual void dump(std::ostream& s = std::cout,
Size depth = 0)
const;
290 void pickObjects(
const QPoint& pos, list<GeometricObject*>& objects);
291 void pickObjects(
const QPoint& pos1,
const QPoint& pos2, list<GeometricObject*>& objects);
297 void drawLine(
const QPointF& a,
const QPointF& b, QPainter* painter = 0);
322 {
return stage_settings_; }
326 {
return stage_settings_; }
330 {
return material_settings_; }
334 {
return material_settings_; }
341 {
return animation_points_;}
345 { animation_smoothness_ = value;}
349 {
return animation_smoothness_;}
353 {
return downsampling_factor_;}
375 { show_light_sources_ = state;}
379 {
return show_light_sources_;}
383 {
return *gl_renderer_;}
385#ifdef BALL_HAS_RTFACT
388 {
return *rt_renderer_;}
431 void rotate(
float degree_right,
float degree_up);
456 void rotateComposites(
const std::list<Composite*>& composites,
float degree_right,
float degree_up,
float degree_clockwise = 0);
509 using QWidget::setCursor;
568#ifdef BALL_HAS_RTFACT
570 void addRTfactWindow();
627#ifdef BALL_HAS_RTFACT
628 RaytracingWindowPtr getWindow(
WindowType aWindowType);
850 QAction *no_stereo_action_, *enter_stereo_action_, *
active_stereo_action_, *dual_stereo_action_, *dual_stereo_different_display_action_;
854#ifdef BALL_HAS_RTFACT
855 QAction *toggle_continuous_loop_action_;
876#ifdef BALL_HAS_RTFACT
878 RaytracingWindowPtr rt_window_;
899#ifdef BALL_HAS_RTFACT
900 bool continuous_loop_;
944 virtual void run() {scene_->animate_();}
#define BALL_EMBEDDABLE(TYPE, BASE)
Base class for all messages concerning a Representation.
void applyStereoDefaults()
void registerRenderers_()
QAction * add_hydrogens_action_
static void setPOVNumber(Position pos)
virtual void dragEnterEvent(QDragEnterEvent *e)
virtual void switchShowWidget()
static void setShowLightSources(bool state)
void changeBondOrder(Index delta)
void showText(const String &text, Size font_size=20)
void handleCompositeMessage_(CompositeMessage *cm)
static BALL_DEPRECATED void setMouseSensitivity(float)
void setOffScreenRendering(bool enabled, Size factor)
void drawLine(const Vector2 &a, const Vector2 &b, QPainter *painter=0)
bool isUpdateRunning() const
void setEditElementType(int element_number)
void merge(Composite *a1, Composite *a2)
void saturateWithHydrogens()
GLRenderer & getGLRenderer()
static BALL_DEPRECATED void setMouseWheelSensitivity(float)
virtual void keyPressEvent(QKeyEvent *e)
Catch key events.
virtual void buttonReleaseEvent(ButtonEvent *evt)
void handleControlSelectionMessage_(ControlSelectionMessage *csm)
void getClickedItems(const QPoint &p)
StageSettings * stage_settings_
void setCurrentAtom(Atom *atom)
void setTurnPoint(const Vector3 &v)
void setRubberBandGeometry(const QRect &rect)
void exportNextPOVRay()
Export to POVRay whithout showing file dialog.
Vector3 mapViewportTo3D(const Vector2 &coords)
void stopContinuousLoop()
void setDefaultLighting(bool update_GL=true)
QList< QAction * > toolbar_actions_edit_controls_
QList< QAction * > toolbar_actions_view_controls_
static BALL_DEPRECATED float getMouseSensitivity()
static bool only_highlighted_
void readLights_(const INIFile &inifile)
static void setVRMLNumber(Position pos)
void clearRecordedAnimation()
const Stage * getStage() const
bool isAnimationRunning() const
virtual void mouseReleaseEvent(QMouseEvent *qmouse_event)
void pickObjects(const QPoint &pos1, const QPoint &pos2, list< GeometricObject * > &objects)
void rotateComposites(const std::list< Composite * > &composites, float degree_right, float degree_up, float degree_clockwise=0)
static bool show_light_sources_
AnimationThread * animation_thread_
Position main_renderer_
The index of the renderer responsible for the main display.
const MaterialSettings * getMaterialSettings() const
String exportPNG()
Export PNG image and return the filename.
static float getAnimationSmoothness()
void createCoordinateSystem_(bool at_origin)
void setPreview(bool state)
Enable or disable model previews e.g. while rotating.
void startContinuousLoop()
void initializeMembers_()
void handleSceneMessage_(SceneMessage *sm)
bool useVertexBuffers() const
void moveComposites(const std::list< Composite * > &composites, Vector3 v)
void pickObjects(const QPoint &pos, list< GeometricObject * > &objects)
std::list< Camera > animation_points_
TVector2< float > getScreenPosition_(Vector3 vec)
void setGLRenderer(GLRenderer &renderer)
virtual void mousePressEvent(QMouseEvent *qmouse_event)
@ LEFT_EYE_WINDOW
Window into which left eye should be rendered. Indicates same window as CONTROL_WINDOW if no stereo i...
virtual void mouseMoveEvent(QMouseEvent *qmouse_event)
void pickParent_(QPoint p)
virtual void wheelEvent(QWheelEvent *qmouse_event)
virtual void addToolBarEntries(QToolBar *tb)
static bool showLightSourcesEnabled()
Position prepareGridTextures(const RegularData3D &grid, const ColorMap &map)
void setDownsamplingFactor(float ds_factor)
QAction * cancel_animation_action_
void deselect(bool update=true)
String createFPSInfo_(Renderer *renderer)
Estimate current fps and convert into a string.
void updateMaterialForRepresentation(Representation *rep, const Stage::Material &new_material)
InteractionModeManager & getInteractionModeManager()
Returns a reference to the Scene's interaction mode manager.
virtual bool isValid() const
virtual void resetCamera_()
Reset the camera to standard values.
virtual void buttonPressEvent(ButtonEvent *evt)
QToolBar * toolbar_edit_controls_
QAction * animation_export_PNG_action_
virtual void resizeEvent(QResizeEvent *event)
void setRubberBandVisible(bool show)
virtual void paintEvent(QPaintEvent *e)
void drawLine(const QPointF &a, const QPointF &b, QPainter *painter=0)
MaterialSettings * material_settings_
Vector3 mapViewportTo3D(int x, int y)
QAction * active_stereo_action_
void activatedOrderItem_(QAction *action)
void createCoordinateSystemAtOrigin()
Create an coordinate system at origin.
vector< EditOperation > undo_
static float downsampling_factor_
std::vector< boost::shared_ptr< RenderSetup > > renderers_
void enterDualStereoDifferentDisplays()
std::list< AtomContainer * > getContainers()
QAction * new_molecule_action_
void selectionPressedMoved_()
void showExportPNGDialog()
show an dialog to save an PNG file to
bool exportPNG(const String &filename)
void setElementCursor(int number)
virtual void handleRenderToBufferFinishedEvent_(RenderToBufferFinishedEvent *evt)
void newEditOperation(EditOperation &eo)
virtual void setViewPoint_()
Set the viewpoint.
Quaternion old_trackrotation_
void writeLights_(INIFile &inifile) const
void renderText_(QPointF const &point, QString const &text, QPaintDevice *current_dev)
virtual void customEvent(QEvent *evt)
void showExportVRMLDialog()
opens the VIEW/DIALOGS/GeometryExportDialog for vrml and stl export
virtual void dump(std::ostream &s=std::cout, Size depth=0) const
virtual void setWidgetVisible(bool state)
virtual void initializeWidget(MainControl &main_control)
static BALL_DEPRECATED float getMouseWheelSensitivity()
void toggleContinuousLoop()
void showContextMenu(QPoint pos)
void setCamera(const Camera &camera)
void notify(Message *msg)
static bool offscreen_rendering_
static bool stereoBufferSupportTest()
void setFPSEnabled(bool state)
virtual bool exportScene(Renderer &er) const
InteractionModeManager mode_manager_
void switchRenderer(RenderSetup::RendererType new_type)
QToolBar * toolbar_view_controls_
void rotate(float degree_right, float degree_up)
StageSettings * getStageSettings()
std::list< Camera > & getAnimationPoints()
QAction * bondorders_action_
virtual void transformationEvent6D(TransformationEvent6D *evt)
const StageSettings * getStageSettings() const
virtual void showViewPoint_()
Show the viewpoint and the look at point in the statusline of the mainwidget.
void setupEnvironmentMap(const QImage &image)
Try to setup an environment map for all renderers that support it.
Vector2 map3DToViewport(const Vector3 &coords)
virtual void mouseDoubleClickEvent(QMouseEvent *e)
void initializePreferencesTab(Preferences &preferences)
static void setAnimationSmoothness(float value)
void lightsUpdated(bool redraw=false)
virtual void motionTrackingEvent(MotionTrackingEvent *evt)
Scene(QWidget *parent_widget=0, const char *name=NULL, Qt::WindowFlags w_flags=0)
virtual bool eventFilter(QObject *object, QEvent *event)
void showInfos()
Popup informations for object under mouse cursor.
QMenu * create_coordinate_system_
bool tracking_initialized_
void updateAllMaterials()
GLRenderer * gl_renderer_
void handleDatasetMessage_(DatasetMessage *dm)
bool want_to_use_vertex_buffer_
virtual void projectionModeChanged()
virtual void writePreferences(INIFile &inifile)
void setFullScreen(bool state)
void rotateClockwise(float degree)
float getDownsamplingFactor() const
void insert_(int x_, int y_, PDBAtom &atom_)
String getBondOrderString_(Index order)
void setInfo(const QString &info_string)
MaterialSettings * getMaterialSettings()
virtual void onNotify(Message *message)
static float animation_smoothness_
virtual void checkMenu(MainControl &main_control)
void finalizePreferencesTab(Preferences &preferences)
void setCurrentBond(Bond *b)
static void setScreenShotNumber(Position pos)
const Vector3 & getTurnPoint() const
virtual void applyPreferences()
EditSettings * edit_settings_
bool usePreview() const
Returns the state of the preview mode.
static Position screenshot_nr_
GLRenderWindow * main_display_
virtual void dropEvent(QDropEvent *e)
virtual void resetRepresentationsForRenderer_(RenderSetup &rs)
void rotateSystemClockwise_()
void createCoordinateSystem()
Create an coordinate system at current position.
void handleRepresentationMessage_(RepresentationMessage *rm)
virtual void fetchPreferences(INIFile &inifile)
LightSettings * light_settings_
void setScene(Scene *scene)