Gui::NavigationStyle Class Reference

The navigation style base class. More...

#include <NavigationStyle.h>

Inheritance diagram for Gui::NavigationStyle:
Base::BaseClass Gui::UserNavigationStyle Gui::BlenderNavigationStyle Gui::CADNavigationStyle Gui::InventorNavigationStyle

List of all members.

Public Types

enum  OrbitStyle { Turntable, Trackball }
enum  SelectionMode { Lasso = 0, Rectangle = 1, BoxZoom = 2, Clip = 3 }
enum  ViewerMode {
  IDLE, INTERACT, ZOOMING, BOXZOOM,
  PANNING, DRAGGING, SPINNING, SEEK_WAIT_MODE,
  SEEK_MODE, SELECTION
}

Public Member Functions

void boxZoom (const SbBox2s &box)
OrbitStyle getOrbitStyle () const
const std::vector< SbVec2s > & getPolygon (SbBool *clip_inner=0) const
virtual Base::Type getTypeId (void) const
int getViewingMode () const
SbBool isAnimating (void) const
SbBool isAnimationEnabled (void) const
SbBool isPopupMenuEnabled (void) const
SbBool isSelecting () const
SbBool isZoomInverted () const
void lookAtPoint (const SbVec3f &)
 NavigationStyle ()
NavigationStyleoperator= (const NavigationStyle &ns)
virtual SbBool processEvent (const SoEvent *const ev)
void redraw ()
void setAnimationEnabled (const SbBool enable)
void setCameraOrientation (const SbRotation &rot)
void setOrbitStyle (OrbitStyle style)
void setPopupMenuEnabled (const SbBool on)
void setViewer (View3DInventorViewer *)
void setViewingMode (const ViewerMode newmode)
void setZoomInverted (SbBool)
void startAnimating (const SbVec3f &axis, float velocity)
void startSelection (SelectionMode=Lasso)
void startSelection (AbstractMouseSelection *)
void stopAnimating (void)
void stopSelection ()
void updateAnimation ()
virtual void viewAll ()
virtual ~NavigationStyle ()

Static Public Member Functions

static void * create (void)
static Base::Type getClassTypeId (void)
static void init (void)

Protected Member Functions

void addToLog (const SbVec2s pos, const SbTime time)
void clearLog (void)
SbBool doSpin ()
void finalize ()
int getInteractiveCount (void) const
SbBool handleEventInForeground (const SoEvent *const e)
void initialize ()
void interactiveCountDec (void)
void interactiveCountInc (void)
SbBool isSeekMode (void) const
SbBool isViewing (void) const
SbBool lookAtPoint (const SbVec2s screenpos)
virtual void openPopupMenu (const SbVec2s &position)
void pan (SoCamera *camera)
void panCamera (SoCamera *camera, float vpaspect, const SbPlane &panplane, const SbVec2f &previous, const SbVec2f &current)
void panToCenter (const SbPlane &pplane, const SbVec2f &currpos)
virtual SbBool processSoEvent (const SoEvent *const ev)
void reorientCamera (SoCamera *camera, const SbRotation &rot)
 Rotate the camera by the given amount, then reposition it so we're still pointing at the same focal point.
void seekToPoint (const SbVec3f &scenepos)
SbBool seekToPoint (const SbVec2s screenpos)
void setSeekMode (SbBool enable)
void setViewing (SbBool)
void spin (const SbVec2f &pointerpos)
 Uses the sphere sheet projector to map the mouseposition onto a 3D point and find a rotation from this and the last calculated point.
void zoom (SoCamera *camera, float diffvalue)
 Dependent on the camera type this will either shrink or expand the height of the viewport (orthogonal camera) or move the camera closer or further away from the focal point in the scene.
void zoomByCursor (const SbVec2f &thispos, const SbVec2f &prevpos)

Protected Attributes

