-// Copyright (C) 2007-2014 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2022 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
#include "INTERPKERNELDefines.hxx"
#include "InterpKernelGeo2DEdge.hxx"
+#include "MCIdType.hxx"
namespace INTERP_KERNEL
{
bool haveTheySameDirection() const;
bool areColinears() const;
void getPlacements(Node *start, Node *end, TypeOfLocInEdge& whereStart, TypeOfLocInEdge& whereEnd, MergePoints& commonNode) const;
- void areOverlappedOrOnlyColinears(const Bounds *whereToFind, bool& obviousNoIntersection, bool& areOverlapped);
+ void areOverlappedOrOnlyColinears(bool& obviousNoIntersection, bool& areOverlapped);
std::list< IntersectElement > getIntersectionsCharacteristicVal() const;
private:
//! return angle in ]-Pi;Pi[ - 'node' must be on curve of '_e1'
const EdgeArcCircle& getE1() const { return (const EdgeArcCircle&)_e1; }
const EdgeArcCircle& getE2() const { return (const EdgeArcCircle&)_e2; }
private:
- double _dist;
+ double _dist; // distance between the two arc centers
};
+ /**
+ * Cross-type intersector: edge1 is the arc of circle, edge2 is the segment.
+ */
class INTERPKERNEL_EXPORT ArcCSegIntersector : public CrossTypeEdgeIntersector
{
public:
//virtual overloading
bool areColinears() const;
void getPlacements(Node *start, Node *end, TypeOfLocInEdge& whereStart, TypeOfLocInEdge& whereEnd, MergePoints& commonNode) const;
- void areOverlappedOrOnlyColinears(const Bounds *whereToFind, bool& obviousNoIntersection, bool& areOverlapped);
+ void areOverlappedOrOnlyColinears(bool& obviousNoIntersection, bool& areOverlapped);
std::list< IntersectElement > getIntersectionsCharacteristicVal() const;
private:
const EdgeArcCircle& getE1() const { return (const EdgeArcCircle&)_e1; }
const EdgeLin& getE2() const { return (const EdgeLin&)_e2; }
private:
- double _dx;
- double _dy;
- double _drSq;
- double _cross;
- double _determinant;
+ double _dx; //!< X extent of the segment
+ double _dy; //!< Y extent of the segment
+ double _drSq; //!< Square of the norm of the seg
+ double _cross; //!< See areOverlappedOrOnlyColinears()
+ double _deltaRoot_div_dr; //!< See areOverlappedOrOnlyColinears()
+ bool _i1S2E,_i1E2E;
};
-
+
class INTERPKERNEL_EXPORT EdgeArcCircle : public Edge
{
public:
void getBarycenter(double *bary) const;
void getBarycenterOfZone(double *bary) const;
void getMiddleOfPoints(const double *p1, const double *p2, double *mid) const;
+ void getMiddleOfPointsOriented(const double *p1, const double *p2, double *mid) const;
bool isIn(double characterVal) const;
Node *buildRepresentantOfMySelf() const;
bool isLower(double val1, double val2) const;
double getAngle0() const { return _angle0; }
double getRadius() const { return _radius; }
double getAngle() const { return _angle; }
- void tesselate(const int *conn, int offset, double eps, std::vector<int>& newConn, std::vector<double>& addCoo) const;
+ void tesselate(const mcIdType *conn, mcIdType offset, double eps, std::vector<mcIdType>& newConn, std::vector<double>& addCoo) const;
static EdgeArcCircle *BuildFromNodes(Node *start, Node *middle, Node *end);
static double GetAbsoluteAngle(const double *vect, double& normVect);
static double GetAbsoluteAngleOfNormalizedVect(double ux, double uy);
protected:
void updateBounds();
Edge *buildEdgeLyingOnMe(Node *start, Node *end, bool direction=true) const;
- void fillGlobalInfoAbs(bool direction, const std::map<INTERP_KERNEL::Node *,int>& mapThis, const std::map<INTERP_KERNEL::Node *,int>& mapOther, int offset1, int offset2, double fact, double baryX, double baryY,
- std::vector<int>& edgesThis, std::vector<double>& addCoo, std::map<INTERP_KERNEL::Node *,int> mapAddCoo) const;
- void fillGlobalInfoAbs2(const std::map<INTERP_KERNEL::Node *,int>& mapThis, const std::map<INTERP_KERNEL::Node *,int>& mapOther, int offset1, int offset2, double fact, double baryX, double baryY,
- std::vector<int>& edgesOther, std::vector<double>& addCoo, std::map<INTERP_KERNEL::Node *,int>& mapAddCoo) const;
+
protected:
- //!Value between -2Pi and 2Pi
- double _angle;
- //!Value between -Pi and Pi
+ //! Absolute angle where the arc starts. Value between -Pi and Pi
double _angle0;
+ //! Angular span of the arc. Value between -2Pi and 2Pi
+ double _angle;
+ //! Radius of the arc of circle
double _radius;
+ //! Center of the arc of circle
double _center[2];
};
}