Modeling Class Reference Library » 建模

#include <lib_modeling.h>

详细描述

建模 engine.

私有成员函数

  建模 ()
  ~Modeling ()

Private Attributes

ModelingBase *  m_pBase
ModelingKernel *  m_pKernelCache
C4DAtom m_pObjectCache

Alloc/Free

static 建模 Alloc ()
static void  Free ( 建模 *&p)

Init/Commit/Release

Bool   InitArray ( AtomArray *objs, Int32 flags=0)
Bool   InitObject ( C4DAtom *op, Int32 flags=0)
Bool   Commit ( C4DAtom *op=nullptr, Int32 flags=0, BaseObject *cobj=nullptr)
void  发行 ()
void  ReleaseObject ( C4DAtom *op)

Map

Bool   GetPointMap ( C4DAtom *op, Int32 **map, Int32 *count)
Bool   GetNgonMap ( C4DAtom *op, Int32 **map, Int32 *count)
Bool   ReleaseMap ( C4DAtom *op, Int32 *map)
Bool   FreeMap ( C4DAtom *op, Int32 *map)

Point

Int32   AddPoint ( C4DAtom *op, const 向量 &p)
Int32   ClonePoint ( C4DAtom *op, Int32 index)
Bool   DeletePoint ( C4DAtom *op, Int32 index)
Bool   GetPoint ( C4DAtom *op, Int32 index, 向量 *p)
Bool   SetPoint ( C4DAtom *op, Int32 index, const 向量 &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, 向量 &opnt)
Bool   SetPointOrigin ( C4DAtom *op, Int32 index, 向量 opnt, Int32 flags)
Bool   SetInterPoint ( C4DAtom *op, Int32 index, 向量 npnt, Float t, Int32 flags=0)
Bool   SetInterPoint ( C4DAtom *op, Int32 index, const 向量 &move, const 向量 &offset, Int32 flags=0)

Polygon/Ngon

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, 向量 *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)

Operations

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)

Information

Int32   GetLastError ( C4DAtom *op)
Bool   IsModified ( C4DAtom *op)

Free Table

void  FreeTable ( C4DAtom *op, void *table)

Helpers

Bool   PointInFace ( C4DAtom *op, Int32 index, const 向量 &p)
Bool   PointInFace ( C4DAtom *op, const Ngon &ngon, const 向量 &p)
Bool   LineFaceIntersection ( C4DAtom *op, Int32 index, const 向量 &p1, const 向量 &p2)
Bool   LineFaceIntersection ( C4DAtom *op, const Ngon &ngon, const 向量 &p1, const 向量 &p2)

Triangulate Hook

void  SetTriangulateHook ( C4DAtom *op, TriangulateHook pHook, void *pData)
void  GetTriangulateHook ( C4DAtom *op, TriangulateHook *ppHook, void **ppData)

构造函数 & 析构函数文档编制

◆  Modeling()

建模 () private

◆  ~Modeling()

~ 建模 () private

成员函数文档编制

◆  Alloc()

static 建模 * Alloc ( )
static

Allocates a modeling engine. Destroy the allocated modeling engine with Free() 。使用 AutoAlloc to automate the allocation and destruction based on scope.

返回
The allocated modeling engine, or nullptr if the allocation failed.

◆  Free()

static void Free ( 建模 *&  p )
static

Destructs modeling engines allocated with Alloc() 。使用 AutoAlloc to automate the allocation and destruction based on scope.

参数
[in,out] p The modeling engine to destruct. If the pointer is nullptr nothing happens. The pointer is assigned nullptr afterwards.

◆  InitArray()

Bool InitArray ( AtomArray objs ,
Int32   flags = 0  
)

Initializes the modeling engine with the objects in objs .

参数
[in] objs An atom array with the objects to perform the modeling on. The caller owns the pointed objects array.
[in] flags Not used.
返回
true if successful, otherwise false .

◆  InitObject()

Bool InitObject ( C4DAtom op ,
Int32   flags = 0  
)

Initialize the modeling engine with the object op .

参数
[in] op The object to perform the modeling on. The caller owns the pointed object.
[in] flags Not used.
返回
true if successful, otherwise false .

◆  Commit()

Bool Commit ( C4DAtom op = nullptr ,
Int32   flags = 0 ,
BaseObject cobj = nullptr  
)

Commits the modeling transformation.

参数
[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.
设置 cobj is only valid when committing a single object. The object must match the original.
返回
true if successful, otherwise false .

◆  Release()

void Release ( )

Frees all data for all initialized objects.

◆  ReleaseObject()

void ReleaseObject ( C4DAtom op )

Frees the data for op .

参数
[in] op An initialized object. The caller owns the pointed object.

◆  GetPointMap()

Bool GetPointMap ( C4DAtom op ,
Int32 **  map ,
Int32 count  
)

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] ,其中 n goes from 0 to count - 1 .

注意
Set MODELING_COMMIT_CREATEMAP flag in Modeling::Commit() for this function to work.
参数
[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 .
返回
true if successful, otherwise false .

◆  GetNgonMap()

Bool GetNgonMap ( C4DAtom op ,
Int32 **  map ,
Int32 count  
)

Not implemented.

◆  ReleaseMap()

Bool ReleaseMap ( C4DAtom op ,
Int32 map  
)

Call this function to keep the table map for later use. When finished use FreeMap() .

注意
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.
参数
[in] op An initialized object. The caller owns the pointed object.
[out] map The map pointer to release.
返回
true if successful, otherwise false .

◆  FreeMap()

Bool FreeMap ( C4DAtom op ,
Int32 map  
)

Frees a map table released by ReleaseMap() .

参数
[in] op An initialized object. The caller owns the pointed object.
[out] map The map pointer to free.
返回
true if successful, otherwise false .

◆  AddPoint()

Int32 AddPoint ( C4DAtom op ,
const 向量 p  
)

Adds a new point to the object.

参数
[in] op An initialized object. The caller owns the pointed object.
[in] p The position of the point to add.
返回
The virtual index of the added point, or 0 if an error occurred.

◆  ClonePoint()

Int32 ClonePoint ( C4DAtom op ,
Int32   index  
)

Clones the point at index .

参数
[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).
返回
The virtual index of the new point, or 0 if an error occurred.

◆  DeletePoint()

Bool DeletePoint ( C4DAtom op ,
Int32   index  
)

Deletes the point at index .

参数
[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).
返回
true if successful, otherwise false .

◆  GetPoint()

Bool GetPoint ( C4DAtom op ,
Int32   index ,
向量 p  
)

Retrieves the position vector for a point at index in p .

参数
[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.
返回
true if successful, otherwise false .

◆  SetPoint()

Bool SetPoint ( C4DAtom op ,
Int32   index ,
const 向量 p ,
Int32   flags = 0  
)

Sets the position vector for a point at index to p .

参数
[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
返回
true if successful, otherwise false .

◆  SetEdgePoint()

Bool SetEdgePoint ( C4DAtom op ,
Int32   index ,
Float   l ,
Int32   flags = 0  
)

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 .

参数
[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
返回
true if successful, otherwise false .

◆  SetPoints()

Bool SetPoints ( C4DAtom op ,
PointMove pnts ,
Int32   cnt ,
Bool   commit = false ,
Int32   flags = 0  
)

Sets many points in one call using an array of PointMove .

参数
[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 true the move triggers a Commit() .
[in] flags The flags: MODELING_SETPOINT_FLAG
返回
true if successful, otherwise false .

◆  GetPointInfo()

Bool GetPointInfo ( C4DAtom op ,
Int32   index ,
Int32 ia ,
Int32 ib ,
Float t  
)

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 .

参数
[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.
返回
true if successful, otherwise false .

◆  GetOriginPoint()

Bool GetOriginPoint ( C4DAtom op ,
Int32   index ,
Int32 ci  
)

Retrieves the original point for a cloned point.

参数
[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.
返回
true if successful, otherwise false .

◆  SetPointInfo()

Bool SetPointInfo ( C4DAtom op ,
Int32   index ,
Int32   ia ,
Int32   ib ,
Float   t  
)

Sets the edge/clone information for a point. For a clone ia == ib and t is 0 .

参数
[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.
返回
true if successful, otherwise false .

◆  SetOriginPoint()

Bool SetOriginPoint ( C4DAtom op ,
Int32   index ,
Int32   ci  
)

Sets the original index for a point, making it a clone of that point.

参数
[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).
返回
true if successful, otherwise false .

◆  GetPointFlags()

Int32 GetPointFlags ( C4DAtom op ,
Int32   index  
)

Gets the flags for a point.

参数
[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).
返回
The point flags: MODELING_SETPOINT_FLAG

◆  SetPointFlags()

Int32 SetPointFlags ( C4DAtom op ,
Int32   index ,
Int32   flags  
)

Sets the flags for a point.

参数
[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
返回
The old point flags.

◆  GetPointOrigin()

Bool GetPointOrigin ( C4DAtom op ,
Int32   index ,
向量 opnt  
)

Gets the original position of a cloned point.

参数
[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.
返回
true if successful, otherwise false .

◆  SetPointOrigin()

Bool SetPointOrigin ( C4DAtom op ,
Int32   index ,
向量   opnt ,
Int32   flags  
)

Sets the original position of a cloned point.

参数
[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
返回
true if successful, otherwise false .

◆  SetInterPoint() [1/2]

Bool SetInterPoint ( C4DAtom op ,
Int32   index ,
向量   npnt ,
Float   t ,
Int32   flags = 0  
)

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.

参数
[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
返回
true if successful, otherwise false .

◆  SetInterPoint() [2/2]

Bool SetInterPoint ( C4DAtom op ,
Int32   index ,
const 向量 move ,
const 向量 offset ,
Int32   flags = 0  
)

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.

参数
[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
返回
true if successful, otherwise false .

◆  NewNgon()

Int32 NewNgon ( C4DAtom op ,
Int32   flags = 0  
)

Creates an empty N-gon.

参数
[in] op An initialized object. The caller owns the pointed object.
[in] flags The flags: MODELING_SETNGON_FLAG
返回
The virtual index of the new N-gon, or 0 if an error occurred.

◆  AddNgon()

Int32 AddNgon ( C4DAtom op ,
const Ngon ngon ,
Int32   flags = 0  
)

Creates an N-gon based on the passed Ngon data.

参数
[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
返回
true if successful, otherwise false .

◆  CreateNgon()

Int32 CreateNgon ( C4DAtom op ,
Int32 padr ,
Int32   cnt ,
Int32   flags = 0  
)

Creates an N-gon based on an array of point indices in padr .

参数
[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
返回
true if successful, otherwise false .

◆  DeleteNgon()

Bool DeleteNgon ( C4DAtom op ,
Int32   index ,
Bool   points  
)

Removes an N-gon.

参数
[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 true the points of the N-gon are checked and removed if they are not used by other N-gons.
返回
true if successful, otherwise false .

◆  CloneNgon()

Int32 CloneNgon ( C4DAtom op ,
Int32   index ,
Int32   flags = 0  
)

Create an N-gon based on another N-gon at index .

参数
[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
返回
The virtual index of the new N-gon, or 0 if an error occurred.

◆  GetNgon()

Bool GetNgon ( C4DAtom op ,
Int32   index ,
Ngon ngon ,
Int32   flags = 0  
)

Retrieves an N-gon.

参数
[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
返回
true if successful, otherwise false .

◆  SetNgon()

Bool SetNgon ( C4DAtom op ,
Int32   index ,
Ngon ngon ,
Int32   flags = 0  
)

Sets an N-gon.

参数
[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
返回
true if successful, otherwise false .

◆  GetNgonNormal()

Bool GetNgonNormal ( C4DAtom op ,
Int32   index ,
向量 n  
)

Calculates the normal for an N-gon.

参数
[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.
返回
true if successful, otherwise false .

◆  FlipNgonNormal()

Bool FlipNgonNormal ( C4DAtom op ,
Int32   index  
)

Reverses the normal of an N-gon.

参数
[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).
返回
true if successful, otherwise false .

◆  GetOriginNgon()

Bool GetOriginNgon ( C4DAtom op ,
Int32   index ,
Int32 ci  
)

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.

参数
[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.
返回
true if successful, otherwise false .

◆  SetOriginNgon()

Bool SetOriginNgon ( C4DAtom op ,
Int32   index ,
Int32   ci  
)

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.

参数
[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.
返回
true if successful, otherwise false .

◆  GetNgonFlags()

Int32 GetNgonFlags ( C4DAtom op ,
Int32   index  
)

Gets the flags for an N-gon.

参数
[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).
返回
The flags: MODELING_SETNGON_FLAG

◆  SetNgonFlags()

Int32 SetNgonFlags ( C4DAtom op ,
Int32   index ,
Int32   flags  
)

Sets the flags for an N-gon.

参数
[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
返回
The old flags.

◆  ResizeNgon()

Bool ResizeNgon ( C4DAtom op ,
Int32   index ,
Int32   pcnt ,
Int32   scnt  
)

Private .

◆  WeldPoints()

Bool WeldPoints ( C4DAtom op ,
Int32   source ,
Int32   dest  
)

Welds the source point index to dest .

参数
[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).
返回
true if successful, otherwise false .

◆  InsertFacePoint()

Bool InsertFacePoint ( C4DAtom op ,
Int32   pa ,
Int32   p1  
)

Private .

◆  CreateHole() [1/2]

Bool CreateHole ( C4DAtom op ,
Int32   index ,
const Ngon ngon  
)

Adds the hole in ngon into the N-gon at index .

参数
[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.
返回
true if successful, otherwise false .

◆  CreateHole() [2/2]

Bool CreateHole ( C4DAtom op ,
Int32   index ,
Int32 pnts ,
Int32   pcnt  
)

Adds the hole with points in pnts into the N-gon at index .

参数
[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.
返回
true if successful, otherwise false .

◆  SplitEdge()

Int32 SplitEdge ( C4DAtom op ,
Int32   p1 ,
Int32   p2 ,
Float   l  
)

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.

参数
[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 .
返回
The virtual index of the new edge point, or 0 if an error occurred.

◆  DeleteEdge()

Bool DeleteEdge ( C4DAtom op ,
Int32   index ,
Int32   p1 ,
Int32   p2  
)

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.

参数
[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).
返回
true if successful, otherwise false .

◆  MeltEdgeBetween()

Bool MeltEdgeBetween ( C4DAtom op ,
Int32   pa ,
Int32   pb ,
Int32   p1 ,
Int32   p2  
)

Melts an edge between the 2 n-gons at pa and pb . The edge is defined by the points p1 and p2 .

参数
[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).
返回
true if successful, otherwise false .

◆  MeltEdge()

Bool MeltEdge ( C4DAtom op ,
Int32   pa ,
Int32   p1 ,
Int32   p2  
)

Melt the edge ( p1 to p2 ) of N-gon pa .

注意
MeltEdge() accepts NOTINDEX for the N-gon index pa , in which case it takes the first index for the edge it finds.
参数
[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).
返回
true if successful, otherwise false .

◆  MeltPoint()

Bool MeltPoint ( C4DAtom op ,
Int32   p  
)

Melts the N-gons around point p .

参数
[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).
返回
true if successful, otherwise false .

◆  MeltNgon()

Bool MeltNgon ( C4DAtom op ,
Int32   pa  
)

Melts the N-gon pa into its surrounding N-gons.

参数
[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).
返回
true if successful, otherwise false .

◆  SplitPolygon()

Int32 SplitPolygon ( C4DAtom op ,
Int32   index ,
Int32   p1 ,
Int32   p2  
)

Cuts the N-gon at index between points p1 and p2 , returning the newly created N-gon index.

参数
[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).
返回
The newly created N-gon index or the passed index for no change, otherwise NOTINDEX for fail.

◆  MergePolygons()

Bool MergePolygons ( C4DAtom op ,
Int32   pa ,
Int32   pb  
)

Merges the points of pb into pa making them into holes of pa .

参数
[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).
返回
true if successful, otherwise false .

◆  IsValidEdge()

Bool IsValidEdge ( C4DAtom op ,
Int32   index ,
Int32   p1 ,
Int32   p2  
)

Checks if the edge ( p1 to p2 ) of the N-gon at index is valid (exists).

参数
[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).
返回
true if the edge is valid, otherwise false .

◆  IsValidNgon()

Bool IsValidNgon ( C4DAtom op ,
Int32   index  
)

Check if the N-gon at index is valid (exists).

参数
[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).
返回
true if the N-gon is valid, otherwise false .

◆  IsValidPoint()

Bool IsValidPoint ( C4DAtom op ,
Int32   index  
)

Check if the point at index exists.

参数
[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).
返回
true if the point is valid, otherwise false .

◆  GetEdgeNgons()

Int32 * GetEdgeNgons ( C4DAtom op ,
Int32   p1 ,
Int32   p2 ,
Int32 pcnt  
)

Retrieves an array with the N-gons that share the edge between p1 and p2 .

参数
[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.
返回
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()

Int32 * GetPointNgons ( C4DAtom op ,
Int32   p ,
Int32 pcnt ,
Bool   clone = true  
)

Retrieves a table of the N-gons that share the point at p .

参数
[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 false a pointer to an internal array is returned. Then it is not need to use FreeTable() .
返回
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()

Int32 * GetNeighborNgons ( C4DAtom op ,
Int32   index ,
Int32 pcnt  
)

Retrieves the N-gons that neighbour the N-gon at index.

参数
[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.
返回
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()

Int32 * GetPointEdges ( C4DAtom op ,
Int32   p ,
Int32 ecnt  
)

Retrieves all the edges that use the point p .

参数
[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.
返回
The array of edge indices. The size is given by ecnt .

◆  FindNgon()

Bool FindNgon ( C4DAtom op ,
Int32   p1 ,
Int32   p2 ,
Int32 index  
)

Finds any N-gon with the edge p1 to p2 .

参数
[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.
返回
true if the N-gon was found, otherwise false .

◆  GetEdgeSegment()

Bool GetEdgeSegment ( C4DAtom op ,
Int32   pa ,
Int32   p1 ,
Int32   p2 ,
Int32 seg ,
Int32 s1 ,
Int32 s2 ,
Bool   rel  
)

Private .

◆  GetOriginalEdgePoints()

Bool GetOriginalEdgePoints ( C4DAtom op ,
Int32   edge ,
Int32 p1 ,
Int32 p2  
)

Gets the original points from edge .

参数
[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.
返回
true if successful, otherwise false .

◆  IsEdgeDeleted()

Bool IsEdgeDeleted ( C4DAtom op ,
Int32   p1 ,
Int32   p2  
)

Checks if the edge between p1 and p2 has been deleted.

参数
[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).
返回
true if successful, otherwise false .

◆  IsPointDeleted()

Bool IsPointDeleted ( C4DAtom op ,
Int32   index  
)

Checks if the point at index has been deleted.

参数
[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).
返回
true if the point has been deleted, otherwise false .

◆  IsFaceDeleted()

Bool IsFaceDeleted ( C4DAtom op ,
Int32   index  
)

Checks if the N-gon at index has been deleted.

参数
[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).
返回
true if the face has been deleted, otherwise false .

◆  TranslateNgonIndex()

Int32 TranslateNgonIndex ( C4DAtom op ,
Int32   index ,
Bool   tovirtual = false  
)

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.

注意
This is not normally needed, all functions manage translations.
参数
[in] op An initialized object. The caller owns the pointed object.
[in] index The original N-gon index.
[in] tovirtual true the conversion is done from real to virtual, otherwise from virtual to real.
返回
The translated N-gon index.

◆  TranslatePointIndex()

Int32 TranslatePointIndex ( C4DAtom op ,
Int32   index ,
Bool   tovirtual = false  
)

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.

参数
[in] op An initialized object. The caller owns the pointed object.
[in] index The original point index.
[in] tovirtual true the conversion is done from real to virtual, otherwise from virtual to real.
返回
The translated point index.

◆  GetFaceSelection()

Bool GetFaceSelection ( C4DAtom op ,
BaseSelect select ,
BaseSelect faceselect ,
BaseSelect hidden = nullptr  
)

Converts a regular selection of polygons into the indices [polygons][ngons] used within the modeling kernel.

注意
This is not normally needed, all functions manage translations.
参数
[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.
返回
true if successful, otherwise false .

◆  GetEdgeSelection()

Bool GetEdgeSelection ( C4DAtom op ,
BaseSelect select ,
BaseSelect edgeselect ,
BaseSelect hidden = nullptr  
)

Converts a regular selection of edges into the indices used within the modeling kernel.

参数
[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.
返回
true if successful, otherwise false .

◆  GetEdgeSelectionArray()

Int32 * GetEdgeSelectionArray ( C4DAtom op ,
BaseSelect select ,
Int32 ecnt ,
BaseSelect hidden = nullptr ,
Bool   tovirtual = true  
)

Converts a regular selection of edges into an array of the indices used within the modeling kernel.

参数
[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 true conversion is done from real to virtual, otherwise from virtual to real.
返回
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()

Int32 GetLastError ( C4DAtom op )

Retrieves the last error code from the modeling engine.

参数
[in] op An initialized object. The caller owns the pointed object.
返回
The error code: MODELING_ERROR

◆  IsModified()

Bool IsModified ( C4DAtom op )

Checks if any editing has been done to the object (virtually).

参数
[in] op An initialized object. The caller owns the pointed object.
返回
true if op is modified, otherwise false .

◆  FreeTable()

void FreeTable ( C4DAtom op ,
void *  table  
)

Frees tables created by the modeling engine.

参数
[in] op An initialized object. The caller owns the pointed object.
[out] table The table to free.

◆  PointInFace() [1/2]

Bool PointInFace ( C4DAtom op ,
Int32   index ,
const 向量 p  
)

Check if the point at p is within the boundaries of the N-gon at index .

参数
[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.
返回
true if p is in the N-gon, otherwise false .

◆  PointInFace() [2/2]

Bool PointInFace ( C4DAtom op ,
const Ngon ngon ,
const 向量 p  
)

Check if the point at p is within the boundaries of the N-gon in ngon .

参数
[in] op An initialized object. The caller owns the pointed object.
[in] ngon The N-gon to check.
[in] p The point position.
返回
true if p is in the N-gon, otherwise false .

◆  LineFaceIntersection() [1/2]

Bool LineFaceIntersection ( C4DAtom op ,
Int32   index ,
const 向量 p1 ,
const 向量 p2  
)

Checks if the line from p1 to p2 intersects the N-gon at index .

参数
[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.
返回
true if the line intersects the face at index , otherwise false .

◆  LineFaceIntersection() [2/2]

Bool LineFaceIntersection ( C4DAtom op ,
const Ngon ngon ,
const 向量 p1 ,
const 向量 p2  
)

Check if the line from p1 to p2 intersects the N-gon in ngon .

参数
[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.
返回
true if the line intersects the face in ngon , otherwise false .

◆  SetTriangulateHook()

void SetTriangulateHook ( C4DAtom op ,
TriangulateHook   pHook ,
void *  pData  
)

Sets a triangulation function to be used instead of the internal one.

参数
[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()

void GetTriangulateHook ( C4DAtom op ,
TriangulateHook ppHook ,
void **  ppData  
)

Gets the current custom triangulation hook.

参数
[in] op An initialized object. The caller owns the pointed object.
[out] ppHook Assigned the triangulation hook.
[out] ppData Assigned the hook private data.

Member Data Documentation

◆  m_pBase

ModelingBase* m_pBase private

◆  m_pKernelCache

ModelingKernel* m_pKernelCache private

◆  m_pObjectCache

C4DAtom * m_pObjectCache
private