Loading...
Searching...
No Matches
triangulatedSES.h
Go to the documentation of this file.
// -*- Mode: C++; tab-width: 2; -*-
// vi: set ts=2:
//
#ifndef BALL_STRUCTURE_TRIANGULATEDSES_H
#define BALL_STRUCTURE_TRIANGULATEDSES_H
#ifndef BALL_TRUCTURE_SOLVENTEXCLUDEDSURFACE_H
# include <BALL/STRUCTURE/solventExcludedSurface.h>
#endif
#ifndef BALL_STRUCTURE_TRIANGLE_H
# include <BALL/STRUCTURE/triangle.h>
#endif
#ifndef BALL_STRUCTURE_TRIANGLEEDGE_H
# include <BALL/STRUCTURE/triangleEdge.h>
#endif
#ifndef BALL_STRUCTURE_TRIANGLEPOINT_H
# include <BALL/STRUCTURE/trianglePoint.h>
#endif
#ifndef BALL_STRUCTURE_TRIANGULATEDSURFACE_H
# include <BALL/STRUCTURE/triangulatedSurface.h>
#endif
#ifndef BALL_MATHS_ANGLE_H
# include <BALL/MATHS/angle.h>
#endif
#ifndef BALL_MATHS_CIRCLE3_H
# include <BALL/MATHS/circle3.h>
#endif
#ifndef BALL_MATHS_SPHERE3_H
# include <BALL/MATHS/sphere3.h>
#endif
#ifndef BALL_MATHS_VECTOR3_H
# include <BALL/MATHS/vector3.h>
#endif
#include <list>
#include <vector>
namespace BALL
{
class SESTriangulator;
class BALL_EXPORT TriangulatedSES : public TriangulatedSurface
{
public:
friend class SESTriangulator;
BALL_CREATE(TriangulatedSES)
TriangulatedSES()
;
TriangulatedSES(const TriangulatedSES& surface, bool = true)
;
TriangulatedSES(SolventExcludedSurface* ses, const double& density)
;
virtual ~TriangulatedSES()
;
void set(const TriangulatedSES& surface, bool = true)
;
TriangulatedSES& operator = (const TriangulatedSES& surface)
;
void setDensity(const double& density)
;
double getDensity() const
;
void compute();
protected:
/*_ @name Attributes
*/
SolventExcludedSurface* ses_;
double density_;
};
class BALL_EXPORT SESTriangulator
{
public:
BALL_CREATE(SESTriangulator)
SESTriangulator()
;
SESTriangulator(TriangulatedSES* tses)
;
virtual ~SESTriangulator()
;
void run();
private:
void preProcessing()
;
void triangulateToricFaces()
;
void partitionSingularEdges()
;
void triangulateContactFaces()
;
void triangulateSphericFaces()
;
void triangulateToricFace
(SESFace* face,
const double& probe_radius)
;
void triangulateFreeToricFace
(SESFace* face,
const double& probe_radius)
;
void triangulateSingularToricFace
(SESFace* face,
const double& probe_radius)
;
void triangulateNonSingularToricFace
(SESFace* face,
const double& probe_radius)
;
void partitionSingularEdge(SESEdge* singular_edge)
;
void partitionFreeSingularEdge(SESEdge* singular_edge)
;
void partitionNonFreeSingularEdge(SESEdge* singular_edge)
;
void triangulateContactFace
(SESFace* face,
const TSphere3<double>& sphere)
;
bool triangulateSphericFace
(SESFace* face,
const TSphere3<double>& sphere)
;
bool buildSphericTriangles
(SESFace* face,
TriangulatedSES& part,
const TSphere3<double>& sphere,
bool convex = true)
;
bool buildFirstTriangle
(SESFace* face,
TriangulatedSES& part,
std::list<TriangleEdge*>& border,
const TSphere3<double>& sphere,
const HashSet<TrianglePoint*>& points,
bool convex)
;
SESEdge* firstSESEdge(const std::list<SESEdge*>& sesedge)
;
void buildUnambiguousTriangle
(TriangleEdge* edge,
TrianglePoint* point,
std::list<TriangleEdge*>& border,
const TSphere3<double>& sphere,
TriangulatedSES& part,
bool convex
)
;
void buildAmbiguousTriangles
(TriangleEdge* edge,
std::list<TrianglePoint*> points,
std::list<TriangleEdge*>& border,
const TSphere3<double>& sphere,
TriangulatedSES& part,
bool convex
)
;
void createTriangleAndEdges
(TriangleEdge* edge,
TrianglePoint* point,
const TSphere3<double>& sphere,
TriangleEdge*& edge1,
bool& old1,
TriangleEdge*& edge2,
bool& old2,
Triangle*& triangle,
bool convex
)
;
void partitionOfCircle
(const TCircle3<double>& circle,
const TVector3<double>& p0,
const TAngle<double>& phi,
Size number_of_segments,
vector< TVector3<double> >& partition,
bool on_surface = true)
;
Size numberOfRefinements(const double& density, const double& radius)
;
void buildTemplateSpheres()
;
void buildTriangles
(SESEdge* edge0,
SESEdge* edge1,
SESEdge* edge2,
SESEdge* edge3,
const std::vector< TVector3<double> >& centers,
const std::vector< TVector3<double> >& edge1_points,
const std::vector< TVector3<double> >& edge3_points,
const double& probe_radius)
;
protected:
/*_ @name Attributes
*/
TriangulatedSES* tses_;
std::vector<TrianglePoint*> point_;
std::vector<std::list<TriangleEdge*> > edge_;
HashMap<Size, std::list<TrianglePoint*> > template_spheres_;
double sqrt_density_;
};
} // namespace BALL
#endif // BALL_STRUCTURE_TRIANGULATEDSES_H
BALL_EXPORT
#define BALL_EXPORT
Definition COMMON/global.h:50
angle.h
circle3.h
BALL::HashMap
HashMap class based on the STL map (containing serveral convenience functions).
Definition hashMap.h:74
BALL::HashSet
Definition hashSet.h:46
BALL::SESEdge
Definition SESEdge.h:34
BALL::SESFace
Definition SESFace.h:38
BALL::SESTriangulator
Definition triangulatedSES.h:164
BALL::SESTriangulator::run
void run()
BALL::SESTriangulator::edge_
std::vector< std::list< TriangleEdge * > > edge_
Definition triangulatedSES.h:346
BALL::SESTriangulator::tses_
TriangulatedSES * tses_
Definition triangulatedSES.h:344
BALL::SESTriangulator::point_
std::vector< TrianglePoint * > point_
Definition triangulatedSES.h:345
BALL::SESTriangulator::SESTriangulator
SESTriangulator()
BALL::SESTriangulator::sqrt_density_
double sqrt_density_
Definition triangulatedSES.h:348
BALL::SESTriangulator::template_spheres_
HashMap< Size, std::list< TrianglePoint * > > template_spheres_
Definition triangulatedSES.h:347
BALL::SolventExcludedSurface
Definition solventExcludedSurface.h:67
BALL::TAngle
Definition angle.h:53
BALL::TCircle3
Definition circle3.h:46
BALL::TSphere3
Definition sphere3.h:33
BALL::TVector3
Definition vector3.h:71
BALL::TriangleEdge
Definition triangleEdge.h:39
BALL::TrianglePoint
Definition trianglePoint.h:43
BALL::Triangle
Definition triangle.h:39
BALL::TriangulatedSES
Definition triangulatedSES.h:55
BALL::TriangulatedSES::compute
void compute()
BALL::TriangulatedSES::SESTriangulator
friend class SESTriangulator
Definition triangulatedSES.h:64
BALL::TriangulatedSES::set
void set(const TriangulatedSES &surface, bool=true)
BALL::TriangulatedSES::ses_
SolventExcludedSurface * ses_
Definition triangulatedSES.h:147
BALL::TriangulatedSES::getDensity
double getDensity() const
BALL::TriangulatedSES::setDensity
void setDensity(const double &density)
BALL::TriangulatedSES::density_
double density_
Definition triangulatedSES.h:149
BALL::TriangulatedSES::TriangulatedSES
TriangulatedSES()
BALL::TriangulatedSurface::TriangulatedSurface
TriangulatedSurface()
BALL_CREATE
#define BALL_CREATE(name)
Definition create.h:62
BALL
Definition constants.h:13
BALL::Size
BALL_SIZE_TYPE Size
Definition COMMON/global.h:114
std
STL namespace.
solventExcludedSurface.h
sphere3.h
triangleEdge.h
trianglePoint.h
triangle.h
triangulatedSurface.h
vector3.h