Rhino C++ API  8.5
Public Member Functions | Static Public Member Functions | List of all members
ON_Squisher Class Reference

#include <opennurbs_plus_squish.h>

Public Member Functions

 ON_Squisher ()
 
virtual ~ON_Squisher ()
 
void Dump (ON_TextLog &text_log) const
 
void DumpEnergyDebugText (ON_TextLog &text_log) const
 Dumps the text for debugging the energy optimizer. More...
 
int GetAreaConstrainedTrianglesIndices (ON_SimpleArray< ON_MeshFace > *faces) const
 
int GetLengthConstrained2dLines (ON_SimpleArray< ON_Line > *edges) const
 
int GetLengthConstrained3dLines (ON_SimpleArray< ON_Line > *edges) const
 
const ON_MeshGetMesh2d () const
 
int GetMesh2dEdges (ON_SimpleArray< ON_Line > *edges) const
 
const ON_MeshGetMesh3d () const
 
int GetMesh3dEdges (ON_SimpleArray< ON_Line > *edges) const
 
ON_Plane GetPlane () const
 Gets the plane that was used to flatten the surface, or ON_Plane::UnsetPlane if local estimates were used. More...
 
void SaveOriginalObjectIdAndComponentIndex (const ON_UUID obj_id, const ON_COMPONENT_INDEX obj_ci, ON_Geometry *squished_geometry)
 Saves the original object id and component index in TL_SquishMapBackInfo user data. More...
 
ON_PolylineCurveSquishCurve (const ON_Curve &curve3d) const
 
ON_MeshSquishMesh (const ON_SquishParameters &squishParams, const ON_Mesh &mesh3d)
 
ON_MeshSquishMesh (const ON_SquishParameters &squishParams, const ON_Mesh &mesh3d, const ON_SimpleArray< const ON_Geometry * > *marks, ON_SimpleArray< ON_Geometry * > *squished_marks)
 
bool SquishPoint (ON_3dPoint point3d, ON_MESH_POINT &point2d) const
 
ON_PointCloudSquishPointCloud (const ON_PointCloud &pc3) const
 
ON_BrepSquishSurface (const ON_SquishParameters &squishParams, const ON_Surface &surface3d)
 
ON_BrepSquishSurface (const ON_SquishParameters &squishParams, const ON_Surface &surface3d, const ON_SimpleArray< const ON_Geometry * > *marks, ON_SimpleArray< ON_Geometry * > *squished_marks)
 
ON_TextDotSquishTextDot (const ON_TextDot &textDot) const
 

Static Public Member Functions

static void DumpSquishInfoText (const ON_Geometry *squished_geometry, ON_TextLog &text_log, const wchar_t *objid_locale_str, const wchar_t *meshcount_locale_str)
 Dumps the text for the SquishInfo command. More...
 
static bool Is2dPatternSquished (const ON_Geometry *geometry)
 
static bool SquishBack2dMarks (const ON_Geometry *squished_geometry, const ON_SimpleArray< const ON_Geometry * > *marks, ON_SimpleArray< ON_Geometry * > *squished_marks)
 Squish back the marks. More...
 

Constructor & Destructor Documentation

◆ ON_Squisher()

ON_Squisher::ON_Squisher ( )

◆ ~ON_Squisher()

virtual ON_Squisher::~ON_Squisher ( )
virtual

Member Function Documentation

◆ Dump()

void ON_Squisher::Dump ( ON_TextLog text_log) const

◆ DumpEnergyDebugText()

void ON_Squisher::DumpEnergyDebugText ( ON_TextLog text_log) const

Dumps the text for debugging the energy optimizer.

◆ DumpSquishInfoText()

static void ON_Squisher::DumpSquishInfoText ( const ON_Geometry squished_geometry,
ON_TextLog text_log,
const wchar_t *  objid_locale_str,
const wchar_t *  meshcount_locale_str 
)
static

Dumps the text for the SquishInfo command.

◆ GetAreaConstrainedTrianglesIndices()

int ON_Squisher::GetAreaConstrainedTrianglesIndices ( ON_SimpleArray< ON_MeshFace > *  faces) const

Gets mesh vertex indices for the triangular faces that were constrained during the squish. Indices can be used in both the 2d and 3d mesh vertices arrays.

◆ GetLengthConstrained2dLines()

int ON_Squisher::GetLengthConstrained2dLines ( ON_SimpleArray< ON_Line > *  edges) const

Gets lines at the position of the mesh edges and diagonals that were constrained during the squish, in the 2d mesh. The line at any index here corresponds to the same line in GetLengthConstrained3dLines.

◆ GetLengthConstrained3dLines()

int ON_Squisher::GetLengthConstrained3dLines ( ON_SimpleArray< ON_Line > *  edges) const

Gets lines at the position of the mesh edges and diagonals that were constrained during the squish, in the 3d mesh. The line at any index here corresponds to the same line in GetLengthConstrained2dLines.

◆ GetMesh2d()

const ON_Mesh* ON_Squisher::GetMesh2d ( ) const

gets a const pointer to the 2d squished mesh, or NULL if it doesn't exist

◆ GetMesh2dEdges()

int ON_Squisher::GetMesh2dEdges ( ON_SimpleArray< ON_Line > *  edges) const
Deprecated:
This method has been renamed GetLengthContrained2dLines

◆ GetMesh3d()

const ON_Mesh* ON_Squisher::GetMesh3d ( ) const

gets a const pointer to the 3d mesh used for squishing, or NULL if it isn't stored

◆ GetMesh3dEdges()

int ON_Squisher::GetMesh3dEdges ( ON_SimpleArray< ON_Line > *  edges) const
Deprecated:
This method has been renamed GetLengthContrained3dLines

◆ GetPlane()

ON_Plane ON_Squisher::GetPlane ( ) const

Gets the plane that was used to flatten the surface, or ON_Plane::UnsetPlane if local estimates were used.

◆ Is2dPatternSquished()

static bool ON_Squisher::Is2dPatternSquished ( const ON_Geometry geometry)
static

◆ SaveOriginalObjectIdAndComponentIndex()

void ON_Squisher::SaveOriginalObjectIdAndComponentIndex ( const ON_UUID  obj_id,
const ON_COMPONENT_INDEX  obj_ci,
ON_Geometry squished_geometry 
)

Saves the original object id and component index in TL_SquishMapBackInfo user data.

◆ SquishBack2dMarks()

static bool ON_Squisher::SquishBack2dMarks ( const ON_Geometry squished_geometry,
const ON_SimpleArray< const ON_Geometry * > *  marks,
ON_SimpleArray< ON_Geometry * > *  squished_marks 
)
static

Squish back the marks.

◆ SquishCurve()

ON_PolylineCurve* ON_Squisher::SquishCurve ( const ON_Curve curve3d) const

Description: After you have flattened a mesh or surface, you can call this function to flatten a 3d curve that is near the 3d mesh or 3d surface. Parameters: curve3d - [in] 3d curve near the 3d mesh or 3d surface. curve2d - [in] if not NULL, the 2d result will be stored in this curve. If NULL, a polyline curve will be created.

◆ SquishMesh() [1/2]

ON_Mesh* ON_Squisher::SquishMesh ( const ON_SquishParameters squishParams,
const ON_Mesh mesh3d 
)

Description: Use to flatten a mesh. Remarks: The ON_Squisher class is NOT designed to support more than one squish operation.

◆ SquishMesh() [2/2]

ON_Mesh* ON_Squisher::SquishMesh ( const ON_SquishParameters squishParams,
const ON_Mesh mesh3d,
const ON_SimpleArray< const ON_Geometry * > *  marks,
ON_SimpleArray< ON_Geometry * > *  squished_marks 
)

Description: Use to flatten a mesh and marks. Remarks: It is the responsibility of the called to delete the geometry returned in the squished_marks array. The ON_Squisher class is NOT designed to support more than one squish operation.

◆ SquishPoint()

bool ON_Squisher::SquishPoint ( ON_3dPoint  point3d,
ON_MESH_POINT point2d 
) const

Description: After you have flattened a mesh or surface, you can call this function to flatten a 3d curve that is near the 3d mesh or 3d surface. Parameters: point3d - [in] 3d point near the 3d mesh or 3d surface. point2d - [out 2d point on the squished mesh.

◆ SquishPointCloud()

ON_PointCloud* ON_Squisher::SquishPointCloud ( const ON_PointCloud pc3) const

Description: After you have flattened a mesh or surface, you can call this function to flatten a PointCloud that is near the 3d mesh or 3d surface. Parameters: pc3 - [in] PointCloud near the 3d surface. squished_cloud - [in] if not NULL, the 2d result will be stored in this cloud. If NULL, a new cloud will be returned

◆ SquishSurface() [1/2]

ON_Brep* ON_Squisher::SquishSurface ( const ON_SquishParameters squishParams,
const ON_Surface surface3d 
)

Description: Use to flatten a surface. Remarks: The TL_SquishMesh class is NOT designed for to support more than one squish operation.

◆ SquishSurface() [2/2]

ON_Brep* ON_Squisher::SquishSurface ( const ON_SquishParameters squishParams,
const ON_Surface surface3d,
const ON_SimpleArray< const ON_Geometry * > *  marks,
ON_SimpleArray< ON_Geometry * > *  squished_marks 
)

Description: Use to flatten a surface and marks. Remarks: It is the responsibility of the called to delete the geometry returned in the squished_marks array. The TL_SquishMesh class is NOT designed for to support more than one squish operation.

◆ SquishTextDot()

ON_TextDot* ON_Squisher::SquishTextDot ( const ON_TextDot textDot) const

Description: After you have flattened a mesh or surface, call this function to map a TextDot on or near the surface to the resulting 2d surface Parameters: textDot - [in] the textDot to squish squished_dot - [in] if not NULL, the 2d result will be stored in this TextDot. If NULL, a TextDot will be created.