Пример #1
0
 public CameraBase(CameraLens lens)
 {
     this.lens = lens;
     c2w = new MovingMatrix4(null);
     w2c = new MovingMatrix4(null);
     shutterOpen = shutterClose = 0;
 }
Пример #2
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     if (this.CheckDataBeforeSave())
     {
         CameraLens item = new CameraLens()
         {
             Name             = this.tbName.Text.Trim(),
             Number           = this.tbNumber.Text.Trim(),
             Connector        = Convert.ToInt32(this.cbInter.SelectedValue),
             Focus            = Convert.ToSingle(this.tbFocus.Text),
             Flange           = Convert.ToSingle(this.tbFlange.Text),
             Length           = Convert.ToSingle(this.tbLength.Text),
             HH               = Convert.ToSingle(this.tbHH.Text),
             RatioMin         = Convert.ToSingle(this.tbRatioMin.Text),
             RatioMax         = Convert.ToSingle(this.tbRatioMax.Text),
             Target           = Convert.ToSingle(this.tbTarget.Text),
             Weight           = this.tbWeight.Text.Trim().Equals(string.Empty) ? 0 : Convert.ToInt32(this.tbWeight.Text),
             Contrast         = this.tbFreq.Text.Trim().Equals(string.Empty) ? 0 : Convert.ToInt32(this.tbFreq.Text),
             Distort          = this.tbDistort.Text.Trim().Equals(string.Empty) ? 0 : Convert.ToInt32(this.tbDistort.Text),
             ResolutionLength = this.tbResoLength.Text.Trim().Equals(string.Empty) ? 0 : Convert.ToInt32(this.tbResoLength.Text),
             ResolutionWidth  = this.tbResoWidth.Text.Trim().Equals(string.Empty) ? 0 : Convert.ToInt32(this.tbResoWidth.Text)
         };
         this.handlerAfterSave(this, enumProductType.CamLens, dbHandler.InsertItem(item));
     }
 }
Пример #3
0
 public CameraBase(CameraLens lens)
 {
     this.lens   = lens;
     c2w         = new MovingMatrix4(null);
     w2c         = new MovingMatrix4(null);
     shutterOpen = shutterClose = 0;
 }
Пример #4
0
 /**
  * Defines a camera with a given name. The camera is built from the
  * specified camera lens type plugin. If the lens type name is left
  * <code>null</code>, the camera with the given name will be updated (if
  * it exists). It is not currently possible to change the lens of a camera
  * after it has been created.
  *
  * @param name camera name
  * @param lensparam lensType a camera lens plugin type name
  */
 public void camera(string name, string lensType)
 {
     if (!isIncremental(lensType))
     {
         // we are declaring this camera for the first time
         if (renderObjects.has(name))
         {
             UI.printError(UI.Module.API, "Unable to declare camera \"{0}\", name is already in use", name);
             parameterList.clear(true);
             return;
         }
         CameraLens lens = PluginRegistry.cameraLensPlugins.createObject(lensType);
         if (lens == null)
         {
             UI.printError(UI.Module.API, "Unable to create a camera lens of type \"{0}\"", lensType);
             return;
         }
         renderObjects.put(name, new CameraBase(lens));
     }
     // update existing shader (only if it is valid)
     if (lookupCamera(name) != null)
     {
         update(name);
     }
     else
     {
         UI.printError(UI.Module.API, "Unable to update camera \"{0}\" - camera object was not found", name);
         parameterList.clear(true);
     }
 }
Пример #5
0
 /**
  * Defines a camera with a given name. The camera is built from the
  * specified {@link CameraLens}. If the lens object is <code>null</code>,
  * the camera with the given name will be updated (if it exists). It isn't
  * possible to change the lens of an existing camera.
  *
  * @param name camera name
  * @param lens camera lens to use
  */
 public void camera(string name, CameraLens lens)
 {
     if (lens != null)
     {
         // we are declaring this camera for the first time
         if (renderObjects.has(name))
         {
             UI.printError(UI.Module.API, "Unable to declare camera \"{0}\", name is already in use", name);
             parameterList.clear(true);
             return;
         }
         renderObjects.put(name, new CameraBase(lens));
     }
     // update existing shader (only if it is valid)
     if (lookupCamera(name) != null)
     {
         update(name);
     }
     else
     {
         UI.printError(UI.Module.API, "Unable to update camera \"{0}\" - camera object was not found", name);
         parameterList.clear(true);
     }
 }
Пример #6
0
 public CameraBase(CameraLens lens)
 {
     this.lens = lens;
     c2w = w2c = new Matrix4[1]; // null
 }
Пример #7
0
 public CameraBase(CameraLens lens)
 {
     this.lens = lens;
     c2w       = w2c = new Matrix4[1]; // null
 }