15 #include <tbb/concurrent_vector.h>
133 virtual void setInstanceMatrixTransform(
int instanceId,
const Matrix4_32& xForm);
136 virtual void concurrentSetInstanceMatrixTransform(
int instanceId,
const Matrix4_32& xForm );
139 virtual void processUpdates();
142 virtual Matrix4_32 instanceMatrixTransform(
int instanceId)
const;
145 virtual void removeInstance(
int id);
148 virtual void setInstanceMultiSwitch(
int id, osgSim::MultiSwitch* clone, osgSim::MultiSwitch* master);
151 virtual void instanceMultiSwitches(
int instanceIdIndirect,
MapCloneToMultiSwitchPair& mapCloneToMasterMultiSwitches)
const;
154 virtual void setInstanceModelId(
int id,
int modelId);
157 virtual void setInstanceUvOffset(
int id,
const std::string& annotation,
float uOffset,
float vOffset);
160 virtual void scrollUv(
int id,
const std::tuple<float, float, float>& uvspeeds);
163 virtual void instanceAnnotationsAndUvOffsets(
int instanceIdIndirect, std::vector<DtIndirectAnnotationAndUvOffset>& annotations)
const;
166 virtual void setInstanceColor(
int instanceIdIndirect,
const Vector4_32& color);
168 virtual Vector4_32 instanceColor(
int instanceIdIndirect)
const;
172 virtual void setInstanceVisibility(
int instanceIdIndirect,
bool visible);
174 virtual bool instanceVisibility(
int instanceIdIndirect)
const;
178 virtual void setInstanceLightPointGroupId(
int instanceIdIndirect,
int lightPointGroupId);
180 virtual int instanceLightPointGroupId(
int instanceIdIndirect)
const;
184 virtual void setInstanceLightPointMaxDistance(
int instanceIdIndirect,
float lightPointMaxDistance);
186 virtual float instanceLightPointMaxDistance(
int instanceIdIndirect)
const;
190 virtual void setInstanceDof(
int id, osgSim::DOFTransform* clone, osgSim::DOFTransform* master,
int animationFlags);
193 virtual void setInstanceDofAnimationFlags(
int id, osgSim::DOFTransform* clone, osgSim::DOFTransform* master,
int animationFlags);
196 virtual void setInstanceDofTranslation(
int id, osgSim::DOFTransform* clone, osgSim::DOFTransform* master
201 virtual void setInstanceDofOrientation(
int id, osgSim::DOFTransform* clone, osgSim::DOFTransform* master
204 ,
int animationFlags);
207 virtual void setInstanceDofOrientation(
int id, osgSim::DOFTransform* clone, osgSim::DOFTransform* master
210 ,
int animationFlags);
216 virtual void setInstanceSequence(
int id, osg::Sequence* clone, osg::Sequence* master);
219 virtual void instanceSequences(
int instanceIdIndirect,
MapCloneToSequencePair& mapCloneToMasterSequences)
const;
225 virtual bool hasInProgressInstanceMove()
const;
228 virtual void addInProgressInstanceMove();
231 virtual void subtractInProgressInstanceMove();
238 virtual bool allInstancesAreToBeDeleted()
const override;
242 virtual void setMultiSwitchOnInstanceInInstanceContainer(
int instanceContainerId, osgSim::MultiSwitch* clone, osgSim::MultiSwitch* master);
245 virtual bool setDofOnInstanceInInstanceContainer(
int instanceContainerId, osgSim::DOFTransform* clone, osgSim::DOFTransform* master,
int animationFlags);
248 virtual void setUvOffsetOnInstanceInInstanceContainer(
const int instanceId,
const std::string& annotation,
float uOffset,
float vOffset);
251 virtual bool removeInstanceInInstanceContainer(
int instanceContainerId);
255 virtual void removeInstanceFromIndicesCount(
int instanceContainerIndex);
258 virtual void updateInstancePositionOrientationAddedActual(
const DtIndirectGeometryInstance& instance,
int outInstanceIndex)
override;
273 virtual void updateInstanceLightPointGroupIdActual(
const DtIndirectGeometryInstance& instance,
int outInstanceIndex)
override;
276 virtual void updateInstanceVisibilityLightPointMaxDistanceActual(
const DtIndirectGeometryInstance& instance,
int outInstanceIndex)
override;
288 virtual void setInstanceModelIdInInstanceContainer(
int instanceId,
int modelId);
357 const bool mySupportInstanceModelChanges =
true;
osg::ref_ptr< T > myMaster
Definition: DtIndirectEntityGeometry.h:51
tbb::concurrent_vector< InstanceUpdateStruct > InstanceUpdatesVector
Holds transform updates that are to be applied to instances.
Definition: DtIndirectEntityGeometry.h:114
const char * creatorTypeName< DtIndirectEntityGeometry >(void)
template specialization for the creator (pass the class being created to the creatorTypeName template...
Definition: DtIndirectEntityGeometry.h:27
std::unordered_map< int, std::tuple< float, float, float > > MapInstanceToUvOffset
Definition: DtIndirectEntityGeometry.h:91
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:50
std::unordered_set< int > SetInstancesToDelete
Structure to hold instance ids to be deleted.
Definition: DtIndirectEntityGeometry.h:347
std::unordered_map< int, MapCloneToSequencePair > MapInstanceToMapCloneToMasterSequences
Definition: DtIndirectEntityGeometry.h:85
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:321
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:76
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
Definition: featureContext.h:36
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:313
CloneMasterPair< osgSim::MultiSwitch > MultiSwitchPair
Structure to hold instance multi-switches' state until the instance is actually added Use the pair to...
Definition: DtIndirectEntityGeometry.h:69
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:88
std::unordered_map< osg::Sequence *, SequencePair > MapCloneToSequencePair
Definition: DtIndirectEntityGeometry.h:84
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:351
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:39
std::unordered_map< int, int > myMapInstanceInIndirectToModelId
Definition: DtIndirectEntityGeometry.h:332
Struct to hold an instance ID and matrix transform Transforms are all calculated concurrently then st...
Definition: DtIndirectEntityGeometry.h:97
\ ::, which allows us to hook into our indirect engine to render using indirect rendering...
Definition: DtIndirectGeometry.h:120
std::unordered_map< osgSim::MultiSwitch *, MultiSwitchPair > MapCloneToMultiSwitchPair
Definition: DtIndirectEntityGeometry.h:70
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:83
std::unordered_map< int, int > myMapInstanceToLightPointGroupId
Maps an instance id to the light point group id for that instance.
Definition: DtIndirectEntityGeometry.h:341
MapInstanceToMapCloneToMasterMultiSwitches myMapInstanceToMapCloneToMasterMultiSwitches
Structure to hold instance multi-switches' state until the instance is actually added Use the pair to...
Definition: DtIndirectEntityGeometry.h:305
std::unordered_map< int, Matrix4_32 > MapInstanceIdToXform
Structure to hold instance orientation until the instance is actually added.
Definition: DtIndirectEntityGeometry.h:63
std::unordered_map< int, MapCloneToMultiSwitchPair > MapInstanceToMapCloneToMasterMultiSwitches
Definition: DtIndirectEntityGeometry.h:71
friend DtIndirectEntityGeometryCreator
only creator can create
Definition: DtIndirectEntityGeometry.h:43
Contains DLL export macros.
MapInstanceIdToXform myMapInstanceIdToXform
Structure to hold instance orientation until the instance is actually added.
Definition: DtIndirectEntityGeometry.h:293
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:77
Matrix4_32 myXForm
Definition: DtIndirectEntityGeometry.h:100
MapInstanceToMapAnnotationToUvOffsetData myMapInstanceToMapAnnotationToUvOffsetData
Maps and instance id and a string to the current uv offset for this particular annotation.
Definition: DtIndirectEntityGeometry.h:326
std::unordered_map< int, bool > myMapInstanceToVisibility
Maps an instance id to the visibility for that instance.
Definition: DtIndirectEntityGeometry.h:338
std::atomic< int > myNumInProgressInstanceMoves
Definition: DtIndirectEntityGeometry.h:353
std::unordered_map< int, float > myMapInstanceToLightPointMaxDistance
Maps an instance id to the light point max distance for that instance.
Definition: DtIndirectEntityGeometry.h:344
MapInstanceToUvOffset myMapInstanceToUvOffset
Maps and instance id to the current uv offset for all scrollable uv offsets.
Definition: DtIndirectEntityGeometry.h:330
Contains the DtIndirectGeometry class declaration.
int myInstanceId
Definition: DtIndirectEntityGeometry.h:99
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:48
std::unordered_map< int, MapAnnotationToUvOffsetData > MapInstanceToMapAnnotationToUvOffsetData
Definition: DtIndirectEntityGeometry.h:89
std::unordered_map< int, MapCloneToDofTransformPair > MapInstanceToMapCloneToMasterDofs
Definition: DtIndirectEntityGeometry.h:78
std::unordered_map< int, Vector4_32 > myMapInstanceToColor
Maps an instance id to the color for that instance.
Definition: DtIndirectEntityGeometry.h:335
DtVirtualBaseClassCreator< DtIndirectEntityGeometry, const DtCullShaderConfig &, const bool & > DtIndirectEntityGeometryCreator
creator
Definition: DtIndirectEntityGeometry.h:20
SetInstancesToDelete mySetInstancesIndirectIdsToDelete
Definition: DtIndirectEntityGeometry.h:348