16 #include <tbb/concurrent_vector.h>
136 virtual void setInstanceMatrixTransform(
int instanceId,
const Matrix4_32& xForm);
139 virtual void concurrentSetInstanceMatrixTransform(
int instanceId,
const Matrix4_32& xForm );
142 virtual void processUpdates();
145 virtual Matrix4_32 instanceMatrixTransform(
int instanceId)
const;
148 virtual void removeInstance(
int id);
151 virtual void setInstanceMultiSwitch(
int id, osgSim::MultiSwitch* clone, osgSim::MultiSwitch* master);
154 virtual void instanceMultiSwitches(
int instanceIdIndirect,
MapCloneToMultiSwitchPair& mapCloneToMasterMultiSwitches)
const;
157 virtual void setInstanceModelId(
int id,
int modelId);
160 virtual void setInstanceUvOffset(
int id,
const std::string& annotation,
float uOffset,
float vOffset);
163 virtual void scrollUv(
int id,
const std::tuple<float, float, float>& uvspeeds);
166 virtual void instanceAnnotationsAndUvOffsets(
int instanceIdIndirect, std::vector<DtIndirectAnnotationAndUvOffset>& annotations)
const;
169 virtual void setInstanceColor(
int instanceIdIndirect,
const Vector4_32& color);
171 virtual Vector4_32 instanceColor(
int instanceIdIndirect)
const;
175 virtual void setInstanceVisibility(
int instanceIdIndirect,
bool visible);
177 virtual bool instanceVisibility(
int instanceIdIndirect)
const;
181 virtual void setInstanceLightPointGroupId(
int instanceIdIndirect,
int lightPointGroupId);
183 virtual int instanceLightPointGroupId(
int instanceIdIndirect)
const;
187 virtual void setInstanceLightPointMaxDistance(
int instanceIdIndirect,
float lightPointMaxDistance);
189 virtual float instanceLightPointMaxDistance(
int instanceIdIndirect)
const;
193 virtual void setInstanceDof(
int id, osgSim::DOFTransform* clone, osgSim::DOFTransform* master,
int animationFlags);
196 virtual void setInstanceDofAnimationFlags(
int id, osgSim::DOFTransform* clone, osgSim::DOFTransform* master,
int animationFlags);
199 virtual void setInstanceDofTranslation(
int id, osgSim::DOFTransform* clone, osgSim::DOFTransform* master
204 virtual void setInstanceDofOrientation(
int id, osgSim::DOFTransform* clone, osgSim::DOFTransform* master
207 ,
int animationFlags);
210 virtual void setInstanceDofOrientation(
int id, osgSim::DOFTransform* clone, osgSim::DOFTransform* master
213 ,
int animationFlags);
222 virtual void setInstanceDofOrientationBatch(
int id,
223 const std::vector<DtInstanceDofBatchEntry>& entries);
229 virtual void setInstanceSequence(
int id, osg::Sequence* clone, osg::Sequence* master);
232 virtual void instanceSequences(
int instanceIdIndirect,
MapCloneToSequencePair& mapCloneToMasterSequences)
const;
238 virtual bool hasInProgressInstanceMove()
const;
241 virtual void addInProgressInstanceMove();
244 virtual void subtractInProgressInstanceMove();
251 virtual bool allInstancesAreToBeDeleted()
const override;
261 virtual void setMultiSwitchOnInstanceInInstanceContainer(
int instanceContainerId, osgSim::MultiSwitch* clone, osgSim::MultiSwitch* master);
264 virtual bool setDofOnInstanceInInstanceContainer(
int instanceContainerId, osgSim::DOFTransform* clone, osgSim::DOFTransform* master,
int animationFlags);
267 virtual void setUvOffsetOnInstanceInInstanceContainer(
const int instanceId,
const std::string& annotation,
float uOffset,
float vOffset);
270 virtual bool removeInstanceInInstanceContainer(
int instanceContainerId);
274 virtual void removeInstanceFromIndicesCount(
int instanceContainerIndex);
277 virtual void updateInstancePositionOrientationAddedActual(
const DtIndirectGeometryInstance& instance,
int outInstanceIndex)
override;
292 virtual void updateInstanceLightPointGroupIdActual(
const DtIndirectGeometryInstance& instance,
int outInstanceIndex)
override;
295 virtual void updateInstanceVisibilityLightPointMaxDistanceActual(
const DtIndirectGeometryInstance& instance,
int outInstanceIndex)
override;
307 virtual void setInstanceModelIdInInstanceContainer(
int instanceId,
int modelId);
376 const bool mySupportInstanceModelChanges =
true;
osg::ref_ptr< T > myMaster
Definition: DtIndirectEntityGeometry.h:54
tbb::concurrent_vector< InstanceUpdateStruct > InstanceUpdatesVector
Holds transform updates that are to be applied to instances.
Definition: DtIndirectEntityGeometry.h:117
const char * creatorTypeName< DtIndirectEntityGeometry >(void)
template specialization for the creator (pass the class being created to the creatorTypeName template...
Definition: DtIndirectEntityGeometry.h:30
std::unordered_map< int, std::tuple< float, float, float > > MapInstanceToUvOffset
Definition: DtIndirectEntityGeometry.h:94
non virtual container class for holding the information needed to create an indirect geometry instanc...
Definition: DtIndirectGeometryInstance.h:26
osg::ref_ptr< T > myClone
Definition: DtIndirectEntityGeometry.h:53
std::unordered_set< int > SetInstancesToDelete
Structure to hold instance ids to be deleted.
Definition: DtIndirectEntityGeometry.h:366
std::unordered_map< int, MapCloneToSequencePair > MapInstanceToMapCloneToMasterSequences
Definition: DtIndirectEntityGeometry.h:88
MapInstanceToMapCloneToMasterSequences myMapInstanceToMapCloneToMasterSequences
Maps an instance id and a master sequence to the clone sequence so we can get to the cloned sequence ...
Definition: DtIndirectEntityGeometry.h:340
MapCloneToDofTransformPairAndFlags< osgSim::DOFTransform > DofTransformPair
Maps an instance id and a master dof to the clone dof so we can get to the cloned dof which contains ...
Definition: DtIndirectEntityGeometry.h:79
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
Definition: featureContext.h:36
OsgEarth-free batch-entry structs shared by the articulated-model / indirect-entity batch update path...
MapInstanceToMapCloneToMasterDofs myMapInstanceToMapCloneToMasterDofs
Maps an instance id and a master dof to the clone dof so we can get to the cloned dof which contains ...
Definition: DtIndirectEntityGeometry.h:332
CloneMasterPair< osgSim::MultiSwitch > MultiSwitchPair
Structure to hold instance multi-switches' state until the instance is actually added Use the pair to...
Definition: DtIndirectEntityGeometry.h:72
std::map< const std::string, DtIndirectUvOffsetManager::UvOffset > MapAnnotationToUvOffsetData
Maps and instance id and a string to the current uv offset for this particular annotation.
Definition: DtIndirectEntityGeometry.h:91
std::unordered_map< osg::Sequence *, SequencePair > MapCloneToSequencePair
Definition: DtIndirectEntityGeometry.h:87
shader configuration storage class. Has 3 available options which are described in the constructor's ...
Definition: DtCullShaderConfig.h:21
InstanceUpdatesVector myInstanceUpdates
Updates are pushed to this vector concurrently by the indirect manager.
Definition: DtIndirectEntityGeometry.h:370
Variadic templated creator class for defining a DtVirtualBaseClass creator that is automatically regi...
Definition: DtVirtualBaseClassCreator.h:23
Inherited from DtIndirectGeometry additionally implements: -removal of instances -ability to set/get ...
Definition: DtIndirectEntityGeometry.h:42
std::unordered_map< int, int > myMapInstanceInIndirectToModelId
Definition: DtIndirectEntityGeometry.h:351
Struct to hold an instance ID and matrix transform Transforms are all calculated concurrently then st...
Definition: DtIndirectEntityGeometry.h:100
This class inherits from.
Definition: DtIndirectGeometry.h:122
std::unordered_map< osgSim::MultiSwitch *, MultiSwitchPair > MapCloneToMultiSwitchPair
Definition: DtIndirectEntityGeometry.h:73
Debug-only. Snapshot of queue health counters for this geometry.
Definition: DtIndirectGeometry.h:375
CloneMasterPair< osg::Sequence > SequencePair
Use the pair to hold the refs and the raw pointer to index into the map Maps an instance id and a ma...
Definition: DtIndirectEntityGeometry.h:86
std::unordered_map< int, int > myMapInstanceToLightPointGroupId
Maps an instance id to the light point group id for that instance.
Definition: DtIndirectEntityGeometry.h:360
MapInstanceToMapCloneToMasterMultiSwitches myMapInstanceToMapCloneToMasterMultiSwitches
Structure to hold instance multi-switches' state until the instance is actually added Use the pair to...
Definition: DtIndirectEntityGeometry.h:324
std::unordered_map< int, Matrix4_32 > MapInstanceIdToXform
Structure to hold instance orientation until the instance is actually added.
Definition: DtIndirectEntityGeometry.h:66
std::unordered_map< int, MapCloneToMultiSwitchPair > MapInstanceToMapCloneToMasterMultiSwitches
Definition: DtIndirectEntityGeometry.h:74
friend DtIndirectEntityGeometryCreator
only creator can create
Definition: DtIndirectEntityGeometry.h:46
Contains DLL export macros.
MapInstanceIdToXform myMapInstanceIdToXform
Structure to hold instance orientation until the instance is actually added.
Definition: DtIndirectEntityGeometry.h:312
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::unordered_map< osgSim::DOFTransform *, DofTransformPair > MapCloneToDofTransformPair
Definition: DtIndirectEntityGeometry.h:80
Matrix4_32 myXForm
Definition: DtIndirectEntityGeometry.h:103
MapInstanceToMapAnnotationToUvOffsetData myMapInstanceToMapAnnotationToUvOffsetData
Maps and instance id and a string to the current uv offset for this particular annotation.
Definition: DtIndirectEntityGeometry.h:345
std::unordered_map< int, bool > myMapInstanceToVisibility
Maps an instance id to the visibility for that instance.
Definition: DtIndirectEntityGeometry.h:357
std::atomic< int > myNumInProgressInstanceMoves
Definition: DtIndirectEntityGeometry.h:372
std::unordered_map< int, float > myMapInstanceToLightPointMaxDistance
Maps an instance id to the light point max distance for that instance.
Definition: DtIndirectEntityGeometry.h:363
MapInstanceToUvOffset myMapInstanceToUvOffset
Maps and instance id to the current uv offset for all scrollable uv offsets.
Definition: DtIndirectEntityGeometry.h:349
Contains the DtIndirectGeometry class declaration.
int myInstanceId
Definition: DtIndirectEntityGeometry.h:102
Helper struct to make the code a bit more clear. Used instead of std::pair to hold a pair of ref_ptr'...
Definition: DtIndirectEntityGeometry.h:51
std::unordered_map< int, MapAnnotationToUvOffsetData > MapInstanceToMapAnnotationToUvOffsetData
Definition: DtIndirectEntityGeometry.h:92
std::unordered_map< int, MapCloneToDofTransformPair > MapInstanceToMapCloneToMasterDofs
Definition: DtIndirectEntityGeometry.h:81
std::unordered_map< int, Vector4_32 > myMapInstanceToColor
Maps an instance id to the color for that instance.
Definition: DtIndirectEntityGeometry.h:354
DtVirtualBaseClassCreator< DtIndirectEntityGeometry, const DtCullShaderConfig &, const bool & > DtIndirectEntityGeometryCreator
creator
Definition: DtIndirectEntityGeometry.h:23
SetInstancesToDelete mySetInstancesIndirectIdsToDelete
Definition: DtIndirectEntityGeometry.h:367