Пример #1
0
void Destroy_Blend_Map (BLEND_MAP *BMap)
{
  int i;
  
  if (BMap != NULL)
  {
    if (--(BMap->Users) == 0)
    {
      for (i = 0; i < BMap->Number_Of_Entries; i++)
      {
        switch (BMap->Type)
        {
           case PIGMENT_TYPE:
           case DENSITY_TYPE:
             Destroy_Pigment(BMap->Blend_Map_Entries[i].Vals.Pigment);
             break;

           case NORMAL_TYPE:
             Destroy_Tnormal(BMap->Blend_Map_Entries[i].Vals.Tnormal);
             break;

           case TEXTURE_TYPE:
             Destroy_Textures(BMap->Blend_Map_Entries[i].Vals.Texture);
        }
      }

      POV_FREE (BMap->Blend_Map_Entries);

      POV_FREE (BMap);
    }
  }
}
Пример #2
0
void Destroy_Rainbow(RAINBOW *Rainbow)
{
	if (Rainbow != NULL)
	{
		Destroy_Pigment(Rainbow->Pigment);

		delete Rainbow;
	}
}
Пример #3
0
void Destroy_Rainbow(RAINBOW *Rainbow)
{
	if (Rainbow != NULL)
	{
		Destroy_Pigment(Rainbow->Pigment);

		POV_FREE(Rainbow);
	}
}
Пример #4
0
Camera::~Camera()
{
	Destroy_Tnormal(Tnormal);
	Destroy_Transform(Trans);
	Destroy_Pigment(Bokeh);
	for (std::vector<ObjectPtr>::iterator it = Meshes.begin(); it != Meshes.end(); it++)
		Destroy_Object(*it);
	Meshes.clear();
}
Пример #5
0
void Destroy_Pigment (PIGMENT *Pigment)
{
	if (Pigment != NULL)
	{
		Destroy_Pigment(reinterpret_cast<PIGMENT *>(Pigment->Next));

		Destroy_TPat_Fields (reinterpret_cast<TPATTERN *>(Pigment));

		POV_FREE(Pigment);
	}
}
Пример #6
0
void Destroy_Pigment (PIGMENT *Pigment)
{
  if (Pigment != NULL)
  {
    Destroy_Pigment((PIGMENT *)Pigment->Next);

    Destroy_TPat_Fields ((TPATTERN *)Pigment);

    POV_FREE(Pigment);
  }
}
Пример #7
0
Camera& Camera::operator=(const Camera& src)
{
	Assign_Vector(Location, src.Location);
	Assign_Vector(Direction, src.Direction);
	Assign_Vector(Up, src.Up);
	Assign_Vector(Right, src.Right);
	Assign_Vector(Sky, src.Sky);
	Assign_Vector(Look_At, src.Look_At);
	Assign_Vector(Focal_Point, src.Focal_Point);

	Focal_Distance = src.Focal_Distance;
	Aperture = src.Aperture;
	Blur_Samples = src.Blur_Samples;
	Blur_Samples_Min = src.Blur_Samples_Min;
	Confidence = src.Confidence;
	Variance = src.Variance;
	Type = src.Type;
	Angle = src.Angle;
	H_Angle = src.H_Angle;
	V_Angle = src.V_Angle;

	if (Tnormal != NULL)
		Destroy_Tnormal(Tnormal);
	Tnormal = src.Tnormal ? Copy_Tnormal(src.Tnormal) : NULL;
	if (Trans != NULL)
		Destroy_Transform(Trans);
	Trans = src.Trans ? Copy_Transform(src.Trans) : NULL;

	if (Bokeh != NULL)
		Destroy_Pigment(Bokeh);
	Bokeh = src.Bokeh ? Copy_Pigment(src.Bokeh) : NULL;

	for (std::vector<ObjectPtr>::iterator it = Meshes.begin(); it != Meshes.end(); it++)
		Destroy_Object(*it);
	Meshes.clear();
	for (std::vector<ObjectPtr>::const_iterator it = src.Meshes.begin(); it != src.Meshes.end(); it++)
		Meshes.push_back(Copy_Object(*it));
	Face_Distribution_Method = src.Face_Distribution_Method;
	Rays_Per_Pixel = src.Rays_Per_Pixel;
	Max_Ray_Distance = src.Max_Ray_Distance;
	Mesh_Index = src.Mesh_Index;
	for (int i = 0; i < 10; i++)
	{
		U_Xref[i] = src.U_Xref[i];
		V_Xref[i] = src.V_Xref[i];
	}
	Smooth = src.Smooth;

	return *this;
}
Пример #8
0
void Destroy_Skysphere(SKYSPHERE *Skysphere)
{
	int i;

	if (Skysphere != NULL)
	{
		for (i = 0; i < Skysphere->Count; i++)
		{
			Destroy_Pigment(Skysphere->Pigments[i]);
		}

		POV_FREE(Skysphere->Pigments);

		Destroy_Transform(Skysphere->Trans);

		delete Skysphere;
	}
}
Пример #9
0
PigmentBlendMap::~PigmentBlendMap()
{
    for (Vector::iterator i = Blend_Map_Entries.begin(); i != Blend_Map_Entries.end(); i++)
        Destroy_Pigment(i->Vals);
}