MeshLib C Docs
Loading...
Searching...
No Matches
MRSolarRadiation.h File Reference
#include <MRCMesh/MRVector3.h>
#include <MRCMisc/exports.h>
#include <stddef.h>

Go to the source code of this file.

Typedefs

typedef struct MR_BitSet MR_BitSet
 
typedef struct MR_Mesh MR_Mesh
 
typedef struct MR_VertBitSet MR_VertBitSet
 
typedef struct MR_VertCoords MR_VertCoords
 
typedef struct MR_VertScalars MR_VertScalars
 
typedef struct MR_std_vector_MR_MeshIntersectionResult MR_std_vector_MR_MeshIntersectionResult
 
typedef struct MR_std_vector_MR_SkyPatch MR_std_vector_MR_SkyPatch
 
typedef struct MR_std_vector_MR_Vector3f MR_std_vector_MR_Vector3f
 
typedef struct MR_SkyPatch MR_SkyPatch
 

Functions

MRC_API MR_std_vector_MR_Vector3fMR_sampleHalfSphere (void)
 
MRC_API const MR_Vector3fMR_SkyPatch_Get_dir (const MR_SkyPatch *_this)
 
MRC_API void MR_SkyPatch_Set_dir (MR_SkyPatch *_this, MR_Vector3f value)
 
MRC_API MR_Vector3fMR_SkyPatch_GetMutable_dir (MR_SkyPatch *_this)
 
MRC_API const float * MR_SkyPatch_Get_radiation (const MR_SkyPatch *_this)
 
MRC_API void MR_SkyPatch_Set_radiation (MR_SkyPatch *_this, float value)
 
MRC_API float * MR_SkyPatch_GetMutable_radiation (MR_SkyPatch *_this)
 
MRC_API MR_SkyPatchMR_SkyPatch_DefaultConstruct (void)
 
MRC_API MR_SkyPatchMR_SkyPatch_DefaultConstructArray (size_t num_elems)
 
MRC_API MR_SkyPatchMR_SkyPatch_ConstructFrom (MR_Vector3f dir, float radiation)
 
MRC_API const MR_SkyPatchMR_SkyPatch_OffsetPtr (const MR_SkyPatch *ptr, ptrdiff_t i)
 
MRC_API MR_SkyPatchMR_SkyPatch_OffsetMutablePtr (MR_SkyPatch *ptr, ptrdiff_t i)
 
MRC_API MR_SkyPatchMR_SkyPatch_ConstructFromAnother (const MR_SkyPatch *_other)
 
MRC_API void MR_SkyPatch_Destroy (const MR_SkyPatch *_this)
 Destroys a heap-allocated instance of MR_SkyPatch. Does nothing if the pointer is null.
 
MRC_API void MR_SkyPatch_DestroyArray (const MR_SkyPatch *_this)
 Destroys a heap-allocated array of MR_SkyPatch. Does nothing if the pointer is null.
 
MRC_API MR_SkyPatchMR_SkyPatch_AssignFromAnother (MR_SkyPatch *_this, const MR_SkyPatch *_other)
 
MRC_API MR_VertScalarsMR_computeSkyViewFactor (const MR_Mesh *terrain, const MR_VertCoords *samples, const MR_VertBitSet *validSamples, const MR_std_vector_MR_SkyPatch *skyPatches, MR_BitSet *outSkyRays, MR_std_vector_MR_MeshIntersectionResult *outIntersections)
 
MRC_API MR_BitSetMR_findSkyRays (const MR_Mesh *terrain, const MR_VertCoords *samples, const MR_VertBitSet *validSamples, const MR_std_vector_MR_SkyPatch *skyPatches, MR_std_vector_MR_MeshIntersectionResult *outIntersections)
 

Typedef Documentation

◆ MR_BitSet

typedef struct MR_BitSet MR_BitSet

◆ MR_Mesh

typedef struct MR_Mesh MR_Mesh

◆ MR_SkyPatch

typedef struct MR_SkyPatch MR_SkyPatch

this class represents a portion of the sky, and its radiation Generated from class MR::SkyPatch. Supported MR_PassBy modes: MR_PassBy_DefaultConstruct, MR_PassBy_Copy, MR_PassBy_Move (and MR_PassBy_DefaultArgument and MR_PassBy_NoObject if supported by the callee).

◆ MR_std_vector_MR_MeshIntersectionResult

◆ MR_std_vector_MR_SkyPatch

◆ MR_std_vector_MR_Vector3f

