VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Classes | Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes
makVrv::DtBuoyBeaconFeatureBuilder Class Reference

DtBuoyBeaconFeatureBuilder implements a DtStreamedFeatureCreator for buoys. It reads configuration files found in appData/importConfig that it uses to build a model definition based on a pattern, attribute values, and the configuration data read. It then creates a DtBuoyOrBeaconFacade using the model definition that it generates.

Inheritance diagram for makVrv::DtBuoyBeaconFeatureBuilder:
Inheritance graph
[legend]

Classes

struct  SeasonalBuoyRecord
 

Public Member Functions

 DtBuoyBeaconFeatureBuilder (const DtBuoyBeaconFeatureBuilder &rhs)
 
DtBuoyBeaconFeatureBuilder & operator= (const DtBuoyBeaconFeatureBuilder &orig)
 
virtual ~DtBuoyBeaconFeatureBuilder ()
 
DtUniqueID create (DtDe &de, const std::string &registrantName, const std::string &featureStyleName, const std::string &strFeatureName, const DtVector &vPosition, double scale, DtVector minBound, DtVector maxBound)
 
- Public Member Functions inherited from makVrv::DtStreamedFeatureCreator
 DtStreamedFeatureCreator (DtAgentManagerInterface &sceneInterface)
 
 DtStreamedFeatureCreator (const DtStreamedFeatureCreator &orig)
 
DtStreamedFeatureCreator & operator= (const DtStreamedFeatureCreator &rhs)
 
virtual ~DtStreamedFeatureCreator ()
 

Public Attributes

friend DtBuoyBeaconFeatureBuilderCreator
 

Protected Types

typedef boost::unordered_map
< DtUniqueID,
SeasonalBuoyRecord > 
SeasonalBuoyMap
 

Protected Member Functions

 DtBuoyBeaconFeatureBuilder (DtDe &de, const std::string &registrantName, DtBuoyBeaconModelStringParser &parser, DtTextureAtlasIndexParser &atlasParser, const std::string &featureClass)
 
virtual void determineStationaryHeight (DtVector &buoyOrBeaconPos, double modelHeightAboveOrigin)
 
std::string buildModelDefinition (const std::string &markerName)
 
void build2DModelDefinitions (const std::string &markerName, std::string &modelDef2dUnlighted, std::string &modelDef2dLighted)
 
std::string parseAndBuild (const std::string &markerStr)
 
virtual void createAndAddBuoy (DtUniqueID elementId, const std::string &modelDefName, const std::string &modelDef2dUnlighted, std::string &modelDef2dLighted, const std::string &buoyName, const DtVector &vPosition, const std::string &designator)
 
virtual DtUniqueID createFogSignalAudioOnly (const std::string &strFeatureName, const DtVector &vPosition)
 
int s57SeasonDateToDayInYear (const std::string &seasonDate)
 
int calcCurrentDayOfTheYear ()
 
virtual void setBuoyTextureOffset (DtArticulatedModelAgent *model, const std::string &atlasFileName, const std::string &key)
 
virtual void setBuoyDesignator (DtArticulatedModelAgent *model, const std::string &atlasFileName, const std::string &designator)
 
void slot_featureToBeDeleted (const std::string &resgistrant, DtUniqueID featureId)
 
void slot_dateChanged ()
 
virtual void slot_coordinateSystemChanged ()
 
Utility methods for reading model definition parameters into a variable
void readModelDefParam (const DtModelDefinition &modelDef, const std::string &paramName, bool &resultOut)
 
void readModelDefParam (const DtModelDefinition &modelDef, const std::string &paramName, float &resultOut)
 
void readModelDefParam (const DtModelDefinition &modelDef, const std::string &paramName, std::string &resultOut)
 

Static Protected Member Functions

static bool checkSeasonalState (int seasonStart, int seasonEnd, int currentDay)
 

Protected Attributes

DtDe & myDe
 
DtBuoyBeaconModelStringParser & myBuoyMarkerStringParser
 
DtTextureAtlasIndexParser & myBuoyTextureAtlasIndexParser
 
std::string myBuoyName
 
std::string myFeatureClass
 
std::string myRegistrantName
 
int myCurrentDayOfTheYear
 
SeasonalBuoyMap mySeasonalBuoyMap
 
boost::unordered_set< DtUniqueID > myAudioFogSignalIds
 
DtSignalConnectionManager myConnections
 
DtIntersector * myIntersector = nullptr
 
DtCoordinateConverter * myCoordinateConverter = nullptr
 
- Protected Attributes inherited from makVrv::DtStreamedFeatureCreator
DtAgentManagerInterface * mySceneInterface
 

Member Typedef Documentation

Constructor & Destructor Documentation

makVrv::DtBuoyBeaconFeatureBuilder::DtBuoyBeaconFeatureBuilder ( const DtBuoyBeaconFeatureBuilder &  rhs)

Copy CTOR.

virtual makVrv::DtBuoyBeaconFeatureBuilder::~DtBuoyBeaconFeatureBuilder ( )
virtual

virtual DTOR

makVrv::DtBuoyBeaconFeatureBuilder::DtBuoyBeaconFeatureBuilder ( DtDe &  de,
const std::string &  registrantName,
DtBuoyBeaconModelStringParser &  parser,
DtTextureAtlasIndexParser &  atlasParser,
const std::string &  featureClass 
)
protected

CTOR.

Parameters
deThe display environment, needed by the created DtBuoyOrBeaconFacade.
registrantNameThe name that was provided to the DtStreamedFeatureManager when the DtStreamedFeatureCreator was registered.
parseris used to parse an encode marker name string and generate a model definition based on its contents
atlasParseris used to parse texture atlas index strings.
featureClassThe feature class string identifying this feature type.

Member Function Documentation

DtBuoyBeaconFeatureBuilder& makVrv::DtBuoyBeaconFeatureBuilder::operator= ( const DtBuoyBeaconFeatureBuilder &  orig)

Assignment Operator.

DtUniqueID makVrv::DtBuoyBeaconFeatureBuilder::create ( DtDe &  de,
const std::string &  registrantName,
const std::string &  featureStyleName,
const std::string &  strFeatureName,
const DtVector &  vPosition,
double  scale,
DtVector  minBound,
DtVector  maxBound 
)
virtual

Create a feature (a DtBuoyOrBeaconFacade for now)

Parameters
deThe display environment.
registrantNameis the name that was provided to the DtStreamedFeatureManager when the DtStreamedFeatureCreator was registered
featureStyleNameis the name provided in the .osgEarth style block specified for this feature.
strFeatureNameis the markerName returned by osgEarth for the feature from a marker: specification
vPositionis the position of the feature
scaleis any scale factor provided from an osgEarth marker-scale: specification
minBoundis the min x,y,z of the feature bound
maxBoundis the max x,y,z of the feature bound
Returns
A uniqueId that will be used to identify the feature created when it comes time to delete it. returns 0 if no feature is created.

Implements makVrv::DtStreamedFeatureCreator.

virtual void makVrv::DtBuoyBeaconFeatureBuilder::determineStationaryHeight ( DtVector &  buoyOrBeaconPos,
double  modelHeightAboveOrigin 
)
protectedvirtual

This method is used to determine the height (z value, or altitude for geocentric) at which the model origin is placed for non-buoyant navigation features. IF the model definition provides a non-zero modelHeightAboveOrigin and IF their is a non-zero height attribute for the feature, then these will be used to determine an origin that will place the feature with the top of the model at the correct height. If these are not provided, an intersector going from 50km up to 50km down is used to find a point on the terrain to place the origin of the object. If the intersector does not return a result, then the altitude of the original position provided to this method is used (the osgEarth-provided altitude for the feature); but osgEarth altitude clamping won't take ocean into consideration, in which case, this location could be below sea level. So finally, if the intersector altitude or osgEarth altiude IS below sea level, then sea level is used instead. Note that if a light is later attached to the object and it has a height attribute (and the model definition provides a modelHeightAboveOrigin) this height will be overridden by that action.

std::string makVrv::DtBuoyBeaconFeatureBuilder::buildModelDefinition ( const std::string &  markerName)
protected

buildModelDefinition is the entry point for turning a string found as a marker name in a CustomFeatureNode feature request into a model definition. It first checks to see if there are any special characters in the string that would indicate that it needs to be parsed. If not, it just returns the string (minus the path that is usually included as part of a marker name). If parsing is required, it calls parseAndBuild().

void makVrv::DtBuoyBeaconFeatureBuilder::build2DModelDefinitions ( const std::string &  markerName,
std::string &  modelDef2dUnlighted,
std::string &  modelDef2dLighted 
)
protected
std::string makVrv::DtBuoyBeaconFeatureBuilder::parseAndBuild ( const std::string &  markerStr)
protected

parseAndBuild() uses the DtBuoyBeaconModelStringParser to break a marker name string into its component pieces; pattern and attribute/value pairs. Once it has the attribute value pairs decoded, it checks for an object name (OBJNAM) parameter value. If it exists, it checks the object name will be looked up in he parser's name to model definition map. If any entry is found, that model definition will be used. Otherwise substitution is performed on the pattern based on the attribute values found and the generated model definition is returned

virtual void makVrv::DtBuoyBeaconFeatureBuilder::createAndAddBuoy ( DtUniqueID  elementId,
const std::string &  modelDefName,
const std::string &  modelDef2dUnlighted,
std::string &  modelDef2dLighted,
const std::string &  buoyName,
const DtVector &  vPosition,
const std::string &  designator 
)
protectedvirtual
virtual DtUniqueID makVrv::DtBuoyBeaconFeatureBuilder::createFogSignalAudioOnly ( const std::string &  strFeatureName,
const DtVector &  vPosition 
)
protectedvirtual

Process a feature from an audio-only fog-signal style.

