Cogs.Core
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
Cogs::Core::TrajectoryComponent Struct Reference

Data component defining a 3D trajectory, for example a Well trajectory. More...

#include <TrajectoryComponent.h>

Inheritance diagram for Cogs::Core::TrajectoryComponent:
Cogs::ComponentModel::Component

Public Member Functions

COGSCORE_DLL_API void determineindices (int &ix0, int &ix1, int &slices, const float startDepth, const float stopDepth)
 
- Public Member Functions inherited from Cogs::ComponentModel::Component
class EntitygetContainer () const
 Get the container currently owning this component instance.
 
void setContainer (class Entity *container)
 Set the container owning this component instance.
 
template<typename ComponentType >
ComponentType * getComponent () const
 
COGSFOUNDATION_API ComponentgetComponent (const Reflection::Name &name) const
 
COGSFOUNDATION_API ComponentgetComponent (const Reflection::TypeId &id) const
 
template<typename ComponentType >
ComponentHandle getComponentHandle () const
 
COGSFOUNDATION_API ComponentHandle getComponentHandle (const Reflection::Name &name) const
 
COGSFOUNDATION_API ComponentHandle getComponentHandle (const Reflection::TypeId &id) const
 
void setActive ()
 Sets the component to the ComponentFlags::Active state.
 
bool isActive () const
 Gets if the component is currently set to the ComponentFlags::Active state.
 
void setChanged ()
 Sets the component to the ComponentFlags::Changed state with carry.
 
void setChangedTransient ()
 Sets the component to the ComponentFlags::Changed state without carry.
 
void setFieldChanged (const Reflection::FieldId fieldId)
 Sets the component to the ComponentFlags::Changed state without carry.
 
template<typename ClassType , typename FieldType >
void setFieldChanged (FieldType ClassType::*field)
 Sets a flag indicating that the given field has changed.
 
void setFieldChangedTransient (const Reflection::FieldId fieldId)
 Sets the component to the ComponentFlags::Changed state without carry.
 
bool hasChanged () const
 
bool hasAnyfieldChanged () const
 Gets if any fields have been changed.
 
bool hasFieldChanged (const Reflection::FieldId fieldId) const
 Gets if the field with the given id on this component instance has changed.
 
template<typename ClassType , typename FieldType >
bool hasFieldChanged (FieldType ClassType::*field) const
 Gets if the given field has changed.
 
void resetCarryChanged ()
 Reset the CarryChanged flag. Called at start of redraw. See ComponentFlags::CarryChanged.
 
void resetChanged ()
 Resets the changed state of the component, respecting any carry state set.
 
template<typename ClassType , typename FieldType >
Reflection::FieldId getFieldId (FieldType ClassType::*field) const
 Gets field ID of the given field.
 
void resetFieldsChanged ()
 Resets the state of all changed field flags.
 
void resetFieldChanged (const Reflection::FieldId fieldId)
 Resets the changed state of the given fieldId.
 
template<typename ClassType , typename FieldType >
void resetFieldChanged (FieldType ClassType::*field)
 Resets the changed state of the given field.
 
constexpr void setFlags (const uint32_t flags)
 Override all flags of the Component, setting the given flags.
 
constexpr void setFlag (const uint32_t flag)
 Set the given flags. Does not override the currently set flags.
 
constexpr void unsetFlag (const uint32_t flag)
 Unset the given flag. Does not remove the status of other than the given flags.
 
constexpr bool isSet (const uint32_t flag) const
 Checks if the given flag is set. Requires exact bit match if test of several bits.
 
constexpr void setTypeId (const Reflection::TypeId typeId)
 Set the Reflection::TypeId of the component.
 
constexpr Reflection::TypeId getTypeId () const
 Get the Reflection::TypeId of the component.
 
COGSFOUNDATION_API const Reflection::TypegetType () const
 Get the full Reflection::Type of the component.
 
constexpr void setIndex (const ComponentIndex index)
 Set the components pool index. For internal use only.
 
