(******************************************************************************
*                                OBJ3D11 .DEF                                 *
*                              ABO Software Dep.                              *
*                                                                             *
* Purpose : To provide a database of 3D objects.                              *
*                                                                             *
*   Notes : This module is very simple.                                       *
*                                                                             *
*         Version Date : 22/10/92                                             *
******************************************************************************)
DEFINITION MODULE OBJ3D1;

FROM FIO IMPORT File;
FROM MTRX3D1  IMPORT Matrix3D;
FROM PNT3D1   IMPORT Point3D;
FROM SHP3D1   IMPORT Shape3D;
FROM COLOR1   IMPORT ColorRGB;
FROM VIEW3D1  IMPORT View3D;

CONST
	MAXELEMENT=32;

TYPE
	Object3DPtr		= POINTER TO Object3D;
	Element3DKey	= INTEGER;
	Object3DKind	= (shape,object);

	Element3D = RECORD
(*		Color      : ColorRGB;*)
		Position   : Matrix3D;
		Object     : Object3DPtr;
  	END;

	Object3D = RECORD
		refcount:INTEGER;
		CASE Kind:Object3DKind OF
			|shape:
				Color      : ColorRGB;
				Shape      : Shape3D;
			|object:	
				Elements   : INTEGER;
				Element    : ARRAY[1..MAXELEMENT] OF Element3D;
		END;
	END;

(*
PROCEDURE RdObj(VAR o:Object3DPtr);

PROCEDURE WrObj(o:Object3DPtr);
*)

PROCEDURE make_object(VAR o:Object3DPtr);

PROCEDURE make_shape(VAR o:Object3DPtr;s:Shape3D;c:ColorRGB);

PROCEDURE free_object(VAR o:Object3DPtr);

PROCEDURE copy_object(VAR dest:Object3DPtr;source:Object3DPtr);

PROCEDURE deepcopy_object(VAR dest:Object3DPtr;source:Object3DPtr);

PROCEDURE ins_element(
	o		:Object3DPtr;
	e		:Object3DPtr;
	pos		:Matrix3D)	:Element3DKey;

PROCEDURE get_element(
	VAR e	:Object3DPtr;
	o		:Object3DPtr;
	id		:Element3DKey);

PROCEDURE mov_element(
	o		:Object3DPtr;
	id		:Element3DKey;
	move	:Matrix3D);

PROCEDURE rem_element(
	o		:Object3DPtr;
	id		:Element3DKey);

PROCEDURE displayobject(
	o:Object3DPtr;
	pos:Matrix3D;
(*	color:ColorRGB;*)	
	view:View3D);

PROCEDURE debugo(o:Object3DPtr);

	
END OBJ3D1.
