![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /****************************************************************************** 00002 ** Copyright (c) 2011 MAK Technologies, Inc. 00003 ** All rights reserved. 00004 ******************************************************************************/ 00005 /****************************************************************************** 00006 ** $RCSfile: DtOsgGlStudioCockpit.h,v $ $Revision: 1.15 $ $State: Exp $ 00007 ******************************************************************************/ 00008 00012 #pragma once 00013 00014 #include <vrvGlStudioShared/DtGlStudioShared.h> 00015 #include <vrvCore/DtUniqueID.h> 00016 00017 #include <vlpi/oldSmoother.h> 00018 #include <vlutil/vlTime.h> 00019 00020 #include <string> 00021 #include <map> 00022 00023 namespace osg 00024 { 00025 class Switch; 00026 class Group; 00027 } 00028 00029 namespace makVrv 00030 { 00031 class DtDe; 00032 class DtGlStudioDrawable; 00033 class DtChannelSpecificGroup; 00034 class DtGlStudioEventProcessor; 00035 class DtMouseEvent; 00036 class DtChannelManager; 00037 class DtChannel; 00038 class DtChannelConfiguration; 00039 class DtWindowConfiguration; 00040 class DtGlStudioAttributeUpdater; 00041 class DtObserverObject; 00042 00047 class DT_DLL_VRVGLSTUDIOSHARED DtOsgGlStudioCockpit 00048 { 00049 public: 00050 enum DtPerspective {Dt2D, Dt3D}; 00051 typedef std::map<std::string, DtGlStudioAttributeUpdater*> DtAttributeUpdateMap; 00052 00053 DtOsgGlStudioCockpit(DtDe& de, DtUniqueID id); 00054 virtual ~DtOsgGlStudioCockpit(); 00055 00056 //@name Distributed Interface 00058 00061 virtual void createCockpit(const std::string& filename, const std::string& rsoName, DtPerspective p); 00062 00063 virtual void removeCockpit(); 00064 00066 virtual void setProperty(const std::string& prop, const std::string& val); 00067 00069 virtual void setChannelKeyword(const std::string& channelKeyword); 00070 00072 virtual void setPerspective(const double& width, const double& height); 00073 00075 virtual void setOffset(const double& x, const double& y, const double& z); 00076 00078 virtual void setVisible(bool vis); 00079 00081 virtual void addUpdater(const std::string& name, const std::string& type); 00082 00085 virtual void updateTSPI(const DtVector& loc, const DtVector& vel, 00086 const DtVector& accel, const DtTaitBryan& orient, 00087 const DtVector& rotVel, int algorithm); 00088 00090 virtual void setObserverName(const std::string& obsName); 00091 00093 00094 //@name Local Interface 00096 00099 virtual std::string className() const; 00100 00102 DtUniqueID uniqueID() const; 00103 00105 virtual bool handleMouseInput(const DtMouseEvent& ea); 00106 00108 virtual double update(); 00109 00111 00112 protected: 00113 //attributes of the current entity 00114 DtAttributeUpdateMap myAttributeUpdaters; 00115 00117 virtual void initGlStudio(); 00118 00120 virtual osg::Group* createOverlayObjects(); 00121 00124 virtual osg::Group* createChannelNode(); 00125 00127 virtual void deepRemoveChildren(osg::Group* g); 00128 00130 virtual void slot_channelAdded(DtChannelManager* mgr, DtChannel* channel); 00131 00133 virtual void slot_channelDestroyed(DtChannelManager* mgr, DtChannel* channel); 00134 00136 virtual void slot_channelModified(const std::string& deName, const std::string& windowName, 00137 const std::string& channelName, const DtChannelConfiguration& config); 00138 00140 virtual void slot_smoothingEnabled(bool smooth); 00142 virtual void slot_smoothingPeriod(const double& period); 00143 00144 virtual void slot_projectionChanged( DtObserverObject*, bool is2D ); 00145 00146 DtDe& myDe; 00147 DtUniqueID myId; 00148 std::string myRsoName; 00149 std::string myFilename; 00150 double myWidth; 00151 double myHeight; 00152 DtPerspective myPerspective; 00153 std::string myChannelKeyword; 00154 double myOffsetX; 00155 double myOffsetY; 00156 double myOffsetZ; 00157 std::string myObserverName; 00158 bool myIsVisible; 00159 bool myObserverIs2D; 00160 00161 osg::Group* myGlStudioGroup; 00162 osg::Switch* myViewSwitchNode; 00163 DtChannelSpecificGroup* myChannelNode; 00164 DtGlStudioDrawable* myGlStudioComponent; 00165 DtGlStudioEventProcessor* myEventProcessor; 00166 00167 bool myHasSmootherValues; 00168 DtOldSmoother mySmoother; 00169 DtClock myClock; 00170 double myPreviousTime; 00171 double myCurrentTime; 00172 }; 00173 }