CFx SDK Documentation  2020SP3
FxHLR.h
Go to the documentation of this file.
1 //
2 // (C) Copyright 2005-2020 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 }
FxHLR::Collector::RemoveEntities
void RemoveEntities(const OdDbEntityPtrArray &pEnts)
OdResult
OdResult
Definition: OdResult.h:29
FxHLR::Engine::SetAbortCallback
void SetAbortCallback(_AbortCallbackFct fct)
FxHLR::Data::m_pResultEntity
OdDbEntityPtr m_pResultEntity
Definition: FxHLR.h:79
FxHLR::kUnite
@ kUnite
Definition: FxHLR.h:41
OdGeVector3d
Definition: GeVector3d.h:54
FxHLR::_AbortCallbackFct
void(* _AbortCallbackFct)(bool *abort)
Definition: FxHLR.h:145
FxHLR::Collector::RemoveEntities
void RemoveEntities(OdDbObjectIdArray &ids)
FxHLR::Data::kInternallyHidden
@ kInternallyHidden
Definition: FxHLR.h:66
FxHLR::Collector::AddEntity
void AddEntity(OdDbEntityPtr pEnt)
FxHLR::Engine::Engine
Engine(const OdDbObjectId &id, int iFlags=kShowAll|kEntity|kBlock|kSubentity|kReuse)
FxHLR::kProgress
@ kProgress
Definition: FxHLR.h:43
FxHLR::Collector::RemoveEntity
void RemoveEntity(const OdDbObjectId &id)
FxHLR::Collector::Clear
void Clear()
FxHLR::Data::SetSubentId
void SetSubentId(const OdDbSubentId &subentId)
FxHLR::Collector::~Collector
virtual ~Collector()
IdArrays.h
FxHLR::kHideTangents
@ kHideTangents
Definition: FxHLR.h:38
FxHLR::Engine::CleanHlrCache
static void CleanHlrCache(OdDbEntityPtr pEnt, const OdDbObjectId &VpId=OdDbObjectId::kNull)
FxHLR::kSubentity
@ kSubentity
Definition: FxHLR.h:37
OdDbObjectId
Definition: DbObjectId.h:99
FxHLR::Engine::m_iControl
int m_iControl
Definition: FxHLR.h:158
FxHLR::Data::GetVisibility
Visibility GetVisibility() const
FxHLR::Engine::m_ptTarget
OdGePoint3d m_ptTarget
Definition: FxHLR.h:156
FxHLR::kEntity
@ kEntity
Definition: FxHLR.h:35
FxHLR::Collector::AddEntity
void AddEntity(const OdDbObjectId &id)
DDKERNEL.h
OdArray< OdDbObjectId, OdMemoryAllocator< OdDbObjectId > >
FxHLR::Data::Data
Data()
FxHLR::Collector::Collector
Collector()
FxHLR::Data::GetObjectIds
const OdDbObjectIdArray & GetObjectIds() const
FxHLR::Data::m_pEntity
OdDbEntityPtr m_pEntity
Definition: FxHLR.h:71
FxHLR
Definition: FxGeomUtils.h:270
FxHLR::Collector::Collector
Collector(const OdDbObjectIdArray &ids)
FxHLR::kIsolines
@ kIsolines
Definition: FxHLR.h:40
FxHLR::Data::GetEntity
OdDbEntityPtr GetEntity() const
FxHLR::kCleanup
@ kCleanup
Definition: FxHLR.h:39
FxHLR::Engine::m_pFxConvertionProgressCallbackFct
_ProgressCallbackFct m_pFxConvertionProgressCallbackFct
Definition: FxHLR.h:162
FxHLR::Engine::Run
OdResult Run(Collector &collector)
FxHLR::Engine::m_pAcisConvertionProgressCallbackFct
_ProgressCallbackFct m_pAcisConvertionProgressCallbackFct
Definition: FxHLR.h:160
FxHLR::Data::SetHlrVisibility
void SetHlrVisibility(Visibility visibility)
OdSmartPtr< OdDbEntity >
FxHLR::kShowAll
@ kShowAll
Definition: FxHLR.h:34
FxHLR::Data::SetResultEntity
void SetResultEntity(OdDbEntityPtr pResultEnt)
OdGePoint3d
Definition: GePoint3d.h:55
FxHLR::Engine::Engine
Engine(int iFlags=kShowAll|kEntity|kBlock|kSubentity|kReuse)
DbEntity.h
FxHLR::Data
Definition: FxHLR.h:59
FxHLR::Data::~Data
virtual ~Data()
FxHLR::Engine::~Engine
virtual ~Engine()
FxHLR::Engine::CleanHlrCache
static void CleanHlrCache(OdDbEntityPtr pEnt, OdGePoint3d viewTarget, OdGeVector3d viewDir)
FxHLR::kProcessAll
@ kProcessAll
Definition: FxHLR.h:45
FxHLR::Data::SetObjectIds
void SetObjectIds(const OdDbObjectIdArray &id)
FxHLR::kMeshSilhouettes
@ kMeshSilhouettes
Definition: FxHLR.h:47
FxHLR::Data::m_objectIds
OdDbObjectIdArray m_objectIds
Definition: FxHLR.h:73
FxHLR::Data::m_hlrVisibility
Visibility m_hlrVisibility
Definition: FxHLR.h:77
OdDbObjectId::kNull
static TOOLKIT_EXPORT_STATIC const OdDbObjectId kNull
Definition: DbObjectId.h:118
FxHLR::Collector::Collector
Collector(const OdDbEntityPtrArray &entities)
FxHLR::Engine::m_pAbortCallbackFct
_AbortCallbackFct m_pAbortCallbackFct
Definition: FxHLR.h:159
FxHLR::_ProgressCallbackFct
void(* _ProgressCallbackFct)(int percent_completed)
Definition: FxHLR.h:146
FxHLR::kHonorInternals
@ kHonorInternals
Definition: FxHLR.h:46
FxHLR::kReuse
@ kReuse
Definition: FxHLR.h:42
FxHLR::Data::kOccluded
@ kOccluded
Definition: FxHLR.h:65
FxHLR::Collector::AddEntities
void AddEntities(const OdDbObjectIdArray &ids)
FxHLR::Engine::m_vViewDirection
OdGeVector3d m_vViewDirection
Definition: FxHLR.h:157
DDKERNEL_API
#define DDKERNEL_API
Definition: DDKERNEL.h:32
FxHLR::Data::kVisible
@ kVisible
Definition: FxHLR.h:63
FxHLR::Data::m_visibility
Visibility m_visibility
Definition: FxHLR.h:76
FxHLR::Data::GetResultEntity
OdDbEntityPtr GetResultEntity() const
FxHLR::Collector::m_aEntityIds
OdDbObjectIdArray m_aEntityIds
Definition: FxHLR.h:113
DbViewport.h
FxHLR::Control
Control
Definition: FxHLR.h:32
FxHLR::Collector::AddEntities
void AddEntities(const OdDbEntityPtrArray &pEnts)
FxHLR::Data::GetHlrVisibility
Visibility GetHlrVisibility() const
FxHLR::Collector::m_aOutputData
OdArray< Data * > m_aOutputData
Definition: FxHLR.h:116
FxHLR::Engine::SetAcisConversionProgressCallBack
void SetAcisConversionProgressCallBack(_ProgressCallbackFct fct)
FxHLR::Engine
Definition: FxHLR.h:154
FxHLR::Collector::Collector
Collector(Collector &collector)
FxHLR::Collector
Definition: FxHLR.h:110
FxHLR::Collector::GetInputEntities
const OdDbEntityPtrArray & GetInputEntities() const
FxHLR::kSingleCacheVp
@ kSingleCacheVp
Definition: FxHLR.h:48
FxHLR::kBlock
@ kBlock
Definition: FxHLR.h:36
FxHLR::Engine::CleanHlrCache
static void CleanHlrCache()
FxHLR::Engine::m_pHlProgressCallbackFct
_ProgressCallbackFct m_pHlProgressCallbackFct
Definition: FxHLR.h:161
FxHLR::Data::GetSubentId
const OdDbSubentId & GetSubentId() const
FxHLR::Data::m_subentId
OdDbSubentId m_subentId
Definition: FxHLR.h:74
FxHLR::Collector::GetInputEntityIds
const OdDbObjectIdArray & GetInputEntityIds() const
void
typedef void(APIENTRYP PFNGLACTIVETEXTUREPROC)(GLenum texture)
FxHLR::Data::SetEntity
void SetEntity(OdDbEntityPtr pEnt)
FxHLR::Engine::Engine
Engine(OdDbViewportPtr pViewport, int iFlags=kShowAll|kEntity|kBlock|kSubentity|kReuse)
FxHLR::Collector::m_apEntities
OdDbEntityPtrArray m_apEntities
Definition: FxHLR.h:112
FxHLR::Data::kHidden
@ kHidden
Definition: FxHLR.h:64
FxHLR::kProject
@ kProject
Definition: FxHLR.h:33
FxHLR::Collector::RemoveEntity
void RemoveEntity(OdDbEntityPtr pEnt)
FxHLR::kHandlePoints
@ kHandlePoints
Definition: FxHLR.h:44
FxHLR::Engine::Engine
Engine(const OdGePoint3d &viewTarget, const OdGeVector3d &viewDirection, int iFlags=kShowAll|kEntity|kBlock|kSubentity|kReuse)
FxHLR::Engine::SetFxConversionProgressCallBack
void SetFxConversionProgressCallBack(_ProgressCallbackFct fct)
OdDbSubentId
Definition: DbBaseSubentId.h:72
FxHLR::Data::Visibility
Visibility
Definition: FxHLR.h:62
FxHLR::Engine::SetHLProgressCallBack
void SetHLProgressCallBack(_ProgressCallbackFct fct)
FxHLR::Data::SetVisibility
void SetVisibility(Visibility visibility)