Public Member Functions

IMNMeshUtilities8 Class Reference

Search for all occurrences

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

#include <mnmesh.h>

Inheritance diagram for IMNMeshUtilities8:
Inheritance graph
[legend]

List of all members.

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)=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)=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)=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.

Member Function Documentation

virtual Interface_ID GetID ( ) [inline, virtual]
Remarks:
This method returns the unique interface ID.

Reimplemented from BaseInterface.

{ return IMNMESHUTILITIES8_INTERFACE_ID; }
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 
) [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_Edge1 1st edge index to bridge
[in] in_Edge2 2nd edge index to bridge
[in] in_segmentsNumber number of polys between the edges
[in] in_prevColumnIndex internal value, do not use
[in] in_smoothingGroup new face smoothing Group index
[in] in_materialId new face material id
[in] in_triangleAdded internal value, do not use
virtual bool BridgeSelectedEdges ( const DWORD  in_edgeFlag,
const float  in_smoothThresh,
const int  in_segmentsNumber,
const float  in_adjacentAngle,
const bool  in_reverseTriangle 
) [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_edgeFlag edge cluster flag.
[in] in_smoothThresh threshold angle, in radians, for smoothing successive columns of the bridge.
[in] in_segmentsNumber number of polys between the edges
[in] in_adjacentAngle angular threshold in radians for splitting one contiguous edge list in 2 in order to perform the bridging on 2 separate edge lists
[in] in_reverseTriangle reverse 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.
virtual bool ConnectEdges ( const DWORD  in_edgeFlag,
const int  in_segments = 2,
const int  in_pinch = 0,
const int  in_slide = 0 
) [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_edgeFlag edge cluster flag
[in] in_segments number of connection edges between successive selected edges
[in] in_pinch distance between successive new connection edges. Can be < 0.
[in] in_slide position of the new connection edges, relative to the existing edges. Can be < 0.
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_shift shifting value, can be positive or negative
[in,out] io_edgeSel the new edge selection list
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_shift shifting value, can be positive or negative
[in,out] io_edgeSel the new edge selection list
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_vertexFlag the vertex flag used
[in] in_distance to split the vertices apart
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_edgeFlag the vertex flag used
[in] in_distance to split the selected edges apart
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_edgeFlip array of flipped edges
[in] in_useOnlySelectedEdges if this is true, only selected edges will be tested against the 2 original edges.
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_flag the edge flag used
[in] in_mcd the chamfer data
[in] in_open If true, the newly created faces are removed, creating a hole between chamfered edges.
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] flag the vertices flag used
[in] mcd the chamfer data
[in] in_open If true, the newly created faces are removed, creating a hole between chamfered vertices.
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] faceIndex The index of the face for which you want to determine cache validity
Returns:
true if the face is invalid, else false.
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] vertex The index of the vertex that needs to be invalidated.

IMNMeshUtilities8 IMNMeshUtilities8 IMNMeshUtilities8 IMNMeshUtilities8 IMNMeshUtilities8 IMNMeshUtilities8 IMNMeshUtilities8 IMNMeshUtilities8 IMNMeshUtilities8 IMNMeshUtilities8
IMNMeshUtilities8 IMNMeshUtilities8 IMNMeshUtilities8 IMNMeshUtilities8 IMNMeshUtilities8 IMNMeshUtilities8 IMNMeshUtilities8 IMNMeshUtilities8 IMNMeshUtilities8 IMNMeshUtilities8