/////////////////////////////////////////////////////////////
// CINEMA 4D SDK                                           //
/////////////////////////////////////////////////////////////
// (c) MAXON Computer GmbH, all rights reserved            //
/////////////////////////////////////////////////////////////

#ifndef _LIB_MODELLING_H_
#define _LIB_MODELLING_H_

#include "c4d_library.h"
#include "c4d_memory.h"

class iModeling;
class ModelingBase;
class ModelingKernel;
class Ngon;

//////////////////////////////////////////////////////////////////////////

#ifndef NOTINDEX
#define NOTINDEX				(MAXLONGl)
#endif

struct PointMove
{
	PointMove(LONG index) { i=index; }

	LONG	i;
	Vector	p;
};

#define TRANSMAP_FLAG_NEW		(1<<0)
#define TRANSMAP_FLAG_CLONE		(1<<1)
#define TRANSMAP_FLAG_MOVED		(1<<2)
#define TRANSMAP_FLAG_DELETED	(1<<3)
#define TRANSMAP_FLAG_UNION		(1<<4)

#define TRANSMAP_PNTFLAG_INTER	(1<<20)
#define TRANSMAP_PNTFLAG_DELTA	(1<<21)
#define TRANSMAP_PNTFLAG_WELDED	(1<<22)

#define TRANSMAP_PLYFLAG_MELTED	(1<<20)
#define TRANSMAP_PLYFLAG_PGON	(1<<21)

struct TransIndexMapData
{
	TransIndexMapData(LONG oindex) { oIndex=oindex; }
	TransIndexMapData(LONG oindex, LONG nindex) { oIndex=oindex; nIndex=nindex; }

	LONG oIndex;
	LONG nIndex;
};

struct TransMapData : TransIndexMapData
{
	TransMapData(LONG oindex) : TransIndexMapData(oindex) { }
	TransMapData(LONG oindex, LONG nindex) : TransIndexMapData(oindex,nindex)  { }

	LONG lFlags;
	LONG mIndex;
};

struct TransMapNewData
{
	TransMapNewData(LONG nindex) { nIndex=nindex; }

	LONG nIndex;
	LONG mIndex;
};

struct TransPointInterData
{
	LONG p1;
	LONG p2;
	Real t;
};

struct TransPointDeltaData
{
	Vector opnt;
	Vector dlt;
};

class TranslationMaps
{
public:
	TranslationMaps(void)
	{
		ClearMem(this, sizeof(TranslationMaps), 0);
	}

	LONG FindOriginalPoint(LONG index);
	LONG FindOriginalPolygon(LONG index);
	LONG FindOriginalPgon(LONG index);
	LONG FindOriginalSegment(LONG index);

	LONG FindNewPoint(LONG index);
	LONG FindNewPolygon(LONG index);
	LONG FindNewPgon(LONG index);
	LONG FindNewSegment(LONG index);

	LONG FindWeldPoint(LONG index);
	LONG FindMeltPolygon(LONG index);

	//////////////////////////////////////////////////////////////////////////

	LONG m_oPointCount;
	LONG m_oPolygonCount;
	LONG m_oPgonCount;
	LONG m_oSegmentCount;

	LONG m_nPointCount;
	LONG m_nPolygonCount;
	LONG m_nPgonCount;
	LONG m_nSegmentCount;

	LONG m_mPointCount;
	LONG m_mPolygonCount;
	LONG m_mPgonCount;
	LONG m_mSegmentCount;

	LONG m_mWeldCount;
	LONG m_mMeltCount;

	//////////////////////////////////////////////////////////////////////////

	TransMapData		*m_pPointMap;
	TransMapData		*m_pPolygonMap;
	TransMapData		*m_pPgonMap;
	TransMapData		*m_pSegmentMap;

	TransIndexMapData	*m_pWeldMap;
	TransIndexMapData	*m_pMeltMap;

	TransMapNewData		*m_pNewPointMap;
	TransMapNewData		*m_pNewPolygonMap;
	TransMapNewData		*m_pNewPgonMap;
	TransMapNewData		*m_pNewSegmentMap;

	TransPointInterData *m_pInterpolatedPoints;
	TransPointDeltaData	*m_pDeltaPoints;
};

//////////////////////////////////////////////////////////////////////////

#define	MODELING_ERROR_UNKNOWN			(-1)
#define	MODELING_ERROR_NONE				(0)
#define	MODELING_ERROR_FAILED			(1)
#define	MODELING_ERROR_NOMEMORY			(2)
#define	MODELING_ERROR_NOTFOUND			(3)
#define	MODELING_ERROR_INVALIDOP		(4)
#define	MODELING_ERROR_FATAL			(5)
#define	MODELING_ERROR_INVALIDOBJECT	(6)
#define	MODELING_ERROR_ILLEGAL			(7)
#define	MODELING_ERROR_TRIANGULATION	(8)
#define	MODELING_ERROR_INVALIDKERNEL	(9)
#define	MODELING_ERROR_INTERNAL			(10)
#define	MODELING_ERROR_BADARGS			(11)
#define	MODELING_ERROR_CORRUPTOBJECT	(12)
#define	MODELING_ERROR_MSGFAIL			(13)

#define MODELING_COMMIT_NONE		0
#define MODELING_COMMIT_UPDATE		1
#define MODELING_COMMIT_CREATEMAP	2
#define MODELING_COMMIT_REFRESH		4
#define MODELING_COMMIT_TRINGONS	8
#define MODELING_COMMIT_RESTORE		16
#define MODELING_COMMIT_ADDUNDO		32
#define MODELING_COMMIT_QUADS		64
#define MODELING_COMMIT_NOVALIDATION	128
#define MODELING_COMMIT_QUADLIMIT		256
#define MODELING_COMMIT_NO_NGONS  (MODELING_COMMIT_TRINGONS | MODELING_COMMIT_QUADS)

#define MODELING_SETPOINT_FLAG_EMPTY	0
#define MODELING_SETPOINT_FLAG_NODIRTY	1
#define MODELING_SETPOINT_FLAG_UNION	2

#define MODELING_SETNGON_FLAG_EMPTY			0
#define MODELING_SETNGON_FLAG_TRIANGULATE	1
#define MODELING_SETNGON_FLAG_FIXEDQUADS	2
#define MODELING_SETNGON_FLAG_NGONQUADS		4
#define MODELING_SETNGON_FLAG_QUADS			8
#define MODELING_SETNGON_FLAG_UNION			16
#define MODELING_SETNGON_FLAG_NOROTATE		32

#define MODELING_GETNGON_FLAG_EMPTY			0
#define MODELING_GETNGON_FLAG_READONLY		1

//////////////////////////////////////////////////////////////////////////

struct CPolygon;

typedef Bool (*TriangulateHook)(BaseObject *pObj, LONG lNgonID, Ngon *ngon, const Vector *pvPoints, LONG lPointCount, CPolygon *&pPolys, LONG &lPolyCount, Bool &bTriang, void *pData);

//////////////////////////////////////////////////////////////////////////

class Modeling
{
private:
	Modeling();
	~Modeling();

	ModelingBase	*m_pBase;
	ModelingKernel	*m_pKernelCache;
	C4DAtom			*m_pObjectCache;

public:

	static Modeling *Alloc();
	static void Free(Modeling *&p);

	//////////////////////////////////////////////////////////////////////////

	Bool InitArray(AtomArray *objs, LONG flags=0);
	Bool InitObject(C4DAtom *op, LONG flags=0);
	Bool Commit(C4DAtom *op=NULL, LONG flags=0 , BaseObject* cobj = NULL);
	void Release();
	void ReleaseObject(C4DAtom *op);

	//////////////////////////////////////////////////////////////////////////

	// Maps

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

	// Points

	LONG AddPoint(C4DAtom *op, const Vector &p);
	LONG ClonePoint(C4DAtom *op, LONG index);
	Bool DeletePoint(C4DAtom *op, LONG index);
	Bool GetPoint(C4DAtom *op, LONG index, Vector *p);
	Bool SetPoint(C4DAtom *op, LONG index, const Vector &p, LONG flags=MODELING_SETPOINT_FLAG_EMPTY);
	Bool SetEdgePoint(C4DAtom *op, LONG index, Real l, LONG flags=MODELING_SETPOINT_FLAG_EMPTY);
	Bool SetPoints(C4DAtom *op, PointMove *pnts, LONG cnt, Bool commit=FALSE, LONG flags=MODELING_SETPOINT_FLAG_EMPTY);
	Bool GetPointInfo(C4DAtom *op, LONG index, LONG &ia, LONG &ib, Real &t);
	Bool GetOriginPoint(C4DAtom *op, LONG index, LONG &ci);
	Bool SetPointInfo(C4DAtom *op, LONG index, LONG ia, LONG ib, Real t);
	Bool SetOriginPoint(C4DAtom *op, LONG index, LONG ci);
	LONG GetPointFlags(C4DAtom *op, LONG index);
	LONG SetPointFlags(C4DAtom *op, LONG index, LONG flags);
	Bool GetPointOrigin(C4DAtom *op, LONG index, Vector &opnt);
	Bool SetPointOrigin(C4DAtom *op, LONG index, Vector opnt, LONG flags);
	Bool SetInterPoint(C4DAtom *op, LONG index, Vector npnt, Real t, LONG flags=MODELING_SETPOINT_FLAG_EMPTY);
	Bool SetInterPoint(C4DAtom *op, LONG index, const Vector &move, const Vector &offset, LONG flags=MODELING_SETPOINT_FLAG_EMPTY);

	// Polygon/Ngon

	LONG NewNgon(C4DAtom *op, LONG flags=MODELING_SETNGON_FLAG_EMPTY);
	LONG AddNgon(C4DAtom *op, const Ngon &ngon, LONG flags=MODELING_SETNGON_FLAG_EMPTY);
	LONG CreateNgon(C4DAtom *op, LONG *padr, LONG cnt, LONG flags=MODELING_SETNGON_FLAG_EMPTY);
	Bool DeleteNgon(C4DAtom *op, LONG index, Bool points);
	LONG CloneNgon(C4DAtom *op, LONG index, LONG flags=MODELING_SETNGON_FLAG_EMPTY);
	Bool GetNgon(C4DAtom *op, LONG index, Ngon *ngon, LONG flags=MODELING_GETNGON_FLAG_EMPTY);
	Bool SetNgon(C4DAtom *op, LONG index, Ngon &ngon, LONG flags=MODELING_SETNGON_FLAG_EMPTY);
	Bool GetNgonNormal(C4DAtom *op, LONG index, Vector *n);
	Bool FlipNgonNormal(C4DAtom *op, LONG index);
	Bool GetOriginNgon(C4DAtom *op, LONG index, LONG &ci);
	Bool SetOriginNgon(C4DAtom *op, LONG index, LONG ci);
	LONG GetNgonFlags(C4DAtom *op, LONG index);
	LONG SetNgonFlags(C4DAtom *op, LONG index, LONG flags);
	Bool ResizeNgon(C4DAtom *op, LONG index, LONG pcnt, LONG scnt);

	// Operations

	Bool WeldPoints(C4DAtom *op, LONG source, LONG dest);
	Bool InsertFacePoint(C4DAtom *op, LONG pa, LONG p1);
	Bool CreateHole(C4DAtom *op, LONG index, const Ngon &ngon);
	Bool CreateHole(C4DAtom *op, LONG index, LONG *pnts, LONG pcnt);

	LONG SplitEdge(C4DAtom *op, LONG p1, LONG p2, Real l);
	Bool DeleteEdge(C4DAtom *op, LONG index, LONG p1, LONG p2);

	Bool MeltEdgeBetween(C4DAtom *op, LONG pa, LONG pb, LONG p1, LONG p2);
	Bool MeltEdge(C4DAtom *op, LONG pa, LONG p1, LONG p2);
	Bool MeltPoint(C4DAtom *op, LONG p);
	Bool MeltNgon(C4DAtom *op, LONG pa);

	LONG SplitPolygon(C4DAtom *op, LONG index, LONG p1, LONG p2);
	Bool MergePolygons(C4DAtom *op, LONG pa, LONG pb);

	Bool IsValidEdge(C4DAtom *op, LONG index, LONG p1, LONG p2);
	Bool IsValidNgon(C4DAtom *op, LONG index);
	Bool IsValidPoint(C4DAtom *op, LONG index);

	LONG *GetEdgeNgons(C4DAtom *op, LONG p1, LONG p2, LONG &pcnt);
	LONG *GetPointNgons(C4DAtom *op, LONG p, LONG &pcnt, Bool clone=TRUE);
	LONG *GetNeighborNgons(C4DAtom *op, LONG index, LONG &pcnt);
	LONG *GetPointEdges(C4DAtom *op, LONG p, LONG &ecnt);

	Bool FindNgon(C4DAtom *op, LONG p1, LONG p2, LONG &index);
	Bool GetEdgeSegment(C4DAtom *op, LONG pa, LONG p1, LONG p2, LONG *seg, LONG *s1, LONG *s2, Bool rel);

	Bool GetOriginalEdgePoints(C4DAtom *op, LONG edge, LONG &p1, LONG &p2);

	Bool IsEdgeDeleted(C4DAtom *op, LONG p1, LONG p2);
	Bool IsPointDeleted(C4DAtom *op, LONG index);
	Bool IsFaceDeleted(C4DAtom *op, LONG index);

	LONG TranslateNgonIndex(C4DAtom *op, LONG index, Bool tovirtual=FALSE);
	LONG TranslatePointIndex(C4DAtom *op, LONG index, Bool tovirtual=FALSE);

	Bool GetFaceSelection(C4DAtom *op, BaseSelect *select, BaseSelect *faceselect, BaseSelect *hidden=NULL);
	Bool GetEdgeSelection(C4DAtom *op, BaseSelect *select, BaseSelect *edgeselect, BaseSelect *hidden=NULL);
	LONG *GetEdgeSelectionArray(C4DAtom *op, BaseSelect *select, LONG &ecnt, BaseSelect *hidden=NULL, Bool tovirtual=TRUE);

	// Information

	LONG GetLastError(C4DAtom *op);
	Bool IsModified(C4DAtom *op);

	// Management

	void FreeTable(C4DAtom *op, void *table);

	// Helper

	Bool PointInFace(C4DAtom *op, LONG index, const Vector &p);
	Bool PointInFace(C4DAtom *op, const Ngon &ngon, const Vector &p);
	Bool LineFaceIntersection(C4DAtom *op, LONG index, const Vector &p1, const Vector &p2);
	Bool LineFaceIntersection(C4DAtom *op, const Ngon &ngon, const Vector &p1, const Vector &p2);

	// Hooks

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

// INTERNAL STUFF -- INTERNAL STUFF -- INTERNAL STUFF -- INTERNAL STUFF -- INTERNAL STUFF
// INTERNAL STUFF -- INTERNAL STUFF -- INTERNAL STUFF -- INTERNAL STUFF -- INTERNAL STUFF
// INTERNAL STUFF -- INTERNAL STUFF -- INTERNAL STUFF -- INTERNAL STUFF -- INTERNAL STUFF

//////////////////////////////////////////////////////////////////////////
#define LIBRARY_MODELLING	1015814
//////////////////////////////////////////////////////////////////////////

struct ModelingLib : public C4DLibrary
{
	iModeling *(*Alloc)();
	void (*Free)(iModeling *&p);

	Bool (*InitArray)(iModeling *this_ptr, AtomArray *objs, LONG flags);
	Bool (*InitObject)(iModeling *this_ptr, C4DAtom *op, LONG flags);
	Bool (*Commit)(iModeling *this_ptr, C4DAtom *op, LONG flags, BaseObject* cobj);
	void (*Release)(iModeling *this_ptr);
	void (*ReleaseObject)(iModeling *this_ptr, C4DAtom *op);

	LONG (*AddPoint)(iModeling *this_ptr, C4DAtom *op, const Vector &p);
	LONG (*ClonePoint)(iModeling *this_ptr, C4DAtom *op, LONG index);
	Bool (*DeletePoint)(iModeling *this_ptr, C4DAtom *op, LONG index);
	Bool (*GetPoint)(iModeling *this_ptr, C4DAtom *op, LONG index, Vector *p);
	Bool (*SetPoint)(iModeling *this_ptr, C4DAtom *op, LONG index, const Vector &p, LONG flags);
	Bool (*SetEdgePoint)(iModeling *this_ptr, C4DAtom *op, LONG index, Real l, LONG flags);
	Bool (*SetPoints)(iModeling *this_ptr, C4DAtom *op, PointMove *pnts, LONG cnt, Bool commit, LONG flags);

