34 #include <OgreCamera.h> 35 #include <OgreSceneManager.h> 36 #include <OgreSceneNode.h> 60 , type_property_(
NULL )
63 "Anything closer to the camera than this threshold will not get rendered.",
69 "Render the main view in stereo if supported." 70 " On Linux this requires a recent version of Ogre and" 71 " an NVIDIA Quadro card with 3DVision glasses.",
74 "Swap eyes if the monitor shows the left eye on the right.",
77 "Distance between eyes for stereo rendering.",
80 "Distance from eyes to screen. For stereo rendering.",
83 "Invert camera's Z axis for Z-down environments/models.",
93 ss <<
"ViewControllerCamera" << count++;
130 QStringList id_parts = class_id.split(
"/" );
131 if( id_parts.size() != 2 )
140 return id_parts[ 1 ] +
" (" + id_parts[ 0 ] +
")";
146 if ( role == Qt::TextColorRole )
155 case Qt::BackgroundRole:
157 return QColor( 0xba, 0xad, 0xa4 );
162 font.setBold(
true );
215 if( event->key() == Qt::Key_F &&
219 QPoint mouse_rel_panel = panel->mapFromGlobal( QCursor::pos() );
220 Ogre::Vector3 point_rel_world;
222 mouse_rel_panel.x(), mouse_rel_panel.y(),
225 lookAt( point_rel_world );
229 if( event->key() == Qt::Key_Z )
242 Ogre::Vector3 point( x, y, z );
257 camera_->setNearClipDistance( n );
268 camera_->setFrustumOffset(0.5
f * eye_sep, 0.0
f);
269 camera_->setFocalLength(focal_dist);
virtual void setStatus(const QString &message)=0
virtual void load(const Config &config)
Load the value of this property and/or its children from the given Config reference.
QMap< CursorType, QCursor > standard_cursors_
void updateStereoProperties()
QCursor makeIconCursor(QString url, bool fill_cache)
static RenderSystem * get()
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()...
void setCursor(CursorType cursor_type)
virtual float getFloat() const
void lookAt(float x, float y, float z)
Convenience function which calls lookAt(Ogre::Vector3).
FloatProperty * stereo_focal_distance_
virtual QVariant getViewData(int column, int role) const
Return data appropriate for the given column (0 or 1) and role for this Property. ...
virtual void setName(const QString &name)
Set the name.
virtual void save(Config config) const
Write the value of this property and/or its children into the given Config reference.
static QString formatClassId(const QString &class_id)
Property specialized to enforce floating point max/min.
virtual Qt::ItemFlags getViewFlags(int column) const
Overridden from Property to make this draggable if it is not active.
bool mapGetString(const QString &key, QString *value_out) const
Convenience function for looking up a named string.
virtual QString getClassId() const
Return the class identifier which was used to create this instance. This version just returns whateve...
void mapSetValue(const QString &key, QVariant value)
Set a named child to the given value.
Configuration data storage class.
virtual bool getBool() const
Pure-virtual base class for objects which give Display subclasses context in which to work...
virtual void save(Config config) const
Write the value of this property and/or its children into the given Config reference.
void show()
Show this Property in any PropertyTreeWidgets.
void updateNearClipDistance()
FloatProperty * stereo_eye_separation_
void setStatus(const QString &message)
QCursor getDefaultCursor(bool fill_cache)
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_ ...
virtual Ogre::SceneManager * getSceneManager() const =0
Returns the Ogre::SceneManager used for the main RenderPanel.
Ogre::Viewport * getViewport() const
Property specialized to provide getter for booleans.
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.
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 void setReadOnly(bool read_only)
Prevent or allow users to edit this property from a PropertyTreeWidget.
DisplayContext * context_
virtual ~ViewController()
virtual QString getName() const
Return the name of this Property as a QString.
virtual QVariant getViewData(int column, int role) const
Overridden from Property to give a different background color and bold font if this view is active...
virtual Qt::ItemFlags getViewFlags(int column) const
Return item flags appropriate for the given column (0 or 1) for this Property.