24#ifndef __ODGSMODELIMPL_H__
25#define __ODGSMODELIMPL_H__
27#define OD_MATERIAL_CACHE_SUPPORTED
53#define CACHE_STATISTICS
60class OdGsBaseModelImpl;
98 friend class CFxGsExtension;
120#ifdef BS_CHANGES_ENABLED
126 virtual OdRxObjectPtr saveAndDetach(OdGiDrawable& db);
137#if defined(CACHE_STATISTICS)
144 kCheckFaded = (1 << 0),
145 kEnableLinetypes = (1 << 1),
146 kModelSelectable = (1 << 2),
147 kLightsInBlocks = (1 << 3),
148 kSkipViewClip = (1 << 4),
149 kViewExtCalcs = (1 << 5),
150 kSkipViewSection = (1 << 6),
151 kIdentityXform = (1 << 7),
152 kVectorizing = (1 << 8),
153 kKeepSelStyles = (1 << 9)
154#ifdef BS_CHANGES_ENABLED
155 , kDisableAddNode = (1 << 10)
157 , kDisableNotifications = (1 << 10)
158 , kDisableInvalidate = (1 << 11)
170#ifdef ODA_DIAGNOSTICS
175 typedef std::pair<OdGsViewImpl*, OdUInt32>
ViewRef;
177 typedef std::pair<const OdGsBaseModule*, OdUInt32>
ModuleRef;
192 if(m_viewProps.size()>viewportId)
193 return m_viewProps[viewportId].isInvalid();
197 OdGsBaseModelImpl*
impl() {
return m_impl; }
214 , m_dTop(0.0), m_dBottom(0.0), m_visualStyle(NULL) { }
219#ifdef BS_CHANGES_ENABLED
220 bool disableAddNode()
const {
return GETBIT(m_gsModelFlags, kDisableAddNode); }
231 if(m_viewProps.size()>viewportId)
232 m_viewProps[viewportId].setInvalid(val);
424 bool isIdentityTransform()
const;
495 bool bSelectHidden =
false,
const OdGsView* pView = NULL);
507 bool bSelectHidden =
false,
const OdGsView* pView = NULL);
657 double dTop,
double dBottom);
GS_TOOLKIT_EXPORT OdGiDrawablePtr fxOpenDrawable(OdGsBaseModel *, OdDbStub *)
#define GS_TOOLKIT_EXPORT
OdGiDrawablePtr(* OdGiOpenDrawableFn)(OdDbStub *id)
#define SETBIT(flags, bit, value)
#define SETBIT_0(flags, bit)
#define GETBIT(flags, bit)
#define SETBIT_1(flags, bit)
void removeModelReactor(OdGsModelReactor *pReactor)
OdGsCacheRedirectionManager * m_pRedirectionMgr
SelectionStyleRefMap m_selStyleRefs
bool supportSelectionStyles() const
virtual OdGsLayerNode * gsLayerNode(OdDbStub *layerId, const OdGsBaseVectorizer *pView)
virtual bool disableNotifications() const
void setRenderType(RenderType renderType)
bool isLightsInBlocksEnabled() const
void invalidateSectionableBlocks()
OdDbStub * visualStyle() const
void onModifiedDrawable(OdGiDrawable *pDrawable, OdGiDrawable *pParent)
bool invalidVp(unsigned int viewportId) const
bool visualStyle(OdGiVisualStyle &visualStyle) const
SectioningSettings m_sectioning
const OdGiDrawable * visualStyleDrawable() const
OdGiDrawablePtr m_pTransVisualStyle
bool isSectioningEnabled() const
void setOpenDrawableFn(OdGiOpenDrawableFn openDrawableFn)
void invalidateRegenDrawBlocks(OdGsViewImpl &view, const OdDbStub *layoutId)
OdDbStub * m_modelBackground
OdGiOpenDrawableFn m_openDrawableFn
virtual bool makeStock(OdDbStub *layoutId)
void invalidate(OdGsViewImpl &view, OdUInt32 mask)
void highlight(const OdGiPathNode &path, const OdGsMarker *pMarkers, OdUInt32 nMarkers, bool bDoIt=true, OdUInt32 nStyle=0, const OdGsView *pView=NULL)
void setEnableLinetypes(bool bEnable)
void setSelectable(bool bEnable)
virtual void hideImpl(const OdGiPathNode &path, const OdGsMarker *pMarkers, OdUInt32 nMarkers, bool bDoIt=true, bool bSelectHidden=false, const OdGsView *pView=NULL)
void onModified(OdGiDrawable *pModified, OdDbStub *parentID)
virtual void addNode(OdGsNode *pNode)
virtual OdGsNode * newNode(ENodeType ntp, const OdGiDrawable *drawable, bool bSetGsNode)
OdVector< OdGsModelReactor *, OdMemoryAllocator< OdGsModelReactor * > > m_modelReactors
bool viewSectioningOverride() const
virtual void releaseStock(OdDbStub *layoutId)
OdDbStub * m_modelVisualStyle
void onModified(OdGiDrawable *pModified, OdGiDrawable *pParent)
void onPropertyModifiedImpl(OdGsBaseModelReactor::ModelProperty nProp, bool &bReturnValue)
OdGsMaterialCache * materialCache()
void setViewSectioningOverride(bool bEnable)
OdGsView::RenderMode renderModeOverride() const
OdArray< ViewProps > m_viewProps
virtual bool saveClientModelState(OdGsFiler *pFiler) const
void setSelectionStyleRef(const OdGsNode *pNode, OdUInt32 nStyle)
void setVisualStyle(const OdGiVisualStyle &visualStyle)
virtual bool isViewPropsValid(OdUInt32 viewportId) const
void onUnerased(OdGiDrawable *pUnerased, OdGiDrawable *pParent)
OdGsMaterialCachePtr m_pMaterialCache
virtual OdGsNode * gsNode(OdGiDrawable *pDrawable)
OdArray< ModuleRef, OdMemoryAllocator< ModuleRef > > m_modules
void extendSelStyleFlag(OdGsViewImpl *pView)
virtual void detach(OdGsNode *pNode)
void setEnableSectioning(bool bEnable)
virtual void invalidateEntRect(OdGsEntityNode *pNode, OdGsContainerNode *pParent, bool bForceIfNoExtents)
void hide(const OdGiPathNode &path, bool bDoIt=true, bool bSelectHidden=false, const OdGsView *pView=NULL)
void setRenderModeOverride(OdGsView::RenderMode mode=OdGsView::kNone)
OdArray< ViewRef, OdMemoryAllocator< ViewRef > > m_views
void invalidate(InvalidationHint hint)
friend GS_TOOLKIT_EXPORT OdGiDrawablePtr fxOpenDrawable(OdGsBaseModel *, OdDbStub *)
void onUnerased(OdGiDrawable *pUnerased, OdDbStub *parentID)
std::map< const OdGsNode *, OdUInt32 > SelectionStyleRefMap
OdGsBaseModelImpl * impl()
virtual OdUInt32 getMaxLocalViewportId() const
virtual void clearChangedLayersList()
bool isLinetypesEnabled() const
OdGsBaseModelImpl * m_impl
bool trySetDisableInvalidate(bool bOn)
const SectioningSettings & getSectioning() const
const ViewPropsArray & getViewProps() const
void onModifiedNode(OdGsNode *pCache, OdGiDrawable *pDrawable, OdGiDrawable *pParent)
virtual void invalidateEntRect(OdGiDrawable *pDrawable, OdGiDrawable *pParent, bool bForceIfNoExtents=false)
OdGsLayerNode * m_pFirstChangedLayer
OdGsViewImpl * refView() const
void removeViewRef(OdGsViewImpl *pView)
bool postprocessModelLoading(OdGsFiler *pFiler)
OdVector< OdGsBaseModelReactor *, OdMemoryAllocator< OdGsBaseModelReactor * > > m_baseModelReactors
OdDbStub * background() const
void highlight(const OdGiPathNode &path, bool bDoIt=true, OdUInt32 nStyle=0, const OdGsView *pView=NULL)
virtual bool saveModelState(OdGsFiler *pFiler, OdGsBaseVectorizer *pVectorizer=NULL) const
void addViewRef(OdGsViewImpl *pView)
OdGiOpenDrawableFn openDrawableFn() const
std::pair< OdGsViewImpl *, OdUInt32 > ViewRef
bool viewClippingOverride() const
virtual void highlightImpl(const OdGiPathNode &path, const OdGsMarker *pMarkers, OdUInt32 nMarkers, bool bDoIt=true, OdUInt32 nStyle=0, const OdGsView *pView=NULL)
RenderType renderType() const
OdGsBaseVectorizeDevice * refDevice() const
virtual void updateViewProps(const OdGsViewImpl &viewport)
void setVisualStyle(OdDbStub *visualStyleId)
virtual OdUInt32 getLocalViewportId(OdGsViewImpl *pView)
void setTransform(const OdGeMatrix3d &xForm)
bool setSectioning(const OdGePoint3dArray &points, const OdGeVector3d &upVector, double dTop, double dBottom)
void setEnableLightsInBlocks(bool bEnable)
void hide(const OdGiPathNode &path, const OdGsMarker *pMarkers, OdUInt32 nMarkers, bool bDoIt=true, bool bSelectHidden=false, const OdGsView *pView=NULL)
void setSectioningVisualStyle(OdDbStub *visualStyleId)
virtual void onErasedImpl(OdGiDrawable *pErased, OdGiDrawable *pParent)
bool isIdentityTransform() const
void setDisableNotifications(bool bOn)
void addModelReactor(OdGsModelReactor *pReactor)
void setBackground(OdDbStub *backgroundId)
virtual bool loadModelState(OdGsFiler *pFiler, OdGsBaseVectorizer *pVectorizer=NULL)
OdUInt32 viewChanges(OdUInt32 viewportId) const
OdGsBaseModelLocalIdsPtr m_pViewIds
void setDrawableGsNode(OdGiDrawable *pDrawable, OdGsCache *pNode)
const ViewProps & viewProps(OdUInt32 viewportId) const
OdGeMatrix3d transform() const
void detachAllFromDb(const OdDbBaseDatabase *pDb)
OdGsView::RenderMode m_renderModeOverride
OdUInt32 numViewProps() const
void setInvalidVp(unsigned int viewportId, bool val)
void setViewClippingOverride(bool bEnable)
virtual void onAddedImpl(OdGiDrawable *pAdded, OdGiDrawable *pParent, AdditionMode additionMode=kAddDrawable)
void onAdded(OdGiDrawable *pAdded, OdGiDrawable *pParent)
OdGeExtents3d & transformExtents(OdGeExtents3d &pExts) const
virtual bool onPropertyModified(OdGsBaseModelReactor::ModelProperty nProp)
std::pair< const OdGsBaseModule *, OdUInt32 > ModuleRef
bool isViewExtentsCalculationEnabled() const
void setCheckFaded(bool bOn)
void onErased(OdGiDrawable *pErased, OdGiDrawable *pParent)
virtual void onModifiedImpl(OdGiDrawable *pModified, OdGiDrawable *pParent)
OdRxObjectPtr m_pGsReserved
void rescanSelStyleFlag()
void onModifiedNodeImp(OdGsNode *pCache, OdGiDrawable *pDrawable, OdGiDrawable *pParent, bool bGraphicsOnly)
bool hasChangedLayers() const
OdGiDrawablePtr open(OdDbStub *objectId)
OdUInt32 refModulesCount() const
OdUInt32 selectionStyleRef(const OdGsNode *pNode) const
void onAdded(OdGiDrawable *pAdded, OdDbStub *parentID)
void invalidateVisible(OdGsDevice *pDevice)
virtual void propagateLayerChanges(OdGsBaseVectorizeDevice &device)
const OdGsViewImpl * viewById(OdUInt32 viewportId) const
virtual bool loadClientModelState(OdGsFiler *pFiler)
void invalidate(OdGsView *pView)
virtual void onModifiedGraphics(const OdGiDrawable *pModified, OdDbStub *parentID) ODRX_OVERRIDE
virtual void attachLocalViewportId(OdGsViewImpl *pView, OdGsViewImpl *pFrom=NULL)
bool setSectioning(const OdGePoint3dArray &points, const OdGeVector3d &upVector)
void setEnableViewExtentsCalculation(bool bEnable)
void onErased(OdGiDrawable *pErased, OdDbStub *parentID)
bool isSelectable() const
OdGsCache * drawableGsNode(const OdGiDrawable *pDrawable)
virtual bool viewSectioningOverride() const =0
virtual RenderType renderType() const =0
virtual OdGsView::RenderMode renderModeOverride() const =0
virtual bool viewClippingOverride() const =0
OdGePoint3dArray m_points