CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
FMMdlFace.h
Go to the documentation of this file.
1
2// Copyright (C) 2002-2022, 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-2022 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_FACE_H__
25#define __FMMDL_FACE_H__
26
27#include "Modeler/FMMdlEntity.h"
28#include "FMProfile3D.h"
29
30namespace FacetModeler
31{
33 const OdUInt32 VFF = FLAG(0);
35 const OdUInt32 OFF = FLAG(1);
38
42 class FMGEOMETRY_API Face : public Entity
43 {
44 public:
49
55 Face* next() const;
56
62 void setNext(Face* pNext);
63
69 Face* prev() const;
70
76 void setPrev(Face* pPrev);
77
83 void addNext(Face* pNext);
84
91 void set(Face* pPrev, Face* pNext);
92
98 const OdGePlane& plane() const;
99
106
115 bool isConvex() const;
116
122 bool hasHoles() const;
123
130
137
144 OdUInt32 loopEdgeCount(OdUInt32 iLoopIndex = 0) const;
145
155 Edge* edge(OdUInt32 nLoop = 0) const;
156
165 Edge* addEdge(OdUInt32 nLoop, FacetModeler::Vertex* pVertex, bool bInverseOrder = false);
166
173 OdUInt32 findLoop(const Edge* pEdge) const;
174
180 double area() const;
181
185 void deletePlane() const;
186
191
196
200 void negate();
201
209 void profile(Profile3D& rResult, const OdGePlane* pPlane = NULL, bool bIncludeHoles = true) const;
210
219 void projection(const OdGePlane& plane, Profile2D& result, bool bIncludeHoles = true, OdArray<const Edge*>* pSourceEdges = NULL) const;
220
227
233 void setOrientation(FaceOrientation eOrientation);
234
246 bool intersectLine(const OdGeLinearEnt3d& gLine, OdGePoint3d* pptResult = NULL, bool* pbCoplanar = NULL) const;
247
253 Surface* surface() const { return m_pSurface; }
254
260 void setSurface(Surface* surface);
261
267 OdUInt32 color() const { return m_iColor; }
268
274 void setColor(const OdUInt32 color) { m_iColor = color; }
275
279 struct EdgeLoop
280 {
281
286 {
287 m_pFace = NULL;
288 m_pFirstEdge = NULL;
289 m_pNextLoop = NULL;
290 }
291
304
308 void zero()
309 {
310 m_pNextLoop = NULL;
311 m_pFirstEdge = NULL;
312 m_pFace = NULL;
313 }
314 };
315
321 void setEdgeLoop(EdgeLoop eloop) { m_Loops = eloop; };
322
329 EdgeLoop* loop(OdUInt32 nLoop) const;
330
335
336 protected:
342 Face(const Face& face);
343
351 Face& operator=(const Face& face);
352
353 private:
361 Face* clone(Body& to) const;
362
366 void clear();
367
371 void evaluatePlane() const;
372
378 void validate(bool bTestPartners = false) const;
379
383 void nullLoopEdgesRefs();
384
393 EdgeLoop* insertLoop(OdUInt32 nIndex, Edge* pFirstEdge = NULL);
394
395 Face* m_pPrev; // Previous face pointer.
396 Face* m_pNext; // Next face pointer.
397 EdgeLoop m_Loops; // Loops list.
398 Surface* m_pSurface; // Surface pointer.
399 OdUInt32 m_iColor; // Color data.
400 mutable OdGePlane* m_Plane; // Calculated plane.
401
402 //DOM-IGNORE-BEGIN
403 friend class Edge;
404 friend class Body;
405 friend class BodyImpl;
406 friend class BodyCustom;
407 friend class BodyInternalConsistencyRestorer;
408 //DOM-IGNORE-END
409 };
410
413
414}
415
416#endif //__FMMDL_FACE_H__
#define FMGEOMETRY_API
unsigned int OdUInt32
void projection(const OdGePlane &plane, Profile2D &result, bool bIncludeHoles=true, OdArray< const Edge * > *pSourceEdges=NULL) const
bool isConvex() const
Face(const Face &face)
OdUInt32 color() const
Definition: FMMdlFace.h:267
void setNext(Face *pNext)
double area() const
OdUInt32 loopEdgeCount(OdUInt32 iLoopIndex=0) const
Surface * surface() const
Definition: FMMdlFace.h:253
void setColor(const OdUInt32 color)
Definition: FMMdlFace.h:274
void setEdgeLoop(EdgeLoop eloop)
Definition: FMMdlFace.h:321
void setPrev(Face *pPrev)
bool hasHoles() const
void deletePlane() const
OdGeVector3d normal() const
FaceOrientation orientation() const
void profile(Profile3D &rResult, const OdGePlane *pPlane=NULL, bool bIncludeHoles=true) const
Face * next() const
void setOrientation(FaceOrientation eOrientation)
void set(Face *pPrev, Face *pNext)
OdUInt32 findLoop(const Edge *pEdge) const
void setSurface(Surface *surface)
void addNext(Face *pNext)
EdgeLoop * loop(OdUInt32 nLoop) const
OdUInt32 loopCount() const
Edge * addEdge(OdUInt32 nLoop, FacetModeler::Vertex *pVertex, bool bInverseOrder=false)
void setLoopCount(OdUInt32 n)
const OdGePlane & plane() const
Face & operator=(const Face &face)
bool intersectLine(const OdGeLinearEnt3d &gLine, OdGePoint3d *pptResult=NULL, bool *pbCoplanar=NULL) const
Face * prev() const
Edge * edge(OdUInt32 nLoop=0) const
OdUInt32 FLAG(OdUInt32 i)
Definition: FMMdlEntity.h:38
const OdUInt32 SKIP_HATCH
Definition: FMMdlFace.h:37
OdArray< const Face *, OdMemoryAllocator< const Face * > > FaceConstPtrArray
Definition: FMMdlFace.h:412
const OdUInt32 OFF
Definition: FMMdlFace.h:35
const OdUInt32 VFF
Definition: FMMdlFace.h:33