Main Page | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

idPointListInterface Class Reference

#include <splines.h>

Inheritance diagram for idPointListInterface:

Inheritance graph
[legend]
Collaboration diagram for idPointListInterface:

Collaboration graph
[legend]

Public Member Functions

virtual void addPoint (const idVec3_t &v)
virtual void addPoint (const float x, const float y, const float z)
virtual void addPoint (const idVec3_t &v)
virtual void addPoint (const float x, const float y, const float z)
void deselectAll ()
void deselectAll ()
void drawSelection ()
virtual idVec3_tgetPoint (int index)
virtual idVec3_tgetPoint (int index)
idVec3_tgetSelectedPoint (int index)
 idPointListInterface ()
 idPointListInterface ()
int isPointSelected (int index)
int isPointSelected (int index)
virtual int numPoints ()
virtual int numPoints ()
int numSelectedPoints ()
virtual void removePoint (int index)
virtual void removePoint (int index)
void selectAll ()
void selectAll ()
int selectPoint (int index, bool single)
int selectPoint (int index, bool single)
int selectPointByRay (const idVec3_t origin, const idVec3_t direction, bool single)
int selectPointByRay (float ox, float oy, float oz, float dx, float dy, float dz, bool single)
int selectPointByRay (const idVec3_t origin, const idVec3_t direction, bool single)
int selectPointByRay (float ox, float oy, float oz, float dx, float dy, float dz, bool single)
virtual void updateSelection (const idVec3_t &move)
virtual void updateSelection (float x, float y, float z)
virtual void updateSelection (const idVec3_t &move)
virtual void updateSelection (float x, float y, float z)
 ~idPointListInterface ()
virtual ~idPointListInterface ()

Protected Attributes

idList< int > selectedPoints
idList< int > selectedPoints

Constructor & Destructor Documentation

idPointListInterface  )  [inline]
 

Definition at line 46 of file splines.h.

00046                            {
00047         selectedPoints.Clear();
00048     }

virtual ~idPointListInterface  )  [inline, virtual]
 

Definition at line 49 of file splines.h.

00049 {}

idPointListInterface  )  [inline]
 

Definition at line 46 of file splines.h.

00046                            {
00047         selectedPoints.Clear();
00048     };

~idPointListInterface  )  [inline]
 

Definition at line 49 of file splines.h.

00049 {};


Member Function Documentation

virtual void addPoint const idVec3_t v  )  [inline, virtual]
 

Reimplemented in idFixedPosition, idInterpolatedPosition, idSplinePosition, idFixedPosition, idInterpolatedPosition, and idSplinePosition.

Definition at line 56 of file splines.h.

00056 {}

virtual void addPoint const float  x,
const float  y,
const float  z
[inline, virtual]
 

Reimplemented in idFixedPosition, idInterpolatedPosition, idSplinePosition, idFixedPosition, idInterpolatedPosition, and idSplinePosition.

Definition at line 55 of file splines.h.

00055 {}

virtual void addPoint const idVec3_t v  )  [inline, virtual]
 

Reimplemented in idFixedPosition, idInterpolatedPosition, idSplinePosition, idFixedPosition, idInterpolatedPosition, and idSplinePosition.

Definition at line 56 of file splines.h.

00056 {}

virtual void addPoint const float  x,
const float  y,
const float  z
[inline, virtual]
 

Reimplemented in idFixedPosition, idInterpolatedPosition, idSplinePosition, idFixedPosition, idInterpolatedPosition, and idSplinePosition.

Definition at line 55 of file splines.h.

Referenced by Drag_Setup(), and CXYWnd::XY_MouseDown().

00055 {}

void deselectAll  )  [inline]
 

Definition at line 128 of file splines.h.

00128                        {
00129         selectedPoints.Clear();
00130     }

void deselectAll  )  [inline]
 

Definition at line 128 of file splines.h.

00128                        {
00129         selectedPoints.Clear();
00130     }

void drawSelection  )  [inline]
 

Definition at line 151 of file splines.h.

References glBox(), i, and red.

Referenced by CCamWnd::Cam_Draw().

00151                          {
00152         int count = selectedPoints.Num();
00153         for (int i = 0; i < count; i++) {
00154             glBox(red, *getPoint(selectedPoints[i]), 4);
00155         }
00156     }

Here is the call graph for this function:

