Rhino C++ API  7.26
Public Member Functions | Public Attributes | List of all members
ON_MorphControl Class Reference

#include <opennurbs_nurbssurface.h>

Inheritance diagram for ON_MorphControl:
ON_Geometry ON_Object

Public Member Functions

 ON_MorphControl ()
virtual ~ON_MorphControl ()
bool AddBoxLocalizer (ON_BoundingBox bbox, double support_distance, double falloff_distance)
bool AddControlLocalizer (double support_distance, double falloff_distance)
bool AddConvexPolygonLocalizer (const ON_SimpleArray< ON_Plane > &planes, double support_distance, double falloff_distance)
bool AddCylinderLocalizer (ON_Line axis, double support_distance, double falloff_distance)
bool AddPlaneLocalizer (const ON_Plane &plane, double support_distance, double falloff_distance)
bool AddSphereLocalizer (ON_3dPoint center, double support_distance, double falloff_distance)
ON_BrepBrepForm (ON_Brep *brep=nullptr) const override
void ClearBoundingBox () override
const double * CV (ON_3dex) const
int CVCount () const
int CVCount (int dir) const
void Destroy ()
 C++ default copy construction and operator= work fine. More...
void DestroyRuntimeCache (bool bDelete=true) override
int Dimension () const override
void Dump (ON_TextLog &) const override
bool GetBBox (double *boxmin, double *boxmax, bool bGrowBox=false) const override
 virtual ON_Geometry GetBBox override
bool GetCageMorph (class ON_CageMorph &cage_morph) const
 Get a cage_morph that can be passed to Morph functions. More...
bool GetTightBoundingBox (class ON_BoundingBox &tight_bbox, bool bGrowBox=false, const class ON_Xform *xform=nullptr) const override
 virtual ON_Geometry GetTightBoundingBox override
bool HasBrepForm () const override
bool IsIdentity (const ON_BoundingBox &bbox) const
bool IsMorphable () const override
bool IsRational () const
bool IsValid (class ON_TextLog *text_log=nullptr) const override
const double * Knot (int dir) const
bool MakeNonRational ()
bool MakeRational ()
ON_3dex MaxCVIndex () const
void MemoryRelocate () override
bool Morph (const ON_SpaceMorph &morph) override
ON_3dPoint MorphPoint (ON_3dPoint point) const
void MorphPointLocalizerHelper (const ON_3dPoint &point, double &w, double &clspt_max_dist, const ON_Localizer *&distloc) const
void MorphPointVarient1Helper (double t, double w, const ON_Localizer *distloc, ON_3dPoint &Q, ON_3dVector *N) const
void MorphPointVarient2Helper (double s, double t, double w, const ON_Localizer *distloc, ON_3dPoint &Q, ON_3dVector *N) const
ON::object_type ObjectType () const override
int Order (int dir) const
bool Read (ON_BinaryArchive &archive) override
unsigned int SizeOf () const override
bool Transform (const ON_Xform &xform) override
double Weight (ON_3dex) const
bool Write (ON_BinaryArchive &archive) const override
- Public Member Functions inherited from ON_Geometry
 ON_Geometry ()=default
 ON_Geometry (const ON_Geometry &)=default
 ~ON_Geometry ()=default
ON_BoundingBox BoundingBox () const
virtual ON_COMPONENT_INDEX ComponentIndex () const
virtual bool EvaluatePoint (const class ON_ObjRef &objref, ON_3dPoint &P) const
bool GetBoundingBox (ON_3dPoint &bbox_min, ON_3dPoint &bbox_max, bool bGrowBox=false) const
bool GetBoundingBox (ON_BoundingBox &bbox, bool bGrowBox=false) const
virtual bool IsDeformable () const
virtual bool MakeDeformable ()
virtual bool Morph (const class ON_SpaceMorph &morph)
ON_Geometryoperator= (const ON_Geometry &)=default
bool Rotate (double rotation_angle, const ON_3dVector &rotation_axis, const ON_3dPoint &rotation_center)
bool Rotate (double sin_angle, double cos_angle, const ON_3dVector &rotation_axis, const ON_3dPoint &rotation_center)
bool Scale (double scale_factor)
virtual bool SwapCoordinates (int i, int j)
bool Translate (const ON_3dVector &translation_vector)
- Public Member Functions inherited from ON_Object
 ON_Object (const ON_Object &)
virtual ~ON_Object ()
virtual ON_AggregateComponentStatus AggregateComponentStatus () const
bool AttachUserData (class ON_UserData *pUserData)
unsigned int ClearAllComponentStates () const
virtual unsigned int ClearComponentStates (ON_COMPONENT_INDEX component_index, ON_ComponentStatus states_to_clear) const
virtual unsigned int ClearComponentStates (ON_ComponentStatus states_to_clear) const
void CopyUserData (const ON_Object &source_object)
unsigned int CopyUserData (const ON_Object &source_object, ON_UUID source_userdata_item_id, ON_Object::UserDataConflictResolution userdata_conflict_resolution)
virtual ON__UINT32 DataCRC (ON__UINT32 current_remainder) const
virtual bool DeleteComponents (const ON_COMPONENT_INDEX *ci_list, size_t ci_count)
bool DetachUserData (class ON_UserData *pUserData)
void EmergencyDestroy ()
class ON_UserDataFirstUserData () const
virtual unsigned int GetComponentsWithSetStates (ON_ComponentStatus states_filter, bool bAllEqualStates, ON_SimpleArray< ON_COMPONENT_INDEX > &components) const
class ON_UserDataGetUserData (const ON_UUID &userdata_uuid) const
bool GetUserString (const wchar_t *key, ON_wString &string_value) const
int GetUserStringKeys (ON_ClassArray< ON_wString > &user_string_keys) const
int GetUserStrings (ON_ClassArray< ON_UserString > &user_strings) const
bool IsCorrupt (bool bRepair, bool bSilentError, class ON_TextLog *text_log) const
bool IsKindOf (const ON_ClassId *pClassId) const
virtual void MarkAggregateComponentStatusAsNotCurrent () const
virtual ON_UUID ModelObjectId () const
void MoveUserData (ON_Object &source_object)
unsigned int MoveUserData (ON_Object &source_object, ON_UUID source_userdata_item_id, ON_Object::UserDataConflictResolution userdata_conflict_resolution, bool bDeleteAllSourceItems)
ON_Objectoperator= (const ON_Object &)
void PurgeUserData ()
virtual unsigned int SetComponentStates (ON_COMPONENT_INDEX component_index, ON_ComponentStatus states_to_set) const
virtual unsigned int SetComponentStatus (ON_COMPONENT_INDEX component_index, ON_ComponentStatus status_to_copy) const
bool SetUserString (const wchar_t *key, const wchar_t *string_value)
int SetUserStrings (int count, const ON_UserString *user_strings, bool bReplace)
bool ThisIsNullptr (bool bSilentError) const
void TransformUserData (const class ON_Xform &xform)
virtual bool UpdateReferencedComponents (const class ON_ComponentManifest &source_manifest, const class ON_ComponentManifest &destination_manifest, const class ON_ManifestMap &manifest_map)
int UserStringCount () const

Public Attributes

ON_UuidList m_captive_id
 Rhino captive object ids. More...
ON_ClassArray< ON_Localizerm_localizers
 Use ON_GetCageXform to set m_cage_xform. More...
ON_NurbsCage m_nurbs_cage
ON_Xform m_nurbs_cage0 = ON_Xform::IdentityTransformation
ON_NurbsCurve m_nurbs_curve
ON_NurbsCurve m_nurbs_curve0
ON_Interval m_nurbs_curve_domain
ON_NurbsSurface m_nurbs_surface
ON_NurbsSurface m_nurbs_surface0
ON_Interval m_nurbs_surface_domain [2]
bool m_sporh_bPreserveStructure
bool m_sporh_bQuickPreview
double m_sporh_tolerance
 ON_SpaceMorphOptions. More...
int m_varient
 1= curve, 2 = surface, 3 = cage More...

Additional Inherited Members

- Public Types inherited from ON_Object
enum  UserDataConflictResolution : unsigned char {
  UserDataConflictResolution::destination_object = 0, UserDataConflictResolution::source_object = 1, UserDataConflictResolution::source_copycount_gt = 2, UserDataConflictResolution::source_copycount_ge = 3,
  UserDataConflictResolution::destination_copycount_gt = 4, UserDataConflictResolution::destination_copycount_ge = 5, UserDataConflictResolution::delete_item = 6
- Static Public Attributes inherited from ON_Geometry
const static ON_Geometry Unset

Constructor & Destructor Documentation

◆ ON_MorphControl()

ON_MorphControl::ON_MorphControl ( )

◆ ~ON_MorphControl()

virtual ON_MorphControl::~ON_MorphControl ( )

Member Function Documentation

◆ AddBoxLocalizer()

bool ON_MorphControl::AddBoxLocalizer ( ON_BoundingBox  bbox,
double  support_distance,
double  falloff_distance 

◆ AddControlLocalizer()

bool ON_MorphControl::AddControlLocalizer ( double  support_distance,
double  falloff_distance 

Localizers Description: Adds localizer with support near the controling NURBS object. Parameters: support_distance - [in] >= 0 If the distance a point to the controls NURBS curve/surface/cage is less than or equal to support_distance, then MorphPoint() deformation has 100% effect.

falloff_distance - [in] > 0 If the distance a point to the controls NURBS curve/surface/cage is more than support_distance+falloff_distance, then MorphPoint() deformation does not move the point. As the distance varies from support_distance to support_distance+falloff_distance the deformation attenuates from 100% to 0%.

◆ AddConvexPolygonLocalizer()

bool ON_MorphControl::AddConvexPolygonLocalizer ( const ON_SimpleArray< ON_Plane > &  planes,
double  support_distance,
double  falloff_distance 

◆ AddCylinderLocalizer()

bool ON_MorphControl::AddCylinderLocalizer ( ON_Line  axis,
double  support_distance,
double  falloff_distance 

◆ AddPlaneLocalizer()

bool ON_MorphControl::AddPlaneLocalizer ( const ON_Plane plane,
double  support_distance,
double  falloff_distance 

◆ AddSphereLocalizer()

bool ON_MorphControl::AddSphereLocalizer ( ON_3dPoint  center,
double  support_distance,
double  falloff_distance 

◆ BrepForm()

ON_Brep* ON_MorphControl::BrepForm ( ON_Brep brep = nullptr) const

Description: If possible, BrepForm() creates a brep form of the ON_Geometry. Parameters: brep - [in] if not nullptr, brep is used to store the brep form of the geometry. Result: Returns a pointer to on ON_Brep or nullptr. If the brep parameter is not nullptr, then brep is returned if the geometry has a brep form and nullptr is returned if the geometry does not have a brep form. Remarks: The caller is responsible for managing the brep memory. See Also ON_Geometry::HasBrepForm

Reimplemented from ON_Geometry.

◆ ClearBoundingBox()

void ON_MorphControl::ClearBoundingBox ( )

Description: Some objects cache bounding box information. If you modify an object, then call ClearBoundingBox() to inform the object that any cached bounding boxes are invalid.

Remarks: Generally, ClearBoundingBox() overrides simply invalidate a cached bounding box and then wait for a call to GetBBox() before recomputing the bounding box.

The default implementation does nothing.

Reimplemented from ON_Geometry.

◆ CV()

const double* ON_MorphControl::CV ( ON_3dex  ) const

◆ CVCount() [1/2]

int ON_MorphControl::CVCount ( ) const

Returns: Number of control points in the target NURBS object.

◆ CVCount() [2/2]

int ON_MorphControl::CVCount ( int  dir) const

◆ Destroy()

void ON_MorphControl::Destroy ( )

C++ default copy construction and operator= work fine.

◆ DestroyRuntimeCache()

void ON_MorphControl::DestroyRuntimeCache ( bool  bDelete = true)

Expert interface Description: Expert user function. If you are using openNURBS in its default configuration to read and write 3dm archives, you never need to call this function. Many objects employ lazy creation of (runtime) caches that save information to help speed geometric calculations. This function will destroy all runtime information. Parameters: bDelete - [in] if true, any cached information is properly deleted. If false, any cached information is simply discarded. This is useful when the cached information may be in alternate memory pools that are managed in nonstandard ways.

Reimplemented from ON_Object.

◆ Dimension()

int ON_MorphControl::Dimension ( ) const

ON_Geometry virtual functions

Reimplemented from ON_Geometry.

◆ Dump()

void ON_MorphControl::Dump ( ON_TextLog ) const

Description: Creates a text dump of the object. Remarks: Dump() is intended for debugging and is not suitable for creating high quality text descriptions of an object.

The default implementations of this virtual function prints the class's name.

Reimplemented from ON_Object.

◆ GetBBox()

bool ON_MorphControl::GetBBox ( double *  boxmin,
double *  boxmax,
bool  bGrowBox = false 
) const

virtual ON_Geometry GetBBox override

Reimplemented from ON_Geometry.

◆ GetCageMorph()

bool ON_MorphControl::GetCageMorph ( class ON_CageMorph cage_morph) const

Get a cage_morph that can be passed to Morph functions.

◆ GetTightBoundingBox()

bool ON_MorphControl::GetTightBoundingBox ( class ON_BoundingBox tight_bbox,
bool  bGrowBox = false,
const class ON_Xform xform = nullptr 
) const

virtual ON_Geometry GetTightBoundingBox override

Reimplemented from ON_Geometry.

◆ HasBrepForm()

bool ON_MorphControl::HasBrepForm ( ) const

Description: Query an object to see if it has an ON_Brep form. Result: Returns true if the virtual ON_Geometry::BrepForm can compute an ON_Brep representation of this object. Remarks: The default implementation of ON_Geometry::BrepForm returns false. See Also ON_Geometry::BrepForm

Reimplemented from ON_Geometry.

◆ IsIdentity()

bool ON_MorphControl::IsIdentity ( const ON_BoundingBox bbox) const

◆ IsMorphable()

bool ON_MorphControl::IsMorphable ( ) const

Returns: True if the object can be morphed by calling Morph(). See Also: ON_Geometry::Morph

Reimplemented from ON_Geometry.

◆ IsRational()

bool ON_MorphControl::IsRational ( ) const

Returns: True if the target NURBS object is rational

◆ IsValid()

bool ON_MorphControl::IsValid ( class ON_TextLog text_log = nullptr) const

Description: Tests an object to see if its data members are correctly initialized. Parameters: text_log - [in] if the object is not valid and text_log is not nullptr, then a brief englis description of the reason the object is not valid is appened to the log. The information appended to text_log is suitable for low-level debugging purposes by programmers and is not intended to be useful as a high level user interface tool. Returns: @untitled table true object is valid false object is invalid, uninitialized, etc.

Reimplemented from ON_Geometry.

◆ Knot()

const double* ON_MorphControl::Knot ( int  dir) const

◆ MakeNonRational()

bool ON_MorphControl::MakeNonRational ( )

Description: Makes the target NURBS object non-rational.

◆ MakeRational()

bool ON_MorphControl::MakeRational ( )

Description: Makes the target NURBS object rational.

◆ MaxCVIndex()

ON_3dex ON_MorphControl::MaxCVIndex ( ) const

◆ MemoryRelocate()

void ON_MorphControl::MemoryRelocate ( )

ON_Object virtual functions

Reimplemented from ON_Object.

◆ Morph()

bool ON_MorphControl::Morph ( const ON_SpaceMorph morph)

◆ MorphPoint()

ON_3dPoint ON_MorphControl::MorphPoint ( ON_3dPoint  point) const

Description: Evaluates the deformation. Used by ON_CageMorph::MorphPoint().

◆ MorphPointLocalizerHelper()

void ON_MorphControl::MorphPointLocalizerHelper ( const ON_3dPoint point,
double &  w,
double &  clspt_max_dist,
const ON_Localizer *&  distloc 
) const

Description: Get localizer settings needed in MorphPoint().

◆ MorphPointVarient1Helper()

void ON_MorphControl::MorphPointVarient1Helper ( double  t,
double  w,
const ON_Localizer distloc,
ON_3dPoint Q,
ON_3dVector N 
) const

◆ MorphPointVarient2Helper()

void ON_MorphControl::MorphPointVarient2Helper ( double  s,
double  t,
double  w,
const ON_Localizer distloc,
ON_3dPoint Q,
ON_3dVector N 
) const

◆ ObjectType()

ON::object_type ON_MorphControl::ObjectType ( ) const

Description: Useful for switch statements that need to differentiate between basic object types like points, curves, surfaces, and so on.

Returns: ON::object_type enum value.

Remarks: The default implementation of this virtual function returns ON::unknown_object_type

Reimplemented from ON_Object.

◆ Order()

int ON_MorphControl::Order ( int  dir) const

◆ Read()

bool ON_MorphControl::Read ( ON_BinaryArchive binary_archive)

Description: Low level archive writing tool used by ON_BinaryArchive::ReadObject(). Parameters: binary_archive - archive to read from Returns: Returns true if the read is successful. Remarks: Use ON_BinaryArchive::ReadObject() to read objects. This Read() function should read the objects definition back into its data members.

The default implementation of this virtual function returns false and does nothing.

Reimplemented from ON_Object.

◆ SizeOf()

unsigned int ON_MorphControl::SizeOf ( ) const

Returns: An estimate of the amount of memory the class uses in bytes.

Reimplemented from ON_Object.

◆ Transform()

bool ON_MorphControl::Transform ( const ON_Xform xform)

Description: Transforms the object.

Parameters: xform - [in] transformation to apply to object. If xform.IsSimilarity() is zero, then you may want to call MakeSquishy() before calling Transform.

Remarks: When overriding this function, be sure to include a call to ON_Object::TransformUserData() which takes care of transforming any ON_UserData that may be attached to the object.

See Also: ON_Geometry::IsDeformable();

Remarks: Classes derived from ON_Geometry should call ON_Geometry::Transform() to handle user data transformations and then transform their definition.

Reimplemented from ON_Geometry.

◆ Weight()

double ON_MorphControl::Weight ( ON_3dex  ) const

◆ Write()

bool ON_MorphControl::Write ( ON_BinaryArchive binary_archive) const

Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.

The default implementation of this virtual function returns false and does nothing.

Reimplemented from ON_Object.

Member Data Documentation

◆ m_captive_id

ON_UuidList ON_MorphControl::m_captive_id

Rhino captive object ids.

◆ m_localizers

ON_ClassArray<ON_Localizer> ON_MorphControl::m_localizers

Use ON_GetCageXform to set m_cage_xform.

Used to localize the deformation

◆ m_nurbs_cage

ON_NurbsCage ON_MorphControl::m_nurbs_cage

◆ m_nurbs_cage0

ON_Xform ON_MorphControl::m_nurbs_cage0 = ON_Xform::IdentityTransformation

◆ m_nurbs_curve

ON_NurbsCurve ON_MorphControl::m_nurbs_curve

◆ m_nurbs_curve0

ON_NurbsCurve ON_MorphControl::m_nurbs_curve0

The value of m_varient determines which nurbs object controls the cage

◆ m_nurbs_curve_domain

ON_Interval ON_MorphControl::m_nurbs_curve_domain

◆ m_nurbs_surface

ON_NurbsSurface ON_MorphControl::m_nurbs_surface

◆ m_nurbs_surface0

ON_NurbsSurface ON_MorphControl::m_nurbs_surface0

◆ m_nurbs_surface_domain

ON_Interval ON_MorphControl::m_nurbs_surface_domain[2]

◆ m_sporh_bPreserveStructure

bool ON_MorphControl::m_sporh_bPreserveStructure

◆ m_sporh_bQuickPreview

bool ON_MorphControl::m_sporh_bQuickPreview

◆ m_sporh_tolerance

double ON_MorphControl::m_sporh_tolerance


◆ m_varient

int ON_MorphControl::m_varient

1= curve, 2 = surface, 3 = cage