VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtMetaObjectCreator.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2023 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvOsg/vrvOsg.h>
13 
15 
16 #include <vrvCore/DtUniqueID.h>
17 #include <vrvCore/DtDe.h>
19 
21 
22 
23 #include <rapidjson/document.h>
24 
25 #include <osg/Node>
26 
27 namespace makVrv
28 {
29  class DtOsgArticulatedModel;
30 
36  {
37  public:
40 
42  virtual ~DtMetaObjectCreator();
43  public:
45  virtual DtVirtualBaseClass* create(DtDe& de, osg::Node* node,
46  DtOsgArticulatedModel* osgArticulatedModel,
47  const rapidjson::Value& jsonObject, const std::string& modelDefName,
48  const DtElementID elementId, const DtUniqueID uniqueId
49  , const unsigned int nodeTypeIndex) = 0;
50  };
51 
52  template<class TickableToCreate, bool add>
54  {
55  public:
58  {
59 
60  }
61 
64  {
65 
66  }
67 
68  public:
69  virtual TickableToCreate* create(DtDe& de, osg::Node* node,
70  DtOsgArticulatedModel* osgArticulatedModel,
71  const rapidjson::Value& jsonObject, const std::string& modelDefName,
72  const DtElementID elementId, const DtUniqueID uniqueId
73  , const unsigned int nodeTypeIndex)
74  {
75  DtUniqueID parentSceneObjectId = 0;
76  if (osgArticulatedModel)
77  {
78  parentSceneObjectId = osgArticulatedModel->sceneObjectId();
79  }
80 
81  TickableToCreate* tickable = new TickableToCreate(de,
82  elementId, parentSceneObjectId, uniqueId, nodeTypeIndex, osgArticulatedModel);
83  tickable->configure(node, jsonObject);
84 
85  if (add)
86  {
87  // This object is tickable, so add ourselves to the tickable manager
89  }
90 
91  return tickable;
92  }
93  };
94 }
Virtual base class. Allows for RTTI and proper virtual destruction. Used by Creators, Factories, Providers, Assemblers and User Interfaces.
Definition: DtVirtualBaseClass.h:19
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
DtUniqueID sceneObjectId() const
Parent of the model.
DtTemplatedTickableCreator()
CTOR.
Definition: DtMetaObjectCreator.h:57
Contains makVrv::DtDe class.
An articulated model manipulator for controlling an articulated model. Supports indirect rendering of...
Definition: DtOsgArticulatedModel.h:67
DtUniqueID DtElementID
The ElementID is a specific type of unique ID used to represent VR-Vantage uniquely defined elements...
Definition: DtUniqueID.h:23
Contains makVrv::DtVirtualBaseClass class.
virtual bool addTickableObject(DtTickable *ticObj)=0
Add a DtTickable object to this manager.
virtual TickableToCreate * create(DtDe &de, osg::Node *node, DtOsgArticulatedModel *osgArticulatedModel, const rapidjson::Value &jsonObject, const std::string &modelDefName, const DtElementID elementId, const DtUniqueID uniqueId, const unsigned int nodeTypeIndex)
Creator method.
Definition: DtMetaObjectCreator.h:69
Definition: DtMetaObjectCreator.h:53
IMGUI_API void Value(const char *prefix, bool b)
unsigned long long DtUniqueID
Definition: DtUniqueID.h:19
virtual DtRenderer & renderer() const
Get the renderer.
Contains makVrv::DtUniqueID type.
Contains DLL export macros.
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:76
Contains the makVrv::DtOsgArticulatedModel class declaration.
DtTickableManagerInterface & tickableManager()
Get the scene manager&#39;s attachable scene object manager.
virtual ~DtTemplatedTickableCreator()
DTOR.
Definition: DtMetaObjectCreator.h:63
Contains the declaration for makVrv::DtTickableManager.
Abstract dynamic feature creator class. A dynamic feature retrieves data from a .meta file and applie...
Definition: DtMetaObjectCreator.h:35

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)