	LONG (*NewNgon)(iModeling *this_ptr, C4DAtom *op, LONG flags);
	LONG (*AddNgon)(iModeling *this_ptr, C4DAtom *op, const Ngon &ngon, LONG flags);
	LONG (*CreateNgon)(iModeling *this_ptr, C4DAtom *op, LONG *padr, LONG cnt, LONG flags);
	Bool (*DeleteNgon)(iModeling *this_ptr, C4DAtom *op, LONG index, Bool points);
	LONG (*CloneNgon)(iModeling *this_ptr, C4DAtom *op, LONG index, LONG flags);
	Bool (*GetNgon)(iModeling *this_ptr, C4DAtom *op, LONG index, Ngon *ngon, LONG flags);
	Bool (*SetNgon)(iModeling *this_ptr, C4DAtom *op, LONG index, Ngon &ngon, LONG flags);
	Bool (*GetNgonNormal)(iModeling *this_ptr, C4DAtom *op, LONG index, Vector *n);
	Bool (*FlipNgonNormal)(iModeling *this_ptr, C4DAtom *op, LONG index);

	LONG (*SplitEdge)(iModeling *this_ptr, C4DAtom *op, LONG p1, LONG p2, Real l);
	Bool (*DeleteEdge)(iModeling *this_ptr, C4DAtom *op, LONG index, LONG p1, LONG p2);

	Bool (*MeltEdgeBetween)(iModeling *this_ptr, C4DAtom *op, LONG pa, LONG pb, LONG p1, LONG p2);
	Bool (*MeltEdge)(iModeling *this_ptr, C4DAtom *op, LONG pa, LONG p1, LONG p2);
	Bool (*MeltPoint)(iModeling *this_ptr, C4DAtom *op, LONG p);

	LONG (*SplitPolygon)(iModeling *this_ptr, C4DAtom *op, LONG index, LONG p1, LONG p2);
	Bool (*MergePolygons)(iModeling *this_ptr, C4DAtom *op, LONG pa, LONG pb);

	Bool (*IsValidEdge)(iModeling *this_ptr, C4DAtom *op, LONG index, LONG p1, LONG p2);
	Bool (*IsValidNgon)(iModeling *this_ptr, C4DAtom *op, LONG index);
	Bool (*IsValidPoint)(iModeling *this_ptr, C4DAtom *op, LONG index);

	LONG *(*GetEdgeNgons)(iModeling *this_ptr, C4DAtom *op, LONG p1, LONG p2, LONG &pcnt);
	LONG *(*GetPointNgons)(iModeling *this_ptr, C4DAtom *op, LONG p, LONG &pcnt, Bool clone);
	LONG *(*GetNeighborNgons)(iModeling *this_ptr, C4DAtom *op, LONG index, LONG &pcnt);
	LONG *(*GetPointEdges)(iModeling *this_ptr, C4DAtom *op, LONG p, LONG &ecnt);
	Bool (*FindNgon)(iModeling *this_ptr, C4DAtom *op, LONG p1, LONG p2, LONG &index);

	Bool (*GetOriginalEdgePoints)(iModeling *this_ptr, C4DAtom *op, LONG edge, LONG &p1, LONG &p2);
	Bool (*IsEdgeDeleted)(iModeling *this_ptr, C4DAtom *op, LONG p1, LONG p2);

	LONG (*TranslateNgonIndex)(iModeling *this_ptr, C4DAtom *op, LONG index, Bool tovirtual);
	LONG (*TranslatePointIndex)(iModeling *this_ptr, C4DAtom *op, LONG index, Bool tovirtual);

	Bool (*GetPointMap)(iModeling *this_ptr, C4DAtom *op, LONG **map, LONG *count);
	Bool (*GetNgonMap)(iModeling *this_ptr, C4DAtom *op, LONG **map, LONG *count);
	Bool (*ReleaseMap)(iModeling *this_ptr, C4DAtom *op, LONG *map);
	Bool (*FreeMap)(iModeling *this_ptr, C4DAtom *op, LONG *map);

	LONG (*GetLastError)(iModeling *this_ptr, C4DAtom *op);
	Bool (*IsModified)(iModeling *this_ptr, C4DAtom *op);

	Bool (*GetPointInfo)(iModeling *this_ptr, C4DAtom *op, LONG index, LONG &ia, LONG &ib, Real &t);
	Bool (*GetOriginPoint)(iModeling *this_ptr, C4DAtom *op, LONG index, LONG &ci);
	Bool (*GetOriginNgon)(iModeling *this_ptr, C4DAtom *op, LONG index, LONG &ci);

	Bool (*SetOriginNgon)(iModeling *this_ptr, C4DAtom *op, LONG index, LONG ci);
	LONG (*GetNgonFlags)(iModeling *this_ptr, C4DAtom *op, LONG index);
	LONG (*SetNgonFlags)(iModeling *this_ptr, C4DAtom *op, LONG index, LONG flags);

	Bool (*SetPointInfo)(iModeling *this_ptr, C4DAtom *op, LONG index, LONG ia, LONG ib, Real t);
	Bool (*SetOriginPoint)(iModeling *this_ptr, C4DAtom *op, LONG index, LONG ci);
	LONG (*GetPointFlags)(iModeling *this_ptr, C4DAtom *op, LONG index);
	LONG (*SetPointFlags)(iModeling *this_ptr, C4DAtom *op, LONG index, LONG flags);

	Bool (*GetPointOrigin)(iModeling *this_ptr, C4DAtom *op, LONG index, Vector &opnt);
	Bool (*SetPointOrigin)(iModeling *this_ptr, C4DAtom *op, LONG index, Vector opnt, LONG flags);
	Bool (*SetInterPointBetween)(iModeling *this_ptr, C4DAtom *op, LONG index, Vector npnt, Real t, LONG flags);
	Bool (*WeldPoints)(iModeling *this_ptr, C4DAtom *op, LONG source, LONG dest);
	Bool (*MeltNgon)(iModeling *this_ptr, C4DAtom *op, LONG pa);

	Bool (*IsPointDeleted)(iModeling *this_ptr, C4DAtom *op, LONG index);
	Bool (*IsFaceDeleted)(iModeling *this_ptr, C4DAtom *op, LONG index);

	Bool (*SetInterPointMove)(iModeling *this_ptr, C4DAtom *op, LONG index, const Vector &move, const Vector &offset, LONG flags);

	Bool (*GetFaceSelection)(iModeling *this_ptr, C4DAtom *op, BaseSelect *select, BaseSelect *faceselect, BaseSelect *hidden);
	Bool (*GetEdgeSelection)(iModeling *this_ptr, C4DAtom *op, BaseSelect *select, BaseSelect *edgeselect, BaseSelect *hidden);
	LONG *(*GetEdgeSelectionArray)(iModeling *this_ptr, C4DAtom *op, BaseSelect *select, LONG &ecnt, BaseSelect *hidden, Bool tovirtual);
	Bool (*InsertFacePoint)(iModeling *this_ptr, C4DAtom *op, LONG pa, LONG p1);
	Bool (*CreateHole)(iModeling *this_ptr, C4DAtom *op, LONG index, const Ngon &ngon);
	Bool (*CreateHoleFromPoints)(iModeling *this_ptr, C4DAtom *op, LONG index, LONG *pnts, LONG pcnt);
	Bool (*ResizeNgon)(iModeling *this_ptr, C4DAtom *op, LONG index, LONG pcnt, LONG scnt);
	Bool (*GetEdgeSegment)(iModeling *this_ptr, C4DAtom *op, LONG pa, LONG p1, LONG p2, LONG *seg, LONG *s1, LONG *s2, Bool rel);

	void (*FreeTable)(iModeling *this_ptr, void *table);

	Bool (*PointInFace)(iModeling *this_ptr, C4DAtom *op, LONG index, const Vector &p);
	Bool (*PointInFaceNgon)(iModeling *this_ptr, C4DAtom *op, const Ngon &ngon, const Vector &p);
	Bool (*LineFaceIntersection)(iModeling *this_ptr, C4DAtom *op, LONG index, const Vector &p1, const Vector &p2);
	Bool (*LineFaceIntersectionNgon)(iModeling *this_ptr, C4DAtom *op, const Ngon &ngon, const Vector &p1, const Vector &p2);

	void (*SetTriangulateHook)(iModeling *this_ptr, C4DAtom *op, TriangulateHook pHook, void *pData);
	void (*GetTriangulateHook)(iModeling *this_ptr, C4DAtom *op, TriangulateHook *ppHook, void **ppData);
};

// INTERNAL STUFF -- INTERNAL STUFF -- INTERNAL STUFF -- INTERNAL STUFF -- INTERNAL STUFF
// INTERNAL STUFF -- INTERNAL STUFF -- INTERNAL STUFF -- INTERNAL STUFF -- INTERNAL STUFF
// INTERNAL STUFF -- INTERNAL STUFF -- INTERNAL STUFF -- INTERNAL STUFF -- INTERNAL STUFF

#endif
