/*****************************************************************************1*2* Elmer, A Finite Element Software for Multiphysical Problems3*4* Copyright 1st April 1995 - , CSC - IT Center for Science Ltd., Finland5*6* This program is free software; you can redistribute it and/or7* modify it under the terms of the GNU General Public License8* as published by the Free Software Foundation; either version 29* of the License, or (at your option) any later version.10*11* This program is distributed in the hope that it will be useful,12* but WITHOUT ANY WARRANTY; without even the implied warranty of13* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the14* GNU General Public License for more details.15*16* You should have received a copy of the GNU General Public License17* along with this program (in file fem/GPL-2); if not, write to the18* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,19* Boston, MA 02110-1301, USA.20*21*****************************************************************************/2223/*******************************************************************************24*25* The character of the routines in this file.26*27*******************************************************************************28*29* Author: Juha Ruokolainen30*31* Address: CSC - IT Center for Science Ltd.32* Keilaranta 14, P.O. BOX 40533* 02101 Espoo, Finland34* Tel. +358 0 457 272335* Telefax: +358 0 457 230236* EMail: [email protected]37*38* Date: 1 Oct 199539*40* Modification history:41*42******************************************************************************/4344#ifdef MODULE_OBJECTS45# define OBJ_EXT46#else47# define OBJ_EXT extern48#endif4950typedef double matrix_t[4][4];5152typedef enum53{54rot_pri_xyz,55rot_pri_xzy,56rot_pri_yxz,57rot_pri_yzx,58rot_pri_zxy,59rot_pri_zyx,60rot_pri_local,61rot_pri_parent62} rot_pri_t;6364typedef enum65{66trn_pri_trs,67trn_pri_tsr,68trn_pri_rts,69trn_pri_rst,70trn_pri_str,71trn_pri_srt72} trn_pri_t;7374typedef struct transform_s75{76struct transform_list_s *Children;77struct transform_s *Parent;7879matrix_t Matrix;8081matrix_t RotMatrix;82matrix_t TrnMatrix;83matrix_t SclMatrix;8485double RotX,RotY,RotZ;86double TrnX,TrnY,TrnZ;87double SclX,SclY,SclZ;8889rot_pri_t RotationPriority;90trn_pri_t TransformPriority;91} transform_t;9293typedef struct transform_list_s94{95struct transform_list_s *Next;96transform_t *Entry;97} transform_list_t;9899typedef struct object_s100{101struct object_s *Next;102int Id;103char *Name;104105transform_t Transform;106107element_model_t *ElementModel;108109geometry_t *Geometry;110111int ClipPlane[6];112double ClipEquation[6][4];113114struct visual_s *VisualList;115} object_t;116117OBJ_EXT object_t VisualObject,RotObject,*CurrentObject;118OBJ_EXT double PiDiv180;119120void obj_object_initialize( object_t *object );121object_t *obj_new(char *name);122object_t *obj_add_object( object_t *object,char *name );123object_t *obj_find( object_t *object,char *name );124int obj_display_list( object_t *object,double t );125void obj_init_transform( transform_t *transform );126void obj_get_matrix(matrix_t matrix,object_t *object);127void obj_get_matrix_transpose( matrix_t matrix,object_t *object );128void obj_set_rotation_priority( object_t *object, rot_pri_t priority);129void obj_set_transform_priority( object_t *object, trn_pri_t priority);130int obj_set_parent( object_t *object,object_t *parent );131void obj_rotate( object_t *object,double x,double y,double z,int which,int relative );132void obj_scale( object_t *object,double x,double y,double z,int which, int relative );133void obj_translate( object_t *object,double x,double y,double z,int which,int relative );134void obj_set_matrix( object_t *object );135136137