GlobeEngine
PolyLine.h
Go to the documentation of this file.
1 //
2 // Polyline.h
3 // GlobeEngine
4 //
5 // Created by Mathias Thöny on 27.12.11.
6 // Copyright (c) 2011 University of Zurich. All rights reserved.
7 //
8 
9 #ifndef GlobeEngine_PolyLine_h
10 #define GlobeEngine_PolyLine_h
11 
12 #include "VBOVertex.h"
13 #include "BSpline.h"
14 #include <map>
15 
16 namespace geData {
17 
19  {
20  double* points;
21  int segments;
22  };
23 
24  class PolyLine
25  {
26  public:
27  PolyLine();
28  ~PolyLine();
29  void clear();
30  void create(std::vector<vmml::Vector3d> _points);
31  void create(int _pointCount, const double* _points);
32  void create(int _pointCount, const vmml::Vector3d* _points);
33  void createWithOffSet(int _pointCount, int _pointOffset, double* _points);
34  void create(int _pointCount, double* _points_x, double* _points_y, double* _points_alti);
35  void create(int _pointCount, double* _points_x, double* _points_y);
36  void create(int _pointCount, double* _points_x, double* _points_y, int _start);
37  void create(int _pointCount, double* _points_x, double* _points_y, double* _points_alti, int _start);
39  double* _points_x,
40  double* _points_y,
41  double* _points_z, vmml::Vector3d _minBound, double* edgelength, double* rescaleTo);
42  void createWithRescale(int _pointCount, double* _points_x, double* _points_y, vmml::Vector3d _minBound, double* edgelength, double* rescaleTo);
43  void calculateDistances();
44 
45  void setData(const double* points);
46  const double* getArray() const;
47  const double* getDistances() const;
48  ge::VBOVertex3d getPoint(int _input) const;
49 
50  void setAdditionalPointSizes(unsigned int* _data);
51 
52  unsigned int getPointCount() const;
53  unsigned int getLineCount() const;
54  double getSummedDistances();
56 
57  virtual void setLineThickness(double _thickness);
58  double getLineThickness() const;
59  int getRefinementLevel() const;
60 
61  bool isNeedingRefinement() const;
62  void isNeedingRefinement(bool _in);
63 
64  void print();
65  void printAll();
66 
67  int getControlPointArraySize() const;
68  int getKnotVectorSize() const;
69  int getAnimationPoint() const;
70  const vmml::Vector3d* getControlPointArray() const;
71 
72  void setSegmentDistance(float _segDist, bool _fixSegments = false);
73  int setControlPointArraySize(int _size);
74 
75  public:
76  void clearInitial();
77  void allocateMemory(int _pointCount);
78  void deletePolyLineMemory();
79 
80  void moveAnimationForward();
81  void moveAnimationBackward();
82 
83  private:
84  void deleteDistanceMemory();
85  void deleteDataMemory();
86 
87  public:
88  /* array of additional point indices */
89  unsigned int** additionalPointsIndices;
90  /* array of the array sizes of the additional indices */
91  unsigned int* additionalPointSizes;
92 
93  protected:
94  unsigned int pointCount;
95  unsigned int lineCount;
96  unsigned int pointsAfterOffset;
97 
98  double lineThickness;
99  double* distances;
101  union {
103  double* data;
104  };
105 
106  // Spline property
109  // Spline interpolation properties;
112  vmml::Vector3d* pts;
113 
114  // line info
116  };
117 }
118 #endif
virtual void setLineThickness(double _thickness)
Definition: PolyLine.cpp:272
void createWithOffSet(int _pointCount, int _pointOffset, double *_points)
Definition: PolyLine.cpp:115
int getRefinementLevel() const
Definition: PolyLine.cpp:298
int ctrlPointSegments
Definition: PolyLine.h:110
Definition: PolyLine.h:18
double * distances
Definition: PolyLine.h:99
unsigned int ** additionalPointsIndices
Definition: PolyLine.h:89
void clearInitial()
Definition: PolyLine.cpp:26
Definition: AvalancheTrainingSimulationEngine.h:39
vmml::Vector3d * pts
Definition: PolyLine.h:112
ge::VBOVertex3d * points
Definition: PolyLine.h:102
void moveAnimationBackward()
Definition: PolyLine.cpp:361
void create(std::vector< vmml::Vector3d > _points)
Definition: PolyLine.cpp:78
void clear()
Definition: PolyLine.cpp:20
~PolyLine()
Definition: PolyLine.cpp:15
void moveAnimationForward()
Definition: PolyLine.cpp:353
double lineThickness
Definition: PolyLine.h:98
double sumOfDistances
Definition: PolyLine.h:100
int refinementlevel
Definition: PolyLine.h:107
const double * getDistances() const
Definition: PolyLine.cpp:290
double * points
Definition: PolyLine.h:20
unsigned int lineCount
Definition: PolyLine.h:95
BSplineInterpolationResult * getBSPlineInterpolationPoints(int _polynomDegree)
Definition: PolyLine.cpp:219
bool isNeedingRefinement() const
Definition: PolyLine.cpp:262
void calculateDistances()
Definition: PolyLine.cpp:203
void setSegmentDistance(float _segDist, bool _fixSegments=false)
Definition: PolyLine.cpp:254
unsigned int pointCount
Definition: PolyLine.h:94
unsigned int pointsAfterOffset
Definition: PolyLine.h:96
double getSummedDistances()
Definition: PolyLine.cpp:311
int setControlPointArraySize(int _size)
Definition: PolyLine.cpp:338
int animationPoint
Definition: PolyLine.h:115
void deletePolyLineMemory()
Definition: PolyLine.cpp:39
void createWithRescale(int pointCount, double *_points_x, double *_points_y, double *_points_z, vmml::Vector3d _minBound, double *edgelength, double *rescaleTo)
Definition: PolyLine.cpp:184
bool needsRefinement
Definition: PolyLine.h:108
int getAnimationPoint() const
Definition: PolyLine.cpp:369
int getControlPointArraySize() const
Definition: PolyLine.cpp:343
void setAdditionalPointSizes(unsigned int *_data)
Definition: PolyLine.cpp:316
const vmml::Vector3d * getControlPointArray() const
Definition: PolyLine.cpp:374
int segments
Definition: PolyLine.h:21
unsigned int getLineCount() const
Definition: PolyLine.cpp:307
Definition: PolyLine.h:24
PolyLine()
Definition: PolyLine.cpp:5
Definition: VBOVertex.h:115
int splineSegments
Definition: PolyLine.h:111
double getLineThickness() const
Definition: PolyLine.cpp:277
int getKnotVectorSize() const
Definition: PolyLine.cpp:348
ge::VBOVertex3d getPoint(int _input) const
Definition: PolyLine.cpp:282
unsigned int getPointCount() const
Definition: PolyLine.cpp:303
void setData(const double *points)
Definition: PolyLine.cpp:244
void printAll()
Definition: PolyLine.cpp:329
void print()
Definition: PolyLine.cpp:321
unsigned int * additionalPointSizes
Definition: PolyLine.h:91
void allocateMemory(int _pointCount)
Definition: PolyLine.cpp:195
double * data
Definition: PolyLine.h:103
const double * getArray() const
Definition: PolyLine.cpp:286