In file graphics2D/Camera2D.h:

class Camera2D : public ListElement<Camera2D>, public Camera, Rotation2D, Scene2D, Data2D, Camera2D>

General 2D camera

Inheritance:


Public Methods

Vec2 getCameraCenter (void) const
returns camera center
virtual void pickObject (const Vec2 &pixel)
find and select closest object from a pixel
virtual void init (void)
camera creation callback
virtual void resize (void)
resize camera to current height and width
virtual void startComputation (void)
the scene2D becomes active : eventually call Interface
virtual void stopComputation (void)
the scene2D becomes unactive : eventually call Interface
virtual void resize (unsigned int w, unsigned int h)
resize camera
virtual void rotateCamera (Rotation2D& rot)
rotates camera (does nothing on a 2D camera)
virtual void translateCamera (Vec2 &t)
translates camera center
virtual void scaleCamera (double s)
scales camera
virtual void doFocus (void)
focus whatever autofocus says
void mapToWorld (const Vec2 &pixel, Vec2 &position)
converts screen coordinate to cartesian coordinate
void mapToScreen (const Vec2 &position, Vec2 &pixel)
converts cartesian coordinate to screen coordinate
virtual void bindMouseMotion (bool on)
bind mouse motion if on == true
virtual void applyObjectSelection (Data2D *obj)
selects a new object
virtual void applyObjectUnselection (Data2D *obj)
unselects an object
virtual void drawBoundingBox (Data2D *obj) const
draw object bounding box
void displayBoundingBox ()
display selected object bounding box
void hideBoundingBox ()
hides selected object bounding box
virtual void grab (const TclString& filename)
dump camera window content in an xwd file
TclCamera2D* getInterface (void) const
returns camera interface
virtual void updateDisplay (void)
post a redraw event
static void doUpdateDisplay (ClientData cam)
updates all object and redraw (called by TK when a redraw event has been posted and the system is idle)

Public

Constructor
Camera2D (Scene2D *scn = 0, unsigned int h = 0, unsigned int w = 0, double scale = DEFAULT_CAMERA_SCALE)
Creates a new camera
Destructor

Protected Fields

static const double initialAspectRatio
The initial aspect ratio when displaying 2D graphical objects
Vec2 cameraCenter
camera center (pixel coordinates)
bool updatePending
flag indicating whether a camera redraw event has been sent

Protected Methods

virtual Vec2 getTrackballVector (int x, int y) const
get trackball location function of mouse pointer location
virtual Rotation2D getTrackballRotation (const Vec2&a, const Vec2&b)
get trackball rotation from mouse pointer move and store results in autoRotation matrix
virtual double getTrackballScale (const Vec2&a, const Vec2&b)
get trackball scale from mouse pointer move and store results in autoRotation matrix
virtual Vec2 getTrackballTranslation (const Vec2& a, const Vec2& b)
get trackball translation from mouse pointer move
virtual Vec2 getTrackballZTranslation (const double a)
get trackball translation from mouse pointer movein the Z direction

Protected

protected constructor
Camera2D (Camera2D *)
constructor that does not create any scene

Private Methods

void initCamera (void)
common constructors code

Documentation

General 2D camera. It gives no practival implementation
void initCamera(void)
common constructors code

static const double initialAspectRatio
The initial aspect ratio when displaying 2D graphical objects

Vec2 cameraCenter
camera center (pixel coordinates)

bool updatePending
flag indicating whether a camera redraw event has been sent

protected constructor

Camera2D(Camera2D *)
constructor that does not create any scene

Constructor

Camera2D(Scene2D *scn = 0, unsigned int h = 0, unsigned int w = 0, double scale = DEFAULT_CAMERA_SCALE)
Creates a new camera. The camera visualize given scene. If scn is 0 the camera visualize the first scene in global scene list (if any) or a new scene is created.
Parameters:
scn - the graphics scene
h - height in pixel size
w - width in pixel size
scale - default scale value

Destructor

Vec2 getCameraCenter(void) const
returns camera center

virtual void pickObject(const Vec2 &pixel)
find and select closest object from a pixel
Parameters:
pixel - selection pixel

virtual void init(void)
camera creation callback

virtual void resize(void)
resize camera to current height and width

virtual void startComputation(void)
the scene2D becomes active : eventually call Interface

virtual void stopComputation(void)
the scene2D becomes unactive : eventually call Interface

virtual void resize(unsigned int w, unsigned int h)
resize camera
Parameters:
w - new camera width
h - new camera height

virtual void rotateCamera(Rotation2D& rot)
rotates camera (does nothing on a 2D camera)
Parameters:
rot - rotation matrix (unsused)

virtual void translateCamera(Vec2 &t)
translates camera center
Parameters:
t - translation vector

virtual void scaleCamera(double s)
scales camera
Parameters:
s - scale

virtual void doFocus(void)
focus whatever autofocus says

void mapToWorld(const Vec2 &pixel, Vec2 &position)
converts screen coordinate to cartesian coordinate
Parameters:
pixel - pixel value
position - returned cartesian coordinate

void mapToScreen(const Vec2 &position, Vec2 &pixel)
converts cartesian coordinate to screen coordinate
Parameters:
position - position in cartesian coordinate
pixel - returned screen coordinate

virtual void bindMouseMotion(bool on)
bind mouse motion if on == true

virtual void applyObjectSelection(Data2D *obj)
selects a new object
Parameters:
obj - selected object

virtual void applyObjectUnselection(Data2D *obj)
unselects an object
Parameters:
obj - unselected object

virtual void drawBoundingBox(Data2D *obj) const
draw object bounding box
Parameters:
obj - object whose bounding box should be drawn

void displayBoundingBox()
display selected object bounding box

void hideBoundingBox()
hides selected object bounding box

virtual void grab(const TclString& filename)
dump camera window content in an xwd file
Parameters:
filename - dump file name

TclCamera2D* getInterface(void) const
returns camera interface

virtual void updateDisplay(void)
post a redraw event

static void doUpdateDisplay(ClientData cam)
updates all object and redraw (called by TK when a redraw event has been posted and the system is idle)
Parameters:
cam - camera to redraw

virtual Vec2 getTrackballVector(int x, int y) const
get trackball location function of mouse pointer location
Returns:
trackball vector
Parameters:
x - pixel X coordinate
y - pixel Y coordinate

virtual Rotation2D getTrackballRotation(const Vec2&a, const Vec2&b)
get trackball rotation from mouse pointer move and store results in autoRotation matrix
Parameters:
a - mouse click point
b - mouse release point

virtual double getTrackballScale(const Vec2&a, const Vec2&b)
get trackball scale from mouse pointer move and store results in autoRotation matrix
Parameters:
a - mouse click point
b - mouse release point

virtual Vec2 getTrackballTranslation(const Vec2& a, const Vec2& b)
get trackball translation from mouse pointer move
Returns:
translation vector
Parameters:
a - mouse click point
b - mouse release point

virtual Vec2 getTrackballZTranslation(const double a)
get trackball translation from mouse pointer movein the Z direction
Returns:
translation vector
Parameters:
a - mouse displacement in the Z direction orthogonal to image plane


Direct child classes:
GRAPHICS

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de