Beispiel #1
0
        private void setupControl()
        {
            _wristControl = new FullWristControl();
            _wristControl.setupControl(WristFilesystem.LongBoneNames, false);
            //disable long bones
            for (int i = 10; i < WristFilesystem.NumBones; i++)
            {
                _wristControl.disableBone(i);
            }

            WristPanelLayoutControl p = new WristPanelLayoutControl();

            p.addControl(_wristControl);

            _animationControl = new AnimationControl();
            _animationControl.setupController(_numPositions);
            _animationControl.FPS = DEFAULT_FPS;
            _animationControl.StopButtonEnabled = false;

            p.addControl(_animationControl);

            //save control
            _control = p;

            setupEventListeners();
        }
Beispiel #2
0
        public TextureController(Separator root, Separator[] bones, TransformParser parser)
        {
            _root   = root;
            _bones  = bones;
            _parser = parser;

            if (parser == null)
            {
                _textureControl = null;
                return;
            }

            _transformHashtables = parser.getArrayOfTransformHashtables();
            _textureControl      = new TextureControl(parser.getArrayOfAllignmentSteps());
            _fullWristControl    = new FullWristControl();
            _fullWristControl.setupControl(WristFilesystem.LongBoneNames, false);
            _mainControlPanel = new WristPanelLayoutControl();
            _mainControlPanel.addControl(_textureControl);
            _mainControlPanel.addControl(_fullWristControl);

            _editableTransforms = parser.getArrayOfOptimizedBothTransforms();
            setupListeners();

            //set the current editable transform
            _textureControl_SelectedTransformChanged();
        }
Beispiel #3
0
 private void setupControl()
 {
     _layoutControl = new WristPanelLayoutControl();
     _wristControl  = new FullWristControl();
     _wristControl.setupControl(WristFilesystem.LongBoneNames, true);
     _layoutControl.addControl(_wristControl);
 }
Beispiel #4
0
        private void SetupXrommControl()
        {
            string[] seriesNames = createSeriesListWithNiceNames();
            _layoutControl = new WristPanelLayoutControl();
            _wristControl  = new FullWristControl();
            _wristControl.setupControl(_xrommFileSys.ShortBoneNames, true, seriesNames.Length);
            _layoutControl.addControl(_wristControl);

            _animationControl = new AnimationControl();
            _animationControl.EnableInternalTimer();
            _animationControl.FPS = 10; //default
            _layoutControl.addControl(_animationControl);

            _wristControl.clearSeriesList();
            _wristControl.addToSeriesList(seriesNames);
            _wristControl.selectedSeriesIndex = 0;
        }
Beispiel #5
0
        CT mri;//for getting the texture info

        public TextureController(Separator root, Separator[] bones, TransformParser parser, Boolean IsVolumeRenderEnabled)
        {
            isVolumeRenderEnabled = IsVolumeRenderEnabled;
            _root   = root;
            _bones  = bones;
            _parser = parser;

            currTranslation = new float[3];
            currRotation    = new float[3];


            currTranslation[0] = 0; currRotation[0] = 0;
            currTranslation[1] = 0; currRotation[1] = 0;
            currTranslation[2] = 0; currRotation[2] = 0;

            if (parser == null)
            {
                _textureControl = null;
                return;
            }

            _transformHashtables = parser.getArrayOfTransformHashtables();
            _textureControl      = new TextureControl(parser.getArrayOfAllignmentSteps());
            if (!isVolumeRenderEnabled)
            {
                _textureControl.disableVolumeItems();
            }
            _fullWristControl = new FullWristControl();
            _fullWristControl.setupControl(WristFilesystem.LongBoneNames, false);
            _mainControlPanel = new WristPanelLayoutControl();
            _mainControlPanel.addControl(_textureControl);
            _mainControlPanel.addControl(_fullWristControl);

            _editableTransforms = parser.getArrayOfOptimizedBothTransforms();
            setupListeners();

            //set the current editable transform
            _textureControl_SelectedTransformChanged();


            /////////////////////////////////////


            float[] center    = _textureControl.getCurrentCenterOfRotation();
            float[] translate = _textureControl.getCurrentTranslation();
            float[] rotation  = _textureControl.getCurrentRotation();

            currTranslation[0] = translate[0]; currRotation[0] = rotation[0];
            currTranslation[1] = translate[1]; currRotation[1] = rotation[1];
            currTranslation[2] = translate[2]; currRotation[2] = rotation[2];

            _rootSeparator = new Separator();
            _rootSeparator.reference();
            root.addChild(_rootSeparator);
            _centerballVisible = true;
            Scale myScale = new Scale();

            _centerballDragger = new CenterballDragger();
            //get the center of rotation from the form elements
            center[0] += translate[0];
            center[1] += translate[1];
            center[2] += translate[2];



            _rootSeparator.addNode(myScale);
            scaleValues    = new float[3];
            scaleValues[0] = scaleValues[1] = scaleValues[2] = 10;
            myScale.setScaleFactor(scaleValues[0], scaleValues[1], scaleValues[2]);

            _centerballDragger.setRotation(rotation[0], rotation[1], rotation[2]);
            _centerballDragger.setTranslation(center[0] / scaleValues[0], center[1] / scaleValues[1], center[2] / scaleValues[2]);


            _rootSeparator.addChild(_centerballDragger);
            beginningTranslation = _textureControl.getCurrentTranslation();

            CenterballDragger.delFunc d = new CenterballDragger.delFunc(_textureControl_EditableTransformChangedFromCenterball);
            _centerballDragger.addCB(d);

            wasRotated();
        }