[Go to CFHT Home Page] Man Pages
Back to Software Index  BORDER=0Manpage Top Level
    Zoomer(3X) manual page Table of Contents

Name

Zoomer, Enlarger, Reducer - classes for interactors that zoom

Remarks:

These interactors do not comply with the OSF/Motif Certification Checklist. They are provided for compatibility with existing InterViews programs, however they may not behave as expected when used with InterViews Plus.

Synopsis

#include <ivplus/adjuster.h>

Description

Zoomers adjust their interactor’s perspective’s curwidth and curheight member variables to suggest reduction or magnification. The Enlarger class halves the perspective values while the Reducer class doubles them. These classes are typically used in conjunction with graphics applications.

Zoomer is an abstract base class.

Class Hierarchy


Enlarger->Zoomer->Adjuster->Interactor
Reducer->Zoomer->Adjuster->Interactor

Constructors

Zoomer(Interactor*, float factor)

Zoomer(const char* instanceName, Interactor*, float factor)

Since Zoomer is an abstract base class, these constructors are protected.

Enlarger(Interactor*, int size = ZoomerSize)

Enlarger(const char*, Interactor*, int size = ZoomerSize)

Create an Enlarger object with the given size which zooms the given interactor’s perspective.

Reducer(Interactor*, int size = ZoomerSize)

Reducer(const char*, Interactor*, int size = ZoomerSize)

Create a Reducer object with the given size which zooms the given interactor’s perspective.

Public Data

static const int ZoomerSize = 24;

Public Operations

virtual void Redraw(IntCoord, IntCoord, IntCoord, IntCoord);

Draws the interactor.

virtual void Reconfig();

Sets the interactor’s shape according to the size parameter in the constructor and sets its shape to be rigid.

Protected Operations

virtual void Zoomer::AdjustView(Event&);

Calculates the new values for curwidth, curheight, curx and cury. Then suggests to its interactor’s perspective to adopt the new perspective with a call to the Interactor function Adjust().

X Resources

None.

Examples


//                          Zoomer Example
#include <ivplus/adjuster.h>
#include <ivplus/box.h>
#include <ivplus/frame.h>
#include <ivplus/glue.h>
#include <ivplus/message.h>
#include <ivplus/viewport.h>
#include <ivplus/world.h>
int main(int argc, char *argv[])
{
   // Create the world to get the connection with the display.
   World* world = new World("MyApp", argc, argv);
 
   // Create a message.
   Message* msg = new Message("Hello World\n...Bye World!");
   // Create a Viewport with a Message.
   // viewport should have something displayed so that the view can be
adjusted
   Viewport* viewport = new Viewport(msg);
   // Create an enlarger to zoom in the view.
   Enlarger* enlarger = new Enlarger(viewport);
 
   // Create a reducer to zoom out the view.
   Reducer* reducer = new Reducer(viewport);
 
   // Arrange the zoomer in a box with proper glue and orientation.
   VBox* zoombox = new VBox(enlarger, reducer);
   HBox* mainbox = new HBox(viewport, new HGlue, zoombox);
   // Map the window.
   world->InsertApplication(new Frame(mainbox, 1, BevelOut));
   //Enter the event loop
   world->Run();
   return 0;
}

Files


adjuster.h
adjuster.C

See Also

Adjuster(3X) , Enlarger(3X) , Interactor(3X) , Mover(3X) , Perspective(3X) , Reducer(3X) .


Table of Contents