SbBool altdown
SbBool button1down
SbBool button2down
SbBool button3down
SbTime centerTime
SbBool ctrldown
ViewerMode currentmode
SbBool invertZoom
SbVec2f lastmouseposition
SbBool lockrecenter
struct {
   short   historysize
   SbVec2s *   position
   short   size
   SbTime *   time
log
SbBool menuenabled
SbPlane panningplane
SbTime prevRedrawTime
SbBool shiftdown
View3DInventorViewerviewer
Mouse model



SbBool clipInner
AbstractMouseSelectionmouseSelection
std::vector< SbVec2s > pcPolygon
Spinning data



SbBool spinanimatingallowed
SbRotation spinincrement
SbSphereSheetProjector * spinprojector
SbRotation spinRotation
int spinsamplecounter

Friends

struct NavigationStyleP

Detailed Description

The navigation style base class.

Author:
Werner Mayer

Definition at line 68 of file NavigationStyle.h.


Member Enumeration Documentation

Enumerator:
Turntable 
Trackball 

Definition at line 93 of file NavigationStyle.h.

Enumerator:
Lasso 

Select objects using a lasso.

Rectangle 

Select objects using a rectangle.

BoxZoom 

Perform a box zoom.

Clip 

Clip objects using a lasso.

Definition at line 86 of file NavigationStyle.h.

Enumerator:
IDLE 
INTERACT 
ZOOMING 
BOXZOOM 
PANNING 
DRAGGING 
SPINNING 
SEEK_WAIT_MODE 
SEEK_MODE 
SELECTION 

Definition at line 73 of file NavigationStyle.h.


Constructor & Destructor Documentation

NavigationStyle::NavigationStyle (  ) 
NavigationStyle::~NavigationStyle (  )  [virtual]

Definition at line 165 of file NavigationStyle.cpp.

References finalize(), and PRIVATE.


Member Function Documentation

void NavigationStyle::addToLog ( const SbVec2s  pos,
const SbTime  time 
) [protected]
void NavigationStyle::boxZoom ( const SbBox2s &  box  ) 
void NavigationStyle::clearLog ( void   )  [protected]

Definition at line 978 of file NavigationStyle.cpp.

References log.

Referenced by setViewingMode().

void * Gui::NavigationStyle::create ( void   )  [static]
SbBool NavigationStyle::doSpin (  )  [protected]
void NavigationStyle::finalize (  )  [protected]

Definition at line 220 of file NavigationStyle.cpp.

References log, and spinprojector.

Referenced by ~NavigationStyle().

Base::Type Gui::NavigationStyle::getClassTypeId ( void   )  [static]
int NavigationStyle::getInteractiveCount ( void   )  const [protected]

Definition at line 237 of file NavigationStyle.cpp.

References viewer.

NavigationStyle::OrbitStyle NavigationStyle::getOrbitStyle (  )  const

Definition at line 248 of file NavigationStyle.cpp.

References FCSphereSheetProjector::getOrbitStyle(), and spinprojector.

const std::vector< SbVec2s > & NavigationStyle::getPolygon ( SbBool *  clip_inner = 0  )  const
Base::Type Gui::NavigationStyle::getTypeId ( void   )  const [virtual]
int NavigationStyle::getViewingMode (  )  const
SbBool NavigationStyle::handleEventInForeground ( const SoEvent *const   e  )  [protected]
void Gui::NavigationStyle::init ( void   )  [static]
void NavigationStyle::initialize (  )  [protected]
void NavigationStyle::interactiveCountDec ( void   )  [protected]
void NavigationStyle::interactiveCountInc ( void   )  [protected]

Definition at line 227 of file NavigationStyle.cpp.

References viewer.

Referenced by lookAtPoint(), setCameraOrientation(), and setViewingMode().

SbBool NavigationStyle::isAnimating ( void   )  const

Query if the model in the viewer is currently in spinning mode after a user drag.

Definition at line 845 of file NavigationStyle.cpp.

References currentmode, and SPINNING.

Referenced by Gui::View3DInventorViewer::isAnimating(), lookAtPoint(), setAnimationEnabled(), setCameraOrientation(), and updateAnimation().

SbBool NavigationStyle::isAnimationEnabled ( void   )  const

Query whether or not it is possible to start a spinning animation by releasing the left mouse button while dragging the mouse.

Definition at line 836 of file NavigationStyle.cpp.

References spinanimatingallowed.

Referenced by Gui::View3DInventorViewer::isAnimationEnabled(), lookAtPoint(), setCameraOrientation(), and startAnimating().

SbBool NavigationStyle::isPopupMenuEnabled ( void   )  const
SbBool NavigationStyle::isSeekMode ( void   )  const [protected]
SbBool NavigationStyle::isSelecting (  )  const

Definition at line 932 of file NavigationStyle.cpp.

References mouseSelection.

Referenced by Gui::View3DInventorViewer::isSelecting(), and startSelection().

SbBool NavigationStyle::isViewing ( void   )  const [protected]
SbBool NavigationStyle::isZoomInverted (  )  const

Definition at line 882 of file NavigationStyle.cpp.

References invertZoom.

SbBool NavigationStyle::lookAtPoint ( const SbVec2s  screenpos  )  [protected]

Definition at line 284 of file NavigationStyle.cpp.

References interactiveCountInc(), lookAtPoint(), and viewer.

void NavigationStyle::lookAtPoint ( const SbVec3f &  pos  ) 
void NavigationStyle::openPopupMenu ( const SbVec2s &  position  )  [protected, virtual]
NavigationStyle & NavigationStyle::operator= ( const NavigationStyle ns  ) 

Definition at line 174 of file NavigationStyle.cpp.

References menuenabled, panningplane, and spinanimatingallowed.

void NavigationStyle::pan ( SoCamera *  camera  )  [protected]

Definition at line 608 of file NavigationStyle.cpp.

References panningplane, and viewer.

Referenced by setViewingMode().

void NavigationStyle::panCamera ( SoCamera *  camera,
float  vpaspect,
const SbPlane &  panplane,
const SbVec2f &  previous,
const SbVec2f &  current 
) [protected]
void NavigationStyle::panToCenter ( const SbPlane &  pplane,
const SbVec2f &  currpos 
) [protected]
SbBool NavigationStyle::processEvent ( const SoEvent *const   ev  )  [virtual]
SbBool NavigationStyle::processSoEvent ( const SoEvent *const   ev  )  [protected, virtual]
void NavigationStyle::redraw (  ) 
void NavigationStyle::reorientCamera ( SoCamera *  camera,
const SbRotation &  rot 
) [protected]

Rotate the camera by the given amount, then reposition it so we're still pointing at the same focal point.

Definition at line 568 of file NavigationStyle.cpp.

Referenced by spin(), and updateAnimation().

void NavigationStyle::seekToPoint ( const SbVec3f &  scenepos  )  [protected]

Definition at line 279 of file NavigationStyle.cpp.

References viewer.

SbBool NavigationStyle::seekToPoint ( const SbVec2s  screenpos  )  [protected]
void NavigationStyle::setAnimationEnabled ( const SbBool  enable  ) 

Decide if it should be possible to start a spin animation of the model in the viewer by releasing the mouse button while dragging.

If the enable flag is FALSE and we're currently animating, the spin will be stopped.

Definition at line 824 of file NavigationStyle.cpp.

References isAnimating(), spinanimatingallowed, and stopAnimating().

Referenced by Gui::View3DInventorViewer::setAnimationEnabled().

void NavigationStyle::setCameraOrientation ( const SbRotation &  rot  ) 
void NavigationStyle::setOrbitStyle ( NavigationStyle::OrbitStyle  style  ) 
void NavigationStyle::setPopupMenuEnabled ( const SbBool  on  ) 

Definition at line 1089 of file NavigationStyle.cpp.

References menuenabled.

void NavigationStyle::setSeekMode ( SbBool  enable  )  [protected]

Definition at line 269 of file NavigationStyle.cpp.

References Gui::View3DInventorViewer::setSeekMode(), and viewer.

void NavigationStyle::setViewer ( View3DInventorViewer view  ) 

Definition at line 182 of file NavigationStyle.cpp.

References viewer.

Referenced by Gui::View3DInventorViewer::setNavigationType().

void NavigationStyle::setViewing ( SbBool  enable  )  [protected]
void NavigationStyle::setViewingMode ( const ViewerMode  newmode  ) 
void NavigationStyle::setZoomInverted ( SbBool  on  ) 

Definition at line 877 of file NavigationStyle.cpp.

References invertZoom.

Referenced by Gui::View3DInventor::OnChange().

void NavigationStyle::spin ( const SbVec2f &  pointerpos  )  [protected]

Uses the sphere sheet projector to map the mouseposition onto a 3D point and find a rotation from this and the last calculated point.

Definition at line 715 of file NavigationStyle.cpp.

References log, reorientCamera(), spinincrement, spinprojector, spinsamplecounter, and viewer.

Referenced by Gui::InventorNavigationStyle::processSoEvent(), Gui::CADNavigationStyle::processSoEvent(), and Gui::BlenderNavigationStyle::processSoEvent().

void NavigationStyle::startAnimating ( const SbVec3f &  axis,
float  velocity 
)

Starts programmatically the viewer in animation mode. The given axis direction is always in screen coordinates, not in world coordinates.

Definition at line 854 of file NavigationStyle.cpp.

References isAnimationEnabled(), prevRedrawTime, setViewing(), setViewingMode(), spinincrement, SPINNING, and spinRotation.

Referenced by Gui::View3DInventorViewer::startAnimating().

void NavigationStyle::startSelection ( NavigationStyle::SelectionMode  mode = Lasso  ) 
void NavigationStyle::startSelection ( AbstractMouseSelection mouse  ) 
void NavigationStyle::stopAnimating ( void   ) 
void NavigationStyle::stopSelection (  ) 

Definition at line 925 of file NavigationStyle.cpp.

References mouseSelection, and pcPolygon.

Referenced by startSelection(), and Gui::View3DInventorViewer::stopSelection().

void NavigationStyle::updateAnimation (  ) 
void NavigationStyle::viewAll (  )  [virtual]

Definition at line 500 of file NavigationStyle.cpp.

References SketcherExample::f, getClassTypeId(), size, and viewer.

void NavigationStyle::zoom ( SoCamera *  camera,
float  diffvalue 
) [protected]

Dependent on the camera type this will either shrink or expand the height of the viewport (orthogonal camera) or move the camera closer or further away from the focal point in the scene.

Definition at line 634 of file NavigationStyle.cpp.

References KDL::exp(), KDL::sqrt(), and RobotExample::t.

Referenced by Gui::InventorNavigationStyle::processSoEvent(), Gui::CADNavigationStyle::processSoEvent(), Gui::BlenderNavigationStyle::processSoEvent(), and zoomByCursor().

void NavigationStyle::zoomByCursor ( const SbVec2f &  thispos,
const SbVec2f &  prevpos 
) [protected]

Friends And Related Function Documentation

friend struct NavigationStyleP [friend]

Definition at line 213 of file NavigationStyle.h.

Referenced by NavigationStyle().


Member Data Documentation

SbBool Gui::NavigationStyle::altdown [protected]
SbBool Gui::NavigationStyle::clipInner [protected]

Definition at line 199 of file NavigationStyle.h.

Referenced by getPolygon(), and processEvent().

SbBool Gui::NavigationStyle::ctrldown [protected]

Definition at line 178 of file NavigationStyle.h.

struct { ... } Gui::NavigationStyle::log [protected]

Definition at line 190 of file NavigationStyle.h.

Referenced by initialize(), isPopupMenuEnabled(), operator=(), and setPopupMenuEnabled().

Definition at line 197 of file NavigationStyle.h.

Referenced by isSelecting(), processEvent(), redraw(), startSelection(), and stopSelection().

std::vector<SbVec2s> Gui::NavigationStyle::pcPolygon [protected]

Definition at line 198 of file NavigationStyle.h.

Referenced by getPolygon(), processEvent(), and stopSelection().

Definition at line 179 of file NavigationStyle.h.

Definition at line 187 of file NavigationStyle.h.

Referenced by initialize(), startAnimating(), and updateAnimation().

SbBool Gui::NavigationStyle::shiftdown [protected]
SbRotation Gui::NavigationStyle::spinincrement [protected]

Definition at line 206 of file NavigationStyle.h.

Referenced by initialize(), spin(), and startAnimating().

SbSphereSheetProjector* Gui::NavigationStyle::spinprojector [protected]
SbRotation Gui::NavigationStyle::spinRotation [protected]

Definition at line 205 of file NavigationStyle.h.

Referenced by initialize(), and spin().

Definition at line 180 of file NavigationStyle.h.


The documentation for this class was generated from the following files:

Generated on Wed Nov 23 19:02:00 2011 for FreeCAD by  doxygen 1.6.1