Rhino C++ API  7.22
Public Member Functions | List of all members
ON_SpaceMorph Class Referenceabstract

#include <opennurbs_xform.h>

Inheritance diagram for ON_SpaceMorph:
CRhinoSpaceMorph ON_BezierCageMorph ON_CageMorph CRhinoBendSpaceMorph CRhinoFlowSpaceMorph CRhinoMaelstromSpaceMorph CRhinoSplopSpaceMorph CRhinoSporphSpaceMorph CRhinoStretchSpaceMorph CRhinoTaperSpaceMorph CRhinoTwistSpaceMorph

Public Member Functions

 ON_SpaceMorph ()
 
virtual ~ON_SpaceMorph ()
 
virtual bool Ev1Der (ON_3dPoint rst, ON_3dPoint &xyz, ON_3dVector &Dr, ON_3dVector &Ds, ON_3dVector &Dt) const
 
bool IsIdentity (const class ON_Curve &Crv, double tol) const
 
bool IsIdentity (const class ON_Surface &Srf, double tol) const
 
virtual bool IsIdentity (const ON_BoundingBox &bbox) const
 
bool IsIdentity (const ON_SimpleArray< ON_3dPoint > &Points, double tol) const
 
virtual ON_4dPoint Morph4dPoint (ON_4dPoint point) const
 
virtual ON_3dPoint MorphPoint (ON_3dPoint point) const =0
 
void MorphPointList (int dim, bool is_rat, int count, int stride, double *point) const
 
void MorphPointList (int dim, bool is_rat, int count, int stride, float *point) const
 
virtual ON_3dVector MorphVector (ON_3dPoint tail_point, ON_3dVector vector) const
 
bool PreserveStructure () const
 
bool QuickPreview () const
 
void SetPreserveStructure (bool bPreserveStructure)
 
void SetQuickPreview (bool bQuickPreview)
 
void SetTolerance (double tolerance)
 
double Tolerance () const
 

Constructor & Destructor Documentation

◆ ON_SpaceMorph()

ON_SpaceMorph::ON_SpaceMorph ( )

◆ ~ON_SpaceMorph()

virtual ON_SpaceMorph::~ON_SpaceMorph ( )
virtual

Member Function Documentation

◆ Ev1Der()

virtual bool ON_SpaceMorph::Ev1Der ( ON_3dPoint  rst,
ON_3dPoint xyz,
ON_3dVector Dr,
ON_3dVector Ds,
ON_3dVector Dt 
) const
virtual

Description: Get the first derivative of the morph function. Parameters: rst - [in] evalation parameters Dr - out Ds - out Dt - out Returns: True if successful.

◆ IsIdentity() [1/4]

bool ON_SpaceMorph::IsIdentity ( const class ON_Curve Crv,
double  tol 
) const

Description: A slower way to determine if a morph function is the identity (doesn't move the points) on a curve, to within a tolerance. Parameters: Crv - [in] Curve to be tested. tol - [in] Distance tolerance. Returns: Uses MorphPoint() on a dense sample of points. True if none of the points move a distance of tol or more under the morph function. Remark: Call IsIdentity(Crv.BoundingBox()) first. Use this on curves whose nurb form is rational or has a different parameterization.

◆ IsIdentity() [2/4]

bool ON_SpaceMorph::IsIdentity ( const class ON_Surface Srf,
double  tol 
) const

Description: A slower way to determine if a morph function is the identity (doesn't move the points) on a surface, to within a tolerance Parameters: Srf - [in] Surface to be tested. tol - [in] Distance tolerance. Returns: Uses MorphPoint() on a dense sample of points. True if none of the points move a distance of tol or more under the morph function. Remark: Call IsIdentity(Srf.BoundingBox()) first. Use this on surfaces whose nurb form is rational or has a different parameterization.

◆ IsIdentity() [3/4]

virtual bool ON_SpaceMorph::IsIdentity ( const ON_BoundingBox bbox) const
virtual

Description: Provides a quick way to determine if a morph function is the identity (doesn't move the points) on a region of space. Parameters: bbox - [in] region of space to test. Returns: The default always returns false. If you override this function, then return true when every point in the bounding box is fixed by the morph.

Reimplemented in ON_CageMorph, CRhinoStretchSpaceMorph, CRhinoMaelstromSpaceMorph, CRhinoBendSpaceMorph, CRhinoTaperSpaceMorph, and CRhinoTwistSpaceMorph.

◆ IsIdentity() [4/4]

bool ON_SpaceMorph::IsIdentity ( const ON_SimpleArray< ON_3dPoint > &  Points,
double  tol 
) const

Description: A slower way to determine if a morph function is the identity (doesn't move the points) on a set of points, to within a tolerance Parameters: Points - [in] Set of points to test. tol - [in] Distance tolerance. Returns: True if none of the points move a distance of tol or more under the morph function. Uses MorphPoint()

◆ Morph4dPoint()

virtual ON_4dPoint ON_SpaceMorph::Morph4dPoint ( ON_4dPoint  point) const
virtual

Description: Morphs rational point. Parameters: point - [in] Returns: Morphed point. Remarks: Default morphs euclidean location and preserves weight.

◆ MorphPoint()

virtual ON_3dPoint ON_SpaceMorph::MorphPoint ( ON_3dPoint  point) const
pure virtual

Description: Morphs euclidean point. Parameters: point - [in] Returns: Morphed point.
Remarks: If you are morphing simple objects like points and meshes, then you can simply morph the locations. If you are morphing more complicated objects like NURBS geometry, then your override should pay attention to the values of m_bQuickPreview, m_bPreserveStructure, and m_tolerance.

Implemented in CRhinoTwistSpaceMorph, CRhinoSplopSpaceMorph, CRhinoStretchSpaceMorph, CRhinoMaelstromSpaceMorph, CRhinoSporphSpaceMorph, CRhinoFlowSpaceMorph, CRhinoBendSpaceMorph, ON_BezierCageMorph, ON_CageMorph, and CRhinoTaperSpaceMorph.

◆ MorphPointList() [1/2]

void ON_SpaceMorph::MorphPointList ( int  dim,
bool  is_rat,
int  count,
int  stride,
double *  point 
) const

Description: Morphs point list Parameters: dim - [in] is_rat - [in] count - [in] stride - [in] point - [in/out]

◆ MorphPointList() [2/2]

void ON_SpaceMorph::MorphPointList ( int  dim,
bool  is_rat,
int  count,
int  stride,
float *  point 
) const

Description: Morphs point list Parameters: dim - [in] is_rat - [in] count - [in] stride - [in] point - [in/out]

◆ MorphVector()

virtual ON_3dVector ON_SpaceMorph::MorphVector ( ON_3dPoint  tail_point,
ON_3dVector  vector 
) const
virtual

Description: Morphs vector. Parameters: tail_point - [in] tail point vector - [in] Returns: Morphed vector. Remakrs: Default returns difference of morphed tail+vector and tail.

◆ PreserveStructure()

bool ON_SpaceMorph::PreserveStructure ( ) const

Returns: True if the morph should be done in a way that preserves the structure of the geometry.
In particular, for NURBS objects, true means that only the control points are moved. Remarks: The value returned by PreserveStructure() does not affect the way meshes and points are morphed. The default is false.

◆ QuickPreview()

bool ON_SpaceMorph::QuickPreview ( ) const

Returns: True if the morph should be done as quickly as possible because the result is being used for some type of dynamic preview. If QuickPreview is true, the tolerance may be ignored. Remarks: The value returned by QuickPreview() does not affect the way meshes and points are morphed. The default is false.

◆ SetPreserveStructure()

void ON_SpaceMorph::SetPreserveStructure ( bool  bPreserveStructure)

Description: Set the preserve structure value. Parameters: bPreserveStructure - [in]

◆ SetQuickPreview()

void ON_SpaceMorph::SetQuickPreview ( bool  bQuickPreview)

Description: Set the quick preview value. Parameters: bQuickPreview - [in]

◆ SetTolerance()

void ON_SpaceMorph::SetTolerance ( double  tolerance)

Description: Set the 3d fitting tolerance used when morphing surfaces and breps. Parameters: tolerance - [in] values < 0.0 are treated as 0.0.

◆ Tolerance()

double ON_SpaceMorph::Tolerance ( ) const

Description: Returns the desired accuracy of the morph. This value is primarily used for deforming surfaces and breps. Returns: 3d fitting tolerance. Remarks: The default is 0.0 and any value <= 0.0 is ignored by morphing functions. The value returned by Tolerance() does not affect the way meshes and points are morphed.