CFx SDK Documentation  2022 SP0
FxHLR.h
Go to the documentation of this file.
1 //
2 // (C) Copyright 2005-2021 by Graebert GmbH.
3 //
4 // Permission to use, copy, modify, and distribute this software in
5 // object code form for any purpose and without fee is hereby granted,
6 // provided that the above copyright notice appears in all copies and
7 // that both that copyright notice and the limited warranty and
8 // restricted rights notice below appear in all supporting
9 // documentation.
10 //
11 // GRAEBERT PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
12 // GRAEBERT SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
13 // MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. GRAEBERT GMBH
14 // DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
15 // UNINTERRUPTED OR ERROR FREE.
16 
17 #pragma once
18 
19 #include "DDKERNEL.h"
20 
21 #include "IdArrays.h"
22 
23 #include "DbEntity.h"
24 #include "DbViewport.h"
25 
26 namespace FxHLR
27 {
29 
30  // Input flags for HLR engine
31  enum Control
32  {
33  kProject = 0x0001,
34  kShowAll = 0x0002,
35  kEntity = 0x0004,
36  kBlock = 0x0008,
37  kSubentity = 0x0010,
38  kHideTangents = 0x0020,
39  kCleanup = 0x0040,
40  kIsolines = 0x0080,
41  kUnite = 0x0100,
42  kReuse = 0x0200,
43  kProgress = 0x0400,
44  kHandlePoints = 0x0800,
45  kProcessAll = 0x1000,
46  kHonorInternals = 0x2000,
47  kMeshSilhouettes = 0x4000,
48  kSingleCacheVp = 0x8000
49  };
50 
52 
59  {
60  public:
62  {
67  kUndefined
68  };
69 
70  protected:
72 
75 
78 
80 
81  public:
82  Data();
83  virtual ~Data();
84 
85  void SetEntity( OdDbEntityPtr pEnt );
86  void SetObjectIds( const OdDbObjectIdArray& id );
87  void SetResultEntity( OdDbEntityPtr pResultEnt );
88  void SetVisibility( Visibility visibility );
89  void SetHlrVisibility( Visibility visibility );
90  void SetSubentId( const OdDbSubentId& subentId );
91 
97  const OdDbSubentId& GetSubentId() const;
98  };
99 
101 
102  class Engine;
103 
110  {
111  protected:
114 
115  public:
117 
118  public:
121  Collector( const OdDbEntityPtrArray& entities );
122  Collector( Collector& collector );
123 
124  virtual ~Collector();
125 
128 
129  void AddEntity( OdDbEntityPtr pEnt );
130  void AddEntities( const OdDbEntityPtrArray& pEnts );
131  void AddEntity( const OdDbObjectId& id );
132  void AddEntities( const OdDbObjectIdArray& ids );
133 
135  void RemoveEntities( const OdDbEntityPtrArray& pEnts );
136  void RemoveEntity( const OdDbObjectId& id );
138 
139  void Clear();
140 
141  };
142 
144 
145  typedef void( *_AbortCallbackFct ) ( bool *abort );
146  typedef void( *_ProgressCallbackFct ) ( int percent_completed );
147 
154  {
155  protected:
163 
164  public:
165  Engine( int iFlags = kShowAll | kEntity | kBlock | kSubentity | kReuse );
166  Engine( const OdDbObjectId& id, int iFlags = kShowAll | kEntity | kBlock | kSubentity | kReuse );
167  Engine( OdDbViewportPtr pViewport, int iFlags = kShowAll | kEntity | kBlock | kSubentity | kReuse );
168  Engine( const OdGePoint3d& viewTarget, const OdGeVector3d& viewDirection, int iFlags = kShowAll | kEntity | kBlock | kSubentity | kReuse );
169 
170  virtual ~Engine();
171 
172  OdResult Run( Collector& collector );
173 
175 
179 
180  static void CleanHlrCache();
181  static void CleanHlrCache( OdDbEntityPtr pEnt, const OdDbObjectId& VpId = OdDbObjectId::kNull );
182  static void CleanHlrCache( OdDbEntityPtr pEnt, OdGePoint3d viewTarget, OdGeVector3d viewDir );
183 
184  };
185 
186 }
#define DDKERNEL_API
Definition: DDKERNEL.h:32
OdResult
Definition: OdResult.h:29
const OdDbEntityPtrArray & GetInputEntities() const
void RemoveEntities(OdDbObjectIdArray &ids)
void AddEntity(OdDbEntityPtr pEnt)
OdDbObjectIdArray m_aEntityIds
Definition: FxHLR.h:113
void RemoveEntities(const OdDbEntityPtrArray &pEnts)
void RemoveEntity(const OdDbObjectId &id)
OdDbEntityPtrArray m_apEntities
Definition: FxHLR.h:112
Collector(const OdDbObjectIdArray &ids)
const OdDbObjectIdArray & GetInputEntityIds() const
Collector(Collector &collector)
void AddEntities(const OdDbEntityPtrArray &pEnts)
OdArray< Data * > m_aOutputData
Definition: FxHLR.h:116
virtual ~Collector()
void AddEntity(const OdDbObjectId &id)
Collector(const OdDbEntityPtrArray &entities)
void RemoveEntity(OdDbEntityPtr pEnt)
void AddEntities(const OdDbObjectIdArray &ids)
Visibility m_visibility
Definition: FxHLR.h:76
void SetEntity(OdDbEntityPtr pEnt)
const OdDbSubentId & GetSubentId() const
virtual ~Data()
Visibility GetVisibility() const
OdDbSubentId m_subentId
Definition: FxHLR.h:74
OdDbEntityPtr m_pEntity
Definition: FxHLR.h:71
OdDbObjectIdArray m_objectIds
Definition: FxHLR.h:73
Visibility
Definition: FxHLR.h:62
@ kInternallyHidden
Definition: FxHLR.h:66
@ kHidden
Definition: FxHLR.h:64
@ kOccluded
Definition: FxHLR.h:65
@ kVisible
Definition: FxHLR.h:63
void SetVisibility(Visibility visibility)
OdDbEntityPtr GetEntity() const
void SetHlrVisibility(Visibility visibility)
OdDbEntityPtr GetResultEntity() const
Visibility GetHlrVisibility() const
void SetObjectIds(const OdDbObjectIdArray &id)
void SetResultEntity(OdDbEntityPtr pResultEnt)
void SetSubentId(const OdDbSubentId &subentId)
OdDbEntityPtr m_pResultEntity
Definition: FxHLR.h:79
const OdDbObjectIdArray & GetObjectIds() const
Visibility m_hlrVisibility
Definition: FxHLR.h:77
_ProgressCallbackFct m_pAcisConvertionProgressCallbackFct
Definition: FxHLR.h:160
_ProgressCallbackFct m_pFxConvertionProgressCallbackFct
Definition: FxHLR.h:162
void SetFxConversionProgressCallBack(_ProgressCallbackFct fct)
Engine(const OdDbObjectId &id, int iFlags=kShowAll|kEntity|kBlock|kSubentity|kReuse)
static void CleanHlrCache(OdDbEntityPtr pEnt, const OdDbObjectId &VpId=OdDbObjectId::kNull)
int m_iControl
Definition: FxHLR.h:158
OdGeVector3d m_vViewDirection
Definition: FxHLR.h:157
void SetAbortCallback(_AbortCallbackFct fct)
Engine(int iFlags=kShowAll|kEntity|kBlock|kSubentity|kReuse)
Engine(OdDbViewportPtr pViewport, int iFlags=kShowAll|kEntity|kBlock|kSubentity|kReuse)
static void CleanHlrCache()
OdGePoint3d m_ptTarget
Definition: FxHLR.h:156
OdResult Run(Collector &collector)
virtual ~Engine()
void SetAcisConversionProgressCallBack(_ProgressCallbackFct fct)
_ProgressCallbackFct m_pHlProgressCallbackFct
Definition: FxHLR.h:161
static void CleanHlrCache(OdDbEntityPtr pEnt, OdGePoint3d viewTarget, OdGeVector3d viewDir)
_AbortCallbackFct m_pAbortCallbackFct
Definition: FxHLR.h:159
void SetHLProgressCallBack(_ProgressCallbackFct fct)
Engine(const OdGePoint3d &viewTarget, const OdGeVector3d &viewDirection, int iFlags=kShowAll|kEntity|kBlock|kSubentity|kReuse)
static TOOLKIT_EXPORT_STATIC const OdDbObjectId kNull
Definition: DbObjectId.h:118
typedef void(APIENTRYP PFNGLACTIVETEXTUREPROC)(GLenum texture)
Control
Definition: FxHLR.h:32
@ kProcessAll
Definition: FxHLR.h:45
@ kReuse
Definition: FxHLR.h:42
@ kBlock
Definition: FxHLR.h:36
@ kHonorInternals
Definition: FxHLR.h:46
@ kSingleCacheVp
Definition: FxHLR.h:48
@ kMeshSilhouettes
Definition: FxHLR.h:47
@ kCleanup
Definition: FxHLR.h:39
@ kIsolines
Definition: FxHLR.h:40
@ kEntity
Definition: FxHLR.h:35
@ kHideTangents
Definition: FxHLR.h:38
@ kProgress
Definition: FxHLR.h:43
@ kSubentity
Definition: FxHLR.h:37
@ kHandlePoints
Definition: FxHLR.h:44
@ kShowAll
Definition: FxHLR.h:34
@ kProject
Definition: FxHLR.h:33
@ kUnite
Definition: FxHLR.h:41
void(* _AbortCallbackFct)(bool *abort)
Definition: FxHLR.h:145
void(* _ProgressCallbackFct)(int percent_completed)
Definition: FxHLR.h:146