VR-Forces 4.0.4 Class Documentation
include/vrfGuiCore/DtRangeSphereVisualizer.h
Go to the documentation of this file.
00001 /*****************************************************************************
00002  * Copyright (c) 2011 MAK Technologies, Inc.
00003  * All rights reserved.
00004  *****************************************************************************/
00005 
00009 
00010 #pragma once
00011 
00012 #include <vrfGuiCore/vrfGuiCore.h>
00013 #include <vrvCore/DtStateVisualizer.h>
00014 #include <vrvUtil/DtUnicode.h>
00015 
00016 namespace makVrv
00017 {
00018    class DtEllipsoidArcModelAgent;
00019    class DtOverlaySegmentedLineModelAgent;
00020    class DtAttachableUpdaterAgent;
00021    class DtWidgetLabelAgent;
00022    class DtProjectedWidgetModelAgent;
00023 }
00024 
00025 namespace makVrf
00026 {
00027    class DtEntityStateListenerExtensions;
00028 
00031    class DT_DLL_VRFGUICORE DtRangeSphereVisualizer : public makVrv::DtStateVisualizer
00032    {
00033    protected:
00034       struct SphereStruct
00035       {
00036          int myType;
00037          makVrv::DtEllipsoidArcModelAgent* myRangeSphere;
00038          makVrv::DtSceneObjectAgent* mySceneObjectAgent;
00039          makVrv::DtAttachableUpdaterAgent* myUpdater;
00040          makVrv::DtSceneObjectAgent* mySphereSceneObjectAgent;
00041          makVrv::DtAttachableUpdaterAgent* mySphereUpdater;
00042          makVrv::DtOverlaySegmentedLineModelAgent* myHeightLine;
00043       };
00044 
00045    public:
00046 
00048       DtRangeSphereVisualizer( makVrv::DtBaseConnection& connection,
00049          makVrv::DtStateListener& listener, int modelSet );
00050 
00052       virtual ~DtRangeSphereVisualizer();
00053 
00054       //connect method called in the creator class
00055       virtual void connect();
00056 
00057       //connect method called in the destructor
00058       virtual void disconnect();
00059 
00060       //initialize method called in the creator class
00061       virtual void initialize_settings();
00062 
00064       virtual void setVisualizerDefinition( const makVrv::DtVisualizerDefinition& visDef );
00065 
00066       virtual void setModelDefinitionForAgents();
00067 
00069       virtual const makVrv::DtStateVisualizer::TypeInfo& typeInfo() const;
00070 
00072       static const makVrv::DtStateVisualizer::TypeInfo& theTypeInfo();
00073 
00075       static const makVrv::DtVisualizerSchema& theDtRangeSphereSchema();
00076       
00077       virtual bool setVisible( bool onOff, int contextInt );//Override of parent class to ensure agreement between entity scene object and range ring
00078       virtual void setShowRangeSphere(bool); //reflects whether "Draw 3d Rings" checkbox is active
00079       virtual void setScale(float); //Scale is used solely to determine the width of the height line
00080 
00081    protected:
00082 
00083       virtual void tryToDraw();//checks whether the appropriate flags are set and then creates or destroys model agents as appropriate
00084       virtual void createModelAgents(); //overrides the base class method and tries to draw spheres contingent on settings
00085       virtual void destroyModelAgents();
00086 
00087       virtual SphereStruct addNewRangeSphere();
00088       virtual void destroyLastRangeSphere();
00089 
00090       virtual void setRangeSphereColors();
00091       virtual void slot_entityRangeRingsEnabled(const std::string& markingText, int setting);
00092       virtual void setRangeSphereGeometry();
00093       virtual void setRangeSphereCount( int );
00094 
00095    protected:
00096       std::vector<SphereStruct> myRangeSpheres;
00097       DtEntityStateListenerExtensions* myExtensions;
00098       bool myShowRangeSphere;
00099       bool myEntityRangeRingsEnabled;
00100       float myScale;
00101    };
00102    //The creator class is normally templated in visualizers, but I want to split out the 
00104    class DtRangeSphereVisualizerCreator: public makVrv::DtStateVisualizerCreator
00105    {
00106    public:
00107 
00109       DtRangeSphereVisualizerCreator();
00110 
00112       virtual ~DtRangeSphereVisualizerCreator();
00113 
00114       virtual DtRangeSphereVisualizerCreator* clone() const;
00115 
00117       virtual makVrv::DtStateVisualizer* create(makVrv::DtBaseConnection& simulation, makVrv::DtStateListener& listener, int modelSet) const;
00118 
00120       virtual const makVrv::DtStateVisualizer::TypeInfo& visualizerTypeInfo() const;
00121 
00122       virtual const std::string& tag();
00123    };
00124 }

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)