// Include currently for testing povr keywords: id_type() and // id_types_match(,) #declare ID_type_float = 1.0; #declare ID_type_string = "1.0"; #declare ID_type_vector2D = <1,1>; #declare ID_type_vector3D = <1,1,1>; #declare ID_type_vector4D = <1,1,1,1>; #declare ID_type_vector5D = <1,1,1,1,1>; #declare ID_type_dictionary = dictionary; #declare ID_type_array = array[1]; #declare ID_type_array_mixed = array mixed [1]; #declare ID_type_sphere = sphere {0,1} #declare ID_type_box = box {0,1} #declare ID_type_object = object { sphere {0,1} } #declare ID_type_union = union { object { ID_type_sphere } object { ID_type_box } } #declare ID_type_merge = merge { object { ID_type_sphere } object { ID_type_box } } #declare ID_type_color = color rgb 1; #declare ID_type_finish = finish { emission 1 } #declare ID_type_normal = normal { wrinkles } #declare ID_type_pigment = pigment { color rgb 1 } #declare ID_type_texture = texture { ID_type_pigment ID_type_normal ID_type_finish } #debug "---\n" #debug concat("float = ",str(id_type(ID_type_float),4,1),"\n") #debug concat("string = ",str(id_type(ID_type_string),4,1),"\n") #debug concat("vector2D = ",str(id_type(ID_type_vector2D),4,1),"\n") #debug concat("vector3D = ",str(id_type(ID_type_vector3D),4,1),"\n") #debug concat("vector4D = ",str(id_type(ID_type_vector4D),4,1),"\n") #debug concat("vector5D = ",str(id_type(ID_type_vector5D),4,1),"\n") #debug concat("dictionary = ",str(id_type(ID_type_dictionary),4,1),"\n") #debug concat("array = ",str(id_type(ID_type_array),4,1),"\n") #debug concat("array_mixed = ",str(id_type(ID_type_array_mixed),4,1),"\n") #debug concat("sphere = ",str(id_type(ID_type_sphere),4,1),"\n") #debug concat("box = ",str(id_type(ID_type_box),4,1),"\n") #debug concat("object = ",str(id_type(ID_type_object),4,1),"\n") #debug concat("merge = ",str(id_type(ID_type_merge),4,1),"\n") #debug concat("union = ",str(id_type(ID_type_union),4,1),"\n") #debug concat("color = ",str(id_type(ID_type_color),4,1),"\n") #debug concat("finish = ",str(id_type(ID_type_finish),4,1),"\n") #debug concat("normal = ",str(id_type(ID_type_normal),4,1),"\n") #debug concat("pigment = ",str(id_type(ID_type_pigment),4,1),"\n") #debug concat("texture = ",str(id_type(ID_type_texture),4,1),"\n") #debug "---\n" #macro Mcr_ID_type(_id) #switch (id_type(_id)) #case (id_type(global.ID_type_float)) #debug "Float\n" #break #case (id_type(global.ID_type_string)) #debug "String\n" #break #case (id_type(global.ID_type_vector2D)) #debug "Vector 2D\n" #break #else #error "Not a type defined in the macro Mcr_ID_type\n" #end #debug "\n" #end #macro Mcr_ID_type_test() #local _ID_type_float = 1.0; #local _ID_type_string = "1.0"; #local _ID_type_vector2D = <1,1>; #local _ID_type_vector3D = <1,1,1>; #local _ID_type_vector4D = <1,1,1,1>; #local _ID_type_vector5D = <1,1,1,1,1>; #local _ID_type_dictionary = dictionary; #local _ID_type_array = array[1]; #local _ID_type_array_mixed = array mixed [1]; #local _ID_type_sphere = sphere {0,1}; #local _ID_type_box = box {0,1}; #local _ID_type_object = object { sphere {0,1} }; #if (id_types_match(global.ID_type_float,_ID_type_float)) #debug "float 1 1\n" #else #debug "float 1 0\n" #end #if (id_types_match(global.ID_type_string,_ID_type_string)) #debug "string 1 1\n" #else #debug "string 1 0\n" #end #if (id_types_match(global.ID_type_vector2D,_ID_type_vector2D)) #debug "vector2D 1 1\n" #else #debug "vector2D 1 0\n" #end #if (id_types_match(global.ID_type_vector3D,_ID_type_vector3D)) #debug "vector3D 1 1\n" #else #debug "vector3D 1 0\n" #end #if (id_types_match(global.ID_type_vector4D,_ID_type_vector4D)) #debug "vector4D 1 1\n" #else #debug "vector4D 1 0\n" #end #if (id_types_match(global.ID_type_vector5D,_ID_type_vector5D)) #debug "vector5D 1 1\n" #else #debug "vector5D 1 0\n" #end #if (id_types_match(global.ID_type_dictionary,_ID_type_dictionary)) #debug "dictionary 1 1\n" #else #debug "dictionary 1 0\n" #end #if (id_types_match(global.ID_type_array,_ID_type_array)) #debug "array 1 1\n" #else #debug "array 1 0\n" #end #if (id_types_match(global.ID_type_array_mixed, _ID_type_array_mixed)) #debug "array_mixed 1 1\n" #else #debug "array_mixed 1 0\n" #end #if (id_types_match(global.ID_type_array, _ID_type_array_mixed)) #debug "array-array_mixed 1 0\n" #else #debug "array-array_mixed 1 1\n" #end #if (id_types_match(global.ID_type_float,_ID_type_vector2D)) #debug "float-vector2D 1 0\n" #else #debug "float-vector2D 1 1\n" #end #debug "\n" #end