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

Main window. More...

#include <mainwindow.h>

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

Classes

struct  ccHObjectContext
 Backup "context" for an object. More...
 
struct  ccMDIDialogs
 CloudCompare MDI area overlay dialogs. More...
 

Public Types

enum  CC_LIB_ALGORITHM {
  CCLIB_ALGO_CURVATURE = 1, CCLIB_ALGO_SF_GRADIENT = 2, CCLIB_ALGO_ROUGHNESS = 3, CCLIB_ALGO_APPROX_DENSITY = 4,
  CCLIB_ALGO_ACCURATE_DENSITY = 5, CCLIB_SPHERICAL_NEIGHBOURHOOD_EXTRACTION_TEST = 255
}
 

Public Member Functions

virtual ccGLWindow * getActiveGLWindow ()
 Returns active GL sub-window (if any)
 
virtual void addToDB (const QStringList &filenames, CC_FILE_TYPES fType=UNKNOWN_FILE, ccGLWindow *destWin=0)
 Tries to load several files (and then pushes them into main DB) More...
 
virtual void addToDB (ccHObject *obj, bool updateZoom=false, bool autoExpandDBTree=true, bool checkDimensions=false)
 
virtual void removeFromDB (ccHObject *obj, bool autoDelete=true)
 
virtual void setSelectedInDB (ccHObject *obj, bool selected)
 
virtual void dispToConsole (QString message, ConsoleMessageLevel level=STD_CONSOLE_MESSAGE)
 
virtual void forceConsoleDisplay ()
 
virtual ccHObject * dbRootObject ()
 
virtual QMainWindow * getMainWindow ()
 
virtual const
ccHObject::Container & 
getSelectedEntities () const
 
virtual ccColorScalesManager * getColorScalesManager ()
 
virtual ccDBRootdb ()
 Returns real 'dbRoot' object.
 
QMdiSubWindow * getMDISubWindow (ccGLWindow *win)
 Returns MDI area subwindow corresponding to a given 3D view.
 
ccHObjectContext removeObjectTemporarilyFromDBTree (ccHObject *obj)
 Removes object temporarily from DB tree. More...
 
void putObjectBackIntoDBTree (ccHObject *obj, const ccHObjectContext &context)
 Adds back object to DB tree. More...
 

Static Public Member Functions

static MainWindowTheInstance ()
 Returns the unique instance of this object.
 
static ccGLWindow * GetActiveGLWindow ()
 Static shortcut to MainWindow::getActiveGLWindow.
 
static ccGLWindow * GetGLWindow (const QString &title)
 Returns a given GL sub-window (determined by its title) More...
 
static void GetGLWindows (std::vector< ccGLWindow * > &glWindows)
 Returns all GL sub-windows. More...
 
static void RefreshAllGLWindow ()
 Static shortcut to MainWindow::refreshAll.
 
static void UpdateUI ()
 Static shortcut to MainWindow::updateUI.
 
static void DestroyInstance ()
 Deletes current main window instance.
 
static bool ApplyCCLibAlgortihm (CC_LIB_ALGORITHM algo, ccHObject::Container &entities, QWidget *parent=0, void **additionalParameters=0)
 Applies a standard CCLib algorithm (see CC_LIB_ALGORITHM) on a set of entities.
 

Protected Types

enum  NORMAL_CONVERSION_DEST { HSV_COLORS, DIP_DIR_SFS }
 Normals conversion destinations.
 

Protected Slots

ccGLWindow * new3DView ()
 Creates a new 3D GL sub-window.
 
void about ()
 Displays 'about' dialog.
 
void help ()
 Displays 'help' dialog.
 
void aboutPlugins ()
 Displays 'about plugins' dialog.
 
void loadFile ()
 Displays file open dialog.
 
void saveFile ()
 Displays file save dialog.
 
void doActionClone ()
 Clones currently selected entities.
 
void prepareWindowDeletion (QObject *glWindow)
 Updates entities display target when a gl sub-window is deleted. More...
 
