Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
INTERP_KERNEL::Edge Class Referenceabstract
Inheritance diagram for INTERP_KERNEL::Edge:
Collaboration diagram for INTERP_KERNEL::Edge:

Public Member Functions

void addSubEdgeInVector (Node *start, Node *end, ComposedEdge &vec) const
 
virtual void applySimilarity (double xBary, double yBary, double dimChar)
 
template<INTERP_KERNEL::TypeOfMod4QuadEdge type>
INTERP_KERNEL::EdgeBuildEdgeFrom (Node *start, Node *middle, Node *end)
 
virtual EdgebuildEdgeLyingOnMe (Node *start, Node *end, bool direction=true) const =0
 
virtual NodebuildRepresentantOfMySelf () const =0
 
bool changeEndNodeWith (Node *otherEndNode) const
 
bool changeEndNodeWithAndKeepTrack (Node *otherEndNode, std::vector< Node * > &track) const
 
bool changeStartNodeWith (Node *otherStartNode) const
 
bool changeStartNodeWithAndKeepTrack (Node *otherStartNode, std::vector< Node * > &track) const
 
void declareIn () const
 
void declareOn () const
 
void declareOut () const
 
bool decrRef ()
 
virtual void dumpInXfigFile (std::ostream &stream, bool direction, int resolution, const Bounds &box) const =0
 
virtual void dynCastFunction (const EdgeLin *&seg, const EdgeArcCircle *&arcSeg) const =0
 
 Edge (Node *start, Node *end, bool direction=true)
 
 Edge (double sX, double sY, double eX, double eY)
 
virtual 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 =0
 
virtual 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 =0
 
void fillXfigStreamForLoc (std::ostream &stream) const
 
virtual double getAreaOfZone () const =0
 
virtual void getBarycenter (double *bary) const =0
 
virtual void getBarycenterOfZone (double *bary) const =0
 
const Bounds & getBounds () const
 
virtual double getCharactValue (const Node &node) const =0
 
virtual double getCharactValueBtw0And1 (const Node &node) const =0
 
virtual double getCurveLength () const =0
 
virtual double getDistanceToPoint (const double *pt) const =0
 
NodegetEndNode () const
 
bool getHitStatus () const
 
TypeOfEdgeLocInPolygon getLoc () const
 
virtual void getMiddleOfPoints (const double *p1, const double *p2, double *mid) const =0
 
virtual void getMiddleOfPointsOriented (const double *p1, const double *p2, double *mid) const
 
NodegetNode (TypeOfLocInEdge where) const
 
void getNormalVector (double *vectOutput) const
 
NodegetStartNode () const
 
virtual TypeOfFunction getTypeOfFunc () const =0
 
void hitMeAfter (double xBary, double yBary, double dimChar)
 
void hitMeAlone (double xBary, double yBary, double dimChar)
 
void incrRef () const
 
void initHitStatus () const
 
void initLocs () const
 
bool intersectWith (const Edge *other, MergePoints &commonNode, ComposedEdge &outVal1, ComposedEdge &outVal2) const
 
bool isEqual (const Edge &other) const
 
virtual bool isIn (double characterVal) const =0
 
virtual bool isLower (double val1, double val2) const =0
 
virtual bool isNodeLyingOn (const double *coordOfNode) const =0
 
void setEndNodeWithoutChange (Node *newEnd)
 
void setStartNodeWithoutChange (Node *newStart)
 
void sortIdsAbs (const std::vector< INTERP_KERNEL::Node * > &addNodes, const std::map< INTERP_KERNEL::Node *, int > &mapp1, const std::map< INTERP_KERNEL::Node *, int > &mapp2, std::vector< int > &edgesThis)
 
bool sortSubNodesAbs (const double *coo, std::vector< int > &subNodes)
 
virtual void unApplySimilarity (double xBary, double yBary, double dimChar)
 
void unHitMeAfter (double xBary, double yBary, double dimChar)
 
void unHitMeAlone (double xBary, double yBary, double dimChar)
 
virtual void update (Node *m)=0
 

Static Public Member Functions

