34 #include <OgreCamera.h> 35 #include <OgreSceneManager.h> 36 #include <OgreSceneNode.h> 56 : context_(nullptr), camera_(nullptr), is_active_(false), type_property_(nullptr)
60 "Anything closer to the camera than this threshold will not get rendered.",
this,
66 "Render the main view in stereo if supported." 67 " On Linux this requires a recent version of Ogre and" 68 " an NVIDIA Quadro card with 3DVision glasses.",
71 "Swap eyes if the monitor shows the left eye on the right.",
74 new FloatProperty(
"Stereo Eye Separation", 0.06
f,
"Distance between eyes for stereo rendering.",
77 "Distance from eyes to screen. For stereo rendering.",
80 new BoolProperty(
"Invert Z Axis",
false,
"Invert camera's Z axis for Z-down environments/models.",
90 ss <<
"ViewControllerCamera" << count++;
127 QStringList id_parts = class_id.split(
"/");
128 if (id_parts.size() != 2)
137 return id_parts[1] +
" (" + id_parts[0] +
")";
143 if (role == Qt::TextColorRole)
208 QPoint mouse_rel_panel = panel->mapFromGlobal(QCursor::pos());
209 Ogre::Vector3 point_rel_world;
211 mouse_rel_panel.y(), point_rel_world))
217 if (event->key() == Qt::Key_Z)
230 Ogre::Vector3 point(x, y, z);
245 camera_->setNearClipDistance(n);
255 camera_->setFrustumOffset(0.5
f * eye_sep, 0.0
f);
256 camera_->setFocalLength(focal_dist);
virtual void setStatus(const QString &message)=0
void updateStereoProperties()
virtual void save(Config config) const
Write the value of this property and/or its children into the given Config reference.
QCursor makeIconCursor(QString url, bool fill_cache)
static RenderSystem * get()
QVariant getViewData(int column, int role) const override
Overridden from Property to give a different background color and bold font if this view is active...
virtual void load(const Config &config)
Load the value of this property and/or its children from the given Config reference.
virtual bool setValue(const QVariant &new_value)
Set the new value for this property. Returns true if the new value is different from the old value...
void emitConfigChanged()
Subclasses should call this whenever a change is made which would change the results of toString()...
Qt::ItemFlags getViewFlags(int column) const override
Overridden from Property to make this draggable if it is not active.
void setCursor(CursorType cursor_type)
~ViewController() override
void lookAt(float x, float y, float z)
Convenience function which calls lookAt(Ogre::Vector3).
FloatProperty * stereo_focal_distance_
virtual void setName(const QString &name)
Set the name.
QCursor getDefaultCursor(bool)
static QString formatClassId(const QString &class_id)
bool mapGetString(const QString &key, QString *value_out) const
Convenience function for looking up a named string.
Property specialized to enforce floating point max/min.
virtual QString getClassId() const
Return the class identifier which was used to create this instance. This version just returns whateve...
void save(Config config) const override
Write the value of this property and/or its children into the given Config reference.
void mapSetValue(const QString &key, QVariant value)
Set a named child to the given value.
Configuration data storage class.
Pure-virtual base class for objects which give Display subclasses context in which to work...
virtual QVariant getViewData(int column, int role) const
Return data appropriate for the given column (0 or 1) and role for this Property. ...
virtual Qt::ItemFlags getViewFlags(int column) const
Return item flags appropriate for the given column (0 or 1) for this Property.
void show()
Show this Property in any PropertyTreeWidgets.
void updateNearClipDistance()
FloatProperty * stereo_eye_separation_
virtual QString getName() const
Return the name of this Property as a QString.
void setStatus(const QString &message)
Ogre::Viewport * getViewport() const
virtual SelectionManager * getSelectionManager() const =0
Return a pointer to the SelectionManager.
BoolProperty * stereo_eye_swap_
virtual void onInitialize()
Do subclass-specific initialization. Called by ViewController::initialize after context_ and camera_ ...
void load(const Config &config) override
Load the value of this property and/or its children from the given Config reference.
virtual Ogre::SceneManager * getSceneManager() const =0
Returns the Ogre::SceneManager used for the main RenderPanel.
Property specialized to provide getter for booleans.
virtual float getFloat() const
virtual void onActivate()
called by activate().
FloatProperty * near_clip_property_
BoolProperty * stereo_enable_
virtual void handleKeyEvent(QKeyEvent *event, RenderPanel *panel)
Called by MoveTool and InteractionTool when keyboard events are passed to them.
QMap< CursorType, QCursor > standard_cursors_
void hide()
Hide this Property in any PropertyTreeWidgets.
void initialize(DisplayContext *context)
Do all setup that can't be done in the constructor.
void activate()
Called by RenderPanel when this view controller is about to be used.
bool get3DPoint(Ogre::Viewport *viewport, const int x, const int y, Ogre::Vector3 &result_point)
virtual bool getBool() const
virtual void setReadOnly(bool read_only)
Prevent or allow users to edit this property from a PropertyTreeWidget.
DisplayContext * context_