SlideShare una empresa de Scribd logo
1 de 25
Descargar para leer sin conexión
Reference Manual
Generated by Doxygen 1.6.3
Sun Dec 4 13:31:15 2011
Contents
1

1

1.1
2

Class Index

1

Class List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

3

2.1
3

File Index

3

File List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Class Documentation

5

3.1

FLPlotColor Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5

3.1.1

Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5

3.1.2

Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . .

5

3.1.2.1

FLPlotColor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5

Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . .

5

3.1.3.1

b . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5

3.1.3.2

b . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

6

3.1.3.3

g . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

6

3.1.3.4

g . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

6

3.1.3.5

r . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

6

3.1.3.6

r . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

6

FLPlotPointXY Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7

3.2.1

Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

8

3.2.2

Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . .

8

3.2.2.1

FLPlotPointXY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

8

3.2.2.2

FLPlotPointXY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

8

Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . .

8

3.2.3.1

color . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

8

3.2.3.2

color . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

8

3.2.3.3

label . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

8

3.2.3.4

label . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

8

3.2.3.5

x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

9

3.1.3

3.2

3.2.3
ii

CONTENTS
3.2.3.6

9

3.2.3.7

y . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

9

3.2.3.8

y . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

9

MyGlWindowPlot Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

10

3.3.1

Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

11

3.3.2

Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . .

11

3.3.2.1

MyGlWindowPlot . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

11

Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . .

11

3.3.3.1

add . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

11

3.3.3.2

clear . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

11

3.3.3.3

drawCircle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

11

3.3.3.4

handle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

12

3.3.3.5

MarkedPoint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

12

3.3.3.6

MarkPoint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

12

3.3.3.7

max_y_value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

12

3.3.3.8

Normalize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

13

3.3.3.9

ResetZoom . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

13

3.3.3.10 ZoomLess . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

13

3.3.3.11 ZoomMore . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

3.3

x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

13

3.3.3

4

File Documentation

15

4.1

MyGlWindowPlot.cxx File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . .

15

4.2

MyGlWindowPlot.cxx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

16

4.3

MyGlWindowPlot.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

19

4.4

MyGlWindowPlot.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

20

4.5

Sys-MyGlWindowPlot.cpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . .

22

4.5.1

Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

22

4.5.1.1

main . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

22

Sys-MyGlWindowPlot.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

23

4.6

Generated on Sun Dec 4 13:31:15 2011 by Doxygen
Chapter 1

Class Index
1.1

Class List

Here are the classes, structs, unions and interfaces with brief descriptions:
FLPlotColor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
FLPlotPointXY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MyGlWindowPlot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5
7
10
Chapter 2

File Index
2.1

File List

Here is a list of all files with brief descriptions:
MyGlWindowPlot.cxx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MyGlWindowPlot.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Sys-MyGlWindowPlot.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

15
19
22
Chapter 3

Class Documentation
3.1

FLPlotColor Class Reference

#include <MyGlWindowPlot.h>

Public Member Functions
•
•
•
•
•
•
•

FLPlotColor (unsigned char r=0, unsigned char g=0, unsigned char b=0)
void r (unsigned char red)
void g (unsigned char green)
void b (unsigned char blue)
unsigned char r (void)
unsigned char g (void)
unsigned char b (void)

3.1.1

Detailed Description

Classe para armazenamento das componentes da cor em rgb.
Definition at line 23 of file MyGlWindowPlot.h.

3.1.2

Constructor & Destructor Documentation

3.1.2.1

FLPlotColor::FLPlotColor (unsigned char r = 0, unsigned char g = 0, unsigned char b =
0) [inline]

Definition at line 30 of file MyGlWindowPlot.h.
00030 : _r(r), _g(g), _b(b) {};

3.1.3

Member Function Documentation

3.1.3.1

unsigned char FLPlotColor::b (void) [inline]

Definition at line 38 of file MyGlWindowPlot.h.
6

Class Documentation

00038 { return _b; };

3.1.3.2

void FLPlotColor::b (unsigned char blue) [inline]

Definition at line 34 of file MyGlWindowPlot.h.
00034 {

3.1.3.3

_b = blue; };

unsigned char FLPlotColor::g (void) [inline]

Definition at line 37 of file MyGlWindowPlot.h.
00037 { return _g; };

3.1.3.4

void FLPlotColor::g (unsigned char green) [inline]

Definition at line 33 of file MyGlWindowPlot.h.
00033 { _g = green; };

3.1.3.5

unsigned char FLPlotColor::r (void) [inline]

Definition at line 36 of file MyGlWindowPlot.h.
00036 { return _r; };

3.1.3.6

void FLPlotColor::r (unsigned char red) [inline]

Definition at line 32 of file MyGlWindowPlot.h.
00032 { _r = red;

};

The documentation for this class was generated from the following file:
• MyGlWindowPlot.h

Generated on Sun Dec 4 13:31:15 2011 by Doxygen
3.2 FLPlotPointXY Class Reference

3.2

7

FLPlotPointXY Class Reference

#include <MyGlWindowPlot.h>
Collaboration diagram for FLPlotPointXY:
FLPlotColor
- _r
- _g
- _b
+ FLPlotColor()
+ r()
+ g()
+ b()
+ r()
+ g()
+ b()
_color
FLPlotPointXY
- _x
- _y
- _color
- _label
+ FLPlotPointXY()
+ FLPlotPointXY()
+ x()
+ x()
+ y()
+ y()
+ color()
+ color()
+ label()
+ label()

Public Member Functions
•
•
•
•
•
•
•
•
•
•

FLPlotPointXY ()
FLPlotPointXY (float x, float y, FLPlotColor color, std::string label)
float x (void)
void x (float X)
float y (void)
void y (float Y)
FLPlotColor color (void)
void color (FLPlotColor color)
std::string label (void)
void label (std::string L)

Generated on Sun Dec 4 13:31:15 2011 by Doxygen
8

3.2.1

Class Documentation

Detailed Description

Classe para armazenamento das caracteristicas do ponto
Definition at line 44 of file MyGlWindowPlot.h.

3.2.2

Constructor & Destructor Documentation

3.2.2.1

FLPlotPointXY::FLPlotPointXY () [inline]

Definition at line 52 of file MyGlWindowPlot.h.
00052 { _x = 0; _y = 0; _color = 0; _label = ""; };

3.2.2.2

FLPlotPointXY::FLPlotPointXY (float x, float y, FLPlotColor color, std::string label)
[inline]

Definition at line 53 of file MyGlWindowPlot.h.
00053 { _x = x; _y = y; _color = color; _label = label; };

3.2.3

Member Function Documentation

3.2.3.1

void FLPlotPointXY::color (FLPlotColor color) [inline]

Definition at line 62 of file MyGlWindowPlot.h.
00062 { _color

3.2.3.2

= color; };

FLPlotColor FLPlotPointXY::color (void) [inline]

Definition at line 61 of file MyGlWindowPlot.h.
00061 { return _color;

3.2.3.3

};

void FLPlotPointXY::label (std::string L) [inline]

Definition at line 65 of file MyGlWindowPlot.h.
00065 { _label

3.2.3.4

= L;

};

std::string FLPlotPointXY::label (void) [inline]

Definition at line 64 of file MyGlWindowPlot.h.
00064 { return _label; };

Generated on Sun Dec 4 13:31:15 2011 by Doxygen
3.2 FLPlotPointXY Class Reference
3.2.3.5

void FLPlotPointXY::x (float X) [inline]

Definition at line 56 of file MyGlWindowPlot.h.
00056 { _x

3.2.3.6

= X;

};

float FLPlotPointXY::x (void) [inline]

Definition at line 55 of file MyGlWindowPlot.h.
00055 { return _x; };

3.2.3.7

void FLPlotPointXY::y (float Y) [inline]

Definition at line 59 of file MyGlWindowPlot.h.
00059 { _y

3.2.3.8

= Y;

};

float FLPlotPointXY::y (void) [inline]

Definition at line 58 of file MyGlWindowPlot.h.
00058 { return _y; };

The documentation for this class was generated from the following file:
• MyGlWindowPlot.h

Generated on Sun Dec 4 13:31:15 2011 by Doxygen

9
10

Class Documentation

3.3

MyGlWindowPlot Class Reference

#include <MyGlWindowPlot.h>
Collaboration diagram for MyGlWindowPlot:
FLPlotColor
- _r
- _g
- _b
+ FLPlotColor()
+ r()
+ g()
+ b()
+ r()
+ g()
+ b()
_color
FLPlotPointXY
- _x
- _y
- _color
- _label
+ FLPlotPointXY()
+ FLPlotPointXY()
+ x()
+ x()
+ y()
+ y()
+ color()
+ color()
+ label()
+ label()
_marked_point
MyGlWindowPlot
- _aspect_ratio
- _aspect_ratio_x
- _aspect_ratio_y
- _mark_height_in_x
- _submark_height_in_x
- _points
- _oss
- _label_plotter
- _marked_point
- _mark_point
- _max_y_value
+ MyGlWindowPlot()
+ ZoomLess()
+ ZoomMore()
+ ResetZoom()
+ max_y_value()
+ Normalize()
+ add()
+ drawCircle()
+ MarkedPoint()
+ MarkPoint()
+ handle()
+ clear()
- InitializeSystem()
- draw()
- resize()

