Back to index

wims  3.65+svn20090927
Public Member Functions | Public Attributes | Package Attributes
geo.Segment Class Reference

Segment. More...

Inheritance diagram for geo.Segment:
Inheritance graph
[legend]
Collaboration diagram for geo.Segment:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Segment (String Nom, Repere R)
 Construit un segment non défini.
 Segment (pt A, pt B, String Nom, Repere R)
 Construit le segment [AB].
 Segment (double Ax, double Ay, double Bx, double By, String Nom, Repere R)
 Construit le segment d'extrémités les points de coordonnées (Ax, Ay) et (Bx, By).
double Longueur ()
 Retourne la longueur du segment.
void trace (Graphics g)
 Trace ou efface le segment.
boolean zone (int X, int Y)
 Teste si la souris est proche du segment.
void Segment (pt A, pt B)
 Redéfinit le Segment [AB].
void Segment (double Ax, double Ay, double Bx, double By)
 Redéfinit le Segment d'extrémités les points de coordonnées (Ax, Ay) et (Bx, By).

Public Attributes

int AX
 Position sur l'écran d'une extrémité du segment.
double Ax
 Coordonnée d'une extrémité du segment.
Repere R
 Repere associé.
boolean defini
 Existence de l'objet.
String Nom
 Nom de l'objet.

Package Attributes

int AY
int BX
int BY
double Ay
double Bx
double By

Detailed Description

Segment.

Definition at line 9 of file Segment.java.


Constructor & Destructor Documentation

geo.Segment.Segment ( String  Nom,
Repere  R 
) [inline]

Construit un segment non défini.

Definition at line 28 of file Segment.java.

  { super (Nom, R) ; }
geo.Segment.Segment ( pt  A,
pt  B,
String  Nom,
Repere  R 
) [inline]

Construit le segment [AB].

Definition at line 35 of file Segment.java.

  { super (Nom, R) ; Segment (A, B) ; }

Here is the call graph for this function:

Here is the caller graph for this function:

geo.Segment.Segment ( double  Ax,
double  Ay,
double  Bx,
double  By,
String  Nom,
Repere  R 
) [inline]

Construit le segment d'extrémités les points de coordonnées (Ax, Ay) et (Bx, By).

Definition at line 42 of file Segment.java.

  { super (Nom, R) ; Segment (Ax, Ay, Bx, By) ; }

Here is the call graph for this function:

Here is the caller graph for this function:

void geo.Segment.Segment ( pt  A,
pt  B 
) [inline]

Redéfinit le Segment [AB].

Definition at line 86 of file Segment.java.

  { defini = A.defini && B.defini ;
    if (defini) { AX = A.X ; AY = A.Y ; BX = B.X ; BY = B.Y ;
                  Ax = A.x ; Ay = A.y ; Bx = B.x ; By = B.y ;
                }
  }
void geo.Segment.Segment ( double  Ax,
double  Ay,
double  Bx,
double  By 
) [inline]

Redéfinit le Segment d'extrémités les points de coordonnées (Ax, Ay) et (Bx, By).

Definition at line 97 of file Segment.java.

  { defini = true ;
    if (defini) { this.Ax = Ax ; this.Ay = Ay ; this.Bx = Bx ; this.By = By ;
                  AX = R.Iabs (Ax) ; AY = R.Iord (Ay) ; BX = R.Iabs (Bx) ; BY = R.Iord (By) ;
                }
  }

Here is the call graph for this function:


Member Function Documentation

double geo.Segment.Longueur ( ) [inline]

Retourne la longueur du segment.

Definition at line 49 of file Segment.java.

  { if (defini) { double u = Bx - Ax ; double v = By - Ay ;
                  return Math.sqrt (u * u + v * v) ;
                }
    else        return -1.0 ;
  }
void geo.Segment.trace ( Graphics  g) [inline]

Trace ou efface le segment.

Reimplemented from geo.ObjetRepere.

Definition at line 60 of file Segment.java.

  { if (defini)
      { g.drawLine (AX, AY, BX, BY) ;
        if (Nom.length () != 0) g.drawString (Nom, (AX + BX) / 2 + 3, (AY + BY) / 2 - 3) ;
      }
  }
boolean geo.Segment.zone ( int  X,
int  Y 
) [inline]

Teste si la souris est proche du segment.

Reimplemented from geo.ObjetRepere.

Definition at line 71 of file Segment.java.

   { if (defini)
       { int A = BY - AY ; int B = AX - BX ;
         double d = ((double) Math.abs (A * X + B * Y + AY * BX - AX * BY)) / Math.sqrt ((double) (A * A + B * B)) ;
         if ((d <= 4.0) && ((X - AX) * (X - BX) <= 0) && ((Y - AY) * (Y - BY) <= 0))
           return true ;
         else return false ;
       }
     return false ;
   }

Member Data Documentation

Position sur l'écran d'une extrémité du segment.

Definition at line 16 of file Segment.java.

Coordonnée d'une extrémité du segment.

Definition at line 22 of file Segment.java.

int geo.Segment.AY [package]

Definition at line 16 of file Segment.java.

double geo.Segment.Ay [package]

Definition at line 22 of file Segment.java.

int geo.Segment.BX [package]

Definition at line 16 of file Segment.java.

double geo.Segment.Bx [package]

Definition at line 22 of file Segment.java.

int geo.Segment.BY [package]

Definition at line 16 of file Segment.java.

double geo.Segment.By [package]

Definition at line 22 of file Segment.java.

Existence de l'objet.

Definition at line 22 of file ObjetRepere.java.

String geo.ObjetRepere.Nom [inherited]

Nom de l'objet.

Definition at line 28 of file ObjetRepere.java.

Repere associé.

Definition at line 16 of file ObjetRepere.java.


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