static EdgeBuildEdgeFrom (Node *start, Node *end)
 
template<TypeOfMod4QuadEdge type>
static EdgeBuildEdgeFrom (Node *start, Node *middle, Node *end)
 
static EdgeBuildEdgeFrom3Points (const double *start, const double *middle, const double *end)
 
static EdgeBuildFromXfigLine (std::istream &str)
 
static EdgeIntersectorBuildIntersectorWith (const Edge *e1, const Edge *e2)
 
static void Interpolate1DLin (const std::vector< double > &distrib1, const std::vector< double > &distrib2, std::map< int, std::map< int, double > > &result)
 
static bool IntersectOverlapped (const Edge *f1, const Edge *f2, EdgeIntersector *intersector, MergePoints &commonNode, ComposedEdge &outValForF1, ComposedEdge &outValForF2)
 

Protected Member Functions

 Edge ()
 
virtual ~Edge ()
 

Static Protected Member Functions

static int CombineCodes (TypeOfLocInEdge code1, TypeOfLocInEdge code2)
 
static bool Intersect (const Edge *f1, const Edge *f2, EdgeIntersector *intersector, const Bounds *whereToFind, MergePoints &commonNode, ComposedEdge &outValForF1, ComposedEdge &outValForF2)
 
static bool SplitOverlappedEdges (const Edge *e1, const Edge *e2, Node *nS, Node *nE, bool direction, int code, ComposedEdge &outVal1, ComposedEdge &outVal2)
 

Protected Attributes

Bounds _bounds
 
unsigned char _cnt
 
Node_end
 
bool _hit
 
TypeOfEdgeLocInPolygon _loc
 
Node_start
 

Static Protected Attributes

static const int OFFSET_FOR_TYPEOFLOCINEDGE = 8
 

Detailed Description

Deal with an oriented edge of a polygon. An Edge is defined with a start node, an end node and an equation of 1D curve. All other attributes are mutable because they don't impact these 3 invariant attributes. To be exact start and end nodes can change (address) but their location remain the same (at precision).

Constructor & Destructor Documentation

INTERP_KERNEL::Edge::Edge ( Node start,
Node end,
bool  direction = true 
)
Edge::Edge ( double  sX,
double  sY,
double  eX,
double  eY 
)
INTERP_KERNEL::Edge::Edge ( )
protected
Edge::~Edge ( )
protectedvirtual

Member Function Documentation

void INTERP_KERNEL::Edge::initLocs ( ) const
void INTERP_KERNEL::Edge::initHitStatus ( ) const
bool INTERP_KERNEL::Edge::getHitStatus ( ) const
void INTERP_KERNEL::Edge::hitMeAlone ( double  xBary,
double  yBary,
double  dimChar 
)
void INTERP_KERNEL::Edge::unHitMeAlone ( double  xBary,
double  yBary,
double  dimChar 
)
void INTERP_KERNEL::Edge::hitMeAfter ( double  xBary,
double  yBary,
double  dimChar 
)
void INTERP_KERNEL::Edge::unHitMeAfter ( double  xBary,
double  yBary,
double  dimChar 
)
void Edge::fillXfigStreamForLoc ( std::ostream &  stream) const
Node* INTERP_KERNEL::Edge::getNode ( TypeOfLocInEdge  where) const
void INTERP_KERNEL::Edge::setEndNodeWithoutChange ( Node newEnd)
void INTERP_KERNEL::Edge::setStartNodeWithoutChange ( Node newStart)
bool Edge::changeStartNodeWithAndKeepTrack ( Node otherStartNode,
std::vector< Node * > &  track 
) const
bool Edge::changeEndNodeWithAndKeepTrack ( Node otherEndNode,
std::vector< Node * > &  track 
) const
void Edge::addSubEdgeInVector ( Node start,
Node end,
ComposedEdge vec 
) const

Precondition : 'start' and 'end' are lying on the same curve than 'this'. Add in vec the sub edge lying on this. If 'start' is equal (by pointer) to '_end' and 'end' is equal to '_end' too nothing is added. If 'start' is equal (by pointer) to '_start' and 'end' is equal to '_start' too nothing is added. If 'start' is equal (by pointer) to '_start' and 'end' is equal to '_end' this is added in vec.

