MorphoGraphX  2.0-1-227
Namespaces | Macros | Typedefs | Functions | Variables
Geometry.hpp File Reference
#include <Config.hpp>
#include <Util.hpp>
#include <Vector.hpp>
#include <Matrix.hpp>
#include <SymmetricTensor.hpp>
#include <BoundingBox.hpp>
#include <cmath>
#include <cuda/CudaGlobal.hpp>
#include <float.h>
#include <math.h>

Go to the source code of this file.

Namespaces

 mgx
 Distributed matrix library.
 

Macros

#define Point3(T)
 

Typedefs

typedef unsigned char mgx::ubyte
 This filee contains different useful geometry algorithms, like intersections, areas, ... More...
 
typedef unsigned char mgx::uchar
 
typedef unsigned int mgx::uint
 
typedef unsigned short mgx::ushort
 Simpler names for the various containers and iterators. More...
 
typedef unsigned long mgx::ulong
 
typedef SymmetricTensor mgx::SymmetricTensor
 
typedef Vector< 5, float > mgx::Point5f
 
typedef Vector< 6, float > mgx::Point6f
 
typedef Vector< 12, float > mgx::Point12f
 
typedef Vector< 1, double > mgx::Point1d
 
typedef Vector< 2, double > mgx::Point2d
 
typedef Vector< 3, double > mgx::Point3d
 
typedef Vector< 4, double > mgx::Point4d
 
typedef Vector< 5, double > mgx::Point5d
 
typedef Vector< 6, double > mgx::Point6d
 
typedef Vector< 8, double > mgx::Point8d
 
typedef Vector< 9, double > mgx::Point9d
 
typedef Vector< 12, double > mgx::Point12d
 
typedef Vector< 16, double > mgx::Point16d
 
typedef Vector< 18, double > mgx::Point18d
 
typedef Vector< 3, int > mgx::Point3i
 
typedef Vector< 4, int > mgx::Point4i
 
typedef Vector< 5, int > mgx::Point5i
 
typedef Vector< 6, int > mgx::Point6i
 
typedef Vector< 1, uintmgx::Point1u
 
typedef Vector< 2, uintmgx::Point2u
 
typedef Vector< 3, uintmgx::Point3u
 
typedef Vector< 4, uintmgx::Point4u
 
typedef Vector< 5, uintmgx::Point5u
 
typedef Vector< 6, uintmgx::Point6u
 
typedef Vector< 12, uintmgx::Point12u
 
typedef Vector< 30, uintmgx::Point30u
 
typedef Vector< 3, ushortmgx::Point3us
 
typedef Vector< 3, ulong > mgx::Point3ul
 
typedef Vector< 2, size_t > mgx::Point2s
 
typedef Vector< 3, size_t > mgx::Point3s
 
typedef Vector< 4, size_t > mgx::Point4s
 
typedef Vector< 5, size_t > mgx::Point5s
 
typedef Vector< 6, size_t > mgx::Point6s
 
typedef Vector< 3, uchar > mgx::Point3uc
 
typedef Matrix< 2, 2, float > mgx::Matrix2f
 
typedef Matrix< 3, 3, float > mgx::Matrix3f
 
typedef Matrix< 4, 4, float > mgx::Matrix4f
 
typedef Matrix< 2, 2, uintmgx::Matrix2u
 
typedef Matrix< 3, 3, uintmgx::Matrix3u
 
typedef Matrix< 4, 4, uintmgx::Matrix4u
 
typedef Matrix< 4, 3, uintmgx::Matrix4x3u
 
typedef Matrix< 6, 3, uintmgx::Matrix6x3u
 
typedef Matrix< 1, 1, double > mgx::Matrix1d
 
typedef Matrix< 2, 2, double > mgx::Matrix2d
 
typedef Matrix< 2, 3, double > mgx::Matrix2x3d
 
typedef Matrix< 2, 6, double > mgx::Matrix2x6d
 
typedef Matrix< 3, 2, double > mgx::Matrix3x2d
 
typedef Matrix< 3, 3, double > mgx::Matrix3d
 
typedef Matrix< 3, 4, double > mgx::Matrix3x4d
 
typedef Matrix< 3, 6, double > mgx::Matrix3x6d
 
typedef Matrix< 3, 12, double > mgx::Matrix3x12d
 
typedef Matrix< 3, 18, double > mgx::Matrix3x18d
 
typedef Matrix< 4, 2, double > mgx::Matrix4x2d
 
typedef Matrix< 4, 3, double > mgx::Matrix4x3d
 
typedef Matrix< 4, 4, double > mgx::Matrix4d
 
typedef Matrix< 4, 6, double > mgx::Matrix4x6d
 
typedef Matrix< 5, 3, double > mgx::Matrix5x3d
 
typedef Matrix< 6, 6, double > mgx::Matrix6d
 
typedef Matrix< 6, 3, double > mgx::Matrix6x3d
 
typedef Matrix< 6, 12, double > mgx::Matrix6x12d
 
typedef Matrix< 6, 18, double > mgx::Matrix6x18d
 
