23#ifndef __FM_IMP_PROFILE2D_BOOL_H__
24#define __FM_IMP_PROFILE2D_BOOL_H__
98 inline const T&
min(
const T&
x,
const T&
y)
100 return (
x<=
y ?
x :
y );
105 inline const T&
max(
const T&
x,
const T&
y)
107 return (
x>=
y ?
x :
y );
134 inline const std::vector< Edge* >&
getEdges()
const {
return m_vecEdges; };
143 std::vector< std::pair< double, Node * > > m_vecNodes;
146 std::vector< Edge* > m_vecEdges;
206 : m_ptCenter( ptC ), m_uHotID(0) { };
221 typedef std::pair< EdgeDirection, Edge * >
EdgeLink;
243 std::vector< EdgeLink > m_vecEdges;
264 inline double param(
int ePos )
const {
return m_aParams[ePos]; };
265 inline Node *
node (
int ePos )
const {
return m_aNodes[ePos]; };
339 std::vector< Edge * > m_vecEdges;
376 bool bValidateNesting =
false,
382 int& riRegularityFlags,
476 std::vector< Contour > m_vecContours;
477 std::vector< Group > m_vecGroups;
479 std::vector< Node * > m_vecNodes;
480 std::vector< Edge * > m_vecEdges;
481 std::vector< EdgeGroup * > m_vecEdgeGroups;
483 int m_iRegularityFlags;
501 void initTolerance (
const OdGeTol & gTol );
504 void resetIntermediate();
517 Result FindCrossings( std::vector< Crossing > & vecCrossings );
520 Result CreateNodes(
const std::vector< Crossing > & vecCrossings );
523 Result CreateEdges(
bool bStoreEdges =
false,
bool bStoreFirstGroupOnly =
false );
526 Result CreateEdgeGroups( );
532 Result CreateFinalContours();
537 Result GenerateFinalContour(
const std::vector<Edge*> & vecEdges,
IContour2D & rDestC2D,
bool bClosed );
549 std::vector<OdUInt32> * pvecValid = 0,
550 std::vector<Result> * pvecResults = 0,
void swap(Profile2D &rAnother)
void addNode(Node *pNode, double dParam)
const std::vector< Edge * > & getEdges() const
Locations getLocation(const OdGePoint2d &ptTest, const OdGeTol gTol) const
Contour(const IContour2D &rC, OdUInt32 uCID, OdUInt32 uGID, bool bReversed=false, bool bForceCopy=false)
const IContour2D & contour2D() const
Result createEdges(Intersector &rAI, bool bStoreEdges=false)
EdgeGroup(Edge *pFirstEdge, Edge *pSecondEdge=0)
EdgeGroup & setFlags(OdUInt32 uFlags, OdUInt32 uUnsetFirst=0)
EdgeGroup & merge(EdgeGroup *pGroup2)
EdgeGroup & addEdge(Edge *pEdge)
const OdGePoint2d & middlePoint() const
Edge * edge(OdUInt32 iIndex)
double tangentAt(int ePos, double dStep) const
const Contour & contour() const
OdUInt32 getFlag(OdUInt32 uFlag) const
OdUInt32 regionId() const
Edge * getNextFinalRegional(bool bContoursCCW=true) const
Edge(const Contour &rC, double dStartP, double dEndP)
static EdgeGroup * GroupEdges(Intersector &rAI, Edge &rEdgeA, Edge &rEdgeB, bool bCoDirectional)
Edge * getNextFinalLinear(bool bStopAtJunctions=false) const
Edge * getPrevFinalRegional(bool bContoursCCW=true) const
const OdGePoint2d & middlePoint() const
Node * anotherNode(int ePos) const
Edge & setNode(OdUInt32 ePos, Node *pNode, OdUInt32 iIndex)
OdUInt32 setFlag(OdUInt32 uFlag)
static bool areCoincident(const Edge &rEdgeA, const Edge &rEdgeB, bool *pbCoDirectional=0, const OdGeTol &gTol=FMGeGbl::gTol)
OdUInt32 unsetFlag(OdUInt32 uFlag)
Node * node(int ePos) const
OdUInt32 indexInNode(int ePos) const
EdgeGroup * edgeGroup() const
double param(int ePos) const
Edge & setEdgeGroup(EdgeGroup *pGroup, OdUInt32 iIndex)
OdUInt32 firstIdx() const
Group(Intersector &rAI, GroupTypes eT, OdUInt32 uPri, OdUInt32 uFirst=0, OdUInt32 uSize=0)
const IContour2D & contour(OdUInt32 uIndex) const
void resize(OdUInt32 uNewSize)
Intersector & intersector() const
OdUInt32 priority() const
Locations getLocation(const OdGePoint2d &ptTest, const OdGeTol gTol) const
virtual Result CheckFinality(EdgeGroup &) const =0
virtual Result CheckFinality(Edge &) const =0
static IEdgeChecker * Create(OperationsExt eOp, Intersector &rAI)
void reserve(OdUInt32 uGroups, OdUInt32 uContours)
const OdGeTol & getPairTol() const
Result TestRegularity(const Profile2D &rSource, int &riRegularityFlags, int iInterestingFlags=erfAllFlags, InfinityLocation eIL=eilByBiggestArea, const OdGeTol &gTol=FMGeGbl::gTol)
const Profile2D & getResult() const
OdUInt32 numGroups() const
Node * addNode(Node *pNode)
const Group & getGroup(OdUInt32 uGroupIdx) const
Result evaluateFlags(const IFlagSetter &rFlagSetter)
Result Regularize(const Profile2D &rSource, Profile2D &rDest, bool bValidateNesting=false, InfinityLocation eIL=eilOutside, const OdGeTol &gTol=FMGeGbl::gTol)
Result evaluate(OperationsExt eOp)
EdgeGroup * addEdgeGroup(EdgeGroup *pEdgeGroup)
OdUInt32 getGroupIdxByPriority(OdUInt32 iIdx) const
static bool TryFastPerformOperation(BooleanOperation eType, const Profile2D &rArg1, const Profile2D &rArg2, Profile2D &rResult)
const Contour & getContour(OdUInt32 uContourID) const
void moveResultTo(Profile2D &rDest)
const OdGeTol & getExportTol() const
const IEdgeChecker & getChecker() const
Result addContour(OdUInt32 uGroup, const IContour2D &rContour, bool bReversed=false, bool bForceCopy=false)
void reset(const OdGeTol &gTol=FMGeGbl::gTol)
void setRegularityFlags(int iFlags)
Result addProfile(OdUInt32 uGroup, const Profile2D &rProfile, bool bReversed=false, bool bForceCopy=false)
OdUInt32 numContours() const
const OdGeTol & getTol() const
Result PerformOperation(BooleanOperation eType, const Profile2D &rArg1, const Profile2D &rArg2, Profile2D &rResult, const OdGeTol &gTol=FMGeGbl::gTol)
const OdGeTol & getMergeTol() const
OdUInt32 addGroup(Group::GroupTypes eT, OdUInt32 uPriority=0, OdUInt32 uReservedSize=0)
Edge * addEdge(Edge *pEdge)
const EdgeLink & edgeLink(OdUInt32 iIndex) const
OdUInt32 getHotID() const
OdUInt32 setHotID(OdUInt32 uID)
Node(const OdGePoint2d &ptC)
void addEdge(int eDir, Edge *pEdge)
void reverseFinalEdge(OdUInt32 iIndex)
Edge * findFinalRegionalNeighbour(const Edge *pEdge, EdgeDirection eEdgeDir, EdgeDirection eNeighbourDir, bool bCCW=false) const
void createEdgeGroups(Intersector &rAI)
OdUInt32 edgeCount() const
void updateFinalEdges(bool bReorderByAngle, double dTgStep)
Edge * findFinalEdge(EdgeDirection eEdgeDir) const
std::pair< EdgeDirection, Edge * > EdgeLink
const T & min(const T &x, const T &y)
const T & max(const T &x, const T &y)
static FMGEOMETRY_API_STATIC OdGeTol gTol