References _end, _start, buildEdgeLyingOnMe(), incrRef(), and INTERP_KERNEL::ComposedEdge::pushBack().

Referenced by Intersect().

void Edge::getNormalVector ( double *  vectOutput) const

Retrieves a vector 'vectOutput' that is normal to 'this'. 'vectOutput' is normalized.

References _end, _start, and INTERP_KERNEL::Node::norm().

EdgeIntersector * Edge::BuildIntersectorWith ( const Edge e1,
const Edge e2 
)
static

References dynCastFunction(), and getTypeOfFunc().

Referenced by intersectWith().

Edge * Edge::BuildFromXfigLine ( std::istream &  str)
static
Edge * Edge::BuildEdgeFrom ( Node start,
Node end 
)
static
template<TypeOfMod4QuadEdge type>
static Edge* INTERP_KERNEL::Edge::BuildEdgeFrom ( Node start,
Node middle,
Node end 
)
static
Edge * Edge::BuildEdgeFrom3Points ( const double *  start,
const double *  middle,
const double *  end 
)
static
virtual void INTERP_KERNEL::Edge::update ( Node m)
pure virtual
virtual double INTERP_KERNEL::Edge::getAreaOfZone ( ) const
pure virtual

returns area between this and axe Ox delimited along Ox by _start and _end.

Implemented in INTERP_KERNEL::EdgeArcCircle, and INTERP_KERNEL::EdgeLin.

Referenced by INTERP_KERNEL::ElementaryEdge::getAreaOfZone().

void Edge::applySimilarity ( double  xBary,
double  yBary,
double  dimChar 
)
virtual

apply a similiraty transformation on 'this'

See Node::applySimilarity to see signification of params.

Reimplemented in INTERP_KERNEL::EdgeArcCircle.

References _bounds.

Referenced by INTERP_KERNEL::ElementaryEdge::applySimilarity(), INTERP_KERNEL::EdgeArcCircle::applySimilarity(), sortIdsAbs(), and sortSubNodesAbs().

void Edge::unApplySimilarity ( double  xBary,
double  yBary,
double  dimChar 
)
virtual

apply the inverse similiraty transformation on 'this'

Reimplemented in INTERP_KERNEL::EdgeArcCircle.

References _bounds.

Referenced by INTERP_KERNEL::ElementaryEdge::unApplySimilarity(), and INTERP_KERNEL::EdgeArcCircle::unApplySimilarity().

virtual double INTERP_KERNEL::Edge::getCurveLength ( ) const
pure virtual
virtual void INTERP_KERNEL::Edge::getBarycenter ( double *  bary) const
pure virtual
virtual void INTERP_KERNEL::Edge::getBarycenterOfZone ( double *  bary) const
pure virtual
virtual void INTERP_KERNEL::Edge::getMiddleOfPoints ( const double *  p1,
const double *  p2,
double *  mid 
) const
pure virtual

return the middle of two points

Implemented in INTERP_KERNEL::EdgeArcCircle, and INTERP_KERNEL::EdgeLin.

Referenced by getMiddleOfPointsOriented().

void Edge::getMiddleOfPointsOriented ( const double *  p1,
const double *  p2,
double *  mid 
) const
virtual

return the middle of two points respecting the orientation defined by this (relevant for arc of circle). By default same as getMiddleOfPoints()

Reimplemented in INTERP_KERNEL::EdgeArcCircle.

References getMiddleOfPoints().

virtual Node* INTERP_KERNEL::Edge::buildRepresentantOfMySelf ( ) const
pure virtual

Retrieves a point that is owning to this, well placed for IN/OUT detection of this. Typically midlle of this is returned.

Implemented in INTERP_KERNEL::EdgeArcCircle, and INTERP_KERNEL::EdgeLin.

Referenced by INTERP_KERNEL::QuadraticPolygon::haveIAChanceToBeCompletedBy(), and INTERP_KERNEL::ElementaryEdge::locateFullyMySelfAbsolute().

