Difference between revisions of "Changing the properties of primitive objects"

From BRL-CAD
(Created page with "We have determined the properties of a primitive object. From the mged console, we now wish to change the properties of this o...")
 
 
Line 1: Line 1:
We have [[Determining the properties of primitives|determined the properties of a primitive object]]. From the [[mged]] console, we now wish to change the properties of this object. The following example demonstrates how to change the height of a [[right circular cylinder]].
+
MGED provides several different ways to modify and reposition [[BRL-CAD Primitives]] by changing the values of their associated parameters:
  
The following command can be used to change the height of a [[right circular cylinder]] [[primitive object]]:
+
* the [[#Primitive Editor | primitive object editor]] dialog box
 +
* the [[#Interactive editing | interactive editing]] commands
 +
* the get and put [[#TCL Commands | TCL commands]]
  
 +
See also: [[Determining the properties of primitive objects]]
 +
;
  
 +
= Primitive Editor =
  
The parameters of many primitive objects can be edited using the Primitive Editor dialog box:
+
Most of the parameters associated with many primitive objects can be edited using the '''Primitive Editor''' dialog box:
# Invoke the GUI '''Edit-->Primitive Editor''' command to display that form.
+
# Invoke the GUI '''Edit-->Primitive Editor''' command to display that dialog.
# Type the object's name into the '''Name:''' field and then click the '''Reset''' button to display its current parameter values (and add it to the Display Window if it wasn't previously drawn there).  
+
# Type the object's name into the '''Name:''' field and then click the '''Reset''' button to display its associated form and the current values of its editable parameters.  
# Interactively edit the object by changing various parameter values. Your changes are immediately written to the database and the Display Window is updated each time you click the '''Apply''' or '''OK''' button (OK also closes the dialog box). Unapplied changes can be undone by clicking the '''Reset''' button.
+
# Interactively change and reposition the object by changing appropriate parameter values. Your changes are immediately written to the database and the object is redrawn in the Display Window each time you click the '''Apply''' or '''OK''' button (OK also closes the dialog box). Unapplied changes can be undone by clicking the '''Reset''' button.
 
# Repeat the above steps to edit additional objects, or click the '''OK''' or '''Dismiss''' button to close the dialog.
 
# Repeat the above steps to edit additional objects, or click the '''OK''' or '''Dismiss''' button to close the dialog.
  
Alternately, any ''displayed'' primitive object can be selected for modification or relocation using either the GUI '''Edit-->Primitive Selection...''' or the CLI '''sed''' command. Objects that aren't currently displayed will not be listed in the Primitive Selection Menu dialog, and the sed command will display an error message if you attempt to select such an object. In either case, the object could then be selected after using the CLI '''draw''' or '''B''' command to display it,
+
Note that forms have not been defined for all object types. Those that lack such forms cannot be edited using this method.
  
;Most parameters (including ones not editable from a form) have special items on the edit menu.
+
= Interactive editing =
  
Primitive objects can also be edited by using a TCL '''get''' command to view its current database entry, then '''kill''' that object and recreate it using a TCL '''put''' command.
+
Any ''currently displayed'' primitive object can be selected for modification or relocation using either the GUI '''Edit-->Primitive Selection...''' or the CLI [[MGED CMD sed | '''sed''']] command.
  
=For additional information=
+
Objects that aren't currently displayed will not be listed in the Primitive Selection Menu dialog, and the sed command will display an error message if you try to edit such an object. In either case, using the CLI '''draw''' or '''B''' command to display such an object would then allow you to select it for editing.
 +
 
 +
When such an object is selected for editing, the '''Edit''' menu will display a set of commands specific to the corresponding primitive type. Invoking any such command will allow you to change the corresponding parameter(s) by entering CLI '''p''' commands or activating the Graphics Window and using associated '''shift grip''' mouse actions. Similarly, the CLI will enable various edit-mode commands that can be used to modify or relocate the selected primitive. As you use either approach to make such changes, you can:
 +
* record the changes you have made so far by invoking the GUI '''Edit-->Apply''' or entering the CLI '''apply''' command;
 +
* undo any unrecorded changes by invoking the GUI '''Edit-->Reset''' or entering the CLI '''reset''' command;
 +
* record the changes you have made and return to viewing mode by invoking the GUI '''Edit-->Accept''' or entering the CLI '''accept''' command; or
 +
* discard any unrecorded changes and return to the viewing mode by invoking the GUI '''Edit-->Reject''' or entering the CLI '''reject''' command. You can also reject unrecorded changes by pressing the escape key while the Graphics Window is active.
 +
 
 +
= TCL Commands =
 +
 
 +
Although it is a cumbersome approach that is best reserved for scripted editing, primitive objects can also be edited by entering TCL '''get''' and '''put''' commands via the CLI:
 +
# Enter a "get object_name" command to display the current database entry for that object.
 +
# Enter a "kill object_name" command to delete that database entry and erase the object from the Graphics Window.
 +
# Enter a "put object_name properties" command to recreate that object with modified parameter values.
 +
# Enter a "draw object_name" command to redisplay the object and verify your changes.

Latest revision as of 18:26, 27 May 2013

MGED provides several different ways to modify and reposition BRL-CAD Primitives by changing the values of their associated parameters:

See also: Determining the properties of primitive objects

Primitive Editor[edit]

Most of the parameters associated with many primitive objects can be edited using the Primitive Editor dialog box:

  1. Invoke the GUI Edit-->Primitive Editor command to display that dialog.
  2. Type the object's name into the Name: field and then click the Reset button to display its associated form and the current values of its editable parameters.
  3. Interactively change and reposition the object by changing appropriate parameter values. Your changes are immediately written to the database and the object is redrawn in the Display Window each time you click the Apply or OK button (OK also closes the dialog box). Unapplied changes can be undone by clicking the Reset button.
  4. Repeat the above steps to edit additional objects, or click the OK or Dismiss button to close the dialog.

Note that forms have not been defined for all object types. Those that lack such forms cannot be edited using this method.

Interactive editing[edit]

Any currently displayed primitive object can be selected for modification or relocation using either the GUI Edit-->Primitive Selection... or the CLI sed command.

Objects that aren't currently displayed will not be listed in the Primitive Selection Menu dialog, and the sed command will display an error message if you try to edit such an object. In either case, using the CLI draw or B command to display such an object would then allow you to select it for editing.

When such an object is selected for editing, the Edit menu will display a set of commands specific to the corresponding primitive type. Invoking any such command will allow you to change the corresponding parameter(s) by entering CLI p commands or activating the Graphics Window and using associated shift grip mouse actions. Similarly, the CLI will enable various edit-mode commands that can be used to modify or relocate the selected primitive. As you use either approach to make such changes, you can:

  • record the changes you have made so far by invoking the GUI Edit-->Apply or entering the CLI apply command;
  • undo any unrecorded changes by invoking the GUI Edit-->Reset or entering the CLI reset command;
  • record the changes you have made and return to viewing mode by invoking the GUI Edit-->Accept or entering the CLI accept command; or
  • discard any unrecorded changes and return to the viewing mode by invoking the GUI Edit-->Reject or entering the CLI reject command. You can also reject unrecorded changes by pressing the escape key while the Graphics Window is active.

TCL Commands[edit]

Although it is a cumbersome approach that is best reserved for scripted editing, primitive objects can also be edited by entering TCL get and put commands via the CLI:

  1. Enter a "get object_name" command to display the current database entry for that object.
  2. Enter a "kill object_name" command to delete that database entry and erase the object from the Graphics Window.
  3. Enter a "put object_name properties" command to recreate that object with modified parameter values.
  4. Enter a "draw object_name" command to redisplay the object and verify your changes.