constexpr ComponentIndex getIndex () const
 Get the components pool index. For internal use only.
 
constexpr void setGeneration (uint16_t generation)
 Sets the component generation.
 
constexpr uint16_t getGeneration () const
 Gets the component generation.
 
size_t hash (size_t hashValue=Cogs::hash()) const
 Calculates a hash of this component's members.
 

Static Public Member Functions

static void registerType ()
 
- Static Public Member Functions inherited from Cogs::ComponentModel::Component
static COGSFOUNDATION_API void registerType ()
 Register the Component type in the global type database.
 
static COGSFOUNDATION_API Reflection::TypeId getComponentTypeId (const StringView &name)
 Get the type id of the component type with the given name.
 

Public Attributes

std::vector< float > indexes
 Positive distances along trajectory. For wells Measured Depth (MD). Set same length of indexes and positions.
 
std::vector< glm::vec3 > positions
 Trajectory positions. For wells the Z component is a measurement of True Vertical Depth (TVD). Set same length of indexes and positions.
 
glm::vec3 startRadialAnchor = glm::vec3(std::numeric_limits<float>::quiet_NaN())
 
glm::vec3 stopRadialAnchor = glm::vec3(std::numeric_limits<float>::quiet_NaN())
 
float anchorStickyness = 0.15f
 

Detailed Description

Data component defining a 3D trajectory, for example a Well trajectory.

The owning entity (typically Trajectory entity) is referred to by other components for actual drawing, like ExtrusionComponent, TrajectoryAlignedComponent, VariableExtrusionComponent TrajectoryCrossSectionsComponent, DepthAxisComponent

Definition at line 22 of file TrajectoryComponent.h.

Member Function Documentation

◆ determineindices()

void Cogs::Core::TrajectoryComponent::determineindices ( int &  ix0,
int &  ix1,
int &  slices,
const float  startDepth,
const float  stopDepth 
)

Given start and stop depth, determine range of relevant trajectory stations.

Definition at line 8 of file TrajectoryComponent.cpp.

References indexes.

Referenced by Cogs::Core::TrajectoryCrossSectionsSystem::update().

◆ registerType()

void Cogs::Core::TrajectoryComponent::registerType ( )
static

Definition at line 40 of file TrajectoryComponent.cpp.

Member Data Documentation

◆ anchorStickyness

float Cogs::Core::TrajectoryComponent::anchorStickyness = 0.15f

Number in [0,1) that indicates how hard the frame should try to align to the anchors.

Definition at line 35 of file TrajectoryComponent.h.

◆ indexes

std::vector<float> Cogs::Core::TrajectoryComponent::indexes

Positive distances along trajectory. For wells Measured Depth (MD). Set same length of indexes and positions.

Definition at line 25 of file TrajectoryComponent.h.

Referenced by determineindices(), Cogs::Core::TrajectoryAlignedComponent::update(), and Cogs::Core::TrajectoryCrossSectionsSystem::update().

◆ positions

std::vector<glm::vec3> Cogs::Core::TrajectoryComponent::positions

Trajectory positions. For wells the Z component is a measurement of True Vertical Depth (TVD). Set same length of indexes and positions.

Definition at line 28 of file TrajectoryComponent.h.

Referenced by Cogs::Core::TrajectoryAlignedComponent::update(), Cogs::Core::DepthAxisSystem::update(), and Cogs::Core::TrajectoryCrossSectionsSystem::update().

◆ startRadialAnchor

glm::vec3 Cogs::Core::TrajectoryComponent::startRadialAnchor = glm::vec3(std::numeric_limits<float>::quiet_NaN())

Frames should have its local Y axis in the plane spanned between the trajectory tangent and the interpolated anchor.

Definition at line 31 of file TrajectoryComponent.h.

◆ stopRadialAnchor

glm::vec3 Cogs::Core::TrajectoryComponent::stopRadialAnchor = glm::vec3(std::numeric_limits<float>::quiet_NaN())

Definition at line 32 of file TrajectoryComponent.h.


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