Inshaping: include/Plane.h Source File

Inshaping

Inshaping  0.1
Plane.h
Go to the documentation of this file.
1 #pragma once
2 #include<Eigen/Dense>
3 #include<iostream>
4 #include<vector>
5 #include<algorithm>
6 #include<BoundingBox.h>
7 #include<TriSparse.h>
8 
9 namespace Inshape
10 {
13  class Plane
14  {
15  public:
16  enum Position
17  {
19  };
20 
21  Eigen::Vector3d Normal;
22  double D;
23 
24  Plane() :Normal(Eigen::Vector3d::Zero()), D(0) {}
25 
26  //��׼ʽ
27  Plane(double a, double b, double c, double d)
28  {
29  Normal.x() = a;
30  Normal.y() = b;
31  Normal.z() = c;
32  D = d;
33  }
34 
35  //�㷨ʽ��ƽ�淽�� inline Plane(Eigen::Vector3d normal, Eigen::Vector3d point) { pointNormForm(normal, point); } //�������㣬�����ƽ�� inline Plane(std::vector<Eigen::Vector3d>& ptArr) { FromThreePt(ptArr); } //�ͷ��������һ�� bool belowPlane(Eigen::Vector3d point, double offset); //���ö��ַ�������D��ʹmatch���ӽ�minMatch //bool adjustToTargetMatch(pcl::PointCloud<pcl::PointXYZ>& body,pcl::PointCloud<pcl::PointXYZ>& head,int traget_match,double threshold); //����ƽ��ָ���� POSITON ����Ҫ����ĵ��Ƶĵ�λ�� void segmentCloud(pcl::PointCloud<pcl::PointXYZ>& cloud, pcl::PointCloud<pcl::PointXYZ>& output, Position position, double offset); //����ƽ��ָ���� POSITON ����Ҫ����ĵ��Ƶĵ�λ�� void segmentMesh(MyMesh& mesh, MyMesh& output, Position position, double offset = 0); //�㷨ʽ bool pointNormForm(Eigen::Vector3d normal, Eigen::Vector3d point); //����ȷ��һ��ƽ�� bool FromThreePt(std::vector<Eigen::Vector3d>& ptArr); inline friend std::ostream& operator<<(std::ostream& os, const Plane& plane) { os << "A=" << plane.Normal.x() << ",B=" << plane.Normal.y() << ",C=" << plane.Normal.z() << ",D=" << plane.D << std::endl; return os; } }; /*@}*/ }
36  inline Plane(Eigen::Vector3d normal, Eigen::Vector3d point) { pointNormForm(normal, point); }
37 
38  //�������㣬�����ƽ��
39  inline Plane(std::vector<Eigen::Vector3d>& ptArr) { FromThreePt(ptArr); }
40 
41  //�ͷ��������һ�� bool belowPlane(Eigen::Vector3d point, double offset); //���ö��ַ�������D��ʹmatch���ӽ�minMatch //bool adjustToTargetMatch(pcl::PointCloud<pcl::PointXYZ>& body,pcl::PointCloud<pcl::PointXYZ>& head,int traget_match,double threshold); //����ƽ��ָ���� POSITON ����Ҫ����ĵ��Ƶĵ�λ�� void segmentCloud(pcl::PointCloud<pcl::PointXYZ>& cloud, pcl::PointCloud<pcl::PointXYZ>& output, Position position, double offset); //����ƽ��ָ���� POSITON ����Ҫ����ĵ��Ƶĵ�λ�� void segmentMesh(MyMesh& mesh, MyMesh& output, Position position, double offset = 0); //�㷨ʽ bool pointNormForm(Eigen::Vector3d normal, Eigen::Vector3d point); //����ȷ��һ��ƽ�� bool FromThreePt(std::vector<Eigen::Vector3d>& ptArr); inline friend std::ostream& operator<<(std::ostream& os, const Plane& plane) { os << "A=" << plane.Normal.x() << ",B=" << plane.Normal.y() << ",C=" << plane.Normal.z() << ",D=" << plane.D << std::endl; return os; } }; /*@}*/ }
42  bool belowPlane(Eigen::Vector3d point, double offset);
43 
44  //���ö��ַ�������D��ʹmatch���ӽ�minMatch
45  //bool adjustToTargetMatch(pcl::PointCloud<pcl::PointXYZ>& body,pcl::PointCloud<pcl::PointXYZ>& head,int traget_match,double threshold);
46 
47 
48  //����ƽ��ָ���� POSITON ����Ҫ����ĵ��Ƶĵ�λ��
49  void segmentCloud(pcl::PointCloud<pcl::PointXYZ>& cloud, pcl::PointCloud<pcl::PointXYZ>& output, Position position, double offset);
50 
51  //����ƽ��ָ���� POSITON ����Ҫ����ĵ��Ƶĵ�λ��
52  void segmentMesh(MyMesh& mesh, MyMesh& output, Position position, double offset = 0);
53 
54  //�㷨ʽ
55  bool pointNormForm(Eigen::Vector3d normal, Eigen::Vector3d point);
56 
57  //����ȷ��һ��ƽ��
58  bool FromThreePt(std::vector<Eigen::Vector3d>& ptArr);
59 
60  inline friend std::ostream& operator<<(std::ostream& os, const Plane& plane)
61  {
62  os << "A=" << plane.Normal.x() << ",B=" << plane.Normal.y() << ",C=" << plane.Normal.z() << ",D=" << plane.D << std::endl;
63  return os;
64  }
65 
66  };
68 }
Definition: Plane.h:13
Plane(Eigen::Vector3d normal, Eigen::Vector3d point)
Definition: Plane.h:36
bool pointNormForm(Eigen::Vector3d normal, Eigen::Vector3d point)
friend std::ostream & operator<<(std::ostream &os, const Plane &plane)
Definition: Plane.h:60
Definition: AfterProcess.h:9
void segmentMesh(MyMesh &mesh, MyMesh &output, Position position, double offset=0)
bool belowPlane(Eigen::Vector3d point, double offset)
void segmentCloud(pcl::PointCloud< pcl::PointXYZ > &cloud, pcl::PointCloud< pcl::PointXYZ > &output, Position position, double offset)
Definition: Plane.h:18
double D
Definition: Plane.h:22
Eigen::Vector3d Normal
Definition: Plane.h:21
bool FromThreePt(std::vector< Eigen::Vector3d > &ptArr)
Plane(double a, double b, double c, double d)
Definition: Plane.h:27
Position
Definition: Plane.h:16
Plane(std::vector< Eigen::Vector3d > &ptArr)
Definition: Plane.h:39
OpenMesh::PolyMesh_ArrayKernelT MyMesh
Definition: Common.h:23
Definition: Plane.h:18
Plane()
Definition: Plane.h:24
Generated by   doxygen 1.8.14