PointCloud2BIM Library  1.0
Library to facilitate the transpormation of point clouds into digital BIM representation
Public Member Functions | Static Public Member Functions | List of all members
Plane Class Reference

Public Member Functions

 Plane ()
 Creates empty plane.
 
 Plane (double _a, double _b, double _c, double _d)
 Creates plane from given plane coefficients ( $ax + by + cz + d = 0$). More...
 
 Plane (Vector3 _a, Vector3 _b, Vector3 _c)
 Creates plane from the coordinates (x,y,z) of the three given points. More...
 
 Plane (PointXYZ _a, PointXYZ _b, PointXYZ _c)
 Creates plane from three given points (PointXYZNormal). More...
 
 Plane (PointXYZNormal _a, PointXYZNormal _b, PointXYZNormal _c)
 Creates plane from three given points (PointXYZNormal). More...
 
const double * getNormal () const
 Returns plane normal vector. More...
 
double * getNormal ()
 Returns plane normal vector. More...
 
void setNormal (double nx, double ny, double nz)
 Sets plane normal vector. More...
 
const double * getMin () const
 Returns minimum coordinates. More...
 
void setMin (double x, double y, double z)
 Sets minimum coordinates. More...
 
const double * getMax () const
 Returns maximum coordinates. More...
 
void setMax (double x, double y, double z)
 Sets maximum coordinates. More...
 
int getId () const
 Returns Plane identifier. More...
 
void setId (int id)
 Sets Plane identifier. More...
 
int getFloorId () const
 Returns Floor identifier. More...
 
void setFloorId (int id)
 Sets Floor identifier. More...
 
double getD () const
 Returns coefficient d (Plane = $ax + by + cz + d = 0$). More...
 
void setD (double d)
 Sets coefficient d (Plane = $ax + by + cz + d = 0$). More...
 
std::vector< int > & getPointCloudIDs ()
 Returns Plane PointClouds identifiers. More...
 
void setPointCloudIDs (std::vector< int > pcl_ids)
 
const std::vector< PointCloud > & getPointClouds () const
 Returns Plane PointClouds. More...
 
std::vector< PointCloud > & getPointClouds ()
 Returns Plane PointClouds. More...
 
void addPointCloud (PointCloud &pc)
 Adds PointCloud to the Plane. More...
 
template<typename T >
void getPoints (std::vector< T > &points)
 Returns Plane Points. More...
 
Vector3 getNormalVector ()
 Returns Plane normal vector. More...
 
double distanceTo (Vector3 &v)
 Returns the distance between the receiver and the given point. More...
 
double distanceTo (PointXYZ &p)
 Returns the distance between the receiver and the given point. More...
 
double distanceTo (PointXYZNormal p)
 Returns the distance between the receiver and the given point. More...
 
double distanceTo (std::vector< PointXYZ > &points)
 
double distanceTo (std::vector< PointXYZNormal > &points)
 Returns the distance between the receiver and the given point. More...
 

Static Public Member Functions

static double angleBetween (double a1, double b1, double c1, double a2, double b2, double c2)
 
static void getLocalContinuity (std::vector< PointXYZ > points1, std::vector< PointXYZ > points2, std::vector< int > &result)
 
static void getLocalMatch (std::vector< PointXYZNormal > points1, std::vector< PointXYZNormal > points2, std::vector< int > &result1, std::vector< int > &result2)
 Search for the overlapping points of two given planes. More...
 
static bool makeWall (Plane &plane1, Plane &plane2, std::vector< PointXYZ > &result1, std::vector< PointXYZ > &result2)
 Search for the overlapping points of two given planes. More...
 
static double checkLocalMatch (std::vector< PointXYZNormal > points1, std::vector< PointXYZNormal > points2)
 Returns the ratio of the overlapping area of two planes over the area of the smaller plane. More...
 
static double checkMatchingArea (std::vector< PointXYZNormal > points1, std::vector< PointXYZNormal > points2)
 Returns the size of the overlapping area of two planes. More...
 
static void giveCenterPlane (std::vector< PointXYZNormal > points1, std::vector< PointXYZNormal > points2, double(&v1)[3], double(&v2)[3], double(&v3)[3], double &d, std::vector< PointXYZNormal > &corners)
 Calculates the centerplane between the two given planes. More...
 
