AGX Dynamics 2.42.3.1
Loading...
Searching...
No Matches
agxVehicle::TrackCurveEvent Struct Reference

Track curve event with a type, an entry tangent (i.e., tangent to this event), wheel index, etc. More...

#include <TrackCurveEvent.h>

+ Inheritance diagram for agxVehicle::TrackCurveEvent:

Classes

struct  Type
 Event type with flags. More...
 

Public Types

using Obs = agx::observer_ptr< TrackCurveEvent >
 
using Ref = agx::ref_ptr< TrackCurveEvent >
 

Public Member Functions

 TrackCurveEvent (const WheelTangentData &entry, size_t wheelIndex, Type type)
 Construct given entry tangent, wheel index and type.
 
template<typename Pred >
TrackCurveEvent * forwardTo (Pred &&pred) const
 Searches forward until pred returns true.
 
agx::Real getConvexProduct () const
 Indication how "convex" this event is in relation to next.
 
agx::RigidBody * getSourceRigidBody () const
 If isIntermediate() == true, this is the source rigid body of this point, if the supported.
 
bool isIntermediate () const
 
bool isIntermediateContact () const
 
bool isIntermediateOther () const
 
bool isIntermediateSensor () const
 
bool isOnRoute () const
 
bool isWheel () const
 
template<typename Pred >
TrackCurveEvent * reverseTo (Pred &&pred) const
 Searches back/in reverse until pred returns true.
 
- Public Member Functions inherited from agx::Referenced
 Referenced ()
 Default constructor.
 
 Referenced (const Referenced &)
 
template<typename T >
T * as ()
 Subclass casting.
 
template<typename T >
const T * as () const
 
template<typename T >
T * asSafe ()
 Safe subclass casting, return nullptr if template type does not match.
 
template<typename T >
const T * asSafe () const
 
int getReferenceCount () const
 
template<typename T >
bool is () const
 Subclass test.
 
Referenced & operator= (const Referenced &)
 Assignment operator. Will increment the number of references to the referenced object.
 
void reference (void *ptr=nullptr) const
 Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it.
 
void unreference (void *ptr=nullptr) const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it.
 
void unreference_nodelete () const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it.
 

Static Public Member Functions

static Ref create (const WheelTangentData &entry, size_t wheelIndex, Type type)
 Create given entry tangent, wheel index and type.
 
- Static Public Member Functions inherited from agx::Referenced
template<typename T >
static bool ValidateCast (const Referenced *object)
 

Public Attributes

WheelTangentData entry
 Entry tangent to this event, i.e., entry.end defines the start of type.
 
Ref next
 Point to the event after this, nullptr if this is the end event.
 
Obs prev
 Pointer to the event before this, nullptr if this is the first event.
 
Type type
 Type describing this event.
 
size_t wheelIndex = agx::InvalidIndex
 Wheel index, the "source" of this event - has to be valid.
 

Protected Member Functions

virtual ~TrackCurveEvent ()=default
 Create and destroy instances using the TrackCurveList API.
 
- Protected Member Functions inherited from agx::Referenced
virtual ~Referenced ()
 Destructor.
 
void allocateObserverVector () const
 
void deleteUsingDeleteHandler () const
 

Additional Inherited Members

- Static Protected Member Functions inherited from agx::Referenced
static DeleteHandler * getDeleteHandler ()
 
static void setDeleteHandler (DeleteHandler *handler)
 Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to.
 
- Protected Attributes inherited from agx::Referenced
Mutex m_mutex
 
ObserverContainer m_observers
 
AtomicValue m_refCount
 

Detailed Description

Track curve event with a type, an entry tangent (i.e., tangent to this event), wheel index, etc.

Definition at line 35 of file TrackCurveEvent.h.

Member Typedef Documentation

◆ Obs

◆ Ref

Constructor & Destructor Documentation

◆ TrackCurveEvent()

agxVehicle::TrackCurveEvent::TrackCurveEvent ( const WheelTangentData &  entry,
size_t  wheelIndex,
Type  type 
)

Construct given entry tangent, wheel index and type.

Parameters
entry- entry tangent to this event
wheelIndex- wheel index of this event
type- type of event

◆ ~TrackCurveEvent()

virtual agxVehicle::TrackCurveEvent::~TrackCurveEvent ( )
protectedvirtualdefault

Create and destroy instances using the TrackCurveList API.

Member Function Documentation

◆ create()

static Ref agxVehicle::TrackCurveEvent::create ( const WheelTangentData &  entry,
size_t  wheelIndex,
Type  type 
)
static

Create given entry tangent, wheel index and type.

Parameters
entry- entry tangent to the new event
wheelIndex- wheel index, independent of type (e.g., INTERMEDIATE also has an index)
type- type of event
Returns
shared pointer to the new event

◆ forwardTo()

template<typename Pred >
TrackCurveEvent * agxVehicle::TrackCurveEvent::forwardTo ( Pred &&  pred) const

Searches forward until pred returns true.

