18 unsigned int stepCount)
19 : m_view1(viewParams1),
21 m_totalSteps(stepCount),
23 smoothTrajectory(nullptr),
24 smoothTrajectoryReversed(nullptr),
25 smoothTrajStartIndex(0),
26 smoothTrajStopIndex(0),
27 smoothTrajCurrentIndex(0),
28 smoothSegmentLength(0),
29 smoothCurrentLength(0) {}
36 smoothTrajectory = _smoothTrajectory;
37 smoothTrajectoryReversed = _smoothTrajectoryReversed;
38 smoothTrajCurrentIndex = smoothTrajStartIndex = i1;
39 smoothTrajStopIndex = i2;
40 smoothSegmentLength =
length;
41 smoothCurrentLength = 0;
47 return static_cast<T
>(
48 static_cast<double>(start) +
49 (
static_cast<double>(end) -
static_cast<double>(start)) *
50 interpolationFraction);
54 double interpolate_fraction)
const {
55 if (interpolate_fraction < 0.0 || interpolate_fraction > 1.0) {
63 interpolate_fraction);
66 interpolate_fraction);
70 interpolate_fraction);
72 interpolate_fraction);
74 interpolate_fraction);
77 interpolate_fraction);
92 interpolate_fraction));
99 if (m_currentStep >= m_totalSteps) {
104 double interpolate_fraction =
105 static_cast<double>(m_currentStep) / m_totalSteps;
107 return interpolate(outViewport, interpolate_fraction);
float PointCoordinateType
Type of the coordinates of a (N-D) point.
static ccGLMatrixTpl Interpolate(double coef, const ccGLMatrixTpl< double > &glMat1, const ccGLMatrixTpl< double > &glMat2)
Interpolates two matrices at relative position 'coef'.
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.
void setSmoothTrajectory(ccPolyline *smoothTrajectory, ccPolyline *smoothTrajectoryReversed, unsigned i1, unsigned i2, PointCoordinateType length)
Sets the smooth trajectory (optional)
ViewInterpolate(const ecvViewportParameters &view1, const ecvViewportParameters &view2, unsigned int stepCount=0)
Constructor from two viewports and a number of steps.
Standard parameters for GL displays/viewports.
double zNearCoef
Theoretical perspective 'zNear' relative position.
float defaultLineWidth
Line width.
float fov_deg
Camera F.O.V. (field of view) in degrees.
float cameraAspectRatio
Camera aspect ratio.
double zFar
Actual perspective 'zFar' value.
double getFocalDistance() const
Computes the 'focal' distance.
const CCVector3d & getCameraCenter() const
Returns the camera center.
float defaultPointSize
Point size.
void setPivotPoint(const CCVector3d &P, bool autoUpdateFocal=true)
Sets the pivot point (for object-centered view mode)
const CCVector3d & getPivotPoint() const
Returns the pivot point (for object-centered view mode)
ccGLMatrixd viewMat
Visualization matrix (rotation only)
void setCameraCenter(const CCVector3d &C, bool autoUpdateFocal=true)
Sets the camera center.
void setFocalDistance(double distance)
Sets the 'focal' distance.
double zNear
Actual perspective 'zNear' value.
__host__ __device__ float length(float2 v)
Generic file read and write utility for python interface.
T InterpolateNumber(T start, T end, double interpolationFraction)