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

Public Member Functions

 QuadraticPolygon ()
 QuadraticPolygon (const QuadraticPolygon &other)
 QuadraticPolygon (const char *fileName)
 ~QuadraticPolygon ()
void closeMe () const
void circularPermute ()
bool isButterflyAbs ()
bool isButterfly () const
void dumpInXfigFile (const char *fileName) const
void dumpInXfigFileWithOther (const ComposedEdge &other, const char *fileName) const
double intersectWithAbs (QuadraticPolygon &other)
double intersectWithAbs1D (QuadraticPolygon &other, bool &isColinear)
double intersectWithAbs (QuadraticPolygon &other, double *barycenter)
void splitAbs (QuadraticPolygon &other, const std::map< INTERP_KERNEL::Node *, int > &mapThis, const std::map< INTERP_KERNEL::Node *, int > &mapOther, int offset1, int offset2, const std::vector< int > &otherEdgeIds, std::vector< int > &edgesThis, int cellIdThis, std::vector< std::vector< int > > &edgesInOtherColinearWithThis, std::vector< std::vector< int > > &subDivOther, std::vector< double > &addCoo)
void buildFromCrudeDataArray (const std::map< int, INTERP_KERNEL::Node * > &mapp, bool isQuad, const int *nodalBg, const double *coords, const int *descBg, const int *descEnd, const std::vector< std::vector< int > > &intersectEdges)
void buildFromCrudeDataArray2 (const std::map< int, INTERP_KERNEL::Node * > &mapp, bool isQuad, const int *nodalBg, const double *coords, const int *descBg, const int *descEnd, const std::vector< std::vector< int > > &intersectEdges, const INTERP_KERNEL::QuadraticPolygon &pol1, const int *descBg1, const int *descEnd1, const std::vector< std::vector< int > > &intersectEdges1, const std::vector< std::vector< int > > &colinear1)
void appendEdgeFromCrudeDataArray (std::size_t edgeId, const std::map< int, INTERP_KERNEL::Node * > &mapp, bool isQuad, const int *nodalBg, const double *coords, const int *descBg, const int *descEnd, const std::vector< std::vector< int > > &intersectEdges)
void appendSubEdgeFromCrudeDataArray (Edge *baseEdge, std::size_t j, bool direct, int edgeId, const std::vector< int > &subEdge, const std::map< int, INTERP_KERNEL::Node * > &mapp)
void appendCrudeData (const std::map< INTERP_KERNEL::Node *, int > &mapp, double xBary, double yBary, double fact, int offset, std::vector< double > &addCoordsQuadratic, std::vector< int > &conn, std::vector< int > &connI) const
void buildPartitionsAbs (QuadraticPolygon &other, const std::map< INTERP_KERNEL::Node *, int > &mapp, int idThis, int idOther, int offset, std::vector< double > &addCoordsQuadratic, std::vector< int > &conn, std::vector< int > &connI, std::vector< int > &nb1, std::vector< int > &nb2)
double intersectWith (const QuadraticPolygon &other) const
double intersectWith (const QuadraticPolygon &other, double *barycenter) const
std::vector< QuadraticPolygon * > intersectMySelfWith (const QuadraticPolygon &other) const
void intersectForPerimeter (const QuadraticPolygon &other, double &perimeterThisPart, double &perimeterOtherPart, double &perimeterCommonPart) const
void intersectForPerimeterAdvanced (const QuadraticPolygon &other, std::vector< double > &polThis, std::vector< double > &polOther) const
void intersectForPoint (const QuadraticPolygon &other, std::vector< int > &numberOfCreatedPointsPerEdge) const
void performLocatingOperation (QuadraticPolygon &pol2) const
std::vector< QuadraticPolygon * > buildIntersectionPolygons (const QuadraticPolygon &pol1, const QuadraticPolygon &pol2) const
bool amIAChanceToBeCompletedBy (const QuadraticPolygon &pol1Splitted, const QuadraticPolygon &pol2NotSplitted, bool &direction)
- Public Member Functions inherited from INTERP_KERNEL::ComposedEdge
 ComposedEdge ()
 ComposedEdge (const ComposedEdge &other)
 ComposedEdge (int sz)
