Clarisse 5.0 SP8 SDK  5.0.5.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | List of all members
GeometrySample Class Reference

This class defines a geometric sample on a geometry. More...

Inheritance diagram for GeometrySample:
CoreBaseType

Public Member Functions

void clear ()
 Set all positions, normals and derivatives to zero.
 
void init_surface (const GMathVec3d &position, const GMathVec3d &dpdu, const GMathVec3d &dpdv, const GMathVec3d &d2pduu, const GMathVec3d &d2pduv, const GMathVec3d &d2pdvv)
 Init the sample with a position and derivatives.
 
void init_surface (const GMathVec3d &position, const GMathVec3d &dpdu, const GMathVec3d &dpdv, const GMathVec3d &dndu=GMathVec3d(0.0), const GMathVec3d &dndv=GMathVec3d(0.0))
 Init the sample with geometric positions and derivatives.
 
void init_surface_point (const GMathVec3d &position, const GMathVec3d &dpdu, const GMathVec3d &dpdv, const GMathVec3d &normal, const GMathVec3d &dndu, const GMathVec3d &dndv)
 Init the sample with geometric positions and derivatives.
 
void set_smoothing (const GMathVec3d &position, const GMathVec3d &normal, const GMathVec3d &dndu=GMathVec3d(0.0), const GMathVec3d &dndv=GMathVec3d(0.0))
 Set the sample with smoothed positions and derivatives.
 
void set_smoothing (const GMathVec3d &position, const GMathVec3d &normal, const GMathVec3d &d2pduu, const GMathVec3d &d2pduv, const GMathVec3d &d2pdvv)
 Set the sample with smoothed positions and derivatives.
 
void init_point (const GMathVec3d &geometric_position)
 Init the sample with only a position.
 
void init_point (const GMathVec3d &geometric_position, const GMathVec3d &geometric_normal, const bool &normalized=false)
 Init the sample with a position and a normal.
 
void init_point (const GMathVec3d &geometric_position, const GMathVec3d &geometric_normal, const GMathVec3d &smoothed_position, const GMathVec3d &smoothed_normal, const bool &normalized=false)
 Init the sample with geometric and smoothed positions and normals.
 
void set_sub_differentials (const GMathVec3d &dpdu, const GMathVec3d &dpdv)
 Set the partial derivatives of the position at the sub primitive level.
 
void set_position (const GMathVec3d &v)
 Set the geometric and smoothed positions at the same time.
 
void set_geometric_position (const GMathVec3d &v)
 Set the geometric position.
 
void set_smoothed_position (const GMathVec3d &v)
 Set the smoothed position.
 
void set_geometric_position_dt (const GMathVec3d &v)
 Set the geometric position at (t + dt)
 
void set_shading_normal (const GMathVec3d &v)
 Set a shading normal which can be different from the geometric and smoothed normals.
 
void normalize ()
 Normalize the normals.
 
void transform (const GMathMatrix4x4d &xform, const GMathMatrix4x4d *xform_dt=0)
 Transform the current sample by a matrix.
 
void transform (const GeometrySample &sample, const GMathMatrix4x4d &xform, const GMathMatrix4x4d *xform_dt=0)
 Transform a sample by a matrix.
 
void init_surface (const GMathVec3f &position, const GMathVec3f &dpdu, const GMathVec3f &dpdv, const GMathVec3f &d2puu, const GMathVec3f &d2puv, const GMathVec3f &d2pvv)
 
 
void init_surface (const GMathVec3f &position, const GMathVec3f &dpdu, const GMathVec3f &dpdv, const GMathVec3f &dndu=GMathVec3f(0.0), const GMathVec3f &dndv=GMathVec3f(0.0))
 Init the sample with geometric positions and derivatives.
 
void set_smoothing (const GMathVec3f &position, const GMathVec3f &normal, const GMathVec3f &dndu=GMathVec3f(0.0), const GMathVec3f &dndv=GMathVec3f(0.0))
 
 
void set_smoothing (const GMathVec3f &position, const GMathVec3f &normal, const GMathVec3f &d2pduu, const GMathVec3f &d2pduv, const GMathVec3f &d2pdvv)
 
 
void init_point (const GMathVec3f &geometric_position)
 Init the sample with only a position.
 
void init_point (const GMathVec3f &geometric_position, const GMathVec3f &geometric_normal, const bool &normalized=false)
 Init the sample with a position and a normal.
 
void init_point (const GMathVec3f &geometric_position, const GMathVec3f &geometric_normal, const GMathVec3f &smoothed_position, const GMathVec3f &smoothed_normal, const bool &normalized=false)
 Init the sample with geometric and smoothed positions and normals.
 
void set_sub_differentials (const GMathVec3f &dpdu, const GMathVec3f &dpdv)
 Set the partial derivatives of the position at the sub primitive level.
 
void set_position (const GMathVec3f &v)
 Set the geometric and smoothed positions at the same time.
 
void set_geometric_position (const GMathVec3f &v)
 Set the geometric position.
 
void set_smoothed_position (const GMathVec3f &v)
 Set the smoothed position.
 
void set_geometric_position_dt (const GMathVec3f &v)
 Set the geometric position at (t + dt)
 
void set_shading_normal (const GMathVec3f &v)
 Set a shading normal which can be different from the geometric and smoothed normals.
 
const GMathVec3d & get_geometric_position () const
 Get the geometric position.
 
const GMathVec3d & get_geometric_position_dt () const
 Get the geometric position at (t + dt)
 
const GMathVec3d & get_geometric_dpdu () const
 Get the geometric position partial derivative for U parameter of the primitive.
 
const GMathVec3d & get_geometric_dpdv () const
 Get the geometric position partial derivative for V parameter of the primitive.
 
const GMathVec3d & get_geometric_dndu () const
 Get the geometric normal partial derivative for V parameter of the primitive.
 
const GMathVec3d & get_geometric_dndv () const
 Get the geometric normal partial derivative for V parameter of the primitive.
 
const GMathVec3d & get_geometric_sub_dpdu () const
 Get the geometric position partial derivative for U parameter of the sub primitive.
 
const GMathVec3d & get_geometric_sub_dpdv () const
 Get the geometric position partial derivative for V parameter of the sub primitive.
 
const GMathVec3d & get_geometric_normal () const
 Get the geometric normal.
 
const GMathVec3d & get_smoothed_position () const
 Get the smoothed position.
 
const GMathVec3d & get_smoothed_dpdu () const
 Get the smoothed position partial derivative for U parameter of the primitive.
 
const GMathVec3d & get_smoothed_dpdv () const
 Get the smoothed position partial derivative for V parameter of the primitive.
 
const GMathVec3d & get_smoothed_dndu () const
 Get the smoothed position partial derivative for U parameter of the primitive.
 
const GMathVec3d & get_smoothed_dndv () const
 Get the smoothed position partial derivative for V parameter of the primitive.
 
const GMathVec3d & get_smoothed_normal () const
 Get the smoothed normal.
 
const GMathVec3d & get_shading_normal () const
 Get the smoothed normal.
 
bool has_differentials () const
 Tell if the sample is defining derivatives.
 
bool has_sub_differentials () const
 Tell if the sample is defining sub derivatives.
 
bool has_motion () const
 Tell if the sample has a motion (different position at t + dt)
 
bool has_normal () const
 Tell if the sample is defining a normal.
 
bool is_normalized () const
 Tell if the normals are normalized.
 
void compute_position_differentials (const GMathVec3d &normal, GMathVec3d &dpdu, GMathVec3d &dpdv) const
 Compute dpdu/dpdv from a given normal.
 
- Public Member Functions inherited from CoreBaseType
bool is_kindof (const CoreClassInfo &cinfo) const
 

Additional Inherited Members

- Static Public Member Functions inherited from CoreBaseType
static const CoreClassInfoclass_info ()
 Get the type descriptor of this instance.
 

Detailed Description

This class defines a geometric sample on a geometry.

