throw Exception("Unexpected situation of overlapping edges : internal error occurs ! ");
}
}
+
+bool Edge::isEqual(const Edge& other) const
+{
+ return _start->isEqual(*other._start) && _end->isEqual(*other._end);
+}
static void interpolate1DLin(const std::vector<double>& distrib1, const std::vector<double>& distrib2,
std::map<int, std::map<int,double> >& result);
virtual void dumpInXfigFile(std::ostream& stream, bool direction, int resolution, const Bounds& box) const = 0;
+ bool isEqual(const Edge& other) const;
protected:
Edge():_cnt(1),_loc(FULL_UNKNOWN),_start(0),_end(0) { }
virtual ~Edge();
{
return _ptr==other;
}
+
+bool ElementaryEdge::isEqual(const ElementaryEdge& other) const
+{
+ return _ptr->isEqual(*other._ptr);
+}
void dumpInXfigFile(std::ostream& stream, int resolution, const Bounds& box) const;
bool getDirection() const { return _direction; }
bool intresincEqCoarse(const Edge *other) const;
+ bool isEqual(const ElementaryEdge& other) const;
private:
bool _direction;
Edge *_ptr;
return ret*fact*fact;
}
+/*!
+ * Warning This method is \b NOT const. 'this' and 'other' are modified after call of this method.
+ */
+double QuadraticPolygon::intersectWithAbs1D(QuadraticPolygon& other, bool& isColinear)
+{
+ double ret = 0., xBaryBB, yBaryBB;
+ double fact = normalize(&other, xBaryBB, yBaryBB);
+
+ QuadraticPolygon cpyOfThis(*this);
+ QuadraticPolygon cpyOfOther(other);
+ int nbOfSplits = 0;
+ splitPolygonsEachOther(cpyOfThis, cpyOfOther, nbOfSplits);
+ //At this point cpyOfThis and cpyOfOther have been splited at maximum edge so that in/out can been done.
+ performLocatingOperation(cpyOfOther);
+
+ std::list<QuadraticPolygon *> cpyOfOtherZip = cpyOfOther.zipConsecutiveInSegments();
+
+ isColinear = false;
+ if (cpyOfOtherZip.size() == 1)
+ {
+ QuadraticPolygon& poly = *cpyOfOtherZip.front();
+ if (poly.size() == 2 && poly.front()->isEqual(*poly.back()))
+ isColinear = true;
+ }
+
+ for (std::list<QuadraticPolygon *>::iterator iter = cpyOfOtherZip.begin(); iter != cpyOfOtherZip.end(); iter++)
+ {
+ ret += fabs((*iter)->getPerimeter());
+ delete *iter;
+ }
+ return ret * fact / 2.;
+}
+
/*!
* Warning contrary to intersectWith method this method is \b NOT const. 'this' and 'other' are modified after call of this method.
*/
void dumpInXfigFileWithOther(const ComposedEdge& other, const char *fileName) const;
//! Before intersecting as intersectWith a normalization is done.
double intersectWithAbs(QuadraticPolygon& other);
+ double intersectWithAbs1D(QuadraticPolygon& other, bool& isColinear);
//! Before intersecting as intersectWith a normalization is done.
double intersectWithAbs(QuadraticPolygon& other, double* barycenter);
double intersectWith(const QuadraticPolygon& other) const;
Geometric2DIntersector(const MyMeshType& meshT, const MyMeshType& meshS,
double dimCaracteristic, double md3DSurf, double medianPlane, double precision, int orientation);
double intersectGeometry(ConnType icellT, ConnType icellS, ConnType nbNodesT, ConnType nbNodesS);
+ double intersectGeometry1D(ConnType icellT, ConnType icellS, ConnType nbNodesT, ConnType nbNodesS,
+ bool& isColinear);
double intersectGeometryWithQuadrangle(const double *quadrangle, const std::vector<double>& sourceCoords, bool isSourceQuad);
double intersectGeometryGeneral(const std::vector<double>& targetCoords, const std::vector<double>& sourceCoords);
double intersectGeoBary(const std::vector<double>& targetCell, bool targetCellQuadratic, const double *sourceCell, std::vector<double>& res);
#include "Geometric2DIntersector.hxx"
#include "PlanarIntersectorP0P0.txx"
+#include "Planar2D1DIntersectorP0P0.txx"
#include "PlanarIntersectorP0P1.txx"
#include "PlanarIntersectorP1P0.txx"
#include "PlanarIntersectorP1P1.txx"
return ret;
}
+ INTERSECTOR_TEMPLATE
+ double GEO2D_INTERSECTOR::intersectGeometry1D(ConnType icellT, ConnType icellS,
+ ConnType nbNodesT, ConnType nbNodesS,
+ bool& isColinear)
+ {
+ int orientation = 1;
+ std::vector<double> CoordsT;
+ std::vector<double> CoordsS;
+ PlanarIntersector<MyMeshType,MyMatrix>::getRealCoordinates(icellT,icellS,nbNodesT,nbNodesS,CoordsT,CoordsS,orientation);
+ NormalizedCellType tT=PlanarIntersector<MyMeshType,MyMatrix>::_meshT.getTypeOfElement(icellT);
+ NormalizedCellType tS=PlanarIntersector<MyMeshType,MyMatrix>::_meshS.getTypeOfElement(icellS);
+ QuadraticPolygon *p1=buildPolygonFrom(CoordsT,tT);
+ QuadraticPolygon *p2=buildPolygonFrom(CoordsS,tS);
+ double ret=p1->intersectWithAbs1D(*p2, isColinear);
+ delete p1; delete p2;
+ return ret;
+ }
+
INTERSECTOR_TEMPLATE
double GEO2D_INTERSECTOR::intersectGeometryWithQuadrangle(const double * quadrangle,
const std::vector<double>& sourceCoords,
Interpolation2D.txx \
Interpolation3D.hxx \
Interpolation3D.txx \
+Interpolation2D1D.hxx \
+Interpolation2D1D.txx \
Interpolation3D2D.hxx \
Interpolation3D2D.txx \
Interpolation3DSurf.hxx \
PointLocatorAlgos.txx \
PlanarIntersector.hxx \
PlanarIntersector.txx \
+Planar2D1DIntersectorP0P0.hxx \
+Planar2D1DIntersectorP0P0.txx \
PlanarIntersectorP0P0.hxx \
PlanarIntersectorP0P0.txx \
PlanarIntersectorP0P1.hxx \
#include "TargetIntersector.hxx"
#include "NormalizedUnstructuredMesh.hxx"
+#include <map>
+#include <set>
+
namespace INTERP_KERNEL
{
class TranslationRotationMatrix;
static const int MESHDIM=MyMeshType::MY_MESHDIM;
typedef typename MyMeshType::MyConnType ConnType;
static const NumberingPolicy numPol=MyMeshType::My_numPol;
+ typedef typename std::map<int,std::set<int> > DuplicateFacesType;
public:
//! \addtogroup InterpKerGrpIntPlan @{
PlanarIntersector(const MyMeshType& meshT, const MyMeshType& meshS, double dimCaracteristic, double precision, double md3DSurf, double medianPlane, bool doRotate, int orientation, int printLevel);
inline void getElemBB(double* bb, const MyMeshType& mesh, ConnType iP, ConnType nb_nodes);
static int projection(double *Coords_A, double *Coords_B,
int nb_NodesA, int nb_NodesB, double epsilon, double md3DSurf, double median_plane, bool do_rotate);
+ virtual const DuplicateFacesType* getIntersectFaces() const
+ {
+ return NULL;
+ }
protected :
int projectionThis(double *Coords_A, double *Coords_B, int nb_NodesA, int nb_NodesB);
void getRealTargetCoordinates(ConnType icellT, std::vector<double>& coordsT);