void reverse ()
int recursiveSize () const
bool presenceOfOn () const
bool presenceOfQuadraticEdge () const
void initLocations () const
ComposedEdgeclone () const
bool isNodeIn (Node *n) const
double getArea () const
double getPerimeter () const
double getHydraulicDiameter () const
void getBarycenter (double *bary) const
void getBarycenterGeneral (double *bary) const
double normalize (ComposedEdge *other, double &xBary, double &yBary)
double normalizeExt (ComposedEdge *other, double &xBary, double &yBary)
void unApplyGlobalSimilarityExt (ComposedEdge &other, double xBary, double yBary, double fact)
void fillBounds (Bounds &output) const
void applySimilarity (double xBary, double yBary, double dimChar)
void applyGlobalSimilarity (double xBary, double yBary, double dimChar)
void applyGlobalSimilarity2 (ComposedEdge *other, double xBary, double yBary, double dimChar)
void dispatchPerimeter (double &partConsidered) const
void dispatchPerimeterExcl (double &partConsidered, double &commonPart) const
double dispatchPerimeterAdv (const ComposedEdge &father, std::vector< double > &result) const
void getAllNodes (std::set< Node * > &output) const
void getBarycenter (double *bary, double &weigh) const
bool completed () const
void setValueAt (int i, Edge *e, bool direction=true)
double getCommonLengthWith (const ComposedEdge &other) const
void clear ()
bool empty () const
ElementaryEdgefront () const
ElementaryEdgeback () const
void resize (int i)
void pushBack (Edge *edge, bool direction=true)
void pushBack (ElementaryEdge *elem)
void pushBack (ComposedEdge *elem)
int size () const
ElementaryEdgeoperator[] (int i) const
NodegetEndNode () const
NodegetStartNode () const
bool changeEndNodeWith (Node *node) const
bool changeStartNodeWith (Node *node) const
bool isInOrOut (Node *nodeToTest) const
bool getDirection () const
bool intresincEqCoarse (const Edge *other) const

Static Public Member Functions

static QuadraticPolygonBuildLinearPolygon (std::vector< Node * > &nodes)
static QuadraticPolygonBuildArcCirclePolygon (std::vector< Node * > &nodes)
static void BuildDbgFile (const std::vector< Node * > &nodes, const char *fileName)
static void SplitPolygonsEachOther (QuadraticPolygon &pol1, QuadraticPolygon &pol2, int &nbOfSplits)
- Static Public Member Functions inherited from INTERP_KERNEL::ComposedEdge
static void Delete (ComposedEdge *pt)
static void SoftDelete (ComposedEdge *pt)

Protected Member Functions

std::list< QuadraticPolygon * > zipConsecutiveInSegments () const
void dumpInXfigFile (std::ostream &stream, int resolution, const Bounds &box) const
void closePolygons (std::list< QuadraticPolygon * > &pol2Zip, const QuadraticPolygon &pol1, std::vector< QuadraticPolygon * > &results) const
std::list< QuadraticPolygon * >
::iterator 
fillAsMuchAsPossibleWith (const QuadraticPolygon &pol1Splitted, std::list< QuadraticPolygon * >::iterator iStart, std::list< QuadraticPolygon * >::iterator iEnd, bool direction)
- Protected Member Functions inherited from INTERP_KERNEL::ComposedEdge
 ~ComposedEdge ()

Static Protected Member Functions

template<class EDGES >
static void UpdateNeighbours (const MergePoints &merger, IteratorOnComposedEdge it1, IteratorOnComposedEdge it2, const EDGES *e1, const EDGES *e2)
static std::list
< QuadraticPolygon * >
::iterator 
CheckInList (Node *n, std::list< QuadraticPolygon * >::iterator iStart, std::list< QuadraticPolygon * >::iterator iEnd)

Additional Inherited Members

- Protected Attributes inherited from INTERP_KERNEL::ComposedEdge
std::list< ElementaryEdge * > _sub_edges

Constructor & Destructor Documentation

INTERP_KERNEL::QuadraticPolygon::QuadraticPolygon ( )
INTERP_KERNEL::QuadraticPolygon::QuadraticPolygon ( const QuadraticPolygon other)
QuadraticPolygon::QuadraticPolygon ( const char *  fileName)
QuadraticPolygon::~QuadraticPolygon ( )

Member Function Documentation

QuadraticPolygon * QuadraticPolygon::BuildLinearPolygon ( std::vector< Node * > &  nodes)
static
QuadraticPolygon * QuadraticPolygon::BuildArcCirclePolygon ( std::vector< Node * > &  nodes)
static
void QuadraticPolygon::BuildDbgFile ( const std::vector< Node * > &  nodes,
const char *  fileName 
)
static
void QuadraticPolygon::closeMe ( ) const
void QuadraticPolygon::circularPermute ( )
bool QuadraticPolygon::isButterflyAbs ( )
bool QuadraticPolygon::isButterfly ( ) const
void QuadraticPolygon::dumpInXfigFile ( const char *  fileName) const
void QuadraticPolygon::dumpInXfigFileWithOther ( const ComposedEdge other,
const char *  fileName 
) const
double QuadraticPolygon::intersectWithAbs ( QuadraticPolygon other)

Before intersecting as intersectWith a normalization is done.

Warning contrary to intersectWith method this method is NOT const. 'this' and 'other' are modified after call of this method.

References intersectMySelfWith(), and INTERP_KERNEL::ComposedEdge::normalize().

double QuadraticPolygon::intersectWithAbs1D ( QuadraticPolygon other,
bool &  isColinear 
)

Warning This method is NOT const. 'this' and 'other' are modified after call of this method. 'other' is a QuadraticPolygon of non closed edges.

References INTERP_KERNEL::ComposedEdge::_sub_edges, INTERP_KERNEL::FULL_IN_1, INTERP_KERNEL::FULL_ON_1, INTERP_KERNEL::ComposedEdge::normalize(), performLocatingOperation(), and SplitPolygonsEachOther().

double QuadraticPolygon::intersectWithAbs ( QuadraticPolygon other,
double *  barycenter 
)

Before intersecting as intersectWith a normalization is done.

Warning contrary to intersectWith method this method is NOT const. 'this' and 'other' are modified after call of this method.

References intersectMySelfWith(), and INTERP_KERNEL::ComposedEdge::normalize().

void QuadraticPolygon::splitAbs ( QuadraticPolygon other,
const std::map< INTERP_KERNEL::Node *, int > &  mapThis,
const std::map< INTERP_KERNEL::Node *, int > &  mapOther,
int  offset1,
int  offset2,
const std::vector< int > &  otherEdgeIds,
std::vector< int > &  edgesThis,
int  cellIdThis,
std::vector< std::vector< int > > &  edgesInOtherColinearWithThis,
std::vector< std::vector< int > > &  subDivOther,
std::vector< double > &  addCoo 
)

This method splits 'this' with 'other' into smaller pieces localizable. 'mapThis' is a map that gives the correspondance between nodes contained in 'this' and node ids in a global mesh. In the same way, 'mapOther' gives the correspondance between nodes contained in 'other' and node ids in a global mesh from wich 'other' is extracted. This method has 1 out paramater : 'edgesThis', After the call of this method contains nodal connectivity (including type) of 'this' into globlal "this mesh". This method has 2 in/out parameters : 'subDivOther' and 'addCoo'.'otherEdgeIds' is useful to put values in 'edgesThis', 'subDivOther' and 'addCoo'. Size of 'otherEdgeIds' has to be equal to number of ElementaryEdges in 'other'. No check of that will be done.

Parameters
offset1is the number of nodes contained in global mesh from which 'this' is extracted.
offset2is the sum of nodes contained in global mesh from which 'this' is extracted and 'other' is extracted.
edgesInOtherColinearWithThiswill be appended at the end of the vector with colinear edge ids of other (if any) is a vector with the same size than other before calling this method. It gives in the same order the cell id in global other mesh.

References INTERP_KERNEL::ComposedEdge::_sub_edges, INTERP_KERNEL::MergePoints::clear(), INTERP_KERNEL::ComposedEdge::ComposedEdge(), INTERP_KERNEL::IteratorOnComposedEdge::current(), INTERP_KERNEL::ComposedEdge::Delete(), INTERP_KERNEL::IteratorOnComposedEdge::finished(), INTERP_KERNEL::IteratorOnComposedEdge::first(), INTERP_KERNEL::ElementaryEdge::getDirection(), INTERP_KERNEL::ElementaryEdge::getIterator(), INTERP_KERNEL::ElementaryEdge::getPtr(), INTERP_KERNEL::Edge::incrRef(), INTERP_KERNEL::IteratorOnComposedEdge::insertElemEdges(), INTERP_KERNEL::Edge::intersectWith(), INTERP_KERNEL::ElementaryEdge::isThereStartPoint(), INTERP_KERNEL::IteratorOnComposedEdge::next(), INTERP_KERNEL::ComposedEdge::normalizeExt(), INTERP_KERNEL::ComposedEdge::presenceOfOn(), INTERP_KERNEL::ComposedEdge::pushBack(), INTERP_KERNEL::ComposedEdge::reverse(), INTERP_KERNEL::ComposedEdge::SoftDelete(), and UpdateNeighbours().

void QuadraticPolygon::buildFromCrudeDataArray ( const std::map< int, INTERP_KERNEL::Node * > &  mapp,
bool  isQuad,
const int *  nodalBg,
const double *  coords,
const int *  descBg,
const int *  descEnd,
const std::vector< std::vector< int > > &  intersectEdges 
)

This method builds from descending conn of a quadratic polygon stored in crude mode (MEDCoupling). Descending conn is in FORTRAN relative mode in order to give the orientation of edge.

References appendEdgeFromCrudeDataArray().

void QuadraticPolygon::buildFromCrudeDataArray2 ( const std::map< int, INTERP_KERNEL::Node * > &  mapp,
bool  isQuad,
const int *  nodalBg,
const double *  coords,
const int *  descBg,
const int *  descEnd,
const std::vector< std::vector< int > > &  intersectEdges,
const INTERP_KERNEL::QuadraticPolygon pol1,
const int *  descBg1,
const int *  descEnd1,
const std::vector< std::vector< int > > &  intersectEdges1,
const std::vector< std::vector< int > > &  colinear1 
)

This method builds from descending conn of a quadratic polygon stored in crude mode (MEDCoupling). Descending conn is in FORTRAN relative mode in order to give the orientation of edge.

References appendEdgeFromCrudeDataArray(), INTERP_KERNEL::ElementaryEdge::BuildEdgeFromCrudeDataArray(), INTERP_KERNEL::ElementaryEdge::getPtr(), INTERP_KERNEL::Edge::incrRef(), and INTERP_KERNEL::ComposedEdge::pushBack().

void QuadraticPolygon::appendEdgeFromCrudeDataArray ( std::size_t  edgeId,
const std::map< int, INTERP_KERNEL::Node * > &  mapp,
bool  isQuad,
const int *  nodalBg,
const double *  coords,
const int *  descBg,
const int *  descEnd,
const std::vector< std::vector< int > > &  intersectEdges 
)
void QuadraticPolygon::appendSubEdgeFromCrudeDataArray ( Edge baseEdge,
std::size_t  j,
bool  direct,
int  edgeId,
const std::vector< int > &  subEdge,
const std::map< int, INTERP_KERNEL::Node * > &  mapp 
)
void QuadraticPolygon::appendCrudeData ( const std::map< INTERP_KERNEL::Node *, int > &  mapp,
double  xBary,
double  yBary,
double  fact,
int  offset,
std::vector< double > &  addCoordsQuadratic,
std::vector< int > &  conn,
std::vector< int > &  connI 
) const
void QuadraticPolygon::buildPartitionsAbs ( QuadraticPolygon other,
const std::map< INTERP_KERNEL::Node *, int > &  mapp,
int  idThis,
int  idOther,
int  offset,
std::vector< double > &  addCoordsQuadratic,
std::vector< int > &  conn,
std::vector< int > &  connI,
std::vector< int > &  nbThis,
std::vector< int > &  nbOther 
)