◆ MR_VertBitSet

typedef struct MR_VertBitSet MR_VertBitSet

◆ MR_VertCoords

typedef struct MR_VertCoords MR_VertCoords

◆ MR_VertScalars

Function Documentation

◆ MR_computeSkyViewFactor()

MRC_API MR_VertScalars * MR_computeSkyViewFactor ( const MR_Mesh * terrain,
const MR_VertCoords * samples,
const MR_VertBitSet * validSamples,
const MR_std_vector_MR_SkyPatch * skyPatches,
MR_BitSet * outSkyRays,
MR_std_vector_MR_MeshIntersectionResult * outIntersections )

computes relative radiation in each valid sample point by emitting rays from that point in the sky: the radiation is 1.0f if all rays reach the sky not hitting the terrain; the radiation is 0.0f if all rays do not reach the sky because they are intercepted by the terrain;

Parameters
outSkyRays- optional output bitset where for every valid sample #i its rays are stored at indices [i*numPatches; (i+1)*numPatches), 0s for occluded rays (hitting the terrain) and 1s for the ones which don't hit anything and reach the sky
outIntersections- optional output vector of MeshIntersectionResult for every valid sample point Generated from function MR::computeSkyViewFactor. Parameter terrain can not be null. It is a single object. Parameter samples can not be null. It is a single object. Parameter validSamples can not be null. It is a single object. Parameter skyPatches can not be null. It is a single object. Parameter outSkyRays defaults to a null pointer in C++. Parameter outIntersections defaults to a null pointer in C++. Never returns null. Returns an instance allocated on the heap! Must call MR_VertScalars_Destroy() to free it when you're done using it.

◆ MR_findSkyRays()

MRC_API MR_BitSet * MR_findSkyRays ( const MR_Mesh * terrain,
const MR_VertCoords * samples,
const MR_VertBitSet * validSamples,
const MR_std_vector_MR_SkyPatch * skyPatches,
MR_std_vector_MR_MeshIntersectionResult * outIntersections )

In each valid sample point tests the rays from that point in the sky;

Returns
bitset where for every valid sample #i its rays are stored at indices [i*numPatches; (i+1)*numPatches), 0s for occluded rays (hitting the terrain) and 1s for the ones which don't hit anything and reach the sky
Parameters
outIntersections- optional output vector of MeshIntersectionResult for every valid sample point Generated from function MR::findSkyRays. Parameter terrain can not be null. It is a single object. Parameter samples can not be null. It is a single object. Parameter validSamples can not be null. It is a single object. Parameter skyPatches can not be null. It is a single object. Parameter outIntersections defaults to a null pointer in C++. Never returns null. Returns an instance allocated on the heap! Must call MR_BitSet_Destroy() to free it when you're done using it.

◆ MR_sampleHalfSphere()

MRC_API MR_std_vector_MR_Vector3f * MR_sampleHalfSphere ( void )

returns quasi-uniform 145 samples on unit half-sphere z>0 Generated from function MR::sampleHalfSphere. Never returns null. Returns an instance allocated on the heap! Must call MR_std_vector_MR_Vector3f_Destroy() to free it when you're done using it.

◆ MR_SkyPatch_AssignFromAnother()

MRC_API MR_SkyPatch * MR_SkyPatch_AssignFromAnother ( MR_SkyPatch * _this,
const MR_SkyPatch * _other )

Generated from method MR::SkyPatch::operator=. Parameter _this can not be null. It is a single object. Parameter _other can not be null. It is a single object. The reference to things referred to by the parameter _other (if any) might be preserved in this object. The returned pointer will never be null. It is non-owning, do NOT destroy it. When this function is called, this object will drop any object references it had previously.

◆ MR_SkyPatch_ConstructFrom()

MRC_API MR_SkyPatch * MR_SkyPatch_ConstructFrom ( MR_Vector3f dir,
float radiation )

Constructs MR::SkyPatch elementwise. The reference to the parameter dir might be preserved in the constructed object. Never returns null. Returns an instance allocated on the heap! Must call MR_SkyPatch_Destroy() to free it when you're done using it. When this function is called, this object will drop any object references it had previously.

◆ MR_SkyPatch_ConstructFromAnother()

MRC_API MR_SkyPatch * MR_SkyPatch_ConstructFromAnother ( const MR_SkyPatch * _other)

