File: vtkPath.h

package info (click to toggle)
vtk6 6.3.0%2Bdfsg2-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 118,880 kB
  • sloc: cpp: 1,442,792; ansic: 113,395; python: 72,383; tcl: 46,998; xml: 8,119; yacc: 4,525; java: 4,239; perl: 3,108; lex: 1,694; sh: 1,093; asm: 154; makefile: 103; objc: 17
file content (116 lines) | stat: -rw-r--r-- 3,834 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
/*=========================================================================

  Program:   Visualization Toolkit
  Module:    vtkPath.h

  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
  All rights reserved.
  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.

     This software is distributed WITHOUT ANY WARRANTY; without even
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
     PURPOSE.  See the above copyright notice for more information.

=========================================================================*/
// .NAME vtkPath - concrete dataset representing a path defined by Bezier
// curves.
// .SECTION Description
// vtkPath provides a container for paths composed of line segment and
// 2nd/3rd order Bezier curves.

#ifndef vtkPath_h
#define vtkPath_h

#include "vtkCommonDataModelModule.h" // For export macro
#include "vtkPointSet.h"

class vtkIntArray;

class VTKCOMMONDATAMODEL_EXPORT vtkPath : public vtkPointSet
{
public:
  static vtkPath *New();

  vtkTypeMacro(vtkPath,vtkPointSet);
  void PrintSelf(ostream& os, vtkIndent indent);

  // Description:
  // Return what type of dataset this is.
  int GetDataObjectType() {return VTK_PATH;}

  // Description:
  // Enumeration of recognized control point types:
  // - MOVE_TO: Point defining the origin of a new segment, not connected to
  //   the previous point.
  // - LINE_TO: Draw a line from the previous point to the current one
  // - CONIC_CURVE: 2nd order (conic/quadratic) point. Must appear
  //   in sets of 2, e.g. (0,0) MOVE_TO (0,1) CONIC_CURVE (1,2) CONIC_CURVE
  //   defines a quadratic Bezier curve that passes through (0,0) and (1,2)
  //   using (0,1) as a control (off) point.
  // - CUBIC_CURVE: 3rd order (cubic) control point. Must appear in sets of
  //   3, e.g. (0,0) MOVE_TO (0,1) CUBIC_CURVE (1,2) CUBIC_CURVE (4,0)
  //   CUBIC_CURVE defines a cubic Bezier curve that passes through (0,0)
  //   and (4,0), using (0,1) and (1,2) as control (off) points.
  enum ControlPointType
    {
    MOVE_TO = 0,
    LINE_TO,
    CONIC_CURVE,
    CUBIC_CURVE
    };

  // Description:
  // Insert the next control point in the path.
  void InsertNextPoint(float pts[3], int code);
  void InsertNextPoint(double pts[3], int code);
  void InsertNextPoint(double x, double y, double z, int code);

  // Description:
  // Set/Get the array of control point codes:
  void SetCodes(vtkIntArray *);
  vtkIntArray *GetCodes();

  // Description:
  //vtkPath doesn't use cells. These methods return trivial values.
  vtkIdType GetNumberOfCells() { return 0; }
  vtkCell *GetCell(vtkIdType) { return NULL; }
  void GetCell(vtkIdType, vtkGenericCell *);
  int GetCellType(vtkIdType) { return 0; }

  // Description:
  // vtkPath doesn't use cells, this method just clears ptIds.
  void GetCellPoints(vtkIdType, vtkIdList *ptIds);

  // Description:
  // vtkPath doesn't use cells, this method just clears cellIds.
  void GetPointCells(vtkIdType ptId, vtkIdList *cellIds);

  // Description:
  // Return the maximum cell size in this poly data.
  int GetMaxCellSize() { return 0; }

  // Description:
  // Method allocates initial storage for points. Use this method before the
  // method vtkPath::InsertNextPoint().
  void Allocate(vtkIdType size=1000, int extSize=1000);

  // Description:
  // Begin inserting data all over again. Memory is not freed but otherwise
  // objects are returned to their initial state.
  void Reset();

  // Description:
  // Retrieve an instance of this class from an information object.
  static vtkPath* GetData(vtkInformation* info);
  static vtkPath* GetData(vtkInformationVector* v, int i=0);

protected:
  vtkPath();
  ~vtkPath();

private:
  vtkPath(const vtkPath&);  // Not implemented.
  void operator=(const vtkPath&);  // Not implemented.
};

#endif