static bool isInnerPlane (std::vector< PointXYZNormal > points, std::vector< BitGrid > roomGrids, double minOffset)
 Evaluates whether the plane is inner (between two rooms) or not (at the pointcloud boundary). More...
 
static bool generateOuterPlane (std::vector< PointXYZNormal > points, std::vector< PointXYZNormal > &outPoints, std::vector< BitGrid > roomGrids, double minOffset)
 Generates a copy of the plane at the pointcloud boundary with given offset. More...
 
static double distanceBetweenPlanes (Plane &pl1, Plane &pl2)
 Returns distance between planes with same a, b, c coefficients. More...
 

Constructor & Destructor Documentation

Plane::Plane ( double  _a,
double  _b,
double  _c,
double  _d 
)
inline

Creates plane from given plane coefficients ( $ax + by + cz + d = 0$).

Parameters
_aCoefficient a
_bCoefficient b
_cCoefficient c
_dCoefficient d
Plane::Plane ( Vector3  _a,
Vector3  _b,
Vector3  _c 
)
inline

Creates plane from the coordinates (x,y,z) of the three given points.

Parameters
_aVector of the coordinates of the point 1
_bVector of the coordinates of the point 2
_cVector of the coordinates of the point 3
Plane::Plane ( PointXYZ  _a,
PointXYZ  _b,
PointXYZ  _c 
)
inline

Creates plane from three given points (PointXYZNormal).

Parameters
_aPoint 1
_bPoint 2
_cPoint 3
Plane::Plane ( PointXYZNormal  _a,
PointXYZNormal  _b,
PointXYZNormal  _c 
)
inline

Creates plane from three given points (PointXYZNormal).

Parameters
_aPoint 1
_bPoint 2
_cPoint 3

Member Function Documentation

void Plane::addPointCloud ( PointCloud pc)
inline

Adds PointCloud to the Plane.

Parameters
pcPointCloud to be added
static double Plane::checkLocalMatch ( std::vector< PointXYZNormal points1,
std::vector< PointXYZNormal points2 
)
inlinestatic

Returns the ratio of the overlapping area of two planes over the area of the smaller plane.

Parameters
points1Points of the first plane
points2Points of the second plane
Returns
Matched percentage
static double Plane::checkMatchingArea ( std::vector< PointXYZNormal points1,
std::vector< PointXYZNormal points2 
)
inlinestatic

Returns the size of the overlapping area of two planes.

Parameters
points1Points of the first plane
points2Points of the second plane
Returns
Matching area
static double Plane::distanceBetweenPlanes ( Plane pl1,
Plane pl2 
)
inlinestatic

Returns distance between planes with same a, b, c coefficients.

Parameters
pl1The first plane
pl2The second plane
Returns
Calculated distance
double Plane::distanceTo ( Vector3 v)
inline

Returns the distance between the receiver and the given point.

Parameters
vVector of the coordinates (x, y, z) of the point to which the distance is calculated
Returns
Distance of the point to the plane
double Plane::distanceTo ( PointXYZ p)
inline

Returns the distance between the receiver and the given point.

Parameters
pPoint to which the distance is calculated
Returns
Distance of the point to the plane
double Plane::distanceTo ( PointXYZNormal  p)
inline

Returns the distance between the receiver and the given point.

Parameters
pPoint to which the distance is calculated
Returns
Distance of the point to the plane
double Plane::distanceTo ( std::vector< PointXYZNormal > &  points)
inline

Returns the distance between the receiver and the given point.

Parameters
pPoint to which the distance is calculated
Returns
Distance of the point to the plane
static bool Plane::generateOuterPlane ( std::vector< PointXYZNormal points,
std::vector< PointXYZNormal > &  outPoints,
std::vector< BitGrid roomGrids,
double  minOffset 
)
inlinestatic

Generates a copy of the plane at the pointcloud boundary with given offset.

Parameters
pointsPoints of the plane to be copied
outPointsReturn parameter storing points of the newly generated plane
roomGridsVector of grids of all rooms in the pointcloud
minOffsetParameter defining the offset (in the normal direction, positive value ~ out of the pointcloud) of the newly generated plane
Returns
True if plane is inner
False if plane is at the pointcloud boundary
double Plane::getD ( ) const
inline

Returns coefficient d (Plane = $ax + by + cz + d = 0$).

Returns
Coefficient d
int Plane::getFloorId ( ) const
inline

Returns Floor identifier.

