Back to index

salome-med  6.5.0
Public Types | Public Member Functions | Private Attributes
INTERP_KERNEL::ProjectedCentralCircularSortOrder Class Reference

Class representing a circular order of a set of points around their barycenter. More...

List of all members.

Public Types

enum  CoordType { XY, XZ, YZ }
 Enumeration of different planes to project on when calculating order. More...

Public Member Functions

 ProjectedCentralCircularSortOrder (const double *barycenter, const CoordType type)
 Constructor.
bool operator() (const double *pt1, const double *pt2)
 Comparison operator.

Private Attributes

const int _aIdx
 index corresponding to first coordinate of plane on which points are projected
const int _bIdx
 index corresponding to second coordinate of plane on which points are projected
const double _a
 value of first projected coordinate of the barycenter
const double _b
 value of second projected coordinate of the barycenter

Detailed Description

Class representing a circular order of a set of points around their barycenter.

It is used with the STL sort() algorithm to sort the point of the two polygons

Definition at line 40 of file TransformedTriangle.cxx.


Member Enumeration Documentation

Enumeration of different planes to project on when calculating order.

Enumerator:
XY 
XZ 
YZ 

Definition at line 45 of file TransformedTriangle.cxx.

{ XY, XZ, YZ };

Constructor & Destructor Documentation

Constructor.

Parameters:
barycenterdouble[3] containing the barycenter of the points to be compared
typeplane to project on when comparing. The comparison will not work if all the points are in a plane perpendicular to the plane being projected on

Definition at line 54 of file TransformedTriangle.cxx.

      : _aIdx((type == YZ) ? 1 : 0), 
        _bIdx((type == XY) ? 1 : 2),
        _a(barycenter[_aIdx]), 
        _b(barycenter[_bIdx])
    {
    }

Member Function Documentation

bool INTERP_KERNEL::ProjectedCentralCircularSortOrder::operator() ( const double *  pt1,
const double *  pt2 
) [inline]

Comparison operator.

Compares the relative position between two points in their ordering around the barycenter.

Parameters:
pt1a double[3] representing a point
pt2a double[3] representing a point
Returns:
true if the angle of the difference vector between pt1 and the barycenter is greater than that of the difference vector between pt2 and the barycenter.

Definition at line 71 of file TransformedTriangle.cxx.

    {
      // calculate angles with the axis
      const double ang1 = atan2(pt1[_aIdx] - _a, pt1[_bIdx] - _b);
      const double ang2 = atan2(pt2[_aIdx] - _a, pt2[_bIdx] - _b);

      return ang1 > ang2;
    }

Member Data Documentation

value of first projected coordinate of the barycenter

Definition at line 88 of file TransformedTriangle.cxx.

index corresponding to first coordinate of plane on which points are projected

Definition at line 82 of file TransformedTriangle.cxx.

value of second projected coordinate of the barycenter

Definition at line 91 of file TransformedTriangle.cxx.

index corresponding to second coordinate of plane on which points are projected

Definition at line 85 of file TransformedTriangle.cxx.


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