#include <lib_modeling.h>
|
Int32 | AddPoint (C4DAtom *op, const Vector &p) |
|
Int32 | ClonePoint (C4DAtom *op, Int32 index) |
|
Bool | DeletePoint (C4DAtom *op, Int32 index) |
|
Bool | GetPoint (C4DAtom *op, Int32 index, Vector *p) |
|
Bool | SetPoint (C4DAtom *op, Int32 index, const Vector &p, Int32 flags=0) |
|
Bool | SetEdgePoint (C4DAtom *op, Int32 index, Float l, Int32 flags=0) |
|
Bool | SetPoints (C4DAtom *op, PointMove *pnts, Int32 cnt, Bool commit=false, Int32 flags=0) |
|
Bool | GetPointInfo (C4DAtom *op, Int32 index, Int32 &ia, Int32 &ib, Float &t) |
|
Bool | GetOriginPoint (C4DAtom *op, Int32 index, Int32 &ci) |
|
Bool | SetPointInfo (C4DAtom *op, Int32 index, Int32 ia, Int32 ib, Float t) |
|
Bool | SetOriginPoint (C4DAtom *op, Int32 index, Int32 ci) |
|
Int32 | GetPointFlags (C4DAtom *op, Int32 index) |
|
Int32 | SetPointFlags (C4DAtom *op, Int32 index, Int32 flags) |
|
Bool | GetPointOrigin (C4DAtom *op, Int32 index, Vector &opnt) |
|
Bool | SetPointOrigin (C4DAtom *op, Int32 index, Vector opnt, Int32 flags) |
|
Bool | SetInterPoint (C4DAtom *op, Int32 index, Vector npnt, Float t, Int32 flags=0) |
|
Bool | SetInterPoint (C4DAtom *op, Int32 index, const Vector &move, const Vector &offset, Int32 flags=0) |
|
|
Int32 | NewNgon (C4DAtom *op, Int32 flags=0) |
|
Int32 | AddNgon (C4DAtom *op, const Ngon &ngon, Int32 flags=0) |
|
Int32 | CreateNgon (C4DAtom *op, Int32 *padr, Int32 cnt, Int32 flags=0) |
|
Bool | DeleteNgon (C4DAtom *op, Int32 index, Bool points) |
|
Int32 | CloneNgon (C4DAtom *op, Int32 index, Int32 flags=0) |
|
Bool | GetNgon (C4DAtom *op, Int32 index, Ngon *ngon, Int32 flags=0) |
|
Bool | SetNgon (C4DAtom *op, Int32 index, Ngon &ngon, Int32 flags=0) |
|
Bool | GetNgonNormal (C4DAtom *op, Int32 index, Vector *n) |
|
Bool | FlipNgonNormal (C4DAtom *op, Int32 index) |
|
Bool | GetOriginNgon (C4DAtom *op, Int32 index, Int32 &ci) |
|
Bool | SetOriginNgon (C4DAtom *op, Int32 index, Int32 ci) |
|
Int32 | GetNgonFlags (C4DAtom *op, Int32 index) |
|
Int32 | SetNgonFlags (C4DAtom *op, Int32 index, Int32 flags) |
|
Bool | ResizeNgon (C4DAtom *op, Int32 index, Int32 pcnt, Int32 scnt) |
|
|
Bool | WeldPoints (C4DAtom *op, Int32 source, Int32 dest) |
|
Bool | InsertFacePoint (C4DAtom *op, Int32 pa, Int32 p1) |
|
Bool | CreateHole (C4DAtom *op, Int32 index, const Ngon &ngon) |
|
Bool | CreateHole (C4DAtom *op, Int32 index, Int32 *pnts, Int32 pcnt) |
|
Int32 | SplitEdge (C4DAtom *op, Int32 p1, Int32 p2, Float l) |
|
Bool | DeleteEdge (C4DAtom *op, Int32 index, Int32 p1, Int32 p2) |
|
Bool | MeltEdgeBetween (C4DAtom *op, Int32 pa, Int32 pb, Int32 p1, Int32 p2) |
|
Bool | MeltEdge (C4DAtom *op, Int32 pa, Int32 p1, Int32 p2) |
|
Bool | MeltPoint (C4DAtom *op, Int32 p) |
|
Bool | MeltNgon (C4DAtom *op, Int32 pa) |
|
Int32 | SplitPolygon (C4DAtom *op, Int32 index, Int32 p1, Int32 p2) |
|
Bool | MergePolygons (C4DAtom *op, Int32 pa, Int32 pb) |
|
Bool | IsValidEdge (C4DAtom *op, Int32 index, Int32 p1, Int32 p2) |
|
Bool | IsValidNgon (C4DAtom *op, Int32 index) |
|
Bool | IsValidPoint (C4DAtom *op, Int32 index) |
|
Int32 * | GetEdgeNgons (C4DAtom *op, Int32 p1, Int32 p2, Int32 &pcnt) |
|
Int32 * | GetPointNgons (C4DAtom *op, Int32 p, Int32 &pcnt, Bool clone=true) |
|
Int32 * | GetNeighborNgons (C4DAtom *op, Int32 index, Int32 &pcnt) |
|
Int32 * | GetPointEdges (C4DAtom *op, Int32 p, Int32 &ecnt) |
|
Bool | FindNgon (C4DAtom *op, Int32 p1, Int32 p2, Int32 &index) |
|
Bool | GetEdgeSegment (C4DAtom *op, Int32 pa, Int32 p1, Int32 p2, Int32 *seg, Int32 *s1, Int32 *s2, Bool rel) |
|
Bool | GetOriginalEdgePoints (C4DAtom *op, Int32 edge, Int32 &p1, Int32 &p2) |
|
Bool | IsEdgeDeleted (C4DAtom *op, Int32 p1, Int32 p2) |
|
Bool | IsPointDeleted (C4DAtom *op, Int32 index) |
|
Bool | IsFaceDeleted (C4DAtom *op, Int32 index) |
|
Int32 | TranslateNgonIndex (C4DAtom *op, Int32 index, Bool tovirtual=false) |
|
Int32 | TranslatePointIndex (C4DAtom *op, Int32 index, Bool tovirtual=false) |
|
Bool | GetFaceSelection (C4DAtom *op, BaseSelect *select, BaseSelect *faceselect, BaseSelect *hidden=nullptr) |
|
Bool | GetEdgeSelection (C4DAtom *op, BaseSelect *select, BaseSelect *edgeselect, BaseSelect *hidden=nullptr) |
|
Int32 * | GetEdgeSelectionArray (C4DAtom *op, BaseSelect *select, Int32 &ecnt, BaseSelect *hidden=nullptr, Bool tovirtual=true) |
|
|
Bool | PointInFace (C4DAtom *op, Int32 index, const Vector &p) |
|
Bool | PointInFace (C4DAtom *op, const Ngon &ngon, const Vector &p) |
|
Bool | LineFaceIntersection (C4DAtom *op, Int32 index, const Vector &p1, const Vector &p2) |
|
Bool | LineFaceIntersection (C4DAtom *op, const Ngon &ngon, const Vector &p1, const Vector &p2) |
|
◆ Modeling()
◆ ~Modeling()
◆ Alloc()
Allocates a modeling engine. Destroy the allocated modeling engine with Free(). Use AutoAlloc to automate the allocation and destruction based on scope.
- Returns
- The allocated modeling engine, or nullptr if the allocation failed.
◆ Free()
Destructs modeling engines allocated with Alloc(). Use AutoAlloc to automate the allocation and destruction based on scope.
- Parameters
-
[in,out] | p | The modeling engine to destruct. If the pointer is nullptr nothing happens. The pointer is assigned nullptr afterwards. |
◆ InitArray()
Initializes the modeling engine with the objects in objs.
- Parameters
-
[in] | objs | An atom array with the objects to perform the modeling on. The caller owns the pointed objects array. |
[in] | flags | Not used. |
- Returns
- true if successful, otherwise false.
◆ InitObject()
Initialize the modeling engine with the object op.
- Parameters
-
[in] | op | The object to perform the modeling on. The caller owns the pointed object. |
[in] | flags | Not used. |
- Returns
- true if successful, otherwise false.
◆ Commit()
Commits the modeling transformation.
- Parameters
-
[in] | op | The pointer of the initialized object to use for the commit, or nullptr to commit all initialized objects. |
[in] | flags | The commit flags: MODELING_COMMIT |
[in] | cobj | The object to commit the changes to, or nullptr to use the initialized object.
Setting cobj is only valid when committing a single object. The object must match the original. |
- Returns
- true if successful, otherwise false.
◆ Release()
Frees all data for all initialized objects.
◆ ReleaseObject()
Frees the data for op.
- Parameters
-
[in] | op | An initialized object. The caller owns the pointed object. |
◆ GetPointMap()
Retrieves a table of where the old/new points were set in the changed object after a Modeling::Commit().
The table is interleaved with virtual indices at (*map)[2*n]
and real indices at (*map)[2*n+1]
, where n
goes from 0 to count - 1.
- Note
- Set MODELING_COMMIT_CREATEMAP flag in Modeling::Commit() for this function to work.
- Parameters
-
[in] | op | An initialized object. The caller owns the pointed object. |
[out] | map | Assigned a pointer to the map array. The modeling engine owns the pointed array. |
[out] | count | Assigned the number of points. The array size is 2 * count. |
- Returns
- true if successful, otherwise false.
◆ GetNgonMap()
◆ ReleaseMap()
Call this function to keep the table map for later use. When finished use FreeMap().
- Note
- Memory allocated with the modeling library (as with the N-gon library) does not use the usual Cinema 4D memory manager but has its own system.
So all memory must be freed through the correct library.
- Parameters
-
[in] | op | An initialized object. The caller owns the pointed object. |
[out] | map | The map pointer to release. |
- Returns
- true if successful, otherwise false.
◆ FreeMap()
Frees a map table released by ReleaseMap().
- Parameters
-
[in] | op | An initialized object. The caller owns the pointed object. |
[out] | map | The map pointer to free. |
- Returns
- true if successful, otherwise false.
◆ AddPoint()
Adds a new point to the object.
- Parameters
-
[in] | op | An initialized object. The caller owns the pointed object. |
[in] | p | The position of the point to add. |
- Returns
- The virtual index of the added point, or 0 if an error occurred.
◆ ClonePoint()
Clones the point at index.
- Parameters
-
[in] | op | An initialized object. The caller owns the pointed object. |
[in] | index | The index of the point to clone. Can be an old index (positive) or a virtual index (negative). |
- Returns
- The virtual index of the new point, or 0 if an error occurred.
◆ DeletePoint()
Deletes the point at index.
- Parameters
-
[in] | op | An initialized object. The caller owns the pointed object. |
[in] | index | The index of the point to delete. Can be an old index (positive) or a virtual index (negative). |
- Returns
- true if successful, otherwise false.
◆ GetPoint()
Retrieves the position vector for a point at index in p.
- Parameters
-
[in] | op | An initialized object. The caller owns the pointed object. |
[in] | index | The index of the point to get. Can be an old index (positive) or a virtual index (negative). |
[out] | p | Assigned the point position. |
- Returns
- true if successful, otherwise false.
◆ SetPoint()
Sets the position vector for a point at index to p.
- Parameters
-
[in] | op | An initialized object. The caller owns the pointed object. |
[in] | index | The index of the point to set. Can be an old index (positive) or a virtual index (negative). |
[in] | p | The point position to set. |
[in] | flags | The flags: MODELING_SETPOINT_FLAG |
- Returns
- true if successful, otherwise false.
◆ SetEdgePoint()
Sets position vector for an edge point at index to p. An edge point is a point that has been inserted between 2 other points with the library (along an edge).
This information is kept internal and can adjust the point along this edge with l.
- Parameters
-
[in] | op | An initialized object. The caller owns the pointed object. |
[in] | index | The index of the edge point to set. |
[in] | l | The edge coordinate, between 0 and 1. |
[in] | flags | The flags: MODELING_SETPOINT_FLAG |
- Returns
- true if successful, otherwise false.
◆ SetPoints()
Sets many points in one call using an array of PointMove.
- Parameters
-
[in] | op | An initialized object. The caller owns the pointed object. |
[in] | pnts | An array with instructions how to move the points. The caller owns the pointed array. |
[in] | cnt | The size of the pnts array. |
[in] | commit | If true the move triggers a Commit(). |
[in] | flags | The flags: MODELING_SETPOINT_FLAG |
- Returns
- true if successful, otherwise false.
◆ GetPointInfo()
Retrieves the information for a point that was inserted along an edge.
If the point was not an edge point then the indexes will be assigned NOTINDEX::
This can also be used to check if a point was a clone, as cloned points would return ia == ib.
- Parameters
-
[in] | op | An initialized object. The caller owns the pointed object. |
[in] | index | The index of the edge point to get information for. |
[out] | ia | Assigned the index of the first point of the original edge. |
[out] | ib | Assigned the index of the second point of the original edge. |
[out] | t | Assigned the position along the edge. |
- Returns
- true if successful, otherwise false.
◆ GetOriginPoint()
Retrieves the original point for a cloned point.
- Parameters
-
[in] | op | An initialized object. The caller owns the pointed object. |
[in] | index | The index of the cloned point. |
[out] | ci | Assigned the cloned index. |
- Returns
- true if successful, otherwise false.
◆ SetPointInfo()
Sets the edge/clone information for a point. For a clone ia == ib and t is 0.
- Parameters
-
[in] | op | An initialized object. The caller owns the pointed object. |
[in] | index | The index of the point to set. |
[in] | ia | The first point of the original edge. |
[in] | ib | The second point of the original edge. |
[in] | t | The position along the edge. |
- Returns
- true if successful, otherwise false.
◆ SetOriginPoint()
Sets the original index for a point, making it a clone of that point.
- Parameters
-
[in] | op | An initialized object. The caller owns the pointed object. |
[in] | index | The index of the point to set. |
[in] | ci | The index of the original point. Can be an old index (positive) or a virtual index (negative). |
- Returns
- true if successful, otherwise false.
◆ GetPointFlags()
Gets the flags for a point.
- Parameters
-
[in] | op | An initialized object. The caller owns the pointed object. |
[in] | index | The index of the point to get the flags for. Can be an old index (positive) or a virtual index (negative). |
- Returns
- The point flags: MODELING_SETPOINT_FLAG
◆ SetPointFlags()
Sets the flags for a point.
- Parameters
-
[in] | op | An initialized object. The caller owns the pointed object. |
[in] | index | The index of the point to set the flags for. Can be an old index (positive) or a virtual index (negative). |
[in] | flags | The new point flags: MODELING_SETPOINT_FLAG |
- Returns
- The old point flags.
◆ GetPointOrigin()
Gets the original position of a cloned point.
- Parameters
-
[in] | op | An initialized object. The caller owns the pointed object. |
[in] | index | The index of the point to get the original position for. |
[out] | opnt | Assigned the original point position. |
- Returns
- true if successful, otherwise false.
◆ SetPointOrigin()
Sets the original position of a cloned point.
- Parameters
-
[in] | op | An initialized object. The caller owns the pointed object. |
[in] | index | The index of the point to set the original position for. |
[in] | opnt | The new original point position. |
[in] | flags | The point flags: MODELING_SETPOINT_FLAG |
- Returns
- true if successful, otherwise false.
◆ SetInterPoint() [1/2]
Sets an interpolated point npnt on the position t along its edge.
The point along an edge must have been previoulsy created e.g. with SplitEdge(), so that the modeling engine knows which 2 points it was created between.
Then use this function to give it a new position along the edge.
- Parameters
-
[in] | op | An initialized object. The caller owns the pointed object. |
[in] | index | The index of the point to set the interpolation information for. |
[in] | npnt | The new position for the point. It is supposed to be along its edge, but it can actually be anywhere. The main aim here is to get the UVs along the edge. |
[in] | t | The new position along the edge for the interpolation. This information is used to update tags, e.g. finding the UVs within a polygon. |
[in] | flags | The point flags: MODELING_SETPOINT_FLAG |
- Returns
- true if successful, otherwise false.
◆ SetInterPoint() [2/2]
For N-gon interpolation. The move vector should be within the N-gon, e.g. something like extrude inner, while offset is just added to the point and not used for the interpolation within the N-gon.
The information set is used to update tags, e.g. finding the UVs within a polygon.
- Parameters
-
[in] | op | An initialized object. The caller owns the pointed object. |
[in] | index | The index of the point to set the interpolation information for. |
[in] | move | The move vector within the N-gon. |
[in] | offset | The offset vector for the point. |
[in] | flags | The point flags: MODELING_SETPOINT_FLAG |
- Returns
- true if successful, otherwise false.
◆ NewNgon()
Creates an empty N-gon.
- Parameters
-
[in] | op | An initialized object. The caller owns the pointed object. |
[in] | flags | The flags: MODELING_SETNGON_FLAG |
- Returns
- The virtual index of the new N-gon, or 0 if an error occurred.
◆ AddNgon()
Creates an N-gon based on the passed Ngon data.
- Parameters
-
[in] | op | An initialized object. The caller owns the pointed object. |
[in] | ngon | The N-gon to add. |
[in] | flags | The flags: MODELING_SETNGON_FLAG |
- Returns
- true if successful, otherwise false.
◆ CreateNgon()
Creates an N-gon based on an array of point indices in padr.
- Parameters
-
[in] | op | An initialized object. The caller owns the pointed object. |
[in] | padr | The array with indices for the points of the N-gon to create. The caller owns the pointed array. |
[in] | cnt | The size of the padr array. |
[in] | flags | The flags: MODELING_SETNGON_FLAG |
- Returns
- true if successful, otherwise false.
◆ DeleteNgon()
Removes an N-gon.
- Parameters
-
[in] | op | An initialized object. The caller owns the pointed object. |
[in] | index | The index of the N-gon to delete. Can be an old index (positive) or a virtual index (negative). |
[in] | points | If true the points of the N-gon are checked and removed if they are not used by other N-gons. |
- Returns
- true if successful, otherwise false.
◆ CloneNgon()
Create an N-gon based on another N-gon at index.
- Parameters
-
[in] | op | An initialized object. The caller owns the pointed object. |
[in] | index | The index of the N-gon to clone. Can be an old index (positive) or a virtual index (negative). |
[in] | flags | The flags: MODELING_SETNGON_FLAG |
- Returns
- The virtual index of the new N-gon, or 0 if an error occurred.
◆ GetNgon()
Retrieves an N-gon.
- Parameters
-
[in] | op | An initialized object. The caller owns the pointed object. |
[in] | index | The index of the N-gon to get. Can be an old index (positive) or a virtual index (negative). |
[out] | ngon | The structure to fill with the N-gon information. The caller owns the pointed structure. |
[in] | flags | The flags: MODELING_SETNGON_FLAG |
- Returns
- true if successful, otherwise false.
◆ SetNgon()
Sets an N-gon.
- Parameters
-
[in] | op | An initialized object. The caller owns the pointed object. |
[in] | index | The index of the N-gon to set. Can be an old index (positive) or a virtual index (negative). |
[in] | ngon | The N-gon structure to set. |
[in] | flags | The flags: MODELING_SETNGON_FLAG |
- Returns
- true if successful, otherwise false.
◆ GetNgonNormal()
Calculates the normal for an N-gon.
- Parameters
-
[in] | op | An initialized object. The caller owns the pointed object. |
[in] | index | The index of the N-gon to get the normal for. Can be an old index (positive) or a virtual index (negative). |
[in] | n | Assigned the normal vector. The caller owns the pointed vector. |
- Returns
- true if successful, otherwise false.
◆ FlipNgonNormal()
Reverses the normal of an N-gon.
- Parameters
-
[in] | op | An initialized object. The caller owns the pointed object. |
[in] | index | The index of the N-gon to reverse the normal of. Can be an old index (positive) or a virtual index (negative). |
- Returns
- true if successful, otherwise false.
◆ GetOriginNgon()
Gets the original index of an N-gon.
This index is used when updating tags so the tag translation knows where any N-gon clones originated from.
- Parameters
-
[in] | op | An initialized object. The caller owns the pointed object. |
[in] | index | The index of the cloned N-gon. |
[in] | ci | Assigned the original index. |
- Returns
- true if successful, otherwise false.
◆ SetOriginNgon()
Sets the original index of a cloned N-gon.
This index is used when updating tags so the tag translation knows where any N-gon clones originated from.
- Parameters
-
[in] | op | An initialized object. The caller owns the pointed object. |
[in] | index | The index of the N-gon to set the original index for. |
[in] | ci | The original index. |
- Returns
- true if successful, otherwise false.
◆ GetNgonFlags()
Gets the flags for an N-gon.
- Parameters
-
[in] | op | An initialized object. The caller owns the pointed object. |
[in] | index | The index of the N-gon to get the flags for. Can be an old index (positive) or a virtual index (negative). |
- Returns
- The flags: MODELING_SETNGON_FLAG
◆ SetNgonFlags()
Sets the flags for an N-gon.
- Parameters
-
[in] | op | An initialized object. The caller owns the pointed object. |
[in] | index | The index of the N-gon to set the flags for. Can be an old index (positive) or a virtual index (negative). |
[in] | flags | The new flags: MODELING_SETNGON_FLAG |
- Returns
- The old flags.
◆ ResizeNgon()
◆ WeldPoints()
Welds the source point index to dest.
- Parameters
-
[in] | op | An initialized object. The caller owns the pointed object. |
[in] | source | The index of the source point. Can be an old index (positive) or a virtual index (negative). |
[in] | dest | The index of the destination point. Can be an old index (positive) or a virtual index (negative). |
- Returns
- true if successful, otherwise false.
◆ InsertFacePoint()
◆ CreateHole() [1/2]
Adds the hole in ngon into the N-gon at index.
- Parameters
-
[in] | op | An initialized object. The caller owns the pointed object. |
[in] | index | The index of the N-gon to add the hole to. Can be an old index (positive) or a virtual index (negative). |
[in] | ngon | The hole N-gon. |
- Returns
- true if successful, otherwise false.
◆ CreateHole() [2/2]
Adds the hole with points in pnts into the N-gon at index.
- Parameters
-
[in] | op | An initialized object. The caller owns the pointed object. |
[in] | index | The index of the N-gon to add the hole to. Can be an old index (positive) or a virtual index (negative). |
[in] | pnts | An array with the hole N-gon points. |
[in] | pcnt | The size of the pnts array. |
- Returns
- true if successful, otherwise false.
◆ SplitEdge()
Splits an edge (defined by the point indices p1 to p2) at l (0 to 1) creating a new edge point with the index returned.
- Parameters
-
[in] | op | An initialized object. The caller owns the pointed object. |
[in] | p1 | The index of the first point of the edge. Can be an old index (positive) or a virtual index (negative). |
[in] | p2 | The index of the second point of the edge. Can be an old index (positive) or a virtual index (negative). |
[in] | l | The position along the edge, between 0 and 1. |
- Returns
- The virtual index of the new edge point, or 0 if an error occurred.
◆ DeleteEdge()
Deletes an edge defined by p1 and p2. If this results in an N-gon with less than 3 points then the N-gon will be removed.
- Parameters
-
[in] | op | An initialized object. The caller owns the pointed object. |
[in] | index | The index of the N-gon. Can be an old index (positive) or a virtual index (negative). |
[in] | p1 | The index of the first point of the edge to remove. Can be an old index (positive) or a virtual index (negative). |
[in] | p2 | The index of the second point of the edge to remove. Can be an old index (positive) or a virtual index (negative). |
- Returns
- true if successful, otherwise false.
◆ MeltEdgeBetween()
Melts an edge between the 2 n-gons at pa and pb. The edge is defined by the points p1 and p2.
- Parameters
-
[in] | op | An initialized object. The caller owns the pointed object. |
[in] | pa | The index of the first N-gon. Can be an old index (positive) or a virtual index (negative). |
[in] | pb | The index of the second N-gon. Can be an old index (positive) or a virtual index (negative). |
[in] | p1 | The index of the first point of the edge. Can be an old index (positive) or a virtual index (negative). |
[in] | p2 | The index of the second point of the edge. Can be an old index (positive) or a virtual index (negative). |
- Returns
- true if successful, otherwise false.
◆ MeltEdge()
Melt the edge (p1 to p2) of N-gon pa.
- Note
- MeltEdge() accepts NOTINDEX for the N-gon index pa, in which case it takes the first index for the edge it finds.
- Parameters
-
[in] | op | An initialized object. The caller owns the pointed object. |
[in] | pa | The index of the N-gon. Can be an old index (positive) or a virtual index (negative). |
[in] | p1 | The index of the first point of the edge to melt. Can be an old index (positive) or a virtual index (negative). |
[in] | p2 | The index of the second point of the edge to melt. Can be an old index (positive) or a virtual index (negative). |
- Returns
- true if successful, otherwise false.
◆ MeltPoint()
Melts the N-gons around point p.
- Parameters
-
[in] | op | An initialized object. The caller owns the pointed object. |
[in] | p | The index of the point, the N-gons around which are to be melted. Can be an old index (positive) or a virtual index (negative). |
- Returns
- true if successful, otherwise false.
◆ MeltNgon()
Melts the N-gon pa into its surrounding N-gons.
- Parameters
-
[in] | op | An initialized object. The caller owns the pointed object. |
[in] | pa | The index of the N-gon to melt. Can be an old index (positive) or a virtual index (negative). |
- Returns
- true if successful, otherwise false.
◆ SplitPolygon()
Cuts the N-gon at index between points p1 and p2, returning the newly created N-gon index.
- Parameters
-
[in] | op | An initialized object. The caller owns the pointed object. |
[in] | index | The index of the N-gon to split. Can be an old index (positive) or a virtual index (negative). |
[in] | p1 | The index of the first point of the split. Can be an old index (positive) or a virtual index (negative). |
[in] | p2 | The index of the second point of the split. Can be an old index (positive) or a virtual index (negative). |
- Returns
- The newly created N-gon index or the passed index for no change, otherwise NOTINDEX for fail.
◆ MergePolygons()
Merges the points of pb into pa making them into holes of pa.
- Parameters
-
[in] | op | An initialized object. The caller owns the pointed object. |
[in] | pa | The index of the first N-gon. Can be an old index (positive) or a virtual index (negative). |
[in] | pb | The index of the second N-gon. Can be an old index (positive) or a virtual index (negative). |
- Returns
- true if successful, otherwise false.
◆ IsValidEdge()
Checks if the edge (p1 to p2) of the N-gon at index is valid (exists).
- Parameters
-
[in] | op | An initialized object. The caller owns the pointed object. |
[in] | index | The index of the N-gon to check. Can be an old index (positive) or a virtual index (negative).
Pass NOTINDEX to check that the edge (p1,p2) exists and is an N-gon edge. |
[in] | p1 | The index of the first point of the edge to check. Can be an old index (positive) or a virtual index (negative). |
[in] | p2 | The index of the second point of the edge to check. Can be an old index (positive) or a virtual index (negative). |
- Returns
- true if the edge is valid, otherwise false.
◆ IsValidNgon()
Check if the N-gon at index is valid (exists).
- Parameters
-
[in] | op | An initialized object. The caller owns the pointed object. |
[in] | index | The index of the N-gon to check. Can be an old index (positive) or a virtual index (negative). |
- Returns
- true if the N-gon is valid, otherwise false.
◆ IsValidPoint()
Check if the point at index exists.
- Parameters
-
[in] | op | An initialized object. The caller owns the pointed object. |
[in] | index | The index of the point to check. Can be an old index (positive) or a virtual index (negative). |
- Returns
- true if the point is valid, otherwise false.
◆ GetEdgeNgons()
Retrieves an array with the N-gons that share the edge between p1 and p2.
- Parameters
-
[in] | op | An initialized object. The caller owns the pointed object. |
[in] | p1 | The index of the first point of the edge to check. Can be an old index (positive) or a virtual index (negative). |
[in] | p2 | The index of the second point of the edge to check. Can be an old index (positive) or a virtual index (negative). |
[out] | pcnt | Assigned the number of N-gons found. |
- Returns
- The array of N-gon indices. The size is given by pcnt. The caller owns the pointed array.
Use the modeling library FreeTable() function to free the data afterwards.
◆ GetPointNgons()
Retrieves a table of the N-gons that share the point at p.
- Parameters
-
[in] | op | An initialized object. The caller owns the pointed object. |
[in] | p | The index of the point to check. Can be an old index (positive) or a virtual index (negative). |
[out] | pcnt | Assigned the number of N-gons found. |
[in] | clone | If false a pointer to an internal array is returned. Then it is not need to use FreeTable(). |
- Returns
- The array of N-gon indices. The size is given by pcnt. The caller owns the pointed array.
Use the modeling library FreeTable() function to free the data afterwards if clone was true.
◆ GetNeighborNgons()
Retrieves the N-gons that neighbour the N-gon at index.
- Parameters
-
[in] | op | An initialized object. The caller owns the pointed object. |
[in] | index | The index of the N-gon to check. Can be an old index (positive) or a virtual index (negative). |
[out] | pcnt | Assigned the number of N-gons found. |
- Returns
- The array of N-gon indices. The size is given by pcnt. The caller owns the pointed array.
Use the modeling library FreeTable() function to free the data afterwards.
◆ GetPointEdges()
Retrieves all the edges that use the point p.
- Parameters
-
[in] | op | An initialized object. The caller owns the pointed object. |
[in] | p | The index of the point to check. Can be an old index (positive) or a virtual index (negative). |
[in] | ecnt | Assigned the number of edges found. |
- Returns
- The array of edge indices. The size is given by ecnt.
◆ FindNgon()
Finds any N-gon with the edge p1 to p2.
- Parameters
-
[in] | op | An initialized object. The caller owns the pointed object. |
[in] | p1 | The index of the first point of the edge to search for. Can be an old index (positive) or a virtual index (negative). |
[in] | p2 | The index of the second point of the edge to search for. Can be an old index (positive) or a virtual index (negative). |
[out] | index | Assigned the index of the found N-gon. |
- Returns
- true if the N-gon was found, otherwise false.
◆ GetEdgeSegment()
◆ GetOriginalEdgePoints()
Gets the original points from edge.
- Parameters
-
[in] | op | An initialized object. The caller owns the pointed object. |
[in] | edge | The index of the edge to get the points for. Can be an old index (positive) or a virtual index (negative). |
[out] | p1 | Assigned the index of the first point of the edge. |
[out] | p2 | Assigned the index of the second point of the edge. |
- Returns
- true if successful, otherwise false.
◆ IsEdgeDeleted()
Checks if the edge between p1 and p2 has been deleted.
- Parameters
-
[in] | op | An initialized object. The caller owns the pointed object. |
[in] | p1 | The index of the first point of the edge to check. Can be an old index (positive) or a virtual index (negative). |
[in] | p2 | The index of the second point of the edge to check. Can be an old index (positive) or a virtual index (negative). |
- Returns
- true if successful, otherwise false.
◆ IsPointDeleted()
Checks if the point at index has been deleted.
- Parameters
-
[in] | op | An initialized object. The caller owns the pointed object. |
[in] | index | The index of the point to check. Can be an old index (positive) or a virtual index (negative). |
- Returns
- true if the point has been deleted, otherwise false.
◆ IsFaceDeleted()
Checks if the N-gon at index has been deleted.
- Parameters
-
[in] | op | An initialized object. The caller owns the pointed object. |
[in] | index | The index of the N-gon to check. Can be an old index (positive) or a virtual index (negative). |
- Returns
- true if the face has been deleted, otherwise false.
◆ TranslateNgonIndex()
Translates an N-gon index. Once an N-gon is accessed then a virtual clone is created for it, using these functions translate between the real index and its virtual index.
- Note
- This is not normally needed, all functions manage translations.
- Parameters
-
[in] | op | An initialized object. The caller owns the pointed object. |
[in] | index | The original N-gon index. |
[in] | tovirtual | If true the conversion is done from real to virtual, otherwise from virtual to real. |
- Returns
- The translated N-gon index.
◆ TranslatePointIndex()
Translates a point index. Once an point is accessed then a virtual clone is created for it, using these functions you can translate between the real index and its virtual index.
- Parameters
-
[in] | op | An initialized object. The caller owns the pointed object. |
[in] | index | The original point index. |
[in] | tovirtual | If true the conversion is done from real to virtual, otherwise from virtual to real. |
- Returns
- The translated point index.
◆ GetFaceSelection()
Converts a regular selection of polygons into the indices [polygons][ngons]
used within the modeling kernel.
- Note
- This is not normally needed, all functions manage translations.
- Parameters
-
[in] | op | An initialized object. The caller owns the pointed object. |
[in] | select | A regular polygon selection. The caller owns the pointed selection. |
[out] | faceselect | Filled with the translated polygon selection. The caller owns the pointed selection. |
[out] | hidden | Optionally filled with the hidden selection. The caller owns the pointed selection. |
- Returns
- true if successful, otherwise false.
◆ GetEdgeSelection()
Converts a regular selection of edges into the indices used within the modeling kernel.
- Parameters
-
[in] | op | An initialized object. The caller owns the pointed object. |
[in] | select | A regular edge selection. The caller owns the pointed selection. |
[out] | edgeselect | Filled with the translated edge selection. The caller owns the pointed selection. |
[out] | hidden | Optionally filled with the hidden selection. The caller owns the pointed selection. |
- Returns
- true if successful, otherwise false.
◆ GetEdgeSelectionArray()
Converts a regular selection of edges into an array of the indices used within the modeling kernel.
- Parameters
-
[in] | op | An initialized object. The caller owns the pointed object. |
[in] | select | A regular edge selection. The caller owns the pointed selection. |
[out] | ecnt | Assigned the size of the returned edge index array. |
[out] | hidden | Optionally filled with the hidden selection. The caller owns the pointed selection. |
[in] | tovirtual | If true conversion is done from real to virtual, otherwise from virtual to real. |
- Returns
- The array of edge indices. The size is given by ecnt. The caller owns the pointed array.
Use the modeling library FreeTable() function to free the data afterwards.
◆ GetLastError()
Retrieves the last error code from the modeling engine.
- Parameters
-
[in] | op | An initialized object. The caller owns the pointed object. |
- Returns
- The error code: MODELING_ERROR
◆ IsModified()
Checks if any editing has been done to the object (virtually).
- Parameters
-
[in] | op | An initialized object. The caller owns the pointed object. |
- Returns
- true if op is modified, otherwise false.
◆ FreeTable()
void FreeTable |
( |
C4DAtom * |
op, |
|
|
void * |
table |
|
) |
| |
Frees tables created by the modeling engine.
- Parameters
-
[in] | op | An initialized object. The caller owns the pointed object. |
[out] | table | The table to free. |
◆ PointInFace() [1/2]
Check if the point at p is within the boundaries of the N-gon at index.
- Parameters
-
[in] | op | An initialized object. The caller owns the pointed object. |
[in] | index | The index of the point to check. Can be an old index (positive) or a virtual index (negative). |
[in] | p | The point position. |
- Returns
- true if p is in the N-gon, otherwise false.
◆ PointInFace() [2/2]
Check if the point at p is within the boundaries of the N-gon in ngon.
- Parameters
-
[in] | op | An initialized object. The caller owns the pointed object. |
[in] | ngon | The N-gon to check. |
[in] | p | The point position. |
- Returns
- true if p is in the N-gon, otherwise false.
◆ LineFaceIntersection() [1/2]
Checks if the line from p1 to p2 intersects the N-gon at index.
- Parameters
-
[in] | op | An initialized object. The caller owns the pointed object. |
[in] | index | The index of the N-gon to check. Can be an old index (positive) or a virtual index (negative). |
[in] | p1 | The first point of the line. |
[in] | p2 | The second point of the line. |
- Returns
- true if the line intersects the face at index, otherwise false.
◆ LineFaceIntersection() [2/2]
Check if the line from p1 to p2 intersects the N-gon in ngon.
- Parameters
-
[in] | op | An initialized object. The caller owns the pointed object. |
[in] | ngon | The N-gon to check. |
[in] | p1 | The first point of the line. |
[in] | p2 | The second point of the line. |
- Returns
- true if the line intersects the face in ngon, otherwise false.
◆ SetTriangulateHook()
Sets a triangulation function to be used instead of the internal one.
- Parameters
-
[in] | op | An initialized object. The caller owns the pointed object. |
[in] | pHook | The new triangulation hook. |
[in] | pData | The private data, passed to the hook. |
◆ GetTriangulateHook()
Gets the current custom triangulation hook.
- Parameters
-
[in] | op | An initialized object. The caller owns the pointed object. |
[out] | ppHook | Assigned the triangulation hook. |
[out] | ppData | Assigned the hook private data. |
◆ m_pBase
◆ m_pKernelCache
ModelingKernel* m_pKernelCache |
|
private |
◆ m_pObjectCache