Parameters
pred- predicate bool( const TrackCurveEvent& )
Returns
pointer to event where pred returned true, or nullptr if not found

Definition at line 249 of file TrackCurveEvent.h.

References next.

◆ getConvexProduct()

agx::Real agxVehicle::TrackCurveEvent::getConvexProduct ( ) const
inline

Indication how "convex" this event is in relation to next.

If the return value is negative means that this event is locally convex, e.g., wrapping a wheel. Note that it's not valid to do this for the last event.

Returns
<= 0 convex, otherwise concave

Definition at line 238 of file TrackCurveEvent.h.

References agxVehicle::WheelTangentData::convexity(), entry, and next.

◆ getSourceRigidBody()

agx::RigidBody * agxVehicle::TrackCurveEvent::getSourceRigidBody ( ) const
inline

If isIntermediate() == true, this is the source rigid body of this point, if the supported.

Returns
source rigid body of an intermediate point

Definition at line 243 of file TrackCurveEvent.h.

References agxVehicle::TrackCurveEvent::Type::source, and type.

◆ isIntermediate()

bool agxVehicle::TrackCurveEvent::isIntermediate ( ) const
inline
Returns
true if this is an event with entry to an intermediate point (of any type)

Definition at line 211 of file TrackCurveEvent.h.

References isIntermediateContact(), isIntermediateOther(), and isIntermediateSensor().

◆ isIntermediateContact()

bool agxVehicle::TrackCurveEvent::isIntermediateContact ( ) const
inline
Returns
true if this is an event with entry to a sensor contact

Definition at line 223 of file TrackCurveEvent.h.

References agxVehicle::TrackCurveEvent::Type::INTERMEDIATE_CONTACT, agxVehicle::TrackCurveEvent::Type::is(), and type.

Referenced by isIntermediate().

◆ isIntermediateOther()

bool agxVehicle::TrackCurveEvent::isIntermediateOther ( ) const
inline
Returns
true if this is an event with entry to an unknown/unclassified point

Definition at line 228 of file TrackCurveEvent.h.

References agxVehicle::TrackCurveEvent::Type::INTERMEDIATE_OTHER, agxVehicle::TrackCurveEvent::Type::is(), and type.

Referenced by isIntermediate().

◆ isIntermediateSensor()

bool agxVehicle::TrackCurveEvent::isIntermediateSensor ( ) const
inline
Returns
true if this is an event with entry to a sensor center point

Definition at line 218 of file TrackCurveEvent.h.

References agxVehicle::TrackCurveEvent::Type::INTERMEDIATE_SENSOR, agxVehicle::TrackCurveEvent::Type::is(), and type.

Referenced by isIntermediate().

◆ isOnRoute()

bool agxVehicle::TrackCurveEvent::isOnRoute ( ) const
inline
Returns
true if this event is in the expected wheel index order, otherwise false

Definition at line 233 of file TrackCurveEvent.h.

References agxVehicle::TrackCurveEvent::Type::is(), agxVehicle::TrackCurveEvent::Type::ON_ROUTE, and type.

◆ isWheel()

bool agxVehicle::TrackCurveEvent::isWheel ( ) const
inline
Returns
true if this is an event with entry onto a wheel

Definition at line 206 of file TrackCurveEvent.h.

References agxVehicle::TrackCurveEvent::Type::is(), type, and agxVehicle::TrackCurveEvent::Type::WHEEL.

◆ reverseTo()

template<typename Pred >
TrackCurveEvent * agxVehicle::TrackCurveEvent::reverseTo ( Pred &&  pred) const

Searches back/in reverse until pred returns true.

Parameters
pred- predicate bool( const TrackCurveEvent& )
Returns
pointer to event where pred returned true, or nullptr if not found

Definition at line 258 of file TrackCurveEvent.h.

References prev.

Member Data Documentation

◆ entry

WheelTangentData agxVehicle::TrackCurveEvent::entry

Entry tangent to this event, i.e., entry.end defines the start of type.

Definition at line 191 of file TrackCurveEvent.h.

Referenced by getConvexProduct().

◆ next

Ref agxVehicle::TrackCurveEvent::next

Point to the event after this, nullptr if this is the end event.

Note that next is not nullptr for the last event, last.next->next is nullptr and last.next->wheelIndex == invalid.

Definition at line 196 of file TrackCurveEvent.h.

Referenced by forwardTo(), and getConvexProduct().

◆ prev

Obs agxVehicle::TrackCurveEvent::prev

Pointer to the event before this, nullptr if this is the first event.

Definition at line 195 of file TrackCurveEvent.h.

Referenced by agxVehicle::TrackCurveEventList::last(), and reverseTo().

◆ type

Type agxVehicle::TrackCurveEvent::type

◆ wheelIndex

size_t agxVehicle::TrackCurveEvent::wheelIndex = agx::InvalidIndex

Wheel index, the "source" of this event - has to be valid.

Definition at line 192 of file TrackCurveEvent.h.


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