need example code-imagevision in motif widgets

need example code-imagevision in motif widgets

Post by Kent Hutson » Sat, 29 Jul 1995 04:00:00


Does anyone know where I can find some example code that
renders imagevision ilImage's into the Motif widgets
created by RapidApp?

Thanks
--

Department of Radiology
University of Tennesse Medical Center at Knoxville

 
 
 

need example code-imagevision in motif widgets

Post by Chris C. Walk » Sat, 29 Jul 1995 04:00:00



> Does anyone know where I can find some example code that
> renders imagevision ilImage's into the Motif widgets
> created by RapidApp?

RapidApp doesn't support the Iris GL/Motif drawing area widget.  Since
IL 2.4 only works with Iris GL you are (temporarily) out of luck.  IL
does work with the Iris GL/Motif widget; see the ilmpaste.c++ example
source for more info.

IL 3.0 (being OpenGL based) will be fully integrated with RapidApp and
contains a number of ViewKit components.  Sorry, we don't have a ship date
yet.

---
Chris Walker

 
 
 

need example code-imagevision in motif widgets

Post by Alex Madara » Wed, 02 Aug 1995 04:00:00



Quote:Walker) writes:
> RapidApp doesn't support the Iris GL/Motif drawing area widget.  Since
> IL 2.4 only works with Iris GL you are (temporarily) out of luck.  IL
> does work with the Iris GL/Motif widget; see the ilmpaste.c++ example
> source for more info.

RapidApp is based on ViewKit, and the RapidApp on-line book, Chapter 3,
"Creating Components from External Classes", says "There is a simple
method for using external classes in RapidApp. ..."  After seeing this, I
browsed around some and found example code for a ViewKit GlxMDraw widget
in:

        /usr/share/src/ViewKit/Applications/GLX

The README says:

"This directory builds Rotate, a sample application that uses GLX to do
GL rendering in an X window.

VkGLX is a ViewKit component which creates a GlxMDraw widget for GL
rendering.  Virtual methods provide hooks for the application for
graphics initialization (ginit), exposure of the component (expose),
resize of the component (resize), and keyboard/pointer events (input).

..."

The question is, could someone at SGI extend this example into something
which makes it practical to use the current GL-based IL with RapidApp?

 ---------------------------------------------------------------------

 
 
 

need example code-imagevision in motif widgets

Post by Dan Ba » Wed, 02 Aug 1995 04:00:00


|>
|> VkGLX is a ViewKit component which creates a GlxMDraw widget for GL
|> [...]
|> The question is, could someone at SGI extend this example into something
|> which makes it practical to use the current GL-based IL with RapidApp?
|>

As Chris mentioned, the ilmpaste.c++ example in 4Dgifts is a good place
to start. I'm not familiar with the VkGLX example you mentioned, but basically,
you setup a callback for ginit, expose and any mouse or widget actions you wish.
It sounds like these callbacks have already been setup and stubbed-out so all
you need to do is fill-in the stubs.

In the ginit callback, you can create ilDisplay or ilViewer and pass the
window to display the image in. In the expose callback you just call the
redraw() method on ilDisplay or ilViewer. Then you setup a callback for
each widget you have or you can setup an input callback to catch X events.
Here is a simple code fragment example from ilmpaste.c++:

void
main() {

    n = 0;
    XtSetArg(args[n], GlxNglxConfig, glxConfig); n++;
    glx = XtCreateManagedWidget("glx", glxMDrawWidgetClass, form, args, n);

    XtAddCallback(glx, GlxNginitCallback,  ginitCB,  (XtPointer)img);
    XtAddCallback(glx, GlxNexposeCallback, exposeCB, NULL);

    [...]

Quote:}

void
exposeCB(Widget,  XtPointer, XtPointer)
{
    dsp->redraw();

Quote:}

void
ginitCB(Widget w,  XtPointer client_data, XtPointer)
{
    ilImage* srcImg = (ilImage*)client_data;

    dsp = new ilDisplay(XtDisplay(w), XtWindow(w));
    dsp->addView(srcImg);

Quote:}

--

Technical Staff           WWW:   http://reality.sgi.com/employees/dan
Silicon Graphics Inc.     Fax:   415-965-2658     Voice: 415-390-1032
 
 
 

need example code-imagevision in motif widgets

Post by Alex Madara » Wed, 02 Aug 1995 04:00:00



Quote:Walker) writes:
> ... I'll forward your request on to our ViewKit/RapidApp expert in the IL
> group.

> You might be able to get a little further by looking at the ilmpaste.c++
> source code example in il_dev.sw.gifts.

Thanks (Dan too) for the pointers - I'll look these things over some more.

 ---------------------------------------------------------------------

 
 
 

need example code-imagevision in motif widgets

Post by Chris C. Walk » Wed, 02 Aug 1995 04:00:00




> Walker) writes:
> > RapidApp doesn't support the Iris GL/Motif drawing area widget.  Since
> > IL 2.4 only works with Iris GL you are (temporarily) out of luck.  IL
> > does work with the Iris GL/Motif widget; see the ilmpaste.c++ example
> > source for more info.

> RapidApp is based on ViewKit, and the RapidApp on-line book, Chapter 3,
> "Creating Components from External Classes", says "There is a simple
> method for using external classes in RapidApp. ..."  After seeing this, I
> browsed around some and found example code for a ViewKit GlxMDraw widget
> in:

>    /usr/share/src/ViewKit/Applications/GLX

> The README says:

> "This directory builds Rotate, a sample application that uses GLX to do
> GL rendering in an X window.

> VkGLX is a ViewKit component which creates a GlxMDraw widget for GL
> rendering.  Virtual methods provide hooks for the application for
> graphics initialization (ginit), exposure of the component (expose),
> resize of the component (resize), and keyboard/pointer events (input).

> ...."

> The question is, could someone at SGI extend this example into something
> which makes it practical to use the current GL-based IL with RapidApp?

We're pretty busy trying to get the OpenGL based IL ready for beta, but I'll
forward your request on to our ViewKit/RapidApp expert in the IL group.

You might be able to get a little further by looking at the ilmpaste.c++
source code example in il_dev.sw.gifts.  This example uses the GlxMDraw
widget in a Motif program.  The usage should be similar in ViewKit.

---
Chris Walker

 
 
 

need example code-imagevision in motif widgets

Post by Chris C. Walk » Fri, 04 Aug 1995 04:00:00



> BTW, are you having problems with really large images and ImageVision?
> I mean, we have images of size approximately 1M, and I get a segmentation
> fault when I try to run the application.  If I cut my .TIFF file size down
> to about 600K I don't see this problem.  We've played with cache size
> as much as we can figure out, without success.  I'd appreciate any
> hints on solving this problem.

This is unusual.  I regularly use images much bigger than that with IL, that's
what it's designed for.  Can you send me more details on the failure?
(Like a stack trace).

---

 
 
 

need example code-imagevision in motif widgets

Post by ( » Fri, 04 Aug 1995 04:00:00




>Walker) writes:
>> RapidApp doesn't support the Iris GL/Motif drawing area widget.  Since
>> IL 2.4 only works with Iris GL you are (temporarily) out of luck.  IL
>> does work with the Iris GL/Motif widget; see the ilmpaste.c++ example
>> source for more info.
>RapidApp is based on ViewKit, and the RapidApp on-line book, Chapter 3,
>"Creating Components from External Classes", says "There is a simple
>method for using external classes in RapidApp. ..."  After seeing this, I
>browsed around some and found example code for a ViewKit GlxMDraw widget
>in:
>    /usr/share/src/ViewKit/Applications/GLX
>The README says:
>"This directory builds Rotate, a sample application that uses GLX to do
>GL rendering in an X window.
>VkGLX is a ViewKit component which creates a GlxMDraw widget for GL
>rendering.  Virtual methods provide hooks for the application for
>graphics initialization (ginit), exposure of the component (expose),
>resize of the component (resize), and keyboard/pointer events (input).
>..."
>The question is, could someone at SGI extend this example into something
>which makes it practical to use the current GL-based IL with RapidApp?

I am also in the position of needing to use ImageVision and RapidApp
together.  What I did was to build my interface with RapidApp using the
OpenGL drawing widget that RapidApp provides.  Then I edited by hand
and replaced all references to the OpenGL widget with corresponding
references to the GL widget.

And I have gone so far as to implement an ilViewer in my GL widget
drawing area, successfully.

So far RapidApp has not had a problem with what I did, even though I
made changes in the parts of code that RapidApp would rather I not
tweak.  In fact, I have had more trouble getting my function headers
carried along than my code changes!  My lessons-learned from that is
to solidify my RapidApp interface as much as possible before I put
a lot of time into hand-tweaking the code.

If you want more details, I'd be pleased to answer questions.

BTW, are you having problems with really large images and ImageVision?
I mean, we have images of size approximately 1M, and I get a segmentation
fault when I try to run the application.  If I cut my .TIFF file size down
to about 600K I don't see this problem.  We've played with cache size
as much as we can figure out, without success.  I'd appreciate any
hints on solving this problem.

 
 
 

1. Overlaying Motif widgets on a Motif OpenGL drawing area widget

I am trying to overlay Motif option menu widgets on a Motif OpenGL
drawing area widget and am having some difficulties...

Basically, I am drawing a wireframe F-14 using OpenGL into a Motif
OpenGL drawing area widget on my SGI Indy. I want to place Motif option
menus over the weapons station locations (on the wireframe F-14
drawing), and have each option menu contain all valid weapons stores for
that station. However, I cannot get the menus to display over the OpenGL
drawing area (the OpenGL F-14 drawing is always displayed, however). My
widget hierarchy is as follows:

    Form widget #1
        OpenGL drawing area widget
        Form widget #2
            option menu widget
            option menu widget
            ...

I have tried several other widget hierarchies as well, such as getting
rid of Form widget #2 and placing the option menus in Form widget #1...
I cannot make the option menus children of the OpenGL drawing area
widget because it is NOT a composite widget and cannot have children...
Do I need to sync the Motif widget display and OpenGL drawing, even
though I'm not using any Xlib drawing commands?


submit a summary of the responses I receive, along with any solution I
find.

Thank you.
--

Manned Flight Simulator
Naval Air Warfare Center - Aircraft Division
Patuxent River, MD

2. rotated 2D text

3. OpenGL motif widget source code?

4. maya2.5 constraint aim

5. Looking for example Tooltalk/Motif C code

6. Position Announcement: NASA Ames

7. Irix 5.3 Motif/IM examples (IDO) need UIL?

8. Line algorithm with width

9. ImageVision with GLX/Motif

10. Cursor in Motif XmText Widgets

11. Resizing OpenGL widgets in Motif

12. Linking OpenGL Motif Widget -n32

13. Motif widgets and GL