Public Member Functions
•
•
•
•
•
•
•
•
•

MyGlWindowPlot (int X, int Y, int W, int H, const char ∗L=0)
void ZoomLess (void)
void ZoomMore (void)
void ResetZoom (void)
void max_y_value (long double y_max)
long double Normalize (long double y_value)
void add (float x, float y, FLPlotColor color=0, std::string label="")
void drawCircle (float Radius, unsigned int numPoints)
void MarkedPoint (FLPlotPointXY p)
Generated on Sun Dec 4 13:31:15 2011 by Doxygen
3.3 MyGlWindowPlot Class Reference

11

• void MarkPoint (bool _mark)
• int handle (int e)
• void clear (void)

3.3.1

Detailed Description

Classe para plotagem de pontos em um canvas opengl
Definition at line 71 of file MyGlWindowPlot.h.

3.3.2

Constructor & Destructor Documentation

3.3.2.1

MyGlWindowPlot::MyGlWindowPlot (int X, int Y, int W, int H, const char ∗ L = 0)

Construtor default
Definition at line 26 of file MyGlWindowPlot.cxx.
00027 : Fl_Gl_Window(X,Y,W,H,L) { InitializeSystem(); };

3.3.3

Member Function Documentation

3.3.3.1

void MyGlWindowPlot::add (float x, float y, FLPlotColor color = 0, std::string label = "")

Insere itens na lista de pontos do plotador
Definition at line 150 of file MyGlWindowPlot.cxx.
00151 {
00152
_points.push_back(FLPlotPointXY(x*_aspect_ratio_x,y*_aspect_ratio_y,color,label
));
00153 }

3.3.3.2

void MyGlWindowPlot::clear (void)

Executa limpeza do vetor de pontos e da área de desenho.
Definition at line 187 of file MyGlWindowPlot.cxx.
00187 { _points.clear(); redraw(); };

3.3.3.3

void MyGlWindowPlot::drawCircle (float Radius, unsigned int numPoints)

Desenha marcador em volta do ponto.
Definition at line 171 of file MyGlWindowPlot.cxx.
00172 {
00173
glBegin( GL_LINE_STRIP );
00174
for(unsigned int i=0; i <= numPoints; i++ )
00175
{
00176
float Angle = i * (2.0*M_PI/numPoints); // use 360 instead of 2.0*PI if
Generated on Sun Dec 4 13:31:15 2011 by Doxygen
12

Class Documentation

00177
float X = cos( Angle )*Radius;
00178
float Y = sin( Angle )*Radius;
00179
glVertex2f( X, Y );
00180
}
00181
glEnd();
00182 }

3.3.3.4

// you use d_cos and d_sin

int MyGlWindowPlot::handle (int e)

Implementação do método que manipula eventos
Definition at line 158 of file MyGlWindowPlot.cxx.
00159 {
00160
switch (e)
00161
{
00162
case FL_ENTER: cursor(FL_CURSOR_CROSS); break;
00163
case FL_LEAVE: cursor(FL_CURSOR_DEFAULT); break;
00164
}
00165
return Fl_Gl_Window::handle(e);
00166 }

3.3.3.5

void MyGlWindowPlot::MarkedPoint (FLPlotPointXY p) [inline]

Manipula o ponto que deve ser marcado
Definition at line 148 of file MyGlWindowPlot.h.
00148 { _marked_point = p;

3.3.3.6

};

void MyGlWindowPlot::MarkPoint (bool _mark) [inline]

Verifica se um ponto deve ser marcado ou não
Definition at line 153 of file MyGlWindowPlot.h.
00153 { _mark_point = _mark; };

3.3.3.7

void MyGlWindowPlot::max_y_value (long double y_max)

Armazena o maior valor existente dentro do conjunto.
Definition at line 133 of file MyGlWindowPlot.cxx.
00134 {
00135
_max_y_value = y_max;
00136 };

Generated on Sun Dec 4 13:31:15 2011 by Doxygen
3.3 MyGlWindowPlot Class Reference
3.3.3.8

long double MyGlWindowPlot::Normalize (long double y_value)

Normaliza o ponto para que o mesmo possa ser mostrado no canvas.
Normaliza o ponto, para que o mesmo possa ser mostrado no canvas.
Definition at line 141 of file MyGlWindowPlot.cxx.
00142 {
00143
00144
00145 }

3.3.3.9

long double _max = (_max_y_value == 0)?(1):(_max_y_value);
return (long double)( ((h()*0.55)*y_value)/(_max));

void MyGlWindowPlot::ResetZoom (void)

Controlador que retorna a câmera ao seu estado normal - reset zoom
Definition at line 124 of file MyGlWindowPlot.cxx.
00125 {
00126
_aspect_ratio = (double)w()/(double)h();
00127
redraw();
00128 };

3.3.3.10

void MyGlWindowPlot::ZoomLess (void)

Controlador de afastamento de camera - zoom less
Definition at line 106 of file MyGlWindowPlot.cxx.
00107 {
00108
_aspect_ratio = (double)_aspect_ratio/1.05;
00109
redraw();
00110 };

3.3.3.11

void MyGlWindowPlot::ZoomMore (void)

Controlador de aproximação de camera - zoom more
Definition at line 115 of file MyGlWindowPlot.cxx.
00116 {
00117
_aspect_ratio = (double)_aspect_ratio*1.05;
00118
redraw();
00119 };

The documentation for this class was generated from the following files:
• MyGlWindowPlot.h
• MyGlWindowPlot.cxx

Generated on Sun Dec 4 13:31:15 2011 by Doxygen

13
14

Class Documentation

Generated on Sun Dec 4 13:31:15 2011 by Doxygen
Chapter 4

File Documentation
4.1

MyGlWindowPlot.cxx File Reference

#include "MyGlWindowPlot.h"
#include <cmath>
#include <vector>
#include <iostream>
#include <sstream>
#include <FL/Fl.H>
#include <FL/gl.h>
#include <FL/Fl_Gl_Window.H>
Include dependency graph for MyGlWindowPlot.cxx:
MyGlWindowPlot.cxx

cmath

vector

iostream

sstream

FL/Fl.H

FL/gl.h

This graph shows which files directly or indirectly include this file:
MyGlWindowPlot.cxx

FL/Fl_Gl_Window.H
16

4.2
00001
00002
00003
00004
00005
00006
00007
00008
00009
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00026
00027
00028
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074

File Documentation

MyGlWindowPlot.cxx
/*
* MyGlWindowPlot.cxx
*
* Created on: 11/09/2009
Author: Michel Alves dos Santos
*
*/
#include "MyGlWindowPlot.h"
void MyGlWindowPlot::InitializeSystem()
{
_aspect_ratio_x
= 2.5;
_aspect_ratio_y
= 1;
_mark_height_in_x
= 2.5;
_submark_height_in_x = 1.5;
_aspect_ratio
= (double)w()/(double)h();
_label_plotter
= "";
}
MyGlWindowPlot::MyGlWindowPlot(int X,int Y,int W,int H,const char*L)
: Fl_Gl_Window(X,Y,W,H,L) { InitializeSystem(); };
void MyGlWindowPlot::draw()
{
// Inicialização dos atributos de visualização da janela
if (!valid())
{
valid(1);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glViewport(0,0,w(),h());
glOrtho(0, w(), -h() , h(), -1, 1);
}
// Limpando a tela
glClear(GL_COLOR_BUFFER_BIT);
//Habilitando transparência
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glShadeModel(GL_FLAT);
//Desenhando o eixo de coordenadas
glLineWidth(2);
glColor3f(1.0, 1.0, 1.0);
glBegin(GL_LINE_STRIP); glVertex2f(1, h()); glVertex2f(1,-h());
glBegin(GL_LINE_STRIP); glVertex2f(0, 0);
glVertex2f(w(), 0);

glEnd();
glEnd();

//Nomeando os eixos de coordenadas ...
gl_font(FL_COURIER_BOLD,15);
gl_color(FL_YELLOW); gl_draw(" x " , w()-40, -40);
gl_color(FL_YELLOW); gl_draw(" y - Diagrama Dispersivo", 5, h()-20);
//Desenhando a linha poligonal que representa a curva
glPushMatrix();
glScalef(_aspect_ratio,_aspect_ratio,1);
glPointSize(2);
//Desenho os pontos que foram fornecidos para o plotter
glPointSize(2);
glColor3ub(63,255,6);
glBegin(GL_POINTS);
for(register unsigned int index = 0; index < _points.size(); index++)
glVertex2f(_points[index].x(),Normalize(_points[index].y()));
glEnd();
Generated on Sun Dec 4 13:31:15 2011 by Doxygen
4.2 MyGlWindowPlot.cxx
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00106
00107
00108
00109
00110
00111
00115
00116
00117
00118
00119
00120
00124
00125
00126
00127
00128
00129
00133
00134
00135
00136
00137
00141
00142
00143
00144
00145
00146
00150

17

glPopMatrix();
//Desabilitando o alpha / transparência
glDisable(GL_BLEND);
//Marcando a origem dos eixos
glPointSize(4);
glColor3ub(255,99,23);
glBegin(GL_POINTS); glVertex2f(0,0); glVertex2f(0,0);

glEnd();

}
void MyGlWindowPlot::resize(int X,int Y,int W,int H)
{
Fl_Gl_Window::resize(X,Y,W,H);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glViewport(0,0,W,H);
glOrtho(-W,W,-H,H,-1,1);
redraw();
}
void MyGlWindowPlot::ZoomLess(void)
{
_aspect_ratio = (double)_aspect_ratio/1.05;
redraw();
};
void MyGlWindowPlot::ZoomMore(void)
{
_aspect_ratio = (double)_aspect_ratio*1.05;
redraw();
};
void MyGlWindowPlot::ResetZoom(void)
{
_aspect_ratio = (double)w()/(double)h();
redraw();
};
void MyGlWindowPlot::max_y_value(long double y_max)
{
_max_y_value = y_max;
};
long double MyGlWindowPlot::Normalize(long double y_value)
{
long double _max = (_max_y_value == 0)?(1):(_max_y_value);
return (long double)( ((h()*0.55)*y_value)/(_max));
}
void MyGlWindowPlot::add (float x, float y, FLPlotColor color, std::string label)

