00001
00002
00003 #include "Iguana/Inventor/interface/IgSoEllipsoid.h"
00004 #include <Inventor/nodes/SoSphere.h>
00005 #include <Inventor/nodes/SoScale.h>
00006 #include <Inventor/nodes/SoRotation.h>
00007 #include <Inventor/nodes/SoTranslation.h>
00008
00009
00010
00011
00012
00013
00014
00015
00016 SO_KIT_SOURCE (IgSoEllipsoid);
00017
00018
00019
00020
00021
00022 void
00023 IgSoEllipsoid::initClass (void)
00024 { SO_KIT_INIT_CLASS (IgSoEllipsoid, IgSoShapeKit, "IgSoShapeKit"); }
00025
00026 IgSoEllipsoid::IgSoEllipsoid (void)
00027 {
00028 SO_KIT_CONSTRUCTOR (IgSoEllipsoid);
00029 SO_KIT_ADD_FIELD (eigenvalues, (1.0,1.0,1.0));
00030 SO_KIT_ADD_FIELD (rotation, (SbVec3f (0,0,1),0));
00031 SO_KIT_ADD_FIELD (center, (0,0,0));
00032
00033 SO_KIT_ADD_CATALOG_ENTRY (trans, SoTranslation, FALSE, separator,\x0, TRUE);
00034 SO_KIT_ADD_CATALOG_ENTRY (rot, SoRotation, FALSE, separator,\x0, TRUE);
00035 SO_KIT_ADD_CATALOG_ENTRY (scale, SoScale, FALSE, separator,\x0, TRUE);
00036 SO_KIT_ADD_CATALOG_ENTRY (sphere, SoSphere, FALSE, separator,\x0, TRUE);
00037 SO_KIT_INIT_INSTANCE ();
00038 setUpConnections (true, true);
00039 }
00040
00041 void
00042 IgSoEllipsoid::refresh (void)
00043 {
00044 SoTranslation *trans = new SoTranslation;
00045 SoRotation *rot = new SoRotation;
00046 SoScale *scale = new SoScale;
00047 SoSphere *sphere = new SoSphere;
00048
00049 rot->rotation = rotation;
00050 trans->translation = center;
00051 scale->scaleFactor = eigenvalues;
00052
00053 setPart ("rot", rot);
00054 setPart ("trans", trans);
00055 setPart ("scale", scale);
00056 setPart ("sphere", sphere);
00057 }