typedef Matrix< 9, 3, double > mgx::Matrix9x3d
 
typedef Matrix< 9, 9, double > mgx::Matrix9d
 
typedef Matrix< 9, 18, double > mgx::Matrix9x18d
 
typedef Matrix< 12, 3, double > mgx::Matrix12x3d
 
typedef Matrix< 12, 12, double > mgx::Matrix12d
 
typedef Matrix< 18, 18, double > mgx::Matrix18d
 
typedef BoundingBox< 3, uintmgx::BoundingBox3u
 
typedef BoundingBox< 3, int > mgx::BoundingBox3i
 
typedef BoundingBox< 3, float > mgx::BoundingBox3f
 

Functions

CU_HOST_DEVICE bool mgx::isNan (float s)
 
CU_HOST_DEVICE bool mgx::isNan (double s)
 
template<typename T >
CU_HOST_DEVICE Point3u mgx::toVoxelsCeil (const Point3(T) &p, const Point3(T) &step)
 
template<typename T >
CU_HOST_DEVICE Vector< 3, T > mgx::multMatrix4Point3 (const Matrix< 4, 4, T > &m, const Vector< 3, T > &p)
 Multiply openGL 4D matrix by 3D point and return 3D point. More...
 
template<typename T >
T CU_HOST_DEVICE mgx::interpolate (const T &a, const T &b, const T &s)
 Interpolate between values. More...
 
template<typename T >
T CU_HOST_DEVICE mgx::interpolate (const Point3(T) &t1, const Point3(T) &t2, const Point3(T) &t3, T c1, T c2, T c3, const Point3(T) &p)
 Interpolate values on a triangle. More...
 
template<typename T >
CU_HOST_DEVICE bool mgx::planeLineIntersect (const Point3(T) &p, const Point3(T) &nrml, const Point3(T) &u1, const Point3(T) &u2, T &s, Point3(T) &u)
 Plane-Line Intersection. More...
 
template<typename T >
CU_HOST_DEVICE mgx::Point3 (T) triangleGradient(const Point3(T) &p1
 
 mgx::if (area2==0) return Point3(T)()
 
 mgx::return (nrml ^(c3 *(p2 - p1)+c1 *(p3 - p2)+c2 *(p1 - p3)))/area2
 
template<typename T >
CU_HOST_DEVICE bool mgx::lineLineIntersect (Point3(T) p1, Point3(T) p2, Point3(T) q1, Point3(T) q2, T &s, T &u, Point3(T) &intersect)
 Line-Line Intersection returns whether two line segments intersect or not saves the location on where on the segments (s, u) and the intersection point (intersect) originally from CellMaker, only used in Join2DMeshes so far, not tested for true 3d lines. More...
 
template<typename T >
CU_HOST_DEVICEmgx::triangleArea (const Point3(T) &a, const Point3(T) &b, const Point3(T) &c)
 
template<typename T >
CU_HOST_DEVICEmgx::signedTetraVolume (const Point3(T) &a, const Point3(T) &b, const Point3(T) &c)
 
template<typename T >
CU_HOST_DEVICE void mgx::getBasisFromPlane (const Point3(T) &nrml, Point3(T)&x, Point3(T) &y, Point3(T) &z)
 
template<typename T >
CU_HOST_DEVICE int mgx::rayTriangleIntersect (const Point3(T) &r0, const Point3(T) &r1, const Point3(T) &t0, const Point3(T) &t1, const Point3(T) &t2, Point3(T) &intp)
 
template<typename T >
CU_HOST_DEVICEmgx::distLinePoint (const Point3(T) &v1, const Point3(T) &_v2, const Point3(T) &_p, bool segment)
 
CU_HOST_DEVICE Point3f mgx::imageToWorld (const Point3i &img, const Point3f &step, const Point3f &shift)
 
CU_HOST_DEVICE Point3i mgx::worldToImage (const Point3f &wrld, const Point3f &step, const Point3f &shift)
 
CU_HOST_DEVICE size_t mgx::offset (uint x, uint y, uint z, uint xsz, uint ysz)
 
CU_HOST_DEVICE size_t mgx::getOffset (const int x, const int y, const int z, const Point3i &size)
 
CU_HOST_DEVICE size_t mgx::getOffset (const uint x, const uint y, const uint z, const Point3u &size)
 
CU_HOST_DEVICE size_t mgx::getOffset (const Point3i p, const Point3i &size)
 
Point3d mgx::projectPointOnPlane (const Point3d &P, const Point3d &Q, const Point3d &N)
 

Variables

CU_HOST_DEVICE const const T mgx::c1
 
CU_HOST_DEVICE const const T T mgx::c2
 
CU_HOST_DEVICE const const T T T mgx::c3
 
mgx::area2
 
 mgx::nrml
 

Detailed Description

Common definitions and utilities for all geometry algorithms This file is shared by cuda, do not include headers that nvcc can't handle (i.e. Qt)

Definition in file Geometry.hpp.

Macro Definition Documentation

◆ Point3

#define Point3 (   T)

Definition at line 145 of file Geometry.hpp.