![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /****************************************************************************** 00002 ** Copyright (c) 2009 MAK Technologies, Inc. 00003 ** All rights reserved. 00004 ******************************************************************************/ 00005 /****************************************************************************** 00006 ** $RCSfile: DtAggregateCopyObject.h,v $ $Revision: 1.1 $ $State: Exp $ 00007 ******************************************************************************/ 00008 00011 00014 00015 #pragma once 00016 00017 #include <vrfGuiCore/vrfGuiCore.h> 00018 #include <vrfGuiCore/DtEntityCopyObject.h> 00019 #include <vrfGuiCore/DtVrfCopyPasteHandler.h> 00020 #include <vrvCore/DtElementIDHierarchy.h> 00021 #include <vrfGuiCore/DtVrfStateViewCollectionManager.h> 00022 00023 #include <vrvUtil/DtSignalConnectionManager.h> 00024 00025 class DtVrlinkSimulatedEntityState; 00026 00027 namespace makVrf 00028 { 00029 class DT_DLL_VRFGUICORE DtVrfAggregateCopyPasteHandler : public DtVrfCopyPasteHandler 00030 { 00031 public: 00032 DtVrfAggregateCopyPasteHandler(makVrv::DtDe&); 00033 virtual ~DtVrfAggregateCopyPasteHandler(); 00034 00035 void addObjectPasting(DtCopyObject* o) 00036 { 00037 myObjectsPasting.push_back(o); 00038 } 00039 00040 void centerPasteObjects(const DtGeodeticCoord&, const DtGeodeticCoord&); 00041 00042 protected: 00044 virtual DtCopyObject* createCopyObject(int) const; 00045 }; 00046 00047 class DT_DLL_VRFGUICORE DtAggregateCopyObject : public DtEntityCopyObject 00048 { 00049 00050 public: 00051 DtAggregateCopyObject(makVrv::DtDe&); 00052 virtual ~DtAggregateCopyObject(); 00053 00054 protected: 00056 virtual void write(std::ostringstream& str, const makVrv::DtVrlinkSimulatedEntityState* data, makVrv::DtUniqueID id); 00057 00059 virtual void read(std::istringstream& str, makVrv::DtVrlinkSimulatedEntityState* data); 00060 00062 virtual void copied(DtCopyObject*, const std::string&); 00063 00065 virtual void copyOperationPending(DtCopyObject*, const std::string&); 00066 00067 protected: 00070 virtual void createObject(const DtVector&); 00071 00073 virtual void pasteCompleted(); 00074 00076 virtual bool pasteComplete() const; 00077 00079 virtual std::string pastePendingMessage() const; 00080 00082 virtual void readComplete(std::istringstream& str); 00083 00085 virtual void pasted(DtCopyObject*); 00086 00088 virtual void pasteOperationPending(DtCopyObject*, const std::string&); 00089 00092 virtual void pasteCancelled(DtCopyObject*); 00093 00094 public: 00097 virtual bool copyOperationsPending() const; 00098 00099 protected: 00101 virtual void copyChildren(const makVrv::DtElementIDHierarchy::ElementIDs&); 00102 00104 virtual void cancel(); 00105 00106 virtual std::string copyPendingMessage() const; 00107 00108 virtual bool cancelComplete() const; 00109 00110 virtual void copy(makVrv::DtSimEntry* simEntry); 00111 00113 virtual void copyComplete(); 00114 00117 virtual makVrv::DtVrlinkSimulatedBaseState* createReadableStateData() const; 00118 00120 virtual DtEntityCreationData entityCreationData(const DtVector&); 00121 00123 virtual void processPasteStep(); 00124 00125 protected: 00126 DtVrfAggregateCopyPasteHandler myCopyPasteHandler; 00127 makVrv::DtSignalConnectionManager myCopyConnections; 00128 makVrv::DtSignalConnectionManager myPasteConnections; 00129 int myWaitingForChildren; 00130 bool myPasteComplete; 00131 bool myAwaitingSubordinateCreation; 00132 DtVector myAggregatePasteLocation; 00133 00134 typedef std::map<std::string, makVrv::DtElementID> AwaitingMap; 00135 00136 std::vector<makVrv::DtVrlinkSimulatedEntityState*> myPastedSubordinates; 00137 AwaitingMap myAwaitingOrganization; 00138 makVrv::DtStateView<makVrv::DtVrlinkSimulatedBaseState>* myAggregateStateView; 00139 }; 00140 00143 class DT_DLL_VRFGUICORE DtAggregateCopyObjectCreator : public DtCopyObjectCreator 00144 { 00145 public: 00146 virtual DtCopyObject* create(makVrv::DtDe&); 00147 }; 00148 }