The surface of a geometry can have two representations, a geometric one (which is often flat) and a smoothed one. The sample contains positions, normals, derivatives for both of these representations.

Member Function Documentation

void GeometrySample::init_point ( const GMathVec3d &  geometric_position)

Init the sample with only a position.

The sample is considered as a single point with no surface. It has no derivative.

Parameters
[in]geometric_positionthe geometric position of the point
void GeometrySample::init_point ( const GMathVec3d &  geometric_position,
const GMathVec3d &  geometric_normal,
const bool &  normalized = false 
)

Init the sample with a position and a normal.

The sample is considered as a single point with no surface. It has no derivative.

Parameters
[in]geometric_positionthe geometric position of the point
[in]geometric_normalthe geometric normal of the point
[in]normalizedindicate if the normal is already normalized
void GeometrySample::init_point ( const GMathVec3d &  geometric_position,
const GMathVec3d &  geometric_normal,
const GMathVec3d &  smoothed_position,
const GMathVec3d &  smoothed_normal,
const bool &  normalized = false 
)

Init the sample with geometric and smoothed positions and normals.

The sample is considered as a single point with no surface. It has no derivative.

Parameters
[in]geometric_positionthe geometric position of the point
[in]geometric_normalthe geometric normal of the point
[in]smoothed_positionthe smoothed position of the point
[in]smoothed_normalthe smoothed normal of the point
[in]normalizedindicate if the normals are already normalized
void GeometrySample::init_point ( const GMathVec3f &  geometric_position)
inline

Init the sample with only a position.

The sample is considered as a single point with no surface. It has no derivative.

Parameters
[in]geometric_positionthe geometric position of the point

void GeometrySample::init_point ( const GMathVec3f &  geometric_position,
const GMathVec3f &  geometric_normal,
const bool &  normalized = false 
)
inline

Init the sample with a position and a normal.

The sample is considered as a single point with no surface. It has no derivative.

Parameters
[in]geometric_positionthe geometric position of the point
[in]geometric_normalthe geometric normal of the point
[in]normalizedindicate if the normal is already normalized

void GeometrySample::init_point ( const GMathVec3f &  geometric_position,
const GMathVec3f &  geometric_normal,
const GMathVec3f &  smoothed_position,
const GMathVec3f &  smoothed_normal,
const bool &  normalized = false 
)
inline

Init the sample with geometric and smoothed positions and normals.

The sample is considered as a single point with no surface. It has no derivative.

Parameters
[in]geometric_positionthe geometric position of the point
[in]geometric_normalthe geometric normal of the point
[in]smoothed_positionthe smoothed position of the point
[in]smoothed_normalthe smoothed normal of the point
[in]normalizedindicate if the normals are already normalized

void GeometrySample::init_surface ( const GMathVec3d &  position,
const GMathVec3d &  dpdu,
const GMathVec3d &  dpdv,
const GMathVec3d &  d2pduu,
const GMathVec3d &  d2pduv,
const GMathVec3d &  d2pdvv 
)

Init the sample with a position and derivatives.

The sample is considered as lying on a surface which has the same geometric and smoothed representations. The normal of the surface is computed from the derivatives.The normal derivatives are compute from the second derivative of u and v using the Weingarten equations

Parameters
[in]positionthe position on the surface
[in]dpduthe partial derivative of the position for the U paramater of the primitive
[in]dpdvthe partial derivative of the position for the V paramater of the primitive
[in]d2pduuthe second partial derivative of the position for the U then U paramater of the primitive
[in]d2pduvthe second partial derivative of the position for the U then V paramater of the primitive
[in]d2pdvvthe second partial derivative of the position for the V then V paramater of the primitive
void GeometrySample::init_surface ( const GMathVec3d &  position,
const GMathVec3d &  dpdu,
const GMathVec3d &  dpdv,
const GMathVec3d &  dndu = GMathVec3d(0.0),
const GMathVec3d &  dndv = GMathVec3d(0.0) 
)

Init the sample with geometric positions and derivatives.

The sample is considered as lying on a surface which has different geometric and smoothed representations. The geometric normal of the surface is computed from the geometric derivatives. The smoothed derivatives are computed from the smoothed normal and geometric derivatives.

Parameters
[in]positionthe geometric position on the surface
[in]dpduthe geometric partial derivative of the position for the U paramater of the primitive
[in]dpdvthe geometric partial derivative of the position for the V paramater of the primitive
[in]dnduthe geometric partial derivative of the normal for the U paramater of the primitive
[in]dndvthe geometric partial derivative of the normal for the V paramater of the primitive
void GeometrySample::init_surface ( const GMathVec3f &  position,
const GMathVec3f &  dpdu,
const GMathVec3f &  dpdv,
const GMathVec3f &  d2puu,
const GMathVec3f &  d2puv,
const GMathVec3f &  d2pvv 
)
inline

void GeometrySample::init_surface ( const GMathVec3f &  position,
const GMathVec3f &  dpdu,
const GMathVec3f &  dpdv,
const GMathVec3f &  dndu = GMathVec3f(0.0),
const GMathVec3f &  dndv = GMathVec3f(0.0) 
)
inline

Init the sample with geometric positions and derivatives.

The sample is considered as lying on a surface which has different geometric and smoothed representations. The geometric normal of the surface is computed from the geometric derivatives. The smoothed derivatives are computed from the smoothed normal and geometric derivatives.

Parameters
[in]positionthe geometric position on the surface
[in]dpduthe geometric partial derivative of the position for the U paramater of the primitive
[in]dpdvthe geometric partial derivative of the position for the V paramater of the primitive
[in]dnduthe geometric partial derivative of the normal for the U paramater of the primitive
[in]dndvthe geometric partial derivative of the normal for the V paramater of the primitive

void GeometrySample::init_surface_point ( const GMathVec3d &  position,
const GMathVec3d &  dpdu,
const GMathVec3d &  dpdv,
const GMathVec3d &  normal,
const GMathVec3d &  dndu,
const GMathVec3d &  dndv 
)

Init the sample with geometric positions and derivatives.

The sample is considered as lying on a surface which has different geometric and smoothed representations. The geometric normal of the surface is computed from the geometric derivatives. The smoothed derivatives are computed from the smoothed normal and geometric derivatives.

Parameters
[in]positionthe geometric position on the surface
[in]dpduthe geometric partial derivative of the position for the U paramater of the primitive
[in]dpdvthe geometric partial derivative of the position for the V paramater of the primitive
[in]normalthe geometric normal on the surface
[in]dnduthe geometric partial derivative of the normal for the U paramater of the primitive
[in]dndvthe geometric partial derivative of the normal for the V paramater of the primitive
void GeometrySample::set_geometric_position ( const GMathVec3d &  v)

Set the geometric position.

Parameters
[in]vthe geometric position
void GeometrySample::set_geometric_position ( const GMathVec3f &  v)
inline

Set the geometric position.

Parameters
[in]vthe geometric position

void GeometrySample::set_geometric_position_dt ( const GMathVec3d &  v)

Set the geometric position at (t + dt)

Parameters
[in]vthe geometric position
void GeometrySample::set_geometric_position_dt ( const GMathVec3f &  v)
inline

Set the geometric position at (t + dt)

Parameters
[in]vthe geometric position

void GeometrySample::set_position ( const GMathVec3d &  v)

Set the geometric and smoothed positions at the same time.

Parameters
[in]vthe position
void GeometrySample::set_position ( const GMathVec3f &  v)
inline

Set the geometric and smoothed positions at the same time.

Parameters
[in]vthe position

void GeometrySample::set_shading_normal ( const GMathVec3d &  v)

Set a shading normal which can be different from the geometric and smoothed normals.

Parameters
[in]vthe shading normal
void GeometrySample::set_shading_normal ( const GMathVec3f &  v)
inline

Set a shading normal which can be different from the geometric and smoothed normals.

Parameters
[in]vthe shading normal

void GeometrySample::set_smoothed_position ( const GMathVec3d &  v)

Set the smoothed position.

Parameters
[in]vthe smoothed position
void GeometrySample::set_smoothed_position ( const GMathVec3f &  v)
inline

Set the smoothed position.

Parameters
[in]vthe smoothed position

void GeometrySample::set_smoothing ( const GMathVec3d &  position,
const GMathVec3d &  normal,
const GMathVec3d &  dndu = GMathVec3d(0.0),
const GMathVec3d &  dndv = GMathVec3d(0.0) 
)

Set the sample with smoothed positions and derivatives.

The sample is considered as lying on a surface which has different geometric and smoothed representations. The geometric normal of the surface is computed from the geometric derivatives. The smoothed derivatives are computed from the smoothed normal and geometric derivatives.

Parameters
[in]positionthe smoothed position on the surface
[in]dpduthe smoothed partial derivative of the position for the U paramater of the primitive
[in]dpdvthe smoothed partial derivative of the position for the V paramater of the primitive
[in]dnduthe smoothed partial derivative of the normal for the U paramater of the primitive
[in]dndvthe smoothed partial derivative of the normal for the V paramater of the primitive
void GeometrySample::set_smoothing ( const GMathVec3d &  position,
const GMathVec3d &  normal,
const GMathVec3d &  d2pduu,
const GMathVec3d &  d2pduv,
const GMathVec3d &  d2pdvv 
)

Set the sample with smoothed positions and derivatives.

The sample is considered as lying on a surface which has different geometric and smoothed representations. The geometric normal of the surface is computed from the geometric derivatives. The smoothed derivatives are computed from the smoothed normal and geometric derivatives.

Parameters
[in]positionthe smoothed position on the surface
[in]dpduthe smoothed partial derivative of the position for the U paramater of the primitive
[in]dpdvthe smoothed partial derivative of the position for the V paramater of the primitive
[in]d2pduuused to compute the smoothed partial derivative of the normal
[in]d2pduvused to compute the smoothed partial derivative of the normal
[in]d2pdvvused to compute the smoothed partial derivative of the normal
void GeometrySample::set_smoothing ( const GMathVec3f &  position,
const GMathVec3f &  normal,
const GMathVec3f &  dndu = GMathVec3f(0.0),
const GMathVec3f &  dndv = GMathVec3f(0.0) 
)
inline

void GeometrySample::set_smoothing ( const GMathVec3f &  position,
const GMathVec3f &  normal,
const GMathVec3f &  d2pduu,
const GMathVec3f &  d2pduv,
const GMathVec3f &  d2pdvv 
)
inline

void GeometrySample::set_sub_differentials ( const GMathVec3d &  dpdu,
const GMathVec3d &  dpdv 
)

Set the partial derivatives of the position at the sub primitive level.

Parameters
[in]dpduthe geometric partial derivative of the position for the U paramater of the sub primitive
[in]dpdvthe geometric partial derivative of the position for the V paramater of the sub primitive
void GeometrySample::set_sub_differentials ( const GMathVec3f &  dpdu,
const GMathVec3f &  dpdv 
)
inline

Set the partial derivatives of the position at the sub primitive level.

Parameters
[in]dpduthe geometric partial derivative of the position for the U paramater of the sub primitive
[in]dpdvthe geometric partial derivative of the position for the V paramater of the sub primitive

void GeometrySample::transform ( const GMathMatrix4x4d &  xform,
const GMathMatrix4x4d *  xform_dt = 0 
)

Transform the current sample by a matrix.

Parameters
[in]xformthe transformation matrix
[in]xform_dtthe transformation matrix at (t + dt)
void GeometrySample::transform ( const GeometrySample sample,
const GMathMatrix4x4d &  xform,
const GMathMatrix4x4d *  xform_dt = 0 
)

Transform a sample by a matrix.

Parameters
[in]samplethe sample to transform
[in]xformthe transformation matrix
[in]xform_dtthe transformation matrix at (t + dt)