Cogs.Core
|
Classes | |
struct | ControlPoint |
struct | FlowFractionData |
struct | TrajectoryPoint |
struct | Vertex |
struct | WallVertex |
Public Member Functions | |
void | updateFontSize () |
void | initialize (Context *context) |
void | update () |
![]() | |
class Entity * | getContainer () 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 Component * | getComponent (const Reflection::Name &name) const |
COGSFOUNDATION_API Component * | getComponent (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::Type & | getType () 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 COGSCORE_DLL_API void | registerType () |
Register the type in the type system. | |
template<typename T > | |
static Reflection::Type & | registerDerivedType () |
Convenience method for registering the type of a derived 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< glm::vec3 > | trajectoryPoints |
std::vector< float > | radius |
std::vector< glm::vec3 > | flowFraction |
std::vector< float > | wallValues |
float | heightScale = 1.f |
float | radiusScale = 1.f |
bool | showWater = true |
bool | showOil = true |
bool | showGas = true |
float | unitScale = 1.f |
std::string | unitText = "m" |
bool | updateNeeded = true |
glm::vec3 | waterColor |
glm::vec3 | oilColor |
glm::vec3 | gasColor |
float | fontSize = 20.f |
bool | showAxialExtents = true |
bool | showShadow = true |
bool | showGrid = true |
bool | centerMesh = true |
bool | showIndicatorRing = false |
float | indicatorRingPosition = 0.f |
glm::vec3 | indicatorRingColor |
![]() | |
void * | messageCallback = nullptr |
void * | userData = nullptr |
size_t | dynamicTypeInfoIndex = static_cast<size_t>(-1) |
Private Member Functions | |
void | createMeshEntity (EntityPtr &mesh, MeshType liquidType) |
void | updateMaterial (EntityPtr mesh, MeshType liquidType) |
void | generateMultiphaseFlowMesh (Mesh *mesh, const std::vector< ControlPoint > &controlPoints, MeshType liquidType) |
void | createGridEntity () |
void | createTextEntity () |
void | createIndicatorRing () |
void | updateGroundGrid () |
void | updateAxisAnnotations () |
void | updateIndicatorRing (const std::vector< TrajectoryPoint > &trajectory) |
void | generateExtrusionVertices (std::vector< Vertex > &vertexBuffer, std::vector< unsigned int > &indexBuffer, const std::vector< ControlPoint > &controlPoints, MeshType liquidType) |
void | generateExtrusionVerticesWall (std::vector< WallVertex > &vertexBuffer, std::vector< unsigned int > &indexBuffer, const std::vector< ControlPoint > &controlPoints, MeshType liquidType) |
void | generateClosingCaps (std::vector< Vertex > &vertexBuffer, std::vector< unsigned int > &indexBuffer, const ControlPoint &controlPoint, MeshType liquidType) |
void | transformCrossection (float ratio, float alpha, std::vector< Vertex > &vertexBuffer, const ControlPoint &controlPoint, MeshType liquidType, bool isClosingCap=false) |
void | removeDuplicatedPoints (std::vector< TrajectoryPoint > &points) |
void | applyScaling (std::vector< TrajectoryPoint > &points) |
void | center (std::vector< TrajectoryPoint > &points) |
void | updateMeshes () |
void | updateShadowVisibility () |
void | finalizeControlPoints (std::vector< ControlPoint > &controlPoints) |
Static Private Member Functions | |
static bool | isStratified (MeshType liquidType) |
static bool | isAnnular (MeshType liquidType) |
static unsigned int | getNumOfSegmentsInCrossSection (MeshType liquidType) |
static glm::vec3 | wallValueToColor (const ControlPoint &controlPoint) |
static void | calculateNormals (std::vector< Vertex > &vertexBuffer, std::vector< unsigned int > &indexBuffer) |
Private Attributes | |
Context * | context = nullptr |
Material * | mainMaterial = nullptr |
VariableKey | diffuseColorMaterialPropertyKey |
VariableKey | emissiveColorMaterialPropertyKey |
VariableKey | specularColorMaterialPropertyKey |
EntityPtr | meshEntity [MeshType::Last+1] |
EntityPtr | wallEntity |
EntityPtr | groundGridMeshEntity |
EntityPtr | annotationAxisMeshEntity |
EntityPtr | indicatorRingEntity |
EntityPtr | textEntity [AnnotationAxis::AxisLast+1] |
glm::vec3 | geometryMin |
glm::vec3 | geometryMax |
glm::vec3 | scaledTrajectoryMin |
glm::vec3 | scaledTrajectoryMax |
float | currentFontSize = -1.f |
bool | currentShowAxialExtents = true |
bool | currentShowGrid = true |
bool | currentCenterMesh = true |
bool | currentShowIndicatorRing = false |
Definition at line 17 of file MultiphaseFlowComponent.h.
|
private |
Definition at line 183 of file MultiphaseFlowComponent.h.
|
private |
Definition at line 126 of file MultiphaseFlowComponent.h.
MultiphaseFlowComponent::MultiphaseFlowComponent | ( | ) |
Definition at line 52 of file MultiphaseFlowComponent.cpp.
|
private |
Definition at line 1534 of file MultiphaseFlowComponent.cpp.
|
staticprivate |
Definition at line 1973 of file MultiphaseFlowComponent.cpp.
|
private |
Definition at line 1555 of file MultiphaseFlowComponent.cpp.
|
private |
Definition at line 248 of file MultiphaseFlowComponent.cpp.
|
private |
Definition at line 267 of file MultiphaseFlowComponent.cpp.
|
private |
Definition at line 127 of file MultiphaseFlowComponent.cpp.
|
private |
Definition at line 280 of file MultiphaseFlowComponent.cpp.
|
private |
Definition at line 1599 of file MultiphaseFlowComponent.cpp.
|
private |
Definition at line 736 of file MultiphaseFlowComponent.cpp.
|
private |
Definition at line 560 of file MultiphaseFlowComponent.cpp.
|
private |
Definition at line 843 of file MultiphaseFlowComponent.cpp.
|
private |
Definition at line 944 of file MultiphaseFlowComponent.cpp.
|
staticprivate |
Definition at line 122 of file MultiphaseFlowComponent.cpp.
void MultiphaseFlowComponent::initialize | ( | Context * | context | ) |
Definition at line 202 of file MultiphaseFlowComponent.cpp.
|
staticprivate |
Definition at line 115 of file MultiphaseFlowComponent.cpp.
|
staticprivate |
Definition at line 106 of file MultiphaseFlowComponent.cpp.
|
static |
Definition at line 71 of file MultiphaseFlowComponent.cpp.
|
private |
Definition at line 1516 of file MultiphaseFlowComponent.cpp.
|
private |
Definition at line 385 of file MultiphaseFlowComponent.cpp.
void MultiphaseFlowComponent::update | ( | ) |
Definition at line 1925 of file MultiphaseFlowComponent.cpp.
|
private |
Definition at line 1345 of file MultiphaseFlowComponent.cpp.
void MultiphaseFlowComponent::updateFontSize | ( | ) |
Definition at line 295 of file MultiphaseFlowComponent.cpp.
|
private |
Definition at line 1213 of file MultiphaseFlowComponent.cpp.
|
private |
Definition at line 1269 of file MultiphaseFlowComponent.cpp.
|
private |
Definition at line 144 of file MultiphaseFlowComponent.cpp.
|
private |
Definition at line 1713 of file MultiphaseFlowComponent.cpp.
|
private |
Definition at line 1696 of file MultiphaseFlowComponent.cpp.
|
staticprivate |
Definition at line 377 of file MultiphaseFlowComponent.cpp.
|
private |
Definition at line 203 of file MultiphaseFlowComponent.h.
bool Cogs::Core::MultiphaseFlowComponent::centerMesh = true |
Definition at line 39 of file MultiphaseFlowComponent.h.
|
private |
Definition at line 195 of file MultiphaseFlowComponent.h.
|
private |
Definition at line 218 of file MultiphaseFlowComponent.h.
|
private |
Definition at line 214 of file MultiphaseFlowComponent.h.
|
private |
Definition at line 216 of file MultiphaseFlowComponent.h.
|
private |
Definition at line 217 of file MultiphaseFlowComponent.h.
|
private |
Definition at line 219 of file MultiphaseFlowComponent.h.
|
private |
Definition at line 197 of file MultiphaseFlowComponent.h.
|
private |
Definition at line 198 of file MultiphaseFlowComponent.h.
std::vector<glm::vec3> Cogs::Core::MultiphaseFlowComponent::flowFraction |
Definition at line 22 of file MultiphaseFlowComponent.h.
float Cogs::Core::MultiphaseFlowComponent::fontSize = 20.f |
Definition at line 35 of file MultiphaseFlowComponent.h.
glm::vec3 Cogs::Core::MultiphaseFlowComponent::gasColor |
Definition at line 34 of file MultiphaseFlowComponent.h.
|
private |
Definition at line 209 of file MultiphaseFlowComponent.h.
|
private |
Definition at line 208 of file MultiphaseFlowComponent.h.
|
private |
Definition at line 202 of file MultiphaseFlowComponent.h.
float Cogs::Core::MultiphaseFlowComponent::heightScale = 1.f |
Definition at line 24 of file MultiphaseFlowComponent.h.
glm::vec3 Cogs::Core::MultiphaseFlowComponent::indicatorRingColor |
Definition at line 42 of file MultiphaseFlowComponent.h.
|
private |
Definition at line 204 of file MultiphaseFlowComponent.h.
float Cogs::Core::MultiphaseFlowComponent::indicatorRingPosition = 0.f |
Definition at line 41 of file MultiphaseFlowComponent.h.
|
private |
Definition at line 196 of file MultiphaseFlowComponent.h.
|
private |
Definition at line 200 of file MultiphaseFlowComponent.h.
glm::vec3 Cogs::Core::MultiphaseFlowComponent::oilColor |
Definition at line 33 of file MultiphaseFlowComponent.h.
std::vector<float> Cogs::Core::MultiphaseFlowComponent::radius |
Definition at line 21 of file MultiphaseFlowComponent.h.
float Cogs::Core::MultiphaseFlowComponent::radiusScale = 1.f |
Definition at line 25 of file MultiphaseFlowComponent.h.
|
private |
Definition at line 212 of file MultiphaseFlowComponent.h.
|
private |
Definition at line 211 of file MultiphaseFlowComponent.h.
bool Cogs::Core::MultiphaseFlowComponent::showAxialExtents = true |
Definition at line 36 of file MultiphaseFlowComponent.h.
bool Cogs::Core::MultiphaseFlowComponent::showGas = true |
Definition at line 28 of file MultiphaseFlowComponent.h.
bool Cogs::Core::MultiphaseFlowComponent::showGrid = true |
Definition at line 38 of file MultiphaseFlowComponent.h.
bool Cogs::Core::MultiphaseFlowComponent::showIndicatorRing = false |
Definition at line 40 of file MultiphaseFlowComponent.h.
bool Cogs::Core::MultiphaseFlowComponent::showOil = true |
Definition at line 27 of file MultiphaseFlowComponent.h.
bool Cogs::Core::MultiphaseFlowComponent::showShadow = true |
Definition at line 37 of file MultiphaseFlowComponent.h.
bool Cogs::Core::MultiphaseFlowComponent::showWater = true |
Definition at line 26 of file MultiphaseFlowComponent.h.
|
private |
Definition at line 199 of file MultiphaseFlowComponent.h.
|
private |
Definition at line 206 of file MultiphaseFlowComponent.h.
std::vector<glm::vec3> Cogs::Core::MultiphaseFlowComponent::trajectoryPoints |
Definition at line 20 of file MultiphaseFlowComponent.h.
float Cogs::Core::MultiphaseFlowComponent::unitScale = 1.f |
Definition at line 29 of file MultiphaseFlowComponent.h.
std::string Cogs::Core::MultiphaseFlowComponent::unitText = "m" |
Definition at line 30 of file MultiphaseFlowComponent.h.
bool Cogs::Core::MultiphaseFlowComponent::updateNeeded = true |
Definition at line 31 of file MultiphaseFlowComponent.h.
|
private |
Definition at line 201 of file MultiphaseFlowComponent.h.
std::vector<float> Cogs::Core::MultiphaseFlowComponent::wallValues |
Definition at line 23 of file MultiphaseFlowComponent.h.
glm::vec3 Cogs::Core::MultiphaseFlowComponent::waterColor |
Definition at line 32 of file MultiphaseFlowComponent.h.