IsoSurface::~IsoSurface() { if(--mginfo->refcnt == 0) POV_FREE(mginfo); delete Function; Destroy_Transform(Trans); }
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); }
CAMERA *Copy_Camera(CAMERA *Old) { CAMERA *New; if (Old != NULL) { New = Create_Camera(); Destroy_Tnormal(New->Tnormal); Destroy_Transform(New->Trans); *New = *Old; New->Tnormal = NULL; // clear in case the copy fails if(Old->Tnormal != NULL) New->Tnormal = Copy_Tnormal(Old->Tnormal); New->Trans = NULL; // clear in case the copy fails if(Old->Trans != NULL) New->Trans = Copy_Transform(Old->Trans); } else { New = NULL; } return (New); }
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); }
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; } }
ObjectPtr Cone::Copy() { Cone *New = new Cone(); Destroy_Transform(New->Trans); *New = *this; New->Trans = Copy_Transform(Trans); return (New); }
ObjectPtr Triangle::Copy() { Triangle *New = new Triangle(); Destroy_Transform(New->Trans); *New = *this; return(New); }
Parametric::~Parametric() { Destroy_Transform(Trans); Parser::Destroy_Function(vm, Function[0]); Parser::Destroy_Function(vm, Function[1]); Parser::Destroy_Function(vm, Function[2]); Destroy_PrecompParVal(); }
ObjectPtr Disc::Copy() { Disc *New = new Disc(); Destroy_Transform(New->Trans); *New = *this; New->Trans = Copy_Transform(Trans); return (New); }
ObjectPtr Sphere::Copy() { Sphere *New = new Sphere(); Destroy_Transform(New->Trans); *New = *this; New->Trans = Copy_Transform(Trans); return(New); }
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(); }
void Destroy_Camera(CAMERA *Camera) { if (Camera != NULL) { Destroy_Tnormal(Camera->Tnormal); Destroy_Transform(Camera->Trans); POV_FREE(Camera); } }
ObjectPtr Superellipsoid::Copy() { Superellipsoid *New = new Superellipsoid(); Destroy_Transform(New->Trans); *New = *this; New->Trans = Copy_Transform(Trans); return(New); }
void Destroy_Parametric(OBJECT* Object) { Destroy_Transform(((PARAMETRIC *)Object)->Trans); Destroy_Function(((PARAMETRIC *)Object)->Function[0]); Destroy_Function(((PARAMETRIC *)Object)->Function[1]); Destroy_Function(((PARAMETRIC *)Object)->Function[2]); Destroy_PrecompParVal(((PARAMETRIC *)Object)->PData); POV_FREE(Object); }
ObjectPtr Torus::Copy() { Torus *New = new Torus(); Destroy_Transform(New->Trans); *New = *this; New->Trans = Copy_Transform(Trans); return (New); }
ObjectPtr Fractal::Copy() { Fractal *New = new Fractal(); Destroy_Transform(New->Trans); *New = *this; New->Trans = Copy_Transform(Trans); New->Rules = Rules; return (New); }
ObjectPtr Lemon::Copy() { Lemon *New = new Lemon(); Destroy_Transform(New->Trans); *New = *this; New->Trans = Copy_Transform(Trans); return (New); }
ObjectPtr Sor::Copy() { Sor *New = new Sor(); Destroy_Transform(New->Trans); *New = *this; New->Trans = Copy_Transform(Trans); New->Spline->References++; return(New); }
ObjectPtr Lathe::Copy() { Lathe *New = new Lathe(); Destroy_Transform(New->Trans); *New = *this; New->Trans = Copy_Transform(Trans); New->Spline = Spline; New->Spline->References++; return(New); }
Polygon::~Polygon() { if (--(Data->References) == 0) { POV_FREE (Data->Points); POV_FREE (Data); } Destroy_Transform(Trans); }
ObjectPtr Polygon::Copy() { Polygon *New = new Polygon(); Destroy_Transform(New->Trans); *New = *this; New->Trans = Copy_Transform(Trans); New->Data = Data; New->Data->References++; return (New); }
Lathe::~Lathe() { Destroy_Transform(Trans); if (--(Spline->References) == 0) { Destroy_BCyl(Spline->BCyl); POV_FREE(Spline->Entry); POV_FREE(Spline); } }
Sor::~Sor() { Destroy_Transform(Trans); if (--(Spline->References) == 0) { Destroy_BCyl(Spline->BCyl); delete[] Spline->Entry; delete Spline; } }
ObjectPtr Parametric::Copy() { Parametric *New = new Parametric(); Destroy_Transform(New->Trans); *New = *this; New->Function[0] = Parser::Copy_Function(vm, Function[0]); New->Function[1] = Parser::Copy_Function(vm, Function[1]); New->Function[2] = Parser::Copy_Function(vm, Function[2]); New->Trans = Copy_Transform(Trans); New->PData = Copy_PrecompParVal(); return (New); }
static PLANE *Copy_Plane (OBJECT *Object) { PLANE *New; New = Create_Plane(); Destroy_Transform(New->Trans); *New = *((PLANE *)Object); New->Trans = Copy_Transform(((PLANE *)Object)->Trans); return(New); }
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; }
static void Destroy_Polygon(OBJECT *Object) { POLYGON *Polyg = (POLYGON *)Object; if (--(Polyg->Data->References) == 0) { POV_FREE (Polyg->Data->Points); POV_FREE (Polyg->Data); } Destroy_Transform(Polyg->Trans); POV_FREE (Object); }
Sphere::~Sphere() { #if(DUMP_OBJECT_DATA == 1) Debug_Info("{ // SPHERE \n"); DUMP_OBJECT_FIELDS(this); Debug_Info("\t{ %f, %f, %f }, // Center\n", \ (DBL)Center[X], \ (DBL)Center[Y], \ (DBL)Center[Z]); \ Debug_Info("\t%f // Radius\n", (DBL)Radius); Debug_Info("}\n"); #endif Destroy_Transform(Trans); }
static void Destroy_Plane(OBJECT *Object) { #if(DUMP_OBJECT_DATA == 1) Debug_Info("{ // PLANE \n"); DUMP_OBJECT_FIELDS(Object); Debug_Info("\t{ %f, %f, %f }, // Normal_Vector\n", \ (DBL)((PLANE *)Object)->Normal_Vector[X], \ (DBL)((PLANE *)Object)->Normal_Vector[Y], \ (DBL)((PLANE *)Object)->Normal_Vector[Z]); \ Debug_Info("\t%f // Distance\n", (DBL)((PLANE *)Object)->Distance); Debug_Info("}\n"); #endif Destroy_Transform(((PLANE *)Object)->Trans); POV_FREE(Object); }
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; } }