virtual bool INTERP_KERNEL::Edge::isIn ( double  characterVal) const
pure virtual

Given a magnitude specified by sub-type returns if in or not. See getCharactValue method.

Implemented in INTERP_KERNEL::EdgeArcCircle, and INTERP_KERNEL::EdgeLin.

Referenced by INTERP_KERNEL::IntersectElement::isIncludedByBoth(), INTERP_KERNEL::IntersectElement::isOnExtrForAnEdgeAndInForOtherEdge(), and SplitOverlappedEdges().

virtual bool INTERP_KERNEL::Edge::isLower ( double  val1,
double  val2 
) const
pure virtual

With the same magnitude as defined in 'isIn' method perform a compararison. Precondition : val1 and val2 are different and exactly INSIDE this.

Implemented in INTERP_KERNEL::EdgeArcCircle, and INTERP_KERNEL::EdgeLin.

Referenced by INTERP_KERNEL::IntersectElement::isLowerOnOther(), and INTERP_KERNEL::IntersectElement::operator<().

virtual double INTERP_KERNEL::Edge::getCharactValue ( const Node node) const
pure virtual

node is expected to lay on 'this'. It returns a characteristic magnitude usable by isIn method.

Implemented in INTERP_KERNEL::EdgeArcCircle, and INTERP_KERNEL::EdgeLin.

Referenced by INTERP_KERNEL::SegSegIntersector::getIntersectionsCharacteristicVal(), INTERP_KERNEL::ArcCSegIntersector::getIntersectionsCharacteristicVal(), and SplitOverlappedEdges().

virtual double INTERP_KERNEL::Edge::getCharactValueBtw0And1 ( const Node node) const
pure virtual

node is expected to lay on 'this'. It returns a characteristic magnitude between 0 and 1.

Implemented in INTERP_KERNEL::EdgeArcCircle, and INTERP_KERNEL::EdgeLin.

Referenced by sortIdsAbs(), and sortSubNodesAbs().

virtual double INTERP_KERNEL::Edge::getDistanceToPoint ( const double *  pt) const
pure virtual

retrieves the distance to this : The min distance from pt and any point of this.

Implemented in INTERP_KERNEL::EdgeArcCircle, and INTERP_KERNEL::EdgeLin.

virtual bool INTERP_KERNEL::Edge::isNodeLyingOn ( const double *  coordOfNode) const
pure virtual

return if node with coords 'coordOfNode' is on this (with precision).

Implemented in INTERP_KERNEL::EdgeArcCircle, and INTERP_KERNEL::EdgeLin.

virtual TypeOfFunction INTERP_KERNEL::Edge::getTypeOfFunc ( ) const
pure virtual
virtual void INTERP_KERNEL::Edge::dynCastFunction ( const EdgeLin *&  seg,
const EdgeArcCircle *&  arcSeg 
) const
pure virtual
bool Edge::intersectWith ( const Edge other,
MergePoints commonNode,
ComposedEdge outVal1,
ComposedEdge outVal2 
) const
Parameters
otherThe Edge with which we are going to intersect.
commonNodeOutput. The common nodes found during operation of intersecting.
outVal1Output filled in case true is returned. It specifies the new or not new edges by which 'this' is replaced after intersecting op.
outVal2Output filled in case true is returned. It specifies the new or not new edges by which 'other' is replaced after intersecting op. return true if the intersection between this.

References _bounds, BuildIntersectorWith(), getBounds(), and Intersect().

Referenced by INTERP_KERNEL::QuadraticPolygon::isButterfly(), INTERP_KERNEL::QuadraticPolygon::splitAbs(), and INTERP_KERNEL::QuadraticPolygon::SplitPolygonsEachOther().

bool Edge::IntersectOverlapped ( const Edge f1,
const Edge f2,
EdgeIntersector intersector,
MergePoints commonNode,
ComposedEdge outValForF1,
ComposedEdge outValForF2 
)
static
void Edge::Interpolate1DLin ( const std::vector< double > &  distrib1,
const std::vector< double > &  distrib2,
std::map< int, std::map< int, double > > &  result 
)
static
virtual void INTERP_KERNEL::Edge::dumpInXfigFile ( std::ostream &  stream,
bool  direction,
int  resolution,
const Bounds &  box 
) const
pure virtual
bool Edge::isEqual ( const Edge other) const
bool Edge::sortSubNodesAbs ( const double *  coo,
std::vector< int > &  subNodes 
)

