CFx SDK Documentation
2020SP3
|
Go to the documentation of this file.
24 #ifndef __OD_GS_ENTITY_NODE__
25 #define __OD_GS_ENTITY_NODE__
74 pPortion = pNextPortion;
93 class OdGsBaseContext;
106 struct NextEntityEntry
111 void allocNextEntityArray(
OdUInt32 nMaxVpId);
112 inline NextEntityEntry *firstEntEntry() {
return reinterpret_cast<NextEntityEntry*
>(m_pNextEntity); }
113 inline const NextEntityEntry *firstEntEntry()
const {
return reinterpret_cast<const NextEntityEntry*
>(m_pNextEntity); }
115 inline NextEntityEntry *nextEntEntry(
OdUInt32 nVpId) { checkEntEntry(nVpId);
return reinterpret_cast<NextEntityEntry*
>(m_pNextEntity) + (nVpId + 1); }
116 inline const NextEntityEntry *nextEntEntry(
OdUInt32 nVpId)
const { checkEntEntry(nVpId);
return reinterpret_cast<const NextEntityEntry*
>(m_pNextEntity) + (nVpId + 1); }
124 void*
operator new(size_t);
125 void operator delete(
void *);
138 bool isEmpty()
const;
185 friend class OdGsModuleObject;
190 static void*
Realloc(
void* pMemBlock,
size_t newSize,
size_t)
212 kAwareFlagsRegenType = 4,
214 kRegenTypeStandard = 8,
215 kRegenTypeHideOrShade = 16,
216 kRegenTypeRenderCommand = 32,
217 kRegenTypeMask = kRegenTypeStandard | kRegenTypeHideOrShade | kRegenTypeRenderCommand,
219 kDependentGeometry = 64,
220 kLayerDependent = 128
224 *
reinterpret_cast<Metafile**
>(rawPtr()) = 0;
228 *
reinterpret_cast<Metafile**
>(rawPtr()) = 0;
254 SETBIT(m_flags, kVpDependent, bOn);
257 SETBIT(m_flags, kRegenTypeMask,
false);
258 setAwareFlagsRegenType(
false);
274 return *
reinterpret_cast<Metafile**
>(rawPtr());
294 *
reinterpret_cast<Metafile**
>(rawPtr()) = pMf;
307 else if(isRegenTypeDependent())
313 setAwareFlagsRegenType(
false);
325 m_flags |= kRegenTypeStandard <<
index;
327 setAwareFlagsRegenType(
true);
335 if(
GETBIT(flags(), kRegenTypeStandard))
337 else if(
GETBIT(flags(), kRegenTypeHideOrShade))
358 return isValid() ? get()->m_nAwareFlags : 0;
370 int flags()
const {
return (
int)m_flags; }
372 const void*
rawPtr()
const {
return &m_data; }
378 #ifdef TD_STRICT_ALIGNMENT
440 kSkipCheckCompatible = 0,
441 kCheckViewChanges = 1,
442 kCheckCompatibleView = 2,
479 kLastFlag = kMultilistNextPtr
484 kLineweightBit1 = (1 << 0),
485 kLineweightBit2 = (1 << 1), kLineweightOffset = 0,
486 kLineweightBit3 = (1 << 2),
487 kLineweightBit4 = (1 << 3),
488 kLineweightBit5 = (1 << 4),
489 kLineweightBit6 = (1 << 5),
490 kLineweightBit7 = (1 << 6),
491 kLineweightBit8 = (1 << 7),
492 kLineweightBitMask = kLineweightBit1 | kLineweightBit2 | kLineweightBit3 | kLineweightBit4 | kLineweightBit5 | kLineweightBit6 | kLineweightBit7 | kLineweightBit8,
493 kLightSourceOwner = (1 << 8),
494 kRegenOnHighlight = (1 << 9),
495 kMarkedByUpdateManager = (1 << 10),
496 kLastEntFlag = kMarkedByUpdateManager
501 kMarkedToSkipFirst = 0x00000001,
502 kMarkedToSkipLast = kMarkedToSkipFirst << 30,
503 kMarkedToSkipAll = 0x7FFFFFFF
547 void enableMultipleNextEntities(
OdUInt32 nMaxVpId);
579 virtual bool isLight()
const {
return false; }
593 bool spatiallyIndexed()
const;
599 bool spatiallyIndexed(
OdUInt32 nVpId)
const;
606 void setSpatiallyIndexed(
bool spatiallyIndexed);
613 void setSpatiallyIndexed(
OdUInt32 nVpId,
bool spatiallyIndexed);
630 void setOwned(
bool owned);
637 void setOwned(
OdUInt32 nVpId,
bool owned);
642 bool markedByUpdateManager()
const;
648 void setMarkedByUpdateManager(
bool marked );
653 bool hasExtents()
const;
671 inline bool markedToSkip(
unsigned mask);
678 inline void markToSkip(
unsigned mask,
bool markToSkip);
680 inline void markToSkipAll();
684 ODA_ASSERT(threadIndex >= 0 && threadIndex < 31);
685 return kMarkedToSkipFirst << threadIndex;
692 bool markedAsNonSelectable()
const;
693 void markAsNonSelectable(
bool val);
694 bool isMarkedSkipSelection()
const;
695 void markSkipSelection(
bool val);
696 bool isMarkedErased()
const;
697 void markErased(
bool val);
699 bool isInWorkset()
const;
700 void setInWorkset(
bool val);
702 bool isRegenOnDraw()
const;
703 void setRegenOnDraw(
bool val);
705 bool isSingleThreaded()
const;
706 void setSingleThreaded(
bool val);
708 virtual void highlight(
bool bDoIt,
bool bWholeBranch);
720 bool entityUnerased()
const;
721 void setEntityUnerased(
bool flag);
723 bool isInvisible()
const;
725 bool isExtentsOutOfModelSpace()
const;
726 void setExtentsOutOfModelSpace(
bool flag);
728 void resetInvalidVpFlag();
730 void setAsLightSourceOwner(
bool bSet);
731 bool isLightSourceOwner()
const;
733 bool isRequireRegenOnHighlightChange()
const;
746 inline void setExtentsFlags();
750 volatile int m_markToSkipFlags;
771 m_pNextEntity = pNextEntity;
777 nextEntEntry(nVpId)->m_pNextEntity = pNextEntity;
779 m_pNextEntity = pNextEntity;
784 if (nMaxVpId == 0xFFFFFFFF) nMaxVpId = 0;
786 allocNextEntityArray(nMaxVpId);
793 return m_pNextEntity;
799 return nextEntEntry(nVpId)->m_pNextEntity;
802 return m_pNextEntity;
809 return m_pNextEntity;
815 return nextEntEntry(nVpId)->m_pNextEntity;
818 return m_pNextEntity;
842 #ifndef TD_SINGLE_THREAD
843 return (
mask & OdInterlockedExchangeAdd(&m_markToSkipFlags, 0)) != 0;
855 #ifndef TD_SINGLE_THREAD
857 OdInterlockedExchangeAdd(&m_markToSkipFlags,
mask);
859 OdInterlockedExchangeAdd(&m_markToSkipFlags, -(
int)
mask);
954 #define VPMETAFILEHOLDERARRAY_DESTRUCTOR ~MetafilePtrArray
1018 if(ptr->m_pGsMetafile.get())
1082 if(
hlBranch() && (!bDoIt || bWholeBranch))
1124 #endif // __OD_GS_ENTITY_NODE__
#define GETBIT(flags, bit)
bool isMarkedSkipSelection() const
OdUInt32 numNextEntity() const
static GS_STATIC_EXPORT AllocatorArray s_aAlloc
void resetInvalidVpFlag()
virtual void propagateLayerChanges(OdGsViewImpl &view)
void setInWorkset(bool val)
OdGsEntityNode::MetafilePtr metafile() const
void filterEmptyNestedPortions()
virtual void highlight(bool bDoIt, bool bWholeBranch)
OdDb::LineWeight getMaxLineweightUsed() const
bool isMarkedErased() const
virtual OdGsEntityNode::MetafilePtr regenMetafile(OdGsUpdateContext &ctx, OdUInt32 vpDepFlags)
void setOwned(bool owned)
static void Free(void *pMemBlock)
bool markedToSkip(unsigned mask)
virtual bool isLight() const
void setSpatiallyIndexed(bool spatiallyIndexed)
void setExtentsOutOfModelSpace(bool flag)
bool isRequireRegenOnHighlightChange() const
void insertToSpatialIndex(OdUInt32 nVpId, OdSiSpatialIndex &parentIndex, const OdGeExtents3d &prevExtents)
OdRxObjectPtr m_pGsMetafile
void setAsLightSourceOwner(bool bSet)
#define SETBIT(flags, bit, value)
const OdGeExtents3d & extents() const
void update(OdGsUpdateContext &ctx, OdGsContainerNode *pParent, OdSiSpatialIndex *pParentIndex)
virtual ENodeType nodeType() const
void setEntityUnerased(bool flag)
virtual bool hasFrozenLayers()
bool isValidExtents() const
virtual void * alloc(int)=0
OdGsGeomPortion * m_pNext
void freeNestedPortions()
virtual void highlight(bool bDoIt, bool bWholeBranch)
OdRxObject * findCompatibleCache(const OdGsViewImpl &keyView, OdGsUpdateContext *ctx, OdUInt32 awareMask=0)
bool entityUnerased() const
void invalidate(OdGsContainerNode *pParent, OdGsViewImpl *pView, OdUInt32 mask)
OdSmartPtr< OdGsEntityNode > OdGsEntityNodePtr
virtual void propagateLayerChangesStock()
OdGsEntityNode(OdGsBaseModel *pModel, const OdGiDrawable *pUnderlyingDrawable, bool bSetGsNode=false)
virtual OdUInt32 awareFlags(OdUInt32 viewportId) const
static OdGsEntityNode::MetafilePtr getEmptyMetafile(OdUInt32 flags, OdGsLayerNode *pLayerNode=NULL)
OdGsEntityNode::MetafilePtr metafileAt(int metafileIndex) const
void markToSkip(unsigned mask, bool markToSkip)
void copyFrom(OdGsGeomPortion &c)
ODRX_DECLARE_MEMBERS(OdGsEntityNode)
const OdGsHlBranch * hlBranch() const
void setExtentsFromMetafiles()
void display(OdGsDisplayContext &ctx)
static void * Alloc(size_t nBytes)
OdGsDCRect extentsToPixels(const OdGeExtents3d &ext, OdGsViewImpl *pViewImpl)
bool saveNodeState(OdGsFiler *pFiler, OdGsBaseVectorizer *pVectorizer=NULL) const
virtual bool layersChanged(OdGsViewImpl &view) const
void addMaxLineweightUsed(OdDb::LineWeight lwd)
OdGsEntityNode * nextEntity()
void resize(size_type logicalLength, const T &value)
void setMetafileAt(int metafileIndex, OdGsEntityNode::Metafile *pMetafile)
static unsigned markToSkipMask(OdUInt32 threadIndex)
bool isRegenOnDraw() const
void setMarkedByUpdateManager(bool marked)
static void * Realloc(void *pMemBlock, size_t newSize, size_t)
bool isSingleThreaded() const
bool markedAsNonSelectable() const
T & at(size_type arrayIndex)
void select(OdGsBaseVectorizer &view)
bool loadNodeState(OdGsFiler *pFiler, OdGsBaseVectorizer *pVectorizer=NULL)
GE_TOOLKIT_EXPORT OdGeDoubleArray & getArray(OdGeKnotVector *p)
bool isExtentsOutOfModelSpace() const
bool isLightSourceOwner() const
void setNextEntity(OdGsEntityNode *pNextEntity)
void setSingleThreaded(bool val)
void updateVisible(OdGsViewImpl *pViewImpl)
OdGsHlBranch * hlBranch()
bool extents(const OdGsView *pView, OdGeExtents3d &ext) const
#define GS_TOOLKIT_EXPORT
virtual void releaseStock()
void markSkipSelection(bool val)
void setMetafile(OdGsEntityNode::Metafile *metafiles)
void setRegenOnDraw(bool val)
void enableMultipleNextEntities(OdUInt32 nMaxVpId)
@ kOdGiHideOrShadeCommand
MetafileHolder m_metafile
bool isEmptyPortion() const
virtual bool isReference() const
OdSmartPtr< Metafile > MetafilePtr
void addContentToUpdateManager(OdUInt32 viewportId, OdGsUpdateManager *pManager, const UpdateManagerContext &context)
bool markedByUpdateManager() const
OdGsHlBranchPtr m_hlBranch
virtual void release(void *p)=0
bool spatiallyIndexed() const
void setInvalidVp(bool val)
MetafileCompatibilityLevel
virtual void playAsGeometry(OdGsBaseVectorizer &view, EMetafilePlayMode eMode)
OdGsEntityNode::Metafile * metafile(const OdGsViewImpl &view, OdGsUpdateContext *ctx, MetafileCompatibilityLevel findCompatibleLevel=kFindCompatible)
void setMaxLineweightUsed(OdDb::LineWeight lwd)
MetafilePtrArray & metafileArray()
IAllocator * getAt(unsigned i)
void setMetafile(OdGsUpdateContext &ctx, OdGsEntityNode::Metafile *metafiles)
bool extents(OdGeExtents3d &extents) const
bool ODSI_API properExtents(const OdGeExtents3d &ext)
void markAsNonSelectable(bool val)
void setHlBranch(OdGsHlBranch *pBr)
void convertToViewportDependent(const OdGsUpdateContext &ctx)
bool findMetafileInStock(OdGsUpdateContext &ctx)
void markErased(bool val)