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);
197 void setLocationTrackAttachment(
double x,
double y,
double z );
201 void getLocationTrackAttachment(
double& x,
double& y,
double& z )
const;
206 void setPartAttachment(
int partId);
209 int partAttachment()
const;
215 bool attached()
const;
218 bool tracking()
const;
221 const ElementList& primaryAttachments()
const;
224 const ElementList& secondaryAttachments()
const;
226 void setHideModelOnAttach(
bool hide );
227 bool hideModelOnAttach()
const;
233 void setAttachmentHas3DCockpit(
bool cockpit);
234 bool attachmentHas3DCockpit()
const;
240 void setOrientToTargetConstraint(
bool orient );
241 bool orientToTargetConstraint()
const;
248 bool haveLastSingleAttached()
const;
261 void setAllowReset(
bool b);
264 bool allowReset()
const;
267 void setAllowAttach(
bool b);
270 bool allowAttach()
const;
273 void setAllowDetach(
bool b);
276 bool allowDetach()
const;
279 void centerOnTerrain();
282 void centerOnTerrain(
const DtUniqueID& terrainPatch );
286 void suppressConstrainToTerrain(
bool trueFalse );
289 void setConstrainToCenter(
bool trueFalse );
290 void toggleConstrainToCenter();
291 bool constrainToCenter()
const;
294 void getLocation(
double &x,
double &y,
double& z )
const;
297 DtVector location()
const;
300 DtVector observerCameraPosition()
const;
303 void setLocation(
double x,
double y,
double z );
306 void getOrientation(
double& psi,
double& theta,
double& phi )
const;
309 void getTopographicOrientation(
double& psi,
double& theta,
double& phi )
const;
312 void setOrientation(
double psi,
double theta,
double phi );
315 void setTopographicOrientation(
double psi,
double theta,
double phi );
318 void getOrientation(
double& x,
double& y,
double& z,
double& w )
const;
321 void setOrientation(
double x,
double y,
double z,
double w );
325 DtTaitBryan observerCameraOrientation(
bool includeShake=
true)
const;
329 virtual DtVector observerPlatformFront()
const;
333 virtual DtVector observerPlatformUp()
const;
337 virtual DtVector observerPlatformRight()
const;
342 virtual DtVector observerCameraFront(
bool includeShake=
true)
const;
345 virtual DtVector observerCameraUp(
bool includeShake =
true)
const;
348 virtual DtVector observerCameraRight(
bool includeShake =
true)
const;
352 void moveUnit(
const DtVector& direction);
356 void rotateUnit(
const DtTaitBryan& rotation);
359 void getLinearVelocity(
double &x,
double &y,
double &z)
const;
361 DtVector linearVelocity()
const;
365 void getRotationalVelocity(
double& x,
double& y,
double& z )
const;
367 DtVector rotationalVelocity()
const;
371 bool observerObjectMoving()
const;
374 double observerAltitude()
const;
385 void setAttachedLocation(
double x,
double y,
double z );
386 void setAttachedX(
double x );
387 void setAttachedY(
double y );
388 void setAttachedZ(
double z );
392 void setAttachedOrientation(
double psi,
double theta,
double phi );
393 void setAttachedYaw(
double psi);
394 void setAttachedPitch(
double theta);
395 void setAttachedRoll(
double phi);
399 void setLocalModelScalingEnabled(
bool enabled );
403 void setLocalModelScalingAmount(
float amount );
411 void setOrbitSpeedGain(
int gain,
bool forwardToObserverModeManager =
true );
414 int orbitSpeedGain()
const;
417 int orbitSpeedGainFromSpeed(
double speed )
const;
419 void setRotationSpeedGain(
int gain,
bool forwardToObserverModeManager =
true );
420 int rotationSpeedGain()
const;
423 void setLinearSpeedGain(
int gain );
424 int linearSpeedGain()
const;
426 void setLinearScaledSpeedGain(
int gain,
bool forwardToObserverModeManager =
true );
427 int linearScaledSpeedGain()
const;
429 void setLinearUnscaledSpeedGain(
int gain,
bool forwardToObserverModeManager =
true );
430 int linearUnscaledSpeedGain()
const;
432 void setGainPrecision(
int amt,
bool forwardToObserverModeManager =
true );
433 int gainPrecision()
const;
435 void setModelScaleFactor(
double modelScaleFactor,
bool forwardToObserverModeManager =
true );
436 double modelScaleFactor()
const;
438 void setModelScaleType(
const std::string& modelScaleType,
bool forwardToObserverModeManager =
true );
439 const std::string& modelScaleType()
const;
441 void setMaxModelScaleFactor(
double maxModelScaleFactor,
bool forwardToObserverModeManager =
true);
442 double maxModelScaleFactor()
const;
445 bool forwardToObserverModeManager =
true );
451 void setIsFrustumBasedViewMagnificationEnabled(
bool enabled,
bool forwardToObserverModeManager =
true);
452 bool isFrustumBasedViewMagnificationEnabled()
const;
463 virtual void setColorControlEnabled(
bool enabled,
bool forwardToObserverModeManager =
true);
466 virtual bool colorControlEnabled()
const;
471 virtual void setColorControlInvert(
bool enabled,
bool forwardToObserverModeManager =
true);
474 virtual bool colorControlInvert()
const;
479 virtual void setColorControlContrast(
double value,
bool forwardToObserverModeManager =
true);
482 virtual double colorControlContrast()
const;
487 virtual void setColorControlBrightness(
double value,
bool forwardToObserverModeManager =
true);
490 virtual double colorControlBrightness()
const;
495 virtual void setColorControlColorMix(
double value,
bool forwardToObserverModeManager =
true);
498 virtual double colorControlColorMix()
const;
500 void setSpeedScalingMslModeOffset(
double offset,
501 bool forwardToObserverModeManager =
true );
502 double speedScalingMslModeOffset()
const;
504 void setOrbitSpeed(
double speed );
505 double orbitSpeed()
const;
507 void setRotationSpeed(
double speed );
508 double rotationSpeed()
const;
510 void setLinearSpeed(
double speed );
511 double linearSpeed()
const;
516 virtual void toggleFlashlight();
522 virtual bool setCameraShake(
const std::string& shakeType);
525 virtual void setLodCenterSettings(
531 virtual void setCameraShakeRotation(
const DtQuat& rotQuat)
const;
535 virtual void setSensor(
const std::string& sensorName);
539 virtual std::string findSensor();
542 virtual void disableSensor();
545 virtual void slot_sensorRemoved(
DtSensor* sensor);
550 virtual void synchronize();
604 boost::signalslib::signal<void (DtObserver*, double offset)>
611 boost::signalslib::signal<void(DtObserver*, DtObserverObject::NorthType northType)>
624 void getObserverOffsetVector(
double& x,
double& y,
double& z )
const;
625 void getObserverRotationOffset(
double& x,
double& y,
double& z,
double& w )
const;
630 void getCameraFromParentOffsetVector(
double& x,
double& y,
double& z )
const;
631 void getCameraFromParentRotationOffset(
double& x,
double& y,
double& z,
double& w )
const;
637 virtual void setUsesBoundingVolumeForAttachedOffsets(
bool useBoundingVolume);
641 virtual bool usesBoundingVolumeForAttachedOffsets()
const;
646 void slot_terrainCleared();
648 void slot_oceanLayerDeleted(
const std::string&);
650 void updateGlobalTerrainFlag(
bool flag);
652 double calcLinearSpeed()
const;
653 double calcRotationSpeed()
const;
654 double calcOrbitSpeed()
const;
656 void setObserverOffsetVector(
double x,
double y,
double z );
658 void setObserverRotationOffset(
double x,
double y,
double z,
double w );
660 void getDisplayNamesFromUniqueIds(
const std::vector<DtUniqueID>& idsIn,
661 std::set<std::string>& displayNamesOut)
const;
662 bool getUniqueIdsFromDisplayNames(
const std::set<std::string>& displayNamesIn,
663 std::vector<DtUniqueID>& idsOut)
const;
670 void connectToElementDataSignals();
671 void disconnectFromElementDataSignals();
673 void setModeSpecificObserverObjectData();
686 virtual void attachToObjects(
const ElementList& objects);
692 virtual void slot_attachNextTick(
const ElementList objects);
695 virtual bool sceneObjectsAvailable(
const ElementList& elements);
699 virtual void slot_onElementAttributesChanged(
704 void slot_completeAttachment();
706 void slot_observerModeModelSetChanged(
int observerMode );
707 void slot_observerModeSensorChanged(
int observerMode );
708 void slot_observerModeIs2DChanged(
int observerMode );
709 void slot_observerModeKeyMapChanged(
int observerMode );
710 void slot_observerModeGainPrecisionChanged(
int observerMode );
711 void slot_observerModeOrbitSpeedGainChanged(
int observerMode );
712 void slot_observerModeRotationSpeedGainChanged(
int observerMode );
713 void slot_observerModeLinearScaledSpeedGainChanged(
int observerMode );
714 void slot_observerModeLinearUnscaledSpeedGainChanged(
int observerMode );
715 void slot_observerModeModelScaleFactorChanged(
int observerMode );
716 void slot_observerModeModelScaleTypeChanged(
int observerMode );
717 void slot_observerModeSpeedScalingModeChanged(
int observerMode );
718 void slot_observerModeSpeedScalingMslModeOffsetChanged(
int observerMode );
719 void slot_observerModeIsFrustumBasedViewMagnificationEnabledChanged(
int observerMode);
720 void slot_observerModeLodCenterSettingsChanged(
int observerMode);
721 void slot_observerModeNorthTypeChanged(
int observerMode);
722 void slot_observerModeColorControlEnabledChanged(
int observerMode);
723 void slot_observerModeColorControlInvertChanged(
int observerMode);
724 void slot_observerModeColorControlContrastChanged(
int observerMode);
725 void slot_observerModeColorControlBrightnessChanged(
int observerMode);
726 void slot_observerModeColorControlColorMixChanged(
int observerMode);
727 void slot_observerModeSettingChanged(
int observerMode,
int settingKey);
728 void slot_observerModeAdded(
int observerMode );
736 void attachTo(
bool afterTrue );
DtObserverObjectAgent * myObserverObjectAgent
Definition: DtObserver.h:744
float myDelayedAttachedPitchValue
Definition: DtObserver.h:786
bool myAllowDetach
Definition: DtObserver.h:763
int myObserverMode
Definition: DtObserver.h:750
AttachType
Definition: DtObserverSettingsRecord.h:24
std::vector< DtUniqueID > mySecondaryAttachments
Definition: DtObserver.h:755
makArchives::DtObserverStateRecord myCachedObserverStateRecord
This is used as a work-around to cache attachments for entities which have not yet been created...
Definition: DtObserver.h:749
DtUniqueID myLastSingleAttached
Definition: DtObserver.h:756
TODO: This class is used to encapsulate a set of default observer settings and parameters.
Definition: DtObserverConfiguration.h:22
bool myConstrainToCenter
Definition: DtObserver.h:759
bool myFlashlightEnabled
Definition: DtObserver.h:765
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:562
boost::signalslib::signal< void(DtObserver *, int)> signal_linearUnscaledSpeedGainChanged
Boost signal called when the unscaled linear speed gain is changed.
Definition: DtObserver.h:565
boost::signalslib::signal< void(DtObserver *, DtObserverObject::NorthType northType)> signal_northTypeChanged
Signal emitted when an observer's north type changed.
Definition: DtObserver.h:612
Contains makVrv::DtElementData class.
boost::signalslib::signal< void(const std::string &)> signal_objectsDetached
Boost signal called when observer detaches from all.
Definition: DtObserver.h:556
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:586
DtObserverObject::AttachType myAttachType
Definition: DtObserver.h:753
boost::signalslib::signal< void(DtObserver *, double offset)> signal_speedScalingMslModeOffsetChanged
Signal emitted when an observer's speed scaling MSL mode offset changes.
Definition: DtObserver.h:605
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:778
DtSensor * mySensor
Definition: DtObserver.h:769
bool myAllowAttach
Definition: DtObserver.h:762
Definition: DtObserverObject.h:71
boost::signalslib::signal< void(DtSensor *)> signal_sensorChanged
Called when the observer changes which sensor it's using.
Definition: DtObserver.h:617
static const double theMoveStepSize
Definition: DtObserver.h:740
Contains vrvCore::DtObserverMode class.
SpeedScalingMode
Definition: DtObserverObject.h:56
A facade for a DtObserverObject.
Definition: DtObserver.h:38
bool myAllowReset
Definition: DtObserver.h:761
boost::signalslib::signal< void(DtObserver *, DtObserverObject::DtLodCenterSettings)> signal_lodCenterSettingsChanged
Boost signal called when the observer's LOD Center Settings has changed.
Definition: DtObserver.h:592
float myEntityLodScale
Definition: DtObserver.h:767
Contains makVrv::DtObserverObject class declaration.
bool myConnectedToElementDataSignals
Definition: DtObserver.h:760
DtCameraShake * myCameraShake
Definition: DtObserver.h:770
#define DT_DLL_VRVCORE
Definition: vrvCore.h:20
bool myAttachedXDelayedFlag
Definition: DtObserver.h:776
bool myAttachedRollDelayedFlag
Definition: DtObserver.h:781
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:568
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
unsigned int myPartId
Definition: DtObserver.h:757
boost::signalslib::signal< void(DtObserver *, int)> signal_orbitSpeedGainChanged
Boost signal called when the orbit speed gain is changed.
Definition: DtObserver.h:571
boost::signalslib::signal< void(DtObserver *, int)> signal_gainPrecisionChanged
Boost signal called when the gain precision is changed.
Definition: DtObserver.h:574
boost::signalslib::signal< void(DtObserver *, double)> signal_modelScaleFactorChanged
Boost signal called when the model scale factor is changed.
Definition: DtObserver.h:577
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:600
float myDelayedAttachedXValue
Definition: DtObserver.h:782
boost::signalslib::signal< void(const std::string &, DtUniqueID)> signal_objectAttached
Boost signal called when observer attaches to an object.
Definition: DtObserver.h:553
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:589
bool myAttachmentHas3DCockpit
Definition: DtObserver.h:752
std::string myPaperMapLayer
Definition: DtObserver.h:772
bool myProjectionIs2D
Definition: DtObserver.h:771
bool myOrientToTargetConstraint
Definition: DtObserver.h:758
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:745
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:621
bool myHideModelOnAttach
Definition: DtObserver.h:751
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:608
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:774
Contains the DtElementAttributeManager class declaration.
The abstract interface necessary for agents.
Definition: DtAgentManagerInterface.h:33
bool myAttachedPitchDelayedFlag
Definition: DtObserver.h:780
bool myHasInitialLocation
Definition: DtObserver.h:764
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:754
float myTerrainLodScale
Definition: DtObserver.h:768
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:583
boost::signalslib::signal< void(DtObserver *, std::string)> signal_paperMapLayerChanged
Signal called when the observer's paper map layer is changed.
Definition: DtObserver.h:595
voidpf uLong offset
Definition: ioapi.h:42
float myDelayedAttachedYValue
Definition: DtObserver.h:783
Provides an algorithm for shaking the camera.
Definition: DtCameraShake.h:23
DtSignalConnectionManager myConnections
Definition: DtObserver.h:743
float myDelayedAttachedRollValue
Definition: DtObserver.h:787
float myDelayedAttachedYawValue
Definition: DtObserver.h:785
bool myAttachedYDelayedFlag
Definition: DtObserver.h:777
boost::signalslib::signal< void(DtObserver *, int)> signal_observerModeChanged
Boost signal called when observer's mode changed.
Definition: DtObserver.h:559
DtDe & myDe
Definition: DtObserver.h:742
DtDe & de()
Get the observer's DtDe.
Definition: DtObserver.h:52
double myViewMagnification
Definition: DtObserver.h:766
bool myAttachedYawDelayedFlag
Definition: DtObserver.h:779
boost::signalslib::signal< void(DtObserver *, std::string)> signal_modelScaleTypeChanged
Boost signal called when the model scale type is changed.
Definition: DtObserver.h:580
float myDelayedAttachedZValue
Definition: DtObserver.h:784
AttachType
Definition: DtObserverObject.h:42