vrecko
virtual reality framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
BrushStroke.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "PoA.h"
4 #include "ColorGen.h"
5 #include "SweepSurface.h"
6 #include "ColorGenAdapter.h"
7 #include "DiameterGenAdapter.h"
8 #include "SplineAdapter.h"
9 #include "InterpolatedSpline.h"
10 #include "Utils.h"
11 #include "Brush.h"
12 #include "TimeLineSpline.h"
14 
15 
16 using namespace vrecko;
17 
18 namespace APDYNAMICART
19 {
20 
21 
22 
24 
38 class BrushStroke : public PoA, public Stroke
39 {
40 public:
41 
42  //TODO ask Martin - what about pointers, referenced pointers, references, ... here?
43  BrushStroke( Controller* contr, BrushPtr brush );
44  ~BrushStroke();
45 
46 
47  virtual void createMenuStructure( osg::ref_ptr<vreckoUtils::MenuBase> parentMenu ) const;
48 
50  void exportToFile(std::string file);
51 
52  double getDuration();
53 
54  inline double getRealStartTime() { return _StartTime; }
55  inline double getComputedStartTime() { return _computedStrokeStartTime; }
56 
58  virtual Vec3ArrayPtr getPositionSamples() const { return this->_samplesPositions; }
59  virtual Vec4ArrayPtr getOrientationSamples() const { return this->_samplesOrientations; }
60  virtual osg::ref_ptr<osg::DoubleArray> getTimeStamps() const { return this->_samplesTimeStamps; }
61  virtual SplinePtr getLeadingSpline() const { return _leadingSpline; }
62 
63  void GUIItemClicked(const char* itemID);
64 
65  void GUISliderChanged(const char* sliderID, float sliderPos);
66 
67  // probably for importing data in some older format
68  void importControlPoints( std::vector<osg::Vec3> * samples, std::vector<osg::Vec4> * colours, double diameter, int usize );
69 
70  int load(XERCES_CPP_NAMESPACE_QUALIFIER DOMNode* BrushStrokeNode);
71 
72  void playback( double playbackTime );
73 
74  void pointed(bool pointed);
75 
76 
78  void save(XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument* Document, XERCES_CPP_NAMESPACE_QUALIFIER DOMNode* poaNode);
79 
80  //sets
81 
82  void setLeadingSpline(InterpolatedSplinePtr val) { _leadingSpline = val; }
83  void setCrossSectionInterpolation(int interpol);
84  void setCrossSectionType(int type);
85  void setInterpolationSteps(int interpol);
86  void setSmoothness(double smooth);
87 
88  void setComputedTime(double newTime) { _computedStrokeStartTime = newTime; }
89 
91  void switchRenderingMethod();
92 
93  void update(void);
94 
96  void visualizeControlPoints(bool show);
97 
98  DECLARE_INPUT(Colour, MessageVec4);
99 protected:
100 
103 
105 
107 
109  DoubleArrayPtr _samplesTimeStamps;
110 
113 
114 
116  double _StartTime;
117 
120 
122  SplinePtr _leadingSpline;
123 
126 
129 
132 
135 
138 
141 
142  //for direct evocation of color picker
143  DECLARE_REQUEST_OUTPUT(EvokeHSLColorPicker, MessageString, MessageBool);
144 };
145 
146 }
147 
148