Rhino C++ API  8.13
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
ON_SurfaceValues Class Reference

ON_SurfaceValues stores surface evaluation values (point, normal, curvatures, derivatives) in a single class More...

#include <opennurbs_point.h>

Public Types

enum  : unsigned { MaximumDerivativeOrder = 15 }
 

Public Member Functions

 ON_SurfaceValues ()=default
 
 ON_SurfaceValues (const ON_SurfaceValues &src)
 
 ~ON_SurfaceValues ()
 
void Clear ()
 Unsets all surface evaluation values. More...
 
void ClearDerivative (unsigned i, unsigned j)
 
void ClearDerivatives ()
 
void ClearNormal ()
 
void ClearPoint ()
 
void ClearPrincipalCurvatures ()
 
const ON_3dVector Derivative (unsigned i, unsigned j) const
 If (u,v) are the surface parameters, then Derivative(0,0) = point, Derivative(1,0) = 1st partial with respect to u (D/Du). Derivative(0,1) = 1st partial with respect to v (D/Dv). Derivative(2,0) = 2nd partial with respect to u (D/Du^2). Derivative(1,1) = 2nd mixed partial (D/DuDv). Derivative(0,2) = 2nd partial with respect to v (D/Dv^2). Derivative(i,j) = (i+j)-th order partial D/Du^iDv^j. More...
 
bool DerivativeIsSet (unsigned i, unsigned j) const
 
unsigned DerivativeOrderCapacity () const
 The order of the partial derivative returned by Derivative(i, j) is i + j. The memory to store partial derivatives can be allocated by calling ReserveDerivativeOrderCapacity(max_order). More...
 
bool DerivativesAreSet (unsigned order) const
 
bool GetDerivativeArrayForExperts (unsigned &derivative_order_capacity, size_t &stride, double *&derivative_values)
 Used by experts when calling legacy bispan evaluation code that takes (num_der, stride, ders) parameters. Pretend this does not exist. More...
 
const ON_3dVector Normal () const
 
bool NormalIsSet () const
 
ON_SurfaceValues operator= (const ON_SurfaceValues &src)
 
const ON_3dPoint Point () const
 
bool PointIsSet () const
 
const ON_SurfaceCurvature PrincipalCurvatures () const
 
bool PrincipalCurvaturesSet () const
 
bool ReserveDerivativeOrderCapacity (unsigned order_capacity)
 
void SetDerivative (unsigned i, unsigned j, ON_3dVector D)
 
void SetDerivativeArrayForExperts (unsigned max_derivative_order, size_t stride, const double *derivative_values)
 Used by experts when calling legacy bispan evaluation code that takes (num_der, stride, ders) parameters. Pretend this does not exist.
More...
 
void SetNormal (ON_3dVector N)
 
void SetPoint (ON_3dPoint P)
 
void SetPrincipalCurvatures (double kappa1, double kappa2)
 
void SetPrincipalCurvatures (ON_SurfaceCurvature kappa)
 

Static Public Member Functions

static bool CreateFromLocalArrayForExperts (unsigned maximum_derivative_order, size_t value_array_stride, double *value_array, ON_SurfaceValues &values)
 NOTE WELL: CreateFromLocalArray is for experts dealing with unusual situations. Create a ON_SurfaceValues where the storage for derivative values is managed externally. This is typically used by experts to easily get surface evaluation results stored in value_array[] when the evaluation function returns the results in a ON_SurfaceValues class. The caller is responsible for ensuring that the value_array[] memory is not freed or deleted while the returned ON_SurfaceValues class is in scope. Any copy of the returned values will not reference value_array[]. More...
 
static bool CreateFromVectorArrayForExperts (unsigned order_capacity, ON_SimpleArray< ON_3dVector > &value_array, ON_SurfaceValues &values)
 NOTE WELL: CreateFromVectorArray is for experts dealing with unusual situations. Create a ON_SurfaceValues where the storage for the values is derivative values is managed externally. This is typically used by experts to easily get surface evaluation results stored in value_array[] when the evaluation function returns the results in a ON_SurfaceValues class. The caller is responsible for ensuring that the value_array[] memory is not freed or deleted while the returned ON_SurfaceValues class is in scope. Any copy of the returned values will not reference value_array[]. More...
 

Static Public Attributes

static const ON_SurfaceValues Nan
 

Detailed Description

ON_SurfaceValues stores surface evaluation values (point, normal, curvatures, derivatives) in a single class

Member Enumeration Documentation

◆ anonymous enum