virtual void freezeUI (bool state)
 
virtual void redrawAll ()
 
virtual void enableAll ()
 
virtual void disableAll ()
 
virtual void disableAllBut (ccGLWindow *win)
 
virtual void refreshAll ()
 
virtual void updateUI ()
 
virtual void setFrontView ()
 
virtual void setBottomView ()
 
virtual void setTopView ()
 
virtual void setBackView ()
 
virtual void setLeftView ()
 
virtual void setRightView ()
 
virtual void setIsoView1 ()
 
virtual void setIsoView2 ()
 
virtual void toggleActiveWindowCenteredPerspective ()
 
virtual void toggleActiveWindowCustomLight ()
 
virtual void toggleActiveWindowSunLight ()
 
virtual void toggleActiveWindowViewerBasedPerspective ()
 
virtual void setGlobalZoom ()
 
virtual void zoomOnSelectedEntities ()
 
virtual void setPivotAlwaysOn ()
 
virtual void setPivotRotationOnly ()
 
virtual void setPivotOff ()
 
virtual void setOrthoView ()
 
virtual void setCenteredPerspectiveView ()
 
virtual void setViewerPerspectiveView ()
 
virtual void doPickRotationCenter ()
 
virtual void cancelPickRotationCenter ()
 
void processPickedRotationCenter (int, unsigned, int, int)
 
void addToDBAuto (const QStringList &filenames)
 Tries to load (and then adds to main db) several files. More...
 
void handleNewLabel (ccHObject *)
 Handles new label.
 
void setActiveSubWindow (QWidget *window)
 
void setLightsAndMaterials ()
 
void showSelectedEntitiesHistogram ()
 
void testFrameRate ()
 
void toggleFullScreen (bool state)
 
void update3DViewsMenu ()
 
void updateMenus ()
 
void on3DViewActivated (QMdiSubWindow *)
 
void updateUIWithSelection ()
 
void echoMouseWheelRotate (float)
 
void echoCameraDisplaced (float ddx, float ddy)
 
void echoBaseViewMatRotation (const ccGLMatrix &rotMat)
 
void echoCameraPosChanged (const CCVector3 &)
 
void echoPivotPointChanged (const CCVector3 &)
 
void echoPixelSizeChanged (float)
 
void toggleSelectedEntitiesVisibility ()
 
void toggleSelectedEntitiesNormals ()
 
void toggleSelectedEntitiesColors ()
 
void toggleSelectedEntitiesSF ()
 
void toggleSelectedEntities3DName ()
 
void toggleSelectedEntitiesMaterials ()
 
void doActionRenderToFile ()
 
void doActionSetUniqueColor ()
 
void doActionColorize ()
 
void doActionSetColor (bool colorize)
 
void doActionSetColorGradient ()
 
void doActionInterpolateColors ()
 
void doActionSFGaussianFilter ()
 
void doActionSFBilateralFilter ()
 
void doActionSFConvertToRGB ()
 
void doActionRenameSF ()
 
void doActionOpenColorScalesManager ()
 
void doActionAddIdField ()
 
void doActionSetSFAsCoord ()
 
void doComputeApproximateDensity ()
 
void doComputeAccurateDensity ()
 
void doComputeCurvature ()
 
void doActionSFGradient ()
 
void doComputeRoughness ()
 
void doRemoveDuplicatePoints ()
 
void doSphericalNeighbourhoodExtractionTest ()
 
void doCylindricalNeighbourhoodExtractionTest ()
 
void doActionFitPlane ()
 
void doActionFitFacet ()
 
void doActionFitQuadric ()
 
void doShowPrimitiveFactory ()
 
void doActionComputeNormals ()
 
void doActionInvertNormals ()
 
void doActionConvertNormalsToHSV ()
 
void doActionConvertNormalsToDipDir ()
 
void doActionComputeOctree ()
 
void doActionComputeKdTree ()
 
void doActionApplyTransformation ()
 
