BIMHome v1.0.0
BIMHome接口文档说明
DocumentObjectObserverDelegate.h
浏览该文件的文档.
1/************************************************************************
2* @file DocumentObjectObserverDelegate.h
3*
4* @brief 文档元素DocumentObject的代理类
5*
6* @details 文档元素DocumentObject的代理类
7*
8* @author sunpeng
9*
10* @version 1.0
11*
12* @date 2025-05-27
13*
14* @license 北京华科软科技有限公司
15*
16*************************************************************************/
17
18#ifndef BIMHOMEAPP_APP_DOCUMENTOBJECTOBSERVERDELEGATE_H
19#define BIMHOMEAPP_APP_DOCUMENTOBJECTOBSERVERDELEGATE_H
20
21#include "BHGlobal.h"
22#include "boost/any.hpp"
23
24namespace App
25{
26 class IDocumentObject;
33 {
34 public:
41 virtual void documentObjectCreating() {}
42
48
55 virtual void documentObjectOnChange(const std::string& sPropName, const boost::any& sPropValue) {};
56
61 virtual void documentObjectExecute() {}
62
68 virtual const char* getViewProviderName() const { return ""; }
69
75 m_pDocObj = pDocObj;
76 }
77
83 virtual std::string delegateName() = 0;
84
89 App::IDocumentObject* getDocumentObject() { return m_pDocObj; }
90
96 virtual std::string getViewProviderDelegateName() { return ""; }
97
105 void addDynamicProperty(const char* type, const char* name, const boost::any& value);
106
113 boost::any getDynamicPoperty(const char* name) const;
114
121 bool hasDynamicPropertyByGivingName(const char* name) const;
122
129 double anyToDouble(const boost::any& value);
130
137 std::string anyToString(const boost::any& value);
138
145 bool anyToBool(const boost::any& value);
146
147 protected:
149 };
150}
151
152#endif // BIMHOMEAPP_APP_DOCUMENTOBJECTOBSERVERDELEGATE_H
App::IDocumentObject * getDocumentObject()
获取文档对象
Definition DocumentObjectObserverDelegate.h:89
virtual void documentObjectIsBeingDestructed()
文档对象即将析构时回调
Definition DocumentObjectObserverDelegate.h:47
virtual ~DocumentObjectObserverDelegate()
Definition DocumentObjectObserverDelegate.h:36
virtual std::string delegateName()=0
获取代理名称
double anyToDouble(const boost::any &value)
将 any 类型转换为 double
App::IDocumentObject * m_pDocObj
当前关联的文档对象指针
Definition DocumentObjectObserverDelegate.h:148
bool anyToBool(const boost::any &value)
将 any 类型转换为 bool
boost::any getDynamicPoperty(const char *name) const
获取动态属性
virtual void documentObjectOnChange(const std::string &sPropName, const boost::any &sPropValue)
文档对象属性改变时调用
Definition DocumentObjectObserverDelegate.h:55
void addDynamicProperty(const char *type, const char *name, const boost::any &value)
添加动态属性
void setDocumentObject(App::IDocumentObject *pDocObj)
设置文档对象
Definition DocumentObjectObserverDelegate.h:74
bool hasDynamicPropertyByGivingName(const char *name) const
检查是否存在指定名称的动态属性
virtual void documentObjectExecute()
文档对象执行时调用
Definition DocumentObjectObserverDelegate.h:61
virtual void documentObjectCreating()
文档对象开始创建时回调
Definition DocumentObjectObserverDelegate.h:41
virtual std::string getViewProviderDelegateName()
获取视图提供者代理名称
Definition DocumentObjectObserverDelegate.h:96
DocumentObjectObserverDelegate()
Definition DocumentObjectObserverDelegate.h:35
virtual const char * getViewProviderName() const
获取视图提供者名称
Definition DocumentObjectObserverDelegate.h:68
std::string anyToString(const boost::any &value)
将 any 类型转换为 string
文档对象观察者代理基类
Definition DocumentObjectObserverDelegate.h:33
Definition IDocumentObject.h:35
Definition BaseFigureFactory.h:28