About to use gl instructions in a "c" program

View: New views
4 Messages — Rating Filter:   Alert me  

About to use gl instructions in a "c" program

by joluinfante :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi, forum.
I did modify the testmain.c (from openev project) to do a little georeferencing software.
To complete it, I need draw a rectangle in the photo, to talk to the operator "what is the zone to process". But, I don't know what is the method to do it.
I did try:

        gv_view_area_add_layer(GV_VIEW_AREA(view_raster), raster_layer); <--- this is my photo
        raster_point_layer=gv_shapes_layer_new(NULL);                               <--- this is a layer to put
        gv_data_set_name(GV_DATA(raster_point_layer), "photo_points");     <--- the gcp points
        gv_view_area_add_layer(GV_VIEW_AREA(view_raster), raster_point_layer);
        gv_view_area_set_active_layer(GV_VIEW_AREA(view_raster), raster_point_layer); <-- the layer
                                                                                                                                    -- is active
            glColor4f(1.0, 0.0, 0.0, 0.0); <--- I'll draw the rectangle with red color
            glBegin(GL_LINES);             <--- I'll draw a lines to build the rectangle
            glVertex3(0.0, 0.0, 0.0);
            glVertex3(1000.0, 0.0, 0.0);
            glVertex3(1000.0, 1000.0, 0.0);
            glVertex3(0.0, 1000.0, 0.0);
            glVertex3(0.0, .0, 0.0);
            glEnd();                              <--- End of draw
            glFlush();                            <--- Is it neccesary?

Then I don't see the rectangle in the view.
I see the sources, and this method is used to draw a rectangle around the cursor position.
Can any help me?
Thanks a lot.

jorge infante
direccion de catastro
municipalidad de rosario
rosario - santa fe - argentina
        printf("2\n");


Re: About to use gl instructions in a "c" program

by Sampson, David :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I had success by following the developers tutorial

http://openev.sourceforge.net/app/developer_info/DEVCOURSE_tutorial2.htm
l

If you have not run through this before I suggest taking a look at it.

That's the extent to what I have to offer.

Cheers

-----Original Message-----
From: openev-discuss-bounces@...
[mailto:openev-discuss-bounces@...] On Behalf Of
joluinfante
Sent: July 20, 2007 14:58
To: openev-discuss@...
Subject: [Openev-discuss] About to use gl instructions in a "c" program


Hi, forum.
I did modify the testmain.c (from openev project) to do a little
georeferencing software.
To complete it, I need draw a rectangle in the photo, to talk to the
operator "what is the zone to process". But, I don't know what is the
method to do it.
I did try:

        gv_view_area_add_layer(GV_VIEW_AREA(view_raster), raster_layer);
<--- this is my photo
        raster_point_layer=gv_shapes_layer_new(NULL);

<--- this is a layer to put
        gv_data_set_name(GV_DATA(raster_point_layer), "photo_points");

<--- the gcp points
        gv_view_area_add_layer(GV_VIEW_AREA(view_raster),
raster_point_layer);
        gv_view_area_set_active_layer(GV_VIEW_AREA(view_raster),
raster_point_layer); <-- the layer
 

-- is active
            glColor4f(1.0, 0.0, 0.0, 0.0); <--- I'll draw the rectangle
with red color
            glBegin(GL_LINES);             <--- I'll draw a lines to
build
the rectangle
            glVertex3(0.0, 0.0, 0.0);
            glVertex3(1000.0, 0.0, 0.0);
            glVertex3(1000.0, 1000.0, 0.0);
            glVertex3(0.0, 1000.0, 0.0);
            glVertex3(0.0, .0, 0.0);
            glEnd();                              <--- End of draw
            glFlush();                            <--- Is it neccesary?

Then I don't see the rectangle in the view.
I see the sources, and this method is used to draw a rectangle around
the cursor position.
Can any help me?
Thanks a lot.

jorge infante
direccion de catastro
municipalidad de rosario
rosario - santa fe - argentina
        printf("2\n");


--
View this message in context:
http://www.nabble.com/About-to-use-gl-instructions-in-a-%22c%22-program-
tf4118607.html#a11712874
Sent from the openev-discuss mailing list archive at Nabble.com.


------------------------------------------------------------------------
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Openev-discuss mailing list
Openev-discuss@...
https://lists.sourceforge.net/lists/listinfo/openev-discuss

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Openev-discuss mailing list
Openev-discuss@...
https://lists.sourceforge.net/lists/listinfo/openev-discuss

Re: About to use gl instructions in a "c" program

by joluinfante :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks, David.
But, I can't to access to the address you tell me.
I did receive the message:
An error has been encountered in accessing this page.

