CFx SDK Documentation
2020SP3
|
Go to the documentation of this file.
24 #ifndef AECSLICERBASEIMPL_H_INCLUDED
25 #define AECSLICERBASEIMPL_H_INCLUDED
47 template<
typename _Tv>
50 template<
typename _Td>
64 typedef _Node<_Tv> Node;
78 m_pCurrentNode = pNode;
84 m_pCurrentNode = it.m_pCurrentNode;
89 m_pCurrentNode = m_pCurrentNode->pNext;
94 m_pCurrentNode = m_pCurrentNode->pPrev;
99 return m_pCurrentNode == it.m_pCurrentNode;
104 return m_pCurrentNode != it.m_pCurrentNode;
109 return m_pCurrentNode->data;
114 return m_pCurrentNode->data;
119 return m_pCurrentNode->pNext->data;
124 return m_pCurrentNode->pPrev->data;
129 return m_pCurrentNode->data;
134 return iterator(m_pCurrentNode->pNext);
152 return m_iNodeCount == 0;
158 if(m_pFirstNode ==
NULL)
161 Node* pDeleteNode = m_pFirstNode->pNext;
162 while(pDeleteNode != m_pFirstNode)
164 pDeleteNode = pDeleteNode->pNext;
165 delete pDeleteNode->pPrev;
181 Node* pNewNode =
new Node();
182 pNewNode->data =
value;
184 if(m_pFirstNode ==
NULL)
186 m_pFirstNode = pNewNode;
187 pNewNode->pPrev = m_pFirstNode;
188 pNewNode->pNext = m_pFirstNode;
192 Node* pLastNode = m_pFirstNode->pPrev;
194 pLastNode->pNext = pNewNode;
195 m_pFirstNode->pPrev = pNewNode;
197 pNewNode->pPrev = pLastNode;
198 pNewNode->pNext = m_pFirstNode;
204 throw OdError(
OD_T(
"delete_range() parameters equal"));
206 Node* pBeginNode = beg.m_pCurrentNode;
207 Node* pEndNode = end.m_pCurrentNode;
209 if(pBeginNode->pNext == pEndNode)
214 Node* pCurrentNode = pEndNode->pPrev;
218 if(pCurrentNode == m_pFirstNode)
219 m_pFirstNode = pBeginNode;
221 pCurrentNode = pCurrentNode->pPrev;
222 delete pCurrentNode->pNext;
224 while (pCurrentNode != pBeginNode);
226 pEndNode->pPrev = pBeginNode;
227 pBeginNode->pNext = pEndNode;
233 throw OdError(
OD_T(
"begin() cannot create iterator for empty cycled list"));
235 return iterator(m_pFirstNode);
250 double mergeLineParam;
253 SegmentPoint(): mergeLineParam(0.0), ownerSegmentId(0)
259 ownerSegmentId = segmentId;
262 inline bool operator < (
const SegmentPoint& segPoint )
const
264 return mergeLineParam < segPoint.mergeLineParam;
269 struct SegmentPointLess
271 inline bool operator() (
const SegmentPoint& pt1,
const SegmentPoint& pt2 )
const
273 return pt1.mergeLineParam < pt2.mergeLineParam;
289 m_segmentsIdBase = 0;
294 OdUInt32 segmentId = MakeSegmentId();
296 m_segmentPoints.
push_back(SegmentPoint(ptStart, segmentId));
297 m_segmentPoints.
push_back(SegmentPoint(ptEnd, segmentId));
302 if(m_segmentPoints.
empty())
306 CheckIsAllSegmentsOnMergeLine(mergeLine,
tol);
309 CalculatePointsParamAlongMergeLine(mergeLine,
tol);
311 MergeSegments(pGraph,
tol);
316 m_segmentPoints.
clear();
317 m_segmentsIdBase = 0;
318 m_inSegments.
clear();
319 m_segmentTags.
clear();
325 return (m_segmentsIdBase++);
331 for(
OdUInt32 iPoint = 0; iPoint < m_segmentPoints.
size(); iPoint++)
333 const SegmentPoint& point = m_segmentPoints[iPoint];
344 for(
OdUInt32 iPoint = 0; iPoint < pointsCount; iPoint++)
346 SegmentPoint& point = m_segmentPoints[iPoint];
347 point.mergeLineParam = mergeLine.
paramOf(point.pt,
tol);
351 void SortSegmentPointsAlongMergeLine()
353 std::sort( m_segmentPoints.
begin(), m_segmentPoints.
end(), SegmentPointLess() );
358 bool IsOnSegment()
const
360 return (!m_inSegments.
empty());
374 void UpdateInSegmentsArray(
OdUInt32 currentPtSegmentId)
376 if(!m_inSegments.
contains(currentPtSegmentId))
378 m_inSegments.
append(currentPtSegmentId);
382 m_inSegments.
remove(currentPtSegmentId);
477 bool bUseReverseEdgeAtMerge,
546 void DebugDrawIntersections()
const;
551 #endif //AECSLICERBASEIMPL_H_INCLUDED
FaceConstPtrArray m_opposite
void exclude_faces(Profile2D &excludedProfile, FaceConstPtrArray &excludeFaces, OdArray< const Edge * > *pSourceEdges=NULL)
const OdGePlane & cut_plane() const
const _Tv & next_node_data()
void AddFaceEdgesAsSegmentsToEdgeGraph()
VertexHalfPlaneSign halfPlane
VtxInPlanePosCycledList::iterator FindOnSegmentStartVertex(VtxInPlanePosCycledList::iterator &itBase)
const OdGePlane * m_pCutPlane
void collect_segments(const Face *pFace)
SlicerBaseImpl::Intersection * FindIntersectionEnterInside()
SlicerBaseImpl::Intersection * FindNextDifferentIntersection(SlicerBaseImpl::Intersection *pIntBase)
bool VertexOnIntersectionLine(const VtxInPlanePosCycledList::iterator &itVtx) const
bool isOn(const OdGePlane &plane, const OdGeTol &tol=OdGeContext::gTol) const
#define ODA_ASSERT_ONCE(exp)
iterator(const iterator &it)
const _Tv & prev_node_data()
bool ExtractSegmentFromVertex(VtxInPlanePosCycledList::iterator &itBase)
void initPointExtraction()
bool IsIntersectionOnVertex(VtxInPlanePosCycledList::iterator &itVtx)
const OdGePoint3d & VertexPoint(const VtxInPlanePosCycledList::iterator &itVtx) const
bool contains(const T &value, size_type start=0) const
void MergeSegmentsAndAddToEdgeGraph()
VtxInPlanePosCycledList::iterator FindOnSegmentEndVertex(VtxInPlanePosCycledList::iterator &itBase)
VtxInPlanePosCycledList m_classifiedVertices
SlicerBaseImpl::VertexHalfPlaneSign ClassifyPointAboutIntersectionLine(const OdGePoint3d &ptToClassify)
GLint GLenum GLsizei GLsizei GLint GLsizei const void * data
void ExtractSegmentsByIntersections()
void reserveBuffers(size_t nFaces)
void AddIntersectionFromEdge(const VertexInPlanePosition &vtxData)
void FindIntersectionSegmentsWithCutPlane()
bool IsIntersectionOnEdge(VtxInPlanePosCycledList::iterator &itVtx)
void ClassifyLoopVertices(Edge *pFirstLoopEdge)
cycled_list< VertexInPlanePosition > VtxInPlanePosCycledList
void MergePairedIntersections()
void build_results(Profile2D *pResInclBndry, Profile2D *pResExclCoBndry, Profile2D *pResExclOpBndry, Profile2D *pResExclBndry, FaceConstPtrArray *pCoincidingFaces, FaceConstPtrArray *pOppositeFaces, bool bUseReverseEdgeAtMerge, OdArray< const Edge * > *sourceEdges=0)
bool operator!=(const iterator &it) const
const OdGePlane & current_face_plane() const
Intersection * m_pCurIntPt
IntersResult IntersectCutPlaneToFacePlane(const Face *f) const
size_type append(const T &value)
bool operator==(const iterator &it) const
void MergeSegmentsAndAddToEdgeGraph(const OdGeLine3d &mergeLine, SlicerBaseImpl *pGraph, const OdGeTol &tol)
void CollectIntersections()
const Face * m_pCurrentFace
Intersection * m_pEndIntPt
void ClearFaceIntersectionsData()
OdGeVector3d m_cutPlane_normal
void AddEdgeToGraph(const OdGePoint3d &ptStart, const OdGePoint3d &ptEnd, const Edge *tag=0)
OdArray< Intersection, OdMemoryAllocator< Intersection > > IntersectionArray
void exclude_opposite_faces(Profile2D &excludedProfile, FaceConstPtrArray &excludeFaces, OdArray< const Edge * > *pSourceEdges=NULL)
double paramOf(const OdGePoint3d &point, const OdGeTol &tol=OdGeContext::gTol) const
bool operator<(const OdString &s1, const OdString &s2)
const OdGeTol & tolerance() const
void PushSegment(const OdGePoint3d &ptStart, const OdGePoint3d &ptEnd, const Edge *tag=0)
OdGeLine3d m_intersectionLine
void set_cut_plane(const OdGePlane &cutPlane)
void AddIntersection(const OdGePoint3d &ptIntersection, const Edge *pEdge, int bOnIntersectionSeg=0)
void reserve(size_type reserveLength)
void CollectSegmentsOnIntersectionLine()
void AddIntersectionFromVertex(const VertexInPlanePosition &vtxData)
void push_back(const T &value)
GLsizei const GLfloat * value
bool operator<(const Intersection &intersection2) const
bool isEqualTo(const OdGePoint3d &point, const OdGeTol &tol=OdGeContext::gTol) const
IntersResult IntersectCutPlaneToCurrentFacePlane(double tol)
void push_back(const _Tv &value)
bool operator()(const Intersection &intersection1, const Intersection &intersection2) const
bool IntersectionsCoincident(const SlicerBaseImpl::Intersection *pInt1, const SlicerBaseImpl::Intersection *pInt2)
IntersectionArray m_intersections
bool extractSegment(const OdGePoint3d *&pStart, const OdGePoint3d *&pEnd, bool &bInside)
void CollectEdgeForEdgeGraph(const OdGePoint3d &ptStart, const OdGePoint3d &ptEnd, const Edge *tag=0)
void delete_range(const iterator &beg, const iterator &end)
FaceConstPtrArray m_coinciding
SegmentMerger m_segmentsMerger
void setTolerance(const OdGeTol &tol)
bool remove(const T &value, size_type start=0)