CFx SDK Documentation 2026 SP0
Loading...
Searching...
No Matches
DbBlockRepresentation.h
Go to the documentation of this file.
1
2// Copyright (C) 2002-2024, 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-2024 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 _DbBlockRepresentation_h_Included_
25#define _DbBlockRepresentation_h_Included_
26
27#include "TD_PackPush.h"
28
29#include "RxObjectImpl.h"
30#include "DbBlockReference.h"
31#include "DbEvalGraph.h"
32#include "IntArray.h"
33#define STL_USING_MAP
34#define STL_USING_SET
35#include "OdaSTL.h"
36
40class OdDbAttribute;
41
48{
49 OdDbObjectId m_pDynamicBlock;
50 OdDbObjectId m_pAnonymousBlock;
51 OdDbObjectId m_pBlockData;
52 OdDbObjectId m_pRef;
53 OdDb::OpenMode m_RefOpenMode = OdDb::kForRead;
54 OdDbObjectId m_pGraph;
55 OdDbBlockReference* m_pNDBROBlockRef;
56 OdDbEvalGraphPtr m_NDBRO_Graph;
57 bool m_bBlockUpdateMode;
58 void eraseOldArrayClones();
59 void updateAttributeMap();
60 bool m_bNDBROAttributes;
61 std::map<OdDbAttributeDefinition*, void*> m_pAttributeMap;
62 std::set<OdDbObjectId> m_TransformedCache;
63 std::map<OdDbStub*, OdIntArray> m_StretchedCache;
64 void updateCachedData(OdDbBlockReference* ref);
65 void updateBPT();
66public:
69 void init(const OdDbDynBlockReference* ref, OdDbBlockReference* dbref, OdDbEvalGraph* gr, bool bRequireEvaluate = false, bool loadIndstanceData = true);
70 void loadInstanceData(bool bRequireEvaluate = false, bool noHistoryData = true);
74 // set RepBTag on representation block
75 static void tagBlockRecord(OdDbBlockTableRecord* repBTR, const OdDbHandle& originalBlockHandle);
76 // remove dynamic block related xdata && xdictionary entries
77 static void clearRepBlock(OdDbBlockTableRecord* repRTR);
78 // create representation block for the insert
79 void createRepresentation(bool copied = true);
81 //
83 // update parameter value from the history record
86 OdDbObjectId getRepresentation() const { return m_pAnonymousBlock.isErased() ? OdDbObjectId::kNull : m_pAnonymousBlock; }
87 OdDbObjectId getOriginal() const { return m_pDynamicBlock; }
93 void readUndo(OdDbObjectId refId, OdDbDwgFiler* pFiler);
98 OdDbObjectId getBlockData() const { return m_pBlockData; }
99 void setBlockUpdateMode(bool b) { m_bBlockUpdateMode = b; m_TransformedCache.clear(); m_StretchedCache.clear(); }
100 bool blockUpdateMode() const { return m_bBlockUpdateMode; }
101 bool registerTransformedEntity(OdDbObjectId id) { return m_TransformedCache.insert(id).second; }
105
106 //FELIX_CHANGE_BEGIN DESKTOP-324290
107 std::function< bool() > m_abortFunc = nullptr;
108 void SetAbortFunc( std::function< bool() > abortFunc );
109 std::function< bool() > GetAbortFunc() const;
110 //FELIX_CHANGE_END DESKTOP-324290
111};
112
114
115#include "TD_PackPop.h"
116
117#endif // _DbBlockRepresentation_h_Included_
OdSmartPtr< OdDbAttribute > OdDbAttributePtr
OdSmartPtr< OdDbBlockReference > OdDbBlockReferencePtr
void DYNBLOCKS_EXPORT oddbUpdateAttributes(OdDbBlockReference *pRef, OdDbBlockTableRecord *pBlk)
OdSmartPtr< OdDbBlockTableRecord > OdDbBlockTableRecordPtr
OdSmartPtr< OdResBuf > OdResBufPtr
Definition DbDatabase.h:105
OdArray< OdDbEntityPtr > OdDbEntityPtrArray
Definition DbEntity.h:56
OdSmartPtr< OdDbEvalGraph > OdDbEvalGraphPtr
Definition DbEvalGraph.h:48
#define DYNBLOCKS_EXPORT
Definition DbEvalGraph.h:91
unsigned long OdDbEvalNodeId
Definition DbEvalGraph.h:60
OdSmartPtr< OdDbEvalExpr > OdDbEvalExprPtr
Definition DbEvalGraph.h:58
OdSmartPtr< OdDbXrecord > OdDbXrecordPtr
Definition DbObject.h:68
OdArray< OdDbObjectId, OdClrMemAllocator< OdDbObjectId > > OdDbObjectIdArray
Definition IdArrays.h:53
OdArray< int, OdMemoryAllocator< int > > OdIntArray
Definition IntArray.h:35
bool originalPathToRepresentationPath(const OdDbObjectIdArray &, OdDbEntityPtrArray &res) const
OdDbBlockTableRecordPtr getBlock() const
OdDbXrecordPtr getHistoryRecord() const
static void tagBlockRecord(OdDbBlockTableRecord *repBTR, const OdDbHandle &originalBlockHandle)
void createRepresentation(bool copied=true)
static OdDbBlockRepresentationContext * getRepresentationContext(OdDbBlockReference *br, bool validate=true)
bool applyHistory(OdResBufPtr pRb)
void SetAbortFunc(std::function< bool() > abortFunc)
OdGeMatrix3d getRelativeMatrix(const OdGeMatrix3d &m) const
std::function< bool() > GetAbortFunc() const
OdDbObjectId getBlockHData() const
OdDbEvalGraphPtr getGraph() const
OdGeVector3d getRelativeOffset(const OdGeVector3d &v) const
void addHistoryRecord(const OdString &name, const OdResBuf *value, OdDbEvalNodeId node)
void readUndo(OdDbObjectId refId, OdDbDwgFiler *pFiler)
OdDbEvalExprPtr getRepresentationNode(OdDbEvalNodeId id) const
bool registerStretchedEntity(OdDbObjectId id, const OdIntArray &indices)
OdDbBlockReferencePtr getReference() const
static void clearRepBlock(OdDbBlockTableRecord *repRTR)
bool registerTransformedEntity(OdDbObjectId id)
void writeUndo(OdDbEvalGraph *gr)
void init(const OdDbDynBlockReference *ref, OdDbBlockReference *dbref, OdDbEvalGraph *gr, bool bRequireEvaluate=false, bool loadIndstanceData=true)
void loadInstanceData(bool bRequireEvaluate=false, bool noHistoryData=true)
OdDbAttributePtr getAttribute(OdDbAttributeDefinition *)
bool representationPathToOriginalPath(OdDbObjectIdArray &) const
static TOOLKIT_EXPORT_STATIC const OdDbObjectId kNull
Definition DbObjectId.h:110
bool isErased() const
GLenum GLint ref
Definition gles2_ext.h:262
GLuint const GLchar * name
Definition gles2_ext.h:265
const GLfloat * v
Definition gles2_ext.h:315
GLsizei const GLfloat * value
Definition gles2_ext.h:302
@ kForRead
Definition DbObjectId.h:56