CATFOG and the SIGGRP/SIGPER/SIGSEQ timing attributes ride on a separate osgEarth style (FogSignalBuoys, sourced from fogsig.mbtiles) that has no BOYSHP/COLOUR – the visible buoy is drawn by one of the other styles at the same world position. This method handles that style: it parses the marker, resolves the sound filepath from a fixed model definition named "FogSignals" (whose schema provides the ten <catfog>_sound_filepath parameters and fog_sound_decibels), and emits signal_buoyOrBeaconFogSignalRequested. No DtBuoyOrBeaconFacade is created or added to the buoy layer.

Parameters
strFeatureNameMarker string emitted by osgEarth.
vPositionWorld position of the feature.
Returns
The minted DtUniqueID, or 0 on failure / missing data.
int makVrv::DtBuoyBeaconFeatureBuilder::s57SeasonDateToDayInYear ( const std::string &  seasonDate)
protected

Convert an s57 seasonal date string (form is --MMDD or --MM) to a day

of the year, from 0 (Jan 1) to 364 (or 365 on a leap year). Returns -1 if string is not valid

int makVrv::DtBuoyBeaconFeatureBuilder::calcCurrentDayOfTheYear ( )
protected

Returns the day of the year for whatever date our calendar is currently set for, from 0 (Jan 1) to 364 (or 365 on a leap year).

static bool makVrv::DtBuoyBeaconFeatureBuilder::checkSeasonalState ( int  seasonStart,
int  seasonEnd,
int  currentDay 
)
staticprotected

Check to see if the current date is within the season seasonStart / seasonEnd.

virtual void makVrv::DtBuoyBeaconFeatureBuilder::setBuoyTextureOffset ( DtArticulatedModelAgent *  model,
const std::string &  atlasFileName,
const std::string &  key 
)
protectedvirtual

Use the parsed buoy data with the buoy texture atlas to set the buoy color (ex. Red, Green, etc.)

virtual void makVrv::DtBuoyBeaconFeatureBuilder::setBuoyDesignator ( DtArticulatedModelAgent *  model,
const std::string &  atlasFileName,
const std::string &  designator 
)
protectedvirtual

Set the designator for the buoy, 3 character max (ex. 'CF','123','A')

void makVrv::DtBuoyBeaconFeatureBuilder::slot_featureToBeDeleted ( const std::string &  resgistrant,
DtUniqueID  featureId 
)
protected

Callback for signal from the streamed feature manager that a buoy has paged out.

void makVrv::DtBuoyBeaconFeatureBuilder::slot_dateChanged ( )
protected

Callback for signal from shared state signaler that the date has changed. Look through the list of seasonal buoys to see if any need to be created or destroyed.

void makVrv::DtBuoyBeaconFeatureBuilder::readModelDefParam ( const DtModelDefinition &  modelDef,
const std::string &  paramName,
bool &  resultOut 
)
protected
void makVrv::DtBuoyBeaconFeatureBuilder::readModelDefParam ( const DtModelDefinition &  modelDef,
const std::string &  paramName,
float &  resultOut 
)
protected
void makVrv::DtBuoyBeaconFeatureBuilder::readModelDefParam ( const DtModelDefinition &  modelDef,
const std::string &  paramName,
std::string &  resultOut 
)
protected
virtual void makVrv::DtBuoyBeaconFeatureBuilder::slot_coordinateSystemChanged ( )
protectedvirtual

slot for when the coordinate system changes

Member Data Documentation

friend makVrv::DtBuoyBeaconFeatureBuilder::DtBuoyBeaconFeatureBuilderCreator
DtDe& makVrv::DtBuoyBeaconFeatureBuilder::myDe
protected
DtBuoyBeaconModelStringParser& makVrv::DtBuoyBeaconFeatureBuilder::myBuoyMarkerStringParser
protected
DtTextureAtlasIndexParser& makVrv::DtBuoyBeaconFeatureBuilder::myBuoyTextureAtlasIndexParser
protected
std::string makVrv::DtBuoyBeaconFeatureBuilder::myBuoyName
protected

std::string myAtlasTextureName;

std::string makVrv::DtBuoyBeaconFeatureBuilder::myFeatureClass
protected
std::string makVrv::DtBuoyBeaconFeatureBuilder::myRegistrantName
protected
int makVrv::DtBuoyBeaconFeatureBuilder::myCurrentDayOfTheYear
protected
SeasonalBuoyMap makVrv::DtBuoyBeaconFeatureBuilder::mySeasonalBuoyMap
protected
boost::unordered_set<DtUniqueID> makVrv::DtBuoyBeaconFeatureBuilder::myAudioFogSignalIds
protected

Unique IDs minted by createFogSignalAudioOnly() for which signal_buoyOrBeaconFogSignalRequested has been emitted and not yet cleared. Used by slot_featureToBeDeleted() to emit signal_fogSignalAudioCleared when the corresponding feature pages out.

DtSignalConnectionManager makVrv::DtBuoyBeaconFeatureBuilder::myConnections
protected
DtIntersector* makVrv::DtBuoyBeaconFeatureBuilder::myIntersector = nullptr
protected
DtCoordinateConverter* makVrv::DtBuoyBeaconFeatureBuilder::myCoordinateConverter = nullptr
protected

local clone of the current system wide coordinate system converter. for thread safety.


The documentation for this class was generated from the following file:

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)