19#ifndef FLOWENGINECOMMONDEF_H
20#define FLOWENGINECOMMONDEF_H
25#define FLE_DLL __declspec( dllexport )
26#elif defined( __LINUX__ )
27#define FLE_DLL __attribute__( ( visibility( "default" ) ) )
29#error "FlowEngine not supported on this platform!"
32#define FLOWENGINE_FACTORY extern "C" FLE_DLL
42#pragma pack( push, 8 )
117 template<
typename T >
120 template<
typename T >
125 template<
typename T >
144 template< std::
size_t N >
146 :
data( fixedSizeArray )
152 :
data( v.empty() ? nullptr : v.
data() )
153 ,
count( v.empty() ? 0 : v.size() )
160 explicit operator bool()
const
183 assert( index <
count );
184 return data[ index ];
191 assert( index <
count );
192 return data[ index ];
198 template<
typename T >
217 template< std::
size_t N >
219 :
data( fixedSizeArray )
225 :
data( v.empty() ? nullptr : v.
data() )
226 ,
count( v.empty() ? 0 : v.size() )
233 explicit operator bool()
const
235 return data !=
nullptr;
256 assert( index <
count );
257 return data[ index ];
277 ,
count( str.size() )
288 :
data( v.empty() ? nullptr : v.
data() )
289 ,
count( v.empty() ? 0 : v.size() )
296 explicit operator bool()
const
318 ,
count( str.size() )
327 ,
count( std::strlen( str ) )
338 :
data( v.empty() ? nullptr : v.
data() )
339 ,
count( v.empty() ? 0 : v.size() )
343 explicit operator bool()
const
369 template<
typename T >
371 :
data( static_cast< void * >( other.
data ) )
378 explicit operator bool()
const
404 template<
typename T >
406 :
data( static_cast< const void * >( other.
data ) )
411 template<
typename T >
413 :
data( static_cast< const void * >( other.
data ) )
418 explicit operator bool()
const
594 template<
typename T,
typename S >
637 double x()
const {
return data[ 0 ]; }
638 double y()
const {
return data[ 1 ]; }
639 double z()
const {
return data[ 2 ]; }
654 return std::sqrt(
x() *
x() +
y() *
y() +
z() *
z() );
665 return {
x() / len,
y() / len,
z() / len };
671 return x() * other.
x() +
y() * other.
y() +
z() * other.
z();
679 y() * other.
z() -
z() * other.
y(),
680 z() * other.
x() -
x() * other.
z(),
681 x() * other.
y() -
y() * other.
x(),
687 return { v.
x() * scalar, v.
y() * scalar, v.
z() * scalar };
697 return { lhs.
x() - rhs.
x(), lhs.
y() - rhs.
y(), lhs.
z() - rhs.
z() };
702 return { lhs.
x() + rhs.
x(), lhs.
y() + rhs.
y(), lhs.
z() + rhs.
z() };
715 std::memcpy(
data, inMatrix,
sizeof(
data ) );
718 Matrix3x3(
const std::initializer_list< double > &list )
720 assert( list.size() == 9 );
721 std::copy( list.begin(), list.end(),
data );
734 R( 0, 0 ) * v.
x() + R( 0, 1 ) * v.
y() + R( 0, 2 ) * v.
z(),
735 R( 1, 0 ) * v.
x() + R( 1, 1 ) * v.
y() + R( 1, 2 ) * v.
z(),
736 R( 2, 0 ) * v.
x() + R( 2, 1 ) * v.
y() + R( 2, 2 ) * v.
z(),
748 operator bool()
const
750 return bus >= 0 &&
idx >= 0;
795static_assert(
sizeof(
FlowEngine::Point3 ) == 3 *
sizeof(
double ),
"Point3 layout mismatch" );
796static_assert(
sizeof(
FlowEngine::Point2 ) == 2 *
sizeof(
double ),
"Point2 layout mismatch" );
797static_assert(
sizeof(
FlowEngine::Normal ) == 3 *
sizeof(
float ),
"Normal layout mismatch" );
802static_assert(
sizeof(
FlowEngine::Vector3 ) == 3 *
sizeof(
double ),
"Vector3 layout mismatch" );
803static_assert(
sizeof(
FlowEngine::Matrix3x3 ) == 9 *
sizeof(
double ),
"Matrix3x3 layout mismatch" );
805static_assert( std::is_trivially_copyable< FlowEngine::Point3 >::value,
"Point3 must be trivially copyable" );
806static_assert( std::is_trivially_copyable< FlowEngine::Normal >::value,
"Normal must be trivially copyable" );
807static_assert( std::is_trivially_copyable< FlowEngine::Color >::value,
"Color must be trivially copyable" );
808static_assert( std::is_trivially_copyable< FlowEngine::Triangle >::value,
"Triangle must be trivially copyable" );
809static_assert( std::is_trivially_copyable< FlowEngine::TexCoords >::value,
"TexCoords must be trivially copyable" );
810static_assert( std::is_trivially_copyable< FlowEngine::Vector3 >::value,
"Vector3 must be trivially copyable" );
811static_assert( std::is_trivially_copyable< FlowEngine::Matrix3x3 >::value,
"Matrix3x3 must be trivially copyable" );
Definition: BoundingBoxInterface.cpp:26
int PointClassification
Definition: CommonDef.h:790
std::ptrdiff_t Index
Index type.
Definition: CommonDef.h:103
float ColorComponent32
Color component (32 bits) type.
Definition: CommonDef.h:112
PointClassificationAttributes
Definition: CommonDef.h:775
@ PointClassificationFlag_IsGround
Definition: CommonDef.h:778
PointClassificationCategory
Definition: CommonDef.h:782
@ PointClassificationCategory_Unknown
Definition: CommonDef.h:783
@ PointClassificationCategory_Trees
Definition: CommonDef.h:786
@ PointClassificationCategory_Buildings
Definition: CommonDef.h:785
@ PointClassificationCategory_Custom
Definition: CommonDef.h:787
@ PointClassificationCategory_Roads
Definition: CommonDef.h:784
std::uint8_t ColorComponent
Color component (8 bits) type.
Definition: CommonDef.h:109
StandardAxis
enumerates the standard axes
Definition: CommonDef.h:582
GraphicsDevicePlatform
The platform of a GPU device.
Definition: CommonDef.h:756
std::size_t Size
Size type.
Definition: CommonDef.h:106
unsigned int ReconstructionID
Unique identification number in a group of cameras.
Definition: CommonDef.h:115
Result
Enumerates possible results generated by FlowEngine.
Definition: CommonDef.h:48
@ UnsupportedVersion
The version of the loading 3DK is not supported or did not match the minimum requirements.
@ InvalidArgument
One or more supplied arguments are invalid.
@ FileNotFound
File not found.
@ PreconditionNotMet
One or more preconditions were not met.
@ Success
Everything went ok.
@ OutOfMemoryError
An out of RAM memory error has been received.
@ NewVersionAvailable
A New SDK version is available to download.
@ BufferTooSmall
The provided buffer is too small to complete the operation.
@ GenericError
Something went wrong. Usually the log contains more detailed information.
@ FeatureNotAvailable
This feature is not available in this version of FlowEngine.
@ ProcessNotRunning
An abort or pause signal has been emitted, but no process is running.
Specialization for a Buffer of characters.
Definition: CommonDef.h:264
Buffer(char *data, Size count)
Construction from an arbitrary buffer and size.
Definition: CommonDef.h:281
Buffer(std::string &&str)=delete
Prohibit conversion from a temporary string.
Buffer(std::vector< char > &v)
Implicit conversion from a std::vector.
Definition: CommonDef.h:287
Buffer(std::string &str)
Implicit conversion from a std::string.
Definition: CommonDef.h:275
Buffer()=default
Represents an empty C string literal.
Buffer()=default
Represents an empty buffer.
Buffer(void *d, Size s)
Construct from a raw pointer and byte count.
Definition: CommonDef.h:363
Buffer(const Buffer< T > &other)
Construction from a buffer of any type.
Definition: CommonDef.h:370
Holds a (mutable) non_owning pointer and a size Used to marshal memory buffers as arguments in a safe...
Definition: CommonDef.h:127
T * end()
Iteration support.
Definition: CommonDef.h:173
Buffer()=default
Represents an empty buffer.
T * begin()
Iteration support.
Definition: CommonDef.h:166
T * data
Pointer to the (mutable) data.
Definition: CommonDef.h:129
T & operator[](std::size_t index)
Indexed access.
Definition: CommonDef.h:180
Buffer(std::vector< T > &v)
Implicit conversion from a std::vector.
Definition: CommonDef.h:151
Buffer(std::vector< T > &&v)=delete
Prohibits implicit conversion from a temporary std::vector.
Buffer(T *d, Size s)
Construct a buffer from a (mutable) pointer and a size.
Definition: CommonDef.h:138
Buffer(T(&fixedSizeArray)[N])
Implicit conversion from a fixed-size array.
Definition: CommonDef.h:145
Size count
Number of elements the pointer points to.
Definition: CommonDef.h:132
a packed RGB color
Definition: CommonDef.h:495
ColorComponent r
red component
Definition: CommonDef.h:497
ColorComponent g
green component
Definition: CommonDef.h:500
ColorComponent b
blue component
Definition: CommonDef.h:503
Specialization for a const buffer characters.
Definition: CommonDef.h:305
ConstBuffer(std::string &&str)=delete
Prohibits conversion from a temporary std::string.
ConstBuffer(const std::vector< char > &v)
Implicit conversion from a std::vector.
Definition: CommonDef.h:337
ConstBuffer(const char *str)
Implicit conversion from a C string literal.
Definition: CommonDef.h:325
ConstBuffer(const std::string &str)
Implicit conversion from a std::string.
Definition: CommonDef.h:316
ConstBuffer()=default
Creates an empty string buffer.
ConstBuffer(const char *data, Size count)
Construction from an arbitrary buffer and size.
Definition: CommonDef.h:331
ConstBuffer(const ConstBuffer< T > &other)
Construction from a const buffer of any type.
Definition: CommonDef.h:412
ConstBuffer()=default
Creates an empty buffer.
ConstBuffer(const void *d, Size s)
Construct from a raw pointer and byte count.
Definition: CommonDef.h:398
ConstBuffer(const Buffer< T > &other)
Construction from a buffer of any type.
Definition: CommonDef.h:405
Holds a (non mutable) non_owning pointer and a count Used to marshal memory buffers as arguments in a...
Definition: CommonDef.h:200
ConstBuffer(const std::vector< T > &v)
Implicit conversion from a std::vector.
Definition: CommonDef.h:224
Size count
Number of elements the pointer points to.
Definition: CommonDef.h:205
const T & operator[](std::size_t index) const
Indexed access.
Definition: CommonDef.h:253
const T * end() const
Iteration support.
Definition: CommonDef.h:246
const T * begin() const
Iteration support.
Definition: CommonDef.h:239
ConstBuffer()=default
Creates an empty buffer.
const T * data
Pointer to the (immutable) data.
Definition: CommonDef.h:202
ConstBuffer(std::vector< T > &&v)=delete
Prohibits implicit conversion from a temporary std::vector.
ConstBuffer(const T *d, Size s)
Creates a const buffer with a const pointer and a size.
Definition: CommonDef.h:211
ConstBuffer(const T(&fixedSizeArray)[N])
Implicit conversion from a fixed-size array.
Definition: CommonDef.h:218
Represents a moment in time.
Definition: CommonDef.h:603
int second
the second in the range (0-59)
Definition: CommonDef.h:620
int year
the year (e.g. 2019)
Definition: CommonDef.h:605
int hour
the hour in the range (0-23)
Definition: CommonDef.h:614
int day
the day in the range 1-31
Definition: CommonDef.h:611
int month
the month in the range 1-12
Definition: CommonDef.h:608
int minute
the minute in the range (0-59)
Definition: CommonDef.h:617
Represents a logical graphics device.
Definition: CommonDef.h:743
int idx
Definition: CommonDef.h:745
int bus
Definition: CommonDef.h:744
Basic information about a GPU device.
Definition: CommonDef.h:764
char name[512]
Definition: CommonDef.h:769
GraphicsDevicePlatform platform
Definition: CommonDef.h:766
int bus
Definition: CommonDef.h:768
bool isIntegrated
Definition: CommonDef.h:771
long long physicalMemoryMB
Definition: CommonDef.h:770
int idx
Definition: CommonDef.h:767
GraphicsDeviceID id
Definition: CommonDef.h:765
a 2D image Holds information about a raw image Data is not owned
Definition: CommonDef.h:563
Buffer< Color32 > data
the image color data stored as 3 floating-point values
Definition: CommonDef.h:571
int width
the image width in pixels
Definition: CommonDef.h:565
Color32 & operator()(int x, int y)
Definition: CommonDef.h:574
int height
the image height in pixels
Definition: CommonDef.h:568
a 3x3 matrix
Definition: CommonDef.h:708
Matrix3x3(const std::initializer_list< double > &list)
Definition: CommonDef.h:718
friend Vector3 operator*(const Matrix3x3 &R, const FlowEngine::Vector3 &v)
Definition: CommonDef.h:730
Matrix3x3(const double(&inMatrix)[9])
Definition: CommonDef.h:713
double & operator()(int row, int col)
Definition: CommonDef.h:725
double data[9]
Definition: CommonDef.h:709
a normal
Definition: CommonDef.h:482
float y
y component
Definition: CommonDef.h:487
float x
x component
Definition: CommonDef.h:484
float z
z component
Definition: CommonDef.h:490
Bound 2 values together.
Definition: CommonDef.h:596
S second
Definition: CommonDef.h:598
T first
Definition: CommonDef.h:597
a 2 dimensional point
Definition: CommonDef.h:472
double y
y coordinate
Definition: CommonDef.h:477
double x
x coordinate
Definition: CommonDef.h:474
a three dimensional point
Definition: CommonDef.h:459
double z
z coordinate
Definition: CommonDef.h:467
double y
y coordinate
Definition: CommonDef.h:464
double x
x coordinate
Definition: CommonDef.h:461
a floating-point color
Definition: CommonDef.h:508
ColorComponent32 b
blue component
Definition: CommonDef.h:516
ColorComponent32 r
red component
Definition: CommonDef.h:510
ColorComponent32 g
green component
Definition: CommonDef.h:513
a Quaternion Holds an axis and an angle
Definition: CommonDef.h:551
double angle
the angle
Definition: CommonDef.h:556
Point3 axis
the axis
Definition: CommonDef.h:553
a texture coordinate Holds a couple of floats representing texture coordinates
Definition: CommonDef.h:540
float v
the v component
Definition: CommonDef.h:545
float u
the u component
Definition: CommonDef.h:542
a triangle. Holds 3 indexes to points. Triangles are specified in counter-clockwise order
Definition: CommonDef.h:526
Index idx1
the second index
Definition: CommonDef.h:531
Index idx0
the first index
Definition: CommonDef.h:528
Index idx2
the third index
Definition: CommonDef.h:534
a 3d vector
Definition: CommonDef.h:625
double dot(const Vector3 &other) const
Definition: CommonDef.h:669
double z() const
Definition: CommonDef.h:639
double & x()
Definition: CommonDef.h:641
friend Vector3 operator*(double scalar, const Vector3 &v)
Definition: CommonDef.h:685
Vector3(double x, double y, double z)
Definition: CommonDef.h:630
double & operator()(int index)
Definition: CommonDef.h:646
double & y()
Definition: CommonDef.h:642
friend Vector3 operator+(const Vector3 &lhs, const Vector3 &rhs)
Definition: CommonDef.h:700
double length() const
Definition: CommonDef.h:652
Vector3 normalized() const
Definition: CommonDef.h:658
Vector3 cross(const Vector3 &other) const
Definition: CommonDef.h:675
double data[3]
Definition: CommonDef.h:626
double y() const
Definition: CommonDef.h:638
double x() const
Definition: CommonDef.h:637
friend Vector3 operator-(const Vector3 &lhs, const Vector3 &rhs)
Definition: CommonDef.h:695
double & z()
Definition: CommonDef.h:643
Represents a version in the major.minor categories format.
Definition: CommonDef.h:431
int major
the major category of this version
Definition: CommonDef.h:433
bool isOlderThan(const Version &other) const
Definition: CommonDef.h:445
int minor
the minor category of this version
Definition: CommonDef.h:436
bool isSameAs(const Version &other) const
Definition: CommonDef.h:439