#include <c4d_baseobject.h>
Helper class to get neighboring polygons from edges and points:
Private Attributes | |
EnumerateEdges * | ee |
Constructor/Destructor | |
Neighbor () | |
virtual | ~Neighbor () |
Init | |
virtual Bool | Init (Int32 pcnt, const CPolygon *vadr, Int32 vcnt, BaseSelect *bs) |
Get Neighbor Information | |
void | GetEdgePolys (Int32 a, Int32 b, Int32 *first, Int32 *second) |
void | GetPointPolys (Int32 pnt, Int32 **dadr, Int32 *dcnt) |
void | GetPointOneRingPoints (Int32 pnt, Int32 **dadr, Int32 *dcnt) |
Int32 | GetEdgeCount (void) |
PolyInfo * | GetPolyInfo (Int32 poly) |
Int32 | GetNeighbor (Int32 a, Int32 b, Int32 poly) |
Bool | GetNGons (PolygonObject *op, Int32 &ngoncnt, NgonNeighbor *&ngons) |
Miscellaneous | |
void | Flush () |
void | ResetAddress (const CPolygon *a_polyadr) |
Neighbor | ( | ) |
Default constructor.
|
virtual |
Default destructor.
|
virtual |
Initializes the internal polygon information.
[in] | pcnt | The total number of points from the polygon object. This can be obtained calling PointObject::GetPointCount(). |
[in] | vadr | Pointer to the polygons array. This can be obtained calling PolygonObject::GetPolygonR(). The caller owns the pointed polygons array. |
[in] | vcnt | The total number of polygons in the polygons array. This can be obtained calling PolygonObject::GetPolygonCount(). |
[in] | bs | Pointer to the polygon selection used to build the neighbor information. Set nullptr to use all polygons. The caller owns the pointed base select. |
Gets the polygons that neighbor the given edge.
[in] | a | The point index that defines the first edge point. |
[in] | b | The point index that defines the second edge point. |
[in] | first | Assigned the first polygon index associated with the edge. |
[in] | second | Assigned the second polygon index associated with the edge. |
Gets the polygons that are attached to the given point.
Example:
To get the polygons around say point 137 we would use:
[in] | pnt | The point index to use to find the associated polygons. |
[in] | dadr | Assigned the address of the returned polygon array. |
[in] | dcnt | Assigned the number of polygons returned in the array daddr. |
Gets the points that are attached through one edge to the given point.
Example:
To get the points around say point 137 we would use:
[in] | pnt | The point index to use to find the associated one ring points. |
[in] | dadr | Assigned the address of the returned points array. The caller owns the pointed points array. |
[in] | dcnt | Assigned the number of points returned in daddr. |
Int32 GetEdgeCount | ( | void | ) |
Gets the total number of edges found.
Gets neighbor information about the given polygon.
[in] | poly | The polygon index to get the neighbor information for. |
Gets the polygon opposite to poly with respect to the edge from point a to b.
[in] | a | The point index that defines the first edge point. |
[in] | b | The point index that defines the second edge point. |
[in] | poly | The index of the polygon to get the polygon opposite to. |
Bool GetNGons | ( | PolygonObject * | op, |
Int32 & | ngoncnt, | ||
NgonNeighbor *& | ngons | ||
) |
Gets the N-gon neighbors.
[in] | op | The polygon object. The caller owns the pointed polygon object. |
[out] | ngoncnt | Assigned the N-gon count. |
[out] | ngons | Assigned a pointer to the N-gon neighbor information. Free the array afterwards with DeleteMem() (not the segments, points, edges or neighbor members). |
void Flush | ( | void | ) |
Flushes the neighbor information.
void ResetAddress | ( | const CPolygon * | a_polyadr | ) |
Allows to set the new pointer to the polygon object if changed.
It is then possible to continue using the Neighbor data.
[in] | a_polyadr | The new polygon address to set. |
|
private |