24 #ifndef __ODGSMODELIMPL_H__
25 #define __ODGSMODELIMPL_H__
27 #define OD_MATERIAL_CACHE_SUPPORTED
52 #define CACHE_STATISTICS
59 class OdGsBaseModelImpl;
120 friend class CFxGsExtension;
142 #if defined(CACHE_STATISTICS)
149 kCheckFaded = (1 << 0),
150 kEnableLinetypes = (1 << 1),
151 kModelSelectable = (1 << 2),
152 kLightsInBlocks = (1 << 3),
153 kSkipViewClip = (1 << 4),
154 kIdentityXform = (1 << 5)
160 #ifdef ODA_DIAGNOSTICS
165 typedef std::pair<OdGsViewImpl*, OdUInt32>
ViewRef;
167 typedef std::pair<const OdGsBaseModule*, OdUInt32>
ModuleRef;
173 #ifdef ODGS_LOCAL_IDS
176 virtual OdUInt32 getMaxLocalViewportId()
const;
184 if(m_viewProps.size()>viewportId)
185 return m_viewProps[viewportId].isInvalid();
189 OdGsBaseModelImpl*
impl() {
return m_impl; }
206 , m_dTop(0.0), m_dBottom(0.0), m_visualStyle(
NULL) { }
219 if(m_viewProps.size()>viewportId)
220 m_viewProps[viewportId].setInvalid(val);
247 #ifdef ODGS_LOCAL_IDS
357 bool isIdentityTransform()
const;
396 double dTop,
double dBottom);
401 bool isViewClippingOverride()
const;
GS_TOOLKIT_EXPORT OdGiDrawablePtr fxOpenDrawable(OdGsBaseModel *, OdDbStub *)
#define GS_TOOLKIT_EXPORT
OdGiDrawablePtr(* OdGiOpenDrawableFn)(OdDbStub *id)
#define SETBIT(flags, bit, value)
#define GETBIT(flags, bit)
void removeModelReactor(OdGsModelReactor *pReactor)
void setRenderType(RenderType renderType)
bool isLightsInBlocksEnabled() const
void invalidateSectionableBlocks()
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 * visualStyle() const
OdDbStub * m_modelBackground
OdGiOpenDrawableFn m_openDrawableFn
virtual bool makeStock(OdDbStub *layoutId)
void invalidate(OdGsViewImpl &view, OdUInt32 mask)
void setEnableLinetypes(bool bEnable)
void setSelectable(bool bEnable)
void onModified(OdGiDrawable *pModified, OdDbStub *parentID)
OdVector< OdGsModelReactor *, OdMemoryAllocator< OdGsModelReactor * > > m_modelReactors
virtual void highlightImpl(const OdGiPathNode &path, bool bDoIt=true, const OdGsView *pView=NULL)
virtual void releaseStock(OdDbStub *layoutId)
OdDbStub * m_modelVisualStyle
OdGsBaseVectorizeDevice * refDevice() const
void onModified(OdGiDrawable *pModified, OdGiDrawable *pParent)
void onPropertyModifiedImpl(OdGsBaseModelReactor::ModelProperty nProp, bool &bReturnValue)
OdGsView::RenderMode renderModeOverride() const
OdArray< ViewProps > m_viewProps
virtual bool saveClientModelState(OdGsFiler *pFiler) const
void setVisualStyle(const OdGiVisualStyle &visualStyle)
virtual bool isViewPropsValid(OdUInt32 viewportId) const
void onUnerased(OdGiDrawable *pUnerased, OdGiDrawable *pParent)
OdGsMaterialCachePtr m_pMaterialCache
const SectioningSettings & getSectioning() const
virtual OdGsNode * gsNode(OdGiDrawable *pDrawable)
OdArray< ModuleRef, OdMemoryAllocator< ModuleRef > > m_modules
virtual void detach(OdGsNode *pNode)
void setEnableSectioning(bool bEnable)
virtual void invalidateEntRect(OdGsEntityNode *pNode, OdGsContainerNode *pParent, bool bForceIfNoExtents)
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)
virtual void clearChangedLayersList()
bool isLinetypesEnabled() const
OdGsBaseModelImpl * m_impl
void onModifiedNode(OdGsNode *pCache, OdGiDrawable *pDrawable, OdGiDrawable *pParent)
virtual OdGsLayerNode * gsLayerNode(OdDbStub *layerId, const OdGsBaseVectorizer *pView)
virtual void invalidateEntRect(OdGiDrawable *pDrawable, OdGiDrawable *pParent, bool bForceIfNoExtents=false)
OdGsLayerNode * m_pFirstChangedLayer
OdGsViewImpl * refView() const
const ViewPropsArray & getViewProps() const
void removeViewRef(OdGsViewImpl *pView)
bool postprocessModelLoading(OdGsFiler *pFiler)
OdVector< OdGsBaseModelReactor *, OdMemoryAllocator< OdGsBaseModelReactor * > > m_baseModelReactors
virtual bool saveModelState(OdGsFiler *pFiler, OdGsBaseVectorizer *pVectorizer=NULL) const
void addViewRef(OdGsViewImpl *pView)
OdGiOpenDrawableFn openDrawableFn() const
std::pair< OdGsViewImpl *, OdUInt32 > ViewRef
RenderType renderType() const
virtual OdGsNode * newNode(ENodeType ntp, const OdGiDrawable *drawable, bool bSetGsNode)
void setAdditionMode(AdditionMode mode)
virtual void updateViewProps(const OdGsViewImpl &viewport)
void setVisualStyle(OdDbStub *visualStyleId)
void setTransform(const OdGeMatrix3d &xForm)
bool setSectioning(const OdGePoint3dArray &points, const OdGeVector3d &upVector, double dTop, double dBottom)
void setEnableLightsInBlocks(bool bEnable)
void setSectioningVisualStyle(OdDbStub *visualStyleId)
AdditionMode additionMode() const
virtual void onErasedImpl(OdGiDrawable *pErased, OdGiDrawable *pParent)
bool isIdentityTransform() const
bool isViewClippingOverride() const
void addNode(OdGsNode *pNode)
void addModelReactor(OdGsModelReactor *pReactor)
void setBackground(OdDbStub *backgroundId)
virtual bool loadModelState(OdGsFiler *pFiler, OdGsBaseVectorizer *pVectorizer=NULL)
OdUInt32 viewChanges(OdUInt32 viewportId) const
const ViewProps & viewProps(OdUInt32 viewportId) const
OdGeMatrix3d transform() const
void detachAllFromDb(const OdDbBaseDatabase *pDb)
void highlight(const OdGiPathNode &path, bool bDoIt=true, const OdGsView *pView=NULL)
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)
virtual bool onPropertyModified(OdGsBaseModelReactor::ModelProperty nProp)
std::pair< const OdGsBaseModule *, OdUInt32 > ModuleRef
void setCheckFaded(bool bOn)
void onErased(OdGiDrawable *pErased, OdGiDrawable *pParent)
virtual void onModifiedImpl(OdGiDrawable *pModified, OdGiDrawable *pParent)
OdRxObjectPtr m_pGsReserved
OdGsBaseModelImpl * impl()
bool hasChangedLayers() const
OdGiDrawablePtr open(OdDbStub *objectId)
OdUInt32 refModulesCount() const
void onAdded(OdGiDrawable *pAdded, OdDbStub *parentID)
OdGsMaterialCache * materialCache()
void invalidateVisible(OdGsDevice *pDevice)
virtual void propagateLayerChanges(OdGsBaseVectorizeDevice &device)
OdDbStub * background() const
virtual bool loadClientModelState(OdGsFiler *pFiler)
void invalidate(OdGsView *pView)
bool setSectioning(const OdGePoint3dArray &points, const OdGeVector3d &upVector)
void onErased(OdGiDrawable *pErased, OdDbStub *parentID)
bool isSelectable() const
virtual bool onPropertyModified(OdGsModel *pModel, ModelProperty nProp)
virtual bool onHighlight(OdGsModel *pModel, const OdGiPathNode &path, bool bDoIt, const OdGsView *pView)
virtual bool onInvalidate(OdGsModel *pModel, OdGsModel::InvalidationHint hint)
virtual bool onInvalidate(OdGsModel *pModel, OdGsView *pView)
virtual RenderType renderType() const =0
StreamP open(const OdString &path, int acc=Read, Creation dispos=OpenExisting, Share sh=DenyNo)
OdGePoint3dArray m_points