1. Server: openev.sourceforge.net
2. URL path: /app/developer_info/DEVCOURSE_tutorial2.htm
3. Error notes: File does not exist: /home/groups/o/op/openev/htdocs/app/developer_info/DEVCOURSE_tutorial2.htm
4. Error type: 404
5. Request method: GET
6. Request query string:
7. Time: 2007-07-23 05:12:38 PDT (1185192758)

Is ok the address?
TIA
jorge infante

Sampson, David wrote:
I had success by following the developers tutorial

http://openev.sourceforge.net/app/developer_info/DEVCOURSE_tutorial2.htm
l

If you have not run through this before I suggest taking a look at it.

That's the extent to what I have to offer.

Cheers

-----Original Message-----
From: openev-discuss-bounces@lists.sourceforge.net
[mailto:openev-discuss-bounces@lists.sourceforge.net] On Behalf Of
joluinfante
Sent: July 20, 2007 14:58
To: openev-discuss@lists.sourceforge.net
Subject: [Openev-discuss] About to use gl instructions in a "c" program


Hi, forum.
I did modify the testmain.c (from openev project) to do a little
georeferencing software.
To complete it, I need draw a rectangle in the photo, to talk to the
operator "what is the zone to process". But, I don't know what is the
method to do it.
I did try:

        gv_view_area_add_layer(GV_VIEW_AREA(view_raster), raster_layer);
<--- this is my photo
        raster_point_layer=gv_shapes_layer_new(NULL);

<--- this is a layer to put
        gv_data_set_name(GV_DATA(raster_point_layer), "photo_points");

<--- the gcp points
        gv_view_area_add_layer(GV_VIEW_AREA(view_raster),
raster_point_layer);
        gv_view_area_set_active_layer(GV_VIEW_AREA(view_raster),
raster_point_layer); <-- the layer
 

-- is active
            glColor4f(1.0, 0.0, 0.0, 0.0); <--- I'll draw the rectangle
with red color
            glBegin(GL_LINES);             <--- I'll draw a lines to
build
the rectangle
            glVertex3(0.0, 0.0, 0.0);
            glVertex3(1000.0, 0.0, 0.0);
            glVertex3(1000.0, 1000.0, 0.0);
            glVertex3(0.0, 1000.0, 0.0);
            glVertex3(0.0, .0, 0.0);
            glEnd();                              <--- End of draw
            glFlush();                            <--- Is it neccesary?

Then I don't see the rectangle in the view.
I see the sources, and this method is used to draw a rectangle around
the cursor position.
Can any help me?
Thanks a lot.

jorge infante
direccion de catastro
municipalidad de rosario
rosario - santa fe - argentina
        printf("2\n");


--
View this message in context:
http://www.nabble.com/About-to-use-gl-instructions-in-a-%22c%22-program-
tf4118607.html#a11712874
Sent from the openev-discuss mailing list archive at Nabble.com.


------------------------------------------------------------------------
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Openev-discuss mailing list
Openev-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openev-discuss

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Openev-discuss mailing list
Openev-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openev-discuss

Re: About to use gl instructions in a "c" program

by Frank Warmerdam-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

joluinfante wrote:
> Thanks, David.
> But, I can't to access to the address you tell me.
> I did receive the message:
> An error has been encountered in accessing this page.


Try entering it at:

   http://openev.sourceforge.net/app/developer_info/DEVCOURSE.html


 >

 > -- is active
 >             glColor4f(1.0, 0.0, 0.0, 0.0); <--- I'll draw the rectangle with
 > red color
 >             glBegin(GL_LINES);             <--- I'll draw a lines to build
 > the rectangle
 >             glVertex3(0.0, 0.0, 0.0);
 >             glVertex3(1000.0, 0.0, 0.0);
 >             glVertex3(1000.0, 1000.0, 0.0);
 >             glVertex3(0.0, 1000.0, 0.0);
 >             glVertex3(0.0, .0, 0.0);
 >             glEnd();                              <--- End of draw
 >             glFlush();                            <--- Is it neccesary?
 >
 > Then I don't see the rectangle in the view.

Generally speaking you can't imperatively draw stuff in the mainline, because
it will just get overwritten by the first redraw.  If you want to show an
area of interest of some sort, you might want to register a vector layer
with just this vector object in it.  Or at a low level, you could add your
own expose callback after the system ones are done to drawn an overlay.

I'd like to give more specific feedback but I'd have to do quite a bit work
to come up with working example code.

Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam@...
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGeo, http://osgeo.org


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Openev-discuss mailing list
Openev-discuss@...
https://lists.sourceforge.net/lists/listinfo/openev-discuss
LightInTheBox - Buy quality products at wholesale price!