ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ViewInterpolate.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 // CV_DB_LIB
11 #include <ecvViewportParameters.h>
12 
14 class ccPolyline;
15 
16 namespace cloudViewer {
18 
22 public:
26  unsigned int stepCount = 0);
27 
29  void setSmoothTrajectory(ccPolyline* smoothTrajectory,
30  ccPolyline* smoothTrajectoryReversed,
31  unsigned i1,
32  unsigned i2,
34 
36  inline const ecvViewportParameters& view1() const { return m_view1; }
37  // Returns the second viewport object
38  inline const ecvViewportParameters& view2() const { return m_view2; }
39 
41  bool interpolate(ecvViewportParameters& a_returned_viewport,
42  double ratio) const;
43 
45  bool nextView(ecvViewportParameters& a_returned_viewport);
46 
48  inline unsigned int currentStep() { return m_currentStep; }
50  inline void setCurrentStep(unsigned int step) { m_currentStep = step; }
51 
53  inline unsigned int maxStep() { return m_totalSteps; }
55  inline void setMaxStep(unsigned int stepCount) { m_totalSteps = stepCount; }
56 
58  inline void reset() { m_currentStep = 0; }
59 
60 private:
61  const ecvViewportParameters& m_view1;
62  const ecvViewportParameters& m_view2;
63 
64  unsigned int m_totalSteps;
65  unsigned int m_currentStep;
66 
67  ccPolyline *smoothTrajectory, *smoothTrajectoryReversed;
68  unsigned smoothTrajStartIndex, smoothTrajStopIndex, smoothTrajCurrentIndex;
69  PointCoordinateType smoothSegmentLength, smoothCurrentLength;
70 };
71 
72 } // namespace cloudViewer
float PointCoordinateType
Type of the coordinates of a (N-D) point.
Definition: CVTypes.h:16
Colored polyline.
Definition: ecvPolyline.h:24
The ViewInterpolate class.
const ecvViewportParameters & view1() const
Returns the first viewport object.
void reset()
Resets the interpolator.
bool interpolate(ecvViewportParameters &a_returned_viewport, double ratio) const
Interpolates the 2 viewports at a given (relative) position.
bool nextView(ecvViewportParameters &a_returned_viewport)
Returns the next viewport.
unsigned int currentStep()
Returns the current step.
const ecvViewportParameters & view2() const
void setCurrentStep(unsigned int step)
Sets the current step.
void setSmoothTrajectory(ccPolyline *smoothTrajectory, ccPolyline *smoothTrajectoryReversed, unsigned i1, unsigned i2, PointCoordinateType length)
Sets the smooth trajectory (optional)
unsigned int maxStep()
Returns the max number of steps.
ViewInterpolate(const ecvViewportParameters &view1, const ecvViewportParameters &view2, unsigned int stepCount=0)
Constructor from two viewports and a number of steps.
void setMaxStep(unsigned int stepCount)
Sets the max number of steps.
Standard parameters for GL displays/viewports.
__host__ __device__ float length(float2 v)
Definition: cutil_math.h:1162
Generic file read and write utility for python interface.