virtual idVec3_t* getPoint int  index  )  [inline, virtual]
 

Reimplemented in idFixedPosition, idInterpolatedPosition, idSplinePosition, idFixedPosition, idInterpolatedPosition, and idSplinePosition.

Definition at line 58 of file splines.h.

00058 { return NULL; }

virtual idVec3_t* getPoint int  index  )  [inline, virtual]
 

Reimplemented in idFixedPosition, idInterpolatedPosition, idSplinePosition, idFixedPosition, idInterpolatedPosition, and idSplinePosition.

Definition at line 58 of file splines.h.

00058 { return NULL; }

idVec3_t* getSelectedPoint int  index  )  [inline]
 

Definition at line 134 of file splines.h.

References assert.

00134                                           {
00135         assert(index >= 0 && index < numSelectedPoints());
00136         return getPoint(selectedPoints[index]);
00137     }

int isPointSelected int  index  )  [inline]
 

Definition at line 97 of file splines.h.

References i.

00097                                    {
00098         int count = selectedPoints.Num();
00099         for (int i = 0; i < count; i++) {
00100             if (selectedPoints[i] == index) {
00101                 return i;
00102             }
00103         }
00104         return -1;
00105     }

int isPointSelected int  index  )  [inline]
 

Definition at line 97 of file splines.h.

References i.

00097                                    {
00098         int count = selectedPoints.Num();
00099         for (int i = 0; i < count; i++) {
00100             if (selectedPoints[i] == index) {
00101                 return i;
00102             }
00103         }
00104         return -1;
00105     }

virtual int numPoints  )  [inline, virtual]
 

Reimplemented in idFixedPosition, idInterpolatedPosition, idSplinePosition, idFixedPosition, idInterpolatedPosition, and idSplinePosition.

Definition at line 51 of file splines.h.

00051                             {
00052         return 0;
00053     }

virtual int numPoints  )  [inline, virtual]
 

Reimplemented in idFixedPosition, idInterpolatedPosition, idSplinePosition, idFixedPosition, idInterpolatedPosition, and idSplinePosition.

Definition at line 51 of file splines.h.

00051                             {
00052         return 0;
00053     }

int numSelectedPoints  ) 
 

virtual void removePoint int  index  )  [inline, virtual]
 

Definition at line 57 of file splines.h.

00057 {}

virtual void removePoint int  index  )  [inline, virtual]
 

Definition at line 57 of file splines.h.

00057 {}

void selectAll  )  [inline]
 

Definition at line 121 of file splines.h.

References i.

00121                      {
00122         selectedPoints.Clear();
00123         for (int i = 0; i < numPoints(); i++) {
00124             selectedPoints.Append(i);
00125         }
00126     }

void selectAll  )  [inline]
 

Definition at line 121 of file splines.h.

References i.

00121                      {
00122         selectedPoints.Clear();
00123         for (int i = 0; i < numPoints(); i++) {
00124             selectedPoints.Append(i);
00125         }
00126     }

int selectPoint int  index,
bool  single
[inline]
 

Definition at line 107 of file splines.h.

00107                                             {
00108         if (index >= 0 && index < numPoints()) {
00109             if (single) {
00110                 deselectAll();
00111             } else {
00112                 if (isPointSelected(index) >= 0) {
00113                     selectedPoints.Remove(index);
00114                 }
00115             }
00116             return selectedPoints.Append(index);
00117         }
00118         return -1;
00119     }

int selectPoint int  index,
bool  single
[inline]
 

Definition at line 107 of file splines.h.

00107                                             {
00108         if (index >= 0 && index < numPoints()) {
00109             if (single) {
00110                 deselectAll();
00111             } else {
00112                 if (isPointSelected(index) >= 0) {
00113                     selectedPoints.Remove(index);
00114                 }
00115             }
00116             return selectedPoints.Append(index);
00117         }
00118         return -1;
00119     }

int selectPointByRay const idVec3_t  origin,
const idVec3_t  direction,
bool  single
[inline]
 

Definition at line 66 of file splines.h.

References __VectorMA, count, d, DotProduct, i, and idVec3_t::Length().

00066                                                                                        {
00067         int     i, besti, count;
00068         float   d, bestd;
00069         idVec3_t    temp, temp2;
00070 
00071         // find the point closest to the ray
00072         besti = -1;
00073         bestd = 8;
00074         count = numPoints();
00075 
00076         for (i=0; i < count; i++) {
00077             temp = *getPoint(i);
00078             temp2 = temp;
00079             temp -= origin;
00080             d = DotProduct(temp, direction);
00081             __VectorMA (origin, d, direction, temp);
00082             temp2 -= temp;
00083             d = temp2.Length();
00084             if (d <= bestd) {
00085                 bestd = d;
00086                 besti = i;
00087             }
00088         }
00089 
00090         if (besti >= 0) {
00091             selectPoint(besti, single);
00092         }
00093 
00094         return besti;
00095     }

Here is the call graph for this function:

int selectPointByRay float  ox,
float  oy,
float  oz,
float  dx,
float  dy,
float  dz,
bool  single
[inline]
 

Definition at line 60 of file splines.h.

00060                                                                                                   {
00061         idVec3_t origin(ox, oy, oz);
00062         idVec3_t dir(dx, dy, dz);
00063         return selectPointByRay(origin, dir, single);
00064     }

int selectPointByRay const idVec3_t  origin,
const idVec3_t  direction,
bool  single
[inline]
 

Definition at line 66 of file splines.h.

References __VectorMA, count, d, DotProduct, i, and idVec3_t::Length().

00066                                                                                        {
00067         int     i, besti, count;
00068         float   d, bestd;
00069         idVec3_t    temp, temp2;
00070 
00071         // find the point closest to the ray
00072         besti = -1;
00073         bestd = 8;
00074         count = numPoints();
00075 
00076         for (i=0; i < count; i++) {
00077             temp = *getPoint(i);
00078             temp2 = temp;
00079             temp -= origin;
00080             d = DotProduct(temp, direction);
00081             __VectorMA (origin, d, direction, temp);
00082             temp2 -= temp;
00083             d = temp2.Length();
00084             if (d <= bestd) {
00085                 bestd = d;
00086                 besti = i;
00087             }
00088         }
00089 
00090         if (besti >= 0) {
00091             selectPoint(besti, single);
00092         }
00093 
00094         return besti;
00095     }

Here is the call graph for this function:

int selectPointByRay float  ox,
float  oy,
float  oz,
float  dx,
float  dy,
float  dz,
bool  single
[inline]
 

Definition at line 60 of file splines.h.

Referenced by Drag_Setup().

00060                                                                                                   {
00061         idVec3_t origin(ox, oy, oz);
00062         idVec3_t dir(dx, dy, dz);
00063         return selectPointByRay(origin, dir, single);
00064     }

virtual void updateSelection const idVec3_t move  )  [inline, virtual]
 

Reimplemented in idSplinePosition, and idSplinePosition.

Definition at line 144 of file splines.h.

References i.

00144                                                        {
00145         int count = selectedPoints.Num();
00146         for (int i = 0; i < count; i++) {
00147             *getPoint(selectedPoints[i]) += move;
00148         }
00149     }

virtual void updateSelection float  x,
float  y,
float  z
[inline, virtual]
 

Definition at line 139 of file splines.h.

References move(), x, y, and z.

00139                                                             {
00140         idVec3_t move(x, y, z);
00141         updateSelection(move);
00142     }

Here is the call graph for this function:

virtual void updateSelection const idVec3_t move  )  [inline, virtual]
 

Reimplemented in idSplinePosition, and idSplinePosition.

Definition at line 137 of file splines.h.

References i.

00137                                                        {
00138         int count = selectedPoints.Num();
00139         for (int i = 0; i < count; i++) {
00140             *getPoint(selectedPoints[i]) += move;
00141         }
00142     }

virtual void updateSelection float  x,
float  y,
float  z
[inline, virtual]
 

Definition at line 132 of file splines.h.

References move(), x, y, and z.

Referenced by MoveSelection(), and idSplinePosition::updateSelection().

00132                                                             {
00133         idVec3_t move(x, y, z);
00134         updateSelection(move);
00135     }

Here is the call graph for this function:


Field Documentation

idList<int> selectedPoints [protected]
 

Definition at line 159 of file splines.h.

idList<int> selectedPoints [protected]
 

Definition at line 152 of file splines.h.


The documentation for this class was generated from the following files:
Generated on Thu Aug 25 19:54:07 2005 for Quake III Arena by  doxygen 1.3.9.1