This method takes in input nodes in subNodes (using coo)

Parameters
[in,out]subNodesto be sorted
Returns
true if a reordering was necessary false if not.

References _end, _start, INTERP_KERNEL::Node::applySimilarity(), applySimilarity(), getBounds(), and getCharactValueBtw0And1().

Referenced by MEDCoupling::MEDCouplingUMesh::conformize2D().

void Edge::sortIdsAbs ( const std::vector< INTERP_KERNEL::Node * > &  addNodes,
const std::map< INTERP_KERNEL::Node *, int > &  mapp1,
const std::map< INTERP_KERNEL::Node *, int > &  mapp2,
std::vector< int > &  edgesThis 
)

Sort nodes so that they all lie consecutively on the edge that has been cut.

References _end, _start, INTERP_KERNEL::Node::applySimilarity(), applySimilarity(), eqpair(), getBounds(), and getCharactValueBtw0And1().

virtual void INTERP_KERNEL::Edge::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
pure virtual
virtual void INTERP_KERNEL::Edge::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
pure virtual
virtual Edge* INTERP_KERNEL::Edge::buildEdgeLyingOnMe ( Node start,
Node end,
bool  direction = true 
) const
pure virtual
int Edge::CombineCodes ( TypeOfLocInEdge  code1,
TypeOfLocInEdge  code2 
)
staticprotected
bool Edge::Intersect ( const Edge f1,
const Edge f2,
EdgeIntersector intersector,
const Bounds *  whereToFind,
MergePoints commonNode,
ComposedEdge outValForF1,
ComposedEdge outValForF2 
)
staticprotected
bool Edge::SplitOverlappedEdges ( const Edge e1,
const Edge e2,
Node nS,
Node nE,
bool  direction,
int  code,
ComposedEdge outVal1,
ComposedEdge outVal2 
)
staticprotected

The code 'code' is built by method combineCodes.

This method splits e1 and e2 into pieces as much sharable as possible. The precondition to the call of this method is that e1 and e2 have been declared as overlapped by corresponding intersector built from e1 and e2 type.

Parameters
nSstart node of e2 with the SAME DIRECTION as e1. The pointer nS should be equal to start node of e2 or to its end node.
nEend node of e2 with the SAME DIRECTION as e1. The pointer nE should be equal to start node of e2 or to its end node.
directionis param that specifies if e2 and e1 have same directions (true) or opposed (false).
codeis the code returned by method Edge::combineCodes.

References buildEdgeLyingOnMe(), declareOn(), INTERP_KERNEL::END, getCharactValue(), getEndNode(), getStartNode(), incrRef(), INTERP_KERNEL::INSIDE, isIn(), OFFSET_FOR_TYPEOFLOCINEDGE, INTERP_KERNEL::OUT_AFTER, INTERP_KERNEL::OUT_BEFORE, INTERP_KERNEL::ComposedEdge::pushBack(), INTERP_KERNEL::ComposedEdge::resize(), INTERP_KERNEL::ComposedEdge::setValueAt(), and INTERP_KERNEL::START.

Referenced by IntersectOverlapped().

template<INTERP_KERNEL::TypeOfMod4QuadEdge type>
INTERP_KERNEL::Edge* INTERP_KERNEL::Edge::BuildEdgeFrom ( Node start,
Node middle,
Node end 
)

Member Data Documentation

bool INTERP_KERNEL::Edge::_hit
mutableprotected
unsigned char INTERP_KERNEL::Edge::_cnt
mutableprotected

Referenced by decrRef().

TypeOfEdgeLocInPolygon INTERP_KERNEL::Edge::_loc
mutableprotected
const int INTERP_KERNEL::Edge::OFFSET_FOR_TYPEOFLOCINEDGE = 8
staticprotected