CloudViewer: refactoring + added CloudViewerCellPicker class to ignore picking backfaces (when backface culling is on)

This commit is contained in:
matlabbe
2018-08-21 16:11:05 -04:00
parent 0c790005b2
commit 63af05ef88
7 changed files with 777 additions and 305 deletions

View File

@@ -0,0 +1,40 @@
/*
* CloudViewerCellPicker.h
*
* Created on: Aug 21, 2018
* Author: mathieu
*/
#ifndef GUILIB_SRC_CLOUDVIEWERCELLPICKER_H_
#define GUILIB_SRC_CLOUDVIEWERCELLPICKER_H_
#include "rtabmap/gui/RtabmapGuiExp.h" // DLL export/import defines
#include <vtkCellPicker.h>
namespace rtabmap {
class RTABMAPGUI_EXP CloudViewerCellPicker : public vtkCellPicker {
public:
public:
static CloudViewerCellPicker *New ();
CloudViewerCellPicker();
virtual ~CloudViewerCellPicker();
protected:
// overrided to ignore back faces
virtual double IntersectActorWithLine(const double p1[3],
const double p2[3],
double t1, double t2,
double tol,
vtkProp3D *prop,
vtkMapper *mapper);
private:
vtkGenericCell * cell_; //used to accelerate picking
vtkIdList * pointIds_; // used to accelerate picking
};
} /* namespace rtabmap */
#endif /* GUILIB_SRC_CLOUDVIEWERCELLPICKER_H_ */