Version: 6.5.0
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
INTERP_KERNEL::Edge Class Reference
Inheritance diagram for INTERP_KERNEL::Edge:
Inheritance graph
[legend]
Collaboration diagram for INTERP_KERNEL::Edge:
Collaboration graph
[legend]

Public Member Functions

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

Static Public Member Functions

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

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

unsigned char _cnt
TypeOfEdgeLocInPolygon _loc
Bounds _bounds
Node_start
Node_end

Static Protected Attributes

static const int OFFSET_FOR_TYPEOFLOCINEDGE = 8

Detailed Description

Deal with an oriented edge of a polygon. An Edge is definied with a start node a 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 node can change (adress) 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

TypeOfEdgeLocInPolygon INTERP_KERNEL::Edge::getLoc ( ) const
void INTERP_KERNEL::Edge::incrRef ( ) const
bool Edge::decrRef ( )
void INTERP_KERNEL::Edge::initLocs ( ) const
void Edge::declareOn ( ) const
void Edge::declareIn ( ) const
void Edge::declareOut ( ) const
const Bounds& INTERP_KERNEL::Edge::getBounds ( ) const
void Edge::fillXfigStreamForLoc ( std::ostream &  stream) const
Node* INTERP_KERNEL::Edge::getNode ( TypeOfLocInEdge  where) const
Node* INTERP_KERNEL::Edge::getStartNode ( ) const
Node* INTERP_KERNEL::Edge::getEndNode ( ) const
void INTERP_KERNEL::Edge::setEndNodeWithoutChange ( Node newEnd)
void INTERP_KERNEL::Edge::setStartNodeWithoutChange ( Node newStart)
bool Edge::changeStartNodeWith ( Node otherStartNode) const
bool Edge::changeStartNodeWithAndKeepTrack ( Node otherStartNode,
std::vector< Node * > &  track 
) const
bool Edge::changeEndNodeWith ( Node otherEndNode) 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
Edge * Edge::BuildFromXfigLine ( std::istream &  str)
static
Edge * Edge::BuildEdgeFrom ( Node start,
Node end 
)
static
template<INTERP_KERNEL::TypeOfMod4QuadEdge type>
INTERP_KERNEL::Edge * INTERP_KERNEL::Edge::BuildEdgeFrom ( Node start,
Node middle,
Node 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.

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 sortIdsAbs().

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

apply the inverse similiraty transformation on 'this'

Reimplemented in INTERP_KERNEL::EdgeArcCircle.

References _bounds.

virtual double INTERP_KERNEL::Edge::getCurveLength ( ) const
pure virtual

return the length of arc. Value is always > 0. !

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

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

virtual void INTERP_KERNEL::Edge::getBarycenter ( double *  bary) const
pure virtual
virtual void INTERP_KERNEL::Edge::getBarycenterOfZone ( double *  bary) const
pure virtual
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::amIAChanceToBeCompletedBy(), 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().

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
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 
)
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().

Member Data Documentation

unsigned char INTERP_KERNEL::Edge::_cnt
mutableprotected

Referenced by decrRef().

TypeOfEdgeLocInPolygon INTERP_KERNEL::Edge::_loc
mutableprotected
Bounds INTERP_KERNEL::Edge::_bounds
protected
Node* INTERP_KERNEL::Edge::_start
protected
Node* INTERP_KERNEL::Edge::_end
protected
const int INTERP_KERNEL::Edge::OFFSET_FOR_TYPEOFLOCINEDGE = 8
staticprotected
Copyright © 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS