![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /***************************************************************************** 00002 * Copyright (c) 2010 MAK Technologies, Inc. 00003 * All rights reserved. 00004 *****************************************************************************/ 00005 /***************************************************************************** 00006 * $RCSfile: $ $Revision: $ $State: $ 00007 *****************************************************************************/ 00008 00012 00013 #pragma once 00014 00015 #include <vrvCoreQt/vrvCoreQt.h> 00016 00017 #include <vrvCoreQt/DtGridLinesInterface.h> 00018 00019 #include <vrvUtil/DtSignalConnectionManager.h> 00020 #include <vrvUtil/DtVirtualBaseClass.h> 00021 00022 #include <makArchives/DtGridLinesSettingsRecord.h> 00023 00024 namespace makVrv 00025 { 00026 00027 class DtSettingsBackup; 00028 class DtPersistenceControlsInterface; 00029 class DtCoordinateDisplay; 00030 00033 class DT_DLL_VRVCOREQT DtGridLinesLogic : public DtVirtualBaseClass 00034 { 00035 public: 00036 00037 friend class DtGridLinesLogicCreator; 00038 00040 virtual ~DtGridLinesLogic(); 00041 00043 virtual void sendSettingsToGui(); 00044 00046 virtual void slot_onAutoSpacingChanged( bool ); 00047 virtual void slot_onFixedSpacingAmountChanged( double ); 00048 virtual void slot_onMinSpacingChanged( int ); 00049 virtual void slot_onGridTypeChanged( makArchives::DtDisplayUnitsSettingsRecord::CoordSys ); 00050 virtual void slot_onUnitTypeChanged( makArchives::DtDisplayUnitsSettingsRecord::DistanceUnits ); 00051 virtual void slot_onAngularUnitTypeChanged( makArchives::DtDisplayUnitsSettingsRecord::OrientationUnits ); 00052 virtual void slot_onXOffsetChanged( double ); 00053 virtual void slot_onYOffsetChanged( double ); 00054 virtual void slot_onDecimalsChanged( unsigned ); 00055 00057 virtual void on_import(); 00058 virtual void on_export(); 00059 virtual void on_importFilePathChosen(const std::string& filePath); 00060 virtual void on_exportFilePathChosen(const std::string& filePath); 00061 virtual void settingsRestored(const DtSettingsBackup* b); 00062 00064 virtual void slot_coordinateSystemChanged( const std::string&, const std::string& ); 00065 00066 protected: 00067 00070 DtGridLinesLogic(DtDe& de, DtPersistenceControlsInterface& persistenceControls, 00071 DtGridLinesInterface& iface); 00072 00073 // Used by sendSettingsToGui to send all the known grid types to the gui 00074 virtual void sendGridTypesToGui(); 00075 00076 // Used by sendSettingsToGui to send all the known unit types to the gui 00077 virtual void sendUnitTypesToGui(); 00078 00079 // Determine if the specified grid type uses angular units (or linear, otherwise) 00080 bool gridTypeUsesAngularUnits( makArchives::DtDisplayUnitsSettingsRecord::CoordSys gridType ) const; 00081 00085 virtual void processCurrentCoordinateSystem(); 00086 00090 virtual void processCurrentGridType(); 00091 00093 virtual double fixedSpacingAmount(); 00094 00096 virtual double xOffset(); 00097 00099 virtual double yOffset(); 00100 00102 virtual unsigned decimals(); 00103 00104 virtual void setMinAndMaxFixedSpacing( const DtCoordinateDisplay* display ); 00105 00106 protected: 00107 00108 DtDe& myDe; 00109 DtGridLinesInterface& myWidget; 00110 DtPersistenceControlsInterface& myPersistenceControls; 00111 DtSignalConnectionManager mySignals; 00112 00113 }; 00114 00117 class DT_DLL_VRVCOREQT DtGridLinesLogicCreator 00118 : public DtVirtualBaseClass 00119 { 00120 public: 00121 00122 // Get the creator instance for this DE object. Creates instance if none found 00123 static DtGridLinesLogicCreator& instance( DtDe& de ); 00124 00125 static void registerInstance( DtDe& de, DtGridLinesLogicCreator* creator ); 00126 00127 //Create the widget's logic. 00128 static DtVirtualBaseClass* create( DtDe& de, 00129 DtPersistenceControlsInterface& persistenceControls, DtGridLinesInterface& iface ) ; 00130 00131 }; 00132 00133 }