Difference between revisions of "Documentation/OOoAuthors User Manual/Draw Guide/Working with Objects"

From Apache OpenOffice Wiki
Jump to: navigation, search
Line 1: Line 1:
 
{{DISPLAYTITLE:Working with Objects and Object Points}}
 
{{DISPLAYTITLE:Working with Objects and Object Points}}
 +
{{NeedsWork}}
 
{{Documentation/DrawObjectsTOC
 
{{Documentation/DrawObjectsTOC
 
|ShowPrevNext=block
 
|ShowPrevNext=block

Revision as of 10:57, 21 March 2008

Template:NeedsWork



This is Chapter 3 of OpenOffice.org 2.x Draw Guide (second edition), produced by the OOoAuthors group. A PDF of this chapter is available from the OOoAuthors Guides page at OpenOffice.org.

Introduction

This chapter looks at the tools and functions that let you modify existing drawings. All of the functions apply to the selected object or group of objects. The selected object or group can be distinguished from others by small colored squares or circles located around the object (this is also true when several objects are selected simultaneously). These points are called handles.

The handles form a rectangular frame that is just big enough to contain the object. Where several objects are selected, the frame around them corresponds to the smallest rectangle that can contain all of the objects. This frame is called the selection rectangle.

If the Options Bar is displayed (View > Toolbars > Options to turn it on if it is not displayed), you can change the size of the handles using two buttons: Simple Handles shows the handles as flat squares, and Large Handles shows the handles in a larger size. You can combine the effects obtained by pressing on both buttons and thus have large handles having a 3D shape or small handles having no 3D shape, whichever suits your needs or preferences. The figure below shows the location of the handles and other buttons.

Figure 1: Location of handles on Draw toolbar.

Selection modes

There are three selection modes:

  1. Moving and changing size
  2. Editing
  3. Rotating points

To set the default mode (1 or 2) for selecting objects, click on the Points button DrawPointsActive.png on the Drawing Toolbar.

In standard mode (when you begin a new drawing), the Points button is not active and the default mode is for selections to be moved or changed in size; these selections are indicated by small green squares.

DrawSelect1.png

When the Points button is active, the default mode is for selections to be edited; these selections are indicated by blue squares. Some objects will have one or more extra handles, which are larger or colored differently. This is explained in more detail in Editing object points.

DrawSelect2.png

Selections for rotating objects are indicated by small red circles and a symbol representing the center of rotation. To choose these selections, click on the Effects drop-down button DrawEffectsIcon.png from the Drawing Toolbar and after that on the object.

DrawSelect3.png

Changing the selection mode

To go from one mode to another, you can do one of the following:

Choose the Points button DrawPointsActive.png from the Drawing Toolbar to switch from simple selection mode to Points mode. You can also use the keyboard shortcut F8 (Points).*

Choose the Effects drop-down button from the Drawing Toolbar DrawEffectsIcon.png to activate the Rotation mode for a selected object. To exit Rotation mode, click on the Selection icon. SelectionIcon.png

If you often work in Rotation mode, you can choose the Rotation Mode after Clicking Object button RotationModeIcon.png from the Options bar and cycle through normal and rotation modes just by clicking on the object. This can be more convenient than repeatedly clicking the selected object, then clicking the Rotate button from the Drawing Toolbar.

  • Keyboard shortcuts can be configured by the user (Tools > Configure > Keyboard). See Chapter 1 for more information.

Selecting objects

Direct selection

To select an object, the easiest way is to click directly on it. For objects that are not filled, you have to click directly on the object’s outline to select it.

Selection by framing

You can select several objects at once by using the mouse to drag a large rectangle around the objects with the Select button, as shown. For this to work the SelectionIcon.png icon on the Draw toolbar must be active.

Only objects that lie entirely within the rectangle will be selected.

SelectByFrame.png

Selecting hidden objects

Even if objects are located behind others and not visible, they can still be selected. To select an object that is covered by another object, hold down the Alt key and click the object. To select an object that is covered by several objects, hold down the Alt key and click through the objects until you reach the required underlying object. To cycle through the objects in reverse order, hold down the Alt+Shift keys when you click. To help in making accurate selections, you can check the number and type of the selected objects, shown at the left of the status bar.

Template:Documentation/Note

To select an object that is covered by another object using the keyboard, use the Tab key to cycle through the objects, stopping at the object you wish to select. To cycle through the objects in reverse order, press Shift+Tab. This is a very quick way to reach the object you want, but it may not be practical if you have a large number of objects in your drawing.

When you click on the selected object, its outline will appear briefly through the objects on top of the selected object.

In the illustration below, the square located beneath the circle was selected in this way (the circle was made semi-transparent in order to see the square).

SelectHidden.png

Arranging objects

In a complex drawing, you may have objects stacked up, one on top of the other, with the result that a particular object is hidden by one or more other objects above it. You can rearrange the stacking order of objects (move an object to the front or to the back of the stack) by selecting the object, clicking Modify > Arrange and selecting the appropriate Bring Forward or Send Backward option, or by right-clicking the object and selecting Arrange from the context menu, then selecting from the list of Bring Forward or Send Backward options.

On the Drawing toolbar the Arrange tear-off menu on the PositionIcon.png button; this menu contains the above options. A keyboard shortcut is Shift+Ctrl++ to bring an object to the top, and Shift+Ctrl+− to send an object to the bottom.

An exception to the above is an object which is located on the Controls layer. Such objects always lie above all other objects and are located within a separate stack on the Controls layer.

Selecting several objects

To select or de-select several objects one by one, hold down the Shift key and click on the various objects to be selected or de-selected. One click on an object selects it, a second click de-selects it.

Moving and dynamically adjusting an object’s size

There are several ways of moving or changing the size of an object. The method described here is called dynamic in the sense that it is carried out using the mouse.

When you dynamically change an object, remember to check the right-hand area of the status bar at the bottom of your screen. This shows detailed information about the ongoing manipulation. For example, during a resizing manipulation, the following information is displayed.

The Info-field (not shown in Figure 2 below) shows which object is selected; the (current) position – X/Y coordinates, and object dimensions – Width x Height, of the object being moved are shown. The information displayed changes as the mouse is moved. The units displayed are those selected under Tools > Options > OpenOffice.org.Draw > General.

Figure 2: Status bar during dynamic adjustment.

Dynamic movement of objects

To move an object, select it and then click within the object’s border and hold down the left mouse button while moving the mouse. During movement, the shape of the object appears as dotted lines to help with repositioning.

DG3-f.png

To drop the object at its new location, let go of the mouse button. The new position will appear immediately in the status bar.

Dynamic size modification of objects

To change the size of a selected object (or a group of selected objects) with the mouse, you need to move one of the handles located around the selection. As shown in the following illustration, the outline of the resulting new object appears as a dotted line while the mouse button is pressed.

DG3-g.png

The results will differ depending on which handle you use. If you choose a corner handle (as shown in the figure above), you will resize the object along two axes at the same time. If you use a side handle, the objects will only be resized along one axis. The new size will appear immediately in the status bar.

Template:Documentation/Note

Dynamic size modification with the help of the Status bar

If you select an object and modify it using the mouse, the changes are immediately reflected in the Info field of the status bar. With geometric shapes (such as Basic Shapes, Symbol Shapes, Block Arrows) only the information that the shape is being resized is shown in the status bar. With geometric elements (Rectangles, Circles, and so on) the changes to the attributes of the element (either relative or absolute) are shown. In the case of a rectangle the relative percentage of the x and y dimensions of the original shape are shown. For a line much more information is given: the absolute change in x,y coordinates of the end point being moved together with the current length and bearing of the modified line are all given in the status bar and updated as the end point is moved (see Figure 3).

This information is very useful. It is the only place in which one can see the exact start and end angle locations of an arc or where the length and bearing of a sloping line are shown. With this information you can dimension the object with some accuracy.

Figure 3: The Information field during dynamic size modification of objects.

Modifying an arc

The beginning and end points of an arc can be modified. Select the arc and click on the Points icon [[Image:]] on the menu bar to enter the Edit points mode[1]. In this mode the handles on the selection frame change – at the beginning and end points of the arc two larger blue handles appear. When the mouse hovers over one of these points the cursor will change to a hand.

Figure 4: Editing an arc.

If you click and hold the mouse button when the hand cursor appears, moving the mouse will change the location of the start or end point of the arc. The actual coordinates are shown in the Status bar.

Rotating and shearing an object

Changing with the mouse

Rotating an object lets you slant the object along an axis. To do this dynamically, use the red handles, as you do when changing the size of the object.

Template:Documentation/Note

To rotate an object (or a group of objects), drag the red corner handle points of the selection with the mouse. The mouse cursor takes the shape of an arc of a circle with an arrow at each end. A dotted outline of the object being rotated appears and the current angle of rotation is dynamically shown in the status bar.

Rotations are made about an axis which is displayed as a small symbol. This is normally located at the mid point of the object, but you can move the axis of rotation with the mouse to any location you like.

Figure 5: Rotating an object.

If you hold down the Shift key during the rotation, the operation will be carried out in increments of 15°.

Changing inclination or perspective

To slant or shear an object, use the red handles located at the midpoint of an edge of the selected object(s). The mouse pointer changes to a ShearPointer.png when the pointer hovers over one of these midpoint handles. Not every object can be slanted – basic shapes can be rotated but not slanted.

The slant axis is the point directly opposite the midpoint handle to be used for shearing the object. This point stays fixed in location; the other sides and edges move in relation to it as the mouse is dragged (make sure that the ShearPointer.png handle icon is showing before dragging).

Figure 6 shows how the vertices move in relation to each other during the shearing process. The circles represent the path of the vertices. The inclination axis is the bottom vertex of the triangle (the slanting handle used is the midpoint of the upper enclosing frame). All points on the figure will move through the same angle irrespective of the final shape. The actual angle is shown in the status bar.

Template:Documentation/Note

Figure 6: Shearing an object.

This tool can be used to produce perspective drawings. The series of pictures in Figure 7 shows the method of constructing a cuboid or rectangular prism. To shorten the edges leading from front to back, reduce the length before you distort the height or width of the surface.

Figure 7: Perspective production of a cuboid.

As with rotation, you can set the slanting to occur as steps of 15° by pressing the Shift key while moving the handle.

Setting size and position exactly

You can position and resize objects with the mouse, but this method is not very exact. If you need accurate positioning of objects, you should use the Position and Size menu on the Format tab of the menu bar, by right-clicking the object and selecting Position and Size from the context menu, or by pressing F4.

Setting position and size

Open the Position and Size menu (see Figure 8) and click on the first tab to set the appropriate values.

Position is defined as an X,Y coordinate relative to a fixed point (the Base Point), typically located at the upper left of the drawing area. If desired you can temporarily change this Base Point to make positioning or dimensioning simpler (click on the radio button corresponding to the location of the base point in either of the two selection windows on the right side of the menu – upper for positioning or lower for dimensioning). The possible Base Point positions correspond to the handles on the selection frame plus a central point. The change in position lasts only as long as you have the menu open; when you close this menu, Draw resets the Base Point to the standard position.

Template:Documentation/Tip

Either or both of size and position can be protected so that they cannot be inadvertently changed. Check the appropriate boxes to achieve this.

Template:Documentation/Tip

Figure 8: Position and size of objects.

Rotating objects

Click on the Rotation tab of the Position and Size dialog (see Figure 9). Here you can define the rotation angle as well as the location of the pivot point.

Figure 9: Rotating an object.

Setting the slant and corner radius

With some Draw objects the slant angle (inclination or shearing) and corner radius can be set in this dialog (Figure 10).

Figure 10: Setting rounded corners and slant angle

Corner radius

You can use this dialog to round the corners of the usual Draw objects – text boxes, legends, rectangles, and squares as shown in Figure 11. The same effect can be achieved, when you are in point mode (by clicking the Points icon on the Draw toolbar), by dragging the large handle with the mouse.

Figure 11: Example of setting rounded corners

The larger the value of the corner radius the more round will be the object.

Slant

You can shear the classic Draw objects, but not the newer Shape objects. Enter the slant angle in the box marked Shear Angle.

DG3-h.png

Editing object points

For polygons and Bézier curves, Draw offers a complete set of tools that let you accurately edit the contour of an object. To edit other objects in the same way you must first convert them into curves. To do this, select the object, then right-click and choose Convert > To Curve or choose Modify > Convert > To Curve from the menu bar.

You can also convert the shapes to a polygon (Convert > To Polygon). With polygons the edge points are always connected with straight lines and not with curves. Some of the techniques described work equally with polygons as with curves.

An alternative way to change the form of basic shapes

In current versions of OpenOffice.org many of the new shapes can be directly edited without having to first convert them to curves. You can recognize these objects by the presence of one (or more) yellow handles. Figure 12 shows a selection of shapes with such handles.

If you hover the mouse pointer over one of these handles and then drag it, you will be able to change the form of the shape; the exact type of change is dependent on the shape itself. The mouse pointer changes, as in the cylinder at the lower left of Figure 12, to a hand with index finger outstretched when hovered over one of these handles.

Examples of what you can do with this tool are rounding the corners of a rectangle or square, changing the angles of an arc or ellipse, or altering the control points of a circular or elliptical segment.

Figure 12: Some basic shapes with yellow "handles".

How curves work

Editing curves works on the basis of a method called Bézier curves*. The complete study of such curves goes beyond this scope of this Guide and only the basics of this powerful method of editing the contour of an object are covered here. Chapter 10 (Advanced Draw Techniques) provides more information on drawing and manipulating Bézier curves.

  • Bézier curves were invented by Pierre Bézier, an engineer working with the Renault car manufacturer, who developed the technique in the 1960s. The technology was intended to make modeling the surface of vehicles easier.

The editing of a Bézier curve consists in principle of moving points and/or tangents passing through these points. Each tangent has two control points, one at each end, and a junction point where it meets the curve. The relative angle and distance between the control points determine the shape of the curve. Figure 13 shows several variations starting from a basic circle and changing only one point on the circle.

You can create many different shapes by moving either the junction point itself, or one or both of the round handle points at either end of the tangent.

Figure 13: Creating different shapes by changing the tangent.

Experimenting with moving the control point(s) of a tangent will yield countless variations of the basic starting shape. Draw offers even more possibilities when you use the functions on the Bézier curve toolbar.

The Edit Points toolbar

When you work in Edit Points mode, use the Edit Points toolbar, shown in Figure 14. This toolbar can be activated by View > Toolbars > Edit points. Once activated, it will appear whenever you select a curve and the Edit Points icon on the Drawing toolbar is active.

Figure 14: Edit Points Toolbar.

On this toolbar, some buttons will be active or inactive depending on the selected object and object point. With the Convert to Curve icon, you can determine for individual points whether their connection will be made with straight lines or with curves.

Only with curves are the icons for tangents activated. An object which contains no curves is treated as a polygon.

The role of the three buttons enabling you to choose the type of tangent is described in the following chapter. The other buttons are described here in relation to working examples.

The three kinds of tangent

Three buttons in the Edit Points Toolbar let you select the type of tangent and convert from one type to another. Only one of these buttons can be active at any given time.

Figure 15: Symmetrical Transition.
The Symmetric Transition button SymTransIcon.png lets you work with a symmetrical tangent. Any movement of one or the other of the handles will be carried over symmetrically to the other one.
Figure 16: Asymmetrical tangent.
The Smooth Transition button SmoothTransIcon.png lets you separately adjust the lengths of the two parts of a tangent and so make the curve flatter or steeper. In the drawing opposite, you can clearly see that the curve is flatter on the longest side of the tangent. The tangent remains as a single straight line. This kind of tangent is known as a smooth junction. This button should not to be confused with the preceding one, since their representations are fairly similar.
Figure 17: Inflexion point.
It is also possible to completely detach both sides of the tangent. In this case, the central point is known as the inflexion point. Using this technique, you can draw spikes and troughs in objects. Use the Corner Point button CornerPointIcon.png to create an inflexion point around the selected point.

Examples

The following examples start from a filled circle. As mentioned earlier, in order to use Edit Points mode, you first need to convert the object to a curve.

You will notice that after conversion, the handles located in the corners of the rectangle have disappeared. This behavior is normal in that the handles which are used in Edit Points mode are located along the outline or trace of the drawn object.

Figure 18: Moving a junction point.
The Move Points button MovePointsIcon.png is the default mode when editing points. If it has not been activated, click on the button. When this mode is active, the mouse cursor has the following shape when it is hovered over an edit point:

DG3-18a.png

Movement of a point is one of the easiest manipulations to do. Figure 18 illustrates how an egg can be drawn very easily by starting from a circle and dragging the the top point upwards.

Figure 19: Rotating a tangent.
To change the direction or location of the tangents, move the circular handles at each end. The mouse cursor then looks like this:

DG3-19a.png

Figure 20: Adding an edit point to a curve.
Use the Add Points button AddPointsIcon.png to add an extra edit point to an existing curve. Click on the curve at the spot where you want to insert a point and then move the mouse slightly, in any direction, while holding down the button. Watch out! If you just click, the new point will not be added.

The tangent attributes associated with the new point depend on the buttons that are selected on the toolbar.

Figure 21: Deleting points from a curve.
The Delete Points button DeletePointsIcon.png has the opposite effect: it subtracts one or more points from the curve. The resulting curve stretches itself automatically around the remaining points after subtraction.

Select one or more points to delete. You can select several points by holding down the Shift key (➊).

When you have selected the points you want to delete, click the Delete Points DeletePointsIcon.png button. The selected points disappear from the curve, which then reforms around the remaining points (➋).

You can also delete the selected points by pressing the Del key on the keyboard.

Figure 22: Cutting a curve.
Use the Split Curve button SplitCurveIcon.png to split or cut a curve at the location of the selected handle. If the object is filled, it will be emptied, because the curve that represented the edge is no longer closed.

Check that you have selected the correct handle (➊), click the Split Curve button SplitCurveIcon.png (➋) and notice that the object is no longer filled. You can then check, by moving the point, that the curve has indeed been separated (➌).

If you have an open curve, the start point of the curve is larger than the others.

Figure 23: Moving a segment.
You can also separate a curve at several points simultaneously. Just keep the Shift key pressed down and select all of the points at which the cut should occur.

Drag and drop segments with the mouse to move them from the original curve.

Figure 24: Closing an open curve.
To close an existing curve, select an open curve and click on the Close Bézier button CloseBezierIcon.png.

The opening point is identified by a slightly larger handle.

Figure 25: Using the “select points” switch.
The Select button SelectionIcon.png on the Drawing Toolbar functions as a switch. It works as follows.

If you have two points linked together by a straight line (you do not need to have a curve between the points) and you insert a new point between them that is set at an angle to the initial straight line (and hence the two endpoints), then:If the Select button is active, you will have a drawing similar to that illustrated in ➊.

If the Select button is not active, and you move the point you have just inserted to bring it back close to its initial position in the straight line, you will have a drawing similar to that illustrated in ➋.

Figure 26: Select object and set Edit points mode.
Figure 27: Draw virtual lines.
The Eliminate Points button ElimPointsIcon.png button only functions with lines with multiple points. If the button is active, clicking on a point, holding the mouse key down and moving the mouse will draw virtual straight lines between the neighboring left and right points. When the two lines are more or less straight, and you let the mouse button go, the point is deleted and a line between the above mentioned two neighboring points replaces the previous two lines, thus eliminating one point. Note that this only works when the angle between the two lines shown dashed in the figure at left is less than a certain amount.
Figure 28: Release mouse button.
Figure 29: Line is reduced by one point.
In the Tools > Options > OpenOffice.org Draw > Grid window there are options for snap settings relating to editing points when rotating and in point reduction mode.
Figure 30: Moving a point on a curve.
The Rotation function from the Effects drop-down button DrawEffectsIcon.png on the Drawing Toolbar and the Rotation Mode after Clicking Object button RotationModeIcon.png on the Options Toolbar can be used in Edit Point mode. In this case, it can be used to move single points around the contour of an object.

Switch into Rotation mode by clicking on either of the rotation buttons. Notice that in rotation mode, all of the tangent points become red dots.

Select the point to be moved and then drag it around the contour while keeping the left mouse button pressed down (➊). When you let go of the mouse button, the point will be moved to the new position (➋).

If you move one of the handles located at the end of the tangents during rotation, you will make the object rotate in exactly the same way as with the usual rotation operations.

Important: To exit the effects mode, do not just single click on the effects button but single click the Select button SelectionIcon.png on the Draw toolbar.


Content on this page is licensed under the Creative Common Attribution 3.0 license (CC-BY).


Cite error: <ref> tags exist, but no <references/> tag was found

Personal tools