anonymous enum : unsigned
Enumerator
MaximumDerivativeOrder 

The maximum order of a partial derivative that an ON_SurfaceValues class can possibly store is 15.

Constructor & Destructor Documentation

◆ ON_SurfaceValues() [1/2]

ON_SurfaceValues::ON_SurfaceValues ( )
default

◆ ~ON_SurfaceValues()

ON_SurfaceValues::~ON_SurfaceValues ( )

◆ ON_SurfaceValues() [2/2]

ON_SurfaceValues::ON_SurfaceValues ( const ON_SurfaceValues src)

Member Function Documentation

◆ Clear()

void ON_SurfaceValues::Clear ( )

Unsets all surface evaluation values.

◆ ClearDerivative()

void ON_SurfaceValues::ClearDerivative ( unsigned  i,
unsigned  j 
)

◆ ClearDerivatives()

void ON_SurfaceValues::ClearDerivatives ( )

◆ ClearNormal()

void ON_SurfaceValues::ClearNormal ( )

◆ ClearPoint()

void ON_SurfaceValues::ClearPoint ( )

◆ ClearPrincipalCurvatures()

void ON_SurfaceValues::ClearPrincipalCurvatures ( )

◆ CreateFromLocalArrayForExperts()

static bool ON_SurfaceValues::CreateFromLocalArrayForExperts ( unsigned  maximum_derivative_order,
size_t  value_array_stride,
double *  value_array,
ON_SurfaceValues values 
)
static

NOTE WELL: CreateFromLocalArray is for experts dealing with unusual situations. Create a ON_SurfaceValues where the storage for derivative values is managed externally. This is typically used by experts to easily get surface evaluation results stored in value_array[] when the evaluation function returns the results in a ON_SurfaceValues class. The caller is responsible for ensuring that the value_array[] memory is not freed or deleted while the returned ON_SurfaceValues class is in scope. Any copy of the returned values will not reference value_array[].

Parameters
derivative_order0 <= derivative_order <= ON_SurfaceValues::MaximumDerivativeOrder derivative_order = maximum order of a partial derivative that can be stored in value_array[]. 1 for point and 1st partial derivatives (value_array[] has at least 3*value_array_stride doubles). 2 for point, 1st and 2nd partial derivatives (value_array[] has at least 6*value_array_stride doubles). And so on.
value_array_stridevalue_array_stride >= 3.
value_arrayAn array with a capacity of at least value_array_stride * ((order_capacity + 1) * (order_capacity + 2) / 2) doubles.
valuesAfter the call, values will use value_array to store point and derivative evaluations.
Returns
True if successful.

◆ CreateFromVectorArrayForExperts()

static bool ON_SurfaceValues::CreateFromVectorArrayForExperts ( unsigned  order_capacity,
ON_SimpleArray< ON_3dVector > &  value_array,
ON_SurfaceValues values 
)
static

NOTE WELL: CreateFromVectorArray is for experts dealing with unusual situations. Create a ON_SurfaceValues where the storage for the values is derivative values is managed externally. This is typically used by experts to easily get surface evaluation results stored in value_array[] when the evaluation function returns the results in a ON_SurfaceValues class. The caller is responsible for ensuring that the value_array[] memory is not freed or deleted while the returned ON_SurfaceValues class is in scope. Any copy of the returned values will not reference value_array[].

Parameters
order_capacity0 <= derivative_order <= ON_SurfaceValues::MaximumDerivativeOrder derivative_order = maximum order of a partial derivative that can be stored in value_array[]. 1 for point and 1st partial derivatives (value_array[] has at least 3*value_array_stride doubles). 2 for point, 1st and 2nd partial derivatives (value_array[] has at least 6*value_array_stride doubles). And so on.
value_arrayThe capacity and count of value_array[] will be set to ((order_capacity + 1) * (order_capacity + 2) / 2).
valuesAfter the call, values will use value_array to store point and derivative evaluations. Note that if values is copied, all derivative information will be lost. This class is for experts dealing with unusual situations.
Returns
True if successful.

◆ Derivative()

const ON_3dVector ON_SurfaceValues::Derivative ( unsigned  i,
unsigned  j 
) const

If (u,v) are the surface parameters, then Derivative(0,0) = point, Derivative(1,0) = 1st partial with respect to u (D/Du). Derivative(0,1) = 1st partial with respect to v (D/Dv). Derivative(2,0) = 2nd partial with respect to u (D/Du^2). Derivative(1,1) = 2nd mixed partial (D/DuDv). Derivative(0,2) = 2nd partial with respect to v (D/Dv^2). Derivative(i,j) = (i+j)-th order partial D/Du^iDv^j.

