VR-Forces 4.0.4 Class Documentation
include/vrvCore/DtDriver.h
Go to the documentation of this file.
00001 /******************************************************************************
00002 ** Copyright (c) 2010 MAK Technologies, Inc.
00003 ** All rights reserved.
00004 ******************************************************************************/
00005 /******************************************************************************
00006 ** $RCSfile: DtDriver.h,v $ $Revision: 1.43 $ $State: Exp $
00007 ******************************************************************************/
00008 
00012 
00013 #pragma once
00014 #include <vrvCore/vrvCore.h>
00015 #include <vrvUtil/DtVirtualBaseClass.h>
00016 #include <vrvUtil/DtConfiguration.h>
00017 #include <vrvCore/DtElementChanges.h>
00018 #include <vrvCore/DtElementEntry.h>
00019 
00020 #include <string>
00021 #include <list>
00022 
00023 namespace makVrv
00024 {
00025    class DtAgentManager;
00026    class DtAgentManagerInterface;
00027    class DtDeRecord;
00028    
00029 
00039    class DT_DLL_VRVCORE DtDriver
00040    {
00041 
00042    public:
00043 
00044       friend class DtDriverManager;
00045       
00047       DtDriver(DtAgentManager& agentManager, const std::string& instanceName);
00048 
00050       virtual ~DtDriver();
00051 
00053       virtual void realizeConfiguration(const DtConfiguration& configuration);
00054 
00056       virtual DtConfiguration createConfiguration() const;
00057 
00061       DtAgentManager& agentManager();
00062 
00064       virtual DtAgentManagerInterface& sceneInterface();
00065 
00067       inline bool started() const
00068       {
00069          return myStartedFlag;
00070       }
00071 
00073       virtual const std::string& className() const = 0;
00074 
00076       virtual const std::string& instanceName() const;
00077 
00080       virtual bool autoStart() const;
00081 
00084       virtual void setAutoStart(bool autoStart);
00085 
00089       virtual bool isWindowDependent() const;
00090 
00094       virtual void setIsWindowDependent(bool dep);
00095 
00098       virtual void setIsUserControllable(bool);
00099 
00102       virtual bool isUserControllable() const;
00103 
00106       virtual void setIsPersistent(bool per);
00107 
00110       virtual bool isPersistent() const;
00111 
00114       virtual bool isOnDriverSelectionList() const;
00115 
00118       virtual void setOnDriverSelectionList(bool);
00119 
00122       bool objectFromAgentManager(const DtUniqueID& id) const;
00123 
00124    protected:
00125 
00129       void applyChangesAndDelete(DtElementChanges* changes);
00130 
00132       void reportElementCreated(DtElementID id, DtElementID parentId,
00133          DtElementEntry::ElementType type);
00134       
00137       void reportElementAttribute(DtElementID id, DtElementAttribute* attribute);
00138 
00140       void reportElementDestroyed(DtElementID id);
00141 
00144       void start();
00145 
00148       void stop();
00149 
00153       bool tick();
00154 
00159       virtual bool onStart() = 0;
00160 
00165       virtual bool onStop() = 0;
00166 
00170       virtual bool onTick() = 0;
00171 
00174       virtual void slot_displayEngineAdded(const DtDeRecord& igRecord);
00175 
00180       virtual void setInstanceName(const std::string& name);
00181 
00185       virtual void installAccessories();
00186 
00190       virtual void uninstallAccessories();
00191       
00192    protected:
00193 
00194       DtAgentManager& myAgentManager;
00195       bool myStartedFlag;
00196       std::string myName;
00197       DtConfiguration myConfiguration;
00198 
00199       bool myPersistentFlag;
00200       bool myUserControllableFlag;
00201       bool myRequestStateDiffPendingFlag;  
00202       DtElementChanges myChanges;
00203 
00204    };
00205 
00206 
00209    class DT_DLL_VRVCORE DtDriverCreator
00210    {
00211    public:
00212 
00214       DtDriverCreator();
00215 
00217       virtual ~DtDriverCreator();
00218 
00222       virtual const std::string& extension() const = 0;
00223 
00225       virtual DtDriver* create(DtAgentManager& agentManager, 
00226          const std::string& instanceName) const = 0;
00227    };
00228 
00229 }

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)