qCC_glWindow  version 2.5.4 (Qt) - 19 Apr 2014
 All Classes Functions Variables Enumerations
Classes | Public Types | Public Slots | Signals | Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
ccGLWindow Class Reference

OpenGL 3D view. More...

#include <ccGLWindow.h>

Inheritance diagram for ccGLWindow:
Inheritance graph
[legend]
Collaboration diagram for ccGLWindow:
Collaboration graph
[legend]

Classes

struct  CaptureModeOptions
 Display capturing mode options. More...
 
struct  MessageToDisplay
 Temporary Message to display in the lower-left corner. More...
 

Public Types

enum  PICKING_MODE {
  NO_PICKING, ENTITY_PICKING, ENTITY_RECT_PICKING, FAST_PICKING,
  POINT_PICKING, TRIANGLE_PICKING, AUTO_POINT_PICKING, DEFAULT_PICKING
}
 Picking mode.
 
enum  INTERACTION_MODE { TRANSFORM_CAMERA, TRANSFORM_ENTITY, SEGMENT_ENTITY, PAN_ONLY }
 Interaction mode (with the mouse!)
 
enum  MessagePosition { LOWER_LEFT_MESSAGE, UPPER_CENTER_MESSAGE, SCREEN_CENTER_MESSAGE }
 Default message positions on screen.
 
enum  MessageType {
  CUSTOM_MESSAGE, SCREEN_SIZE_MESSAGE, PERSPECTIVE_STATE_MESSAGE, SUN_LIGHT_STATE_MESSAGE,
  CUSTOM_LIGHT_STATE_MESSAGE, MANUAL_TRANSFORMATION_MESSAGE, MANUAL_SEGMENTATION_MESSAGE
}
 Message type.
 
enum  PivotVisibility { PIVOT_HIDE, PIVOT_SHOW_ON_MOVE, PIVOT_ALWAYS_SHOW }
 Pivot symbol visibility.
 

Public Slots

void zoomGlobal ()
 
void testFrameRate ()
 
virtual void redraw ()
 
void onWheelEvent (float wheelDelta_deg)
 

Signals

void entitySelectionChanged (int uniqueID)
 Signal emitted when an entity is selected in the 3D view.
 
void entitiesSelectionChanged (std::set< int > entIDs)
 Signal emitted when multiple entities are selected in the 3D view.
 
void pointPicked (int cloudUniqueID, unsigned pointIndex, int x, int y)
 Signal emitted in point picking mode to declare picking of a given point. More...
 
void viewMatRotated (const ccGLMatrix &rotMat)
 Signal emitted when the window 'model view' matrix is interactively changed.
 
void cameraDisplaced (float ddx, float ddy)
 Signal emitted when the camera is interactively displaced.
 
void mouseWheelRotated (float wheelDelta_deg)
 Signal emitted when the mouse wheel is rotated.
 
void perspectiveStateChanged ()
 Signal emitted when the perspective state changes (see setPerspectiveState)
 
void baseViewMatChanged (const ccGLMatrix &newViewMat)
 Signal emitted when the window 'base view' matrix is changed.
 
void pixelSizeChanged (float)
 Signal emitted when the pixel size is changed.
 
void pivotPointChanged (const CCVector3 &)
 Signal emitted when the pivot point is changed.
 
void cameraPosChanged (const CCVector3 &)
 Signal emitted when the camera position is changed.
 
void translation (const CCVector3 &t)
 Signal emitted when the selected object is translated by the user.
 
void rotation (const ccGLMatrix &rotMat)
 Signal emitted when the selected object is rotated by the user. More...
 
void leftButtonClicked (int, int)
 Signal emitted when the left mouse button is cliked on the window. More...
 
void rightButtonClicked (int, int)
 Signal emitted when the right mouse button is cliked on the window. More...
 
void mouseMoved (int, int, Qt::MouseButtons)
 Signal emitted when the mouse is moved. More...
 
void buttonReleased ()
 Signal emitted when a mouse button is released (cursor on the window) More...
 
void drawing3D ()
 Signal emitted during 3D pass of OpenGL display process. More...
 
