cesium-native  0.41.0
CesiumGeometry Namespace Reference

Basic geometry classes for Cesium. More...

Classes

struct  ConstantAvailability
 
struct  SubtreeBufferView
 
struct  AvailabilitySubtree
 
struct  AvailabilityNode
 Availability nodes wrap subtree objects and link them together to form a downwardly traversable availability tree. More...
 
struct  AvailabilityTree
 
class  AvailabilityAccessor
 
struct  AxisAlignedBox
 
class  BoundingSphere
 A bounding sphere with a center and a radius. More...
 
struct  InterpolatedVertex
 A structure describing a vertex that results from interpolating two other vertices. More...
 
class  IntersectionTests
 Functions for computing the intersection between geometries such as rays, planes, triangles, and ellipsoids. More...
 
class  OctreeAvailability
 
struct  OctreeTileID
 A structure serving as a unique identifier for a node in an octree. More...
 
class  OctreeTilingScheme
 Defines how an AxisAlignedBox is divided into octree tiles. More...
 
class  OrientedBoundingBox
 A bounding volume defined as a closed and convex cuboid with any orientation. More...
 
class  Plane
 A plane in Hessian Normal Format. More...
 
class  QuadtreeAvailability
 
class  QuadtreeRectangleAvailability
 Manages information about the availability of tiles in a quadtree. More...
 
struct  QuadtreeTileID
 Uniquely identifies a node in a quadtree. More...
 
struct  UpsampledQuadtreeNode
 A node of a tile hierarchy that was created by upsampling the tile content of a parent node. More...
 
struct  QuadtreeTileRectangularRange
 A rectangular range of tiles at a particular level of a quadtree. More...
 
class  QuadtreeTilingScheme
 Defines how a rectangular region is divided into quadtree tiles. More...
 
class  Ray
 A ray that extends infinitely from the provided origin in the provided direction. More...
 
struct  Rectangle
 A 2D rectangle. More...
 
struct  Transforms
 Coordinate system matrix constructions helpers. More...
 

Typedefs

typedef std::variant< ConstantAvailability, SubtreeBufferViewAvailabilityView
 
using TriangleClipVertex = std::variant< int, InterpolatedVertex >
 A vertex resulting from clipping a triangle against a threshold. More...
 

Enumerations

enum class  Axis { X , Y , Z }
 An enum describing the x, y, and z axes. More...
 
enum class  CullingResult { Outside = -1 , Intersecting = 0 , Inside = 1 }
 The result of culling an object. More...
 
enum  TileAvailabilityFlags {
  TILE_AVAILABLE = 1U , CONTENT_AVAILABLE = 2U , SUBTREE_AVAILABLE = 4U , SUBTREE_LOADED = 8U ,
  REACHABLE = 16U
}
 

Functions

void clipTriangleAtAxisAlignedThreshold (double threshold, bool keepAbove, int i0, int i1, int i2, double u0, double u1, double u2, std::vector< TriangleClipVertex > &result) noexcept
 Splits a 2D triangle at given axis-aligned threshold value and returns the resulting polygon on a given side of the threshold. More...
 

Detailed Description

Basic geometry classes for Cesium.

Typedef Documentation

◆ TriangleClipVertex

using CesiumGeometry::TriangleClipVertex = typedef std::variant<int, InterpolatedVertex>

A vertex resulting from clipping a triangle against a threshold.

It may either be a simple index referring to an existing vertex, or an interpolation between two vertices.

Definition at line 51 of file clipTriangleAtAxisAlignedThreshold.h.

Enumeration Type Documentation

◆ Axis

enum CesiumGeometry::Axis
strong

An enum describing the x, y, and z axes.

Enumerator

The x-axis.

The y-axis.

The z-axis.

Definition at line 10 of file Axis.h.

◆ CullingResult

The result of culling an object.

Enumerator
Outside 

Indicates that an object lies completely outside the culling volume.

Intersecting 

Indicates that an object intersects with the boundary of the culling volume.

This means that the object is partially inside and partially outside the culling volume.

Inside 

Indicates that an object lies completely inside the culling volume.

Definition at line 10 of file CullingResult.h.

◆ TileAvailabilityFlags

Enumerator
TILE_AVAILABLE 

The tile is known to be available.

CONTENT_AVAILABLE 

The tile's content is known to be available.

SUBTREE_AVAILABLE 

This tile has a subtree that is known to be available.

SUBTREE_LOADED 

This tile has a subtree that is loaded.

REACHABLE 

The tile is reachable through the tileset availability tree.

If a tile is not reachable, the above flags being false may simply indicate that a subtree needed to reach this tile has not yet been loaded.

Definition at line 9 of file TileAvailabilityFlags.h.

Function Documentation

◆ clipTriangleAtAxisAlignedThreshold()

void CesiumGeometry::clipTriangleAtAxisAlignedThreshold ( double  threshold,
bool  keepAbove,
int  i0,
int  i1,
int  i2,
double  u0,
double  u1,
double  u2,
std::vector< TriangleClipVertex > &  result 
)
noexcept

Splits a 2D triangle at given axis-aligned threshold value and returns the resulting polygon on a given side of the threshold.

The resulting polygon may have 0, 1, 2, 3, or 4 vertices.

Parameters
thresholdThe threshold coordinate value at which to clip the triangle.
keepAbovetrue to keep the portion of the triangle above the threshold, or false to keep the portion below.
i0The index of the first vertex in the triangle in counter-clockwise order, used only to construct the TriangleClipVertex result.
i1The index of the second vertex in the triangle in counter-clockwise order, used only to construct the TriangleClipVertex result.
i2The index of the third vertex in the triangle in counter-clockwise order, used only to construct the TriangleClipVertex result.
u0The coordinate of the first vertex in the triangle, in counter-clockwise order.
u1The coordinate of the second vertex in the triangle, in counter-clockwise order.
u2The coordinate of the third vertex in the triangle, in counter-clockwise order.
resultOn return, contains the polygon that results after the clip, specified as a list of vertices. If this vector already contains elements, the result is pushed onto the end of the vector.
TODO port this CesiumJS example to cesium-native
var result = Cesium.Intersections2D.clipTriangleAtAxisAlignedThreshold(0.5,
false, 0.2, 0.6, 0.4);
// result === [2, 0, -1, 1, 0, 0.25, -1, 1, 2, 0.5]