This method make the hypothesis that 'this' and 'other' are splited at the minimum into edges that are fully IN, OUT or ON. This method returns newly created polygons in 'conn' and 'connI' and the corresponding ids ('idThis','idOther') are stored respectively into 'nbThis' and 'nbOther'.

References buildIntersectionPolygons(), INTERP_KERNEL::ComposedEdge::normalizeExt(), performLocatingOperation(), and INTERP_KERNEL::ComposedEdge::unApplyGlobalSimilarityExt().

double QuadraticPolygon::intersectWith ( const QuadraticPolygon other) const

WARNING this method is const and other is const too. BUT location of Edges in 'this' and 'other' are nevertheless modified. This is possible because loc attribute in Edge class is mutable. This implies that if 'this' or/and 'other' are reused for intersect* method initLocations has to be called on each of this/them.

References intersectMySelfWith().

double QuadraticPolygon::intersectWith ( const QuadraticPolygon other,
double *  barycenter 
) const

WARNING this method is const and other is const too. BUT location of Edges in 'this' and 'other' are nevertheless modified. This is possible because loc attribute in Edge class is mutable. This implies that if 'this' or/and 'other' are reused for intersect* method initLocations has to be called on each of this/them.

References intersectMySelfWith().

std::vector< QuadraticPolygon * > QuadraticPolygon::intersectMySelfWith ( const QuadraticPolygon other) const

WARNING this method is const and other is const too. BUT location of Edges in 'this' and 'other' are nevertheless modified. This is possible because loc attribute in Edge class is mutable. This implies that if 'this' or/and 'other' are reused for intersect* method initLocations has to be called on each of this/them.

References buildIntersectionPolygons(), performLocatingOperation(), and SplitPolygonsEachOther().

Referenced by intersectWith(), and intersectWithAbs().

void QuadraticPolygon::intersectForPerimeter ( const QuadraticPolygon other,
double &  perimeterThisPart,
double &  perimeterOtherPart,
double &  perimeterCommonPart 
) const

WARNING this method is const and other is const too. BUT location of Edges in 'this' and 'other' are nevertheless modified. This is possible because loc attribute in Edge class is mutable. This implies that if 'this' or/and 'other' are reused for intersect* method initLocations has to be called on each of this/them.

References INTERP_KERNEL::ComposedEdge::dispatchPerimeterExcl(), performLocatingOperation(), and SplitPolygonsEachOther().

void QuadraticPolygon::intersectForPerimeterAdvanced ( const QuadraticPolygon other,
std::vector< double > &  polThis,
std::vector< double > &  polOther 
) const

WARNING this method is const and other is const too. BUT location of Edges in 'this' and 'other' are nevertheless modified. This is possible because loc attribute in Edge class is mutable. This implies that if 'this' or/and 'other' are reused for intersect* method initLocations has to be called on each of this/them.

polThis.size()==this->size() and polOther.size()==other.size(). For each ElementaryEdge of 'this', the corresponding contribution in resulting polygon is in 'polThis'. For each ElementaryEdge of 'other', the corresponding contribution in resulting polygon is in 'polOther'. As consequence common part are counted twice (in polThis and in polOther).

References INTERP_KERNEL::ElementaryEdge::clone(), INTERP_KERNEL::IteratorOnComposedEdge::current(), INTERP_KERNEL::ComposedEdge::dispatchPerimeter(), INTERP_KERNEL::IteratorOnComposedEdge::finished(), INTERP_KERNEL::IteratorOnComposedEdge::first(), INTERP_KERNEL::IteratorOnComposedEdge::next(), performLocatingOperation(), INTERP_KERNEL::ComposedEdge::pushBack(), INTERP_KERNEL::ComposedEdge::size(), and SplitPolygonsEachOther().

