3ds Max C++ API Reference
Loading...
Searching...
No Matches
IMNMeshUtilities8 Class Referenceabstract

IMNMeshUtilities8 extends the MNMeshUtilities class, adding new functionality applied on a MNMesh. More...

#include <mnmesh.h>

+ Inheritance diagram for IMNMeshUtilities8:

Public Member Functions

virtual Interface_ID GetID ()
 
virtual bool BridgeTwoEdges (const int in_Edge1, const int in_Edge2, const int in_segmentsNumber, const int in_prevColumnIndex=0, const DWORD in_smoothingGroup=0, const MtlID in_materialId=0, const bool in_triangleAdded=false, MNMeshTriangulationType triangulationType=TRIANGULATION_ENHANCED_2024)=0
 Bridges 2 edges.
 
virtual bool BridgeSelectedEdges (const DWORD in_edgeFlag, const float in_smoothThresh, const int in_segmentsNumber, const float in_adjacentAngle, const bool in_reverseTriangle, MNMeshTriangulationType triangulationType=TRIANGULATION_ENHANCED_2024)=0
 Bridges edge selection.
 
virtual bool ConnectEdges (const DWORD in_edgeFlag, const int in_segments=2, const int in_pinch=0, const int in_slide=0, MNMeshTriangulationType triangulationType=TRIANGULATION_ENHANCED_2024)=0
 Creates new connections between opposing edges of the specified type.
 
virtual void SelectEdgeRingShift (const int in_ring_shift, BitArray &io_edgeSel)=0
 Edge selection shifting routine: shifts the current edge selection in the ring direction.
 
virtual void SelectEdgeLoopShift (const int in_loop_shift, BitArray &io_edgeSel)=0
 Edge selection shifting routine: shifts the current edge selection in the loop direction.
 
virtual bool SplitFlaggedVertices (const DWORD in_vertexFlag=MN_SEL, const float in_distance=0.0)=0
 Vertex splitting method, using a distance value for specifying the distance between the split vertices.
 
virtual bool SplitFlaggedEdges (const DWORD in_edgeFlag=MN_SEL, const float in_distance=0.0)=0
 Edge splitting method, using a distance value for specifying the distance between the split edges.
 
virtual void GetFlippedEdges (BitArray &io_edgeFlip, const bool in_useOnlySelectedEdges=false)=0
 Creates a bitArray indicating the directions of the MNMesh's edges relative to 2 arbitrary edges: the 2 first edges of the first face of the MNMesh.
 
virtual bool ChamferEdges (const DWORD in_flag=MN_SEL, MNChamferData *in_mcd=NULL, const bool in_open=false)=0
 New Edge chamfer method: A new parameter is added, allowing the creation of holes when chamfering.
 
virtual bool ChamferVertices (const DWORD flag=MN_SEL, MNChamferData *mcd=NULL, const bool in_open=false)=0
 New Vertex chamfer method : A new parameter is added, allowing the creation of holes when chamfering.
 
MNMesh Optimization Functions
virtual bool isFaceCacheInvalid (int faceIndex)=0
 Check if a face's cache is invalid.
 
virtual void InvalidateVertexCache (int vertex)=0
 Invalidates a single vertex's cache indicating it needs to be rebuilt.
 
- Public Member Functions inherited from BaseInterface
virtual UtilExport ~BaseInterface ()
 Destructor.
 
UtilExport BaseInterfaceGetInterface (Interface_ID id) override
 
virtual UtilExport Interface_ID GetID ()
 
virtual LifetimeType LifetimeControl ()
 
virtual bool RegisterNotifyCallback (InterfaceNotifyCallback *incb)
 
virtual void UnRegisterNotifyCallback (InterfaceNotifyCallback *incb)
 
virtual BaseInterfaceAcquireInterface ()
 
virtual void ReleaseInterface ()
 
virtual void DeleteInterface ()
 
virtual BaseInterfaceCloneInterface (void *remapDir=nullptr)
 
- Public Member Functions inherited from InterfaceServer
virtual UtilExport ~InterfaceServer ()
 Destructor.
 
virtual UtilExport BaseInterfaceGetInterface (Interface_ID id)
 
template<class InterfaceType >
InterfaceType * GetTypedInterface ()
 

Static Public Attributes

static constexpr Interface_ID ID = IMNMESHUTILITIES8_INTERFACE_ID
 

Additional Inherited Members

- Public Types inherited from BaseInterface
enum  LifetimeType { noRelease , immediateRelease , wantsRelease , serverControlled }
 
- Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown.
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e)
 Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned.
 
static UtilExport voidoperator new (size_t size, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown.
 
static UtilExport voidoperator new (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown.
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned.
 
static UtilExport voidoperator new (size_t size, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown.
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned.
 
static UtilExport voidoperator new[] (size_t size)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown.
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned.
 
static UtilExport voidoperator new[] (size_t size, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown.
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects.
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned.
 
static UtilExport voidoperator new[] (size_t size, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown.
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned.
 
static UtilExport void operator delete (void *ptr)
 Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown.
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen.
 
static UtilExport void operator delete (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown.
 
static UtilExport void operator delete (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown.
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen.
 
static UtilExport void operator delete (void *ptr, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown.
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen.
 
static UtilExport void operator delete[] (void *ptr)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown.
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen.
 
static UtilExport void operator delete[] (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown.
 
static UtilExport void operator delete[] (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown.
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen.
 
static UtilExport void operator delete[] (void *ptr, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown.
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown.
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator.
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator.
 
static UtilExport voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary.
 
static UtilExport voidaligned_realloc (void *ptr, size_t size, size_t alignment)
 Reallocates memory on a specified alignment boundary.
 
static UtilExport void aligned_free (void *ptr)
 Frees a block of memory that was allocated with aligned_malloc/aligned_realloc.
 

Detailed Description

IMNMeshUtilities8 extends the MNMeshUtilities class, adding new functionality applied on a MNMesh.

Such an interface is obtained through the call to GetInterface, using the class id: IMNMESHUTILITIES8_INTERFACE_ID on an instance of an MNMesh. usage is : IMNMeshUtilities8* l_meshToBridge = static_cast<IMNMeshUtilities8*>(mesh.GetInterface( IMNMESHUTILITIES8_INTERFACE_ID ));

Edge bridging: This is an extension of the existing bridge border method. It bridges 2 sets od edges of different size. you can bridge 4 edges with 5 edges. Limitations. the 2 edge lists must be disjoint, or at least separated by a sharp angle. this angular threshold can be adjusted by using the in_adjacentAngle parameter, Connect edges: 2 new parameters are added for better precision: in_pinch and in_slide. SelectEdgeRingShift: selects edges in the ring direction

Member Function Documentation

◆ GetID()

virtual Interface_ID GetID ( )
inlinevirtual
Remarks
This method returns the unique interface ID.

Reimplemented from BaseInterface.

#define IMNMESHUTILITIES8_INTERFACE_ID
Interface id for IMNMeshUtilities8, se.g.
Definition: mnmesh.h:120

◆ BridgeTwoEdges()

virtual bool BridgeTwoEdges ( const int  in_Edge1,
const int  in_Edge2,
const int  in_segmentsNumber,
const int  in_prevColumnIndex = 0,
const DWORD  in_smoothingGroup = 0,
const MtlID  in_materialId = 0,
const bool  in_triangleAdded = false,
MNMeshTriangulationType  triangulationType = TRIANGULATION_ENHANCED_2024 
)
pure virtual

Bridges 2 edges.

Returns
true if the bridging operation was successful
false if the bridging operation failed
Precondition
in_sourceEdge and in_targetEdge must be different
in_sourceEdge and in_targetEdge must on border
Postcondition
the mesh geometry is valid, even if the operation failed
Parameters
[in]in_Edge11st edge index to bridge
[in]in_Edge22nd edge index to bridge
[in]in_segmentsNumbernumber of polys between the edges
[in]in_prevColumnIndexinternal value, do not use
[in]in_smoothingGroupnew face smoothing Group index
[in]in_materialIdnew face material id
[in]in_triangleAddedinternal value, do not use
[in]triangulationTypealgorithm to be employed when triangulating generated faces

◆ BridgeSelectedEdges()

virtual bool BridgeSelectedEdges ( const DWORD  in_edgeFlag,
const float  in_smoothThresh,
const int  in_segmentsNumber,
const float  in_adjacentAngle,
const bool  in_reverseTriangle,
MNMeshTriangulationType  triangulationType = TRIANGULATION_ENHANCED_2024 
)
pure virtual

Bridges edge selection.

Returns
true if the bridging operation was successful
false if the bridging operation failed
Precondition
in_sourceEdge and in_targetEdge must be different
in_sourceEdge and in_targetEdge must on border
Postcondition
the mesh geometry is valid, even if the operation failed
Parameters
[in]in_edgeFlagedge cluster flag.
[in]in_smoothThreshthreshold angle, in radians, for smoothing successive columns of the bridge.
[in]in_segmentsNumbernumber of polys between the edges
[in]in_adjacentAngleangular threshold in radians for splitting one contiguous edge list in 2 in order to perform the bridging on 2 separate edge lists
[in]in_reverseTrianglereverse triangle's position: if true, triangles will be added at the end of the bridge, if they are needed ( when bridging 4 edges with 5 edges
[in]triangulationTypealgorithm to be employed when triangulating generated faces

◆ ConnectEdges()

virtual bool ConnectEdges ( const DWORD  in_edgeFlag,
const int  in_segments = 2,
const int  in_pinch = 0,
const int  in_slide = 0,
MNMeshTriangulationType  triangulationType = TRIANGULATION_ENHANCED_2024 
)
pure virtual

Creates new connections between opposing edges of the specified type.

If two edges are opposed they will each be split into a number (specified by in_segements) of equally sized segments. New edges will be created from the new vertexes created on each edge

Returns
true if the connection operation was successful
false if the connection operation failed
Precondition
in_segments must be greater than 1
in_pinch and in_slide must be between -100 and 100
Postcondition
the mesh geometry is valid, even if the operation failed
Parameters
[in]in_edgeFlagedge cluster flag
[in]in_segmentsnumber of connection edges between successive selected edges
[in]in_pinchdistance between successive new connection edges. Can be < 0.
[in]in_slideposition of the new connection edges, relative to the existing edges. Can be < 0.
[in]triangulationTypetriangulation algorithm to employ

◆ SelectEdgeRingShift()

virtual void SelectEdgeRingShift ( const int  in_ring_shift,
BitArray io_edgeSel 
)
pure virtual

Edge selection shifting routine: shifts the current edge selection in the ring direction.

Precondition
the io_edgeSel BitArray, must exist with the proper size
Postcondition
the io_edgeSel BitArray contains the list of the shifted edges
Parameters
[in]in_ring_shiftshifting value, can be positive or negative
[in,out]io_edgeSelthe new edge selection list

◆ SelectEdgeLoopShift()

virtual void SelectEdgeLoopShift ( const int  in_loop_shift,
BitArray io_edgeSel 
)
pure virtual

Edge selection shifting routine: shifts the current edge selection in the loop direction.

Precondition
the io_edgeSel BitArray must exist with the proper size
Postcondition
the io_edgeSel BitArray contains the list of the shifted edges
Parameters
[in]in_loop_shiftshifting value, can be positive or negative
[in,out]io_edgeSelthe new edge selection list

◆ SplitFlaggedVertices()

virtual bool SplitFlaggedVertices ( const DWORD  in_vertexFlag = MN_SEL,
const float  in_distance = 0.0 
)
pure virtual

Vertex splitting method, using a distance value for specifying the distance between the split vertices.

Postcondition
the MNmesh is valid, with the selected vertices ,split apart, using the in_distance.
Parameters
[in]in_vertexFlagthe vertex flag used
[in]in_distanceto split the vertices apart

◆ SplitFlaggedEdges()

virtual bool SplitFlaggedEdges ( const DWORD  in_edgeFlag = MN_SEL,
const float  in_distance = 0.0 
)
pure virtual

Edge splitting method, using a distance value for specifying the distance between the split edges.

Postcondition
the MNmesh is valid with the selected vertices ,split apart, using the in_distance.
Parameters
[in]in_edgeFlagthe vertex flag used
[in]in_distanceto split the selected edges apart

◆ GetFlippedEdges()

virtual void GetFlippedEdges ( BitArray io_edgeFlip,
const bool  in_useOnlySelectedEdges = false 
)
pure virtual

Creates a bitArray indicating the directions of the MNMesh's edges relative to 2 arbitrary edges: the 2 first edges of the first face of the MNMesh.

For a MNesh made of quads ( like a converted plane), they are the 2 first edges of the lower left face.

Precondition
the array io_edgeFlip does not need to exist
Postcondition
the array exists and contains number of edges entries.
Parameters
[in,out]io_edgeFliparray of flipped edges
[in]in_useOnlySelectedEdgesif this is true, only selected edges will be tested against the 2 original edges.

◆ ChamferEdges()

virtual bool ChamferEdges ( const DWORD  in_flag = MN_SEL,
MNChamferData in_mcd = NULL,
const bool  in_open = false 
)
pure virtual

New Edge chamfer method: A new parameter is added, allowing the creation of holes when chamfering.

Returns
true if the chamfer operation was successful
false if the chamfer operation failed
Postcondition
the mesh geometry is valid, even if the operation failed
Parameters
[in]in_flagthe edge flag used
[in]in_mcdthe chamfer data
[in]in_openIf true, the newly created faces are removed, creating a hole between chamfered edges.

◆ ChamferVertices()

virtual bool ChamferVertices ( const DWORD  flag = MN_SEL,
MNChamferData mcd = NULL,
const bool  in_open = false 
)
pure virtual

New Vertex chamfer method : A new parameter is added, allowing the creation of holes when chamfering.

Returns
true if the chamfer operation was successful
false if the chamfer operation failed
Postcondition
the mesh geometry is valid, even if the operation failed
Parameters
[in]flagthe vertices flag used
[in]mcdthe chamfer data
[in]in_openIf true, the newly created faces are removed, creating a hole between chamfered vertices.

◆ isFaceCacheInvalid()

virtual bool isFaceCacheInvalid ( int  faceIndex)
pure virtual

Check if a face's cache is invalid.

The function first checks if the whole mesh or the face have been flagged as cache invalid (MN_CACHEINVALID). If none of these is true, it then cycles through the face's vertices and returns true as soon as it finds a vertex flagged with MN_CACHEINVALID.

Precondition
faceIndex must be a valid index in the faces (f) array.
Parameters
[in]faceIndexThe index of the face for which you want to determine cache validity
Returns
true if the face is invalid, else false.

◆ InvalidateVertexCache()

virtual void InvalidateVertexCache ( int  vertex)
pure virtual

Invalidates a single vertex's cache indicating it needs to be rebuilt.

The function flags the specified vertex with the MN_CACHEINVALID flag, telling the rebuild functions that this vertex, the faces surrounding it and the other vertices of those faces need to have their normals recomputed. It also sets normalsBuilt to 0 to trigger normals' rebuild. This function should be called when one to several vertices have been modified. If all or almost all vertices of the mesh have been invalidated, it's more efficient to call InvalidateGeomCache() instead.

Precondition
vertex must be a valid index in the vertex (v) array.
Parameters
[in]vertexThe index of the vertex that needs to be invalidated.

Member Data Documentation

◆ ID

constexpr Interface_ID ID = IMNMESHUTILITIES8_INTERFACE_ID
staticconstexpr