documentation
This commit is contained in:
parent
25f5456e9d
commit
5f6b88b34c
|
|
@ -74,6 +74,7 @@ void CameraMoveCallback::zoom(const bool in) {
|
|||
clampCamera(this->cam->GetPosition());
|
||||
}
|
||||
|
||||
// we use the interactor's getKeySym instead of getKeyCode because getKeyCode is platform-dependent.
|
||||
void CameraMoveCallback::pan(const string dir) {
|
||||
double pos[3];
|
||||
this->cam->GetPosition(pos);
|
||||
|
|
|
|||
|
|
@ -10,17 +10,45 @@
|
|||
class CameraMoveCallback : public vtkCallbackCommand {
|
||||
|
||||
public:
|
||||
/** Create new instance using the vtk New template.
|
||||
*/
|
||||
static CameraMoveCallback *New(vtkCamera *cam);
|
||||
|
||||
/** Constructor.
|
||||
*/
|
||||
CameraMoveCallback();
|
||||
|
||||
/** Sets the camera to operate on.
|
||||
*/
|
||||
void setCam(const vtkSmartPointer<vtkCamera> &cam);
|
||||
|
||||
private:
|
||||
/** The camera to operate on.
|
||||
*/
|
||||
vtkSmartPointer<vtkCamera> cam;
|
||||
|
||||
/** Event callback. Should be subscribed to keyPressEvent and MouseWheelForward/MouseWheelBackward events.
|
||||
*/
|
||||
void Execute(vtkObject *caller, unsigned long evId, void *callData) override;
|
||||
|
||||
/** Zooms the camera in or out.
|
||||
* @param in : whether to zoom in or out.
|
||||
*/
|
||||
void zoom(const bool in);
|
||||
|
||||
/** Pans the camera in a direction, determined by the parameter.
|
||||
* 'h' and 'left' : pan left
|
||||
* 'j' and 'up' : pan up
|
||||
* 'k' and 'down' : pan down
|
||||
* 'l' and 'right' : pan right
|
||||
* @param dir : string of the pressed keycode.
|
||||
*/
|
||||
void pan(const std::string dir);
|
||||
|
||||
/** Edits the camera such that it only ever renders within the [-1,1] normalised coordinate field.
|
||||
* Does so by making sure that the position of the camera (on the x,y axes), combined with the parallel scale, is never > 1.
|
||||
* @param pos : pointer to new desired camera position. This will be changed if it would cause points outside [-1,1] to be displayed.
|
||||
*/
|
||||
void clampCamera(double *pos);
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue