17 #include <matrix/vlVector.h>
26 class DtObserverObjectAgent;
28 class DtAgentManagerInterface;
29 class DtObserverConfiguration;
34 class DtChannelConfiguration;
58 DtObserverObjectAgent& agent();
61 const DtObserverObjectAgent& agent()
const;
86 bool hasInitialLocation()
const;
89 bool projectionIs2D()
const;
98 void setProjectionIs2D(
bool is2d );
104 const std::string& name()
const;
105 void setName(
const std::string& name );
117 int observerMode()
const;
118 bool setObserverMode(
int observerMode );
122 double viewResolution()
const;
125 void setViewResolution(
double resolution);
128 void setViewResolutionFromHeightAboveTerrain(
double hat);
131 double viewMagnification()
const;
134 void setViewMagnification(
double magnficationFactor);
137 void setEntityLodScale(
double entityLodScale);
140 double entityLodScale()
const;
143 void setTerrainLodScale(
double terrainLodScale);
146 double terrainLodScale()
const;
149 void setPaperMapLayer(
const std::string& paperMapLayer);
152 std::string paperMapLayer()
const;
158 bool inUse(
const std::string& channelKeyToIgnore =
"" )
const;
164 void attachToNextElement();
167 void attachToPreviousElement();
179 void setPrimaryAttachment(
const ElementList& elements);
187 void setSecondaryAttachment(
const ElementList& element);
196 virtual void slot_disableBuoyancyForAttachedEntitiesChanged(
bool disable);
200 void setLocationTrackAttachment(
double x,
double y,
double z );
204 void getLocationTrackAttachment(
double& x,
double& y,
double& z )
const;
209 void setPartAttachment(
int partId);
212 int partAttachment()
const;
218 bool attached()
const;
221 bool tracking()
const;
224 const ElementList& primaryAttachments()
const;
227 const ElementList& secondaryAttachments()
const;
229 void setHideModelOnAttach(
bool hide );
230 bool hideModelOnAttach()
const;
236 void setAttachmentHas3DCockpit(
bool cockpit);
237 bool attachmentHas3DCockpit()
const;
243 void setOrientToTargetConstraint(
bool orient );
244 bool orientToTargetConstraint()
const;
251 bool haveLastSingleAttached()
const;
264 void setAllowReset(
bool b);
267 bool allowReset()
const;
270 void setAllowAttach(
bool b);
273 bool allowAttach()
const;
276 void setAllowDetach(
bool b);
279 bool allowDetach()
const;
282 void centerOnTerrain();
285 void centerOnTerrain(
const DtUniqueID& terrainPatch );
289 void suppressConstrainToTerrain(
bool trueFalse );
292 void setConstrainToCenter(
bool trueFalse );
293 void toggleConstrainToCenter();
294 bool constrainToCenter()
const;
297 void getLocation(
double &x,
double &y,
double& z )
const;
300 DtVector location()
const;
303 DtVector observerCameraPosition()
const;
306 void setLocation(
double x,
double y,
double z );
309 void getOrientation(
double& psi,
double& theta,
double& phi )
const;
312 void getTopographicOrientation(
double& psi,
double& theta,
double& phi )
const;
315 void setOrientation(
double psi,
double theta,
double phi );
318 void setTopographicOrientation(
double psi,
double theta,
double phi );
321 void getOrientation(
double& x,
double& y,
double& z,
double& w )
const;
324 void setOrientation(
double x,
double y,
double z,
double w );
328 DtTaitBryan observerCameraOrientation(
bool includeShake=
true)
const;
332 virtual DtVector observerPlatformFront()
const;
336 virtual DtVector observerPlatformUp()
const;
340 virtual DtVector observerPlatformRight()
const;
345 virtual DtVector observerCameraFront(
bool includeShake=
true)
const;
348 virtual DtVector observerCameraUp(
bool includeShake =
true)
const;
351 virtual DtVector observerCameraRight(
bool includeShake =
true)
const;
355 void moveUnit(
const DtVector& direction);
359 void rotateUnit(
const DtTaitBryan& rotation);
362 void getLinearVelocity(
double &x,
double &y,
double &z)
const;
364 DtVector linearVelocity()
const;
368 void getRotationalVelocity(
double& x,
double& y,
double& z )
const;
370 DtVector rotationalVelocity()
const;
374 bool observerObjectMoving()
const;
377 double observerAltitude()
const;
382 double observerHeightAboveTerrain()
const;
393 void setAttachedLocation(
double x,
double y,
double z );
394 void setAttachedX(
double x );
395 void setAttachedY(
double y );
396 void setAttachedZ(
double z );
400 void setAttachedOrientation(
double psi,
double theta,
double phi );
401 void setAttachedYaw(
double psi);
402 void setAttachedPitch(
double theta);
403 void setAttachedRoll(
double phi);
407 void setLocalModelScalingEnabled(
bool enabled );
411 void setLocalModelScalingAmount(
float amount );
419 void setOrbitSpeedGain(
int gain,
bool forwardToObserverModeManager =
true );
422 int orbitSpeedGain()
const;
425 int orbitSpeedGainFromSpeed(
double speed )
const;
427 void setRotationSpeedGain(
int gain,
bool forwardToObserverModeManager =
true );
428 int rotationSpeedGain()
const;
431 void setLinearSpeedGain(
int gain );
432 int linearSpeedGain()
const;
434 void setLinearScaledSpeedGain(
int gain,
bool forwardToObserverModeManager =
true );
435 int linearScaledSpeedGain()
const;
437 void setLinearUnscaledSpeedGain(
int gain,
bool forwardToObserverModeManager =
true );
438 int linearUnscaledSpeedGain()
const;
440 void setGainPrecision(
int amt,
bool forwardToObserverModeManager =
true );
441 int gainPrecision()
const;
443 void setModelScaleFactor(
double modelScaleFactor,
bool forwardToObserverModeManager =
true );
444 double modelScaleFactor()
const;
446 void setModelScaleType(
const std::string& modelScaleType,
bool forwardToObserverModeManager =
true );
447 const std::string& modelScaleType()
const;
449 void setMaxModelScaleFactor(
double maxModelScaleFactor,
bool forwardToObserverModeManager =
true);
450 double maxModelScaleFactor()
const;
453 bool forwardToObserverModeManager =
true );
459 void setIsFrustumBasedViewMagnificationEnabled(
bool enabled,
bool forwardToObserverModeManager =
true);
460 bool isFrustumBasedViewMagnificationEnabled()
const;
472 virtual void setColorControlEnabled(
bool enabled,
bool forwardToObserverModeManager =
true);
475 virtual bool colorControlEnabled()
const;
481 virtual void setColorControlInvert(
bool enabled,
bool forwardToObserverModeManager =
true);
484 virtual bool colorControlInvert()
const;
490 virtual void setColorControlContrast(
double value,
bool forwardToObserverModeManager =
true);
493 virtual double colorControlContrast()
const;
499 virtual void setColorControlBrightness(
double value,
bool forwardToObserverModeManager =
true);
502 virtual double colorControlBrightness()
const;
508 virtual void setColorControlColorMix(
double value,
bool forwardToObserverModeManager =
true);
511 virtual double colorControlColorMix()
const;
513 void setSpeedScalingMslModeOffset(
double offset,
514 bool forwardToObserverModeManager =
true );
515 double speedScalingMslModeOffset()
const;
517 void setOrbitSpeed(
double speed );
518 double orbitSpeed()
const;
520 void setRotationSpeed(
double speed );
521 double rotationSpeed()
const;
523 void setLinearSpeed(
double speed );
524 double linearSpeed()
const;
529 virtual void toggleFlashlight();
535 virtual bool setCameraShake(
const std::string& shakeType);
538 virtual void setLodCenterSettings(
544 virtual void setCameraShakeRotation(
const DtQuat& rotQuat)
const;
548 virtual void setSensor(
const std::string& sensorName);
552 virtual std::string findSensor();
555 virtual void disableSensor();
558 virtual void slot_sensorRemoved(
DtSensor* sensor);
563 virtual void synchronize();
617 boost::signalslib::signal<void (DtObserver*, double offset)>
624 boost::signalslib::signal<void(DtObserver*, DtObserverObject::NorthType northType)>
637 void getObserverOffsetVector(
double& x,
double& y,
double& z )
const;
638 void getObserverRotationOffset(
double& x,
double& y,
double& z,
double& w )
const;
643 void getCameraFromParentOffsetVector(
double& x,
double& y,
double& z )
const;
644 void getCameraFromParentRotationOffset(
double& x,
double& y,
double& z,
double& w )
const;
650 virtual void setUsesBoundingVolumeForAttachedOffsets(
bool useBoundingVolume);
654 virtual bool usesBoundingVolumeForAttachedOffsets()
const;
659 void slot_terrainCleared();
661 void slot_oceanLayerDeleted(
const std::string&);
663 void updateGlobalTerrainFlag(
bool flag);
665 double calcLinearSpeed()
const;
666 double calcRotationSpeed()
const;
667 double calcOrbitSpeed()
const;
669 void setObserverOffsetVector(
double x,
double y,
double z );
671 void setObserverRotationOffset(
double x,
double y,
double z,
double w );
673 void getDisplayNamesFromUniqueIds(
const std::vector<DtUniqueID>& idsIn,
674 std::set<std::string>& displayNamesOut)
const;
675 bool getUniqueIdsFromDisplayNames(
const std::set<std::string>& displayNamesIn,
676 std::vector<DtUniqueID>& idsOut)
const;
683 void connectToElementDataSignals();
684 void disconnectFromElementDataSignals();
686 void setModeSpecificObserverObjectData();
699 virtual void attachToObjects(
const ElementList& objects);
705 virtual void slot_attachNextTick(
const ElementList objects);
708 virtual bool sceneObjectsAvailable(
const ElementList& elements);
712 virtual void slot_onElementAttributesChanged(
717 void slot_completeAttachment();
719 void slot_observerModeModelSetChanged(
int observerMode );
720 void slot_observerModeSensorChanged(
int observerMode );
721 void slot_observerModeIs2DChanged(
int observerMode );
722 void slot_observerModeKeyMapChanged(
int observerMode );
723 void slot_observerModeGainPrecisionChanged(
int observerMode );
724 void slot_observerModeOrbitSpeedGainChanged(
int observerMode );
725 void slot_observerModeRotationSpeedGainChanged(
int observerMode );
726 void slot_observerModeLinearScaledSpeedGainChanged(
int observerMode );
727 void slot_observerModeLinearUnscaledSpeedGainChanged(
int observerMode );
728 void slot_observerModeModelScaleFactorChanged(
int observerMode );
729 void slot_observerModeModelScaleTypeChanged(
int observerMode );
730 void slot_observerModeSpeedScalingModeChanged(
int observerMode );
731 void slot_observerModeSpeedScalingMslModeOffsetChanged(
int observerMode );
732 void slot_observerModeIsFrustumBasedViewMagnificationEnabledChanged(
int observerMode);
733 void slot_observerModeLodCenterSettingsChanged(
int observerMode);
734 void slot_observerModeNorthTypeChanged(
int observerMode);
735 void slot_observerModeColorControlEnabledChanged(
int observerMode);
736 void slot_observerModeColorControlInvertChanged(
int observerMode);
737 void slot_observerModeColorControlContrastChanged(
int observerMode);
738 void slot_observerModeColorControlBrightnessChanged(
int observerMode);
739 void slot_observerModeColorControlColorMixChanged(
int observerMode);
740 void slot_observerModeSettingChanged(
int observerMode,
int settingKey);
741 void slot_observerModeAdded(
int observerMode );
749 void attachTo(
bool afterTrue );
DtObserverObjectAgent * myObserverObjectAgent
Definition: DtObserver.h:757
float myDelayedAttachedPitchValue
Definition: DtObserver.h:799
bool myAllowDetach
Definition: DtObserver.h:776
int myObserverMode
Definition: DtObserver.h:763
AttachType
Definition: DtObserverSettingsRecord.h:24
std::vector< DtUniqueID > mySecondaryAttachments
Definition: DtObserver.h:768
makArchives::DtObserverStateRecord myCachedObserverStateRecord
This is used as a work-around to cache attachments for entities which have not yet been created...
Definition: DtObserver.h:762
DtUniqueID myLastSingleAttached
Definition: DtObserver.h:769
TODO: This class is used to encapsulate a set of default observer settings and parameters.
Definition: DtObserverConfiguration.h:22
bool myConstrainToCenter
Definition: DtObserver.h:772
bool myFlashlightEnabled
Definition: DtObserver.h:778
std::vector< DtElementID > ElementList
Definition: DtObserver.h:42
boost::signalslib::signal< void(DtObserver *, int)> signal_linearScaledSpeedGainChanged
Boost signal called when the scaled linear speed gain is changed.
Definition: DtObserver.h:575
boost::signalslib::signal< void(DtObserver *, int)> signal_linearUnscaledSpeedGainChanged
Boost signal called when the unscaled linear speed gain is changed.
Definition: DtObserver.h:578
boost::signalslib::signal< void(DtObserver *, DtObserverObject::NorthType northType)> signal_northTypeChanged
Signal emitted when an observer's north type changed.
Definition: DtObserver.h:625
Contains makVrv::DtElementData class.
boost::signalslib::signal< void(const std::string &)> signal_objectsDetached
Boost signal called when observer detaches from all.
Definition: DtObserver.h:569
A DtObserverSettingsRecord contains the state of an observer.
Definition: DtObserverStateRecord.h:20
boost::signalslib::signal< void(DtObserver *, double)> signal_terrainLodScaleChanged
Boost signal called when the observer's LOD Distance Scale used for terrain visuals is changed...
Definition: DtObserver.h:599
DtObserverObject::AttachType myAttachType
Definition: DtObserver.h:766
boost::signalslib::signal< void(DtObserver *, double offset)> signal_speedScalingMslModeOffsetChanged
Signal emitted when an observer's speed scaling MSL mode offset changes.
Definition: DtObserver.h:618
DtUniqueID DtElementID
The ElementID is a specific type of unique ID used to represent VR-Vantage uniquely defined elements...
Definition: DtUniqueID.h:23
bool myAttachedZDelayedFlag
Definition: DtObserver.h:791
DtSensor * mySensor
Definition: DtObserver.h:782
bool myAllowAttach
Definition: DtObserver.h:775
Definition: DtObserverObject.h:71
boost::signalslib::signal< void(DtSensor *)> signal_sensorChanged
Called when the observer changes which sensor it's using.
Definition: DtObserver.h:630
static const double theMoveStepSize
Definition: DtObserver.h:753
Contains vrvCore::DtObserverMode class.
SpeedScalingMode
Definition: DtObserverObject.h:56
A facade for a DtObserverObject.
Definition: DtObserver.h:38
bool myAllowReset
Definition: DtObserver.h:774
boost::signalslib::signal< void(DtObserver *, DtObserverObject::DtLodCenterSettings)> signal_lodCenterSettingsChanged
Boost signal called when the observer's LOD Center Settings has changed.
Definition: DtObserver.h:605
float myEntityLodScale
Definition: DtObserver.h:780
Contains makVrv::DtObserverObject class declaration.
bool myConnectedToElementDataSignals
Definition: DtObserver.h:773
DtCameraShake * myCameraShake
Definition: DtObserver.h:783
#define DT_DLL_VRVCORE
Definition: vrvCore.h:20
bool myAttachedXDelayedFlag
Definition: DtObserver.h:789
bool myAttachedRollDelayedFlag
Definition: DtObserver.h:794
std::vector< EntryAttributes > EntryAttributesList
Define the type used to signal changes to one or more attributes for one or more elements.
Definition: DtElementAttributeManager.h:44
boost::signalslib::signal< void(DtObserver *, int)> signal_rotationSpeedGainChanged
Boost signal called when the rotation speed gain is changed.
Definition: DtObserver.h:581
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
unsigned int myPartId
Definition: DtObserver.h:770
boost::signalslib::signal< void(DtObserver *, int)> signal_orbitSpeedGainChanged
Boost signal called when the orbit speed gain is changed.
Definition: DtObserver.h:584
boost::signalslib::signal< void(DtObserver *, int)> signal_gainPrecisionChanged
Boost signal called when the gain precision is changed.
Definition: DtObserver.h:587
boost::signalslib::signal< void(DtObserver *, double)> signal_modelScaleFactorChanged
Boost signal called when the model scale factor is changed.
Definition: DtObserver.h:590
NorthType
Definition: DtObserverObject.h:62
Definition of a sensor.
Definition: DtSensor.h:30
boost::signalslib::signal< void(DtObserver *, DtObserverObject::SpeedScalingMode scalingMode)> signal_speedScalingModeChanged
Signal emitted when an observer's speed scaling mode changes.
Definition: DtObserver.h:613
float myDelayedAttachedXValue
Definition: DtObserver.h:795
boost::signalslib::signal< void(const std::string &, DtUniqueID)> signal_objectAttached
Boost signal called when observer attaches to an object.
Definition: DtObserver.h:566
unsigned long long DtUniqueID
Definition: DtUniqueID.h:19
boost::signalslib::signal< void(DtObserver *, double)> signal_entityLodScaleChanged
Boost signal called when the observer's LOD Distance Scale used for entities is changed.
Definition: DtObserver.h:602
bool myAttachmentHas3DCockpit
Definition: DtObserver.h:765
std::string myPaperMapLayer
Definition: DtObserver.h:785
bool myProjectionIs2D
Definition: DtObserver.h:784
bool myOrientToTargetConstraint
Definition: DtObserver.h:771
The ocean layer is a type of terrain layer which contains information about an area that should be re...
Definition: DtOceanLayer.h:25
DtObserverConfiguration * myConfiguration
Definition: DtObserver.h:758
std::vector< DtElementEntry * > ElementList
Type definition for a vector of DtElementEntry pointers.
Definition: DtElementData.h:47
Contains makArchives::DtObserverStateRecord class.
Base class to provide boost signal/slot management.
Configuration for a single channel Serialized and sent to remote displays as necessary to configure r...
Definition: DtChannelConfiguration.h:24
boost::signalslib::signal< void()> signal_terrainChanged
Called when the observer sees a change in terrain which might require updates to observer settings...
Definition: DtObserver.h:634
bool myHideModelOnAttach
Definition: DtObserver.h:764
boost::signalslib::signal< void(DtObserver *, bool)> signal_isFrustumBasedViewMagnificationEnabledChanged
Boost signal called when the observer's use of an effective zoom calculation has changed.
Definition: DtObserver.h:621
A DtObserverSettingsRecord contains the settings of an observer.
Definition: DtObserverSettingsRecord.h:20
const char int mode
Definition: ioapi.h:38
bool myAttachmentDelayed
Definition: DtObserver.h:787
Contains the DtElementAttributeManager class declaration.
The abstract interface necessary for agents.
Definition: DtAgentManagerInterface.h:33
bool myAttachedPitchDelayedFlag
Definition: DtObserver.h:793
bool myHasInitialLocation
Definition: DtObserver.h:777
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:76
std::vector< DtUniqueID > myCurrentAttachments
Definition: DtObserver.h:767
float myTerrainLodScale
Definition: DtObserver.h:781
A utility Quaternion class.
Definition: DtQuat.h:19
boost::signalslib::signal< void(DtObserver *, double)> signal_viewMagnificationChanged
Boost signal called when the observer's view magnification is changed.
Definition: DtObserver.h:596
boost::signalslib::signal< void(DtObserver *, std::string)> signal_paperMapLayerChanged
Signal called when the observer's paper map layer is changed.
Definition: DtObserver.h:608
voidpf uLong offset
Definition: ioapi.h:42
float myDelayedAttachedYValue
Definition: DtObserver.h:796
Provides an algorithm for shaking the camera.
Definition: DtCameraShake.h:23
DtSignalConnectionManager myConnections
Definition: DtObserver.h:756
float myDelayedAttachedRollValue
Definition: DtObserver.h:800
float myDelayedAttachedYawValue
Definition: DtObserver.h:798
bool myAttachedYDelayedFlag
Definition: DtObserver.h:790
boost::signalslib::signal< void(DtObserver *, int)> signal_observerModeChanged
Boost signal called when observer's mode changed.
Definition: DtObserver.h:572
DtDe & myDe
Definition: DtObserver.h:755
DtDe & de()
Get the observer's DtDe.
Definition: DtObserver.h:52
double myViewMagnification
Definition: DtObserver.h:779
bool myAttachedYawDelayedFlag
Definition: DtObserver.h:792
boost::signalslib::signal< void(DtObserver *, std::string)> signal_modelScaleTypeChanged
Boost signal called when the model scale type is changed.
Definition: DtObserver.h:593
float myDelayedAttachedZValue
Definition: DtObserver.h:797
AttachType
Definition: DtObserverObject.h:42