ivutils
Loading...
Searching...
No Matches
contour.hpp File Reference

Template function definitions for contour.h. More...

#include "contour.h"
#include "utiltl.h"
Include dependency graph for contour.hpp:
This graph shows which files directly or indirectly include this file:

Functions

template<class point_it , int N>
Vector_Nt< vec_type, N > GetBoundingBox (point_it it, point_it end, Vector_Nt< vec_type, N > *cube1, Vector_Nt< vec_type, N > *cube2)
 records opposite coordinates of maximal rectangular parallelepiped which contains some points defined by point iterators it and end returns average of selected points

 
template<class plane_it , class contour_t >
int ProjectSimplex (const Plane_3 &plane0, plane_it beg, plane_it end, contour_t &cnt, int nplanes)
 record to the contour cnt section of the plane plane0 by polyhedron, formed by planes iterated from iterator beg till end
 
template<class out_cont_t , class plane_it >
int GetFaces (out_cont_t &cont, plane_it beg, plane_it end, const std::vector< int > *redundant_planes, std::vector< int > *valid_planes)
 gets all faces of the polyhedral region defined by planes from [beg, end) of type plane_it puts the faces as planar contours into container cont using push_back(...) Parameter redundant_planes specifies the order number of planes that can not form faces.
 
template<class contour_t >
int GetPlaneSection (const contour_t &cnt, const Plane_3 &plane, contour_t *cnt_in, contour_t *cnt_out)
 Tests whether the contour crosses the plane and optionally outputs inside (side of plane distance >0) and outside subcontours.
 

Detailed Description

Template function definitions for contour.h.

Function Documentation

◆ GetFaces()

template<class out_cont_t , class plane_it >
int GetFaces ( out_cont_t &  cont,
plane_it  beg,
plane_it  end,
const std::vector< int > *  redundant_planes = nullptr,
std::vector< int > *  valid_planes = nullptr 
)

gets all faces of the polyhedral region defined by planes from [beg, end) of type plane_it puts the faces as planar contours into container cont using push_back(...) Parameter redundant_planes specifies the order number of planes that can not form faces.

The order number of planes that actually form faces are placed in output parameter valid_planes, if specified.

Returns
the number of faces

◆ GetPlaneSection()

template<class contour_t >
int GetPlaneSection ( const contour_t &  cnt,
const Plane_3 plane,
contour_t *  cnt_in = nullptr,
contour_t *  cnt_out = nullptr 
)

Tests whether the contour crosses the plane and optionally outputs inside (side of plane distance >0) and outside subcontours.

Returns
0, if there is a crossing
1, if the contour is fully inside plane
-1, if the contour is fully outside plane