16 #include <matrix/vlVector.h>
25 class DtObserverObjectAgent;
27 class DtAgentManagerInterface;
28 class DtObserverConfiguration;
33 class DtChannelConfiguration;
57 DtObserverObjectAgent& agent();
60 const DtObserverObjectAgent& agent()
const;
85 bool hasInitialLocation()
const;
88 bool projectionIs2D()
const;
97 void setProjectionIs2D(
bool is2d );
103 const std::string& name()
const;
104 void setName(
const std::string& name );
111 int observerMode()
const;
112 void setObserverMode(
int observerMode );
116 double viewResolution()
const;
119 void setViewResolution(
double resolution);
122 void setViewResolutionFromHeightAboveTerrain(
double hat);
125 double viewMagnification()
const;
128 void setViewMagnification(
double magnficationFactor);
131 void setLodScale(
double lodScale);
134 double lodScale()
const;
140 bool inUse(
const std::string& channelKeyToIgnore =
"" )
const;
146 void attachToNextElement();
149 void attachToPreviousElement();
161 void setPrimaryAttachment(
const ElementList& elements);
169 void setSecondaryAttachment(
const ElementList& element);
179 void setLocationTrackAttachment(
double x,
double y,
double z );
183 void getLocationTrackAttachment(
double& x,
double& y,
double& z )
const;
188 void setPartAttachment(
int partId);
191 int partAttachment()
const;
197 bool attached()
const;
200 bool tracking()
const;
203 const ElementList& primaryAttachments()
const;
206 const ElementList& secondaryAttachments()
const;
208 void setHideModelOnAttach(
bool hide );
209 bool hideModelOnAttach()
const;
215 void setAttachmentHas3DCockpit(
bool cockpit);
216 bool attachmentHas3DCockpit()
const;
222 void setOrientToTargetConstraint(
bool orient );
223 bool orientToTargetConstraint()
const;
230 bool haveLastSingleAttached()
const;
243 void setAllowReset(
bool b);
246 bool allowReset()
const;
249 void setAllowAttach(
bool b);
252 bool allowAttach()
const;
255 void setAllowDetach(
bool b);
258 bool allowDetach()
const;
261 void centerOnTerrain();
264 void centerOnTerrain(
const DtUniqueID& terrainPatch );
268 void suppressConstrainToTerrain(
bool trueFalse );
271 void setConstrainToCenter(
bool trueFalse );
272 void toggleConstrainToCenter();
273 bool constrainToCenter()
const;
276 void getLocation(
double &x,
double &y,
double& z )
const;
282 DtVector observerCameraPosition()
const;
285 void setLocation(
double x,
double y,
double z );
288 void getOrientation(
double& psi,
double& theta,
double& phi )
const;
291 void getTopographicOrientation(
double& psi,
double& theta,
double& phi )
const;
294 void setOrientation(
double psi,
double theta,
double phi );
297 void setTopographicOrientation(
double psi,
double theta,
double phi );
300 void getOrientation(
double& x,
double& y,
double& z,
double& w )
const;
303 void setOrientation(
double x,
double y,
double z,
double w );
307 DtTaitBryan observerCameraOrientation(
bool includeShake=
true)
const;
311 virtual DtVector observerPlatformFront()
const;
315 virtual DtVector observerPlatformUp()
const;
319 virtual DtVector observerPlatformRight()
const;
324 virtual DtVector observerCameraFront(
bool includeShake=
true)
const;
327 virtual DtVector observerCameraUp(
bool includeShake =
true)
const;
330 virtual DtVector observerCameraRight(
bool includeShake =
true)
const;
334 void moveUnit(
const DtVector& direction);
338 void rotateUnit(
const DtTaitBryan& rotation);
341 void getLinearVelocity(
double &x,
double &y,
double &z)
const;
347 void getRotationalVelocity(
double& x,
double& y,
double& z )
const;
349 DtVector rotationalVelocity()
const;
353 bool observerObjectMoving()
const;
356 double observerAltitude()
const;
364 void setAttachedLocation(
double x,
double y,
double z );
368 void setAttachedOrientation(
double psi,
double theta,
double phi );
372 void setLocalModelScalingEnabled(
bool enabled );
376 void setLocalModelScalingAmount(
float amount );
384 void setOrbitSpeedGain(
int gain,
bool forwardToObserverModeManager =
true );
387 int orbitSpeedGain()
const;
390 int orbitSpeedGainFromSpeed(
double speed )
const;
392 void setRotationSpeedGain(
int gain,
bool forwardToObserverModeManager =
true );
393 int rotationSpeedGain()
const;
396 void setLinearSpeedGain(
int gain );
397 int linearSpeedGain()
const;
399 void setLinearScaledSpeedGain(
int gain,
bool forwardToObserverModeManager =
true );
400 int linearScaledSpeedGain()
const;
402 void setLinearUnscaledSpeedGain(
int gain,
bool forwardToObserverModeManager =
true );
403 int linearUnscaledSpeedGain()
const;
405 void setGainPrecision(
int amt,
bool forwardToObserverModeManager =
true );
406 int gainPrecision()
const;
408 void setModelScaleFactor(
double modelScaleFactor,
bool forwardToObserverModeManager =
true );
409 double modelScaleFactor()
const;
411 void setModelScaleType(
const std::string& modelScaleType,
bool forwardToObserverModeManager =
true );
412 const std::string& modelScaleType()
const;
414 void setMaxModelScaleFactor(
double maxModelScaleFactor,
bool forwardToObserverModeManager =
true);
415 double maxModelScaleFactor()
const;
418 bool forwardToObserverModeManager =
true );
421 void setLodScaleCenterEnabled(
bool enabled,
bool forwardToObserverModeManager =
true);
422 bool lodScaleCenterEnabled()
const;
424 void setLodScaleCenterMagMinLimit(
double limit,
bool forwardToObserverModeManager =
true);
425 double lodScaleCenterMagMinLimit()
const;
427 void setSpeedScalingMslModeOffset(
double offset,
428 bool forwardToObserverModeManager =
true );
429 double speedScalingMslModeOffset()
const;
431 void setOrbitSpeed(
double speed );
432 double orbitSpeed()
const;
434 void setRotationSpeed(
double speed );
435 double rotationSpeed()
const;
437 void setLinearSpeed(
double speed );
438 double linearSpeed()
const;
443 virtual void toggleFlashlight();
449 virtual bool setCameraShake(
const std::string& shakeType);
453 virtual void setCameraShakeRotation(
const DtQuat& rotQuat)
const;
457 virtual void setSensor(
const std::string& sensorName);
461 virtual std::string findSensor();
464 virtual void disableSensor();
467 virtual void slot_sensorRemoved(
DtSensor* sensor);
472 virtual void synchronize();
518 boost::signal<void (DtObserver*, double offset)>
537 void getObserverOffsetVector(
double& x,
double& y,
double& z )
const;
538 void getObserverRotationOffset(
double& x,
double& y,
double& z,
double& w )
const;
543 void getCameraFromParentOffsetVector(
double& x,
double& y,
double& z )
const;
544 void getCameraFromParentRotationOffset(
double& x,
double& y,
double& z,
double& w )
const;
549 void slot_terrainCleared();
551 void slot_oceanLayerDeleted(
const std::string&);
553 void updateGlobalTerrainFlag(
bool flag);
555 double calcLinearSpeed()
const;
556 double calcRotationSpeed()
const;
557 double calcOrbitSpeed()
const;
559 void setObserverOffsetVector(
double x,
double y,
double z );
561 void setObserverRotationOffset(
double x,
double y,
double z,
double w );
563 void getDisplayNamesFromUniqueIds(
const std::vector<DtUniqueID>& idsIn,
564 std::set<std::string>& displayNamesOut)
const;
565 bool getUniqueIdsFromDisplayNames(
const std::set<std::string>& displayNamesIn,
566 std::vector<DtUniqueID>& idsOut)
const;
573 void connectToElementDataSignals();
574 void disconnectFromElementDataSignals();
576 void setModeSpecificObserverObjectData();
582 virtual void slot_onElementAttributesChanged(
587 void slot_completeAttachment();
589 void slot_observerModeModelSetChanged(
int observerMode );
590 void slot_observerModeSensorChanged(
int observerMode );
591 void slot_observerModeIs2DChanged(
int observerMode );
592 void slot_observerModeKeyMapChanged(
int observerMode );
593 void slot_observerModeGainPrecisionChanged(
int observerMode );
594 void slot_observerModeOrbitSpeedGainChanged(
int observerMode );
595 void slot_observerModeRotationSpeedGainChanged(
int observerMode );
596 void slot_observerModeLinearScaledSpeedGainChanged(
int observerMode );
597 void slot_observerModeLinearUnscaledSpeedGainChanged(
int observerMode );
598 void slot_observerModeModelScaleFactorChanged(
int observerMode );
599 void slot_observerModeModelScaleTypeChanged(
int observerMode );
600 void slot_observerModeSpeedScalingModeChanged(
int observerMode );
601 void slot_observerModeSpeedScalingMslModeOffsetChanged(
int observerMode );
602 void slot_observerModeLodScaleCenterEnabledChanged(
int observerMode);
603 void slot_observerModeLodScaleCenterMagMinLimitChanged(
int observerMode);
604 void slot_observerModeSettingChanged(
int observerMode,
int settingKey);
605 void slot_observerModeAdded(
int observerMode );
613 void attachTo(
bool afterTrue );
boost::signal< void(const std::string &)> signal_objectsDetached
Boost signal called when observer detaches from all.
Definition: DtObserver.h:478
boost::signal< void(DtObserver *, int)> signal_gainPrecisionChanged
Boost signal called when the gain precision is changed.
Definition: DtObserver.h:496
DtObserverObjectAgent * myObserverObjectAgent
Definition: DtObserver.h:621
bool myAllowDetach
Definition: DtObserver.h:640
int myObserverMode
Definition: DtObserver.h:627
AttachType
Definition: DtObserverSettingsRecord.h:24
boost::signal< void(DtObserver *, double offset)> signal_speedScalingMslModeOffsetChanged
Signal emitted when an observer's speed scaling MSL mode offset changes.
Definition: DtObserver.h:519
std::vector< DtUniqueID > mySecondaryAttachments
Definition: DtObserver.h:632
makArchives::DtObserverStateRecord myCachedObserverStateRecord
This is used as a work-around to cache attachments for entities which have not yet been created...
Definition: DtObserver.h:626
DtUniqueID myLastSingleAttached
Definition: DtObserver.h:633
boost::signal< void(DtObserver *, int)> signal_orbitSpeedGainChanged
Boost signal called when the orbit speed gain is changed.
Definition: DtObserver.h:493
TODO: This class is used to encapsulate a set of default observer settings and parameters.
Definition: DtObserverConfiguration.h:25
bool myConstrainToCenter
Definition: DtObserver.h:636
bool myFlashlightEnabled
Definition: DtObserver.h:642
std::vector< DtElementID > ElementList
Definition: DtObserver.h:41
boost::signal< void(DtObserver *, int)> signal_observerModeChanged
Boost signal called when observer's mode changed.
Definition: DtObserver.h:481
boost::signal< void(DtObserver *, int)> signal_linearScaledSpeedGainChanged
Boost signal called when the scaled linear speed gain is changed.
Definition: DtObserver.h:484
boost::signal< void(DtObserver *, double)> signal_viewMagnificationChanged
Boost signal called when the observer's view magnification is changed.
Definition: DtObserver.h:505
boost::signal< void(const std::string &, DtUniqueID)> signal_objectAttached
Boost signal called when observer attaches to an object.
Definition: DtObserver.h:475
Contains makVrv::DtElementData class.
A DtObserverSettingsRecord contains the state of an observer.
Definition: DtObserverStateRecord.h:20
boost::signal< void(DtSensor *)> signal_sensorChanged
Called when the observer changes which sensor it's using.
Definition: DtObserver.h:530
DtObserverObject::AttachType myAttachType
Definition: DtObserver.h:630
DtUniqueID DtElementID
The ElementID is a specific type of unique ID used to represent VR-Vantage uniquely defined elements...
Definition: DtUniqueID.h:26
DtSensor * mySensor
Definition: DtObserver.h:645
bool myAllowAttach
Definition: DtObserver.h:639
boost::signal< void(DtObserver *, DtObserverObject::SpeedScalingMode scalingMode)> signal_speedScalingModeChanged
Signal emitted when an observer's speed scaling mode changes.
Definition: DtObserver.h:514
static const double theMoveStepSize
Definition: DtObserver.h:617
SpeedScalingMode
Definition: DtObserverObject.h:50
boost::signal< void(DtObserver *, std::string)> signal_modelScaleTypeChanged
Boost signal called when the model scale type is changed.
Definition: DtObserver.h:502
A facade for a DtObserverObject.
Definition: DtObserver.h:37
boost::signal< void(DtObserver *, double)> signal_lodScaleChanged
Boost signal called when the observer's view magnification is changed.
Definition: DtObserver.h:508
bool myAllowReset
Definition: DtObserver.h:638
Contains makVrv::DtObserverObject class.
bool myConnectedToElementDataSignals
Definition: DtObserver.h:637
DtCameraShake * myCameraShake
Definition: DtObserver.h:646
boost::signal< void(DtObserver *, double)> signal_modelScaleFactorChanged
Boost signal called when the model scale factor is changed.
Definition: DtObserver.h:499
#define DT_DLL_VRVCORE
Definition: vrvCore.h:20
std::vector< EntryAttributes > EntryAttributesList
Definition: DtElementAttributeManager.h:41
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:24
unsigned int myPartId
Definition: DtObserver.h:634
Definition of a sensor.
Definition: DtSensor.h:30
unsigned long long DtUniqueID
Definition: DtUniqueID.h:22
boost::signal< void(DtObserver *, bool)> signal_lodScaleCenterEnabledChanged
Boost signal called when the observer's lod scale center enabled is changed.
Definition: DtObserver.h:522
bool myAttachmentHas3DCockpit
Definition: DtObserver.h:629
bool myProjectionIs2D
Definition: DtObserver.h:647
bool myOrientToTargetConstraint
Definition: DtObserver.h:635
The ocean layer is a type of terrain layer which contains information about an area that should be re...
Definition: DtOceanLayer.h:27
DtObserverConfiguration * myConfiguration
Definition: DtObserver.h:622
std::vector< DtElementEntry * > ElementList
Type definition for a vector of DtElementEntry pointers.
Definition: DtElementData.h:46
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:26
boost::signal< void(DtObserver *, double)> signal_lodScaleCenterMagMinLimitChanged
Boost signal called when the observer's lod scale view magnificaion minimum is changed.
Definition: DtObserver.h:525
bool myHideModelOnAttach
Definition: DtObserver.h:628
A DtObserverSettingsRecord contains the settings of an observer.
Definition: DtObserverSettingsRecord.h:20
const char int mode
Definition: ioapi.h:38
Contains the DtElementAttributeManager class declaration.
The abstract interface necessary for agents.
Definition: DtAgentManagerInterface.h:36
bool myHasInitialLocation
Definition: DtObserver.h:641
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69
std::vector< DtUniqueID > myCurrentAttachments
Definition: DtObserver.h:631
A utility Quaternion class.
Definition: DtQuat.h:22
boost::signal< void(DtObserver *, int)> signal_linearUnscaledSpeedGainChanged
Boost signal called when the unscaled linear speed gain is changed.
Definition: DtObserver.h:487
voidpf uLong offset
Definition: ioapi.h:42
float myLodScale
Definition: DtObserver.h:644
boost::signal< void(DtObserver *, int)> signal_rotationSpeedGainChanged
Boost signal called when the rotation speed gain is changed.
Definition: DtObserver.h:490
Provides an algorithm for shaking the camera.
Definition: DtCameraShake.h:23
DtSignalConnectionManager myConnections
Definition: DtObserver.h:620
boost::signal< void()> signal_terrainChanged
Called when the observer sees a change in terrain which might require updates to observer settings...
Definition: DtObserver.h:534
DtDe & myDe
Definition: DtObserver.h:619
DtDe & de()
Get the observer's DtDe.
Definition: DtObserver.h:51
double myViewMagnification
Definition: DtObserver.h:643
AttachType
Definition: DtObserverObject.h:36