CFx SDK Documentation 2026 SP0
Loading...
Searching...
No Matches
FMMdlEdge.h
Go to the documentation of this file.
1
2// Copyright (C) 2002-2024, Open Design Alliance (the "Alliance").
3// All rights reserved.
4//
5// This software and its documentation and related materials are owned by
6// the Alliance. The software may only be incorporated into application
7// programs owned by members of the Alliance, subject to a signed
8// Membership Agreement and Supplemental Software License Agreement with the
9// Alliance. The structure and organization of this software are the valuable
10// trade secrets of the Alliance and its suppliers. The software is also
11// protected by copyright law and international treaty provisions. Application
12// programs incorporating this software must include the following statement
13// with their copyright notices:
14//
15// This application incorporates Open Design Alliance software pursuant to a license
16// agreement with Open Design Alliance.
17// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.
18// All rights reserved.
19//
20// By use of this software, its documentation or related materials, you
21// acknowledge and accept the above terms.
23
24#ifndef __FMMDL_EDGE_H__
25#define __FMMDL_EDGE_H__
26
27#include "Modeler/FMMdlVertex.h"
28#include "Modeler/FMMdlFace.h"
29
30namespace FacetModeler
31{
33 const OdUInt32 AEF = FLAG(0);
35 const OdUInt32 VEF = FLAG(1);
36
40 class FMGEOMETRY_API Edge : public Entity
41 {
42 public:
47
56 Edge(Vertex* pVertex, Face* pFace, Edge* pPrevEdge, Edge* pPartner);
57
63 Face::EdgeLoop* loop() const;
64
70 Face* face() const;
71
77 Vertex* vertex() const;
78
84 Vertex* endVertex() const;
85
91 const OdGePoint3d& startPoint() const;
92
98 const OdGePoint3d& endPoint() const;
99
105 double length() const;
106
112 OdGeVector3d vector() const;
113
119 Edge* next() const;
120
126 Edge* prev() const;
127
138 Edge* pair() const;
139
146
152 bool isPartner(const Edge* pEdge) const;
153
159 bool isManifold() const;
160
170 double angleBetweenEdges() const;
171
180 double angleBetweenFaces() const;
181
191
198
205
211 void addNext(Edge* pNext);
212
222 void set(Edge* pPrev, Edge* pNext);
223
232 void setNext(Edge* pNext);
233
242 void setPrev(Edge* pPrev);
243
244
253 void setPair(Edge* pPair);
254
263 void setVertex(Vertex* pVertex);
264
273 void setFace(Face* pFace);
274
283 void setLoop(Face::EdgeLoop* pLoop);
284
293 void setPartner(Edge* pPartner) { m_pNextPartner = pPartner; }
294
303 void addPartner(Edge* pPartner);
304
312
319
325 void setColor(OdUInt32 iColor);
326
330 void zero();
331
336
343 const OdGePoint2d& mappingCoord(bool& isInitialized) const;
344
350 void setMappingCoord(const OdGePoint2d& coord);
351
352 private:
353
357 void updatePartnerPairs();
358
364 void validate(bool bTestPartners = true) const;
365
371 void validateLoop(bool bTestPartners = true) const;
372
380 static void addEdge(Face::EdgeLoop& loop, Edge* pEdge, bool bInverseOrder);
381
385 Edge(const Edge&);
386
387
395 Edge& operator=(const Edge& edge);
396
397 Vertex* m_pVertex; // Start vertex.
398 Edge* m_pPrevEdge; // Previous edge.
399 Edge* m_pNextEdge; // Next edge.
400 Edge* m_pPairEdge; // Overlapping edge from neighboring face.
401 Edge* m_pNextPartner; // Next edge in a single-linked loop of overlapping edges.
402 Face* m_pFace; // Owner face.
403 Face::EdgeLoop* m_pLoop; // Owner loop.
404 OdUInt32 m_iColor; // Edge color.
405 OdGePoint2d m_mappingCoord; // Start vertex mapping coordinate.
406
407 //DOM-IGNORE-BEGIN
408 friend class Face;
409 friend class Body;
410 friend class BodyImpl;
411 friend class CFxFacetModelerHelper; //FELIX_CHANGE
412 //DOM-IGNORE-END
413 };
414
415 // Inline alias method for the statement: this->next()->vertex();
416 inline Vertex* Edge::endVertex() const {
417 return next()->vertex();
418 }
419
420 inline Face::EdgeLoop* Edge::loop() const {
421 return m_pLoop;
422 }
423
424 inline const OdGePoint3d& Edge::startPoint() const {
425 return vertex()->point();
426 }
427
428 inline const OdGePoint3d& Edge::endPoint() const {
429 return endVertex()->point();
430 }
431
432 inline double Edge::length() const {
433 return startPoint().distanceTo(endPoint());
434 }
435
436 inline OdGeVector3d Edge::vector() const {
437 return endPoint() - startPoint();
438 }
439
440 inline void Edge::setLoop(Face::EdgeLoop* pLoop) {
441 m_pLoop = pLoop;
442 }
443}
444
445#endif //__FMMDL_EDGE_H__
#define FMGEOMETRY_API
unsigned int OdUInt32
OdGeVector3d direction() const
void addPartner(Edge *pPartner)
OdGeVector3d vector() const
Definition FMMdlEdge.h:436
void setLoop(Face::EdgeLoop *pLoop)
Definition FMMdlEdge.h:440
void setNext(Edge *pNext)
bool isManifold() const
const OdGePoint3d & startPoint() const
Definition FMMdlEdge.h:424
void setPartner(Edge *pPartner)
Definition FMMdlEdge.h:293
const OdGePoint2d & mappingCoord(bool &isInitialized) const
double angleBetweenEdges() const
void setPair(Edge *pPair)
Edge(Vertex *pVertex, Face *pFace, Edge *pPrevEdge, Edge *pPartner)
const OdGePoint3d & endPoint() const
Definition FMMdlEdge.h:428
friend class Face
Definition FMMdlEdge.h:408
friend class CFxFacetModelerHelper
Definition FMMdlEdge.h:411
OdUInt32 color() const
friend class Body
Definition FMMdlEdge.h:409
Edge * next() const
void setMappingCoord(const OdGePoint2d &coord)
Face::EdgeLoop * loop() const
Definition FMMdlEdge.h:420
Face * face() const
OdGeVector3d normal() const
void setVertex(Vertex *pVertex)
OdGeVector3d calculateLoopNormal() const
void set(Edge *pPrev, Edge *pNext)
Vertex * endVertex() const
Definition FMMdlEdge.h:416
double length() const
Definition FMMdlEdge.h:432
Vertex * vertex() const
void setPrev(Edge *pPrev)
void setColor(OdUInt32 iColor)
bool isPartner(const Edge *pEdge) const
void setFace(Face *pFace)
friend class BodyImpl
Definition FMMdlEdge.h:410
void addNext(Edge *pNext)
Edge * nextPartner() const
Edge * pair() const
double angleBetweenFaces() const
Edge * prev() const
const OdGePoint3d & point() const
double distanceTo(const OdGePoint3d &point) const
Definition GePoint3d.h:360
GLuint GLsizei GLsizei * length
Definition gles2_ext.h:274
const OdUInt32 VEF
Definition FMMdlEdge.h:35
OdUInt32 FLAG(OdUInt32 i)
Definition FMMdlEntity.h:38
const OdUInt32 AEF
Definition FMMdlEdge.h:33