VR-Forces 5.0.1 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
spatialVrfObjectManagerHybrid.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2019 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
6 #pragma once
7 
9 
10 #include "vrfobjcore/spatial.h"
11 
17 
19 {
20 private:
22 
27 public:
29  const Coordinate_System* coordSys);
30 
32 
34  virtual void addVrfObjects(const DtManagedObjectListConstPtr& vrfObjects) override;
35 
39  virtual void removeVrfObject(const DtSimObject * vrfObject) override;
40 
42  virtual bool setResolutions(unsigned int xRes, unsigned int yRes,
43  unsigned int zRes) override;
44 
47  virtual void clearVrfObjects() override;
48 
58  virtual void reset(const DtManagedObjectListConstPtr& vrfObjects) override;
59 
62 
73  virtual bool getVrfObjects(const DtExtent& extent, DtVrfConstObjectUniqueContainer& objects) const override;
74 
75  virtual bool getVrfObjects(const DtVrfObjectPredicate& predicate, const DtExtent& extent,
76  DtVrfConstObjectUniqueContainer& objects) const override;
77 
78  virtual bool getVrfObjects(const DtChord& chord, std::list<const DtSimObject*>& objects) const override;
79 
80  virtual bool getVrfObjects(const DtVrfObjectPredicate& predicate, const DtChord& chord,
81  std::list<const DtSimObject*>& objects) const override;
83 
86 
99 
100  virtual void visitVrfObjects(const DtExtent& extent, DtSpatialSelectionFunctor &callback) const override;
101  virtual void visitVrfObjects(const DtChord& chord, DtSpatialSelectionFunctor& callback) const override;
103 
104  unsigned int numObjects() const override
105  {
106  return myOctree->numObjects();
107  }
108 
109 private:
113 
115  typedef std::map<unsigned long long, DtSimObjectReference> Container;
116  void splitVrfObjectsSingleMultiPoint(const DtManagedObjectListConstPtr& vrfObjects,
117  Container& vrfObjectsMultiPoint,
118  Container& vrfObjectsSinglePoint);
119  bool IsVrfObjectsSinglePoint(const DtSimObject* vrfObject);
120  void combineVrfObjectsSingleMultiPoint(const DtVrfConstObjectUniqueContainer& vrfObjectsMultiPoint,
121  const DtVrfConstObjectUniqueContainer& vrfObjectsSinglePoint,
122  DtVrfConstObjectUniqueContainer& vrfObjects) const;
123  void combineVrfObjectsSingleMultiPoint(const std::list<const DtSimObject*>& vrfObjectsMultiPoint,
124  const std::list<const DtSimObject*>& vrfObjectsSinglePoint,
125  std::list<const DtSimObject*>& vrfObjects) const;
126  void resetObjectMaxSize();
127  void updateObjectMaxSize(const Dt3dBoundingVolume& boundingVolume);
128 
130  void resetOctree(const Container& vrfObjects);
131  void addVrfObjectsOctree(const Container& vrfObjects);
132  void removeVrfObjectOctree(const DtSimObject* vrfObject);
133  void clearVrfObjectsOctree();
134  bool getVrfObjectsOctree(const DtExtent& extent, DtVrfConstObjectUniqueContainer& objects) const;
135  bool getVrfObjectsOctree(const DtVrfObjectPredicate& predicate, const DtExtent& extent,
136  DtVrfConstObjectUniqueContainer& objects) const;
137  bool getVrfObjectsOctree(const DtChord& chord, std::list<const DtSimObject*>& objects) const;
138  bool getVrfObjectsOctree(const DtVrfObjectPredicate& predicate, const DtChord& chord,
139  std::list<const DtSimObject*>& objects) const;
140  void visitVrfObjectsOctree(const DtExtent& extent, DtSpatialSelectionFunctor &callback) const;
141  void visitVrfObjectsOctree(const DtChord& chord, DtSpatialSelectionFunctor& callback) const;
142 
144  void resetSpatialIndex(const Container& vrfObjects);
145  void addVrfObjectsSpatialIndex(const Container& vrfObjects);
146  void removeVrfObjectSpatialIndex(const DtSimObject* vrfObject);
147  void clearVrfObjectsSpatialIndex();
148  bool getVrfObjectsSpatialIndex(const DtExtent& extent, DtVrfConstObjectUniqueContainer& objects) const;
149  bool getVrfObjectsSpatialIndex(const DtVrfObjectPredicate& predicate, const DtExtent& extent,
150  DtVrfConstObjectUniqueContainer& objects) const;
151  bool getVrfObjectsSpatialIndex(const DtChord& chord, const double delta, std::list<const DtSimObject*>& objects) const;
152  bool getVrfObjectsSpatialIndex(const DtVrfObjectPredicate& predicate, const DtChord& chord, const double delta,
153  std::list<const DtSimObject*>& objects) const;
154  void visitVrfObjectsSpatialIndex(const DtExtent& extent, DtSpatialSelectionFunctor &callback) const;
155  void visitVrfObjectsSpatialIndex(const DtChord& chord, const double delta, DtSpatialSelectionFunctor& callback) const;
156  DtExtent expandExtentSpatialIndex(const DtExtent& extent) const;
157  DtChord expandChordSpatialIndex(const DtChord& chord) const;
158  double getChordDeltaSpatialIndex() const;
159 
161 
162  bool getVrfObjectsWithinSpatialIndex(const MAK::Vector3d& min, const MAK::Vector3d& max,
163  DtVrfConstObjectUniqueContainer& objects) const;
164  bool getVrfObjectsWithinSpatialIndex(const DtVrfObjectPredicate& predicate,
165  const MAK::Vector3d& min, const MAK::Vector3d& max,
166  DtVrfConstObjectUniqueContainer& objects) const;
167  bool getVrfObjectsNearChordSpatialIndex(const MAK::Vector3d& pointA, const MAK::Vector3d& pointB,
168  const double delta, std::list<const DtSimObject*>& objects) const;
169  bool getVrfObjectsNearChordSpatialIndex(const DtVrfObjectPredicate& predicate,
170  const MAK::Vector3d& pointA, const MAK::Vector3d& pointB,
171  const double delta, std::list<const DtSimObject*>& objects) const;
173 
174 protected:
175 
178 
181 
183  std::shared_ptr<MAK::SpatialIndex<const DtSimObject*>> mySpatialIndex;
184 
188 
191 
194 };
NOTE: This entire class is deprecated, in favor of Dt3dChord.
Definition: chord.h:40
DtOctree< const DtSimObject > * myOctree
The octree being used to store the objects.
Definition: spatialVrfObjectManagerHybrid.h:180
std::vector< const DtSimObject * > DtVrfConstObjectUniqueContainer
Definition: spatialVrfObjectManager.h:94
Container myVrfObjectsSinglePoint
Definition: spatialVrfObjectManagerHybrid.h:190
const Coordinate_System * myCoordSys
Definition: spatialVrfObjectManagerHybrid.h:193
Container myVrfObjectsMultiPoint
Definition: spatialVrfObjectManagerHybrid.h:189
virtual void visitVrfObjects(const DtExtent &extent, DtSpatialSelectionFunctor &callback) const =0
Functions that call the specified functor for every object intersecting the requested region (whether...
virtual bool getVrfObjects(const DtExtent &extent, DtVrfConstObjectUniqueContainer &objects) const =0
The DtSpatialVrfObjectManager is responsible for maintaining a spatial organization of all specified ...
Definition: spatialVrfObjectManager.h:31
double myObjectMaxHeight
Definition: spatialVrfObjectManagerHybrid.h:187
virtual void reset(const DtManagedObjectListConstPtr &vrfObjects)=0
Clears out the current DtSimObjects, sets it to have the minimum extent, that contains all of the DtS...
unsigned int numObjects() const override
Number of objects in the octree.
Definition: spatialVrfObjectManagerHybrid.h:104
The DtExtent represents an axis-aligned 3d bounding box.
Definition: extent.h:43
virtual void removeVrfObject(const DtSimObject *vrfObject)=0
Removes vrfObject from the set of vrfObjects we are maintaining.
double myObjectMaxWidth
Definition: spatialVrfObjectManagerHybrid.h:186
DtExtent myRootExtent
The extent of the octree.
Definition: spatialVrfObjectManagerHybrid.h:177
Contains the DtVrfObjectPredicate class declaration.
Definition: vrfObjectPredicate.h:20
Spatial object manager which uses both an octree and a spatialindex. It is a wrapper for the DtSpatia...
Definition: spatialVrfObjectManagerHybrid.h:18
std::shared_ptr< MAK::SpatialIndex< const DtSimObject * > > mySpatialIndex
The SpatialIndex being used to store the objects.
Definition: spatialVrfObjectManagerHybrid.h:183
Definition: coordSystem.h:54
std::map< unsigned long long, DtSimObjectReference > Container
Private class implementation details.
Definition: spatialVrfObjectManagerHybrid.h:115
#define DT_DLL_vrfobjcore
This file is used to determine how to build.
Definition: vrfobjcoreDefines.h:24
Abstract interface for a spatial object manager.
Definition: spatialVrfObjectManager.h:43
Represents a single simulation object in the exercise. Object may be VRF simulation, or non-VRF simulated, and may be simulated by the local sim engine, or by a remote sim engine. Only public (external) state of the object is available. All data is read-only. All access to data of the object is thread safe within the simulation frame.
Definition: simObject.h:79
virtual void clearVrfObjects()=0
Clears all managed objects from the manager. Does not affect the spatial container, other than to empty its cells of any elements.
virtual bool setResolutions(unsigned int xRes, unsigned int yRes, unsigned int zRes)=0
Deprecated – doesn&#39;t apply to octree manager. Still necessary for DtSpatialVrfObjectManager. TODO need to push this all into the manager class, instead of having the DtPhysicalWorld assume that things are uniformly subdivided.
DtBoost::shared_ptr< const DtManagedObjectList > DtManagedObjectListConstPtr
Typedef for a shared pointer to a const DtOrgViewManagedObjectList. These lists are used within VR-Fo...
Definition: managedObjectList.h:35
double myObjectMaxLength
Definition: spatialVrfObjectManagerHybrid.h:185
double myLastTimeEvaluated
Definition: spatialVrfObjectManagerHybrid.h:192
virtual void addVrfObjects(const DtManagedObjectListConstPtr &vrfObjects)=0
Spatially sorts the vrfObjects associated in the vrfObjects.

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)