CFx SDK Documentation  2023 SP0
AECHLR.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2017, 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 Teigha(R) software pursuant to a license
16 // agreement with Open Design Alliance.
17 // Teigha(R) Copyright (C) 2002-2017 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 __AECHLR_H__
25 #define __AECHLR_H__
26 
27 #include "Geometry/AECMesh.h"
28 #include "FMContour3D.h"
29 #include "Modeler/FMMdlBody.h"
30 #include <Ge/GeLineSeg3d.h>
31 
35 namespace AECGe
36 {
37 
41 struct AECGEOMETRY_API HLRSegment
42 {
45 };
46 
50 struct AECGEOMETRY_API HLRResult
51 {
52  std::vector<HLRSegment> rVisResult;
53  std::vector<HLRSegment> rHidResult;
54 };
55 
60 class AECGEOMETRY_API HLRStorage
61 {
62  public:
70  HLRStorage( const OdGePlane& pViewPlane );
71 
79  HLRStorage( const OdGeVector3d& vViewDirection );
80 
81  public:
85  const OdGePlane& GetViewPlane() const;
86 
90  void SetViewPlane( const OdGePlane& pPlane );
91 
95  void SetViewPlane( const OdGeVector3d& vViewDirection );
96 
104  bool IsCalculateCrossLines() const;
105 
113  void SetIsCalculateCrossLines( bool bCalculate );
114 
122  bool IsClipWithPlane() const;
123 
131  void SetIsClipWithPlane( bool bClip );
132 
139  bool IsSortByMetadata() const;
140 
147  void SetIsSortByMetadata( bool bSort );
148 
155  bool IsDrawSilhouettes() const;
156 
163  void SetIsDrawSilhouettes( bool bDraw );
164 
171  bool IsClipBySegments() const;
172 
179  void SetIsClipBySegments( bool bClip );
180 
187  bool IsCalcVis() const;
188 
195  void SetIsCalcVis( bool bCalculate );
196 
203  bool IsCalcHid() const;
204 
211  void SetIsCalcHid( bool bCalculate );
212 
216  const OdGeTol& GetTolerance() const;
217 
221  void SetTolerance( const OdGeTol& rTol );
222 
223  public:
228 
232  void ReserveForFaces( OdUInt32 iSize );
233 
237  void AddSegment( const OdGeLineSeg3d& rSegment,
238  OdUInt32 iMetadata = 0 );
239 
243  void AddSegments(const FacetModeler::Body& rSource,
244  OdUInt32 iMetadata = 0 );
245 
249  void AddFace( const OdGePoint3dArray& rFace );
250 
254  void AddFaces(const FacetModeler::Body& rSource);
255 
260 
264  const OdGeLineSeg3d& GetSegment( OdUInt32 iIndex ) const;
265 
270 
275 
281 
289  void Clear();
290 
291  private:
293  HLRStorage();
294 
296  void AddCrossLines();
297 
299  void ClipWithPlane();
300 
301  private:
302  OdGePlane m_pViewPlane;
303  OdGeTol m_tTol;
304  std::vector<HLRSegment> m_aLinework;
305  //std::vector<FacetModeler::Contour3D> m_aLoops;
306  std::vector<FacetModeler::Profile3D> m_aLoops;
307  bool m_bCalculateCrossLines;
308  bool m_bClipWithPlane;
309  bool m_bSortByMetadata;
310  bool m_bDrawSilhouettes;
311  bool m_bClipBySegments;
312  bool m_bCalcVis;
313  bool m_bCalcHid;
314 
315  friend class HLR;
316 };
317 
321 class AECGEOMETRY_API HLR
322 {
323  public:
333  static void Process( const HLRStorage& rHLRStorage,
334  HLRResult& rResult );
335 
345  static void ProcessABLinework( const OdGePlane& pCutPlane,
346  const FacetModeler::Body& rBody,
347  bool bDrawSilhouettes,
348  std::vector<HLRSegment>& rAbove,
349  std::vector<HLRSegment>& rBelow );
350 };
351 
352 }
353 
354 #endif // __AECHLR_H__
unsigned int OdUInt32
static void ProcessABLinework(const OdGePlane &pCutPlane, const FacetModeler::Body &rBody, bool bDrawSilhouettes, std::vector< HLRSegment > &rAbove, std::vector< HLRSegment > &rBelow)
static void Process(const HLRStorage &rHLRStorage, HLRResult &rResult)
void SetIsClipWithPlane(bool bClip)
HLRStorage(const OdGeVector3d &vViewDirection)
void SetIsCalculateCrossLines(bool bCalculate)
void SetIsClipBySegments(bool bClip)
void SetIsCalcHid(bool bCalculate)
void ReserveForLinework(OdUInt32 iSize)
const FacetModeler::Profile3D & GetFace(OdUInt32 iIndex) const
bool IsClipWithPlane() const
void SetTolerance(const OdGeTol &rTol)
bool IsClipBySegments() const
void AddFace(const OdGePoint3dArray &rFace)
const OdGeLineSeg3d & GetSegment(OdUInt32 iIndex) const
OdUInt32 GetSegmentMetadata(OdUInt32 iIndex) const
OdUInt32 GetFaceCount() const
bool IsDrawSilhouettes() const
void ReserveForFaces(OdUInt32 iSize)
bool IsCalculateCrossLines() const
void SetViewPlane(const OdGeVector3d &vViewDirection)
void AddSegments(const FacetModeler::Body &rSource, OdUInt32 iMetadata=0)
OdUInt32 GetSegmentCount() const
void AddFaces(const FacetModeler::Body &rSource)
void SetIsSortByMetadata(bool bSort)
void SetIsDrawSilhouettes(bool bDraw)
void AddSegment(const OdGeLineSeg3d &rSegment, OdUInt32 iMetadata=0)
void SetIsCalcVis(bool bCalculate)
bool IsCalcVis() const
const OdGeTol & GetTolerance() const
HLRStorage(const OdGePlane &pViewPlane)
void SetViewPlane(const OdGePlane &pPlane)
bool IsCalcHid() const
bool IsSortByMetadata() const
const OdGePlane & GetViewPlane() const
Definition: GeTol.h:49
std::vector< HLRSegment > rVisResult
Definition: AECHLR.h:52
std::vector< HLRSegment > rHidResult
Definition: AECHLR.h:53
OdGeLineSeg3d lSeg
Definition: AECHLR.h:43
OdUInt32 iMetadata
Definition: AECHLR.h:44