c4d_baseobject.h File Reference

Classes

struct   CPolygon
struct   Tangent
struct   Segment
struct   ObjectColorProperties
class   HierarchyHelp
class   BaseObject
class   CameraObject
class   PointObject
struct   CLine
class   LineObject
class   PolygonObject
class   SplineLengthData
class   SplineObject
class   Safety
struct   PolyInfo
struct   NgonNeighbor
struct   NgonNeighbor::NgonNeighborSegment
class   Neighbor
class   PolyTriangulate

Macros

#define  MODE_ON
#define  MODE_OFF
#define  MODE_UNDEF
#define  POLYOBJECT_VBO_VERTEX
#define  POLYOBJECT_VBO_PHONG_NORMAL
#define  POLYOBJECT_VBO_POLYGON_NORMAL
#define  POLYOBJECT_VBO_DISPLACE_NORMAL
#define  POLYOBJECT_VBO_STICK_TEXTURE
#define  POLYOBJECT_VBO_COLOR
#define  ToPoint (op)
#define  ToPoly (op)
#define  ToSpline (op)
#define  POLY_TRIANG_CONSTRAINED_OUTLINE
#define  POLY_TRIANG_QUADS
#define  POLY_TRIANG_NGON
#define  POLY_TRIANG_FORCE_VORONOI
#define  POLY_TRIANG_FORCE_NGON
#define  POLY_TRIANG_FILL_HOLES
#define  TRIANGSTATE_SKIP_EDGE
#define  TRIANGSTATE_MISSING_CONSTRAINT

函数

BaseObject GeneratePrimitive ( BaseDocument *doc, Int32 type, const BaseContainer &bc, Float lod, Bool isoparm, BaseThread *bt=nullptr)
BaseObject GenerateSplinePrimitive ( BaseDocument *doc, Int32 type, const BaseContainer &bc, Float lod, BaseThread *bt=nullptr)
向量   CalcFaceNormal (const 向量 *padr, const CPolygon &v)
Int32   CalcLOD ( Int32 val, Float lod, Int32 min, Int32 max)
Bool   DisjointMesh ( PointObject *op)
SplineObject FitCurve ( 向量 *padr, Int32 pcnt, Float error, BaseThread *bt)
Bool   Triangulate (const 向量 *padr, Int32 pcnt, CPolygon **vadr, Int32 *vcnt)
Bool   TriangulateStandard (const 向量 *padr, Int32 pcnt, Int32 *list, Int32 lcnt, CPolygon *&vadr, Int32 &vcnt, BaseThread *thread)
Bool   TriangulateRegular (const 向量 *pinp, Int32 pinp_cnt, Int32 *list, Int32 lcnt, 向量 *&padr, Int32 &pcnt, CPolygon *&vadr, Int32 &vcnt, Float regular_width, BaseThread *thread)
BaseObject GenerateText ( BaseContainer *cp, BaseThread *bt, Bool separate)
Bool   CheckDisplayFilter ( BaseObject *op, DISPLAYFILTER filter)
Bool   CheckEditorVisibility ( BaseObject *op)
Int32   IntersectionTest ( PolygonObject *op, BaseDraw *bd, Float x, Float y, const 矩阵 &mg, Float *z, MODELINGCOMMANDMODE 模式, UChar *pPointSelect, Int32 lSelectCount)
向量   ComputeLightColor ( BaseObject *op, Bool editor, Float reference)
BaseObject GetVirtualLineObject ( BaseObject *op, HierarchyHelp *hh, const 矩阵 &mloc, Bool keep_spline, Bool recurse, 矩阵 *mres, Bool *dirty)
UVWTag GenerateUVW ( BaseObject *op, const 矩阵 &opmg, TextureTag *tp, const 矩阵 &texopmg, BaseView *view)
void  CutReal ( BaseContainer &data, Int32 id, Float min, Float max)
void  CutVector ( BaseContainer &data, Int32 id, Float min, Float max)
Bool   CalculateVisiblePoints ( BaseDraw *bd, PolygonObject *op, 向量 *padr, UChar *pset, Bool select_visibonly)

Macro Definition Documentation

◆  ToPoint

#define ToPoint (   op )

Casts a BaseObject * to a PointObject *.

◆  ToPoly

#define ToPoly (   op )

Casts a BaseObject * to a PolygonObject *.

◆  ToSpline

#define ToSpline (   op )