void doActionMerge ()
 
void doActionRegister ()
 
void doAction4pcsRegister ()
 
void doActionSubsample ()
 
void doActionStatisticalTest ()
 
void doActionSamplePoints ()
 
void doActionConvertTextureToColor ()
 
void doActionLabelConnectedComponents ()
 
void doActionComputeStatParams ()
 
void doActionFilterByValue ()
 
void doActionDeleteScalarField ()
 
void doActionSmoothMeshSF ()
 
void doActionEnhanceMeshSF ()
 
void doActionAddConstantSF ()
 
void doActionScalarFieldArithmetic ()
 
void doActionScalarFieldFromColor ()
 
void doActionClearColor ()
 
void doActionOrientNormalsFM ()
 
void doActionOrientNormalsMST ()
 
void doActionClearNormals ()
 
void doActionResampleWithOctree ()
 
void doActionComputeMeshAA ()
 
void doActionComputeMeshLS ()
 
void doActionComputeDistToBestFitQuadric3D ()
 
void doActionMeasureMeshSurface ()
 
void doActionSmoothMeshLaplacian ()
 
void doActionSubdivideMesh ()
 
void doActionComputeCPS ()
 
void doActionDeleteAllSF ()
 
void doActionKMeans ()
 
void doActionFrontPropagation ()
 
void doActionApplyScale ()
 
void doActionEditGlobalShift ()
 
void doActionEditGlobalScale ()
 
void doActionMatchBBCenters ()
 
void doActionUnroll ()
 
void doActionCreateGBLSensor ()
 
void doActionCreateCameraSensor ()
 
void doActionModifySensor ()
 
void doActionProjectUncertainty ()
 
void doActionCheckPointsInsideFrustrum ()
 
void doActionComputeDistancesFromSensor ()
 
void doActionComputeScatteringAngles ()
 
void doActionSetViewFromSensor ()
 
void doActionShowDepthBuffer ()
 
void doActionExportDepthBuffer ()
 
void doActionHeightGridGeneration ()
 
void doActionExportCoordToSF ()
 
void doComputeBestFitBB ()
 
void doActionCrop ()
 
void doActionEditCamera ()
 
void doActionAdjustZoom ()
 
void doActionSaveViewportAsCamera ()
 
void doActionLoadShader ()
 
void doActionDeleteShader ()
 
void doEnableGLFilter ()
 
void doDisableGLFilter ()
 
void doActionFindBiggestInnerRectangle ()
 
void activateClippingBoxMode ()
 
void deactivateClippingBoxMode (bool)
 
void activateTranslateRotateMode ()
 
void deactivateTranslateRotateMode (bool)
 
void activateSegmentationMode ()
 
void deactivateSegmentationMode (bool)
 
void doActionCloudCloudDist ()
 
void doActionCloudMeshDist ()
 
void deactivateComparisonMode (int)
 
void activatePointPickingMode ()
 
void deactivatePointPickingMode (bool)
 
void activatePointListPickingMode ()
 
void deactivatePointListPickingMode (bool)
 
void activateRegisterPointPairTool ()
 
void deactivateRegisterPointPairTool (bool)
 
void doActionToggleActiveSFColorScale ()
 
void doActionShowActiveSFPrevious ()
 
void doActionShowActiveSFNext ()
 
void on3DMouseMove (std::vector< float > &)
 
void on3DMouseKeyUp (int)
 
void on3DMouseKeyDown (int)
 
void setup3DMouse (bool)
 Setups 3D mouse (if any)
 
void closeAll ()
 Removes all entiites currently loaded in the DB tree.
 
void doActionExportCloudsInfo ()
 Batch export some pieces of info from a set of selected clouds.
 

Protected Member Functions

 MainWindow ()
 Default constructor.
 
virtual ~MainWindow ()
 Default desctructor.
 
void doActionConvertNormalsTo (NORMAL_CONVERSION_DEST dest)
 Converts a cloud's normals.
 
