Public Member Functions | |
QuadraticPolygon () | |
QuadraticPolygon (const QuadraticPolygon &other) | |
QuadraticPolygon (const char *fileName) | |
~QuadraticPolygon () | |
void | closeMe () const |
void | circularPermute () |
void | dumpInXfigFile (const char *fileName) const |
void | dumpInXfigFileWithOther (const ComposedEdge &other, const char *fileName) const |
double | intersectWithAbs (QuadraticPolygon &other) |
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) |
Static Public Member Functions | |
static QuadraticPolygon * | buildLinearPolygon (std::vector< Node * > &nodes) |
static QuadraticPolygon * | buildArcCirclePolygon (std::vector< Node * > &nodes) |
static void | buildDbgFile (const std::vector< Node * > &nodes, const char *fileName) |
static void | splitPolygonsEachOther (QuadraticPolygon &pol1, QuadraticPolygon &pol2, int &nbOfSplits) |
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) |
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) |
INTERP_KERNEL::QuadraticPolygon::QuadraticPolygon | ( | ) |
Referenced by buildIntersectionPolygons().
INTERP_KERNEL::QuadraticPolygon::QuadraticPolygon | ( | const QuadraticPolygon & | other | ) |
QuadraticPolygon::QuadraticPolygon | ( | const char * | fileName | ) |
References INTERP_KERNEL::ComposedEdge::back(), INTERP_KERNEL::Edge::buildFromXfigLine(), INTERP_KERNEL::ElementaryEdge::changeStartNodeWith(), INTERP_KERNEL::Edge::changeStartNodeWith(), INTERP_KERNEL::ComposedEdge::empty(), INTERP_KERNEL::ComposedEdge::front(), INTERP_KERNEL::ComposedEdge::getEndNode(), INTERP_KERNEL::MAX_SIZE_OF_LINE_XFIG_FILE, and INTERP_KERNEL::ComposedEdge::pushBack().
QuadraticPolygon::~QuadraticPolygon | ( | ) |
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 | ( | ) |
References INTERP_KERNEL::ComposedEdge::_sub_edges.
void QuadraticPolygon::dumpInXfigFile | ( | const char * | fileName | ) | const |
References INTERP_KERNEL::ComposedEdge::fillBounds().
Referenced by dumpInXfigFile(), and dumpInXfigFileWithOther().
void QuadraticPolygon::dumpInXfigFileWithOther | ( | const ComposedEdge & | other, | |
const char * | fileName | |||
) | const |
References dumpInXfigFile(), and INTERP_KERNEL::ComposedEdge::fillBounds().
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::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 |
References INTERP_KERNEL::IteratorOnComposedEdge::current(), INTERP_KERNEL::IteratorOnComposedEdge::finished(), INTERP_KERNEL::IteratorOnComposedEdge::first(), INTERP_KERNEL::FULL_ON_1, INTERP_KERNEL::ElementaryEdge::locateFullyMySelf(), and INTERP_KERNEL::IteratorOnComposedEdge::next().
Referenced by intersectForPerimeter(), intersectForPerimeterAdvanced(), and intersectMySelfWith().
void QuadraticPolygon::splitPolygonsEachOther | ( | QuadraticPolygon & | pol1, | |
QuadraticPolygon & | pol2, | |||
int & | nbOfSplits | |||
) | [static] |
This method is typically the first step of boolean operations between pol1 and pol2. This method perform the minimal splitting so that at the end each edges constituting pol1 are fully either IN or OUT or ON.
pol1 | IN/OUT param that is equal to 'this' when called. |
References INTERP_KERNEL::MergePoints::clear(), 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::IteratorOnComposedEdge::insertElemEdges(), INTERP_KERNEL::Edge::intersectWith(), INTERP_KERNEL::ElementaryEdge::isThereStartPoint(), INTERP_KERNEL::IteratorOnComposedEdge::next(), INTERP_KERNEL::ComposedEdge::reverse(), INTERP_KERNEL::ComposedEdge::SoftDelete(), and updateNeighbours().
Referenced by intersectForPerimeter(), intersectForPerimeterAdvanced(), intersectForPoint(), and intersectMySelfWith().
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.
pol1 | pol1 split. | |
pol2 | pol2 split. |
References closePolygons(), INTERP_KERNEL::FULL_IN_1, INTERP_KERNEL::FULL_ON_1, INTERP_KERNEL::ElementaryEdge::locateFullyMySelf(), QuadraticPolygon(), and zipConsecutiveInSegments().
Referenced by intersectMySelfWith().
bool QuadraticPolygon::amIAChanceToBeCompletedBy | ( | const QuadraticPolygon & | pol1Splitted, | |
const QuadraticPolygon & | pol2NotSplitted, | |||
bool & | direction | |||
) |
'this' is expected to be set of edges (not closed) of pol2 split.
References INTERP_KERNEL::ComposedEdge::_sub_edges, INTERP_KERNEL::Edge::buildRepresentantOfMySelf(), INTERP_KERNEL::IteratorOnComposedEdge::current(), INTERP_KERNEL::Node::decrRef(), INTERP_KERNEL::IteratorOnComposedEdge::finished(), INTERP_KERNEL::IteratorOnComposedEdge::first(), INTERP_KERNEL::FULL_IN_1, INTERP_KERNEL::FULL_ON_1, INTERP_KERNEL::ComposedEdge::getEndNode(), INTERP_KERNEL::ElementaryEdge::getLoc(), INTERP_KERNEL::ElementaryEdge::getPtr(), INTERP_KERNEL::ElementaryEdge::getStartNode(), INTERP_KERNEL::ComposedEdge::isInOrOut(), INTERP_KERNEL::ElementaryEdge::locateFullyMySelfAbsolute(), INTERP_KERNEL::IteratorOnComposedEdge::next(), and INTERP_KERNEL::IteratorOnComposedEdge::previousLoop().
std::list< QuadraticPolygon * > QuadraticPolygon::zipConsecutiveInSegments | ( | ) | const [protected] |
Returns parts of potentially non closed-polygons. Each returned polygons are not mergeable. this : pol2 split and locallized.
References INTERP_KERNEL::ElementaryEdge::clone(), INTERP_KERNEL::IteratorOnComposedEdge::current(), INTERP_KERNEL::ComposedEdge::empty(), INTERP_KERNEL::FULL_OUT_1, INTERP_KERNEL::ElementaryEdge::getLoc(), INTERP_KERNEL::IteratorOnComposedEdge::goToNextInOn(), INTERP_KERNEL::IteratorOnComposedEdge::nextLoop(), INTERP_KERNEL::ComposedEdge::pushBack(), and INTERP_KERNEL::ComposedEdge::recursiveSize().
Referenced by buildIntersectionPolygons().
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.
pol2zip | is a list of set of edges (openned polygon) coming from split polygon 2. | |
pol1 | is split pol1. | |
results | the resulting CLOSED polygons. |
References INTERP_KERNEL::ComposedEdge::SoftDelete().
Referenced by buildIntersectionPolygons().
void INTERP_KERNEL::QuadraticPolygon::updateNeighbours | ( | const MergePoints & | merger, | |
IteratorOnComposedEdge | it1, | |||
IteratorOnComposedEdge | it2, | |||
const EDGES * | e1, | |||
const EDGES * | e2 | |||
) | [static, protected] |
References INTERP_KERNEL::ElementaryEdge::changeEndNodeWith(), INTERP_KERNEL::ElementaryEdge::changeStartNodeWith(), INTERP_KERNEL::IteratorOnComposedEdge::current(), INTERP_KERNEL::IteratorOnComposedEdge::nextLoop(), and INTERP_KERNEL::IteratorOnComposedEdge::previousLoop().
Referenced by splitPolygonsEachOther().
std::list< QuadraticPolygon * >::iterator QuadraticPolygon::fillAsMuchAsPossibleWith | ( | const QuadraticPolygon & | pol1Splitted, | |
std::list< QuadraticPolygon * >::iterator | iStart, | |||
std::list< QuadraticPolygon * >::iterator | iEnd, | |||
bool | direction | |||
) | [protected] |
This method fills as much as possible 'this' (part of pol2 split) with edges of 'pol1Splitted'.
References checkInList(), INTERP_KERNEL::ElementaryEdge::clone(), INTERP_KERNEL::ComposedEdge::completed(), INTERP_KERNEL::IteratorOnComposedEdge::current(), INTERP_KERNEL::IteratorOnComposedEdge::finished(), INTERP_KERNEL::IteratorOnComposedEdge::first(), INTERP_KERNEL::ElementaryEdge::getEndNode(), INTERP_KERNEL::ComposedEdge::getEndNode(), INTERP_KERNEL::ElementaryEdge::getStartNode(), INTERP_KERNEL::IteratorOnComposedEdge::next(), INTERP_KERNEL::IteratorOnComposedEdge::nextLoop(), INTERP_KERNEL::IteratorOnComposedEdge::previousLoop(), INTERP_KERNEL::ComposedEdge::pushBack(), and INTERP_KERNEL::ElementaryEdge::reverse().
std::list< QuadraticPolygon * >::iterator QuadraticPolygon::checkInList | ( | Node * | n, | |
std::list< QuadraticPolygon * >::iterator | iStart, | |||
std::list< QuadraticPolygon * >::iterator | iEnd | |||
) | [static, protected] |
Referenced by fillAsMuchAsPossibleWith().