00151 {
00152
_points.push_back(FLPlotPointXY(x*_aspect_ratio_x,y*_aspect_ratio_y,color,label
));
00153 }
00154
00158 int MyGlWindowPlot::handle(int e)
00159 {
00160
switch (e)
00161
{
00162
case FL_ENTER: cursor(FL_CURSOR_CROSS); break;
00163
case FL_LEAVE: cursor(FL_CURSOR_DEFAULT); break;
00164
}
00165
return Fl_Gl_Window::handle(e);
00166 }
00167

Generated on Sun Dec 4 13:31:15 2011 by Doxygen
18
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00187

File Documentation
void MyGlWindowPlot::drawCircle(float Radius, unsigned int numPoints)
{
glBegin( GL_LINE_STRIP );
for(unsigned int i=0; i <= numPoints; i++ )
{
float Angle = i * (2.0*M_PI/numPoints); // use 360 instead of 2.0*PI if
float X = cos( Angle )*Radius;
// you use d_cos and d_sin
float Y = sin( Angle )*Radius;
glVertex2f( X, Y );
}
glEnd();
}
void MyGlWindowPlot::clear(void) { _points.clear(); redraw(); };

Generated on Sun Dec 4 13:31:15 2011 by Doxygen
4.3 MyGlWindowPlot.h File Reference

4.3

19

MyGlWindowPlot.h File Reference

#include <cmath>
#include <vector>
#include <iostream>
#include <sstream>
#include <FL/Fl.H>
#include <FL/gl.h>
#include <FL/Fl_Gl_Window.H>
Include dependency graph for MyGlWindowPlot.h:
MyGlWindowPlot.h

cmath

vector

iostream

sstream

FL/Fl.H

FL/gl.h

This graph shows which files directly or indirectly include this file:
MyGlWindowPlot.h

Sys-MyGlWindowPlot.cpp

Classes
• class FLPlotColor
• class FLPlotPointXY
• class MyGlWindowPlot

Generated on Sun Dec 4 13:31:15 2011 by Doxygen

FL/Fl_Gl_Window.H
20

4.4
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00023
00024
00025
00026
00027
00028
00029
00030

File Documentation

MyGlWindowPlot.h
/*
* MyGlWindowplot.h
*
* Created on: 11/09/2009
Author: Administrador
*
*/
#ifndef MYGLWINDOWPLOT_H_
#define MYGLWINDOWPLOT_H_
#include
#include
#include
#include

<cmath>
<vector>
<iostream>
<sstream>

#include <FL/Fl.H>
#include <FL/gl.h>
#include <FL/Fl_Gl_Window.H>
class FLPlotColor
{
unsigned char _r;
unsigned char _g;
unsigned char _b;

//Componente vermelha
//Componente verde
//Componente azul

public:
FLPlotColor(unsigned char r = 0, unsigned char g =0, unsigned char b = 0): _r
(r), _g(g), _b(b) {};

00031
00032
void r(unsigned char red)
{ _r = red;
};
00033
void g(unsigned char green) { _g = green; };
00034
void b(unsigned char blue) { _b = blue; };
00035
00036
unsigned char r(void) { return _r; };
00037
unsigned char g(void) { return _g; };
00038
unsigned char b(void) { return _b; };
00039 };
00040
00044 class FLPlotPointXY
00045 {
00046
float
_x;
// Coordenada x
00047
float
_y;
// Coordenada y
00048
FLPlotColor _color;
// Cor do ponto
00049
std::string _label;
// Um rótulo para o ponto
00050
00051
public :
00052
FLPlotPointXY(){ _x = 0; _y = 0; _color = 0; _label = ""; };
00053
FLPlotPointXY(float x, float y, FLPlotColor color, std::string label){ _x
= x; _y = y; _color = color; _label = label; };
00054
00055
float x(void)
{ return _x; };
00056
void x(float X) { _x = X;
};
00057
00058
float y(void)
{ return _y; };
00059
void y(float Y) { _y = Y;
};
00060
00061
FLPlotColor color(void)
{ return _color;
};
00062
void color(FLPlotColor color) { _color = color; };
00063
00064
std::string label(void)
{ return _label; };
00065
void
label(std::string L) { _label = L;
};
00066 };
00067
00071 class MyGlWindowPlot : public Fl_Gl_Window
00072 {
Generated on Sun Dec 4 13:31:15 2011 by Doxygen
4.4 MyGlWindowPlot.h
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083

double
_aspect_ratio;
o geral
float
_aspect_ratio_x;
float
_aspect_ratio_y;
float
_mark_height_in_x;
dade em x
float
_submark_height_in_x;
unidades inteiras
std::vector<FLPlotPointXY>
_points;
plotados
std::ostringstream
_oss;
s eixos;
std::string
_label_plotter;
FLPlotPointXY
_marked_point;
bool
_mark_point;
marcado
long double
_max_y_value;
pontos

21
//razao de aspecto para exibiçã
//razão de aspecto em x
//razão de aspecto em y
//altura da marca para cada uni
//altura da submarca entre duas
//lista de pontos que devem ser
//Conversor para a numeração do
//Rótulo ou título do plotador
//Ponto que deve ser marcado.
//Verifica se o ponto deve ser
//Recebe o maior valor entre os

00084
00088
void InitializeSystem();
00089
00093
void draw();
00094
00102
void resize(int X,int Y,int W,int H);
00103
00104 public:
00108
MyGlWindowPlot(int X,int Y,int W,int H,const char*L=0);
00109
00113
void ZoomLess(void);
00114
00118
void ZoomMore(void);
00119
00123
void ResetZoom(void);
00124
00128
void max_y_value(long double y_max);
00129
00133
long double Normalize(long double y_value);
00134
00138
void add (float x, float y, FLPlotColor color = 0, std::string label = "");
00139
00143
void drawCircle(float Radius, unsigned int numPoints);
00144
00148
void MarkedPoint(FLPlotPointXY p) { _marked_point = p; };
00149
00153
void MarkPoint(bool _mark) { _mark_point = _mark; };
00154
00158
int handle(int e);
00159
00163
void clear(void);
00164 };
00165
00166 #endif /* MYGLWINDOWPLOT_H_ */

Generated on Sun Dec 4 13:31:15 2011 by Doxygen
22

File Documentation

4.5

Sys-MyGlWindowPlot.cpp File Reference

#include <iostream>
#include <FL/Fl.H>
#include <FL/glut.H>
#include <FL/Fl_Double_Window.H>
#include "MyGlWindowPlot.h"
Include dependency graph for Sys-MyGlWindowPlot.cpp:
Sys-MyGlWindowPlot.cpp

MyGlWindowPlot.h

iostream

FL/Fl.H

vector

FL/glut.H

sstream

FL/gl.h

FL/Fl_Double_Window.H

FL/Fl_Gl_Window.H

cmath

Functions
• int main (int argc, char ∗argv[ ])

4.5.1

Function Documentation

4.5.1.1

int main (int argc, char ∗ argv[ ])

Função para testes com a biblioteca.
Definition at line 16 of file Sys-MyGlWindowPlot.cpp.
00017 {
00018
Fl_Double_Window mywin(0,0,400,300);
00019
mywin.resizable(mywin);
00020
mywin.begin();
00021
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
00022
MyGlWindowPlot g(10, 10, 380, 260);
00023
mywin.end();
00024
mywin.show();
00025
return Fl::run();
00026 }

Generated on Sun Dec 4 13:31:15 2011 by Doxygen
4.6 Sys-MyGlWindowPlot.cpp

4.6
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026

Sys-MyGlWindowPlot.cpp
//============================================================================
// Name
: Sys-MyGlWindowPlot
// Author
: Michel Alves dos Santos
// Version
: 1.0
//============================================================================
#include
#include
#include
#include
#include

<iostream>
<FL/Fl.H>
<FL/glut.H>
<FL/Fl_Double_Window.H>
"MyGlWindowPlot.h"

int main(int argc, char* argv[])
{
Fl_Double_Window mywin(0,0,400,300);
mywin.resizable(mywin);
mywin.begin();
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
MyGlWindowPlot g(10, 10, 380, 260);
mywin.end();
mywin.show();
return Fl::run();
}

Generated on Sun Dec 4 13:31:15 2011 by Doxygen

23
Index
add
MyGlWindowPlot, 11
b
FLPlotColor, 5, 6
clear
MyGlWindowPlot, 11
color
FLPlotPointXY, 8
drawCircle
MyGlWindowPlot, 11
FLPlotColor, 5
b, 5, 6
FLPlotColor, 5
g, 6
r, 6
FLPlotPointXY, 7
color, 8
FLPlotPointXY, 8
label, 8
x, 8, 9
y, 9

drawCircle, 11
handle, 12
MarkedPoint, 12
MarkPoint, 12
max_y_value, 12
MyGlWindowPlot, 11
Normalize, 12
ResetZoom, 13
ZoomLess, 13
ZoomMore, 13
MyGlWindowPlot.cxx, 15
MyGlWindowPlot.h, 19
Normalize
MyGlWindowPlot, 12
r
FLPlotColor, 6
ResetZoom
MyGlWindowPlot, 13
Sys-MyGlWindowPlot.cpp, 22
main, 22
x
FLPlotPointXY, 8, 9

g
FLPlotColor, 6

y
FLPlotPointXY, 9

handle
MyGlWindowPlot, 12
label
FLPlotPointXY, 8
main
Sys-MyGlWindowPlot.cpp, 22
MarkedPoint
MyGlWindowPlot, 12
MarkPoint
MyGlWindowPlot, 12
max_y_value
MyGlWindowPlot, 12
MyGlWindowPlot, 10
add, 11
clear, 11

ZoomLess
MyGlWindowPlot, 13
ZoomMore
MyGlWindowPlot, 13

Más contenido relacionado

La actualidad más candente

Code Conventions
Code ConventionsCode Conventions
Code Conventions
51 lecture
 
Py2 5 tut_cn
Py2 5 tut_cnPy2 5 tut_cn
Py2 5 tut_cn
wwwgzp
 
Flash File Format Specification
Flash File Format SpecificationFlash File Format Specification
Flash File Format Specification
guest0ebe1e
 
Another example PDF
Another example PDFAnother example PDF
Another example PDF
occhris
 
Using ZFS Snapshots With Zmanda Recovery Manager for MySQL on ...
Using ZFS Snapshots With Zmanda Recovery Manager for MySQL on ...Using ZFS Snapshots With Zmanda Recovery Manager for MySQL on ...
Using ZFS Snapshots With Zmanda Recovery Manager for MySQL on ...
webhostingguy
 

La actualidad más candente (15)

Java code conventions
Java code conventionsJava code conventions
Java code conventions
 
Code Conventions
Code ConventionsCode Conventions
Code Conventions
 
Algoritmicx
AlgoritmicxAlgoritmicx
Algoritmicx
 
Py2 5 tut_cn
Py2 5 tut_cnPy2 5 tut_cn
Py2 5 tut_cn
 
digital marketing training in bangalore
digital marketing training in bangaloredigital marketing training in bangalore
digital marketing training in bangalore
 
Blockchain protocol due diligence framework
Blockchain protocol due diligence frameworkBlockchain protocol due diligence framework
Blockchain protocol due diligence framework
 
Flash File Format Specification
Flash File Format SpecificationFlash File Format Specification
Flash File Format Specification
 
Ebay News 1998 10 27 Earnings
Ebay News 1998 10 27 EarningsEbay News 1998 10 27 Earnings
Ebay News 1998 10 27 Earnings
 
Manual cs it
Manual cs itManual cs it
Manual cs it
 
AdvFS Storage allocation/reservation
AdvFS Storage allocation/reservationAdvFS Storage allocation/reservation
AdvFS Storage allocation/reservation
 
DB2 DOCUMENT
DB2 DOCUMENTDB2 DOCUMENT
DB2 DOCUMENT
 
Another example PDF
Another example PDFAnother example PDF
Another example PDF
 
Using ZFS Snapshots With Zmanda Recovery Manager for MySQL on ...
Using ZFS Snapshots With Zmanda Recovery Manager for MySQL on ...Using ZFS Snapshots With Zmanda Recovery Manager for MySQL on ...
Using ZFS Snapshots With Zmanda Recovery Manager for MySQL on ...
 
MongoDB - Monitoring & queueing
MongoDB - Monitoring & queueingMongoDB - Monitoring & queueing
MongoDB - Monitoring & queueing
 
Pcbgcode
PcbgcodePcbgcode
Pcbgcode
 

Destacado

A Struggle to Survive a Legacy. 3.01 B
A Struggle to Survive a Legacy. 3.01 BA Struggle to Survive a Legacy. 3.01 B
A Struggle to Survive a Legacy. 3.01 B
Xenia-Ellen Caltabiano
 
A Struggle to Survive a Legacy! Chapter 3.07
A Struggle to Survive a Legacy! Chapter 3.07A Struggle to Survive a Legacy! Chapter 3.07
A Struggle to Survive a Legacy! Chapter 3.07
Xenia-Ellen Caltabiano
 
A Struggle to Survive a Legacy! 3.02 B
A Struggle to Survive a Legacy! 3.02 BA Struggle to Survive a Legacy! 3.02 B
A Struggle to Survive a Legacy! 3.02 B
Xenia-Ellen Caltabiano
 

Destacado (8)

A Sparrow Legacy! Chapter 1.08
A Sparrow Legacy! Chapter 1.08A Sparrow Legacy! Chapter 1.08
A Sparrow Legacy! Chapter 1.08
 
A Struggle to Survive a Legacy. 3.01 B
A Struggle to Survive a Legacy. 3.01 BA Struggle to Survive a Legacy. 3.01 B
A Struggle to Survive a Legacy. 3.01 B
 
FLTK Summer Course - Part I - First Impact
FLTK Summer Course - Part I - First ImpactFLTK Summer Course - Part I - First Impact
FLTK Summer Course - Part I - First Impact
 
A Struggle to Survive a Legacy! Chapter 3.07
A Struggle to Survive a Legacy! Chapter 3.07A Struggle to Survive a Legacy! Chapter 3.07
A Struggle to Survive a Legacy! Chapter 3.07
 
Documentation - LibraryRandom
Documentation - LibraryRandomDocumentation - LibraryRandom
Documentation - LibraryRandom
 
A Struggle to Survive a Legacy! 3.02 B
A Struggle to Survive a Legacy! 3.02 BA Struggle to Survive a Legacy! 3.02 B
A Struggle to Survive a Legacy! 3.02 B
 
Bootstrap Evaluation in R - Source Code
Bootstrap Evaluation in R -  Source CodeBootstrap Evaluation in R -  Source Code
Bootstrap Evaluation in R - Source Code
 
A Gentle Introduction to Hardening Concept
A Gentle Introduction to Hardening ConceptA Gentle Introduction to Hardening Concept
A Gentle Introduction to Hardening Concept
 

Similar a Documentation - MyGlWindowPlot

Documentation - Element and ElementVector
Documentation - Element and ElementVectorDocumentation - Element and ElementVector
Documentation - Element and ElementVector
Michel Alves
 
Implementing ibm storage data deduplication solutions sg247888
Implementing ibm storage data deduplication solutions sg247888Implementing ibm storage data deduplication solutions sg247888
Implementing ibm storage data deduplication solutions sg247888
Banking at Ho Chi Minh city
 
Learn C# Includes The C# 3.0 Features
Learn C# Includes The C# 3.0 FeaturesLearn C# Includes The C# 3.0 Features
Learn C# Includes The C# 3.0 Features
ZEZUA Z.
 
NS-2 Manual
NS-2 ManualNS-2 Manual
NS-2 Manual
code453
 
Sqlmap readme
Sqlmap readmeSqlmap readme
Sqlmap readme
fangjiafu
 

