本文整理汇总了C++中POV_MALLOC函数的典型用法代码示例。如果您正苦于以下问题:C++ POV_MALLOC函数的具体用法?C++ POV_MALLOC怎么用?C++ POV_MALLOC使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了POV_MALLOC函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: return
PRIORITY_QUEUE *Create_Priority_Queue(unsigned QSize)
{
PRIORITY_QUEUE *New;
New = (PRIORITY_QUEUE *)POV_MALLOC(sizeof(PRIORITY_QUEUE), "priority queue");
New->Queue = (QELEM *)POV_MALLOC(QSize*sizeof(QELEM), "priority queue");
New->QSize = 0;
New->Max_QSize = QSize;
return (New);
}
示例2: Initialize_VLBuffer_Code
void Initialize_VLBuffer_Code()
{
Node_Queue = (PROJECT_QUEUE *)POV_MALLOC(sizeof(PROJECT_QUEUE),
"vista/light buffer node queue");
Node_Queue->QSize = 0;
Node_Queue->Max_QSize = INITIAL_NUMBER_OF_ENTRIES;
Node_Queue->Queue = (PROJECT_TREE_NODE **)POV_MALLOC(Node_Queue->Max_QSize*sizeof(PROJECT_TREE_NODE *),
"vista/light buffer node queue");
VLBuffer_Queue = Create_Priority_Queue(INITIAL_NUMBER_OF_ENTRIES);
}
示例3: sizeof
UCS2 *Parser::String_To_UCS2(const char *str)
{
UCS2 *char_string = nullptr;
UCS2 *char_array = nullptr;
int char_array_size = 0;
int utf8arraysize = 0;
unsigned char *utf8array = nullptr;
int index_in = 0;
int index_out = 0;
char *dummy_ptr = nullptr;
int i = 0;
if(strlen(str) == 0)
{
char_string = reinterpret_cast<UCS2 *>(POV_MALLOC(sizeof(UCS2), "UCS2 String"));
char_string[0] = 0;
return char_string;
}
char_array_size = (int)strlen(str);
char_array = reinterpret_cast<UCS2 *>(POV_MALLOC(char_array_size * sizeof(UCS2), "Character Array"));
for(i = 0; i < char_array_size; i++)
{
if(sceneData->EffectiveLanguageVersion() < 350)
char_array[i] = (unsigned char)(str[i]);
else
{
char_array[i] = str[i] & 0x007F;
if(char_array[i] != str[i])
{
char_array[i] = ' ';
PossibleError("Unexpected non-ASCII character has been replaced by space character.");
}
}
}
char_string = reinterpret_cast<UCS2 *>(POV_MALLOC((char_array_size + 1) * sizeof(UCS2), "UCS2 String"));
for(index_in = 0, index_out = 0; index_in < char_array_size; index_in++, index_out++)
char_string[index_out] = char_array[index_in];
char_string[index_out] = 0;
index_out++;
if (char_array != nullptr)
POV_FREE(char_array);
return char_string;
}
示例4: return
CONE *Create_Cylinder()
{
CONE *New;
New = (CONE *)POV_MALLOC(sizeof(CONE), "cone");
INIT_OBJECT_FIELDS(New, CONE_OBJECT, &Cone_Methods)
Make_Vector(New->apex, 0.0, 0.0, 1.0);
Make_Vector(New->base, 0.0, 0.0, 0.0);
New->apex_radius = 1.0;
New->base_radius = 1.0;
New->dist = 0.0;
New->Trans = Create_Transform();
Set_Flag(New, CYLINDER_FLAG); /* This is a cylinder. */
Set_Flag(New, CLOSED_FLAG); /* Has capped ends. */
/* Default bounds */
Make_BBox(New->BBox, -1.0, -1.0, 0.0, 2.0, 2.0, 1.0);
return (New);
}
示例5: Create_Skysphere
SKYSPHERE *Copy_Skysphere(const SKYSPHERE *Old)
{
int i;
SKYSPHERE *New;
New = Create_Skysphere();
Destroy_Transform(New->Trans);
*New = *Old;
New->Trans = Copy_Transform(Old->Trans);
if (New->Count > 0)
{
New->Pigments = reinterpret_cast<PIGMENT **>(POV_MALLOC(New->Count*sizeof(PIGMENT *), "skysphere pigment"));
for (i = 0; i < New->Count; i++)
{
New->Pigments[i] = Copy_Pigment(Old->Pigments[i]);
}
}
return (New);
}
示例6: GET
UCS2 *Parser::Parse_Substr(bool pathname)
{
UCS2 *str;
UCS2 *New;
int l, d;
GET(LEFT_PAREN_TOKEN);
str = Parse_String(pathname);
Parse_Comma();
l = (int)Parse_Float();
Parse_Comma();
d = (int)Parse_Float();
GET(RIGHT_PAREN_TOKEN);
if(((l + d - 1) > UCS2_strlen(str)) || (l < 0) || (d < 0))
Error("Illegal parameters in substr.");
New = reinterpret_cast<UCS2 *>(POV_MALLOC(sizeof(UCS2) * (d + 1), "temporary string"));
UCS2_strncpy(New, &(str[l - 1]), d);
New[d] = 0;
POV_FREE(str);
return New;
}
示例7: ObjectBase
IsoSurface::IsoSurface() : ObjectBase(ISOSURFACE_OBJECT)
{
container = shared_ptr<ContainedByShape>(new ContainedByBox());
Make_BBox(BBox, -1.0, -1.0, -1.0, 2.0, 2.0, 2.0);
Trans = Create_Transform();
Function = NULL;
accuracy = 0.001;
max_trace = 1;
eval_param[0] = 0.0; // 1.1; // not necessary
eval_param[1] = 0.0; // 1.4; // not necessary
eval_param[2] = 0.0; // 0.99; // not necessary
eval = false;
closed = true;
isCopy = false;
max_gradient = 1.1;
gradient = 0.0;
threshold = 0.0;
mginfo = reinterpret_cast<ISO_Max_Gradient *>(POV_MALLOC(sizeof(ISO_Max_Gradient), "isosurface max_gradient info"));
mginfo->refcnt = 1;
mginfo->max_gradient = 0.0;
mginfo->gradient = 0.0; // not really necessary yet [trf]
mginfo->eval_max = 0.0;
mginfo->eval_cnt = 0.0;
mginfo->eval_gradient_sum = 0.0;
}
示例8: sizeof
UCS4 *Parser::Convert_UTF8_To_UCS4(const unsigned char *text_array, int text_array_size, int *char_array_size)
{
UCS4 *char_array = NULL;
UCS4 chr;
int i, j, k, seqlen;
if((text_array == NULL) || (text_array_size == 0) || (char_array_size == NULL))
return NULL;
char_array = reinterpret_cast<UCS4 *>(POV_MALLOC(text_array_size * sizeof(UCS4), "Character Array"));
if(char_array == NULL)
throw POV_EXCEPTION_CODE(kOutOfMemoryErr);
for(i = 0, k = 0; i < text_array_size; k++, i++)
{
seqlen = gUTF8SequenceArray[text_array[i]];
chr = 0;
for(j = seqlen; j > 0; j--)
{
chr += text_array[i];
chr <<= 6;
i++;
}
chr += text_array[i];
char_array[k] = chr - gUTF8Offsets[seqlen];
}
char_array = reinterpret_cast<UCS4 *>(POV_REALLOC(char_array, k * sizeof(UCS4), "Character Array"));
*char_array_size = k;
return char_array;
}
示例9: return
TRIANGLE *Create_Triangle()
{
TRIANGLE *New;
New = (TRIANGLE *)POV_MALLOC(sizeof(TRIANGLE), "triangle");
INIT_OBJECT_FIELDS(New,TRIANGLE_OBJECT,&Triangle_Methods)
Make_Vector(New->Normal_Vector, 0.0, 1.0, 0.0);
New->Distance = 0.0;
/* BEG ROSE
this three points doesn't belong to the normal vector, created above:
END ROSE */
Make_Vector(New->P1, 0.0, 0.0, 0.0);
Make_Vector(New->P2, 1.0, 0.0, 0.0);
Make_Vector(New->P3, 0.0, 1.0, 0.0);
/*
* NOTE: Dominant_Axis is computed when Parse_Triangle calls
* Compute_Triangle. vAxis is used only for smooth triangles.
*/
return(New);
}
示例10:
RAINBOW *Create_Rainbow()
{
RAINBOW *New;
New = (RAINBOW *)POV_MALLOC(sizeof(RAINBOW), "fog");
New->Distance = MAX_DISTANCE;
New->Jitter = 0.0;
New->Angle = 0.0;
New->Width = 0.0;
New->Falloff_Width = 0.0;
New->Arc_Angle = 180.0;
New->Falloff_Angle = 180.0;
New->Pigment = NULL;
Make_Vector(New->Antisolar_Vector, 0.0, 0.0, 0.0);
Make_Vector(New->Right_Vector, 1.0, 0.0, 0.0);
Make_Vector(New->Up_Vector, 0.0, 1.0, 0.0);
New->Next = NULL;
return (New);
}
示例11: return
BEZIER_NODE *BicubicPatch::create_new_bezier_node()
{
BEZIER_NODE *Node = reinterpret_cast<BEZIER_NODE *>(POV_MALLOC(sizeof(BEZIER_NODE), "bezier node"));
Node->Data_Ptr = NULL;
return (Node);
}
示例12: strcpy
char *pov_strdup(const char *s)
{
char *New;
New=reinterpret_cast<char *>(POV_MALLOC(strlen(s)+1,s));
strcpy(New,s);
return (New);
}
示例13: strcpy
char *pov_strdup(const char *s)
{
char *New;
New=(char *)POV_MALLOC(strlen(s)+1,s);
strcpy(New,s);
return (New);
}
示例14: Free_Iteration_Stack
void Fractal::Allocate_Iteration_Stack(DBL **IStack, int Len)
{
Free_Iteration_Stack(IStack);
if (Len == 0)
return ;
const int len = (Len + 1) * sizeof(DBL);
for (int i = 0 ; i < 4 ; i++)
IStack [i] = reinterpret_cast<DBL *>(POV_MALLOC(len, "fractal iteration stack"));
}
示例15: Make_BBox
BBOX_TREE *create_bbox_node(int size)
{
BBOX_TREE *New;
New = reinterpret_cast<BBOX_TREE *>(POV_MALLOC(sizeof(BBOX_TREE), "bounding box node"));
New->Infinite = false;
New->Entries = size;
Make_BBox(New->BBox, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
if(size)
New->Node = reinterpret_cast<BBOX_TREE **>(POV_MALLOC(size*sizeof(BBOX_TREE *), "bounding box node"));
else
New->Node = NULL;
return (New);
}