void QuadraticPolygon::intersectForPoint ( const QuadraticPolygon other,
std::vector< int > &  numberOfCreatedPointsPerEdge 
) const

numberOfCreatedPointsPerEdge is resized to the number of edges of 'this'. This method returns in ordered maner the number of newly created points per edge. This method performs a split process between 'this' and 'other' that gives the result PThis. Then for each edges of 'this' this method counts how many edges in Pthis have the same id.

References INTERP_KERNEL::ElementaryEdge::clone(), INTERP_KERNEL::IteratorOnComposedEdge::current(), INTERP_KERNEL::IteratorOnComposedEdge::finished(), INTERP_KERNEL::IteratorOnComposedEdge::first(), INTERP_KERNEL::IteratorOnComposedEdge::next(), INTERP_KERNEL::ComposedEdge::pushBack(), INTERP_KERNEL::ComposedEdge::recursiveSize(), INTERP_KERNEL::ComposedEdge::size(), and SplitPolygonsEachOther().

void QuadraticPolygon::performLocatingOperation ( QuadraticPolygon pol2) const
void QuadraticPolygon::SplitPolygonsEachOther ( QuadraticPolygon pol1,
QuadraticPolygon pol2,
int &  nbOfSplits 
)
static
std::vector< QuadraticPolygon * > QuadraticPolygon::buildIntersectionPolygons ( const QuadraticPolygon pol1,
const QuadraticPolygon pol2 
) const

Given 2 polygons 'pol1' and 'pol2' (localized) the resulting polygons are returned.

this : pol2 simplified.

Parameters
pol1pol1 split.
pol2pol2 split.

References closePolygons(), INTERP_KERNEL::FULL_IN_1, INTERP_KERNEL::FULL_ON_1, INTERP_KERNEL::ElementaryEdge::locateFullyMySelf(), QuadraticPolygon(), and zipConsecutiveInSegments().

Referenced by buildPartitionsAbs(), and intersectMySelfWith().

bool QuadraticPolygon::amIAChanceToBeCompletedBy ( const QuadraticPolygon pol1Splitted,
const QuadraticPolygon pol2NotSplitted,
bool &  direction 
)
std::list< QuadraticPolygon * > QuadraticPolygon::zipConsecutiveInSegments ( ) const
protected
void QuadraticPolygon::dumpInXfigFile ( std::ostream &  stream,
int  resolution,
const Bounds &  box 
) const
protected

Reimplemented from INTERP_KERNEL::ComposedEdge.

References dumpInXfigFile().

void QuadraticPolygon::closePolygons ( std::list< QuadraticPolygon * > &  pol2Zip,
const QuadraticPolygon pol1,
std::vector< QuadraticPolygon * > &  results 
) const
protected

'this' should be considered as pol2Simplified.

Parameters
pol2zipis a list of set of edges (openned polygon) coming from split polygon 2.
pol1is split pol1.
resultsthe resulting CLOSED polygons.

References INTERP_KERNEL::ComposedEdge::SoftDelete().

Referenced by buildIntersectionPolygons().

template<class EDGES >
void INTERP_KERNEL::QuadraticPolygon::UpdateNeighbours ( const MergePoints merger,
IteratorOnComposedEdge  it1,
IteratorOnComposedEdge  it2,
const EDGES *  e1,
const EDGES *  e2 
)
staticprotected
std::list< QuadraticPolygon * >::iterator QuadraticPolygon::fillAsMuchAsPossibleWith ( const QuadraticPolygon pol1Splitted,
std::list< QuadraticPolygon * >::iterator  iStart,
std::list< QuadraticPolygon * >::iterator  iEnd,
bool  direction 
)
protected
std::list< QuadraticPolygon * >::iterator QuadraticPolygon::CheckInList ( Node n,
std::list< QuadraticPolygon * >::iterator  iStart,
std::list< QuadraticPolygon * >::iterator  iEnd 
)
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