VR-Forces 4.0.4 Class Documentation
include/vrvVrl/DtAggregateElement.h
Go to the documentation of this file.
00001 /******************************************************************************
00002 ** Copyright (c) 2009 MAK Technologies, Inc.
00003 ** All rights reserved.
00004 ******************************************************************************/
00005 /******************************************************************************
00006 ** $RCSfile: DtAggregateElement.h,v $ $Revision: 1.17 $ $State: Exp $
00007 ******************************************************************************/
00008 
00012 
00013 #pragma once
00014 
00015 #include <vrvVrl/vrvVrl.h>
00016 #include <vrvUtil/DtSignalConnectionManager.h>
00017 #include <vrvCore/DtAggregateVisualizerSet.h>
00018 #include <vrvVrl/DtVrlinkElement.h>
00019 #include <boost/unordered_map.hpp>
00020 
00021 namespace makVrv
00022 {
00023    class DtStateVisualizerFactory;
00024 
00025    namespace DT_PROTOCOL_NAMESPACE
00026    {
00027       class DtVrlinkConnection;
00028       class DtVrlinkAggregateStateListener;
00029 
00033       class DL_DLL_IGCONVRLINK DtAggregateElement : public DtVrlinkElement
00034       {
00035       public:
00036 
00037          typedef boost::unordered_map<int, DtAggregateVisualizerSet*> ModelSetMap;
00038         
00040          DtAggregateElement( DtVrlinkConnection& conn, DtVrlinkAggregateStateListener& listener );
00041 
00043          ~DtAggregateElement();
00044          
00046          void visualize(const DtSharedModelSetSettings::ModelSetVisualizedMap& sets);
00047          
00049          virtual void setVisible(bool visible);
00050 
00052          virtual void show(DtShowHideContext::ShowHideContext);
00053          virtual void hide(DtShowHideContext::ShowHideContext);
00054 
00057          void setModelSetEnabled( int modelSet, bool enabled );
00058          
00060          inline const ModelSetMap& modelSetMap() const
00061          {
00062             return myAggregateModelSetMap;
00063          }
00064 
00065          template <typename VisualizerClass>
00066          void findVisualizers(std::vector<VisualizerClass*>& visualizers)
00067          {
00068             ModelSetMap::iterator i = myAggregateModelSetMap.begin();
00069             ModelSetMap::iterator e = myAggregateModelSetMap.end();
00070             for(;i != e;++i)
00071             {
00072                i->second->findVisualizers(visualizers);
00073             }
00074          }
00075          
00077          inline DtVrlinkAggregateStateListener& listener()
00078          {
00079             return myListener;
00080          }
00081 
00082          virtual DtElementEntry::ObjectType elementType() const
00083          {
00084             return DtElementEntry::Aggregate;
00085          }
00086 
00088          virtual void slot_subordinatesChanged();
00089 
00090          boost::signal<void (DtAggregateElement*)> signal_subordinatesChanged;
00091 
00092       protected:
00093 
00095          virtual void updateVisibilityStates();
00096 
00100          virtual void updateVisibilityState(DtAggregateVisualizerSet*);
00101 
00102          virtual void getDefinitions( std::vector<DtUnicode>& definitions );
00103 
00104       protected:
00105 
00106          ModelSetMap myAggregateModelSetMap;
00107          DtVrlinkConnection& myVrlinkConnection;
00108          DtVrlinkAggregateStateListener& myListener;
00109          DtSignalConnectionManager myConnections;
00110       };
00111    }
00112 }

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)