![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 00002 /****************************************************************************** 00003 ** Copyright (c) 2009 MAK Technologies, Inc. 00004 ** All rights reserved. 00005 ******************************************************************************/ 00006 /****************************************************************************** 00007 ** $RCSfile: bhaveGuiManager.h,v $ $Revision: 1.1 $ $State: Exp $ 00008 ******************************************************************************/ 00009 00012 00013 #pragma once 00014 00015 #include <bhave3DGui/bhave3DGuiDefines.h> 00016 #include "bhaveMsgs/ifSpawnList.h" 00017 00018 #include <vrfGuiCore/entityMapperKey.h> 00019 #include <vrvUtil/DtSignalConnectionManager.h> 00020 #include <vrvCore/DtEntityState.h> 00021 00022 #include <vector> 00023 00024 //Vantage 00025 #include <vrvUtil/DtVirtualBaseClass.h> 00026 #include <vrvCore/DtDe.h> 00027 00028 //VRLink 00029 #include <vlpi/entityType.h> 00030 00031 00032 #include <boost/signal.hpp> 00033 00034 00035 class DtBhavePluginOptions; 00036 class DtSimMessage; 00037 class QString; 00038 class DtSimCommand; 00039 00040 namespace makVrf 00041 { 00042 class DtEntityCreatePaletteInterface; 00043 } 00044 00045 namespace makVrv 00046 { 00047 class DtSimObjectEntry; 00048 } 00049 00050 namespace BHAVE 00051 { 00052 namespace BHAVE3DGui 00053 { 00054 00058 class DT_DLL_bhave3DGui DtBhaveGuiManager : public makVrv::DtVirtualBaseClass 00059 { 00060 00061 public: 00062 00064 DtBhaveGuiManager(makVrv::DtDe&); 00065 00067 virtual ~DtBhaveGuiManager(); 00068 00070 static DtBhaveGuiManager& instance(makVrv::DtDe& de); 00071 00073 virtual bool init(); 00074 00076 virtual DtBhavePluginOptions* pluginOptions(); 00077 virtual void requestSpawnTemplateList(); 00078 00079 virtual const SpawnTemplateDescriptionList& spawnPatternList() const; 00081 virtual bool setPatternList( const SpawnTemplateDescriptionList & list); 00082 00083 virtual const SpawnTemplateDescriptionList & patternList() const; 00084 virtual SpawnTemplateDescriptionList & patternList(); 00085 00087 virtual void slot_updateCreationPalette(makVrf::DtEntityCreatePaletteInterface* palette); 00088 00090 00093 virtual void slot_spawnCreateObject(const DtEntityType&, std::string, int, const std::vector<DtVector>&, double, bool, bool, const QString&); 00094 00097 virtual void slot_sinkCreateObject(const DtEntityType&, std::string, int, const std::vector<DtVector>&, double, bool, bool, const QString&); 00098 00100 static int nextSpawnNumber(); 00102 static int nextSinkNumber(); 00103 00105 virtual void slot_commandRequestToBeAddedToPlan(DtSimCommand&, bool forEdit); 00106 00107 public: 00108 boost::signal<void (const SpawnTemplateDescriptionList &)> signal_patternListUpdated; 00109 boost::signal<void (const SpawnTemplateDescriptionList &)> signal_spawnSinkPointCountUpdated; 00110 00111 boost::signal<void (const DtString&)> signal_spawnPointAdded; 00112 boost::signal<void (const DtString&)> signal_sinkPointAdded; 00113 00114 boost::signal<void (const DtString&)> signal_spawnPointRemoved; 00115 boost::signal<void (const DtString&)> signal_sinkPointRemoved; 00116 00117 protected: 00118 virtual DtString sinkPointName(const DtString& templateName) const; 00119 virtual DtString spawnPointName(const DtString& templateName) const; 00120 00123 virtual void updateCreateMenuWithSpawnAndSinkPoints(makVrf::DtEntityCreatePaletteInterface* palette); 00124 00126 virtual void removePaletteItems(makVrf::DtEntityCreatePaletteInterface* iFace); 00127 00129 virtual void removeCreateMenuItems(makVrf::DtEntityCreatePaletteInterface* palette); 00130 00133 virtual void slot_simStateAdded(makVrv::DtSimObjectEntry& e); 00134 00136 virtual void slot_simObjectEntryAboutToBeRemoved(makVrv::DtSimObjectEntry& e); 00137 00139 virtual void resetCounters(); 00140 00141 protected: 00142 00143 virtual void processTemplateList(DtSimMessage* rsp); 00144 virtual int indexOfTemplate(DtString& tempName); 00145 00146 virtual void completeInitialization(); 00147 00148 virtual void addPotentialSpawnSinkPoint(const makVrv::DtVrlinkSimulatedBaseState&); 00149 virtual void removePotentialSpawnSinkPoint(const std::string& templateName, const DtEntityType& t); 00150 00151 virtual void slot_stateViewUpdated(makVrv::DtStateView<makVrv::DtVrlinkSimulatedBaseState>* s); 00152 00153 protected: 00154 00155 makVrv::DtDe& myDe; 00156 DtBhavePluginOptions* myBhavePluginOptions; 00157 SpawnTemplateDescriptionList myPatternList; 00158 00159 makVrv::DtSignalConnectionManager myConnectionManager; 00160 00162 static int theNextSinkNumber; 00163 static int theNextSpawnNumber; 00164 00165 struct TemplateInfo 00166 { 00167 std::string templateName; 00168 std::string templateType; 00169 }; 00170 00171 typedef std::map<makVrv::DtUniqueID, TemplateInfo> UniqueIdToTemplateInfo; 00172 UniqueIdToTemplateInfo myUniqueIdToTemplateInfo; 00173 }; 00174 } 00175 } 00176