indexing description: "[ This factory creates 3d objects. ]" date: "$Date$" revision: "$Revision$" deferred class EM_3D_OBJECT_FACTORY inherit EM_CONSTANTS export {NONE} all end GL_FUNCTIONS export {NONE} all end feature -- Commands create_object: EM_3D_OBJECT is -- Creates a new object; -- TODO: Rename to `new_object'. local new_object: EM_3D_OBJECT_DISPLAYLIST do if not unchanged then compile unchanged := true end create new_object.make (displaylist, object_width, object_height, object_depth) result := new_object ensure unchanged: unchanged end feature -- Status unchanged: BOOLEAN -- Are the model informations unchanged? object_width: DOUBLE is -- The size of the bounding box in x direction of created objects deferred ensure result >= 0 end object_height: DOUBLE is -- The size of the bounding box in y direction of created objects deferred ensure result >= 0 end object_depth: DOUBLE is -- The size of the bounding box in z direction of created objects deferred ensure result >= 0 end feature {EM_3D_OBJECT_FACTORY} -- Deferred features that should not be accessible from the outside specify_object is -- Specify an object that can be drawn in the origin -- (front, left, lower corner of bounding box = 0,0,0) deferred end feature {NONE} -- Implementation compile is -- Compile the object do displaylist := gl_gen_lists (1) gl_new_list (displaylist, EM_GL_COMPILE) specify_object gl_end_list ensure displaylist_allocated: displaylist /= 0 end displaylist: INTEGER end