Generated from constructor MR::SkyPatch::SkyPatch. Parameter _other can not be null. It is a single object. The reference to things referred to by the parameter _other (if any) might be preserved in the constructed object. Never returns null. Returns an instance allocated on the heap! Must call MR_SkyPatch_Destroy() to free it when you're done using it.

◆ MR_SkyPatch_DefaultConstruct()

MRC_API MR_SkyPatch * MR_SkyPatch_DefaultConstruct ( void )

Constructs an empty (default-constructed) instance. Never returns null. Returns an instance allocated on the heap! Must call MR_SkyPatch_Destroy() to free it when you're done using it.

◆ MR_SkyPatch_DefaultConstructArray()

MRC_API MR_SkyPatch * MR_SkyPatch_DefaultConstructArray ( size_t num_elems)

Constructs an array of empty (default-constructed) instances, of the specified size. Will never return null. The array must be destroyed using MR_SkyPatch_DestroyArray(). Use MR_SkyPatch_OffsetMutablePtr() and MR_SkyPatch_OffsetPtr() to access the array elements.

◆ MR_SkyPatch_Destroy()

MRC_API void MR_SkyPatch_Destroy ( const MR_SkyPatch * _this)

Destroys a heap-allocated instance of MR_SkyPatch. Does nothing if the pointer is null.

◆ MR_SkyPatch_DestroyArray()

MRC_API void MR_SkyPatch_DestroyArray ( const MR_SkyPatch * _this)

Destroys a heap-allocated array of MR_SkyPatch. Does nothing if the pointer is null.

◆ MR_SkyPatch_Get_dir()

MRC_API const MR_Vector3f * MR_SkyPatch_Get_dir ( const MR_SkyPatch * _this)

direction toward the center of the patch Returns a pointer to a member variable of class MR::SkyPatch named dir. Parameter _this can not be null. It is a single object. The returned pointer will never be null. It is non-owning, do NOT destroy it.

◆ MR_SkyPatch_Get_radiation()

MRC_API const float * MR_SkyPatch_Get_radiation ( const MR_SkyPatch * _this)

radiation of the patch depending on Sun's position, sky clearness and brightness, etc Returns a pointer to a member variable of class MR::SkyPatch named radiation. Parameter _this can not be null. It is a single object. The returned pointer will never be null. It is non-owning, do NOT destroy it.

◆ MR_SkyPatch_GetMutable_dir()

MRC_API MR_Vector3f * MR_SkyPatch_GetMutable_dir ( MR_SkyPatch * _this)

direction toward the center of the patch Returns a mutable pointer to a member variable of class MR::SkyPatch named dir. Parameter _this can not be null. It is a single object. The returned pointer will never be null. It is non-owning, do NOT destroy it.

◆ MR_SkyPatch_GetMutable_radiation()

MRC_API float * MR_SkyPatch_GetMutable_radiation ( MR_SkyPatch * _this)

radiation of the patch depending on Sun's position, sky clearness and brightness, etc Returns a mutable pointer to a member variable of class MR::SkyPatch named radiation. Parameter _this can not be null. It is a single object. The returned pointer will never be null. It is non-owning, do NOT destroy it.

◆ MR_SkyPatch_OffsetMutablePtr()

MRC_API MR_SkyPatch * MR_SkyPatch_OffsetMutablePtr ( MR_SkyPatch * ptr,
ptrdiff_t i )

Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the pointer points to an array element. The reference to the parameter ptr might be preserved in the return value.

◆ MR_SkyPatch_OffsetPtr()

MRC_API const MR_SkyPatch * MR_SkyPatch_OffsetPtr ( const MR_SkyPatch * ptr,
ptrdiff_t i )

Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the pointer points to an array element. The reference to the parameter ptr might be preserved in the return value.

◆ MR_SkyPatch_Set_dir()

MRC_API void MR_SkyPatch_Set_dir ( MR_SkyPatch * _this,
MR_Vector3f value )

direction toward the center of the patch Modifies a member variable of class MR::SkyPatch named dir. Parameter _this can not be null. It is a single object. The reference to the parameter value might be preserved in this object in element dir. When this function is called, this object will drop object references it had previously in dir.

◆ MR_SkyPatch_Set_radiation()

MRC_API void MR_SkyPatch_Set_radiation ( MR_SkyPatch * _this,
float value )

radiation of the patch depending on Sun's position, sky clearness and brightness, etc Modifies a member variable of class MR::SkyPatch named radiation. Parameter _this can not be null. It is a single object. When this function is called, this object will drop object references it had previously in radiation.