marLine Class Reference

#include <marLine.h>

List of all members.

Public Member Functions

 marLine ()
 marLine (double x1, double y1, double x2, double y2)
 marLine (double a, double b)
void getNormal (double *a, double *b)
void getIntersect (double a, double b, double c, double *x, double *y)
double getA ()
double getB ()
double getC ()
virtual ~marLine ()

Private Attributes

double a
double b
double c

Detailed Description

Definition at line 8 of file marLine.h.


Constructor & Destructor Documentation

marLine::marLine (  ) 

Definition at line 6 of file marLine.cpp.

References a, b, and c.

00006                 {
00007         this->a = 1;
00008         this->b = 1;
00009         this->c = 0;
00010 }

marLine::marLine ( double  x1,
double  y1,
double  x2,
double  y2 
)

Definition at line 13 of file marLine.cpp.

References a, b, and c.

00013                                                           {
00014         this->a = y2 - y1;                      //REVISAR SIGNO
00015         this->b = (x1 - x2);
00016         this->c = (y1 - y2) * x1 + (x2 - x1)*y1;
00017 }

marLine::marLine ( double  a,
double  b 
)

Definition at line 20 of file marLine.cpp.

References c.

00020                                   {
00021         this->a = a;
00022         this->b = b;
00023         this->c = 0;
00024 }

marLine::~marLine (  )  [virtual]

Definition at line 80 of file marLine.cpp.

00080                  {
00081 }


Member Function Documentation

double marLine::getA (  ) 

Definition at line 65 of file marLine.cpp.

References a.

Referenced by marAxisCT::filterContour().

00065                     {
00066         return a;
00067 }

Here is the caller graph for this function:

double marLine::getB (  ) 

Definition at line 70 of file marLine.cpp.

References b.

Referenced by marAxisCT::filterContour().

00070                     {
00071         return b;
00072 }

Here is the caller graph for this function:

double marLine::getC (  ) 

Definition at line 75 of file marLine.cpp.

References c.

Referenced by marAxisCT::filterContour().

00075                     {
00076         return c;
00077 }

Here is the caller graph for this function:

void marLine::getIntersect ( double  a,
double  b,
double  c,
double *  x,
double *  y 
)

Definition at line 33 of file marLine.cpp.

Referenced by marAxisCT::filterContour().

00033                                                                             {
00034 
00035         if (this->a == a){
00036                 *x = -1;
00037                 *y = -1;
00038                 return;
00039         }
00040 
00041         if (this->b == b){
00042                 *x = -1;
00043                 *y = -1;
00044                 return;
00045         }
00046 
00047         *x = (c*this->b - this->c*b) / (this->a*b - a*this->b);
00048 
00049         if (this->b == 0){
00050                 *y = -c/b;
00051         } else if (b == 0){
00052                 *y = -this->c/this->b;
00053         } else {
00054                 *y = (-this->a*(*x) - this->c) / this->b;
00055         }
00056         
00057 
00058         if (*x < 0 || *y < 0){
00059                 *x = -1;
00060                 *y = -1;
00061         }
00062         
00063 }

Here is the caller graph for this function:

void marLine::getNormal ( double *  a,
double *  b 
)

Definition at line 27 of file marLine.cpp.

00027                                            {
00028         *a = (this->b);
00029         *b = this->a;
00030 }


Member Data Documentation

double marLine::a [private]

Definition at line 22 of file marLine.h.

Referenced by getA(), and marLine().

double marLine::b [private]

Definition at line 23 of file marLine.h.

Referenced by getB(), and marLine().

double marLine::c [private]

Definition at line 24 of file marLine.h.

Referenced by getC(), and marLine().


The documentation for this class was generated from the following files:

Generated on 18 Mar 2010 for creaMaracasVisu_lib by  doxygen 1.6.1