Casts a BaseObject * to a SplineObject *.

Function Documentation

◆  GeneratePrimitive()

BaseObject * GeneratePrimitive ( BaseDocument doc ,
Int32   type ,
const BaseContainer bc ,
Float   lod ,
Bool   isoparm ,
BaseThread bt = nullptr  
)

Creates a built-in Cinema 4D primitive objects.

参数
[in] doc The document for the primitive object. The caller owns the pointed document.
[in] type The primitive type: Primitive Types
[in] bc The settings for the primitive.
[in] lod The level of detail to use for the primitive.
[in] isoparm Pass true to create a isoparm of the object.
[in] bt The thread to test for a break or nullptr . The caller owns the pointed thread.
返回
The primitive object or nullptr if failed. The caller owns the pointed object.

◆  GenerateSplinePrimitive()

BaseObject * GenerateSplinePrimitive ( BaseDocument doc ,
Int32   type ,
const BaseContainer bc ,
Float   lod ,
BaseThread bt = nullptr  
)

Creates a built-in Cinema 4D primitive spline objects.

参数
[in] doc The document for the spline primitive object. The caller owns the pointed document.
[in] type The spline primitive type: Spline Primitive Types
[in] bc The settings for the spline primitive.
[in] lod The level of detail to use for the primitive.
[in] bt The thread to test for a break or nullptr . The caller owns the pointed thread.
返回
The primitive spline object or nullptr if failed. The caller owns the pointed object.

◆  CalcFaceNormal()

向量 CalcFaceNormal ( const 向量 padr ,
const CPolygon v  
)

Calculates the normal of a polygon.

参数
[in] padr The points array.
[in] v The polygon.
返回
The face's normal.

◆  CalcLOD()

Int32 CalcLOD ( Int32   val ,
Float   lod ,
Int32   min ,
Int32   max  
)

Helper function to modify a user chosen subdivision value.
范例:

Int32 sub = CalcLOD (data. GetInt32 (TUBEOBJECT_SUB, 1), hh->GetLOD(), 1, 1000);
参数
[in] val The user chosen LOD value.
[in] lod The LOD value, from BaseDocument::GetLOD() .
[in] min The minimum LOD.
[in] max The maximum LOD.
返回
The level of detail.

◆  DisjointMesh()

Bool DisjointMesh ( PointObject op )

Separates the mesh of the object to make each polygon/line segment independent.
Each polygon/line will be given its own points thereby separating them so they can be moved independently, such as the Explosion object.

参数
[in] op The Point object to disjoint. The caller owns the pointed Point object.
返回
true if the mesh was disjointed successfully, otherwise false .

◆  FitCurve()

SplineObject * FitCurve ( 向量 padr ,
Int32   pcnt ,
Float   error ,
BaseThread bt  
)

Creates a Spline object that has the best fit through the given points.

参数
[in] padr The points to fit a curve to. The caller owns the pointed array.
[in] pcnt The number of points in the point array padr .
[in] error Sets how closely the curve must match the passed points. The range for this is 0 to MAXRANGE . The lower the value then the closer the curve will match.
[in] bt The current thread, or nullptr for the main Cinema 4D thread. The caller owns the pointed thread.
返回
A Spline object that fits the given points, or nullptr if failed. The caller owns the pointed Spline object.

◆  Triangulate()

Bool Triangulate ( const 向量 padr ,
Int32   pcnt ,
CPolygon **  vadr ,
Int32 vcnt  
)

Turns the polygon mesh into triangles.

参数
[in] padr The points of the object to triangulate. The caller owns the pointed array.
[in] pcnt The number of points in the points array padr .
[out] vadr The polygons for the object. Assigned the triangulated polygons. The caller owns the pointed array.
Can be assigned nullptr , always check.
[out] vcnt Assigned the triangulated count i.e. the number of polygons in the returned polygons array vadr .
返回
true if turning the polygons into triangles was successful, otherwise false .

◆  TriangulateStandard()

Bool TriangulateStandard ( const 向量 padr ,
Int32   pcnt ,
Int32 list ,
Int32   lcnt ,
CPolygon *&  vadr ,
Int32 vcnt ,
BaseThread thread  
)

Triangulates the spline described by ( padr , pcnt ) and ( list , lcnt ) returning the result in ( vadr , vcnt ).

警告
The returned data vadr must be freed with DeleteMem()
参数
[in] padr The input points. The caller owns the pointed array.
[in] pcnt The number of input points in padr .
[in] list The input segments. A list with a Int32 for each segment, telling its length within the point array padr . The caller owns the pointed array.
[in] lcnt The number of input segments in list .
[out] vadr Assigned the output polygon array. The caller owns the pointed array.
[out] vcnt The number of polygons in vadr .
[in] thread The current thread, or nullptr for the main Cinema 4D thread. The caller owns the pointed thread.
返回
true if the spline was triangulated successfully, otherwise false .

◆  TriangulateRegular()

Bool TriangulateRegular ( const 向量 pinp ,
Int32   pinp_cnt ,
Int32 list ,
Int32   lcnt ,
向量 *&  padr ,
Int32 pcnt ,
CPolygon *&  vadr ,
Int32 vcnt ,
Float   regular_width ,
BaseThread thread  
)

Triangulates the spline described by ( pinp , pinp_cnt ) and ( list , lcnt ) returning the result in ( padr , pcnt ) and ( vadr , vcnt ). Generates new points in a regular mesh specified by regular_width .

警告
The returned data ( padr , vadr ) must be freed with DeleteMem() .
参数
[in] pinp The input points. The caller owns the pointed array.
[in] pinp_cnt The number of input points in pinp .
[in] list The input segments. A list with a Int32 for each segment, telling its length within the point array padr . The caller owns the pointed array.
[in] lcnt The number of input segments in list .
[out] padr Assigned the output point array. The caller owns the pointed array.
[out] pcnt The number of output points in padr .
[out] vadr Assigned the output polygon array. The caller owns the pointed array.
[out] vcnt The number of output polygons in vadr .
[in] regular_width The width of the regular mesh.
[in] thread The current thread, or nullptr for the main Cinema 4D thread. The caller owns the pointed thread.
返回
true if the spline was triangulated successfully, otherwise false .

◆  GenerateText()

BaseObject * GenerateText ( BaseContainer cp ,
BaseThread bt ,
Bool   separate  
)

Creates a text object.

参数
[in] cp The container with settings for the text object.
[in] bt The current thread, or nullptr for the main Cinema 4D thread. The caller owns the pointed thread.
[in] separate true if the letters should be separate, otherwise false .
返回
The created text object or nullptr if failed. The caller owns the pointed object.

◆  CheckDisplayFilter()

Bool CheckDisplayFilter ( BaseObject op ,
DISPLAYFILTER   filter  
)

Checks if an object is covered by a display filter.
范例:

BaseDraw * bd = doc-> GetActiveBaseDraw ();

// Get the BaseDraw's display filter DISPLAYFILTER filter = bd-> GetDisplayFilter (); if ( CheckDisplayFilter (op, filter)) { // Use object }

参数
[in] op The object to check. The caller owns the pointed object.
[in] filter The filter bitmask: DISPLAYFILTER
返回
true if the object is included in a display filter, otherwise false .

◆  CheckEditorVisibility()

Bool CheckEditorVisibility ( BaseObject op )

Checks if an object is visible in the viewport including evaluation of parent hierarchies and layers. Combine with CheckDisplayFilter() to get the visibility in a certain BaseDraw .

由于
R16.050
参数
[in] op The object to check.
返回
true if the object state is visible, otherwise false .

◆  IntersectionTest()

Int32 IntersectionTest ( PolygonObject op ,
BaseDraw bd ,
Float   x ,
Float   y ,
const 矩阵 mg ,
Float z ,
MODELINGCOMMANDMODE   mode ,
UChar pPointSelect ,
Int32   lSelectCount  
)

Checks for a polygon intersection at position ( x / y ) in the view bd with object op and global matrix mg .
The resulting Z depth is assigned to z .

参数
[in] op The polygon object to check. The caller owns the pointed polygon object.
[in] bd The base draw to check the intersection in. The caller owns the pointed base draw.
[in] x The X coordinate to check.
[in] y The Y coordinate to check.
[in] mg The global matrix of the object.
[out] z Assigned the Z coordinate of the intersection if found.
[in] mode The intersection mode: MODELINGCOMMANDMODE
[in] pPointSelect An optional point selection. The caller owns the pointed array.
[in] lSelectCount The number of points in pPointselect .
返回
The intersection result.

◆  ComputeLightColor()

向量 ComputeLightColor ( BaseObject op ,
Bool   editor ,
Float   reference  
)

Computes the color of a light source. Private .

◆  GetVirtualLineObject()

BaseObject * GetVirtualLineObject ( BaseObject op ,
HierarchyHelp hh ,
const 矩阵 mloc ,
Bool   keep_spline ,
Bool   recurse ,
矩阵 mres ,
Bool dirty  
)

Gets a LineObject or SplineObject from a spline generator.

参数
[in] op The spline object. The caller owns the pointed base object.
[in] hh The HierarchyHelp usually passed from ObjectData::GetVirtualObjects() . The caller owns the pointed hierarchy help.
[in] mloc The local matrix of the spline object.
[in] keep_spline true to generate a SplineObject or false for a LineObject .
[in] recurse true and the object op itself did not generate a line object then Cinema 4D will search through all children and caches of op if any of those objects generates the line form.
注意
The caches are always searched.
If a spline is placed in An array object and the array under the generator then GetVirtualLineObject() will return the first "arrayed" spline.
For example, a Spline is put into a Null object placed under the generator.
With recurse == false then GetVirtualLineObject() return nullptr , if recurse == true then it would find the first child Spline of the Null object.
参数
[out] mres Assigned the local matrix of the object that created the line form.
[out] dirty Assigned true if the object that generated the spline was modified. In this case the generator knows that it must rebuild its cache.
返回
The LineObject or SplineObject from a spline generator. The caller owns the pointed base object.

◆  GenerateUVW()

UVWTag * GenerateUVW ( BaseObject op ,
const 矩阵 opmg ,
TextureTag tp ,
const 矩阵 texopmg ,
BaseView view  
)

Generates a UVW tag for an object.

参数
[in] op The object to generate the UVW coordinates for. The caller owns the pointed base object.
[in] opmg The object's global matrix.
[in] tp The texture tag to generate the UVW coordinates from. The caller owns the pointed texture tag.
[in] texopmg The global matrix of the object that carries the texture tag.
[in] view The current view or nullptr . The caller owns the pointed base view.
返回
The created UVW tag or nullptr if the texture type is already UV or if failed. If nullptr then the UVW tag must retrieved from the object itself. The caller owns the pointed UVW tag.

◆  CutReal()

void CutReal ( BaseContainer data ,
Int32   id ,
Float   min ,
Float   max  
)

Limits the float value with the specified id in the container data between min and max .

参数
[in] data The container with the value.
[in] id The ID of the float value.
[in] min The minimum value.
[in] max The maximum value.

◆  CutVector()

void CutVector ( BaseContainer data ,
Int32   id ,
Float   min ,
Float   max  
)

Limits the vector value with the specified id in the container data between min and max .

参数
[in] data The container with the value.
[in] id The ID of the vector value.
[in] min The minimum value.
[in] max The maximum value.

◆  CalculateVisiblePoints()

Bool CalculateVisiblePoints ( BaseDraw bd ,
PolygonObject op ,
向量 padr ,
UChar pset ,
Bool   select_visibonly  
)

Checks which points in the points array padr of op are visible in the view bd .

参数
[in] bd The base draw to check. The caller owns the pointed base draw.
[in] op The polygon object to check. The caller owns the pointed polygon object.
[in] padr The points array. The caller owns the pointed points array.
[in] pset Assigned an array of size PointObject::GetPointCount() with the visibility status for each point:
1 if the point is visible otherwise 0 .
[in] select_visibonly true only points that are truly visible are included, otherwise e.g. points from the back of an object are included.
返回
true if successful, otherwise false .
CheckDisplayFilter
Bool CheckDisplayFilter(BaseObject *op, DISPLAYFILTER filter)
DISPLAYFILTER
DISPLAYFILTER
定义: ge_prepass.h:4279
BaseDocument::GetActiveBaseDraw
BaseDraw * GetActiveBaseDraw(void)
BaseDraw
定义: c4d_basedraw.h:747
CalcLOD
Int32 CalcLOD(Int32 val, Float lod, Int32 min, Int32 max)
Int32
maxon::Int32 Int32
定义: ge_sys_math.h:58
BaseContainer::GetInt32
Int32 GetInt32(Int32 id, Int32 preset=0) const
定义: c4d_basecontainer.h:303
BaseDraw::GetDisplayFilter
DISPLAYFILTER GetDisplayFilter() const
定义: c4d_basedraw.h:1588