Commit f6e9b811 authored by Anatoly Baksheev's avatar Anatoly Baksheev

reduced exported interface names (to make IntelliSense hints less littered)

parent 44c1d4df
......@@ -119,8 +119,6 @@ namespace cv
Affine3f getPose() const;
void setColor(const Color &color);
private:
struct MatrixConverter;
};
......@@ -145,8 +143,6 @@ namespace cv
public:
WPlane(const Vec4f& coefs, float size = 1.f, const Color &color = Color::white());
WPlane(const Vec4f& coefs, const Point3f& pt, float size = 1.f, const Color &color = Color::white());
private:
struct SetSizeImpl;
};
class CV_EXPORTS WSphere : public Widget3D
......@@ -189,9 +185,6 @@ namespace cv
{
public:
WPolyLine(InputArray points, const Color &color = Color::white());
private:
struct CopyImpl;
};
class CV_EXPORTS WGrid : public Widget3D
......@@ -201,10 +194,6 @@ namespace cv
WGrid(const Vec2i &dimensions, const Vec2d &spacing, const Color &color = Color::white());
//! Creates grid based on the plane equation
WGrid(const Vec4f &coeffs, const Vec2i &dimensions, const Vec2d &spacing, const Color &color = Color::white());
private:
struct GridImpl;
};
class CV_EXPORTS WText3D : public Widget3D
......@@ -257,9 +246,6 @@ namespace cv
WCameraPosition(const Matx33f &K, const Mat &img, float scale = 1.f, const Color &color = Color::white());
//! Creates frustum and display given image at the far plane
WCameraPosition(const Vec2f &fov, const Mat &img, float scale = 1.f, const Color &color = Color::white());
private:
struct ProjectImage;
};
class CV_EXPORTS WTrajectory : public Widget3D
......@@ -273,9 +259,6 @@ namespace cv
WTrajectory(const std::vector<Affine3f> &path, const Matx33f &K, float scale = 1.f, const Color &color = Color::white());
//! Displays trajectory of the given path by frustums
WTrajectory(const std::vector<Affine3f> &path, const Vec2f &fov, float scale = 1.f, const Color &color = Color::white());
private:
struct ApplyPath;
};
class CV_EXPORTS WSpheresTrajectory: public Widget3D
......@@ -292,9 +275,6 @@ namespace cv
WCloud(InputArray cloud, InputArray colors);
//! All points in cloud have the same color
WCloud(InputArray cloud, const Color &color = Color::white());
private:
struct CreateCloudWidget;
};
class CV_EXPORTS WCloudCollection : public Widget3D
......@@ -306,27 +286,18 @@ namespace cv
void addCloud(InputArray cloud, InputArray colors, const Affine3f &pose = Affine3f::Identity());
//! All points in cloud have the same color
void addCloud(InputArray cloud, const Color &color = Color::white(), const Affine3f &pose = Affine3f::Identity());
private:
struct CreateCloudWidget;
};
class CV_EXPORTS WCloudNormals : public Widget3D
{
public:
WCloudNormals(InputArray cloud, InputArray normals, int level = 100, float scale = 0.02f, const Color &color = Color::white());
private:
struct ApplyCloudNormals;
};
class CV_EXPORTS WMesh : public Widget3D
{
public:
WMesh(const Mesh3d &mesh);
private:
struct CopyImpl;
};
template<> CV_EXPORTS Widget2D Widget::cast<Widget2D>();
......
This diff is collapsed.
This diff is collapsed.
......@@ -303,27 +303,6 @@ void cv::viz::WidgetAccessor::setProp(Widget& widget, vtkSmartPointer<vtkProp> p
///////////////////////////////////////////////////////////////////////////////////////////////
/// widget3D implementation
struct cv::viz::Widget3D::MatrixConverter
{
static Matx44f convertToMatx(const vtkSmartPointer<vtkMatrix4x4>& vtk_matrix)
{
Matx44f m;
for (int i = 0; i < 4; i++)
for (int k = 0; k < 4; k++)
m(i, k) = vtk_matrix->GetElement(i, k);
return m;
}
static vtkSmartPointer<vtkMatrix4x4> convertToVtkMatrix(const Matx44f& m)
{
vtkSmartPointer<vtkMatrix4x4> vtk_matrix = vtkSmartPointer<vtkMatrix4x4>::New();
for (int i = 0; i < 4; i++)
for (int k = 0; k < 4; k++)
vtk_matrix->SetElement(i, k, m(i, k));
return vtk_matrix;
}
};
void cv::viz::Widget3D::setPose(const Affine3f &pose)
{
vtkProp3D *actor = vtkProp3D::SafeDownCast(WidgetAccessor::getProp(*this));
......@@ -345,10 +324,9 @@ void cv::viz::Widget3D::updatePose(const Affine3f &pose)
setPose(pose);
return ;
}
Matx44f matrix_cv = MatrixConverter::convertToMatx(matrix);
Affine3f updated_pose = pose * Affine3f(matrix_cv);
matrix = MatrixConverter::convertToVtkMatrix(updated_pose.matrix);
Affine3f updated_pose = pose * Affine3f(convertToMatx(matrix));
matrix = convertToVtkMatrix(updated_pose.matrix);
actor->SetUserMatrix(matrix);
actor->Modified();
......@@ -358,10 +336,7 @@ cv::Affine3f cv::viz::Widget3D::getPose() const
{
vtkProp3D *actor = vtkProp3D::SafeDownCast(WidgetAccessor::getProp(*this));
CV_Assert("Widget is not 3D." && actor);
vtkSmartPointer<vtkMatrix4x4> matrix = actor->GetUserMatrix();
Matx44f matrix_cv = MatrixConverter::convertToMatx(matrix);
return Affine3f(matrix_cv);
return Affine3f(convertToMatx(actor->GetUserMatrix()));
}
void cv::viz::Widget3D::setColor(const Color &color)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment