 |
ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
|
Go to the documentation of this file.
15 #include <vtkAutoInit.h>
17 VTK_MODULE_INIT(vtkRenderingOpenGL2);
18 VTK_MODULE_INIT(vtkInteractionStyle);
32 #include <QVTKOpenGLNativeWidget.h>
33 #include <vtkDataSet.h>
34 #include <vtkLODActor.h>
35 #include <vtkPlanes.h>
36 #include <vtkPolyData.h>
37 #include <vtkRenderWindow.h>
38 #include <vtkSmartPointer.h>
53 class vtkRenderWindowInteractor;
56 class vtkScalarBarWidget;
57 class vtkRenderWindowInteractor;
58 class vtkOrientationMarkerWidget;
59 class VtkWidgetPrivate;
68 bool stereoMode =
false);
73 return this->m_interactor;
78 void setMultiViewports(
bool multi =
true);
79 bool multiViewports()
const;
81 void addActor(vtkProp* actor,
const QColor& clr =
Qt::black);
82 void addViewProp(vtkProp* prop);
83 QList<vtkProp*> actors()
const;
85 void setActorsVisible(
bool visible);
86 void setActorVisible(vtkProp* actor,
bool visible);
87 bool actorVisible(vtkProp* actor);
89 void setBackgroundColor(
const QColor& clr);
90 QColor backgroundColor()
const;
92 vtkRenderer* defaultRenderer();
93 bool defaultRendererTaken()
const;
95 void transformCameraView(
const double* viewMat);
96 void transformCameraProjection(
const double* projMat);
101 return this->setRenderWindow(win);
106 void setBounds(
double* bounds);
120 void setCameraPosition(
const CCVector3d& pos);
121 void setCameraFocalPoint(
const CCVector3d& pos);
133 if (m_scaleBar) m_scaleBar->setVisible(visible);
138 virtual bool event(QEvent* evt)
override;
139 virtual void wheelEvent(QWheelEvent*
event)
override;
140 virtual void keyPressEvent(QKeyEvent*
event)
override;
141 virtual void mouseMoveEvent(QMouseEvent*
event)
override;
142 virtual void mousePressEvent(QMouseEvent*
event)
override;
143 virtual void mouseReleaseEvent(QMouseEvent*
event)
override;
144 virtual void mouseDoubleClickEvent(QMouseEvent*
event)
override;
145 virtual void dragEnterEvent(QDragEnterEvent*
event)
override;
146 virtual void dropEvent(QDropEvent*
event)
override;
148 virtual void updateActivateditems(
149 int x,
int y,
int dx,
int dy,
bool updatePosition =
false);
152 bool m_unclosable =
true;
153 bool m_useVBO =
false;
159 vtkActor* m_modelActor =
nullptr;
160 vtkLODActor* m_filterActor =
nullptr;
187 QTimer* m_wheelZoomUpdateTimer =
nullptr;
constexpr double M_PI
Pi.
Definition: CVConst.h:19
Vector3Tpl< T > getColumnAsVec3D(unsigned index) const
Returns a copy of a given column as a CCVector3.
Definition: ecvGLMatrixTpl.h:919
void layoutRenderers< 10 >(const QList< vtkRenderer * > &renderers)
Definition: rendererslayoutalgo.h:215
void normalize()
Sets vector norm to unity.
Definition: CVGeom.h:428
constexpr Rgb black(0, 0, 0)
normal_z x
Definition: my_point_types.h:165
Type x
Definition: CVGeom.h:137
void layoutRenderers< 7 >(const QList< vtkRenderer * > &renderers)
Definition: rendererslayoutalgo.h:125
void Resize(const core::Tensor &src_im, core::Tensor &dst_im, Image::InterpType interp_type)
Definition: IPPImage.cpp:94
Vector2Tpl< int > CCVector2i
Int 2D Vector.
Definition: CVGeom.h:786
Type norm() const
Returns vector norm.
Definition: CVGeom.h:424
ccGLMatrixd viewMat
Visualization matrix (rotation only)
Definition: ecvViewportParameters.h:107
static bool PrintVerbose(const char *format,...)
Prints out a verbose formatted message in console.
Definition: CVLog.cpp:103
Double version of ccGLMatrixTpl.
Definition: ecvGLMatrix.h:56
void layoutRenderers< 8 >(const QList< vtkRenderer * > &renderers)
Definition: rendererslayoutalgo.h:153
static bool Print(const char *format,...)
Prints out a formatted message in console.
Definition: CVLog.cpp:113
void setForeground(bool state)
Defines if the polyline is drawn in background or foreground.
Definition: ecvPolyline.cpp:146
A 3D cloud and its associated features (color, normals, scalar fields, etc.)
Definition: ecvPointCloud.h:146
virtual bool acceptClick(int x, int y, Qt::MouseButton button)
Called on mouse click.
Definition: ecvInteractor.h:25
Type r
Definition: ecvColorTypes.h:54
static bool PrintDebug(const char *format,...)
Same as Print, but works only in Debug mode.
Definition: CVLog.cpp:153
void layoutRenderers< 1 >(const QList< vtkRenderer * > &renderers)
Definition: rendererslayoutalgo.h:20
float RadiansToDegrees(int radians)
Convert radians to degrees.
Definition: CVMath.h:71
void layoutRenderers(const QList< vtkRenderer * > &renderers)
Definition: rendererslayoutalgo.h:17
void layoutRenderers< 9 >(const QList< vtkRenderer * > &renderers)
Definition: rendererslayoutalgo.h:183
double qtCompatWheelEventDelta(const QWheelEvent *event) noexcept
Definition: QtCompat.h:751
OpenGL camera parameters.
Definition: ecvGenericDisplayTools.h:554
Interactor interface (entity that can be dragged or clicked in a 3D view)
Definition: ecvInteractor.h:20
Vector3Tpl< double > CCVector3d
Double 3D Vector.
Definition: CVGeom.h:804
void vtkInitOnce(T **obj)
Definition: vtkutils.h:44
int width
Definition: FileIOFactory.cpp:142
virtual void showColors(bool state)
Sets colors visibility.
Definition: ecvDrawableObject.h:84
virtual bool addPointIndex(unsigned globalIndex)
Point global index insertion mechanism.
Definition: ReferenceCloud.cpp:84
int size
Definition: FileIOFactory.cpp:130
int height
Definition: FileIOFactory.cpp:143
double zFar
Actual perspective 'zFar' value.
Definition: ecvViewportParameters.h:137
normal_z y
Definition: my_point_types.h:168
MouseEvent event
Definition: BitmapWindowSystem.cpp:61
void applyRotation(Vector3Tpl< float > &vec) const
Applies rotation only to a 3D vector (in place) - float version.
Definition: ecvGLMatrixTpl.h:1184
static double IncrementToZNearCoef(int i, int iMax)
Definition: ecvViewportParameters.cpp:203
double zNearCoef
Theoretical perspective 'zNear' relative position.
Definition: ecvViewportParameters.h:133
ccGLMatrixd modelViewMat
Model view matrix (GL_MODELVIEW)
Definition: ecvGenericDisplayTools.h:593
const double * e
Definition: essential_matrix_poly.h:10
Type g
Definition: ecvColorTypes.h:54
const CCVector3d & getPivotPoint() const
Returns the pivot point (for object-centered view mode)
Definition: ecvViewportParameters.h:39
constexpr Rgb green(0, MAX, 0)
void initFromParameters(T alpha_rad, const Vector3Tpl< T > &axis3D, const Vector3Tpl< T > &t3D)
Inits transformation from a rotation axis, an angle and a translation.
Definition: ecvGLMatrixTpl.h:648
bool reserve(unsigned numberOfPoints) override
Reserves memory for all the active features.
Definition: ecvPointCloud.cpp:1452
void qColor2HSV(const QColor &clr, double *hsv)
Definition: utils.cpp:97
void vtkColor(const QColor &clr, double *vtkClr)
Definition: utils.cpp:60
void layoutRenderers< 3 >(const QList< vtkRenderer * > &renderers)
Definition: rendererslayoutalgo.h:43
a[190]
Definition: essential_matrix_poly.h:19
float fov_deg
Camera F.O.V. (field of view) in degrees.
Definition: ecvViewportParameters.h:144
virtual void setVisible(bool state)
Sets entity visibility.
Definition: ecvDrawableObject.h:40
Type z
Definition: CVGeom.h:137
void setClosed(bool state)
Sets whether the polyline is closed or not.
Definition: Polyline.h:29
bool objectCenteredView
Definition: ecvViewportParameters.h:130
float cameraAspectRatio
Camera aspect ratio.
Definition: ecvViewportParameters.h:146
Type b
Definition: ecvColorTypes.h:54
A generic 3D point cloud with index-based and presistent access to points.
Definition: GenericIndexedCloudPersist.h:18
float DegreesToRadians(int degrees)
Convert degrees to radians.
Definition: CVMath.h:98
bool perspectiveView
Perspective view state.
Definition: ecvViewportParameters.h:125
Type dot(const Vector3Tpl &v) const
Dot product.
Definition: CVGeom.h:408
void layoutRenderers< 4 >(const QList< vtkRenderer * > &renderers)
Definition: rendererslayoutalgo.h:59
bool project(const CCVector3d &input3D, CCVector3d &output2D, bool *inFrustum=nullptr) const
Projects a 3D point in 2D (+ normalized 'z' coordinate)
Definition: ecvGenericDisplayTools.h:561
float defaultPointSize
Point size.
Definition: ecvViewportParameters.h:110
int count
Definition: FileIOFactory.cpp:132
static bool Warning(const char *format,...)
Prints out a formatted warning message in console.
Definition: CVLog.cpp:133
#define QPCL_ENGINE_LIB_API
Definition: qPCL.h:15
RGB color structure.
Definition: ecvColorTypes.h:49
Definition: IJsonConvertible.h:86
Type y
Definition: CVGeom.h:137
static int ZNearCoefToIncrement(double coef, int iMax)
Definition: ecvViewportParameters.cpp:209
virtual const CCVector3 * getPointPersistentPtr(unsigned index)=0
Returns the ith point as a persistent pointer.
void set2DMode(bool state)
Defines if the polyline is considered as 2D or 3D.
Definition: ecvPolyline.cpp:144
constexpr Rgb red(MAX, 0, 0)
void addPoint(const CCVector3 &P)
Adds a 3D point to the database.
Definition: PointCloudTpl.h:246
static ccGLMatrixTpl< double > FromToRotation(const Vector3Tpl< double > &from, const Vector3Tpl< double > &to)
Creates a transformation matrix that rotates a vector to another.
Definition: ecvGLMatrixTpl.h:230
void layoutRenderers< 5 >(const QList< vtkRenderer * > &renderers)
Definition: rendererslayoutalgo.h:78
void layoutRenderers< 2 >(const QList< vtkRenderer * > &renderers)
Definition: rendererslayoutalgo.h:30
float PointCoordinateType
Type of the coordinates of a (N-D) point.
Definition: CVTypes.h:16
constexpr Rgb blue(0, 0, MAX)
Type u[3]
Definition: CVGeom.h:139
ccGLMatrixTpl< T > transposed() const
Returns transposed matrix.
Definition: ecvGLMatrixTpl.h:1286
virtual bool addChild(ccHObject *child, int dependencyFlags=DP_PARENT_OF_OTHER, int insertIndex=-1)
Adds a child.
Definition: ecvHObject.cpp:534
virtual GenericIndexedCloudPersist * getAssociatedCloud()
Returns the associated (source) cloud.
Definition: ReferenceCloud.h:206
static Vector3Tpl fromArray(const int a[3])
Constructor from an int array.
Definition: CVGeom.h:268
void layoutRenderers< 6 >(const QList< vtkRenderer * > &renderers)
Definition: rendererslayoutalgo.h:100
void setColor(const ecvColor::Rgb &col)
Sets the polyline color.
Definition: ecvPolyline.h:81
Colored polyline.
Definition: ecvPolyline.h:23