Beispiel #1
0
void Destroy_Object (OBJECT *Object)
{
  OBJECT *Sib;

  while (Object != NULL)
  {
    Destroy_Textures(Object->Texture);
    Destroy_Textures(Object->Interior_Texture);
    Destroy_Object(Object->Bound);

    Destroy_Interior((INTERIOR *)Object->Interior);

	/* NK 1998 */
    Destroy_Transform(Object->UV_Trans);

    if (Object->Bound != Object->Clip)
    {
      Destroy_Object(Object->Clip);
    }

    Sib = Object->Sibling;

    Destroy(Object);

    Object = Sib;
  }
}
Beispiel #2
0
void Destroy_Single_Object (OBJECT **ObjectPtr)
{
  OBJECT *Object;

  Object = *ObjectPtr;

  Destroy_Textures(Object->Texture);

  Destroy_Object(Object->Bound);

  Destroy_Interior((INTERIOR *)Object->Interior);

	/* NK 1998 */
  Destroy_Transform(Object->UV_Trans);

  Destroy_Object (Object->Bound);
  Destroy_Interior((INTERIOR *)Object->Interior);

  if (Object->Bound != Object->Clip)
  {
    Destroy_Object(Object->Clip);
  }

  *ObjectPtr = Object->Sibling;

  Destroy(Object);
}
Beispiel #3
0
void Destroy_Single_Object (ObjectPtr *objectPtr)
{
    ObjectPtr object = *objectPtr;

    Destroy_Textures(object->Texture);

    Destroy_Object(object->Bound);

    Destroy_Object(object->Bound);

    if(object->Bound != object->Clip)
        Destroy_Object(object->Clip);

    delete object;
}
Beispiel #4
0
SceneData::~SceneData()
{
    lightSources.clear();
    lightGroupLightSources.clear();
    Destroy_Skysphere(skysphere);
    while (fog != nullptr)
    {
        FOG *next = fog->Next;
        Destroy_Fog(fog);
        fog = next;
    }
    while (rainbow != nullptr)
    {
        RAINBOW *next = rainbow->Next;
        Destroy_Rainbow(rainbow);
        rainbow = next;
    }
    if (boundingSlabs != nullptr)
        Destroy_BBox_Tree(boundingSlabs);
    for (std::vector<TrueTypeFont*>::iterator i = TTFonts.begin(); i != TTFonts.end(); ++i)
        delete *i;
    // TODO: perhaps ObjectBase::~ObjectBase would be a better place
    //       to handle cleanup of individual objects ?
    Destroy_Object(objects);

    if (tree != nullptr)
        delete tree;
}
Beispiel #5
0
SceneData::~SceneData()
{
    lightSources.clear();
    lightGroupLightSources.clear();
    Destroy_Skysphere(skysphere);
    while (fog != NULL)
    {
        FOG *next = fog->Next;
        Destroy_Fog(fog);
        fog = next;
    }
    while (rainbow != NULL)
    {
        RAINBOW *next = rainbow->Next;
        Destroy_Rainbow(rainbow);
        rainbow = next;
    }
    if(boundingSlabs != NULL)
        Destroy_BBox_Tree(boundingSlabs);
    if(TTFonts != NULL)
        FreeFontInfo(TTFonts);
    // TODO: perhaps ObjectBase::~ObjectBase would be a better place
    //       to handle cleanup of individual objects ?
    Destroy_Object(objects);
    delete functionVM;

    if(tree != NULL)
        delete tree;
}
Beispiel #6
0
void Destroy_Single_Object (ObjectPtr *objectPtr)
{
    ObjectPtr object = *objectPtr;

    Destroy_Textures(object->Texture);

    Destroy_Object(object->Bound);

    /* NK 1998 */
    Destroy_Transform(object->UV_Trans);

    Destroy_Object(object->Bound);

    if(object->Bound != object->Clip)
        Destroy_Object(object->Clip);

    delete object;
}
Beispiel #7
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();
}
Beispiel #8
0
void Destroy_Object(ObjectPtr Object)
{
    if(Object != NULL)
    {
        bool DestroyClip = true;
        if (!Object->Bound.empty() && !Object->Clip.empty())
            if (*Object->Bound.begin() == *Object->Clip.begin())
                DestroyClip = false;
        Destroy_Textures(Object->Texture);
        Destroy_Textures(Object->Interior_Texture);
        Destroy_Object(Object->Bound);

        if (DestroyClip)
            Destroy_Object(Object->Clip);

        if (dynamic_cast<CompoundObject *> (Object) != NULL)
            Destroy_Object ((dynamic_cast<CompoundObject *> (Object))->children);

        delete Object;
    }
}
Beispiel #9
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;
}
Beispiel #10
0
TraceThreadData::~TraceThreadData()
{
    delete functionContext;
    for(vector<GenericFunctionContextPtr>::iterator i = functionPatternContext.begin(); i != functionPatternContext.end(); ++i)
        delete *i;

    POV_FREE(Blob_Coefficients);
    POV_FREE(Blob_Queue);
    POV_FREE(isosurfaceData);
    Fractal::Free_Iteration_Stack(Fractal_IStack);
    delete surfacePhotonMap;
    delete mediaPhotonMap;
    delete[] Blob_Intervals;
    for(vector<LightSource *>::iterator it = lightSources.begin(); it != lightSources.end(); it++)
        Destroy_Object(*it);
}
Beispiel #11
0
void Destroy_Object(vector<ObjectPtr>& Objects)
{
    for(vector<ObjectPtr>::iterator Sib = Objects.begin(); Sib != Objects.end(); Sib++)
        Destroy_Object (*Sib);
    Objects.clear();
}
Beispiel #12
0
LightSource::~LightSource()
{
    Destroy_Object(Projected_Through_Object);
}