00001 /* T R A N S F O R M . C 00002 * BRL-CAD 00003 * 00004 * Copyright (c) 2006 United States Government as represented by 00005 * the U.S. Army Research Laboratory. 00006 * 00007 * This library is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU Lesser General Public License 00009 * as published by the Free Software Foundation; either version 2 of 00010 * the License, or (at your option) any later version. 00011 * 00012 * This library is distributed in the hope that it will be useful, but 00013 * WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 * Lesser General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU Lesser General Public 00018 * License along with this file; see the file named COPYING for more 00019 * information. 00020 */ 00021 /** @file transform.c 00022 * 00023 */ 00024 #include "common.h" 00025 00026 #include "machine.h" 00027 #include "raytrace.h" 00028 00029 00030 /** r t _ m a t r i x _ t r a n s f o r m 00031 * 00032 * apply a matrix transformation to a given input object, setting the 00033 * resultant transformed object as the output solid. if free is set, 00034 * the input object will be released. 00035 * 00036 * returns zero if matrix transform was applied, non-zero on failure. 00037 */ 00038 int 00039 rt_matrix_transform(struct rt_db_internal *output, const mat_t matrix, struct rt_db_internal *input, int free, struct db_i *dbip, struct resource *resource) 00040 { 00041 int ret; 00042 00043 RT_CK_DB_INTERNAL(output); 00044 RT_CK_DB_INTERNAL(input); 00045 RT_CK_DBI(dbip); 00046 RT_CK_RESOURCE(resource); 00047 00048 ret = rt_functab[input->idb_type].ft_xform( output, matrix, input, free, dbip, resource ); 00049 00050 return ret; 00051 } 00052 00053 00054 /* 00055 * Local Variables: 00056 * mode: C 00057 * tab-width: 8 00058 * c-basic-offset: 4 00059 * indent-tabs-mode: t 00060 * End: 00061 * ex: shiftwidth=4 tabstop=8 00062 */