15 class DtLocationStateComponent;
23 : myLocalVertices(
"local")
24 , myWorldVertices(
"world")
31 : myObjectGeometry(orig.myObjectGeometry)
58 DtLocalVertexList myLocalVertices;
60 DtVertexList myWorldVertices;
73 : DtFrameStateInterface(storage)
118 virtual bool localGetClosestLine(
const DtVector& point, DtVector& linePt1, DtVector& linePt2)
const {
throw DtUnimplementedMethod(
"bool localGetClosestLine(const DtVector& point, DtVector& linePt1, DtVector& linePt2) const is unimplemented."); };
133 virtual bool worldGetClosestLine(
const DtVector& point, DtVector& linePt1, DtVector& linePt2)
const {
throw DtUnimplementedMethod(
"bool localGetClosestLine(const DtVector& point, DtVector& linePt1, DtVector& linePt2) const is unimplemented."); };
138 virtual void setLocalVertices(
const DtList& vertices, DtVector& newGeometricCenter) {
throw DtUnimplementedMethod(
"bool setLocalVertices(const DtList& vertices, DtVector& newGeometricCenter) is unimplemented."); };
142 virtual void setLocalVertices(
const std::vector<DtVector>& vertices, DtVector& newGeometricCenter) {
throw DtUnimplementedMethod(
"bool setLocalVertices(const std::vector<DtVector>& vertices, DtVector& newGeometricCenter) is unimplemented."); };
151 virtual void setWorldVertices(
const std::vector<DtVector>& vertices, DtVector& newGeometricCenter) {
throw DtUnimplementedMethod(
"bool setWorldVertices(const std::vector<DtVector>& vertices, DtVector& newGeometricCenter) is unimplemented."); };
159 virtual void setWorldVertices(
const DtList& vertices, DtVector& newGeometricCenter) {
throw DtUnimplementedMethod(
"bool setWorldVertices(const DtList& vertices, DtVector& newGeometricCenter) is unimplemented."); };
163 virtual void setObjectVertices(
const std::vector<DtVector>& vertices) {
throw DtUnimplementedMethod(
"bool setObjectVertices(const std::vector<DtVector>& vertices, DtVector& newGeometricCenter) is unimplemented."); };
174 virtual void addLocalVertex(
const DtVector& vertex, DtVector& newGeometricCenter) {
throw DtUnimplementedMethod(
"bool addLocalVertex(const DtVector& vertex, DtVector& newGeometricCenter) is unimplemented."); };
178 virtual void addWorldVertex(
const DtVector& vertex, DtVector& newGeometricCenter) {
throw DtUnimplementedMethod(
"bool addWorldVertex(const DtVector& vertex, DtVector& newGeometricCenter) is unimplemented."); };
181 mutable boost::signals2::signal<void (const DtFrameStateInterface*)> signal_objectVerticesChanged{};
185 virtual const DtString& markingText()
const;
208 virtual const DtVertexList& worldVertices()
const override;
214 virtual const Dt3dBoundingVolume& boundingVolume()
const override;
216 virtual const bool closedFigure()
const override;
217 virtual const bool ellipsoid()
const override;
218 virtual const bool projection()
const override ;
219 virtual void setClosedFigure(
const bool& b)
override;
220 virtual void setEllipsoid(
const bool& b)
override;
221 virtual void setProjection(
const bool& b)
override;
222 virtual void setBoundingVolume(
const Dt3dBoundingVolume& b)
override;
223 virtual void setHalfLengthWidthHeight(
double l,
double w,
double h)
override;
225 virtual void updateVertices()
override;
236 bool calculateWorldVertices(
DtVertexList& newList)
const;
237 virtual void removeVertex(
int)
override;
238 virtual const bool& objectVerticesChanged()
const override;
239 virtual void setObjectVerticesChanged(
const bool&)
override;
240 virtual const bool& worldVerticesChanged()
const override;
241 virtual void setWorldVerticesChanged(
const bool&)
override;
242 virtual double distSquaredTo(
const DtVector& testPoint)
const override;
243 virtual bool localGetClosestVertex(
const DtVector& point, DtVector& vertex)
const override;
244 virtual bool localGetClosestLine(
const DtVector& point, DtVector& linePt1, DtVector& linePt2)
const override;
245 virtual double worldDistSquaredTo(
const DtVector& testPoint)
const override;
246 virtual bool worldGetClosestVertex(
const DtVector& point, DtVector& vertex)
const override;
247 virtual bool worldGetClosestLine(
const DtVector& point, DtVector& linePt1, DtVector& linePt2)
const override;
251 virtual void setEngineeringArea(
const DtVector&)
override;
253 virtual void setLocalVertices(
const std::vector<DtVector>& vertices, DtVector& newGeometricCenter)
override;
254 virtual void setLocalVertices(
const DtList& vertices, DtVector& newGeometricCenter)
override;
255 virtual void setLocalVertices(
const DtLocalVertexList& vertices, DtVector& newGeometricCenter)
override;
257 virtual void setWorldVertices(
const std::vector<DtVector>& vertices, DtVector& newGeometricCenter)
override;
258 virtual void setWorldVertices(
const DtVertexList& vertices, DtVector& newGeometricCenter)
override;
259 virtual void setWorldVertices(
const DtList& vertices, DtVector& newGeometricCenter)
override;
261 virtual void setObjectVertices(
const std::vector<DtVector>& vertices)
override;
262 virtual void setObjectVertices(
const DtList& vertices)
override;
264 virtual void addLocalVertex(
const DtVector& vertex)
override;
265 virtual void addLocalVertex(
const DtVector& vertex, DtVector& newGeometricCenter)
override;
266 virtual void addWorldVertex(
const DtVector& vertex, DtVector& newGeometricCenter)
override;
268 virtual void setMaximumVertices(
unsigned maxVertices);
280 return myNeedsUpdateVertices;
287 myNeedsUpdateVertices = b;
293 virtual void setPointRecordsIntoEnvironmental();
323 virtual const Dt3dBoundingVolume& boundingVolume()
const override;
325 virtual const DtVertexList& worldVertices()
const override;
327 virtual const bool closedFigure()
const override;
328 virtual const bool ellipsoid()
const override;
329 virtual const bool projection()
const override;
330 virtual void updateVertices()
override;
331 virtual double distSquaredTo(
const DtVector& testPoint)
const override;
332 virtual bool localGetClosestVertex(
const DtVector& point, DtVector& vertex)
const override;
333 virtual bool localGetClosestLine(
const DtVector& point, DtVector& linePt1, DtVector& linePt2)
const override;
334 virtual double worldDistSquaredTo(
const DtVector& testPoint)
const override;
335 virtual bool worldGetClosestVertex(
const DtVector& point, DtVector& vertex)
const override;
336 virtual bool worldGetClosestLine(
const DtVector& point, DtVector& linePt1, DtVector& linePt2)
const override;
341 virtual void setObjectVerticesChanged(
const bool&)
override;
342 virtual const bool& objectVerticesChanged()
const override;
344 virtual void setWorldVerticesChanged(
const bool&)
override;
345 virtual const bool& worldVerticesChanged()
const override;
349 virtual void handleDataUpdated();
360 bool calculateWorldVertices(
DtVertexList& newList)
const;
366 void watchEnvironmentalChanges();
409 virtual void updateDataStorage()
override;
412 virtual bool forceAdvance()
override;
422 myCurrentFrameState.aboutToBeDeleted();
423 myNextFrameState.aboutToBeDeleted();
430 myCurrentFrameState.updateStateData(sd);
431 myNextFrameState.updateStateData(sd);
435 virtual void advanceFrame()
override;
447 bool myFirstAdvance =
true;
Instances of DtVrfObjectParameters are the readable/writeable objects that contain the information ne...
Definition: vrfObjectParameters.h:64
Exception thrown when a required method has not been implemented.
Definition: stateDataTypes.h:30
const DtVrfGeometryStateComponentData & frameState() const
Current frame state only can access current frame buffers. This ensures thread safety.
Definition: vrfGeometryStateComponent.h:321
virtual const DtSimBoundingGeometry & worldBoundingGeometry() const
Returns the bounding geometry of this object in world coordinates.
Definition: vrfGeometryStateComponent.h:100
#define UNDEFINED_METHOD(Type, Method,...)
Defines a virtual non-const method with variadic parameters that throws DtUnimplementedMethod, requiring an override in a derived class.
Definition: doubleBufferedDataStorage.h:138
virtual void setToObjectGeometry(DtVrfObjectGeometry &) const
Copies this component's object geometry into the provided geometry object.
Definition: vrfGeometryStateComponent.h:103
DtVrfGeometryStateComponentData(const DtVrfGeometryStateComponentData &orig)
Copy constructor.
Definition: vrfGeometryStateComponent.h:30
virtual void setObjectVertices(const std::vector< DtVector > &vertices)
Sets the object-relative reference vertices from a vector.
Definition: vrfGeometryStateComponent.h:163
virtual bool localGetClosestVertex(const DtVector &point, DtVector &vertex) const
Determines the closest vertex in the object's geometry to a given point, in local coordinates...
Definition: vrfGeometryStateComponent.h:112
DtLocalVertexList myLocalVertices
Vertex list in local (body-frame) coordinates.
Definition: vrfGeometryStateComponent.h:58
The DtLocationStateComponent interface contains the interface that all DtLocationStateComponents can ...
Definition: locationStateComponent.h:25
Class Description: DtSimBoundingGeometry describes on objects bounding volume or bounding area (or no...
Definition: simBoundingGeometry.h:57
virtual void makeWritable() override
Override to make component writable.
Definition: vrfGeometryStateComponent.h:271
virtual void setLocalVertices(const DtLocalVertexList &vertices, DtVector &newGeometricCenter)
Sets the local-coordinate vertices from a DtLocalVertexList and returns the updated geometric center...
Definition: vrfGeometryStateComponent.h:146
virtual void setObjectVertices(const DtList &vertices)
Sets the object-relative reference vertices from a DtList.
Definition: vrfGeometryStateComponent.h:166
bool myWorldVerticesChanged
True if world-coordinate vertices changed since the last frame advance.
Definition: vrfGeometryStateComponent.h:299
Default creator implementation for a state component type. T_StateComponent is the concrete component...
Definition: stateComponent.h:326
virtual bool worldGetClosestLine(const DtVector &point, DtVector &linePt1, DtVector &linePt2) const
Determines the closest line segment in the object's geometry to a given point, in world coordinates...
Definition: vrfGeometryStateComponent.h:133
virtual void addLocalVertex(const DtVector &vertex, DtVector &newGeometricCenter)
Appends a vertex in local coordinates and updates the geometric center.
Definition: vrfGeometryStateComponent.h:174
3) Define the current frame class. This will be used for read access.
Definition: vrfGeometryStateComponent.h:311
DtVrfGeometryStateComponentData & frameState()
Definition: vrfGeometryStateComponent.h:203
DtVector myParentLocation
Cached world position of the parent entity from the last frame advance.
Definition: vrfGeometryStateComponent.h:445
virtual void setWorldVertices(const DtList &vertices, DtVector &newGeometricCenter)
Sets the world-coordinate vertices from a DtList and returns the updated geometric center...
Definition: vrfGeometryStateComponent.h:159
virtual DtFrameStateInterface * nextFrameState() override
Returns the writable next frame state interface.
Definition: vrfGeometryStateComponent.h:404
virtual void setMaximumVertices(unsigned maxVertices)
Sets the maximum number of vertices allowed for this geometry component. If an attempt is made to set...
Definition: vrfGeometryStateComponent.h:190
unsigned int myCallbackHandle
Handle returned when registering the environmental instance update callback.
Definition: vrfGeometryStateComponent.h:380
bool isDoubleBuffered()
Returns true since this component uses double-buffered frame data storage.
Definition: vrfGeometryStateComponent.h:400
#define UNDEFINED_MUTATOR_WITH_ARGS(Set,...)
Defines a virtual setter accepting variadic arguments that throws DtUnimplementedMethod, requiring an override in a derived class.
Definition: doubleBufferedDataStorage.h:88
#define UNDEFINED_RETURNREF_ACCESSORS(ReturnType, Member)
Defines both const and non-const virtual reference accessors that throw DtUnimplementedMethod, requiring overrides in a derived class.
Definition: doubleBufferedDataStorage.h:74
Plain data holder for the geometry state component, storing the object geometry, local-coordinate ver...
Definition: vrfGeometryStateComponent.h:19
bool myObjectVerticesChanged
True if object-space vertices changed in the current frame.
Definition: vrfGeometryStateComponent.h:376
const DtVrfGeometryStateComponentData & frameState() const
Next frame access write access. Ensure this is only used in a single thread (i.e.a controller thread)...
Definition: vrfGeometryStateComponent.h:202
unsigned long long UInt64
64-bit unsigned integer type.
Definition: stateDataTypes.h:19
#define UNDEFINED_RETURNREF_ACCESSOR(ReturnType, Member)
Defines a virtual const reference accessor that throws DtUnimplementedMethod, marking the method as r...
Definition: doubleBufferedDataStorage.h:60
virtual double worldDistSquaredTo(const DtVector &testPoint) const
Returns the squared distance from a given point in world coordinates, to the object. If the object has more than two vertices (that is, more than one line segment), it acts on the closest line segment.
Definition: vrfGeometryStateComponent.h:123
virtual bool localGetClosestLine(const DtVector &point, DtVector &linePt1, DtVector &linePt2) const
Determines the closest line segment in the object's geometry to a given point, in local coordinates...
Definition: vrfGeometryStateComponent.h:118
bool myNeedsUpdateVertices
True if vertex positions must be recalculated before the next advance.
Definition: vrfGeometryStateComponent.h:301
1) Define the interface class that will be used to represent the next and current frames...
Definition: vrfGeometryStateComponent.h:65
DtVrfGeometryStateComponentNextFrame myNextFrameState
The next-frame (writable) geometry state component.
Definition: vrfGeometryStateComponent.h:441
virtual void setLocalVertices(const std::vector< DtVector > &vertices, DtVector &newGeometricCenter)
Sets the local-coordinate vertices from a vector and returns the updated geometric center...
Definition: vrfGeometryStateComponent.h:142
DtVrfGeometryStateComponentData & operator=(const DtVrfGeometryStateComponentData &rhs)
Assignment operator.
Definition: vrfGeometryStateComponent.h:40
bool needsUpdateVertices() const
Returns whether vertices are marked dirty and need to be recalculated.
Definition: vrfGeometryStateComponent.h:278
4) Define the state component that will contain the wrappers to the next and current frame states tha...
Definition: vrfGeometryStateComponent.h:392
const DtLocationStateComponent * myLocationStateComponent
Cached pointer to the location state component, used to detect parent position changes.
Definition: vrfGeometryStateComponent.h:443
virtual void setWorldVertices(const DtVertexList &vertices, DtVector &newGeometricCenter)
Sets the world-coordinate vertices from a DtVertexList and returns the updated geometric center...
Definition: vrfGeometryStateComponent.h:155
The overall structure of the DtStateData mechanism is: The DtStateData contains a list of double buff...
Definition: stateData.h:513
virtual const DtFrameStateInterface * nextFrameState() const override
Returns the read-only next frame state interface.
Definition: vrfGeometryStateComponent.h:406
#define DEFINE_STATE_COMPONENT_TYPE(CreatedComponent)
Macro to define all required static and virtual state component type methods. Place in the public sec...
Definition: stateComponent.h:272
DtVrfGeometryStateComponentCurrentFrame myCurrentFrameState
The current-frame (read-only) geometry state component.
Definition: vrfGeometryStateComponent.h:439
void advanceFrame(const DtVrfGeometryStateComponentData &data)
Copies the provided next-frame data into the current-frame buffer.
Definition: vrfGeometryStateComponent.h:369
UInt64 myEnvironmentInstanceHandle
Legion instance handle of the associated environmental state component.
Definition: vrfGeometryStateComponent.h:382
class DtVertexList:
Definition: vertexList.h:22
Subclass from this to indicate that this will be a double buffered state component.
Definition: stateComponent.h:489
DtStateComponentCreator< DtVrfGeometryStateComponentImplementation > DtVrfGeometryStateComponentCreator
5) Define the creator. This will need to be registered with the REGISTER_STATE_COMPONENT macro in the...
Definition: vrfGeometryStateComponent.h:452
void setNeedsUpdateVertices(bool b)
Sets whether vertices need to be recalculated on the next updateVertices() call.
Definition: vrfGeometryStateComponent.h:285
virtual void addLocalVertex(const DtVector &vertex)
Appends a vertex in local coordinates without updating the geometric center.
Definition: vrfGeometryStateComponent.h:170
unsigned myMaxVertices
The maximum number of vertices allowed for this geometry component.
Definition: vrfGeometryStateComponent.h:303
#define UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(Type, Member, Set)
Defines an undefined virtual by-value accessor and an undefined virtual setter, both throwing DtUnimp...
Definition: doubleBufferedDataStorage.h:103
#define UNDEFINED_RETURNREF_CONST_ACCESSOR(ReturnType, Member)
Defines a virtual const reference accessor that throws DtUnimplementedMethod. Equivalent to UNDEFINED...
Definition: doubleBufferedDataStorage.h:67
virtual void aboutToBeDeleted()
Called when the component is about to be deleted; emits signal_stateComponentAboutToBeDeleted.
Definition: stateComponent.h:78
bool myWorldVerticesChanged
True if world-coordinate vertices changed in the current frame.
Definition: vrfGeometryStateComponent.h:378
DtSimBoundingGeometryType
Definition: simBoundingGeometry.h:61
virtual const DtFrameStateInterface * currentFrameState() const override
Returns the read-only current frame state interface.
Definition: vrfGeometryStateComponent.h:402
This class maintains a rectangular bounding volume and an ordered list of vertices describing the phy...
Definition: vrfObjectGeometry.h:39
virtual void makeReadOnly() override
Override to make component read-only.
Definition: vrfGeometryStateComponent.h:274
UInt64 myLastRecordAdd
Instance handle of the last Legion point record added for environmental sync.
Definition: vrfGeometryStateComponent.h:305
virtual void aboutToBeDeleted() override
Notifies both frame states that this component is about to be removed from the simulation.
Definition: vrfGeometryStateComponent.h:419
#define UNDEFINED_RETURNREF_ACCESSOR_MUTATOR(Type, Member, Set)
Defines an undefined virtual const-reference accessor and an undefined virtual setter, both throwing DtUnimplementedMethod and requiring overrides in a derived class.
Definition: doubleBufferedDataStorage.h:112
#define DEFINE_REF_ACCESSORS(ReturnType, Method, Member)
Defines const and non-const reference accessors for a member variable.
Definition: doubleBufferedDataStorage.h:17
DtVrfObjectGeometry myObjectGeometry
The object's geometry definition including bounding geometry.
Definition: vrfGeometryStateComponent.h:56
DtVertexList myWorldVertices
Vertex list in world (geocentric) coordinates.
Definition: vrfGeometryStateComponent.h:60
virtual double distSquaredTo(const DtVector &testPoint) const
Returns the squared distance from a given point in local coordinates, to the object. If the object has more than two vertices (that is, more than one line segment), it acts on the closest line segment.
Definition: vrfGeometryStateComponent.h:108
boost::signals2::scoped_connection myCompleteSetupConnection
Connection to defer watchEnvironmentalChanges() until after the first frame advance.
Definition: vrfGeometryStateComponent.h:384
virtual void setLocalVertices(const DtList &vertices, DtVector &newGeometricCenter)
Sets the local-coordinate vertices from a DtList and returns the updated geometric center...
Definition: vrfGeometryStateComponent.h:138
virtual void updateStateData(DtStateData *sd) override
Updates both frame states to use the provided state data storage.
Definition: vrfGeometryStateComponent.h:428
DtVrfGeometryStateComponentData()
Constructs a default geometry state component data with empty vertex lists.
Definition: vrfGeometryStateComponent.h:22
#define DT_DLL_vrfStateData
This file is used to determine how to build Disable inconsistent dll linkage warning Visual Studio 6...
Definition: vrfStateDataDefines.h:29
DtVrfGeometryStateComponentData myData
Definition: vrfGeometryStateComponent.h:387
virtual bool worldGetClosestVertex(const DtVector &point, DtVector &vertex) const
Determines the closest vertex in the object's geometry to a given point, in world coordinates...
Definition: vrfGeometryStateComponent.h:127
virtual void addWorldVertex(const DtVector &vertex, DtVector &newGeometricCenter)
Appends a vertex in world coordinates and updates the geometric center.
Definition: vrfGeometryStateComponent.h:178
class DtLocalVertexList:
Definition: localVertexList.h:20
DtVrfGeometryStateComponentData myData
The writable geometry data for the next simulation frame.
Definition: vrfGeometryStateComponent.h:307
Contains the DtStateComponent class declaration.
virtual void setWorldVertices(const std::vector< DtVector > &vertices, DtVector &newGeometricCenter)
Sets the world-coordinate vertices from a vector and returns the updated geometric center...
Definition: vrfGeometryStateComponent.h:151
Base interface for accessing current or next frame state in a double-buffered state component...
Definition: stateComponent.h:354
2) Define the next frame class. This will be used for write access.
Definition: vrfGeometryStateComponent.h:194
bool myObjectVerticesChanged
True if object-space vertices changed since the last frame advance.
Definition: vrfGeometryStateComponent.h:297