A spline used to store gradient components waveforms.  
 More...
#include <anatomist/gradientwidget/spline.h>
 | 
|   | Spline () | 
|   | Constructor.  More...
  | 
|   | 
|   | ~Spline () | 
|   | Destructor.  More...
  | 
|   | 
| int  | getNodesCnt () const | 
|   | Get the number of nodes in the spline.  More...
  | 
|   | 
| void  | clear () | 
|   | Remove all spline nodes.  More...
  | 
|   | 
| int  | findNode (QSize gradSize, QPoint ptPos, QSize ptSize) const | 
|   | Find a node at the specified position.  More...
  | 
|   | 
| void  | findSegment (QSize gradSize, QPoint ptPos, int &p1, int &p2) const | 
|   | Find a segment at the specified position.  More...
  | 
|   | 
| void  | addNode (double x, double y) | 
|   | Add a node to the spline.  More...
  | 
|   | 
| int  | insertNode (double x, double y) | 
|   | Insert a node into the spline.  More...
  | 
|   | 
| void  | setNode (int index, double x, double y) | 
|   | Change the position of a node.  More...
  | 
|   | 
| void  | removeNode (int index) | 
|   | Remove a node.  More...
  | 
|   | 
| void  | insertAt (int index) | 
|   | Insert a node at the given position.  More...
  | 
|   | 
| double  | getNodeX (int index) const | 
|   | Get the x coordinate of the given node.  More...
  | 
|   | 
| double  | getNodeY (int index) const | 
|   | Get the y coordinate of the given node.  More...
  | 
|   | 
| double  | getLimitMin (int index) const | 
|   | Get the minimum x coordinate of the given node.  More...
  | 
|   | 
| double  | getLimitMax (int index) const | 
|   | Get the maximum x coordinate of the given node.  More...
  | 
|   | 
| void  | invert () | 
|   | Invert the nodes in the spline.  More...
  | 
|   | 
| void  | generateSpline (double *buffer, int count) const | 
|   | Generate the spline waveform.  More...
  | 
|   | 
| QString  | toString () const | 
|   | Encode the spline data as a string.  More...
  | 
|   | 
| void  | fromString (const QString &string) | 
|   | Decode the spline data from a string.  More...
  | 
|   | 
A spline used to store gradient components waveforms. 
Definition at line 17 of file spline.h.
 
◆ Spline()
◆ ~Spline()
◆ addNode()
  
  
      
        
          | void Spline::addNode  | 
          ( | 
          double  | 
          x,  | 
         
        
           | 
           | 
          double  | 
          y  | 
         
        
           | 
          ) | 
           |  | 
         
       
   | 
  
inline   | 
  
 
Add a node to the spline. 
- Note
 - The nodes must be added in order of non-descending x coordinates. The valid range of both coordinates is [0..1].
 
- Parameters
 - 
  
    | x | The x coordinate of the node.  | 
    | y | The y coordinate of the node.  | 
  
   
Definition at line 81 of file spline.h.
References insertNode().
 
 
◆ clear()
◆ findNode()
      
        
          | int Spline::findNode  | 
          ( | 
          QSize  | 
          gradSize,  | 
        
        
           | 
           | 
          QPoint  | 
          ptPos,  | 
        
        
           | 
           | 
          QSize  | 
          ptSize  | 
        
        
           | 
          ) | 
           |  const | 
        
      
 
Find a node at the specified position. 
- Parameters
 - 
  
    | gradSize | The size of the gradient's area.  | 
    | ptPos | Position of the point close to the node.  | 
    | ptSize | Size of the node.  | 
  
   
- Returns
 - The index of node or -1 if not found. 
 
Referenced by clear().
 
 
◆ findSegment()
      
        
          | void Spline::findSegment  | 
          ( | 
          QSize  | 
          gradSize,  | 
        
        
           | 
           | 
          QPoint  | 
          ptPos,  | 
        
        
           | 
           | 
          int &  | 
          p1,  | 
        
        
           | 
           | 
          int &  | 
          p2  | 
        
        
           | 
          ) | 
           |  const | 
        
      
 
Find a segment at the specified position. 
- Parameters
 - 
  
    | gradSize | The size of the gradient's area.  | 
    | ptPos | Position of the point close to the node.  | 
    | ptSize | Size of the node.  | 
    | p1 | Pointer to the index of first node or -1 if not found  | 
    | p2 | Pointer to the index of second node or -1 if not found  | 
  
   