void createComponentsClouds (ccGenericPointCloud *cloud, CCLib::ReferenceCloudContainer &components, unsigned minPointPerComponent, bool randomColors, bool selectComponents, bool sortBysize=true)
 Creates point clouds from multiple 'components'.
 
void closeEvent (QCloseEvent *event)
 
void moveEvent (QMoveEvent *event)
 
void resizeEvent (QResizeEvent *event)
 
void loadPlugins ()
 
bool dispatchPlugin (QObject *plugin)
 
ccPluginInterface * getValidPlugin (QObject *plugin)
 
void zoomOn (ccDrawableObject *object)
 Makes the window including an entity zoom on it (helper)
 
void doActionClearProperty (int prop)
 Clear property process fork. More...
 
void toggleSelectedEntitiesProp (int prop)
 Toggles selected entities properties. More...
 
void doApplyActiveSFAction (int action)
 Active SF action fork. More...
 
void doActionComputeMesh (CC_TRIANGULATION_TYPES type)
 Mesh computation fork. More...
 
void doMeshSFAction (ccMesh::MESH_SCALAR_FIELD_PROCESS process)
 Apply a specific process to a mesh scalar field. More...
 
void doComputePlaneOrientation (bool fitFacet)
 Computes the orientation of an entity. More...
 
void connectActions ()
 Connects all QT actions to slots.
 
void enableUIItems (dbTreeSelectionInfo &selInfo)
 Enables menu entires based on the current selection.
 
void expandDBTreeWithSelection (ccHObject::Container &selection)
 Expands DB tree for selected items.
 
void release3DMouse ()
 Releases any connected 3D mouse (if any)
 
void enable3DMouse (bool state, bool silent)
 Trys to enable (or disable) a 3D mouse device. More...
 
virtual void updateViewModePopUpMenu (ccGLWindow *win)
 Updates the view mode pop-menu based for a given window (or an absence of!)
 
virtual void updatePivotVisibilityPopUpMenu (ccGLWindow *win)
 Updates the pivot visibility pop-menu based for a given window (or an absence of!)
 
void placeMDIDialog (ccMDIDialogs &mdiDlg)
 Replaces an MDI dialog at its right position.
 
void registerMDIDialog (ccOverlayDialog *dlg, Qt::Corner pos)
 Registers a MDI area overlay dialog.
 
void unregisterMDIDialog (ccOverlayDialog *dlg)
 Unregisters a MDI area overlay dialog.
 
void updateMDIDialogsPlacement ()
 Automatically updates all registered MDI dialogs placement.
 

Static Protected Member Functions

static void RemoveSiblingsFromCCObjectList (ccHObject::Container &ccObjects)
 Removes from a list all elements that are sibling of others. More...
 
static PointCoordinateType GetDefaultCloudKernelSize (const ccHObject::Container &entities)
 Returns a default first guess for algorithms kernel size.
 

Protected Attributes

ccDBRootm_ccRoot
 
ccHObject::Container m_selectedEntities
 Currently selected entities;.
 
bool m_uiFrozen
 UI frozen state (see freezeUI)
 
Mouse3DInput * m_3dMouseInput
 3D mouse handler
 
QToolButton * m_viewModePopupButton
 View mode pop-up menu button.
 
QToolButton * m_pivotVisibilityPopupButton
 Pivot visibility pop-up menu button.
 
QMdiArea * m_mdiArea
 
QSignalMapper * m_windowMapper
 
std::vector< ccMDIDialogsm_mdiDialogs
 Registered MDI area overlay dialogs.
 
ccCameraParamEditDlgm_cpeDlg
 Camera params dialog.
 
ccGraphicalSegmentationToolm_gsTool
 Graphical segmentation dialog.
 
ccGraphicalTransformationToolm_transTool
 Graphical transformation dialog.
 
ccClippingBoxToolm_clipTool
 Clipping box dialog.
 
ccComparisonDlgm_compDlg
 Cloud comparison dialog.
 