Similar a Documentation - MyGlWindowPlot (20)

ID3 Algorithm - Reference Manual
ID3 Algorithm - Reference ManualID3 Algorithm - Reference Manual
ID3 Algorithm - Reference Manual
 
refman
refmanrefman
refman
 
Documentation - Element and ElementVector
Documentation - Element and ElementVectorDocumentation - Element and ElementVector
Documentation - Element and ElementVector
 
C++ annotations version
C++ annotations versionC++ annotations version
C++ annotations version
 
Postgresql database administration volume 1
Postgresql database administration volume 1Postgresql database administration volume 1
Postgresql database administration volume 1
 
Gdbint
GdbintGdbint
Gdbint
 
Implementing ibm storage data deduplication solutions sg247888
Implementing ibm storage data deduplication solutions sg247888Implementing ibm storage data deduplication solutions sg247888
Implementing ibm storage data deduplication solutions sg247888
 
Francois fleuret -_c++_lecture_notes
Francois fleuret -_c++_lecture_notesFrancois fleuret -_c++_lecture_notes
Francois fleuret -_c++_lecture_notes
 
Learn C# Includes The C# 3.0 Features
Learn C# Includes The C# 3.0 FeaturesLearn C# Includes The C# 3.0 Features
Learn C# Includes The C# 3.0 Features
 
Manual
ManualManual
Manual
 
Ctfile
CtfileCtfile
Ctfile
 
Specification of the Linked Media Layer
Specification of the Linked Media LayerSpecification of the Linked Media Layer
Specification of the Linked Media Layer
 
NS-2 Manual
NS-2 ManualNS-2 Manual
NS-2 Manual
 
Sqlmap readme
Sqlmap readmeSqlmap readme
Sqlmap readme
 
Liebman_Thesis.pdf
Liebman_Thesis.pdfLiebman_Thesis.pdf
Liebman_Thesis.pdf
 
test6
test6test6
test6
 
Red paper
Red paperRed paper
Red paper
 
Codeconventions 150003
Codeconventions 150003Codeconventions 150003
Codeconventions 150003
 
BOOK - IBM zOS V1R10 communications server TCP / IP implementation volume 1 b...
BOOK - IBM zOS V1R10 communications server TCP / IP implementation volume 1 b...BOOK - IBM zOS V1R10 communications server TCP / IP implementation volume 1 b...
BOOK - IBM zOS V1R10 communications server TCP / IP implementation volume 1 b...
 
Fundamentals of HDL (first 4 chapters only) - Godse
Fundamentals of HDL (first 4 chapters only) - GodseFundamentals of HDL (first 4 chapters only) - Godse
Fundamentals of HDL (first 4 chapters only) - Godse
 

Más de Michel Alves

Más de Michel Alves (20)

Texture Synthesis: An Approach Based on GPU Use
Texture Synthesis: An Approach Based on GPU UseTexture Synthesis: An Approach Based on GPU Use
Texture Synthesis: An Approach Based on GPU Use
 
Intelligent Transfer of Thematic Harmonic Color Palettes
Intelligent Transfer of Thematic Harmonic Color PalettesIntelligent Transfer of Thematic Harmonic Color Palettes
Intelligent Transfer of Thematic Harmonic Color Palettes
 
A Framework for Harmonic Color Measures
A Framework for Harmonic Color MeasuresA Framework for Harmonic Color Measures
A Framework for Harmonic Color Measures
 
Effectiveness of Image Quality Assessment Indexes
Effectiveness of Image Quality Assessment IndexesEffectiveness of Image Quality Assessment Indexes
Effectiveness of Image Quality Assessment Indexes
 
Introduction to Kernel Functions
Introduction to Kernel FunctionsIntroduction to Kernel Functions
Introduction to Kernel Functions
 
About Perception and Hue Histograms in HSV Space
About Perception and Hue Histograms in HSV SpaceAbout Perception and Hue Histograms in HSV Space
About Perception and Hue Histograms in HSV Space
 
Color Harmonization - Results
Color Harmonization - ResultsColor Harmonization - Results
Color Harmonization - Results
 
Wave Simulation Using Perlin Noise
Wave Simulation Using Perlin NoiseWave Simulation Using Perlin Noise
Wave Simulation Using Perlin Noise
 
Similarity Maps Using SSIM Index
Similarity Maps Using SSIM IndexSimilarity Maps Using SSIM Index
Similarity Maps Using SSIM Index
 
Qualifying Exam - Image-Based Reconstruction With Color Harmonization
Qualifying Exam - Image-Based Reconstruction With Color HarmonizationQualifying Exam - Image-Based Reconstruction With Color Harmonization
Qualifying Exam - Image-Based Reconstruction With Color Harmonization
 
TMS - Schedule of Presentations and Reports
TMS - Schedule of Presentations and ReportsTMS - Schedule of Presentations and Reports
TMS - Schedule of Presentations and Reports
 
Month Presentations Schedule - March/2015 - LCG/UFRJ
Month Presentations Schedule - March/2015 - LCG/UFRJMonth Presentations Schedule - March/2015 - LCG/UFRJ
Month Presentations Schedule - March/2015 - LCG/UFRJ
 
Color Palettes in R
Color Palettes in RColor Palettes in R
Color Palettes in R
 
Sigmoid Curve Erf
Sigmoid Curve ErfSigmoid Curve Erf
Sigmoid Curve Erf
 
Hue Wheel Prototype
Hue Wheel PrototypeHue Wheel Prototype
Hue Wheel Prototype
 
Cosine Curve
Cosine CurveCosine Curve
Cosine Curve
 
Triangle Mesh Plot
Triangle Mesh PlotTriangle Mesh Plot
Triangle Mesh Plot
 
Triangle Plot
Triangle PlotTriangle Plot
Triangle Plot
 
Capacity-Constrained Point Distributions :: Video Slides
Capacity-Constrained Point Distributions :: Video SlidesCapacity-Constrained Point Distributions :: Video Slides
Capacity-Constrained Point Distributions :: Video Slides
 
Capacity-Constrained Point Distributions :: Density Function Catalog
Capacity-Constrained Point Distributions :: Density Function CatalogCapacity-Constrained Point Distributions :: Density Function Catalog
Capacity-Constrained Point Distributions :: Density Function Catalog
 

Último

The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
heathfieldcps1
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
Chris Hunter
 

Último (20)

Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptx
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 

