![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /***************************************************************************** 00002 * Copyright (c) 2012 MAK Technologies, Inc. 00003 * All rights reserved. 00004 *****************************************************************************/ 00005 00009 00010 #pragma once 00011 00012 #include <vrvCore/DtSceneObjectVisualizer.h> 00013 #include <vrvCore/DtSceneObject.h> 00014 #include <matrix/vlVector.h> 00015 #include <vector> 00016 00017 namespace makVrv 00018 { 00019 00020 class DtCoordinateSystem; 00021 class DtAttachableUpdaterAgent; 00022 class DtAttributeGroupWidgetAgent; 00023 class DtProjectedWidgetModelAgent; 00024 class DtEnvironmentalVisualizerSet; 00025 class DtEnvironmentalStateListener; 00026 class DtIntervisibilityStateListener; 00027 00032 class DT_DLL_VRVCORE DtIntervisibilityVertexVisualizer 00033 : public DtSceneObjectVisualizer 00034 { 00035 public: 00036 00038 DtIntervisibilityVertexVisualizer( DtBaseConnection& conn, 00039 DtStateListener& listener, int modelSet ); 00040 00042 virtual ~DtIntervisibilityVertexVisualizer(); 00043 00044 DtIntervisibilityStateListener& intervisibilityStateListener() 00045 { 00046 return *myIntervisibilityListener; 00047 } 00048 00050 virtual void setColor( float r, float g, float b, float a ); 00051 00054 virtual void setStartPoint( const DtVector& vec ); 00055 00058 virtual void setEndPoint( const DtVector& vec ); 00059 00062 virtual void setStartAttachPoint( DtElementID elementId ); 00063 00065 virtual void setStartPointOffset( const DtVector& vec ); 00066 00069 virtual void setEndAttachPoint( DtElementID elementId ); 00070 00072 virtual void setEndPointOffset( const DtVector& vec ); 00073 00075 virtual void setSelected( int index, bool isSelected ); 00076 00078 virtual void setSelected( bool isSelected ); 00079 00081 virtual void setFixedDistanceMode( bool isFixedDistMode ); 00082 00084 virtual int indexOfVertex( DtUniqueID id ) const; 00085 00087 virtual const DtStateVisualizer::TypeInfo& typeInfo() const; 00088 00090 static const DtStateVisualizer::TypeInfo& theTypeInfo(); 00091 00092 protected: 00093 00094 struct VertexInformation; 00095 00096 virtual void createStartPoint(); 00097 virtual void createEndPoint(); 00098 virtual void createModelAgents(); 00099 virtual void destroyModelAgents(); 00100 virtual DtUniqueID elementIdToSceneId( DtElementID elementId ); 00101 00103 virtual DtEnvironmentalVisualizerSet* createVertexVisualizer( VertexInformation& vertexInfo ); 00104 00105 virtual void createRangeInfoWidget( VertexInformation& vertexInfo ); 00106 00107 virtual void setVisualizerDefinition( const DtVisualizerDefinition& visDef ); 00108 00109 virtual void slot_mouseDown( DtMouseState& mouseState, 00110 const DtUniqueID& id, const std::string& displayEngineName, 00111 const std::string& windowName, const std::string& channelName, 00112 DtStateVisualizer* v ); 00113 00114 virtual void slot_mouseUp( DtMouseState& mouseState, const DtUniqueID& id, 00115 const std::string& displayEngineName, const std::string& windowName, 00116 const std::string& channelName, DtStateVisualizer* v ); 00117 00118 virtual void slot_mouseDblClick( DtMouseState& mouseState, 00119 const DtUniqueID& id, const std::string& displayEngineName, 00120 const std::string& windowName, const std::string& channelName, 00121 DtStateVisualizer* v ); 00122 00123 virtual void setColor( DtEnvironmentalVisualizerSet&, float, float, float, float ); 00124 virtual void setIndicatorsEnabled( DtEnvironmentalVisualizerSet&, bool ); 00125 virtual void setShowInfoPopupOnSelect( DtEnvironmentalVisualizerSet&, bool ); 00126 virtual void setWidgetEventsEnabled( DtEnvironmentalVisualizerSet&, bool ); 00127 virtual void setHatLineVisible( DtEnvironmentalVisualizerSet&, bool ); 00128 virtual void updateHatLine( DtEnvironmentalVisualizerSet& visSet ); 00129 virtual void setIndicatorModelDefinitions( DtEnvironmentalVisualizerSet& v, 00130 const std::string& normalTheme, const std::string& activeTheme, 00131 const std::string& selectedTheme, const std::string& multiSelectedTheme ); 00132 virtual void setEditing( bool isEditing ); 00133 virtual void setRangeInfoLabelBackgroundColor( float r, float g, float b, float a ); 00134 virtual void setRangeInfoLabelsEnabled( bool enabled ); 00135 virtual void setShowAltChangeField( bool show ); 00136 virtual void setShowLocationField( bool show ); 00137 virtual void setShowHeadingField( bool show ); 00138 virtual void setShowRangeField( bool show ); 00139 00141 void setHatLinesEnabled( bool isEnabled ); 00142 00144 void setHatLinesOnSelectionOnly( bool isSelectedOnly ); 00145 00146 virtual void setupFixedDistanceForEndVertex(); 00147 virtual void setupUpdaterForEndVertex(); 00148 00149 virtual void updateRangeInfoOverlayGroup(); 00150 virtual void updateRangeInfoVisibility(); 00151 virtual void updateRangeInfoFields(); 00152 virtual void updateRangeInfoText(); 00153 00154 DtUnicode formatLocationString( const DtCoordinateSystem& coordSys, 00155 const std::vector<std::string>& locs ); 00156 00157 protected: 00158 00159 struct VertexInformation 00160 { 00161 VertexInformation() 00162 : listener( 0 ) 00163 , vertex( 0 ) 00164 , rangeInfoWidget( 0 ) 00165 , rangeInfoWidgetModel( 0 ) 00166 , selected( false ) 00167 , attachedTo( 0 ) 00168 , updater( 0 ) 00169 , elementID( 0 ) 00170 { 00171 } 00172 00174 DtEnvironmentalStateListener* listener; 00176 DtEnvironmentalVisualizerSet* vertex; 00178 DtAttributeGroupWidgetAgent* rangeInfoWidget; 00180 DtProjectedWidgetModelAgent* rangeInfoWidgetModel; 00182 DtElementID attachedTo; 00184 DtAttachableUpdaterAgent* updater; 00186 bool selected; 00188 DtElementID elementID; 00189 }; 00190 00191 protected: 00192 00193 DtIntervisibilityStateListener* myIntervisibilityListener; 00194 00195 DtUnicode myVertexVisualizerDefinition; 00196 00197 VertexInformation myStartPoint; 00198 VertexInformation myEndPoint; 00199 00200 bool myIndicatorsEnabled; 00201 bool myWidgetEventsEnabled; 00202 bool myShowInfoOnSelect; 00203 bool myShowRangeInformation; 00204 bool myHatLinesOnSelectionOnly; 00205 bool myHatLinesEnabled; 00206 bool myFixedDistanceMode; 00207 bool myEditingFlag; 00208 bool myShowStart; 00209 bool myShowEnd; 00210 00211 float myRangeInfoBackgroundColorR; 00212 float myRangeInfoBackgroundColorG; 00213 float myRangeInfoBackgroundColorB; 00214 float myRangeInfoBackgroundColorA; 00215 bool myShowAltChangeField; 00216 bool myShowLocationField; 00217 bool myShowHeadingField; 00218 bool myShowRangeField; 00219 00220 }; 00221 00222 00223 typedef DtStateVisualizerCreatorTemplate<DtIntervisibilityVertexVisualizer> 00224 DtIntervisibilityVertexVisualizerCreator; 00225 }