ccPointPropertiesDlgm_ppDlg
 Point properties mode dialog.
 
ccPointListPickingDlgm_plpDlg
 Point list picking.
 
ccPointPairRegistrationDlgm_pprDlg
 Point-pair registration.
 
ccPrimitiveFactoryDlgm_pfDlg
 Primitive factory dialog.
 
QString m_pluginsPath
 
QStringList m_pluginFileNames
 
QList< ccStdPluginInterface * > m_stdPlugins
 
QActionGroup m_glFilterActions
 

Detailed Description

Main window.

Member Function Documentation

void MainWindow::addToDB ( const QStringList &  filenames,
CC_FILE_TYPES  fType = UNKNOWN_FILE,
ccGLWindow *  destWin = 0 
)
virtual

Tries to load several files (and then pushes them into main DB)

Parameters
filenameslist of all filenames
fTypefile type
destWindestination window (0 = active one)
void MainWindow::addToDBAuto ( const QStringList &  filenames)
protectedslot

Tries to load (and then adds to main db) several files.

Parameters
filenameslist of all filenames
void MainWindow::doActionClearProperty ( int  prop)
protected

Clear property process fork.

  • prop=0 : COLOR
  • prop=1 : NORMALS
  • prop=2 : SCALAR FIELD
  • prop=3 : ALL SCALAR FIELDS
    Parameters
    propproperty id
void MainWindow::doActionComputeMesh ( CC_TRIANGULATION_TYPES  type)
protected

Mesh computation fork.

Parameters
typetriangulation type
void MainWindow::doApplyActiveSFAction ( int  action)
protected

Active SF action fork.

  • action=0 : toggle SF color scale
  • action=1 : activate previous SF
  • action=2 : activate next SF
    Parameters
    actionaction id
void MainWindow::doComputePlaneOrientation ( bool  fitFacet)
protected

Computes the orientation of an entity.

Either fit a plane or a 'facet' (2D polygon)

void MainWindow::doMeshSFAction ( ccMesh::MESH_SCALAR_FIELD_PROCESS  process)
protected

Apply a specific process to a mesh scalar field.

Parameters
processprocess
void MainWindow::enable3DMouse ( bool  state,
bool  silent 
)
protected

Trys to enable (or disable) a 3D mouse device.

Parameters
statewhether to enable or disable the device
silentwhether to issue an error message in case of failure
ccGLWindow * MainWindow::GetGLWindow ( const QString &  title)
static

Returns a given GL sub-window (determined by its title)

Parameters
titlewindow title
void MainWindow::GetGLWindows ( std::vector< ccGLWindow * > &  glWindows)
static

Returns all GL sub-windows.

Parameters
[in,out]glWindowsvector to store all sub-windows
void MainWindow::prepareWindowDeletion ( QObject *  glWindow)
protectedslot

Updates entities display target when a gl sub-window is deleted.

Parameters
glWindowthe window that is going to be delete
void MainWindow::putObjectBackIntoDBTree ( ccHObject *  obj,
const ccHObjectContext context 
)

Adds back object to DB tree.

This method should be called once modifications to the db tree are finished (see removeObjectTemporarilyFromDBTree).

MainWindow::ccHObjectContext MainWindow::removeObjectTemporarilyFromDBTree ( ccHObject *  obj)

Removes object temporarily from DB tree.

This method must be called before any modification to the db tree WARNING: may change 'selectedEntities' container!

void MainWindow::RemoveSiblingsFromCCObjectList ( ccHObject::Container &  ccObjects)
staticprotected

Removes from a list all elements that are sibling of others.

List is updated in place.

void MainWindow::toggleSelectedEntitiesProp ( int  prop)
protected

Toggles selected entities properties.

  • prop=0 : VISIBILITY
    • prop=1 : COLOR
  • prop=2 : NORMALS
  • prop=3 : SCALAR FIELD
  • prop=4 : MATERIAL/TEXTURE
    • prop=5 : NAME (IN 3D)
      Parameters
      propproperty id

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