CFx SDK Documentation  2023 SP0
daiEntityInstance.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2019, 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-2019 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 _DAI_ENTITY_INSTANCE_H_
25 #define _DAI_ENTITY_INSTANCE_H_
26 
27 #include "OdaCommon.h"
28 #include "Gi/GiDrawable.h"
29 #include "RxValue.h"
30 
34 namespace OdDAI {
35 
36  class Model;
37  class Entity;
38  class OdSpfFilerBase;
39 
40  class Attribute;
42 
47  {
48  //DOM-IGNORE-BEGIN
50  //DOM-IGNORE-END
51 
55  EntityInstance() : m_id(NULL) {};
56 
61  Model* owningModel() const;
62 
70  virtual OdResult inFields(OdSpfFilerBase *rdFiler) { return eNotImplemented; };
71 
79  virtual OdResult outFields(OdSpfFilerBase *wrFiler) { return eNotImplemented; };
80 
84  virtual void setInverseCounterParts() {};
85 
89  virtual void resetInverseCounterParts() {};
90 
96  bool isInstanceOf(const char *entityName) const;
97 
103  bool isInstanceOf(const Entity *entityDef) const;
104 
110  bool isKindOf(const char *entityName) const;
111 
117  bool isKindOf(const Entity *entityDef) const;
118 
123  virtual Entity* getInstanceType() const = 0;
124 
129  virtual OdAnsiString typeName() const = 0;
130 
139  virtual OdRxValue getAttr(const OdAnsiString &attrName) const = 0;
140 
147  virtual bool putAttr(const OdAnsiString &explicitAttrName, const OdRxValue &val) = 0;
148 
154  virtual bool testAttr(const OdAnsiString &attrName) const = 0;
155 
161  virtual bool testAttr(const AttributePtr& attribute) const;
162 
163 
168  virtual void unsetAttr(const OdAnsiString &explicitAttrName) = 0;
169 
174  virtual void unsetAttr(const AttributePtr& attribute);
175 
182  virtual bool isPersistent() const { return m_id != NULL; }
183 
190  virtual OdDbStub* id() const { return m_id; };
191 
196  virtual void setGsNode(OdGsCache* pGsNode) { throw OdError(eNotImplemented); };
197 
202  virtual OdGsCache* gsNode() const { throw OdError(eNotImplemented); };
203 
204 //DOM-IGNORE-BEGIN
205  protected:
206 
208  virtual bool subWorldDraw(OdGiWorldDraw * wd) const { throw OdError(eNotImplemented); };
209  virtual void subViewportDraw(OdGiViewportDraw * vd) const {};
210 
211  protected:
212  OdDbStub *m_id;
213 
214  friend class ModelContents;
215 //DOM-IGNORE-END
216  };
217 
222 
223 }
224 
225 #endif // _DAI_ENTITY_INSTANCE_H_
#define eNotImplemented
#define NULL
Definition: GsProperties.h:177
unsigned int OdUInt32
OdResult
Definition: OdResult.h:29
#define ODRX_DECLARE_MEMBERS(ClassName)
Definition: RxObject.h:131
virtual void subViewportDraw(OdGiViewportDraw *vd) const
virtual bool subWorldDraw(OdGiWorldDraw *wd) const
virtual OdUInt32 subSetAttributes(OdGiDrawableTraits *traits) const
#define DAI_EXPORT
OdSmartPtr< Attribute > AttributePtr
OdSmartPtr< EntityInstance > EntityInstancePtr