Tulip
4.0.0
Better Visualization Through Research
|
#include <Camera.h>
Inherits tlp::Observable.
Public Member Functions | |
Camera (GlScene *scene, Coord center=Coord(0, 0, 0), Coord eyes=Coord(0, 0, 10), Coord up=Coord(0,-1, 0), double zoomFactor=0.5, double sceneRadius=10) | |
Camera (GlScene *scene, bool d3) | |
~Camera () | |
BoundingBox | getBoundingBox () const |
Coord | getCenter () const |
Coord | getEyes () const |
GlScene * | getScene () const |
double | getSceneRadius () const |
Coord | getUp () const |
Vector< int, 4 > | getViewport () const |
virtual void | getXML (std::string &outString) |
double | getZoomFactor () const |
bool | is3D () const |
void | move (float speed) |
Camera & | operator= (const Camera &camera) |
void | rotate (float angle, float x, float y, float z) |
Coord | screenTo3DWorld (const Coord &point) const |
void | setCenter (const Coord ¢er) |
void | setEyes (const Coord &eyes) |
void | setScene (GlScene *scene) |
void | setUp (const Coord &up) |
virtual void | setWithXML (const std::string &inString, unsigned int ¤tPosition) |
void | setZoomFactor (double zoomFactor) |
void | strafeLeftRight (float speed) |
void | strafeUpDown (float speed) |
Coord | worldTo2DScreen (const Coord &obj) const |
Public Member Functions inherited from tlp::Observable | |
void | addListener (Observable *const listener) const |
void | addObserver (Observable *const observer) const |
unsigned int | countListeners () const |
unsigned int | countObservers () const |
unsigned int | getReceived () const |
unsigned int | getSent () const |
void | removeListener (Observable *const listener) const |
void | removeObserver (Observable *const observerver) const |
Additional Inherited Members | |
Static Public Member Functions inherited from tlp::Observable | |
static Observable * | getObject (tlp::node n) |
static const tlp::VectorGraph & | getObservableGraph () |
static void | holdObservers () |
static bool | isAlive (tlp::node n) |
static unsigned int | observersHoldCounter () |
static void | unholdObservers () |
Protected Member Functions inherited from tlp::Observable | |
Observable (const Observable &) | |
tlp::Iterator< tlp::Observable * > * | getObservables () const |
bool | hasOnlookers () const |
void | notifyObservers () |
void | observableDeleted () |
Observable & | operator= (const Observable &) |
void | sendEvent (const Event &message) |
virtual void | treatEvent (const Event &message) |
virtual void | treatEvents (const std::vector< Event > &events) |
Tulip OpenGL camera object.
This camera can be a 2D or 3D camera After setup you can do some basic operation :
tlp::Camera::Camera | ( | GlScene * | scene, |
Coord | center = Coord(0, 0, 0) , |
||
Coord | eyes = Coord(0, 0, 10) , |
||
Coord | up = Coord(0,-1, 0) , |
||
double | zoomFactor = 0.5 , |
||
double | sceneRadius = 10 |
||
) |
Constructor.
scene | A layer is attached to a scene so we have to specify it in the constructor |
center | 3D coordinates of point visualized by the camera |
eye | 3D position of the camera |
up | normalized up 3D coordinates of the camera |
zoomFactor | level of zoom of the camera |
sceneRadius | scene radius of the camera |
tlp::Camera::Camera | ( | GlScene * | scene, |
bool | d3 | ||
) |
Constructor : used to create a 2D camera.
tlp::Camera::~Camera | ( | ) |
Destructor.
BoundingBox tlp::Camera::getBoundingBox | ( | ) | const |
Return the camera bounding box.
This bounding box is the part of the scene visualized by this camera.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Vector<int, 4> tlp::Camera::getViewport | ( | ) | const |
Return the viewport of the attached scene.
|
virtual |
Function to export data in outString (in XML format)
|
inline |
|
inline |
void tlp::Camera::move | ( | float | speed | ) |
This function moves the camera forward or backward depending on the speed.
void tlp::Camera::rotate | ( | float | angle, |
float | x, | ||
float | y, | ||
float | z | ||
) |
This function rotates the camera's eyes around the center depending on the values passed in.
Coord tlp::Camera::screenTo3DWorld | ( | const Coord & | point | ) | const |
Return the 3D world coordinate for the given screen point.
void tlp::Camera::setCenter | ( | const Coord & | center | ) |
Set the center.
3D coordinates of point visualized by the camera
void tlp::Camera::setEyes | ( | const Coord & | eyes | ) |
Set the eye.
3D position of the camera
void tlp::Camera::setScene | ( | GlScene * | scene | ) |
Set the camera's scene The viewport is store in the scene, so we must attach camera to a scene.
void tlp::Camera::setUp | ( | const Coord & | up | ) |
Set the up vector.
normalized up 3D coordinates of the camera
|
virtual |
Function to set data with inString (in XML format)
void tlp::Camera::setZoomFactor | ( | double | zoomFactor | ) |
Set the zoom factor.
level of zoom of the camera
void tlp::Camera::strafeLeftRight | ( | float | speed | ) |
This function strafes the camera left and right depending on the speed (-/+)
void tlp::Camera::strafeUpDown | ( | float | speed | ) |
This function strafes the camera up and down depending on the speed (-/+)
Coord tlp::Camera::worldTo2DScreen | ( | const Coord & | obj | ) | const |
Return the screen position for the given 3D coordinate.