Parameters
iNumber of partial derivatives in the 1st surface parameter.
jNumber of partial derivatives in the 2nd surface parameter.
Returns
Specified partial derivative.

◆ DerivativeIsSet()

bool ON_SurfaceValues::DerivativeIsSet ( unsigned  i,
unsigned  j 
) const

◆ DerivativeOrderCapacity()

unsigned ON_SurfaceValues::DerivativeOrderCapacity ( ) const

The order of the partial derivative returned by Derivative(i, j) is i + j. The memory to store partial derivatives can be allocated by calling ReserveDerivativeOrderCapacity(max_order).

Returns
Returns the maximum order of a partial derivative that can be stored.

◆ DerivativesAreSet()

bool ON_SurfaceValues::DerivativesAreSet ( unsigned  order) const

◆ GetDerivativeArrayForExperts()

bool ON_SurfaceValues::GetDerivativeArrayForExperts ( unsigned &  derivative_order_capacity,
size_t &  stride,
double *&  derivative_values 
)

Used by experts when calling legacy bispan evaluation code that takes (num_der, stride, ders) parameters. Pretend this does not exist.

Parameters
derivative_order_capacityThe returned value is the maximum order of a partial derivative that can be stored in derivative_values.
strideReturns the number of doubles between successive partial derivatives.
derivative_valuesReturns a pointer to an array of stride*(derivative_order_capacity + 1)*(derivative_order_capacity + 2)/2 doubles.
Returns
True if the returned information can be passed to a legacy bispan evaluator.

◆ Normal()

const ON_3dVector ON_SurfaceValues::Normal ( ) const

◆ NormalIsSet()

bool ON_SurfaceValues::NormalIsSet ( ) const

◆ operator=()

ON_SurfaceValues ON_SurfaceValues::operator= ( const ON_SurfaceValues src)

◆ Point()

const ON_3dPoint ON_SurfaceValues::Point ( ) const

◆ PointIsSet()

bool ON_SurfaceValues::PointIsSet ( ) const

◆ PrincipalCurvatures()

const ON_SurfaceCurvature ON_SurfaceValues::PrincipalCurvatures ( ) const

◆ PrincipalCurvaturesSet()

bool ON_SurfaceValues::PrincipalCurvaturesSet ( ) const

◆ ReserveDerivativeOrderCapacity()

bool ON_SurfaceValues::ReserveDerivativeOrderCapacity ( unsigned  order_capacity)

Parameters
order_capacity0 <= derivative_order <= ON_SurfaceValues::MaximumDerivativeOrder derivative_order = maximum order of a partial derivative that can be stored in value_array[]. 1 for point and 1st partial derivatives (value_array[] has at least 3*value_array_stride doubles). 2 for point, 1st and 2nd partial derivatives (value_array[] has at least 6*value_array_stride doubles). And so on.
Returns
True if the capacity to store derivatives was reserved.

◆ SetDerivative()

void ON_SurfaceValues::SetDerivative ( unsigned  i,
unsigned  j,
ON_3dVector  D 
)

void SetPrincipalVectorCurvatures( ON_3dVector K1, ON_3dVector K2 ); void ClearPrincipalVectorCurvatures(); bool PrincipalVectorCurvaturesAreSet() const; const ON_3dVector PrincipalVectorCurvature(unsigned i) const;

◆ SetDerivativeArrayForExperts()

void ON_SurfaceValues::SetDerivativeArrayForExperts ( unsigned  max_derivative_order,
size_t  stride,
const double *  derivative_values 
)

Used by experts when calling legacy bispan evaluation code that takes (num_der, stride, ders) parameters. Pretend this does not exist.

Parameters
max_derivative_order
stride
derivative_values

◆ SetNormal()

void ON_SurfaceValues::SetNormal ( ON_3dVector  N)

◆ SetPoint()

void ON_SurfaceValues::SetPoint ( ON_3dPoint  P)

◆ SetPrincipalCurvatures() [1/2]

void ON_SurfaceValues::SetPrincipalCurvatures ( double  kappa1,
double  kappa2 
)

◆ SetPrincipalCurvatures() [2/2]

void ON_SurfaceValues::SetPrincipalCurvatures ( ON_SurfaceCurvature  kappa)

Member Data Documentation

◆ Nan

const ON_SurfaceValues ON_SurfaceValues::Nan
static