CFx SDK Documentation  2022 SP0
daiModel.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_MODEL_H
25 #define _DAI_MODEL_H
26 
27 #include "daiSessionInstance.h"
28 #include "daiInstanceIterator.h"
29 #include "daiBaseType.h"
30 #include "daiSchema.h"
31 #include "daiEntityExtent.h"
32 
33 #include "SharedPtr.h"
34 #include "SmartPtr.h"
35 
36 #include "sdai.h"
37 
38 class OdExpSchemaModule;
40 
44 namespace OdDAI {
45 
46  //DOM-IGNORE-BEGIN
47  class ModelContents;
49 
50  class OdSpfFilerBase;
52 
56  class Model;
57  typedef OdSmartPtr<Model> ModelPtr; //DOM-IGNORE-END
58 
63  {
64  public:
65 
66  //DOM-IGNORE-BEGIN
68  Model();
69  //DOM-IGNORE-END
70 
75  void initialize(const OdAnsiString& schemaName);
76 
82  //void initialize(const OdAnsiString& schemaName, OdDAI::OdSpfFilerBasePtr& pFiler);
84 
85  /* \details
86  Retreives a name of the model.
87  \returns Returns a name of the model.
88  */
89  OdAnsiString name() const { return m_name; };
90 
91  /* \details
92  Retreives a repository which contains the model.
93  \returns Returns a pointer to the repository which contains the model.
94  */
95  Repository* repository() const { return m_repository; };
96 
101  void RenameModel(const OdAnsiString &modelName);
102 
103 
111  const OdDAI::Entity* getEntityDefinition(const char *entityName) const;
112 
118 
123  const OdAnsiString& underlyingSchemaName() const;
124 
131 
141  EntityInstancePtr createEntityInstance(const OdDAI::EntityPtr& entityDef);
142 
152  EntityInstancePtr createEntityInstance(const char *entityTypeName);
153 
164 
175  OdDAIObjectId insertEntityInstance(EntityInstancePtr pInstanceToInsert, const OdDbHandle& insertHandle);
176 
182 
188  //OdEntityExtentPtr getEntityExtent(const char *entityName) const;
189 
195  OdDAIObjectIdAggr* getEntityExtent(EntityPtr entityDef) const;
196 
206  OdDAIObjectIds getEntityExtent(const char *entityName) const;
207 
213 
217  void closeModel();
218 
222  void closeModel() const;
223 
228 
229 //DOM-IGNORE-BEGIN
230  protected:
231 
237 
243 
244  void name(const OdAnsiString &name) { m_name = name; };
245  void repository(Repository *repo) { m_repository = repo; };
246 
247  ModelContentsPtr createModelContents(const OdAnsiString &schemaName);
248  OdDAI::SchemaPtr getSchemaDef(const OdAnsiString &schemaName);
249  virtual void subInitialize() = 0;
250 
251  protected:
252  OdAnsiString m_name;
257 
258  private:
259  friend class Repository;
260  mutable SdaiAccessMode m_accessMode;
261 //DOM-IGNORE-END
262  };
263 
264 
265 }
266 
267 #endif // _DAI_MODEL_H
OdResult
Definition: OdResult.h:29
void repository(Repository *repo)
Definition: daiModel.h:245
OdDAIObjectId appendEntityInstance(EntityInstancePtr pInst)
const OdAnsiString & underlyingSchemaName() const
OdDAIObjectIds getEntityExtent(const char *entityName) const
const OdDAI::SchemaPtr underlyingSchema() const
ModelContentsPtr createModelContents(const OdAnsiString &schemaName)
OdDAIObjectId getEntityInstance(const OdDbHandle &h)
void RenameModel(const OdAnsiString &modelName)
virtual void subInitialize()=0
OdDAI::SchemaPtr getSchemaDef(const OdAnsiString &schemaName)
void PromoteModelToReadWrite() const
void initialize(OdDAI::SchemaPtr schema)
OdDAI::InstanceIteratorPtr newIterator()
EntityInstancePtr createEntityInstance(const OdDAI::EntityPtr &entityDef)
OdDAIObjectId insertEntityInstance(EntityInstancePtr pInstanceToInsert, const OdDbHandle &insertHandle)
SdaiAccessMode mode() const
ModelContentsPtr m_contents
Definition: daiModel.h:255
const OdDAI::Entity * getEntityDefinition(const char *entityName) const
Repository * m_repository
Definition: daiModel.h:256
OdDAIObjectIdAggr * getEntityExtent(EntityPtr entityDef) const
void closeModel() const
Repository * repository() const
Definition: daiModel.h:95
void closeModel()
OdAnsiString name() const
Definition: daiModel.h:89
SchemaModulePtr m_schemaModule
Definition: daiModel.h:254
void name(const OdAnsiString &name)
Definition: daiModel.h:244
OdAnsiString m_name
Definition: daiModel.h:252
ODRX_DECLARE_MEMBERS(Model)
OdResult in(OdDAI::OdSpfFilerBasePtr &rdFiler)
void out(OdDAI::OdSpfFilerBasePtr &wrFiler)
SchemaPtr m_underlyingSchema
Definition: daiModel.h:253
EntityInstancePtr createEntityInstance(const char *entityTypeName)
void initialize(const OdAnsiString &schemaName)
#define DAI_EXPORT
OdSmartPtr< OdExpSchemaModule > SchemaModulePtr
Definition: daiModel.h:38
GLuint const GLchar * name
Definition: gles2_ext.h:265
OdSmartPtr< OdSpfFilerBase > OdSpfFilerBasePtr
OdSmartPtr< ModelContents > ModelContentsPtr
Definition: daiModel.h:47
OdSmartPtr< Model > ModelPtr
Definition: daiModel.h:56
SdaiAccessMode
Definition: sdai.h:298