1 // File : FrontTrack_Projector.hxx
2 // Created : Wed Apr 26 20:12:13 2017
3 // Author : Edward AGAPOV (eap)
5 #ifndef __FrontTrack_Projector_HXX__
6 #define __FrontTrack_Projector_HXX__
8 #include <TopoDS_Shape.hxx>
11 struct FT_RealProjector;
14 * \brief Projector of a point to a boundary shape. Wrapper of a real projection algo
20 FT_Projector(const TopoDS_Shape& shape = TopoDS_Shape());
21 FT_Projector(const FT_Projector& other);
24 // initialize with a boundary shape, compute the bounding box
25 void setBoundaryShape(const TopoDS_Shape& shape);
27 // return the boundary shape
28 const TopoDS_Shape& getShape() const { return _shape; }
30 // return the bounding box
31 const Bnd_Box getBoundingBox() const { return _bndBox; }
34 // create a real projector
35 void prepareForProjection();
37 // return true if a previously found solution can be used to speed up the projection
38 bool canUsePrevSolution() const;
40 // return true if projection is not needed
41 bool isPlanarBoundary() const;
44 // switch a mode of usage of prevSolution.
45 // If projection fails, to try to project without usage of prevSolution.
46 // By default this mode is off
47 void tryWithoutPrevSolution( bool toTry ) { _tryWOPrevSolution = toTry; }
49 // project a point to the boundary shape
50 bool project( const gp_Pnt& point,
51 const double maxDist2,
54 const double* prevSolution = 0);
56 // project a point to the boundary shape and check if the projection is within the shape boundary
57 bool projectAndClassify( const gp_Pnt& point,
58 const double maxDist2,
61 const double* prevSolution = 0);
63 // check if a point lies on the boundary shape
64 bool isOnShape( const gp_Pnt& point,
67 const double* prevSolution = 0);
71 FT_RealProjector* _realProjector;
74 bool _tryWOPrevSolution;