void filesDropped (const QStringList &filenames)
 Signal emitted when files are dropped on the window.
 
void newLabel (ccHObject *obj)
 Signal emitted when a new label is created.
 

Public Member Functions

 ccGLWindow (QWidget *parent=0, const QGLFormat &format=QGLFormat::defaultFormat(), QGLWidget *shareWidget=0, bool silentInitialization=false)
 Default constructor.
 
virtual ~ccGLWindow ()
 Destructor.
 
void setSceneDB (ccHObject *root)
 Sets 'scene graph' root.
 
ccHObject * getSceneDB ()
 Returns current 'scene graph' root.
 
virtual void toBeRefreshed ()
 
virtual void refresh ()
 
virtual void invalidateViewport ()
 
virtual unsigned getTexture (const QImage &image)
 
virtual void releaseTexture (unsigned texID)
 
virtual void display3DLabel (const QString &str, const CCVector3 &pos3D, const unsigned char *rgbColor=0, const QFont &font=QFont())
 
virtual bool supportOpenGLVersion (unsigned openGLVersionFlag)
 
virtual void displayText (QString text, int x, int y, unsigned char align=ALIGN_DEFAULT, float bkgAlpha=0, const unsigned char *rgbColor=0, const QFont *font=0)
 
virtual QFont getTextDisplayFont () const
 
virtual const
ccViewportParameters & 
getViewportParameters () const
 
virtual void displayNewMessage (const QString &message, MessagePosition pos, bool append=false, int displayMaxDelay_sec=2, MessageType type=CUSTOM_MESSAGE)
 Displays a status message in the bottom-left corner. More...
 
virtual void setSunLight (bool state)
 Activates sun light.
 
virtual void toggleSunLight ()
 Toggles sun light.
 
virtual bool sunLightEnabled () const
 Returns whether sun light is enabled or not.
 
virtual void setCustomLight (bool state)
 Activates custom light.
 
virtual void toggleCustomLight ()
 Toggles custom light.
 
virtual bool customLightEnabled () const
 Returns whether custom light is enabled or not.
 
virtual void setZoom (float value)
 Sets current zoom. More...
 
virtual void updateZoom (float zoomFactor)
 Updates current zoom. More...
 
virtual void setPivotVisibility (PivotVisibility vis)
 Sets pivot visibility.
 
virtual PivotVisibility getPivotVisibility () const
 Returns pivot visibility.
 
virtual void showPivotSymbol (bool state)
 Shows or hide the pivot symbol. More...
 
virtual void setPixelSize (float pixelSize)
 Sets pixel size (i.e. zoom base) More...
 
virtual void setPivotPoint (const CCVector3 &P)
 Sets pivot point. More...
 
virtual void setCameraPos (const CCVector3 &P)
 Sets camera position. More...
 
virtual void moveCamera (float dx, float dy, float dz)
 Displaces camera. More...
 
virtual void setPerspectiveState (bool state, bool objectCenteredView)
 Set perspective state/mode. More...
 
virtual void togglePerspective (bool objectCentered)
 Toggles perspective mode. More...
 
virtual bool getPerspectiveState (bool &objectCentered) const
 Returns perspective mode.
 
virtual bool objectPerspectiveEnabled () const
 Shortcut: returns whether object-based perspective mode is enabled.
 
virtual bool viewerPerspectiveEnabled () const
 Shortcut: returns whether viewer-based perspective mode is enabled.
 
virtual void updateConstellationCenterAndZoom (const ccBBox *aBox=0)
 Center and zoom on a given bounding box. More...
 
ccBBox getVisibleObjectsBB () const
 Returns the visible objects bounding-box.
 
virtual void rotateBaseViewMat (const ccGLMatrix &rotMat)
 Rotates the base view matrix. More...
 
virtual const ccGLMatrix & getBaseViewMat ()
 Returns the base view matrix. More...
 
virtual const void setBaseViewMat (ccGLMatrix &mat)
 Sets the base view matrix. More...
 
virtual const double * getModelViewMatd ()
 Returns the current (OpenGL) view matrix as a double array. More...
 
virtual const double * getProjectionMatd ()
 Returns the current (OpenGL) projection matrix as a double array.
 
virtual void getViewportArray (int vp[])
 Returns the current viewport (OpenGL int[4] array)
 
virtual void setView (CC_VIEW_ORIENTATION orientation, bool redraw=true)
 Sets camera to a predefined view (top, bottom, etc.)
 
virtual void setCustomView (const CCVector3 &forward, const CCVector3 &up, bool forceRedraw=true)
 Sets camera to a custom view (forward and up directions must be specified)
 
virtual void setInteractionMode (INTERACTION_MODE mode)
 Sets current interaction mode.
 
virtual void setPickingMode (PICKING_MODE mode=DEFAULT_PICKING)
 Sets current picking mode. More...
 
virtual PICKING_MODE getPickingMode () const
 Returns current picking mode.
 
virtual void lockPickingMode (bool state)
 Locks picking mode. More...
 
virtual bool isPickingModeLocked () const
 Returns whether picking mode is locked or not.
 
virtual void setUnclosable (bool state)
 Specify whether this 3D window can be closed by the user or not.
 
virtual void getContext (CC_DRAW_CONTEXT &context)
 Returns context information.
 
virtual void setPointSize (float size)
 Sets point size. More...
 
virtual void setLineWidth (float width)
 Sets line width. More...
 
virtual int getFontPointSize () const
 Returns current font size.
 
virtual ccHObject * getOwnDB ()
 Returns window own DB (2D objects only)
 
virtual void addToOwnDB (ccHObject *obj2D, bool noDependency=true)
 Adds an entity to window own DB (2D objects only) More...
 
virtual void removeFromOwnDB (ccHObject *obj2D)
 Removes an entity from window own DB (2D objects only)
 
virtual void setViewportParameters (const ccViewportParameters &params)
 Sets viewport parameters (all at once)
 
virtual void applyImageViewport (ccCalibratedImage *image)
 Applies the same camera parameters as a given calibrated image.
 
virtual void setFov (float fov)
 Sets current camera f.o.v. (field of view) More...
 
virtual void invalidateVisualization ()
 Invalidate current visualization state. More...
 
virtual bool renderToFile (const char *filename, float zoomFactor=1.0, bool dontScaleFeatures=false, bool renderOverlayItems=false)
 Renders screen to a file.
 
virtual void setShader (ccShader *shader)
 
virtual void setGlFilter (ccGlFilter *filter)
 
ccGlFilter * getGlFilter ()
 
virtual bool areShadersEnabled () const
 
virtual bool areGLFiltersEnabled () const
 
virtual void enableEmbeddedIcons (bool state)
 Enables "embedded icons".
 
virtual float computeActualPixelSize () const
 Returns the actual pixel size on screen (taking zoom or perspective parameters into account) More...
 
float computePerspectiveZoom () const
 Returns the zoom value equivalent to the current camera position (perspective only)
 
bool hasColorRampShader () const
 Returns whether the ColorRamp shader is supported or not.
 
bool isRectangularPickingAllowed () const
 Returns whether rectangular picking is allowed or not.
 
void setRectangularPickingAllowed (bool state)
 Sets whether rectangular picking is allowed or not.
 
CCVector3 getCurrentViewDir () const
 Returns current viewing direction. More...
 
CCVector3 getCurrentUpDir () const
 Returns current up direction. More...
 
const ccGui::ParamStructgetDisplayParameters () const
 Returns current parameters for this display (const version) More...
 
void setDisplayParameters (const ccGui::ParamStruct &params, bool thisWindowOnly=false)
 Sets current parameters for this display.
 
bool hasOverridenDisplayParameters () const
 Whether display parameters are overidden for this window.
 
void displayOverlayEntities (bool state)
 Sets whether overlay entities (scale, tetrahedron, etc.) should be displayed or not.
 
bool overlayEntitiesAreDisplayed () const
 Returns whether overlay entities (scale, tetrahedron, etc.) are displayed or not.
 

Protected Member Functions

void setFontPointSize (int pixelSize)
 Sets current font size. More...
 
void mousePressEvent (QMouseEvent *event)
 
void mouseMoveEvent (QMouseEvent *event)
 
void mouseReleaseEvent (QMouseEvent *event)
 
void wheelEvent (QWheelEvent *event)
 
void closeEvent (QCloseEvent *event)
 
void initializeGL ()
 
void resizeGL (int w, int h)
 
void paintGL ()
 
void draw3D (CC_DRAW_CONTEXT &context, bool doDrawCross, ccFrameBufferObject *fbo=0)
 main OpenGL loop
 
void drawCross ()
 
void drawTrihedron ()
 
void drawGradientBackground ()
 
void drawScale (const colorType color[]=ccColor::white)
 
void recalcModelViewMatrix ()
 
void recalcProjectionMatrix ()
 
void setStandardOrthoCenter ()
 
void setStandardOrthoCorner ()
 
void glEnableSunLight ()
 
void glDisableSunLight ()
 
void glEnableCustomLight ()
 
void glDisableCustomLight ()
 
void drawCustomLight ()
 
void drawPivot ()
 Draws pivot point symbol in 3D.
 
void stopFrameRateTest ()
 Stops frame rate test.
 
virtual void dragEnterEvent (QDragEnterEvent *event)
 
virtual void dropEvent (QDropEvent *event)
 
int startPicking (PICKING_MODE mode, int centerX, int centerY, int width=5, int height=5, int *subID=0)
 Starts OpenGL picking process. More...
 
void updateActiveItemsList (int x, int y, bool extendToSelectedLabels=false)
 Updates currently active items list (m_activeItems) More...
 
bool initFBO (int w, int h)
 Inits FBO (frame buffer object)
 
void removeFBO ()
 Releases any active FBO.
 
bool initGLFilter (int w, int h)
 Inits active GL filter (advanced shader)
 
void removeGLFilter ()
 Releases active GL filter.
 
CCVector3 convertMousePositionToOrientation (int x, int y)
 Converts a given (mouse) position in pixels to an orientation. More...
 
int getGlFilterBannerHeight () const
 Returns the height of the 'GL filter' banner.
 
CCVector3 getRealCameraCenter () const
 Returns real camera center (i.e. with z centered on the visible objects bounding-box in ortho mode)
 

Static Protected Member Functions

static bool InitGLEW ()
 Loads all available OpenGL extensions.
 
static bool CheckExtension (const char *extName)
 Checks for availability of a given OpenGL extension.
 
static bool CheckShadersAvailability ()
 Shortcut: checks Shaders support.
 
static bool CheckFBOAvailability ()
 Shortcut: checks FBO support.
 
static bool CheckVBOAvailability ()
 Shortcut: checks VBO support.
 

Protected Attributes

std::list< ccInteractor * > m_activeItems
 Currently active items. More...
 
GLuint m_pickingBuffer [CC_PICKING_BUFFER_SIZE]
 GL names picking buffer.
 
int m_uniqueID
 Unique ID.
 
bool m_initialized
 Initialization state.
 
GLuint m_trihedronGLList
 Trihedron GL list.
 
GLuint m_pivotGLList
 Pivot center GL list.
 
ccViewportParameters m_viewportParams
 Viewport parameters (zoom, etc.)
 
QPoint m_lastMousePos
 Last mouse position.
 
CCVector3 m_lastMouseOrientation
 Last mouse orientation.
 
CCVector3 m_currentMouseOrientation
 Current mouse orientation.
 
double m_viewMatd [OPENGL_MATRIX_SIZE]
 Complete visualization matrix (GL style - double version)
 
bool m_validModelviewMatrix
 Whether the model veiw matrix is valid (or need to be recomputed)
 
double m_projMatd [OPENGL_MATRIX_SIZE]
 Projection matrix (GL style - double version)
 
bool m_validProjectionMatrix
 Whether the projection matrix is valid (or need to be recomputed)
 
int m_glWidth
 GL context width.
 
int m_glHeight
 GL context height.
 
bool m_lodActivated
 L.O.D. (level of detail) display mode.
 
bool m_shouldBeRefreshed
 Whether the display should be refreshed on next call to 'refresh'.
 
bool m_cursorMoved
 Whether the mouse cursor has moved after being pressed or not.
 
bool m_unclosable
 Whether this 3D window can be closed by the user or not.
 
INTERACTION_MODE m_interactionMode
 Current intercation mode (with mouse)
 
PICKING_MODE m_pickingMode
 Current picking mode.
 
bool m_pickingModeLocked
 Whether picking mode is locked or not.
 
CaptureModeOptions m_captureMode
 Display capturing mode options.
 
std::list< MessageToDisplaym_messagesToDisplay
 List of messages to display.
 
int m_lastClickTime_ticks
 Last click time (msec)
 
float m_sunLightPos [4]
 Sun light position. More...
 
bool m_sunLightEnabled
 Whether sun light is enabled or not.
 
float m_customLightPos [4]
 Custom light position. More...
 
bool m_customLightEnabled
 Whether custom light is enabled or not.
 
bool m_embeddedIconsEnabled
 Whether embedded icons (point size, etc.) are enabled or not.
 
bool m_hotZoneActivated
 Hot zone (= where embedded icons lie) is activated (= mouse over)
 
int m_hotZonePlusIconROI [4]
 Hot zone "plus" button ROI.
 
int m_hotZoneMinusIconROI [4]
 Hot zone "minus" button ROI.
 
ccShader * m_activeShader
 Currently active shader.
 
bool m_shadersEnabled
 Whether shaders are enabled or not.
 
ccFrameBufferObject * m_fbo
 Currently active FBO (frame buffer object)
 
bool m_alwaysUseFBO
 Whether to always use FBO or only for GL filters.
 
bool m_updateFBO
 Whether FBO should be updated (or simply displayed as a texture = faster!)
 
ccColorRampShader * m_colorRampShader
 
ccGlFilter * m_activeGLFilter
 Active GL filter.
 
bool m_glFiltersEnabled
 Whether GL filters are enabled or not.
 
ccHObject * m_winDBRoot
 Window own DB.
 
ccHObject * m_globalDBRoot
 CC main DB.
 
QFont m_font
 Default font.
 
PivotVisibility m_pivotVisibility
 Pivot symbol visibility.
 
bool m_pivotSymbolShown
 Whether pivot symbol should be shown or not.
 
bool m_allowRectangularEntityPicking
 Whether rectangular picking is allowed or not.
 
ccPolyline * m_rectPickingPoly
 Rectangular picking polyline.
 
ccGui::ParamStruct m_overridenDisplayParameters
 Overriden display parameter.
 
bool m_overridenDisplayParametersEnabled
 Whether display parameters are overidden for this window.
 
bool m_displayOverlayEntities
 Whether to display overlay entities or not (scale, tetrahedron, etc.)
 
bool m_silentInitialization
 Whether initialization should be silent or not (i.e. no message to console)
 

Detailed Description

OpenGL 3D view.

Member Function Documentation

virtual void ccGLWindow::addToOwnDB ( ccHObject *  obj2D,
bool  noDependency = true 
)
virtual

Adds an entity to window own DB (2D objects only)

By default no dependency link is established between the entity and the window (DB).

void ccGLWindow::buttonReleased ( )
signal

Signal emitted when a mouse button is released (cursor on the window)

SEGMENT_ENTITY mode only!

virtual float ccGLWindow::computeActualPixelSize ( ) const
virtual

Returns the actual pixel size on screen (taking zoom or perspective parameters into account)

In perspective mode, this value is approximate.

CCVector3 ccGLWindow::convertMousePositionToOrientation ( int  x,
int  y 
)
protected

Converts a given (mouse) position in pixels to an orientation.

The orientation vector origin is the current pivot point!

virtual void ccGLWindow::displayNewMessage ( const QString &  message,
MessagePosition  pos,
bool  append = false,
int  displayMaxDelay_sec = 2,
MessageType  type = CUSTOM_MESSAGE 
)
virtual

Displays a status message in the bottom-left corner.

WARNING: currently, 'append' is not supported for SCREEN_CENTER_MESSAGE

Parameters
messagemessage (if message is empty and append is 'false', all messages will be cleared)
posmessage position on screen
appendwhether to append the message or to replace existing one(s) (only messages of the same type are impacted)
displayMaxDelay_secminimum display duration
typemessage type (if not custom, only one message of this type at a time is accepted)
void ccGLWindow::drawing3D ( )
signal

Signal emitted during 3D pass of OpenGL display process.

Any object connected to this slot can draw additional stuff in 3D. Depth buffering, lights and shaders are enabled by default.

virtual const ccGLMatrix& ccGLWindow::getBaseViewMat ( )
virtual

Returns the base view matrix.

Warning: 'base view' marix is either:

  • the rotation around the object in object-centered mode
  • the rotation around the camera center in viewer-centered mode (see setPerspectiveState).
CCVector3 ccGLWindow::getCurrentUpDir ( ) const

Returns current up direction.

This is the vertical direction of the screen (pointing 'upward') in world base.

CCVector3 ccGLWindow::getCurrentViewDir ( ) const

Returns current viewing direction.

This is the direction normal to the screen (pointing 'inside') in world base.

const ccGui::ParamStruct & ccGLWindow::getDisplayParameters ( ) const

Returns current parameters for this display (const version)

Warning: may return overriden parameters!

virtual const double* ccGLWindow::getModelViewMatd ( )
virtual

Returns the current (OpenGL) view matrix as a double array.

Warning: different from 'view' matrix returned by getBaseViewMat.

virtual void ccGLWindow::invalidateVisualization ( )
virtual

Invalidate current visualization state.

Forces view matrix update and 3D/FBO display.

void ccGLWindow::leftButtonClicked ( int  ,
int   
)
signal

Signal emitted when the left mouse button is cliked on the window.

Arguments correspond to the clicked point coordinates (x,y) in pixels and relatively to the window center.

virtual void ccGLWindow::lockPickingMode ( bool  state)
inlinevirtual

Locks picking mode.

Warning
Bes sure to unlock it at some point ;)
void ccGLWindow::mouseMoved ( int  ,
int  ,
Qt::MouseButtons   
)
signal

Signal emitted when the mouse is moved.

SEGMENT_ENTITY mode only with either a button pressed or m_alwaysUseFBO=true! (too slow otherwise) Two first arguments correspond to the current cursor coordinates (x,y) in pixels and relatively to the window center.

virtual void ccGLWindow::moveCamera ( float  dx,
float  dy,
float  dz 
)
virtual

Displaces camera.

Values are given in objects world along the current camera viewing directions (we use the right hand rule): X: horizontal axis (right) Y: vertical axis (up) Z: depth axis (pointing out of the screen)

void ccGLWindow::pointPicked ( int  cloudUniqueID,
unsigned  pointIndex,
int  x,
int  y 
)
signal

Signal emitted in point picking mode to declare picking of a given point.

Parameters
cloudUniqueIDcloud unique ID
pointIndexpoint index in cloud
xmouse cursor x position
ymouse cursor y position
void ccGLWindow::rightButtonClicked ( int  ,
int   
)
signal

Signal emitted when the right mouse button is cliked on the window.

Arguments correspond to the clicked point coordinates (x,y) in pixels and relatively to the window center.

virtual void ccGLWindow::rotateBaseViewMat ( const ccGLMatrix &  rotMat)
virtual

Rotates the base view matrix.

Warning: 'base view' marix is either:

  • the rotation around the object in object-centered mode
  • the rotation around the camera center in viewer-centered mode (see setPerspectiveState).
void ccGLWindow::rotation ( const ccGLMatrix &  rotMat)
signal

Signal emitted when the selected object is rotated by the user.

Parameters
rotMatrotation applied to current viewport (4x4 OpenGL matrix)
virtual const void ccGLWindow::setBaseViewMat ( ccGLMatrix &  mat)
virtual

Sets the base view matrix.

Warning: 'base view' marix is either:

  • the rotation around the object in object-centered mode
  • the rotation around the camera center in viewer-centered mode (see setPerspectiveState).
virtual void ccGLWindow::setCameraPos ( const CCVector3 &  P)
virtual

Sets camera position.

Emits the 'cameraPosChanged' signal.

void ccGLWindow::setFontPointSize ( int  pixelSize)
protected

Sets current font size.

Warning: only used internally. Change 'defaultFontSize' with setDisplayParameters instead!

virtual void ccGLWindow::setFov ( float  fov)
virtual

Sets current camera f.o.v. (field of view)

FOV is only used in perspective mode.

virtual void ccGLWindow::setLineWidth ( float  width)
virtual

Sets line width.

Parameters
widthlines width (typically between 1 and 10)
virtual void ccGLWindow::setPerspectiveState ( bool  state,
bool  objectCenteredView 
)
virtual

Set perspective state/mode.

Persepctive mode can be:

  • object-centered (moving the mouse make the object rotate)
  • viewer-centered (moving the mouse make the camera move)
    Parameters
    statewhether perspective mode is enabled or not
    objectCenteredViewwhether view is object- or viewer-centered (forced to true in ortho. mode)
virtual void ccGLWindow::setPickingMode ( PICKING_MODE  mode = DEFAULT_PICKING)
virtual

Sets current picking mode.

Picking can be applied to entities (default), points, triangles, etc.)

virtual void ccGLWindow::setPivotPoint ( const CCVector3 &  P)
virtual

Sets pivot point.

Emits the 'pivotPointChanged' signal.

virtual void ccGLWindow::setPixelSize ( float  pixelSize)
virtual

Sets pixel size (i.e. zoom base)

Emits the 'pixelSizeChanged' signal.

virtual void ccGLWindow::setPointSize ( float  size)
virtual

Sets point size.

Parameters
sizepoint size (typically between 1 and 10)
virtual void ccGLWindow::setZoom ( float  value)
virtual

Sets current zoom.

Warning: has no effect in viewer-centered perspective mode

virtual void ccGLWindow::showPivotSymbol ( bool  state)
virtual

Shows or hide the pivot symbol.

Warnings:

  • not to be mistaken with setPivotVisibility
  • only taken into account if pivot visibility is set to PIVOT_SHOW_ON_MOVE
int ccGLWindow::startPicking ( PICKING_MODE  mode,
int  centerX,
int  centerY,
int  width = 5,
int  height = 5,
int *  subID = 0 
)
protected

Starts OpenGL picking process.

Parameters
modepicking mode
centerXpicking area center X position
centerYpicking area center y position
widthpicking area width
heightpicking area height `
[out]subID[optional] poiter to store sub item ID (if any - <1 otherwise)
Returns
item ID (if any) or <1 otherwise
virtual void ccGLWindow::togglePerspective ( bool  objectCentered)
virtual

Toggles perspective mode.

If perspective is activated, the user must specify if it should be object or viewer based (see setPerspectiveState)

void ccGLWindow::updateActiveItemsList ( int  x,
int  y,
bool  extendToSelectedLabels = false 
)
protected

Updates currently active items list (m_activeItems)

The items must be currently displayed in this context AND at least one of them must be under the mouse cursor.

virtual void ccGLWindow::updateConstellationCenterAndZoom ( const ccBBox *  aBox = 0)
virtual

Center and zoom on a given bounding box.

If no bounding box is defined, the current displayed 'scene graph' bounding box is taken.

virtual void ccGLWindow::updateZoom ( float  zoomFactor)
virtual

Updates current zoom.

Warning: has no effect in viewer-centered perspective mode

Member Data Documentation

std::list<ccInteractor*> ccGLWindow::m_activeItems
protected

Currently active items.

Active items can be moved with mouse, etc.

float ccGLWindow::m_customLightPos[4]
protected

Custom light position.

Relative to object.

float ccGLWindow::m_sunLightPos[4]
protected

Sun light position.

Relative to screen.


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