예제 #1
0
POVMS_List::~POVMS_List() noexcept(false)
{
    int err;

    err = POVMSAttrList_Delete(&data);
    if(err != pov_base::kNoErr)
        throw POV_EXCEPTION_CODE(err);
}
예제 #2
0
POVMS_List::~POVMS_List()
{
	int err;

	err = POVMSAttrList_Delete(&data);
	if(err != kNoErr)
		throw err;
}
예제 #3
0
void POVMS_Object::Get(POVMSType key, POVMS_List& attr)
{
	int err;

	err = POVMSAttrList_Delete(&attr.data);
	if(err != kNoErr)
		throw err;
	err = POVMSObject_Get(&data, &attr.data, key);
	if(err != kNoErr)
		throw err;
}
예제 #4
0
void POVMS_List::GetNth(int index, POVMS_List& item)
{
	int err;

	err = POVMSAttrList_Delete(&item.data);
	if(err != kNoErr)
		throw err;
	err = POVMSAttrList_GetNth(&data, index, &item.data);
	if(err != kNoErr)
		throw err;
}
예제 #5
0
void POVMS_Object::Get(POVMSType key, POVMS_List& attr)
{
    int err;

    err = POVMSAttrList_Delete(&attr.data);
    if(err != pov_base::kNoErr)
        throw POV_EXCEPTION_CODE(err);
    err = POVMSObject_Get(&data, &attr.data, key);
    if(err != pov_base::kNoErr)
        throw POV_EXCEPTION_CODE(err);
}
예제 #6
0
void POVMS_List::GetNth(int index, POVMS_List& item)
{
    int err;

    err = POVMSAttrList_Delete(&item.data);
    if(err != pov_base::kNoErr)
        throw POV_EXCEPTION_CODE(err);
    err = POVMSAttrList_GetNth(&data, index, &item.data);
    if(err != pov_base::kNoErr)
        throw POV_EXCEPTION_CODE(err);
}
예제 #7
0
POVMS_List& POVMS_List::operator=(POVMS_List& source)
{
	int err;

	err = POVMSAttrList_Delete(&data);
	if(err == kNoErr)
		err = POVMSAttrList_Copy(&source.data, &data);
	if(err != kNoErr)
		throw err;

	return *this;
}
예제 #8
0
POVMS_List& POVMS_List::operator=(const POVMS_List& source)
{
    int err;

    err = POVMSAttrList_Delete(&data);
    if(err == pov_base::kNoErr)
        err = POVMSAttrList_Copy(&source.data, &data);
    if(err != pov_base::kNoErr)
        throw POV_EXCEPTION_CODE(err);

    return *this;
}
예제 #9
0
void close_all()
{
  /* Only close things once */

  if (closed_flag)
  {
    return;
  }

  FlushDebugMessageBuffer();

  FreeBacktraceEverything();

  // Close out our file
  if(Output_File != NULL)
  {
    delete Output_File;
    Output_File = NULL;
  }

  destroy_libraries();
  Terminate_Renderer();
  Destroy_Bounding_Slabs();
  Destroy_Vista_Buffer();
  Destroy_Light_Buffers();
  Destroy_Random_Generators();
  Deinitialize_Radiosity_Code();
  Free_Iteration_Stack();
  Free_Noise_Tables();
  destroy_histogram();
  Deinitialize_Atmosphere_Code();
  Deinitialize_BBox_Code();
  Deinitialize_Lighting_Code();
  Deinitialize_Mesh_Code();
  Deinitialize_VLBuffer_Code();
  Destroy_Frame();
  Destroy_IStacks();
  FreeFontInfo();

  POVFPU_Terminate();

  if ((opts.Options & DISPLAY) && Display_Started)
  {
    POV_DISPLAY_CLOSE(opts.Preview_RefCon);
  }

  (void)POVMSAttrList_Delete(&opts.Declared_Variables);

  FlushDebugMessageBuffer();

  init_shellouts();
  closed_flag = true;
}
예제 #10
0
ITextStream *ProcessRenderOptions::OpenINIFileStream(const char *filename, unsigned int stype, char *buffer, POVMSObjectPtr obj)
{
    int i,ii,l[4];
    char pathname[FILE_NAME_LENGTH];
    char file[FILE_NAME_LENGTH];
    char file_x[4][FILE_NAME_LENGTH];
    int cnt = 0;
    int ll;
    POVMSAttribute attr, item;

    if(Has_Extension(filename))
    {
        for(i = 0; i < 4; i++)
            l[i]=0;
    }
    else
    {
        for(i = 0; i < 4; i++)
        {
            if((l[i] = strlen(gPOV_File_Extensions[stype].ext[i])) > 0)
            {
                strcpy(file_x[i], filename);
                strcat(file_x[i], gPOV_File_Extensions[stype].ext[i]);
            }
        }
    }

    // Check the current directory first
    for(i = 0; i < 4; i++)
    {
        if(l[i])
        {
            if(EXIST_FILE(file_x[i]) == true)
            {
                strcpy(buffer,file_x[i]);
                return new ITextStream(file_x[i], stype);
            }
        }
    }
    if(EXIST_FILE(filename) == true)
    {
        strcpy(buffer,filename);
        return new ITextStream(filename, stype);
    }

    if(POVMSObject_Get(obj, &attr, kPOVAttrib_LibraryPath) != 0)
        return NULL;

    if(POVMSAttrList_Count(&attr, &cnt) != 0)
    {
        (void)POVMSAttrList_Delete(&attr);
        return NULL;
    }

    for (i = 1; i <= cnt; i++)
    {
        (void)POVMSAttr_New(&item);
        if(POVMSAttrList_GetNth(&attr, i, &item) != 0)
            continue;
        ll = 0;
        if(POVMSAttr_Size(&item, &ll) != 0)
        {
            (void)POVMSAttr_Delete(&item);
            continue;
        }
        if(ll <= 0)
        {
            (void)POVMSAttr_Delete(&item);
            continue;
        }
        if(POVMSAttr_Get(&item, kPOVMSType_CString, file, &ll) != 0)
        {
            (void)POVMSAttr_Delete(&item);
            continue;
        }
        (void)POVMSAttr_Delete(&item);

        file[strlen(file)+1] = '\0';
        if(file[strlen(file) - 1] != DRIVE_SEPARATOR)
            file[strlen(file)] = FILENAME_SEPARATOR;

        for(ii = 0; ii < 4; ii++)
        {
            if(l[ii])
            {
                strcpy(pathname, file);
                strcat(pathname, file_x[ii]);
                if(EXIST_FILE(pathname) == true)
                {
                    strcpy(buffer,pathname);
                    (void)POVMSAttrList_Delete(&attr);
                    return new ITextStream(pathname, stype);
                }
            }
        }
        strcpy(pathname, file);
        strcat(pathname, filename);
        if(EXIST_FILE(pathname) == true)
        {
            strcpy(buffer,pathname);
            (void)POVMSAttrList_Delete(&attr);
            return new ITextStream(pathname, stype);
        }
    }

    (void)POVMSAttrList_Delete(&attr);

    if(l[0])
        ParseError("Could not find file '%s%s'", filename, gPOV_File_Extensions[stype].ext[0]);
    else
        ParseError("Could not find file '%s'", filename);

    return NULL;
}