Referenced by clear().
 
 
◆ fromString()
      
        
          | void Spline::fromString  | 
          ( | 
          const QString &  | 
          string | ) | 
           | 
        
      
 
Decode the spline data from a string. 
- Parameters
 - 
  
    | string | The encoded spline data.  | 
  
   
Referenced by getLimitMax().
 
 
◆ generateSpline()
      
        
          | void Spline::generateSpline  | 
          ( | 
          double *  | 
          buffer,  | 
        
        
           | 
           | 
          int  | 
          count  | 
        
        
           | 
          ) | 
           |  const | 
        
      
 
Generate the spline waveform. 
- Parameters
 - 
  
    | [out] | buffer | The array to fill.  | 
     | count | The size of the array.  | 
  
   
Referenced by getLimitMax().
 
 
◆ getLimitMax()
  
  
      
        
          | double Spline::getLimitMax  | 
          ( | 
          int  | 
          index | ) | 
           const | 
         
       
   | 
  
inline   | 
  
 
 
◆ getLimitMin()
  
  
      
        
          | double Spline::getLimitMin  | 
          ( | 
          int  | 
          index | ) | 
           const | 
         
       
   | 
  
inline   | 
  
 
Get the minimum x coordinate of the given node. 
- Parameters
 - 
  
    | index | The index of the node.  | 
  
   
- Returns
 - The minimum allowed position of the node. 
 
Definition at line 156 of file spline.h.
 
 
◆ getNodesCnt()
  
  
      
        
          | int Spline::getNodesCnt  | 
          ( | 
           | ) | 
           const | 
         
       
   | 
  
inline   | 
  
 
Get the number of nodes in the spline. 
- Returns
 - The number of nodes. 
 
Definition at line 36 of file spline.h.
 
 
◆ getNodeX()
  
  
      
        
          | double Spline::getNodeX  | 
          ( | 
          int  | 
          index | ) | 
           const | 
         
       
   | 
  
inline   | 
  
 
Get the x coordinate of the given node. 
- Parameters
 - 
  
    | index | The index of the node.  | 
  
   
- Returns
 - The horizontal position of the node. 
 
Definition at line 134 of file spline.h.
 
 
◆ getNodeY()
  
  
      
        
          | double Spline::getNodeY  | 
          ( | 
          int  | 
          index | ) | 
           const | 
         
       
   | 
  
inline   | 
  
 
Get the y coordinate of the given node. 
- Parameters
 - 
  
    | index | The index of the node.  | 
  
   
- Returns
 - The vertical position of the node. 
 
Definition at line 145 of file spline.h.
 
 
◆ insertAt()
  
  
      
        
          | void Spline::insertAt  | 
          ( | 
          int  | 
          index | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
Insert a node at the given position. 
- Parameters
 - 
  
    | index | The index of the position to insert the node.  | 
  
   
Definition at line 123 of file spline.h.
 
 
◆ insertNode()
      
        
          | int Spline::insertNode  | 
          ( | 
          double  | 
          x,  | 
        
        
           | 
           | 
          double  | 
          y  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Insert a node into the spline. 
- Parameters
 - 
  
    | x | The x coordinate of the node.  | 
    | y | The y coordinate of the node.  | 
  
   
- Returns
 - The index of the inserted node. 
 
Referenced by addNode().
 
 
◆ invert()
◆ removeNode()
  
  
      
        
          | void Spline::removeNode  | 
          ( | 
          int  | 
          index | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
Remove a node. 
- Parameters
 - 
  
    | index | The index of the node to remove.  | 
  
   
Definition at line 113 of file spline.h.
 
 
◆ setNode()
  
  
      
        
          | void Spline::setNode  | 
          ( | 
          int  | 
          index,  | 
         
        
           | 
           | 
          double  | 
          x,  | 
         
        
           | 
           | 
          double  | 
          y  | 
         
        
           | 
          ) | 
           |  | 
         
       
   | 
  
inline   | 
  
 
Change the position of a node. 
- Parameters
 - 
  
    | index | The index of the node.  | 
    | x | The new x coordinate of the node.  | 
    | y | The new y coordinate of the node.  | 
  
   
Definition at line 102 of file spline.h.
 
 
◆ toString()
      
        
          | QString Spline::toString  | 
          ( | 
           | ) | 
           const | 
        
      
 
Encode the spline data as a string. 
- Returns
 - The encoded spline data. 
 
Referenced by getLimitMax().
 
 
The documentation for this class was generated from the following file: