public ICommand CreateCommand()
        {
            ICommand ret = null;
            using (AddObjectDialog dlg = new AddObjectDialog(app.Assets))
            {
                bool showAgain = false;
                DialogResult result;
                do
                {
                    result = dlg.ShowDialog();
                    showAgain = false;
                    if (result == DialogResult.OK)
                    {
                        // do validation here
                        // if validation fails, set showAgain to true
                        showAgain = ((result == DialogResult.OK) && (!dlg.okButton_validating()));
                    }

                } while (showAgain);
                if (result == DialogResult.OK)
                {
                    ret = new AddObjectCommand(app, parent, dlg.ObjectName, dlg.ObjectMeshName, dlg.RandomRotation, dlg.RandomScale, dlg.MinScale, dlg.MaxScale, dlg.MultiPlacement);
                }
            }

            return ret;
        }
        public ICommand CreateCommand()
        {
            ICommand ret = null;

            using (AddObjectDialog dlg = new AddObjectDialog(app.Assets))
            {
                bool         showAgain = false;
                DialogResult result;
                do
                {
                    result    = dlg.ShowDialog();
                    showAgain = false;
                    if (result == DialogResult.OK)
                    {
                        // do validation here
                        // if validation fails, set showAgain to true
                        showAgain = ((result == DialogResult.OK) && (!dlg.okButton_validating()));
                    }
                } while (showAgain);
                if (result == DialogResult.OK)
                {
                    ret = new AddObjectCommand(app, parent, dlg.ObjectName, dlg.ObjectMeshName, dlg.RandomRotation, dlg.RandomScale, dlg.MinScale, dlg.MaxScale, dlg.MultiPlacement);
                }
            }

            return(ret);
        }
Exemple #3
0
        protected bool ObjectValidate(List <Vector3> points, Vector3 location)
        {
            Vector3          scaleVec = new Vector3(scale, scale, scale);
            Vector3          rotVec   = new Vector3(0, rotation, 0);
            AddObjectCommand addCmd   = new AddObjectCommand(app, parent, String.Format("{0}-{1}", name, objectNumber), meshName, randomRotation, randomScale, minScale, maxScale, location);

            app.ExecuteCommand(addCmd);
            objectNumber++;
            return(true);
        }
 protected bool ObjectValidate(List<Vector3> points, Vector3 location)
 {
     Vector3 scaleVec = new Vector3(scale, scale, scale);
     Vector3 rotVec = new Vector3(0, rotation, 0);
     AddObjectCommand addCmd = new AddObjectCommand(app, parent, String.Format("{0}-{1}", name, objectNumber), meshName, randomRotation, randomScale, minScale, maxScale, location);
     app.ExecuteCommand(addCmd);
     objectNumber++;
     return true;
 }