Documentation - MyGlWindowPlot

  • 1. Reference Manual Generated by Doxygen 1.6.3 Sun Dec 4 13:31:15 2011
  • 2. Contents 1 1 1.1 2 Class Index 1 Class List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 2.1 3 File Index 3 File List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Class Documentation 5 3.1 FLPlotColor Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 3.1.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 3.1.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . 5 3.1.2.1 FLPlotColor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 5 3.1.3.1 b . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 3.1.3.2 b . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 3.1.3.3 g . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 3.1.3.4 g . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 3.1.3.5 r . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 3.1.3.6 r . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 FLPlotPointXY Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 3.2.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 3.2.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . 8 3.2.2.1 FLPlotPointXY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 3.2.2.2 FLPlotPointXY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 8 3.2.3.1 color . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 3.2.3.2 color . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 3.2.3.3 label . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 3.2.3.4 label . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 3.2.3.5 x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 3.1.3 3.2 3.2.3
  • 3. ii CONTENTS 3.2.3.6 9 3.2.3.7 y . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 3.2.3.8 y . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 MyGlWindowPlot Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 3.3.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 3.3.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . 11 3.3.2.1 MyGlWindowPlot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 11 3.3.3.1 add . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 3.3.3.2 clear . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 3.3.3.3 drawCircle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 3.3.3.4 handle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 3.3.3.5 MarkedPoint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 3.3.3.6 MarkPoint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 3.3.3.7 max_y_value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 3.3.3.8 Normalize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 3.3.3.9 ResetZoom . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 3.3.3.10 ZoomLess . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 3.3.3.11 ZoomMore . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.3 x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 3.3.3 4 File Documentation 15 4.1 MyGlWindowPlot.cxx File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 4.2 MyGlWindowPlot.cxx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 4.3 MyGlWindowPlot.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 4.4 MyGlWindowPlot.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 4.5 Sys-MyGlWindowPlot.cpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 22 4.5.1 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 4.5.1.1 main . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 Sys-MyGlWindowPlot.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 4.6 Generated on Sun Dec 4 13:31:15 2011 by Doxygen
  • 4. Chapter 1 Class Index 1.1 Class List Here are the classes, structs, unions and interfaces with brief descriptions: FLPlotColor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . FLPlotPointXY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . MyGlWindowPlot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 7 10
  • 5. Chapter 2 File Index 2.1 File List Here is a list of all files with brief descriptions: MyGlWindowPlot.cxx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . MyGlWindowPlot.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Sys-MyGlWindowPlot.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 19 22
  • 6. Chapter 3 Class Documentation 3.1 FLPlotColor Class Reference #include <MyGlWindowPlot.h> Public Member Functions • • • • • • • FLPlotColor (unsigned char r=0, unsigned char g=0, unsigned char b=0) void r (unsigned char red) void g (unsigned char green) void b (unsigned char blue) unsigned char r (void) unsigned char g (void) unsigned char b (void) 3.1.1 Detailed Description Classe para armazenamento das componentes da cor em rgb. Definition at line 23 of file MyGlWindowPlot.h. 3.1.2 Constructor & Destructor Documentation 3.1.2.1 FLPlotColor::FLPlotColor (unsigned char r = 0, unsigned char g = 0, unsigned char b = 0) [inline] Definition at line 30 of file MyGlWindowPlot.h. 00030 : _r(r), _g(g), _b(b) {}; 3.1.3 Member Function Documentation 3.1.3.1 unsigned char FLPlotColor::b (void) [inline] Definition at line 38 of file MyGlWindowPlot.h.
  • 7. 6 Class Documentation 00038 { return _b; }; 3.1.3.2 void FLPlotColor::b (unsigned char blue) [inline] Definition at line 34 of file MyGlWindowPlot.h. 00034 { 3.1.3.3 _b = blue; }; unsigned char FLPlotColor::g (void) [inline] Definition at line 37 of file MyGlWindowPlot.h. 00037 { return _g; }; 3.1.3.4 void FLPlotColor::g (unsigned char green) [inline] Definition at line 33 of file MyGlWindowPlot.h. 00033 { _g = green; }; 3.1.3.5 unsigned char FLPlotColor::r (void) [inline] Definition at line 36 of file MyGlWindowPlot.h. 00036 { return _r; }; 3.1.3.6 void FLPlotColor::r (unsigned char red) [inline] Definition at line 32 of file MyGlWindowPlot.h. 00032 { _r = red; }; The documentation for this class was generated from the following file: • MyGlWindowPlot.h Generated on Sun Dec 4 13:31:15 2011 by Doxygen
  • 8. 3.2 FLPlotPointXY Class Reference 3.2 7 FLPlotPointXY Class Reference #include <MyGlWindowPlot.h> Collaboration diagram for FLPlotPointXY: FLPlotColor - _r - _g - _b + FLPlotColor() + r() + g() + b() + r() + g() + b() _color FLPlotPointXY - _x - _y - _color - _label + FLPlotPointXY() + FLPlotPointXY() + x() + x() + y() + y() + color() + color() + label() + label() Public Member Functions • • • • • • • • • • FLPlotPointXY () FLPlotPointXY (float x, float y, FLPlotColor color, std::string label) float x (void) void x (float X) float y (void) void y (float Y) FLPlotColor color (void) void color (FLPlotColor color) std::string label (void) void label (std::string L) Generated on Sun Dec 4 13:31:15 2011 by Doxygen
  • 9. 8 3.2.1 Class Documentation Detailed Description Classe para armazenamento das caracteristicas do ponto Definition at line 44 of file MyGlWindowPlot.h. 3.2.2 Constructor & Destructor Documentation 3.2.2.1 FLPlotPointXY::FLPlotPointXY () [inline] Definition at line 52 of file MyGlWindowPlot.h. 00052 { _x = 0; _y = 0; _color = 0; _label = ""; }; 3.2.2.2 FLPlotPointXY::FLPlotPointXY (float x, float y, FLPlotColor color, std::string label) [inline] Definition at line 53 of file MyGlWindowPlot.h. 00053 { _x = x; _y = y; _color = color; _label = label; }; 3.2.3 Member Function Documentation 3.2.3.1 void FLPlotPointXY::color (FLPlotColor color) [inline] Definition at line 62 of file MyGlWindowPlot.h. 00062 { _color 3.2.3.2 = color; }; FLPlotColor FLPlotPointXY::color (void) [inline] Definition at line 61 of file MyGlWindowPlot.h. 00061 { return _color; 3.2.3.3 }; void FLPlotPointXY::label (std::string L) [inline] Definition at line 65 of file MyGlWindowPlot.h. 00065 { _label 3.2.3.4 = L; }; std::string FLPlotPointXY::label (void) [inline] Definition at line 64 of file MyGlWindowPlot.h. 00064 { return _label; }; Generated on Sun Dec 4 13:31:15 2011 by Doxygen
  • 10. 3.2 FLPlotPointXY Class Reference 3.2.3.5 void FLPlotPointXY::x (float X) [inline] Definition at line 56 of file MyGlWindowPlot.h. 00056 { _x 3.2.3.6 = X; }; float FLPlotPointXY::x (void) [inline] Definition at line 55 of file MyGlWindowPlot.h. 00055 { return _x; }; 3.2.3.7 void FLPlotPointXY::y (float Y) [inline] Definition at line 59 of file MyGlWindowPlot.h. 00059 { _y 3.2.3.8 = Y; }; float FLPlotPointXY::y (void) [inline] Definition at line 58 of file MyGlWindowPlot.h. 00058 { return _y; }; The documentation for this class was generated from the following file: • MyGlWindowPlot.h Generated on Sun Dec 4 13:31:15 2011 by Doxygen 9
  • 11. 10 Class Documentation 3.3 MyGlWindowPlot Class Reference #include <MyGlWindowPlot.h> Collaboration diagram for MyGlWindowPlot: FLPlotColor - _r - _g - _b + FLPlotColor() + r() + g() + b() + r() + g() + b() _color FLPlotPointXY - _x - _y - _color - _label + FLPlotPointXY() + FLPlotPointXY() + x() + x() + y() + y() + color() + color() + label() + label() _marked_point MyGlWindowPlot - _aspect_ratio - _aspect_ratio_x - _aspect_ratio_y - _mark_height_in_x - _submark_height_in_x - _points - _oss - _label_plotter - _marked_point - _mark_point - _max_y_value + MyGlWindowPlot() + ZoomLess() + ZoomMore() + ResetZoom() + max_y_value() + Normalize() + add() + drawCircle() + MarkedPoint() + MarkPoint() + handle() + clear() - InitializeSystem() - draw() - resize() Public Member Functions • • • • • • • • • MyGlWindowPlot (int X, int Y, int W, int H, const char ∗L=0) void ZoomLess (void) void ZoomMore (void) void ResetZoom (void) void max_y_value (long double y_max) long double Normalize (long double y_value) void add (float x, float y, FLPlotColor color=0, std::string label="") void drawCircle (float Radius, unsigned int numPoints) void MarkedPoint (FLPlotPointXY p) Generated on Sun Dec 4 13:31:15 2011 by Doxygen
  • 12. 3.3 MyGlWindowPlot Class Reference 11 • void MarkPoint (bool _mark) • int handle (int e) • void clear (void) 3.3.1 Detailed Description Classe para plotagem de pontos em um canvas opengl Definition at line 71 of file MyGlWindowPlot.h. 3.3.2 Constructor & Destructor Documentation 3.3.2.1 MyGlWindowPlot::MyGlWindowPlot (int X, int Y, int W, int H, const char ∗ L = 0) Construtor default Definition at line 26 of file MyGlWindowPlot.cxx. 00027 : Fl_Gl_Window(X,Y,W,H,L) { InitializeSystem(); }; 3.3.3 Member Function Documentation 3.3.3.1 void MyGlWindowPlot::add (float x, float y, FLPlotColor color = 0, std::string label = "") Insere itens na lista de pontos do plotador Definition at line 150 of file MyGlWindowPlot.cxx. 00151 { 00152 _points.push_back(FLPlotPointXY(x*_aspect_ratio_x,y*_aspect_ratio_y,color,label )); 00153 } 3.3.3.2 void MyGlWindowPlot::clear (void) Executa limpeza do vetor de pontos e da área de desenho. Definition at line 187 of file MyGlWindowPlot.cxx. 00187 { _points.clear(); redraw(); }; 3.3.3.3 void MyGlWindowPlot::drawCircle (float Radius, unsigned int numPoints) Desenha marcador em volta do ponto. Definition at line 171 of file MyGlWindowPlot.cxx. 00172 { 00173 glBegin( GL_LINE_STRIP ); 00174 for(unsigned int i=0; i <= numPoints; i++ ) 00175 { 00176 float Angle = i * (2.0*M_PI/numPoints); // use 360 instead of 2.0*PI if Generated on Sun Dec 4 13:31:15 2011 by Doxygen
  • 13. 12 Class Documentation 00177 float X = cos( Angle )*Radius; 00178 float Y = sin( Angle )*Radius; 00179 glVertex2f( X, Y ); 00180 } 00181 glEnd(); 00182 } 3.3.3.4 // you use d_cos and d_sin int MyGlWindowPlot::handle (int e) Implementação do método que manipula eventos Definition at line 158 of file MyGlWindowPlot.cxx. 00159 { 00160 switch (e) 00161 { 00162 case FL_ENTER: cursor(FL_CURSOR_CROSS); break; 00163 case FL_LEAVE: cursor(FL_CURSOR_DEFAULT); break; 00164 } 00165 return Fl_Gl_Window::handle(e); 00166 } 3.3.3.5 void MyGlWindowPlot::MarkedPoint (FLPlotPointXY p) [inline] Manipula o ponto que deve ser marcado Definition at line 148 of file MyGlWindowPlot.h. 00148 { _marked_point = p; 3.3.3.6 }; void MyGlWindowPlot::MarkPoint (bool _mark) [inline] Verifica se um ponto deve ser marcado ou não Definition at line 153 of file MyGlWindowPlot.h. 00153 { _mark_point = _mark; }; 3.3.3.7 void MyGlWindowPlot::max_y_value (long double y_max) Armazena o maior valor existente dentro do conjunto. Definition at line 133 of file MyGlWindowPlot.cxx. 00134 { 00135 _max_y_value = y_max; 00136 }; Generated on Sun Dec 4 13:31:15 2011 by Doxygen
  • 14. 3.3 MyGlWindowPlot Class Reference 3.3.3.8 long double MyGlWindowPlot::Normalize (long double y_value) Normaliza o ponto para que o mesmo possa ser mostrado no canvas. Normaliza o ponto, para que o mesmo possa ser mostrado no canvas. Definition at line 141 of file MyGlWindowPlot.cxx. 00142 { 00143 00144 00145 } 3.3.3.9 long double _max = (_max_y_value == 0)?(1):(_max_y_value); return (long double)( ((h()*0.55)*y_value)/(_max)); void MyGlWindowPlot::ResetZoom (void) Controlador que retorna a câmera ao seu estado normal - reset zoom Definition at line 124 of file MyGlWindowPlot.cxx. 00125 { 00126 _aspect_ratio = (double)w()/(double)h(); 00127 redraw(); 00128 }; 3.3.3.10 void MyGlWindowPlot::ZoomLess (void) Controlador de afastamento de camera - zoom less Definition at line 106 of file MyGlWindowPlot.cxx. 00107 { 00108 _aspect_ratio = (double)_aspect_ratio/1.05; 00109 redraw(); 00110 }; 3.3.3.11 void MyGlWindowPlot::ZoomMore (void) Controlador de aproximação de camera - zoom more Definition at line 115 of file MyGlWindowPlot.cxx. 00116 { 00117 _aspect_ratio = (double)_aspect_ratio*1.05; 00118 redraw(); 00119 }; The documentation for this class was generated from the following files: • MyGlWindowPlot.h • MyGlWindowPlot.cxx Generated on Sun Dec 4 13:31:15 2011 by Doxygen 13
  • 15. 14 Class Documentation Generated on Sun Dec 4 13:31:15 2011 by Doxygen
  • 16. Chapter 4 File Documentation 4.1 MyGlWindowPlot.cxx File Reference #include "MyGlWindowPlot.h" #include <cmath> #include <vector> #include <iostream> #include <sstream> #include <FL/Fl.H> #include <FL/gl.h> #include <FL/Fl_Gl_Window.H> Include dependency graph for MyGlWindowPlot.cxx: MyGlWindowPlot.cxx cmath vector iostream sstream FL/Fl.H FL/gl.h This graph shows which files directly or indirectly include this file: MyGlWindowPlot.cxx FL/Fl_Gl_Window.H
  • 17. 16 4.2 00001 00002 00003 00004 00005 00006 00007 00008 00009 00013 00014 00015 00016 00017 00018 00019 00020 00021 00022 00026 00027 00028 00032 00033 00034 00035 00036 00037 00038 00039 00040 00041 00042 00043 00044 00045 00046 00047 00048 00049 00050 00051 00052 00053 00054 00055 00056 00057 00058 00059 00060 00061 00062 00063 00064 00065 00066 00067 00068 00069 00070 00071 00072 00073 00074 File Documentation MyGlWindowPlot.cxx /* * MyGlWindowPlot.cxx * * Created on: 11/09/2009 Author: Michel Alves dos Santos * */ #include "MyGlWindowPlot.h" void MyGlWindowPlot::InitializeSystem() { _aspect_ratio_x = 2.5; _aspect_ratio_y = 1; _mark_height_in_x = 2.5; _submark_height_in_x = 1.5; _aspect_ratio = (double)w()/(double)h(); _label_plotter = ""; } MyGlWindowPlot::MyGlWindowPlot(int X,int Y,int W,int H,const char*L) : Fl_Gl_Window(X,Y,W,H,L) { InitializeSystem(); }; void MyGlWindowPlot::draw() { // Inicialização dos atributos de visualização da janela if (!valid()) { valid(1); glMatrixMode(GL_PROJECTION); glLoadIdentity(); glViewport(0,0,w(),h()); glOrtho(0, w(), -h() , h(), -1, 1); } // Limpando a tela glClear(GL_COLOR_BUFFER_BIT); //Habilitando transparência glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glShadeModel(GL_FLAT); //Desenhando o eixo de coordenadas glLineWidth(2); glColor3f(1.0, 1.0, 1.0); glBegin(GL_LINE_STRIP); glVertex2f(1, h()); glVertex2f(1,-h()); glBegin(GL_LINE_STRIP); glVertex2f(0, 0); glVertex2f(w(), 0); glEnd(); glEnd(); //Nomeando os eixos de coordenadas ... gl_font(FL_COURIER_BOLD,15); gl_color(FL_YELLOW); gl_draw(" x " , w()-40, -40); gl_color(FL_YELLOW); gl_draw(" y - Diagrama Dispersivo", 5, h()-20); //Desenhando a linha poligonal que representa a curva glPushMatrix(); glScalef(_aspect_ratio,_aspect_ratio,1); glPointSize(2); //Desenho os pontos que foram fornecidos para o plotter glPointSize(2); glColor3ub(63,255,6); glBegin(GL_POINTS); for(register unsigned int index = 0; index < _points.size(); index++) glVertex2f(_points[index].x(),Normalize(_points[index].y())); glEnd(); Generated on Sun Dec 4 13:31:15 2011 by Doxygen
  • 18. 4.2 MyGlWindowPlot.cxx 00075 00076 00077 00078 00079 00080 00081 00082 00083 00084 00085 00093 00094 00095 00096 00097 00098 00099 00100 00101 00102 00106 00107 00108 00109 00110 00111 00115 00116 00117 00118 00119 00120 00124 00125 00126 00127 00128 00129 00133 00134 00135 00136 00137 00141 00142 00143 00144 00145 00146 00150 17 glPopMatrix(); //Desabilitando o alpha / transparência glDisable(GL_BLEND); //Marcando a origem dos eixos glPointSize(4); glColor3ub(255,99,23); glBegin(GL_POINTS); glVertex2f(0,0); glVertex2f(0,0); glEnd(); } void MyGlWindowPlot::resize(int X,int Y,int W,int H) { Fl_Gl_Window::resize(X,Y,W,H); glMatrixMode(GL_PROJECTION); glLoadIdentity(); glViewport(0,0,W,H); glOrtho(-W,W,-H,H,-1,1); redraw(); } void MyGlWindowPlot::ZoomLess(void) { _aspect_ratio = (double)_aspect_ratio/1.05; redraw(); }; void MyGlWindowPlot::ZoomMore(void) { _aspect_ratio = (double)_aspect_ratio*1.05; redraw(); }; void MyGlWindowPlot::ResetZoom(void) { _aspect_ratio = (double)w()/(double)h(); redraw(); }; void MyGlWindowPlot::max_y_value(long double y_max) { _max_y_value = y_max; }; long double MyGlWindowPlot::Normalize(long double y_value) { long double _max = (_max_y_value == 0)?(1):(_max_y_value); return (long double)( ((h()*0.55)*y_value)/(_max)); } void MyGlWindowPlot::add (float x, float y, FLPlotColor color, std::string label) 00151 { 00152 _points.push_back(FLPlotPointXY(x*_aspect_ratio_x,y*_aspect_ratio_y,color,label )); 00153 } 00154 00158 int MyGlWindowPlot::handle(int e) 00159 { 00160 switch (e) 00161 { 00162 case FL_ENTER: cursor(FL_CURSOR_CROSS); break; 00163 case FL_LEAVE: cursor(FL_CURSOR_DEFAULT); break; 00164 } 00165 return Fl_Gl_Window::handle(e); 00166 } 00167 Generated on Sun Dec 4 13:31:15 2011 by Doxygen
  • 19. 18 00171 00172 00173 00174 00175 00176 00177 00178 00179 00180 00181 00182 00183 00187 File Documentation void MyGlWindowPlot::drawCircle(float Radius, unsigned int numPoints) { glBegin( GL_LINE_STRIP ); for(unsigned int i=0; i <= numPoints; i++ ) { float Angle = i * (2.0*M_PI/numPoints); // use 360 instead of 2.0*PI if float X = cos( Angle )*Radius; // you use d_cos and d_sin float Y = sin( Angle )*Radius; glVertex2f( X, Y ); } glEnd(); } void MyGlWindowPlot::clear(void) { _points.clear(); redraw(); }; Generated on Sun Dec 4 13:31:15 2011 by Doxygen
  • 20. 4.3 MyGlWindowPlot.h File Reference 4.3 19 MyGlWindowPlot.h File Reference #include <cmath> #include <vector> #include <iostream> #include <sstream> #include <FL/Fl.H> #include <FL/gl.h> #include <FL/Fl_Gl_Window.H> Include dependency graph for MyGlWindowPlot.h: MyGlWindowPlot.h cmath vector iostream sstream FL/Fl.H FL/gl.h This graph shows which files directly or indirectly include this file: MyGlWindowPlot.h Sys-MyGlWindowPlot.cpp Classes • class FLPlotColor • class FLPlotPointXY • class MyGlWindowPlot Generated on Sun Dec 4 13:31:15 2011 by Doxygen FL/Fl_Gl_Window.H
  • 21. 20 4.4 00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 00013 00014 00015 00016 00017 00018 00019 00023 00024 00025 00026 00027 00028 00029 00030 File Documentation MyGlWindowPlot.h /* * MyGlWindowplot.h * * Created on: 11/09/2009 Author: Administrador * */ #ifndef MYGLWINDOWPLOT_H_ #define MYGLWINDOWPLOT_H_ #include #include #include #include <cmath> <vector> <iostream> <sstream> #include <FL/Fl.H> #include <FL/gl.h> #include <FL/Fl_Gl_Window.H> class FLPlotColor { unsigned char _r; unsigned char _g; unsigned char _b; //Componente vermelha //Componente verde //Componente azul public: FLPlotColor(unsigned char r = 0, unsigned char g =0, unsigned char b = 0): _r (r), _g(g), _b(b) {}; 00031 00032 void r(unsigned char red) { _r = red; }; 00033 void g(unsigned char green) { _g = green; }; 00034 void b(unsigned char blue) { _b = blue; }; 00035 00036 unsigned char r(void) { return _r; }; 00037 unsigned char g(void) { return _g; }; 00038 unsigned char b(void) { return _b; }; 00039 }; 00040 00044 class FLPlotPointXY 00045 { 00046 float _x; // Coordenada x 00047 float _y; // Coordenada y 00048 FLPlotColor _color; // Cor do ponto 00049 std::string _label; // Um rótulo para o ponto 00050 00051 public : 00052 FLPlotPointXY(){ _x = 0; _y = 0; _color = 0; _label = ""; }; 00053 FLPlotPointXY(float x, float y, FLPlotColor color, std::string label){ _x = x; _y = y; _color = color; _label = label; }; 00054 00055 float x(void) { return _x; }; 00056 void x(float X) { _x = X; }; 00057 00058 float y(void) { return _y; }; 00059 void y(float Y) { _y = Y; }; 00060 00061 FLPlotColor color(void) { return _color; }; 00062 void color(FLPlotColor color) { _color = color; }; 00063 00064 std::string label(void) { return _label; }; 00065 void label(std::string L) { _label = L; }; 00066 }; 00067 00071 class MyGlWindowPlot : public Fl_Gl_Window 00072 { Generated on Sun Dec 4 13:31:15 2011 by Doxygen
  • 22. 4.4 MyGlWindowPlot.h 00073 00074 00075 00076 00077 00078 00079 00080 00081 00082 00083 double _aspect_ratio; o geral float _aspect_ratio_x; float _aspect_ratio_y; float _mark_height_in_x; dade em x float _submark_height_in_x; unidades inteiras std::vector<FLPlotPointXY> _points; plotados std::ostringstream _oss; s eixos; std::string _label_plotter; FLPlotPointXY _marked_point; bool _mark_point; marcado long double _max_y_value; pontos 21 //razao de aspecto para exibiçã //razão de aspecto em x //razão de aspecto em y //altura da marca para cada uni //altura da submarca entre duas //lista de pontos que devem ser //Conversor para a numeração do //Rótulo ou título do plotador //Ponto que deve ser marcado. //Verifica se o ponto deve ser //Recebe o maior valor entre os 00084 00088 void InitializeSystem(); 00089 00093 void draw(); 00094 00102 void resize(int X,int Y,int W,int H); 00103 00104 public: 00108 MyGlWindowPlot(int X,int Y,int W,int H,const char*L=0); 00109 00113 void ZoomLess(void); 00114 00118 void ZoomMore(void); 00119 00123 void ResetZoom(void); 00124 00128 void max_y_value(long double y_max); 00129 00133 long double Normalize(long double y_value); 00134 00138 void add (float x, float y, FLPlotColor color = 0, std::string label = ""); 00139 00143 void drawCircle(float Radius, unsigned int numPoints); 00144 00148 void MarkedPoint(FLPlotPointXY p) { _marked_point = p; }; 00149 00153 void MarkPoint(bool _mark) { _mark_point = _mark; }; 00154 00158 int handle(int e); 00159 00163 void clear(void); 00164 }; 00165 00166 #endif /* MYGLWINDOWPLOT_H_ */ Generated on Sun Dec 4 13:31:15 2011 by Doxygen
  • 23. 22 File Documentation 4.5 Sys-MyGlWindowPlot.cpp File Reference #include <iostream> #include <FL/Fl.H> #include <FL/glut.H> #include <FL/Fl_Double_Window.H> #include "MyGlWindowPlot.h" Include dependency graph for Sys-MyGlWindowPlot.cpp: Sys-MyGlWindowPlot.cpp MyGlWindowPlot.h iostream FL/Fl.H vector FL/glut.H sstream FL/gl.h FL/Fl_Double_Window.H FL/Fl_Gl_Window.H cmath Functions • int main (int argc, char ∗argv[ ]) 4.5.1 Function Documentation 4.5.1.1 int main (int argc, char ∗ argv[ ]) Função para testes com a biblioteca. Definition at line 16 of file Sys-MyGlWindowPlot.cpp. 00017 { 00018 Fl_Double_Window mywin(0,0,400,300); 00019 mywin.resizable(mywin); 00020 mywin.begin(); 00021 glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH); 00022 MyGlWindowPlot g(10, 10, 380, 260); 00023 mywin.end(); 00024 mywin.show(); 00025 return Fl::run(); 00026 } Generated on Sun Dec 4 13:31:15 2011 by Doxygen
  • 24. 4.6 Sys-MyGlWindowPlot.cpp 4.6 00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 00016 00017 00018 00019 00020 00021 00022 00023 00024 00025 00026 Sys-MyGlWindowPlot.cpp //============================================================================ // Name : Sys-MyGlWindowPlot // Author : Michel Alves dos Santos // Version : 1.0 //============================================================================ #include #include #include #include #include <iostream> <FL/Fl.H> <FL/glut.H> <FL/Fl_Double_Window.H> "MyGlWindowPlot.h" int main(int argc, char* argv[]) { Fl_Double_Window mywin(0,0,400,300); mywin.resizable(mywin); mywin.begin(); glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH); MyGlWindowPlot g(10, 10, 380, 260); mywin.end(); mywin.show(); return Fl::run(); } Generated on Sun Dec 4 13:31:15 2011 by Doxygen 23
  • 25. Index add MyGlWindowPlot, 11 b FLPlotColor, 5, 6 clear MyGlWindowPlot, 11 color FLPlotPointXY, 8 drawCircle MyGlWindowPlot, 11 FLPlotColor, 5 b, 5, 6 FLPlotColor, 5 g, 6 r, 6 FLPlotPointXY, 7 color, 8 FLPlotPointXY, 8 label, 8 x, 8, 9 y, 9 drawCircle, 11 handle, 12 MarkedPoint, 12 MarkPoint, 12 max_y_value, 12 MyGlWindowPlot, 11 Normalize, 12 ResetZoom, 13 ZoomLess, 13 ZoomMore, 13 MyGlWindowPlot.cxx, 15 MyGlWindowPlot.h, 19 Normalize MyGlWindowPlot, 12 r FLPlotColor, 6 ResetZoom MyGlWindowPlot, 13 Sys-MyGlWindowPlot.cpp, 22 main, 22 x FLPlotPointXY, 8, 9 g FLPlotColor, 6 y FLPlotPointXY, 9 handle MyGlWindowPlot, 12 label FLPlotPointXY, 8 main Sys-MyGlWindowPlot.cpp, 22 MarkedPoint MyGlWindowPlot, 12 MarkPoint MyGlWindowPlot, 12 max_y_value MyGlWindowPlot, 12 MyGlWindowPlot, 10 add, 11 clear, 11 ZoomLess MyGlWindowPlot, 13 ZoomMore MyGlWindowPlot, 13