Returns
Floor identifier
int Plane::getId ( ) const
inline

Returns Plane identifier.

Returns
Plane identifier
static void Plane::getLocalMatch ( std::vector< PointXYZNormal points1,
std::vector< PointXYZNormal points2,
std::vector< int > &  result1,
std::vector< int > &  result2 
)
inlinestatic

Search for the overlapping points of two given planes.

Parameters
points1Points of the first plane
points2Points of the second plane
result1Indexes of the points1 which are overlapping with the second plane
result2Indexes of the points2 which are overlapping with the first plane
const double* Plane::getMax ( ) const
inline

Returns maximum coordinates.

Returns
Maximum coordinates [x, y, z]
const double* Plane::getMin ( ) const
inline

Returns minimum coordinates.

Returns
Minimum coordinates [x, y, z]
const double* Plane::getNormal ( ) const
inline

Returns plane normal vector.

Returns
Plane normal vector.
double* Plane::getNormal ( )
inline

Returns plane normal vector.

Returns
Plane normal vector.
Vector3 Plane::getNormalVector ( )
inline

Returns Plane normal vector.

Returns
Normal vector
std::vector<int>& Plane::getPointCloudIDs ( )
inline

Returns Plane PointClouds identifiers.

Returns
PointClouds identifiers
const std::vector<PointCloud>& Plane::getPointClouds ( ) const
inline

Returns Plane PointClouds.

Returns
Plane PointClouds
std::vector<PointCloud>& Plane::getPointClouds ( )
inline

Returns Plane PointClouds.

Returns
Plane PointClouds
template<typename T >
void Plane::getPoints ( std::vector< T > &  points)
inline

Returns Plane Points.

Parameters
pointsReturn parametr storing Plane points
static void Plane::giveCenterPlane ( std::vector< PointXYZNormal points1,
std::vector< PointXYZNormal points2,
double(&)  v1[3],
double(&)  v2[3],
double(&)  v3[3],
double &  d,
std::vector< PointXYZNormal > &  corners 
)
inlinestatic

Calculates the centerplane between the two given planes.

Parameters
points1Plane 1
points2Plane 2
v1Return parameter corresponding to the normal vector of the calculated centerplane
v2Return parameter corresponding to the in-plane vector of the calculated centerplane
v3Return parameter corresponding to the in-plane vector of the calculated centerplane
dReturn parameter corresponding to coefficient d of the calculated plane
cornersReturn parameter corresp[onding to the set of points defining the centerplane
static bool Plane::isInnerPlane ( std::vector< PointXYZNormal points,
std::vector< BitGrid roomGrids,
double  minOffset 
)
inlinestatic

Evaluates whether the plane is inner (between two rooms) or not (at the pointcloud boundary).

Parameters
pointsPoints of the plane to be evaluated
roomGridsVector of grids of all rooms in the pointcloud
minOffsetParameter defining how far from the plane to search for the room
Returns
True if plane is inner
False if plane is at the pointcloud boundary
static bool Plane::makeWall ( Plane plane1,
Plane plane2,
std::vector< PointXYZ > &  result1,
std::vector< PointXYZ > &  result2 
)
inlinestatic

Search for the overlapping points of two given planes.

Parameters
points1Points of the first plane
points2Points of the second plane
result1Return parametr storing indexes of the points1 which are overlapping with the second plane
result2Return parametr storing indexes of the points2 which are overlapping with the first plane
void Plane::setD ( double  d)
inline

Sets coefficient d (Plane = $ax + by + cz + d = 0$).

Parameters
dCoefficient d to be set
void Plane::setFloorId ( int  id)
inline

Sets Floor identifier.

Parameters
idFloor identifier to be set
void Plane::setId ( int  id)
inline

Sets Plane identifier.

Parameters
idPlane identifier to be set
void Plane::setMax ( double  x,
double  y,
double  z 
)
inline

Sets maximum coordinates.

Parameters
xX coordinate to be set
yY coordinate to be set
zZ coordinate to be set
void Plane::setMin ( double  x,
double  y,
double  z 
)
inline

Sets minimum coordinates.

Parameters
xX coordinate to be set
yY coordinate to be set
zZ coordinate to be set
void Plane::setNormal ( double  nx,
double  ny,
double  nz 
)
inline

Sets plane normal vector.

Parameters
nxX component
nyY component
nzZ component

The documentation for this class was generated from the following file: